quran-madina-html 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -60,6 +60,9 @@
|
|
|
60
60
|
div.innerHTML = htmlString.trim();
|
|
61
61
|
return div.firstChild;
|
|
62
62
|
}
|
|
63
|
+
function print(str){
|
|
64
|
+
console.log(`${name}> ${str}`);
|
|
65
|
+
}
|
|
63
66
|
function copyToClipboard(){
|
|
64
67
|
textWithHeader = this.parentElement.parentElement.innerText.split("\n");
|
|
65
68
|
if(textWithHeader.length > 1){
|
|
@@ -68,7 +71,6 @@
|
|
|
68
71
|
let sura_index = this.parentElement.parentElement.getAttribute("sura");
|
|
69
72
|
text = textWithHeader[0]+ "\n\n" + madina_data.suras[sura_index-1].name;
|
|
70
73
|
}
|
|
71
|
-
|
|
72
74
|
navigator.clipboard.writeText(text);
|
|
73
75
|
alert("\u2398 تم نسخ:\n\n" + text);
|
|
74
76
|
}
|
|
@@ -77,7 +79,7 @@
|
|
|
77
79
|
var doc_name = this_script.getAttribute('data-name') || "Madina05";
|
|
78
80
|
var doc_font = (this_script.getAttribute('data-font') || "Hafs").replaceAll(" ","%");
|
|
79
81
|
var doc_font_sz = this_script.getAttribute('data-font-size') || 16;
|
|
80
|
-
|
|
82
|
+
print(`${doc_name} with font: ${doc_font} size: ${doc_font_sz}`);
|
|
81
83
|
const name_css = cdn+"dist/"+name+".min.css?v=1.1";
|
|
82
84
|
if (!document.getElementById(name))
|
|
83
85
|
{
|
|
@@ -112,7 +114,7 @@
|
|
|
112
114
|
this.xtag.data.page = value;
|
|
113
115
|
},
|
|
114
116
|
get: function(){
|
|
115
|
-
return this.getAttribute("page")
|
|
117
|
+
return this.getAttribute("page");
|
|
116
118
|
}
|
|
117
119
|
},
|
|
118
120
|
aya:{
|
|
@@ -136,20 +138,33 @@
|
|
|
136
138
|
},
|
|
137
139
|
methods: {
|
|
138
140
|
render: function(tag){
|
|
139
|
-
|
|
141
|
+
var sura;
|
|
142
|
+
var multiline;
|
|
143
|
+
var aya_from;
|
|
144
|
+
var aya_to;
|
|
145
|
+
var line_from;
|
|
146
|
+
var line_to;
|
|
140
147
|
if(this.sura != null && this.aya != null ){
|
|
141
148
|
sura = parseSuraRange(this.sura)[0]; // Only a single Sura
|
|
142
149
|
multiline = false;
|
|
143
150
|
[aya_from,aya_to] = parseAyaRange(this.aya);
|
|
144
|
-
|
|
145
|
-
line_to = madina_data.suras[sura].ayas[aya_to].r.slice(-1)[0].l;
|
|
151
|
+
if(this.page != null) print("Ignoring page parameter!");
|
|
146
152
|
} else if(this.page != null){
|
|
147
|
-
|
|
153
|
+
/* Search: only works within a single sura */
|
|
154
|
+
sura = 0; aya_from=1; aya_to=0;
|
|
155
|
+
while(madina_data.suras[sura].ayas[0].p < this.page) sura = sura + 1;
|
|
156
|
+
sura = sura -1;
|
|
157
|
+
while(madina_data.suras[sura].ayas[aya_from].p < this.page) aya_from = aya_from + 1;
|
|
158
|
+
aya_to = aya_from;
|
|
159
|
+
while(madina_data.suras[sura].ayas[aya_to].p == this.page) aya_to = aya_to + 1;
|
|
160
|
+
aya_to = aya_to -1;
|
|
161
|
+
multiline = true;
|
|
148
162
|
} else{
|
|
149
|
-
console.error(
|
|
163
|
+
console.error(`${name}> Bad arguments: Not rendering!`);
|
|
150
164
|
return 1;
|
|
151
165
|
}
|
|
152
|
-
|
|
166
|
+
line_from = madina_data.suras[sura].ayas[aya_from].r[0].l;
|
|
167
|
+
line_to = madina_data.suras[sura].ayas[aya_to].r.slice(-1)[0].l;
|
|
153
168
|
if(line_from!=line_to){
|
|
154
169
|
multiline = true;
|
|
155
170
|
tag.style = "display:block;";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
quran-madina-html{--qmh-background:#F5F5DC;--qmh-header:#696969;display:inline-flex;background-color:var(--qmh-background);border-radius:5px;overflow:hidden}quran-madina-html-header{background-color:var(--qmh-header);font-size:smaller;display:block;padding:0 5px 0 10px;color:var(--qmh-background)}quran-madina-html-copy{background-color:var(--qmh-header);display:inline-block;padding:0 5px;margin-right:3px}quran-madina-html-line{text-align:right;white-space:nowrap;transform-origin:top right;margin-right:5px
|
|
1
|
+
quran-madina-html{--qmh-background:#F5F5DC;--qmh-header:#696969;display:inline-flex;background-color:var(--qmh-background);border-radius:5px;overflow:hidden}quran-madina-html-header{background-color:var(--qmh-header);font-size:smaller;display:block;padding:0 5px 0 10px;color:var(--qmh-background)}quran-madina-html-copy{background-color:var(--qmh-header);display:inline-block;padding:0 5px;margin-right:3px}quran-madina-html-line{text-align:right;white-space:nowrap;transform-origin:top right;margin-right:5px}.quran-madina-html-part{transition:background-color .7s ease}svg.quran-madina-html-icon{float:left;padding-top:2px}svg.quran-madina-html-icon path{fill:var(--qmh-background)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! quran-madina-html 31-08-2023 */
|
|
2
|
-
!function(){var v="quran-madina-html",e=`https://www.unpkg.com/${v}/`;function g(){var e=document.createElement("div");return e.innerHTML='<svg viewBox="0 0 24 24" class="quran-madina-html-icon" width="20px"><path d="M16.02 20.96H3.78c-.41 0-.75-.34-.75-.75V7.74c0-.41.34-.75.75-.75h7.87c.21 0 .39.08.53.22l4.37 4.37c.14.14.22.32.22.53v8.11c0 .4-.34.74-.75.74ZM4.53 19.47h10.75v-6.61h-3.62c-.41 0-.75-.34-.75-.75V8.48H4.53v10.99Z"></path><path d="m20.74 7.63-4.37-4.37c-.14-.14-.36-.2-.53-.22H8.01c-.41 0-.75.34-.75.75V5.5h1.49v-.97h6.34v3.62c0 .41.34.75.75.75h3.62v8.19h-1.2v1.49h1.95c.41 0 .75-.34.75-.75V8.16c0-.21-.08-.4-.22-.53Z"></path></svg>'.trim(),e.firstChild}function y(){var e;textWithHeader=this.parentElement.parentElement.innerText.split("\n"),text=1<textWithHeader.length?textWithHeader.slice(1).join(" ")+"\n\n"+textWithHeader[0]:(e=this.parentElement.parentElement.getAttribute("sura"),textWithHeader[0]+"\n\n"+b.suras[e-1].name),navigator.clipboard.writeText(text),alert("⎘ تم نسخ:\n\n"+text)}var t,n,r,o,i,b={content:"Loading .."},a=document.currentScript||document.querySelector(`script[src*="${v}"]`),s=a.getAttribute("data-name")||"Madina05",c=(a.getAttribute("data-font")||"Hafs").replaceAll(" ","%"),a=a.getAttribute("data-font-size")||16;console.log(`Quran> ${s} with font: ${c} size: `+a);document.getElementById(v)||(n=document.getElementsByTagName("head")[0],(t=document.createElement("link")).id=v,t.rel="stylesheet",t.type="text/css",t.href="https://www.unpkg.com/quran-madina-html/dist/quran-madina-html.min.css?v=1.1",t.media="all",n.appendChild(t)),n=e+`assets/db/${s}-${c}-${a}px.json`,r=function(e){b=e;const t=new FontFace(b.font_family,"url("+encodeURI(b.font_url)+")");t.load().then(()=>{document.fonts.add(t)}),xtag.register(v,{lifecycle:{created:function(){this.render(this)},inserted:function(){},removed:function(){},attributeChanged:function(){}},events:{},accessors:{page:{attribute:{},set:function(e){this.xtag.data.page=e},get:function(){return this.getAttribute("page")||-1}},aya:{attribute:{},set:function(e){this.xtag.data.aya=e},get:function(){return this.getAttribute("aya")}},sura:{attribute:{},set:function(e){this.xtag.data.sura=e},get:function(){return this.getAttribute("sura")}}},methods:{render:function(t){let n=0,r=!1,o=0,i=0,a=0,s=0;if(null!=this.sura&&null!=this.aya)n=(p=this.sura,Array(2).fill(p.split("-")[0]-1)[0]),r=!1,[o,i]=2==(p=this.aya).split("-").length?p.split("-").map(e=>parseInt(e)+1):Array(2).fill(parseInt(p.split("-")[0])+1),a=b.suras[n].ayas[o].r[0].l,s=b.suras[n].ayas[i].r.slice(-1)[0].l;else if(null==this.page)return console.error("Bad arguments for quran-madina-html: Not renderring!"),1;a!=s&&(r=!0,t.style="display:block;"),r&&(t.style.setProperty("font-family",b.font_family,""),t.style.setProperty("font-size",b.font_size+"px",""),"me_quran"===b.font_family)&&t.style.setProperty("line-height",2*b.font_size+"px","");var c,u,l,d,h,e,p="",m=(r&&((p=document.createElement("quran-madina-html-header")).innerHTML=b.suras[n].name,(e=g()).setAttribute("data-copy-sura",n),e.setAttribute("data-copy-aya-from",o),e.setAttribute("data-copy-aya-to",i),e.addEventListener("click",y),p.appendChild(e),t.appendChild(p)),o);for(let e=a;e<=s;e++){const f=e;line=document.createElement("quran-madina-html-line"),t.appendChild(line),r||(line.style.setProperty("font-family",b.font_family,""),line.style.setProperty("font-size",b.font_size+"px","")),r&&(t.style.width=b.line_width+10+"px",c=b.suras[n].ayas[o].p%2==1?"":"-",t.style.setProperty("box-shadow","inset "+c+"8px 0 7px -7px #333",""),line.style.setProperty("display","block",""));for(let e=m;e<m+5&&e<=i;e++)(line_match=b.suras[n].ayas[e].r.filter(e=>e.l==f)).length&&(r&&(""==line.innerHTML.trim()&&(u=line_match[0].o,line.style.setProperty("padding-right",u+"px",""),0<u)&&line.style.setProperty("transform-origin","left"),0<=line_match[0].s?line.style.setProperty("transform",`scaleX(${line_match[0].s})`,""):line.style.setProperty("text-align","center","")),u=document.createElement("div"),l=n+1,d=e-1,l=[v+"-part",v+`-${(h=(e,t)=>String(e).padStart(t,"0"))(l,3)}-`+h(d,3)],DOMTokenList.prototype.add.apply(u.classList,l),u.textContent=line_match[0].t,u.style.cssText="display:inline",line.appendChild(u),function(e,t="class",n="lightgrey",r="transparent"){var o="tag"===t.toLowerCase()?document.getElementsByTagName(e):document.getElementsByClassName(e);Array.from(o).forEach(function(e){e.onmouseover=function(){Array.from(o).forEach(function(e){e.style.backgroundColor=n})},e.onmouseout=function(){Array.from(o).forEach(function(e){e.style.backgroundColor=r})}})}(l.slice(-1)[0]),m=e)}r||(p=document.createElement("quran-madina-html-copy"),(e=g()).setAttribute("data-copy-sura",n),e.setAttribute("data-copy-aya-from",o),e.setAttribute("data-copy-aya-to",i),e.addEventListener("click",y),p.appendChild(e),t.appendChild(p))}}})},o=function(e){console.error(e)},(i=new XMLHttpRequest).onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(200===i.status?r&&r(JSON.parse(i.responseText)):o&&o(i))},i.open("GET",n,!0),i.send()}(),function(){function e(e){if((this._element=e).className!=this._classCache&&(this._classCache=e.className,this._classCache))for(var t=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/),n=0;t.length>n;n++)o.call(this,t[n])}function t(e,t){e.className=t.join(" ")}var n,r,o,i,a,s,c,u;void 0===window.Element||"classList"in document.documentElement||(s=Array.prototype,n=s.indexOf,r=s.slice,o=s.push,i=s.splice,a=s.join,e.prototype={add:function(e){this.contains(e)||(o.call(this,e),t(this._element,r.call(this,0)))},contains:function(e){return-1!==n.call(this,e)},item:function(e){return this[e]||null},remove:function(e){e=n.call(this,e);-1!==e&&(i.call(this,e,1),t(this._element,r.call(this,0)))},toString:function(){return a.call(this," ")},toggle:function(e){-1===n.call(this,e)?this.add(e):this.remove(e)}},window.DOMTokenList=e,s=Element.prototype,c="classList",u=function(){return new e(this)},Object.defineProperty?Object.defineProperty(s,c,{get:u}):s.__defineGetter__(c,u))}(),function(){window.WebComponents=window.WebComponents||{flags:{}};var e,t=document.querySelector('script[src*="webcomponents-lite.js"]'),n={};if(!n.noOpts){if(location.search.slice(1).split("&").forEach(function(e){var t,e=e.split("=");e[0]&&(t=e[0].match(/wc-(.+)/))&&(n[t[1]]=e[1]||!0)}),t)for(var r,o=0;r=t.attributes[o];o++)"src"!==r.name&&(n[r.name]=r.value||!0);n.log&&n.log.split?(e=n.log.split(","),n.log={},e.forEach(function(e){n.log[e]=!0})):n.log={}}n.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=n.register),WebComponents.flags=n}(),function(e){"use strict";function g(e){return void 0!==_[e]}function y(){r.call(this),this._isInvalid=!0}function b(e){return""==e&&y.call(this),e.toLowerCase()}function w(e){var t=e.charCodeAt(0);return 32<t&&t<127&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function n(e,t,n){function r(e){d.push(e)}var o,i,a=t||"scheme start",s=0,c="",u=!1,l=!1,d=[];e:for(;(e[s-1]!=T||0==s)&&!this._isInvalid;){var h=e[s];switch(a){case"scheme start":if(!h||!M.test(h)){if(t){r("Invalid scheme.");break e}c="",a="no scheme";continue}c+=h.toLowerCase(),a="scheme";break;case"scheme":if(h&&L.test(h))c+=h.toLowerCase();else{if(":"!=h){if(t){if(T==h)break e;r("Code point not allowed in scheme: "+h);break e}c="",s=0,a="no scheme";continue}if(this._scheme=c,c="",t)break e;g(this._scheme)&&(this._isRelative=!0),a="file"==this._scheme?"relative":this._isRelative&&n&&n._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==h?(this._query="?",a="query"):"#"==h?(this._fragment="#",a="fragment"):T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._schemeData+=w(h));break;case"no scheme":if(n&&g(n._scheme)){a="relative";continue}r("Missing scheme."),y.call(this);break;case"relative or authority":if("/"!=h||"/"!=e[s+1]){r("Expected /, got: "+h),a="relative";continue}a="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=n._scheme),T==h){this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query=n._query,this._username=n._username,this._password=n._password;break e}if("/"==h||"\\"==h)"\\"==h&&r("\\ is an invalid code point."),a="relative slash";else if("?"==h)this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query="?",this._username=n._username,this._password=n._password,a="query";else{if("#"!=h){var p=e[s+1],m=e[s+2];("file"!=this._scheme||!M.test(h)||":"!=p&&"|"!=p||T!=m&&"/"!=m&&"\\"!=m&&"?"!=m&&"#"!=m)&&(this._host=n._host,this._port=n._port,this._username=n._username,this._password=n._password,this._path=n._path.slice(),this._path.pop()),a="relative path";continue}this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query=n._query,this._fragment="#",this._username=n._username,this._password=n._password,a="fragment"}break;case"relative slash":if("/"!=h&&"\\"!=h){"file"!=this._scheme&&(this._host=n._host,this._port=n._port,this._username=n._username,this._password=n._password),a="relative path";continue}"\\"==h&&r("\\ is an invalid code point."),a="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=h){r("Expected '/', got: "+h),a="authority ignore slashes";continue}a="authority second slash";break;case"authority second slash":if(a="authority ignore slashes","/"==h)break;r("Expected '/', got: "+h);continue;case"authority ignore slashes":if("/"!=h&&"\\"!=h){a="authority";continue}r("Expected authority, got: "+h);break;case"authority":if("@"==h){u&&(r("@ already seen."),c+="%40");for(var u=!0,f=0;c.length>f;f++){var v=c[f];"\t"!=v&&"\n"!=v&&"\r"!=v?":"!=v||null!==this._password?(v=w(v),null!==this._password?this._password+=v:this._username+=v):this._password="":r("Invalid whitespace in authority.")}c=""}else{if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){s-=c.length,c="",a="host";continue}c+=h}break;case"file host":if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){a=2!=c.length||!M.test(c[0])||":"!=c[1]&&"|"!=c[1]?(0==c.length||(this._host=b.call(this,c),c=""),"relative path start"):"relative path";continue}"\t"==h||"\n"==h||"\r"==h?r("Invalid whitespace in file host."):c+=h;break;case"host":case"hostname":if(":"!=h||l){if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){if(this._host=b.call(this,c),c="",a="relative path start",t)break e;continue}"\t"!=h&&"\n"!=h&&"\r"!=h?("["==h?l=!0:"]"==h&&(l=!1),c+=h):r("Invalid code point in host/hostname: "+h)}else if(this._host=b.call(this,c),c="",a="port","hostname"==t)break e;break;case"port":if(/[0-9]/.test(h))c+=h;else{if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h||t){if(""!=c&&((p=parseInt(c,10))!=_[this._scheme]&&(this._port=p+""),c=""),t)break e;a="relative path start";continue}"\t"==h||"\n"==h||"\r"==h?r("Invalid code point in port: "+h):y.call(this)}break;case"relative path start":if("\\"==h&&r("'\\' not allowed in path."),a="relative path","/"!=h&&"\\"!=h)continue;break;case"relative path":T!=h&&"/"!=h&&"\\"!=h&&(t||"?"!=h&&"#"!=h)?"\t"!=h&&"\n"!=h&&"\r"!=h&&(c+=w(h)):("\\"==h&&r("\\ not allowed in relative path."),".."==(c=(m=E[c.toLowerCase()])?m:c)?(this._path.pop(),"/"!=h&&"\\"!=h&&this._path.push("")):"."==c&&"/"!=h&&"\\"!=h?this._path.push(""):"."!=c&&("file"==this._scheme&&0==this._path.length&&2==c.length&&M.test(c[0])&&"|"==c[1]&&(c=c[0]+":"),this._path.push(c)),c="","?"==h?(this._query="?",a="query"):"#"==h&&(this._fragment="#",a="fragment"));break;case"query":t||"#"!=h?T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._query+=(i=void 0,32<(i=(o=h).charCodeAt(0))&&i<127&&-1==[34,35,60,62,96].indexOf(i)?o:encodeURIComponent(o))):(this._fragment="#",a="fragment");break;case"fragment":T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._fragment+=h)}s++}}function r(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function o(e,t){void 0===t||t instanceof o||(t=new o(t+"")),this._url=e,r.call(this);e=e.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");n.call(this,e,null,t)}var _,E,T,M,L,t,i=!1;if(!e.forceJURL)try{var a=new URL("b","http://a");a.pathname="c%20d",i="http://a/c%20d"===a.href}catch(e){}i||((_=Object.create(null)).ftp=21,_.file=0,_.gopher=70,_.http=80,_.https=443,_.ws=80,_.wss=443,(E=Object.create(null))["%2e"]=".",E[".%2e"]="..",E["%2e."]="..",T=void(E["%2e%2e"]=".."),M=/[a-zA-Z]/,L=/[a-zA-Z0-9\+\-\.]/,o.prototype={toString:function(){return this.href},get href(){var e;return this._isInvalid?this._url:((e="")==this._username&&null==this._password||(e=this._username+(null!=this._password?":"+this._password:"")+"@"),this.protocol+(this._isRelative?"//"+e+this.host:"")+this.pathname+this._query+this._fragment)},set href(e){r.call(this),n.call(this,e)},get protocol(){return this._scheme+":"},set protocol(e){this._isInvalid||n.call(this,e+":","scheme start")},get host(){return this._isInvalid?"":this._port?this._host+":"+this._port:this._host},set host(e){!this._isInvalid&&this._isRelative&&n.call(this,e,"host")},get hostname(){return this._host},set hostname(e){!this._isInvalid&&this._isRelative&&n.call(this,e,"hostname")},get port(){return this._port},set port(e){!this._isInvalid&&this._isRelative&&n.call(this,e,"port")},get pathname(){return this._isInvalid?"":this._isRelative?"/"+this._path.join("/"):this._schemeData},set pathname(e){!this._isInvalid&&this._isRelative&&(this._path=[],n.call(this,e,"relative path start"))},get search(){return this._isInvalid||!this._query||"?"==this._query?"":this._query},set search(e){!this._isInvalid&&this._isRelative&&((this._query="?")==e[0]&&(e=e.slice(1)),n.call(this,e,"query"))},get hash(){return this._isInvalid||!this._fragment||"#"==this._fragment?"":this._fragment},set hash(e){this._isInvalid||((this._fragment="#")==e[0]&&(e=e.slice(1)),n.call(this,e,"fragment"))},get origin(){var e;if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}return(e=this.host)?this._scheme+"://"+e:""}},(t=e.URL)&&(o.createObjectURL=function(){return t.createObjectURL.apply(t,arguments)},o.revokeObjectURL=function(e){t.revokeObjectURL(e)}),e.URL=o)}(self),"undefined"==typeof WeakMap&&function(){function e(){this.name="__st"+(1e9*Math.random()>>>0)+t+++"__"}var r=Object.defineProperty,t=Date.now()%1e9;e.prototype={set:function(e,t){var n=e[this.name];return n&&n[0]===e?n[1]=t:r(e,this.name,{value:[e,t],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},delete:function(e){var t=e[this.name];return!(!t||t[0]!==e||(t[0]=t[1]=void 0))},has:function(e){var t=e[this.name];return!!t&&t[0]===e}},window.WeakMap=e}(),function(e){function o(){p=!1;var e=m,r=(m=[],e.sort(function(e,t){return e.uid_-t.uid_}),!1);e.forEach(function(e){var t,n=e.takeRecords();(t=e).nodes_.forEach(function(e){e=s.get(e);e&&e.forEach(function(e){e.observer===t&&e.removeTransientObservers()})}),n.length&&(e.callback_(n,e),r=!0)}),r&&o()}function u(e,t){for(var n=e;n;n=n.parentNode){var r=s.get(n);if(r)for(var o=0;r.length>o;o++){var i=r[o],a=i.options;(n===e||a.subtree)&&(a=t(a))&&i.enqueue(a)}}}function t(e){this.callback_=e,this.nodes_=[],this.records_=[],this.uid_=++f}function r(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 l(e,t){return v=new r(e,t)}function d(e){return g||((n=new r((t=v).type,t.target)).addedNodes=t.addedNodes.slice(),n.removedNodes=t.removedNodes.slice(),n.previousSibling=t.previousSibling,n.nextSibling=t.nextSibling,n.attributeName=t.attributeName,n.attributeNamespace=t.attributeNamespace,n.oldValue=t.oldValue,(g=n).oldValue=e,g);var t,n}function i(e,t){return e===t?e:g&&((t=e)===g||t===v)?g:null}function a(e,t,n){this.observer=e,this.target=t,this.options=n,this.transientObservedNodes=[]}var s,n,c,h,p,m,f,v,g;e.JsMutationObserver||(s=new WeakMap,h=/Trident|Edge/.test(navigator.userAgent)?setTimeout:window.setImmediate||(n=[],c=Math.random()+"",window.addEventListener("message",function(e){e.data===c&&(e=n,n=[],e.forEach(function(e){e()}))}),function(e){n.push(e),window.postMessage(c,"*")}),p=!1,m=[],f=0,t.prototype={observe:function(e,t){if(n=e,e=window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(n)||n,!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,r=s.get(e);r||s.set(e,r=[]);for(var o,i=0;r.length>i;i++)if(r[i].observer===this){(o=r[i]).removeListeners(),o.options=t;break}o||(o=new a(this,e,t),r.push(o),this.nodes_.push(e)),o.addListeners()},disconnect:function(){this.nodes_.forEach(function(e){for(var t=s.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}},a.prototype={enqueue:function(e){var t=this.observer.records_,n=t.length;if(0<t.length){var r=i(t[n-1],e);if(r)return void(t[n-1]=r)}else r=this.observer,m.push(r),p||(p=!0,h(o));t[n]=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){var t;e!==this.target&&(this.addListeners_(e),this.transientObservedNodes.push(e),(t=s.get(e))||s.set(e,t=[]),t.push(this))},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=s.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=((i=new l("attributes",r)).attributeName=t,i.attributeNamespace=n,e.attrChange===MutationEvent.ADDITION?null:e.prevValue);u(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?d(o):i});break;case"DOMCharacterDataModified":var i=l("characterData",r=e.target),o=e.prevValue;u(r,function(e){return e.characterData?e.characterDataOldValue?d(o):i:void 0});break;case"DOMNodeRemoved":this.addTransientObserver(e.target);case"DOMNodeInserted":var a,r=e.target,s="DOMNodeInserted"===e.type?(a=[r],[]):(a=[],[r]),c=r.previousSibling,r=r.nextSibling;(i=l("childList",e.target.parentNode)).addedNodes=a,i.removedNodes=s,i.previousSibling=c,i.nextSibling=r,u(e.relatedNode,function(e){return e.childList?i:void 0})}v=g=void 0}},e.JsMutationObserver=t,e.MutationObserver)||((e.MutationObserver=t)._isPolyfilled=!0)}(self),"undefined"==typeof HTMLTemplateElement&&function(){function n(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case" ":return" "}}var r=document.implementation.createHTMLDocument("template"),o=!0,t=((HTMLTemplateElement=function(){}).prototype=Object.create(HTMLElement.prototype),HTMLTemplateElement.decorate=function(e){if(!e.content){e.content=r.createDocumentFragment();for(var t;t=e.firstChild;)e.content.appendChild(t);if(o)try{Object.defineProperty(e,"innerHTML",{get:function(){for(var e="",t=this.content.firstChild;t;t=t.nextSibling)e+=t.outerHTML||t.data.replace(i,n);return e},set:function(e){for(r.body.innerHTML=e,HTMLTemplateElement.bootstrap(r);this.content.firstChild;)this.content.removeChild(this.content.firstChild);for(;r.body.firstChild;)this.content.appendChild(r.body.firstChild)},configurable:!0})}catch(e){o=!1}HTMLTemplateElement.bootstrap(e.content)}},HTMLTemplateElement.bootstrap=function(e){for(var t,n=e.querySelectorAll("template"),r=0,o=n.length;r<o&&(t=n[r]);r++)HTMLTemplateElement.decorate(t)},document.addEventListener("DOMContentLoaded",function(){HTMLTemplateElement.bootstrap(document)}),document.createElement),i=(document.createElement=function(){"use strict";var e=t.apply(document,arguments);return"template"==e.localName&&HTMLTemplateElement.decorate(e),e},/[&\u00A0<>]/g)}(),function(){"use strict";var e,t;window.performance||(e=Date.now(),window.performance={now:function(){return Date.now()-e}}),window.requestAnimationFrame||(window.requestAnimationFrame=(t=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)?function(e){return t(function(){e(performance.now())})}:function(e){return window.setTimeout(e,1e3/60)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}),(r=document.createEvent("Event")).initEvent("foo",!0,!0),r.preventDefault();r.defaultPrevented||(n=Event.prototype.preventDefault,Event.prototype.preventDefault=function(){this.cancelable&&(n.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))});var n,r=/Trident/.test(navigator.userAgent);(!window.CustomEvent||r&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,Boolean(t.bubbles),Boolean(t.cancelable),t.detail),n},window.CustomEvent.prototype=window.Event.prototype),(!window.Event||r&&"function"!=typeof window.Event)&&(r=window.Event,window.Event=function(e,t){t=t||{};var n=document.createEvent("Event");return n.initEvent(e,Boolean(t.bubbles),Boolean(t.cancelable)),n},window.Event.prototype=r.prototype)}(window.WebComponents),window.HTMLImports=window.HTMLImports||{flags:{}},function(e){function t(e,t){(function e(t,n){{var r;o(n)?t&&t():(r=function(){"complete"!==n.readyState&&n.readyState!==s||(n.removeEventListener(c,r),e(t,n))},n.addEventListener(c,r))}})(function(){!function(e,t){function n(){a==s&&e&&e({allImports:i,loadedImports:c,errorImports:u})}function r(e){h(e),c.push(this),a++,n()}function o(){u.push(this),a++,n()}var i=t.querySelectorAll("link[rel=import]"),a=0,s=i.length,c=[],u=[];if(s)for(var l,d=0;d<s&&(l=i[d]);d++)!function(e){return p?e.__loaded||e.import&&"loading"!==e.import.readyState:e.__importParsed}(l)?(l.addEventListener("load",r),l.addEventListener("error",o)):(c.push(this),a++,n());else n()}(e,t)},t=t||i)}function o(e){return"complete"===e.readyState||e.readyState===s}function h(e){e.target.__loaded=!0}function u(e){e.import?h({target:e}):(e.addEventListener("load",h),e.addEventListener("error",h))}function n(e){return r?window.ShadowDOMPolyfill.wrapIfNeeded(e):e}var p=Boolean("import"in document.createElement("link")),r=Boolean(window.ShadowDOMPolyfill),i=n(document),a={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return n(e)},configurable:!0},a=(Object.defineProperty(document,"_currentScript",a),Object.defineProperty(i,"_currentScript",a),/Trident/.test(navigator.userAgent)),s=a?"complete":"interactive",c="readystatechange";if(p&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;n<r&&(t=e[n]);n++)if(t.addedNodes){o=void 0;i=void 0;s=void 0;c=void 0;a=void 0;var o=t.addedNodes;for(var i,a,s=0,c=o.length;s<c&&(i=o[s]);s++)"link"===(a=i).localName&&"import"===a.rel&&u(i)}}).observe(document.head,{childList:!0}),"loading"===document.readyState))for(var l,d=document.querySelectorAll("link[rel=import]"),m=0,f=d.length;m<f&&(l=d[m]);m++)u(l);t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=i.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),i.dispatchEvent(t)}),e.IMPORT_LINK_TYPE="import",e.useNative=p,e.rootDocument=i,e.whenReady=t,e.isIE=a}(window.HTMLImports),function(t){var n=[];t.addModule=function(e){n.push(e)},t.initializeModules=function(){n.forEach(function(e){e(t)})}}(window.HTMLImports),window.HTMLImports.addModule(function(e){var r=/(url\()([^)]*)(\))/g,o=/(@import[\s]+(?!url\())([^;]*)(;)/g;e.path={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,n),e},resolveUrlsInCssText:function(e,t,n){e=this.replaceUrls(e,n,t,r);return this.replaceUrls(e,n,t,o)},replaceUrls:function(e,o,i,t){return e.replace(t,function(e,t,n,r){n=n.replace(/["']/g,"");return i&&(n=new URL(n,i).href),o.href=n,t+"'"+(n=o.href)+"'"+r})}}}),window.HTMLImports.addModule(function(t){var a={async:!0,ok:function(e){return 200<=e.status&&e.status<300||304===e.status||0===e.status},load:function(e,r,o){var i=new XMLHttpRequest;return(t.flags.debug||t.flags.bust)&&(e+="?"+Math.random()),i.open("GET",e,a.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var t=null;try{var n=i.getResponseHeader("Location");n&&(t="/"===n.substr(0,1)?location.origin+n:n)}catch(e){console.error(e.message)}r.call(o,!a.ok(i)&&i,i.response||i.responseText,t)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};t.xhr=a}),window.HTMLImports.addModule(function(e){function t(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}}var i=e.xhr,a=e.flags;t.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;n<r&&(t=e[n]);n++)this.require(t);this.checkDone()},addNode:function(e){this.inflight++,this.require(e),this.checkDone()},require:function(e){var t=e.src||e.href;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,this.cache[e]),this.tail(),!0):!(this.pending[e]=[t])},fetch:function(r,o){var e,t,n;a.load&&console.log("fetch",r,o),r?r.match(/^data:/)?(e=(n=r.split(","))[0],t=n[1],t=(-1<e.indexOf(";base64")?atob:decodeURIComponent)(t),setTimeout(function(){this.receive(r,o,null,t)}.bind(this),0)):(n=function(e,t,n){this.receive(r,o,e,t,n)}.bind(this),i.load(r,n)):setTimeout(function(){this.receive(r,o,{error:"href must be specified"},null)}.bind(this),0)},receive:function(e,t,n,r,o){this.cache[e]=r;for(var i,a=this.pending[e],s=0,c=a.length;s<c&&(i=a[s]);s++)this.onload(e,i,r,n,o),this.tail();this.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},e.Loader=t}),window.HTMLImports.addModule(function(e){function t(e){this.addCallback=e,this.mo=new MutationObserver(this.handler.bind(this))}t.prototype={handler:function(e){for(var t,n=0,r=e.length;n<r&&(t=e[n]);n++)"childList"===t.type&&t.addedNodes.length&&this.addedNodes(t.addedNodes)},addedNodes:function(e){this.addCallback&&this.addCallback(e);for(var t,n=0,r=e.length;n<r&&(t=e[n]);n++)t.children&&t.children.length&&this.addedNodes(t.children)},observe:function(e){this.mo.observe(e,{childList:!0,subtree:!0})}},e.Observer=t}),window.HTMLImports.addModule(function(n){function a(e){return"link"===e.localName&&e.rel===s}function r(e){e=e.textContent+function(e){var t=e.ownerDocument,e=(t.__importedScripts=t.__importedScripts||0,e.ownerDocument.baseURI),n=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+e+n+".js\n"}(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(e)}var o=n.path,t=n.rootDocument,i=n.flags,u=n.isIE,s=n.IMPORT_LINK_TYPE,e="link[rel="+s+"]",c={documentSelectors:e,importsSelectors:[e,"link[rel=stylesheet]:not([type])","style:not([type])","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var e=this.nextToParse();e&&this.parse(e)},parse:function(e){var t;this.isParsed(e)?i.parse&&console.log("[%s] is already parsed",e.localName):(t=this[this.map[e.localName]])&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){i.parse&&console.log("parsing",e),this.parsingElement=e},markParsingComplete:function(e){e.__importParsed=!0,this.markDynamicParsingComplete(e),e.__importElement&&(e.__importElement.__importParsed=!0,this.markDynamicParsingComplete(e.__importElement)),this.parsingElement=null,i.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){e=this.dynamicElements.indexOf(e);0<=e&&this.dynamicElements.splice(e,1)},parseImport:function(e){if(e.import=e.__doc,window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e.import&&(e.import.__importParsed=!0),this.markParsingComplete(e),e.__resource&&!e.__error?e.dispatchEvent(new CustomEvent("load",{bubbles:!1})):e.dispatchEvent(new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)(t=e.__pending.shift())&&t({target:e});this.parseNext()},parseLink:function(e){a(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t,n,r=e;(n=(t=e).ownerDocument.createElement("style")).textContent=t.textContent,o.resolveUrlsInStyle(n),e=n,(r.__appliedElement=e).__importElement=r,this.parseGeneric(e)},parseGeneric:function(e){this.trackElement(e),this.addElementToDocument(e)},rootImportForElement:function(e){for(var t=e;t.ownerDocument.__importLink;)t=t.ownerDocument.__importLink;return t},addElementToDocument:function(e){var t=this.rootImportForElement(e.__importElement||e);t.parentNode.insertBefore(e,t)},trackElement:function(t,n){function r(e){t.removeEventListener("load",r),t.removeEventListener("error",r),n&&n(e),o.markParsingComplete(t),o.parseNext()}var o=this;if(t.addEventListener("load",r),t.addEventListener("error",r),u&&"style"===t.localName){var e=!1;if(-1==t.textContent.indexOf("@import"))e=!0;else if(t.sheet)for(var i,e=!0,a=t.sheet.cssRules,s=a?a.length:0,c=0;c<s&&(i=a[c]);c++)i.type===CSSRule.IMPORT_RULE&&(e=e&&Boolean(i.styleSheet));e&&setTimeout(function(){t.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(e){var t=document.createElement("script");t.__importElement=e,t.src=e.src||r(e),n.currentScript=e,this.trackElement(t,function(){t.parentNode&&t.parentNode.removeChild(t),n.currentScript=null}),this.addElementToDocument(t)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(t)||this.nextToParseDynamic())},nextToParseInDoc:function(e,t){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var n,r=e.querySelectorAll(this.parseSelectorsForNode(e)),o=0,i=r.length;o<i&&(n=r[o]);o++)if(!this.isParsed(n))return this.hasResource(n)?a(n)?this.nextToParseInDoc(n.__doc,n):n:void 0}return t},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){return(e.ownerDocument||e)===t?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return 0<=this.dynamicElements.indexOf(e)},hasResource:function(e){return!a(e)||void 0!==e.__doc}};n.parser=c,n.IMPORT_SELECTOR=e}),window.HTMLImports.addModule(function(e){function s(e,t){var n=document.implementation.createHTMLDocument(u),r=(n._URL=t,n.createElement("base")),t=(r.setAttribute("href",t),n.baseURI||Object.getOwnPropertyDescriptor(n,"baseURI")||Object.defineProperty(n,"baseURI",{value:t}),n.createElement("meta"));return t.setAttribute("charset","utf-8"),n.head.appendChild(t),n.head.appendChild(r),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var c=e.flags,u=e.IMPORT_LINK_TYPE,t=e.IMPORT_SELECTOR,n=e.rootDocument,r=e.Loader,o=e.Observer,l=e.parser,t={documents:{},documentPreloadSelectors:t,importsPreloadSelectors:[t].join(","),loadNode:function(e){i.addNode(e)},loadSubtree:function(e){e=this.marshalNodes(e);i.addNodes(e)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){return(e.ownerDocument||e)===n?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,t,n,r,o){var i,a;c.load&&console.log("loaded",e,t),t.__resource=n,t.__error=r,a=u,"link"===(i=i=t).localName&&i.getAttribute("rel")===a&&(void 0===(i=this.documents[e])&&((i=r?null:s(n,o||e))&&(i.__importLink=t,this.bootDocument(i)),this.documents[e]=i),t.__doc=i),l.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),l.parseNext()},loadedAll:function(){l.parseNext()}},i=new r(t.loaded.bind(t),t.loadedAll.bind(t));t.observer=new o,document.baseURI||(r={get:function(){var e=document.querySelector("base");return(e||window.location).href},configurable:!0},Object.defineProperty(document,"baseURI",r),Object.defineProperty(n,"baseURI",r)),e.importer=t,e.importLoader=i}),window.HTMLImports.addModule(function(e){var s=e.parser,c=e.importer,e={added:function(e){for(var t,n,r,o,i=0,a=e.length;i<a&&(o=e[i]);i++)t||(t=o.ownerDocument,n=s.isParsed(t)),(r=this.shouldLoadNode(o))&&c.loadNode(o),this.shouldParseNode(o)&&n&&s.parseDynamic(o,r)},shouldLoadNode:function(e){return 1===e.nodeType&&t.call(e,c.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&t.call(e,s.parseSelectorsForNode(e))}},t=(c.observer.addCallback=e.added.bind(e),HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector)}),function(e){function t(){window.HTMLImports.importer.bootDocument(n)}var n,r=e.initializeModules;e.isIE,e.useNative||(r(),n=e.rootDocument,"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t))}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(t){var e=t.flags,n=[];t.addModule=function(e){n.push(e)},t.initializeModules=function(){n.forEach(function(e){e(t)})},t.hasNative=Boolean(document.registerElement),t.isIE=/Trident/.test(navigator.userAgent),t.useNative=!e.register&&t.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function r(e,t){(function e(t,n,r){var o=t.firstElementChild;if(!o)for(o=t.firstChild;o&&o.nodeType!==Node.ELEMENT_NODE;)o=o.nextSibling;for(;o;)!0!==n(o,r)&&e(o,n,r),o=o.nextElementSibling;return null})(e,function(e){return!!t(e)||void n(e,t)}),n(e,t)}function n(e,t){for(var n=e.shadowRoot;n;)r(n,t),n=n.olderShadowRoot}var c=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=function(e,t){!function e(t,n,r){if(t=window.wrap(t),!(0<=r.indexOf(t))){r.push(t);for(var o,i=t.querySelectorAll("link[rel="+c+"]"),a=0,s=i.length;a<s&&(o=i[a]);a++)o.import&&e(o.import,n,r);n(t)}}(e,t,[])},e.forSubtree=r}),window.CustomElements.addModule(function(n){function a(e,t){return r(e,t)||o(e,t)}function r(e,t){return!!n.upgrade(e,t)||void(t&&s(e))}function o(e,t){f(e,function(e){return!!r(e,t)||void 0})}function t(e){b.push(e),y||(y=!0,setTimeout(i))}function i(){y=!1;for(var e,t=b,n=0,r=t.length;n<r&&(e=t[n]);n++)e();b=[]}function s(e){g?t(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&!e.__attached&&(e.__attached=!0,e.attachedCallback)&&e.attachedCallback()}function u(e){g?t(function(){l(e)}):l(e)}function l(e){e.__upgraded__&&e.__attached&&(e.__attached=!1,e.detachedCallback)&&e.detachedCallback()}function d(e,t){if(m.dom){var n=t[0];if(n&&"childList"===n.type&&n.addedNodes&&n.addedNodes){for(var r=n.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var o=(o=r&&(r.URL||r._URL||r.host&&r.host.localName)||"").split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",t.length,o||"")}var i=function(e){for(var t=e,n=window.wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}(e);t.forEach(function(e){"childList"===e.type&&(w(e.addedNodes,function(e){e.localName&&a(e,i)}),w(e.removedNodes,function(e){e.localName&&(u(e=e),f(e,function(e){u(e)}))}))}),m.dom&&console.groupEnd()}function h(e){var t;e.__observer||((t=new MutationObserver(d.bind(this,e))).observe(e,{childList:!0,subtree:!0}),e.__observer=t)}function p(e){e=window.wrap(e),m.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop()),a(e,e===window.wrap(document)),h(e),m.dom&&console.groupEnd()}var m=n.flags,f=n.forSubtree,v=n.forDocumentTree,g=window.MutationObserver._isPolyfilled&&m["throttle-attached"],y=(n.hasPolyfillMutations=g,n.hasThrottledAttached=g,!1),b=[],w=Array.prototype.forEach.call.bind(Array.prototype.forEach),_=Element.prototype.createShadowRoot;_&&(Element.prototype.createShadowRoot=function(){var e=_.call(this);return window.CustomElements.watchShadow(this),e}),n.watchShadow=function(e){if(e.shadowRoot&&!e.shadowRoot.__watched){m.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)h(t),t=t.olderShadowRoot}},n.upgradeDocumentTree=function(e){v(e,p)},n.upgradeDocument=p,n.upgradeSubtree=o,n.upgradeAll=a,n.attached=s,n.takeRecords=function(e){for(e=(e=window.wrap(e))||window.wrap(document);e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(d(e,t.takeRecords()),i())}}),window.CustomElements.addModule(function(o){function i(e,t,n){return a.upgrade&&console.group("upgrade:",e.localName),t.is&&e.setAttribute("is",t.is),r(e,t),e.__upgraded__=!0,(t=e).createdCallback&&t.createdCallback(),n&&o.attached(e),o.upgradeSubtree(e,n),a.upgrade&&console.groupEnd(),e}function r(e,t){if(!Object.__proto__)for(var n=e,r=t.prototype,o=t.native,i={},a=r;a!==o&&a!==HTMLElement.prototype;){for(var s,c=Object.getOwnPropertyNames(a),u=0;s=c[u];u++)i[s]||(Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(a,s)),i[s]=1);a=Object.getPrototypeOf(a)}e.__proto__=t.prototype}var a=o.flags;o.upgrade=function(e,t){if("template"===e.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(e),!e.__upgraded__&&e.nodeType===Node.ELEMENT_NODE){var n=e.getAttribute("is"),r=o.getRegisteredDefinition(e.localName)||o.getRegisteredDefinition(n);if(r&&(n&&r.tag==e.localName||!n&&!r.extends))return i(e,r,t)}},o.upgradeWithDefinition=i,o.implementPrototype=r}),window.CustomElements.addModule(function(m){function f(e,t,n){e=e.toLowerCase();var r=this.getAttribute(e),o=(n.apply(this,arguments),this.getAttribute(e));this.attributeChangedCallback&&o!==r&&this.attributeChangedCallback(e,r,o)}function v(e){return e?w[e.toLowerCase()]:void 0}function o(e,t){e=e&&e.toLowerCase();var n,r=v((t=t&&t.toLowerCase())||e);if(r){if(e==r.tag&&t==r.is)return new r.ctor;if(!t&&!r.is)return new r.ctor}return t?(n=o(e)).setAttribute("is",t):(n=_(e),0<=e.indexOf("-")&&i(n,HTMLElement)),n}function e(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return r(e),e}}var n,t=m.isIE,g=m.upgradeDocumentTree,r=m.upgradeAll,y=m.upgradeWithDefinition,i=m.implementPrototype,a=m.useNative,b=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],w={},_=document.createElement.bind(document),s=document.createElementNS.bind(document),a=Object.__proto__||a?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1};e(Node.prototype,"cloneNode"),e(document,"importNode"),t&&(n=document.importNode,document.importNode=function(){var e,t=n.apply(document,arguments);return t.nodeType==t.DOCUMENT_FRAGMENT_NODE?((e=document.createDocumentFragment()).appendChild(t),e):t}),document.registerElement=function(e,t){var n,r,o,t=t||{};if(!e)throw Error("document.registerElement: first argument `name` must not be empty");if(e.indexOf("-")<0)throw Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+e+"'.");if(function(e){for(var t=0;b.length>t;t++)if(e===b[t])return 1}(e))throw Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+e+"'. The type name is invalid.");if(v(e))throw Error("DuplicateDefinitionError: a type with name '"+e+"' is already registered");t.prototype||(t.prototype=Object.create(HTMLElement.prototype)),t.__name=e.toLowerCase(),t.lifecycle=t.lifecycle||{},t.ancestry=function e(t){t=v(t);return t?e(t.extends).concat([t]):[]}(t.extends);for(var i,a=t,s=a.extends,c=0;i=a.ancestry[c];c++)s=i.is&&i.tag;a.tag=s||a.__name,s&&(a.is=a.__name);var e=t;if(!Object.__proto__){var u=HTMLElement.prototype;e.is&&(p=document.createElement(e.tag),u=Object.getPrototypeOf(p));for(var l,d=e.prototype,h=!1;d;)d==u&&(h=!0),(l=Object.getPrototypeOf(d))&&(d.__proto__=l),d=l;h||console.warn(e.tag+" prototype not found in prototype chain for "+e.is),e.native=u}var p=t.prototype;return p.setAttribute._polyfilled||(n=p.setAttribute,p.setAttribute=function(e,t){f.call(this,e,t,n)},r=p.removeAttribute,p.removeAttribute=function(e){f.call(this,e,null,r)},p.setAttribute._polyfilled=!0),e=t.__name,(w[e]=t).ctor=(o=t,function(){return y(_((e=o).tag),e);var e}),t.ctor.prototype=t.prototype,t.prototype.constructor=t.ctor,m.ready&&g(document),t.ctor},document.createElement=o,document.createElementNS=function(e,t,n){return"http://www.w3.org/1999/xhtml"===e?o(t,n):s(e,t)},m.registry=w,m.instanceof=a,m.reservedTagList=b,m.getRegisteredDefinition=v,document.register=document.registerElement}),function(e){function t(){o(window.wrap(document)),window.CustomElements.ready=!0,(window.requestAnimationFrame||function(e){setTimeout(e,16)})(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=e.useNative,r=e.initializeModules,o=(e.isIE,n?(e.watchShadow=n=function(){},e.upgrade=n,e.upgradeAll=n,e.upgradeDocumentTree=n,e.upgradeSubtree=n,e.takeRecords=n,e.instanceof=function(e,t){return e instanceof t}):r(),e.upgradeDocumentTree),i=e.upgradeDocument;window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){e.import&&i(wrap(e.import))}),"complete"!==document.readyState&&!e.flags.eager&&("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready)?(n=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded",window.addEventListener(n,t)):t()}(window.CustomElements),function(){var e=document.createElement("style"),t=(e.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n",document.querySelector("head"));t.insertBefore(e,t.firstChild)}(window.WebComponents),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.PointerEventsPolyfill=t()}(this,function(){"use strict";function e(){this.array=[],this.size=0}function t(e,t,n,r){this.addCallback=e.bind(r),this.removeCallback=t.bind(r),this.changedCallback=n.bind(r),_&&(this.observer=new _(this.mutationWatcher.bind(this)))}function n(e){return"body /shadow-deep/ "+r(e)}function r(e){return'[touch-action="'+e+'"]'}function o(e){return"{ -ms-touch-action: "+e+"; touch-action: "+e+"; touch-action-delay: none; }"}function i(e){if(!f.pointermap.has(e))throw Error("InvalidPointerId")}var a=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],s=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],c=function(e,t){t=t||Object.create(null);var n=document.createEvent("Event");n.initEvent(e,t.bubbles||!1,t.cancelable||!1);for(var r,o=2;o<a.length;o++)n[r=a[o]]=t[r]||s[o];return n.buttons=t.buttons||0,e=t.pressure||(n.buttons?.5:0),n.x=n.clientX,n.y=n.clientY,n.pointerId=t.pointerId||0,n.width=t.width||0,n.height=t.height||0,n.pressure=e,n.tiltX=t.tiltX||0,n.tiltY=t.tiltY||0,n.pointerType=t.pointerType||"",n.hwTimestamp=t.hwTimestamp||0,n.isPrimary=t.isPrimary||!1,n},u=window.Map&&window.Map.prototype.forEach?Map:e,l=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp"],d=[!(e.prototype={set:function(e,t){return void 0===t?this.delete(e):(this.has(e)||this.size++,void(this.array[e]=t))},has:function(e){return void 0!==this.array[e]},delete:function(e){this.has(e)&&(delete this.array[e],this.size--)},get:function(e){return this.array[e]},clear:function(){this.array.length=0,this.size=0},forEach:function(n,r){return this.array.forEach(function(e,t){n.call(r,e,t,this)},this)}}),!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],h={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},p="undefined"!=typeof SVGElementInstance,m={pointermap:new u,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(e,t){var n=t,t=n.events;t&&(t.forEach(function(e){n[e]&&(this.eventMap[e]=n[e].bind(n))},this),this.eventSources[e]=n,this.eventSourceList.push(n))},register:function(e){for(var t,n=this.eventSourceList.length,r=0;r<n&&(t=this.eventSourceList[r]);r++)t.register.call(t,e)},unregister:function(e){for(var t,n=this.eventSourceList.length,r=0;r<n&&(t=this.eventSourceList[r]);r++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(e){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,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){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.contains(e.target,e.relatedTarget)||this.leave(e)},enterOver:function(e){this.over(e),this.contains(e.target,e.relatedTarget)||this.enter(e)},eventHandler:function(e){var t;e._handledByPE||(t=e.type,(t=this.eventMap&&this.eventMap[t])&&t(e),e._handledByPE=!0)},listen:function(t,e){e.forEach(function(e){this.addEvent(t,e)},this)},unlisten:function(t,e){e.forEach(function(e){this.removeEvent(t,e)},this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(e,t){this.captureInfo[t.pointerId]&&(t.relatedTarget=null);e=new c(e,t);return t.preventDefault&&(e.preventDefault=t.preventDefault),e._target=e._target||t.target,e},fireEvent:function(e,t){e=this.makeEvent(e,t);return this.dispatchEvent(e)},cloneEvent:function(e){for(var t,n=Object.create(null),r=0;r<l.length;r++)n[t=l[r]]=e[t]||d[r],!p||"target"!==t&&"relatedTarget"!==t||n[t]instanceof SVGElementInstance&&(n[t]=n[t].correspondingUseElement);return e.preventDefault&&(n.preventDefault=function(){e.preventDefault()}),n},getTarget:function(e){var t=this.captureInfo[e.pointerId];return t?e._target!==t&&e.type in h?void 0:t:e._target},setCapture:function(e,t){this.captureInfo[e]&&this.releaseCapture(e),this.captureInfo[e]=t;var n=document.createEvent("Event");n.initEvent("gotpointercapture",!0,!1),n.pointerId=e,this.implicitRelease=this.releaseCapture.bind(this,e),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease),n._target=t,this.asyncDispatchEvent(n)},releaseCapture:function(e){var t,n=this.captureInfo[e];n&&((t=document.createEvent("Event")).initEvent("lostpointercapture",!0,!1),t.pointerId=e,this.captureInfo[e]=void 0,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease),t._target=n,this.asyncDispatchEvent(t))},dispatchEvent:function(e){var t=this.getTarget(e);return t?t.dispatchEvent(e):void 0},asyncDispatchEvent:function(e){requestAnimationFrame(this.dispatchEvent.bind(this,e))}},f=(m.boundHandler=m.eventHandler.bind(m),m),v={shadow:function(e){return e?e.shadowRoot||e.webkitShadowRoot:void 0},canTarget:function(e){return e&&Boolean(e.elementFromPoint)},targetingShadow:function(e){e=this.shadow(e);return this.canTarget(e)?e:void 0},olderShadow:function(e){var t=e.olderShadowRoot;return t||(e=e.querySelector("shadow"))&&(t=e.olderShadowRoot),t},allShadows:function(e){for(var t=[],n=this.shadow(e);n;)t.push(n),n=this.olderShadow(n);return t},searchRoot:function(e,t,n){if(e){for(var r,o,e=e.elementFromPoint(t,n),i=this.targetingShadow(e);i;){if(r=i.elementFromPoint(t,n))return o=this.targetingShadow(r),this.searchRoot(o,t,n)||r;i=this.olderShadow(i)}return e}},owner:function(e){for(var t=e;t.parentNode;)t=t.parentNode;return t=t.nodeType!==Node.DOCUMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?document:t},findTarget:function(e){var t=e.clientX,n=e.clientY,e=this.owner(e.target);return e.elementFromPoint(t,n)||(e=document),this.searchRoot(e,t,n)}},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),y=Array.prototype.map.call.bind(Array.prototype.map),b=Array.prototype.slice.call.bind(Array.prototype.slice),w=Array.prototype.filter.call.bind(Array.prototype.filter),_=window.MutationObserver||window.WebKitMutationObserver,A={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]},m=(t.prototype={watchSubtree:function(e){this.observer&&v.canTarget(e)&&this.observer.observe(e,A)},enableOnSubtree:function(e){this.watchSubtree(e),e===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(e)},installNewSubtree:function(e){g(this.findElements(e),this.addElement,this)},findElements:function(e){return e.querySelectorAll?e.querySelectorAll("[touch-action]"):[]},removeElement:function(e){this.removeCallback(e)},addElement:function(e){this.addCallback(e)},elementChanged:function(e,t){this.changedCallback(e,t)},concatLists:function(e,t){return e.concat(b(t))},installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(e){return e.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(e){var t=y(e,this.findElements,this);return t.push(w(e,this.isElement)),t.reduce(this.concatLists,[])},mutationWatcher:function(e){e.forEach(this.mutationHandler,this)},mutationHandler:function(e){"childList"===e.type?(this.flattenMutationTree(e.addedNodes).forEach(this.addElement,this),this.flattenMutationTree(e.removedNodes).forEach(this.removeElement,this)):"attributes"===e.type&&this.elementChanged(e.target,e.oldValue)}},t),E=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],T="",M=window.PointerEvent||window.MSPointerEvent,L=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,C=f.pointermap,S=[1,4,2,8,16],O=!1;try{O=1===new MouseEvent("test",{buttons:1}).buttons}catch(e){}var P,N={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(e){f.listen(e,this.events)},unregister:function(e){f.unlisten(e,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(e){for(var t,n=this.lastTouches,r=e.clientX,o=e.clientY,i=0,a=n.length;i<a&&(t=n[i]);i++){var s=Math.abs(r-t.x),c=Math.abs(o-t.y);if(s<=25&&c<=25)return!0}},prepareEvent:function(e){var t=f.cloneEvent(e),n=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),n()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var n=C.get(this.POINTER_ID);e.buttons=n?n.buttons:0,t.buttons=e.buttons},mousedown:function(e){var t,n;this.isEventSimulatedFromTouch(e)||(t=C.get(this.POINTER_ID),n=this.prepareEvent(e),O||(n.buttons=S[n.button],t&&(n.buttons|=t.buttons),e.buttons=n.buttons),C.set(this.POINTER_ID,e),t?f.move(n):f.down(n))},mousemove:function(e){var t;this.isEventSimulatedFromTouch(e)||(t=this.prepareEvent(e),O||this.prepareButtonsForMove(t,e),f.move(t))},mouseup:function(e){var t,n,r;this.isEventSimulatedFromTouch(e)||(t=C.get(this.POINTER_ID),n=this.prepareEvent(e),O||(r=S[n.button],n.buttons=t?t.buttons&~r:0,e.buttons=n.buttons),C.set(this.POINTER_ID,e),0===n.buttons||n.buttons===S[n.button]?(this.cleanupMouse(),f.up(n)):f.move(n))},mouseover:function(e){var t;this.isEventSimulatedFromTouch(e)||(t=this.prepareEvent(e),O||this.prepareButtonsForMove(t,e),f.enterOver(t))},mouseout:function(e){var t;this.isEventSimulatedFromTouch(e)||(t=this.prepareEvent(e),O||this.prepareButtonsForMove(t,e),f.leaveOut(t))},cancel:function(e){e=this.prepareEvent(e);f.cancel(e),this.cleanupMouse()},cleanupMouse:function(){C.delete(this.POINTER_ID)}},H=f.captureInfo,j=v.findTarget.bind(v),I=v.allShadows.bind(v),D=f.pointermap,k="touch-action",x={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){q.enableOnSubtree(e)},unregister:function(e){},elementAdded:function(e){var t=e.getAttribute(k),n=this.touchActionToScrollType(t);n&&(e._scrollType=n,f.listen(e,this.events),I(e).forEach(function(e){e._scrollType=n,f.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,f.unlisten(e,this.events),I(e).forEach(function(e){e._scrollType=void 0,f.unlisten(e,this.events)},this)},elementChanged:function(e,t){var n=e.getAttribute(k),r=this.touchActionToScrollType(n),n=this.touchActionToScrollType(t);r&&n?(e._scrollType=r,I(e).forEach(function(e){e._scrollType=r},this)):n?this.elementRemoved(e):r&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=this.scrollTypes;return"none"===e?"none":e===t.XSCROLLER?"X":e===t.YSCROLLER?"Y":t.SCROLLER.exec(e)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===D.size||1===D.size&&D.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){return"touchstart"!==e&&"touchmove"!==e?0:1},touchToPointer:function(e){var t=this.currentTouchEvent,n=f.cloneEvent(e),r=n.pointerId=e.identifier+2,o=(n.target=H[r]||j(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(t.type),n.width=e.radiusX||e.webkitRadiusX||0,n.height=e.radiusY||e.webkitRadiusY||0,n.pressure=e.force||e.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE,this);return n.preventDefault=function(){o.scrolling=!1,o.firstXY=null,t.preventDefault()},n},processTouches:function(e,t){var n=e.changedTouches;this.currentTouchEvent=e;for(var r,o=0;n.length>o;o++)r=n[o],t.call(this,this.touchToPointer(r))},shouldScroll:function(e){var t,n;if(this.firstXY)return e="none"!==(n=e.currentTarget._scrollType)&&("XY"===n||(e=e.changedTouches[0],t="Y"===n?"X":"Y",n=Math.abs(e["client"+n]-this.firstXY[n]),Math.abs(e["client"+t]-this.firstXY[t])<=n)),this.firstXY=null,e},findTouch:function(e,t){for(var n,r=0,o=e.length;r<o&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var n,r=e.touches;D.size>=r.length&&(n=[],D.forEach(function(e,t){1===t||this.findTouch(r,t-2)||(t=e.out,n.push(t))},this),n.forEach(this.cancelOut,this))},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){D.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),f.over(e),f.enter(e),f.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 t,n,r=D.get(e.pointerId);r&&(t=r.out,n=r.outTarget,f.move(e),t&&n!==e.target&&(t.relatedTarget=e.target,e.relatedTarget=n,t.target=n,e.target?(f.leaveOut(t),f.enterOver(e)):(e.target=n,e.relatedTarget=null,this.cancelOut(e))),r.out=e,r.outTarget=e.target)},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(f.up(e),f.out(e),f.leave(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){f.cancel(e),f.out(e),f.leave(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){D.delete(e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=N.lastTouches,e=e.changedTouches[0];this.isPrimaryTouch(e)&&(e={x:e.clientX,y:e.clientY},t.push(e),t=function(e,t){t=e.indexOf(t);-1<t&&e.splice(t,1)}.bind(null,t,e),setTimeout(t,2500))}},q=new m(x.elementAdded,x.elementRemoved,x.elementChanged,x),R=f.pointermap,F=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,U={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){f.listen(e,this.events)},unregister:function(e){f.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return F&&((t=f.cloneEvent(e)).pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){R.delete(e)},MSPointerDown:function(e){R.set(e.pointerId,e);e=this.prepareEvent(e);f.down(e)},MSPointerMove:function(e){e=this.prepareEvent(e);f.move(e)},MSPointerUp:function(e){var t=this.prepareEvent(e);f.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){e=this.prepareEvent(e);f.leaveOut(e)},MSPointerOver:function(e){e=this.prepareEvent(e);f.enterOver(e)},MSPointerCancel:function(e){var t=this.prepareEvent(e);f.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){e=f.makeEvent("lostpointercapture",e);f.dispatchEvent(e)},MSGotPointerCapture:function(e){e=f.makeEvent("gotpointercapture",e);f.dispatchEvent(e)}},Y=window.navigator.msPointerEnabled?(P=function(e){i(e),this.msSetPointerCapture(e)},function(e){i(e),this.msReleasePointerCapture(e)}):(P=function(e){i(e),f.setCapture(e,this)},function(e){i(e),f.releaseCapture(e,this)});return M&&(E.forEach(function(e){e+""===e?(T+=r(e)+o(e)+"\n",L&&(T+=n(e)+o(e)+"\n")):(T+=e.selectors.map(r)+o(e.rule)+"\n",L&&(T+=e.selectors.map(n)+o(e.rule)+"\n"))}),(M=document.createElement("style")).textContent=T,document.head.appendChild(M)),window.PointerEvent||(window.PointerEvent=c,window.navigator.msPointerEnabled?(E=window.navigator.msMaxTouchPoints,Object.defineProperty(window.navigator,"maxTouchPoints",{value:E,enumerable:!0}),f.registerSource("ms",U)):(f.registerSource("mouse",N),void 0!==window.ontouchstart&&f.registerSource("touch",x)),f.register(document)),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:P},releasePointerCapture:{value:Y}}),{dispatcher:f,Installer:m,PointerEvent:c,PointerMap:u,targetFinding:v}}),function(){function s(e){e=N.call(e);return P[e]||(P[e]=e.match(I)[1].toLowerCase())}function o(e,t){t=o[t||s(e)];return t?t(e):e}function p(e){return A[s(e)]?[e]:Array.prototype.slice.call(e,0)}function c(e,t,n){var r=s(n);return"object"==r&&"object"==s(e[t])?R.merge(e[t],n):e[t]=o(n,r),e}function d(e,t,n){var r,o,i={};for(o in t)i[o.split(":")[0]]=o;for(o in n)r=i[o.split(":")[0]],"function"==typeof t[r]?(r.match(":mixins")||(t[r+":mixins"]=t[r],delete t[r],r+=":mixins"),t[r].__mixin__=R.applyPseudos(o+(o.match(":mixins")?"":":mixins"),n[o],e.pseudos,t[r].__mixin__)):(t[o]=n[o],delete t[r])}function m(l){return function e(t,n){for(var r=t.length;r--;)n.unshift(t[r]),R.mixins[t[r]].mixins&&e(R.mixins[t[r]].mixins,n);return n}(l.mixins,[]).forEach(function(e){var t,n=R.mixins[e];for(t in n){var r=n[t],o=l[t];if(o)switch(t){case"mixins":break;case"events":i=c=s=a=void 0;var i,a=l,s=o,c=r;for(i in c)s[i+":__mixin__("+H+++")"]=R.applyPseudos(i,c[i],a.pseudos);break;case"accessors":case"prototype":for(var u in r)o[u]?d(l,o[u],r[u]):o[u]=r[u];break;default:d(l,o,r)}else l[t]=r}}),l}function e(e){return 0===e.button}function i(e,t){var n,r,o,i,a,s=Object.getOwnPropertyDescriptor(e,"target");for(n in t)D[n]||(r=n,o=e,i=t,a=s,a?o[r]=i[r]:Object.defineProperty(o,r,{writable:!0,enumerable:!0,value:i[r]}));e.baseEvent=t}function f(e,t,n,r,o){a[o].call(e,n,t&&t.boolean?"":r)}function v(e,t,n,r,o){if(t&&(t.property||t.selector))for(var i=t.property?[e.xtag[t.property]]:t.selector?R.query(e,t.selector):[],a=i.length;a--;)i[a][o](n,r)}function g(e,t){e.prototype[t]={};var n,r,o,i=e.accessors[t],a=i.attribute;for(r in a&&(n=a.name=(a?a.name||t.replace(T,"$1-$2"):t).toLowerCase(),a.key=t,e.attributes[n]=a),i)!function(e,t,r,o,i,a){var n=r.split(":"),s=n[0];"get"==s?(n[0]=t,e.prototype[t].get=R.applyPseudos(n.join(":"),o[r],e.pseudos,o[r])):"set"==s?(n[0]=t,e.prototype[t].set=R.applyPseudos(n.join(":"),i?function(e){var t,n="setAttribute";i.boolean?(e=!!e,t=this.hasAttribute(a),e||(n="removeAttribute")):(e=i.validate?i.validate.call(this,e):e,t=this.getAttribute(a)),f(this,i,a,e,n),o[r].call(this,e,t),v(this,i,a,e,n)}:o[r]?function(e){o[r].call(this,e)}:null,e.pseudos,o[r]),i&&(i.setter=o[r])):e.prototype[t][r]=o[r]}(e,t,r,i,a,n);a&&(e.prototype[t].get||(o=(a.boolean?"has":"get")+"Attribute",e.prototype[t].get=function(){return this[o](n)}),e.prototype[t].set||(e.prototype[t].set=function(e){e=a.boolean?!!e:a.validate?a.validate.call(this,e):e;var t=!a.boolean||e?"setAttribute":"removeAttribute";f(this,a,n,e,t),v(this,a,n,e,t)}))}function y(e){return"function"==typeof e?j.exec(""+e)[1]:e}function h(){}function b(){return!0}var t,n,w=window,_=document,a={setAttribute:Element.prototype.setAttribute,removeAttribute:Element.prototype.removeAttribute},E=Element.prototype.createShadowRoot,u=_.createElement("div"),l=/,/g,T=/([a-z])([A-Z])/g,r=/\(|\)/g,M=/:(\w+)\u276A(.+?(?=\u276B))|:(\w+)/g,L=/(\d+)/g,C={action:function(e,t){return-1<e.value.match(L).indexOf(t.keyCode+"")==("keypass"==e.name)||null}},S={dom:"ms"==(t=((t=Object.keys(window).join()).match(/,(ms)/)||t.match(/,(moz)/)||t.match(/,(O)/)||[null,"webkit"])[1].toLowerCase())?"MS":t,lowercase:t,css:"-"+t+"-",js:"ms"==t?t:t.charAt(0).toUpperCase()+t.substring(1)},O=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype[S.lowercase+"MatchesSelector"],P={},N=P.toString,I=/\s([a-zA-Z]+)/,A=(o.object=function(e){var t,n={};for(t in e)n[t]=o(e[t]);return n},o.array=function(e){for(var t=e.length,n=Array(t);t--;)n[t]=o(e[t]);return n},{undefined:1,null:1,number:1,boolean:1,string:1,function:1}),H=0,D={};for(n in _.createEvent("CustomEvent"))D[n]=1;var k,x,j=/\/\*!?(?:\@preserve)?[ \t]*(?:\r\n|\n)([\s\S]*?)(?:\r\n|\n)\s*\*\//,R={tags:{},defaultOptions:{pseudos:[],mixins:[],events:{},methods:{},accessors:{},lifecycle:{},attributes:{},prototype:{xtag:{get:function(){return this.__xtag__||(this.__xtag__={data:{}})}}}},register:function(e,t){if("string"!=typeof e)throw"First argument must be a Custom Element string name";e=e.toLowerCase(),R.tags[e]=t||{};var n,o=t.prototype,a=(delete t.prototype,R.tags[e].compiled=m(R.merge({},R.defaultOptions,t))),i=a.prototype,r=a.lifecycle;for(n in a.events)a.events[n]=R.parseEvent(n,a.events[n]);for(n in r)r[n.split(":")[0]]=R.applyPseudos(n,r[n],a.pseudos,r[n]);for(n in a.methods)i[n.split(":")[0]]={value:R.applyPseudos(n,a.methods[n],a.pseudos,a.methods[n]),enumerable:!0};for(n in a.accessors)g(a,n);a.shadow&&(a.shadow=a.shadow.nodeName?a.shadow:R.createFragment(a.shadow)),a.content&&(a.content=a.content.nodeName?a.content.innerHTML:y(a.content));var s=r.created,c=r.finalized,u=(i.createdCallback={enumerable:!0,value:function(){var e,t=this,n=(a.shadow&&E&&this.createShadowRoot().appendChild(a.shadow.cloneNode(!0)),a.content&&(this.appendChild(document.createElement("div")).outerHTML=a.content),s?s.apply(this,arguments):null);for(e in R.addEvents(this,a.events),a.attributes){var r=a.attributes[e],o=this.hasAttribute(e),i=void 0!==r.def;(o||r.boolean||i)&&(this[r.key]=r.boolean?o:!o&&i?r.def:this.getAttribute(e))}return a.pseudos.forEach(function(e){e.onAdd.call(t,e)}),this.xtagComponentReady=!0,c&&c.apply(this,arguments),n}},r.inserted),l=r.removed,t=((u||l)&&(i.attachedCallback={value:function(){return l&&(this.xtag.__parentNode__=this.parentNode),u?u.apply(this,arguments):void 0},enumerable:!0}),l&&(i.detachedCallback={value:function(){var e=p(arguments),e=(e.unshift(this.xtag.__parentNode__),l.apply(this,e));return delete this.xtag.__parentNode__,e},enumerable:!0}),r.attributeChanged&&(i.attributeChangedCallback={value:r.attributeChanged,enumerable:!0}),i.setAttribute={writable:!0,enumerable:!0,value:function(e,t){var n,e=e.toLowerCase(),r=a.attributes[e];r&&(n=this.getAttribute(e),t=r.boolean?"":r.validate?r.validate.call(this,t):t),f(this,r,e,t,"setAttribute"),r&&(r.setter&&r.setter.call(this,!!r.boolean||t,n),v(this,r,e,t,"setAttribute"))}},i.removeAttribute={writable:!0,enumerable:!0,value:function(e){var e=e.toLowerCase(),t=a.attributes[e],n=this.hasAttribute(e);f(this,t,e,"","removeAttribute"),t&&(t.setter&&t.setter.call(this,!t.boolean&&void 0,n),v(this,t,e,"","removeAttribute"))}},{}),d=o instanceof w.HTMLElement,h=a.extends&&(t.extends=a.extends);return o&&Object.getOwnPropertyNames(o).forEach(function(e){var t=i[e],n=d?Object.getOwnPropertyDescriptor(o,e):o[e];if(t)for(var r in n)t[r]="function"==typeof n[r]&&t[r]?R.wrap(n[r],t[r]):n[r];i[e]=t||n}),t.prototype=Object.create((h?Object.create(_.createElement(h).constructor):w.HTMLElement).prototype,i),_.registerElement(e,t)},mixins:{},prefix:S,captureEvents:{focus:1,blur:1,scroll:1,DOMMouseScroll:1},customEvents:{animationstart:{attach:[S.dom+"AnimationStart"]},animationend:{attach:[S.dom+"AnimationEnd"]},transitionend:{attach:[S.dom+"TransitionEnd"]},move:{attach:["pointermove"]},enter:{attach:["pointerenter"]},leave:{attach:["pointerleave"]},scrollwheel:{attach:["DOMMouseScroll","mousewheel"],condition:function(e){return e.delta=e.wheelDelta?e.wheelDelta/40:Math.round(e.detail/3.5*-1),!0}},tap:{attach:["pointerdown","pointerup"],condition:function(e,t){if("pointerdown"==e.type)t.startX=e.clientX,t.startY=e.clientY;else if(0===e.button&&Math.abs(t.startX-e.clientX)<10&&Math.abs(t.startY-e.clientY)<10)return!0}},tapstart:{attach:["pointerdown"],condition:e},tapend:{attach:["pointerup"],condition:e},tapmove:{attach:["pointerdown"],condition:function(e,t){var n;return"pointerdown"==e.type?(n=t.listener.bind(this),t.tapmoveListeners||(t.tapmoveListeners=R.addEvents(document,{pointermove:n,pointerup:n,pointercancel:n}))):"pointerup"!=e.type&&"pointercancel"!=e.type||(R.removeEvents(document,t.tapmoveListeners),t.tapmoveListeners=null),!0}},taphold:{attach:["pointerdown","pointerup"],condition:function(e,t){if("pointerdown"==e.type)(t.pointers=t.pointers||{})[e.pointerId]=setTimeout(R.fireEvent.bind(null,this,"taphold"),t.duration||1e3);else{if("pointerup"!=e.type)return!0;t.pointers&&(clearTimeout(t.pointers[e.pointerId]),delete t.pointers[e.pointerId])}}}},pseudos:{__mixin__:{},mixins:{onCompiled:function(t,e){var n=e.source&&e.source.__mixin__||e.source;if(!n)return t;switch(e.value){case null:case"":case"before":return function(){return n.apply(this,arguments),t.apply(this,arguments)};case"after":return function(){var e=t.apply(this,arguments);return n.apply(this,arguments),e};case"none":return t}}},keypass:C,keyfail:C,delegate:{action:function(e,t){for(var n,r=t.target,o=t.currentTarget;!n&&r&&r!=o;)r.tagName&&O.call(r,e.value)&&(n=r),r=r.parentNode;return(n=!n&&o.tagName&&O.call(o,e.value)?o:n)?e.listener=e.listener.bind(n):null}},preventable:{action:function(e,t){return!t.defaultPrevented}},duration:{onAdd:function(e){e.source.duration=Number(e.value)}},capture:{onCompiled:function(e,t){t.source&&(t.source.capture=!0)}}},clone:o,typeOf:s,toArray:p,wrap:function(t,n){return function(){var e=t.apply(this,arguments);return n.apply(this,arguments),e}},merge:function(e,t,n){if("string"==s(t))return c(e,t,n);for(var r=1,o=arguments.length;r<o;r++){var i,a=arguments[r];for(i in a)c(e,i,a[i])}return e},uid:function(){return Math.random().toString(36).substr(2,10)},query:function(e,t){return(t||"").length?p(e.querySelectorAll(t)):[]},skipTransition:function(e,t,n){var r=S.js+"TransitionProperty",o=(e.style[r]=e.style.transitionProperty="none",t?t.call(n||e):null);return R.skipFrame(function(){e.style[r]=e.style.transitionProperty="",o&&o.call(n||e)})},requestFrame:(x=w.requestAnimationFrame||w[S.lowercase+"RequestAnimationFrame"]||function(e){return w.setTimeout(e,20)},function(e){return x(e)}),cancelFrame:(k=w.cancelAnimationFrame||w[S.lowercase+"CancelAnimationFrame"]||w.clearTimeout,function(e){return k(e)}),skipFrame:function(e){var t=R.requestFrame(function(){t=R.requestFrame(e)});return t},matchSelector:function(e,t){return O.call(e,t)},set:function(e,t,n){e[t]=n,window.CustomElements&&CustomElements.upgradeAll(e)},innerHTML:function(e,t){R.set(e,"innerHTML",t)},hasClass:function(e,t){return-1<e.className.split(" ").indexOf(t.trim())},addClass:function(e,t){var n=e.className.trim().split(" ");return t.trim().split(" ").forEach(function(e){~n.indexOf(e)||n.push(e)}),e.className=n.join(" ").trim(),e},removeClass:function(e,t){var n=t.trim().split(" ");return e.className=e.className.trim().split(" ").filter(function(e){return e&&!~n.indexOf(e)}).join(" "),e},toggleClass:function(e,t){return R[R.hasClass(e,t)?"removeClass":"addClass"].call(null,e,t)},queryChildren:function(e,t){var n=e.id,r="#"+(e.id=n||"x_"+R.uid())+" > ",o=e.parentNode||!u.appendChild(e),r=(t=r+(t+"").replace(l,","+r),e.parentNode.querySelectorAll(t));return n||e.removeAttribute("id"),o||u.removeChild(e),p(r)},createFragment:function(e){var t=document.createElement("template");return e&&(e.nodeName?p(arguments).forEach(function(e){t.content.appendChild(e)}):t.innerHTML=y(e)),document.importNode(t.content,!0)},manipulate:function(e,t){var n=e.nextSibling,r=e.parentNode,t=t.call(e)||e;n?r.insertBefore(t,n):r.appendChild(t)},applyPseudos:function(o,i,a,s){var e,c=i,u={};if(o.match(":")){var l=[],t=0;o.replace(r,function(e){return"("==e?1==++t?"❪":"(":--t?")":"❫"}).replace(M,function(e,t,n,r){l.push([t||r,n])});for(var d=l.length;d--;)!function(){var e=l[d][0],t=l[d][1];if(!R.pseudos[e])throw"pseudo not found: "+e+" "+t;var t=""===t||void 0===t?null:t,n=u[d]=Object.create(R.pseudos[e]),r=(n.key=o,n.name=e,n.value=t,n.arguments=(t||"").split(","),n.action=n.action||b,n.source=s,n.onAdd=n.onAdd||h,n.onRemove=n.onRemove||h,n.listener=c);c=function(){var e=n.action.apply(this,[n].concat(p(arguments)));return null===e||!1===e||(e=n.listener.apply(this,arguments),n.listener=r),e},a?a.push(n):n.onAdd.call(i,n)}()}for(e in u)u[e].onCompiled&&(c=u[e].onCompiled(c,u[e])||c);return c},removePseudos:function(t,e){e.forEach(function(e){e.onRemove.call(t,e)})},parseEvent:function(e,t){var e=e.split(":"),r=e.shift(),n=R.customEvents[r],o=R.merge({type:r,stack:h,condition:b,capture:R.captureEvents[r],attach:[],_attach:[],pseudos:"",_pseudos:[],onAdd:h,onRemove:h},n||{}),i=(o.attach=p(o.base||o.attach),o.chain=r+(o.pseudos.length?":"+o.pseudos:"")+(e.length?":"+e.join(":"):""),R.applyPseudos(o.chain,t,o._pseudos,o));return o.stack=function(e){e.currentTarget=e.currentTarget||this;var t=e.detail||{};return t.__stack__?t.__stack__==i?(e.stopPropagation(),e.cancelBubble=!0,i.apply(this,arguments)):void 0:i.apply(this,arguments)},o.listener=function(e){var t=p(arguments),n=o.condition.apply(this,t.concat([o]));return n&&(e.type!=r&&e.baseEvent&&e.type!=e.baseEvent.type?void R.fireEvent(e.target,r,{baseEvent:e,detail:!0!==n&&(n.__stack__=i)?n:{__stack__:i}}):o.stack.apply(this,t))},o.attach.forEach(function(e){o._attach.push(R.parseEvent(e,o.listener))}),o},addEvent:function(t,e,n,r){e="function"==typeof n?R.parseEvent(e,n):n;return e._pseudos.forEach(function(e){e.onAdd.call(t,e)}),e._attach.forEach(function(e){R.addEvent(t,e.type,e)}),e.onAdd.call(t,e,e.listener),t.addEventListener(e.type,e.stack,r||e.capture),e},addEvents:function(e,t){var n,r={};for(n in t)r[n]=R.addEvent(e,n,t[n]);return r},removeEvent:function(t,e,n){(n=n||e).onRemove.call(t,n,n.listener),R.removePseudos(t,n._pseudos),n._attach.forEach(function(e){R.removeEvent(t,e)}),t.removeEventListener(n.type,n.stack)},removeEvents:function(e,t){for(var n in t)R.removeEvent(e,t[n])},fireEvent:function(e,t,n){var r=_.createEvent("CustomEvent");r.initCustomEvent(t,!1!==(n=n||{}).bubbles,!1!==n.cancelable,n.detail),n.baseEvent&&i(r,n.baseEvent),e.dispatchEvent(r)}};"function"==typeof define&&define.amd?define(R):"undefined"!=typeof module&&module.exports?module.exports=R:w.xtag=R,_.addEventListener("WebComponentsReady",function(){R.fireEvent(_.body,"DOMComponentsLoaded")})}();
|
|
2
|
+
!function(){var m="quran-madina-html",e=`https://www.unpkg.com/${m}/`;function v(){var e=document.createElement("div");return e.innerHTML='<svg viewBox="0 0 24 24" class="quran-madina-html-icon" width="20px"><path d="M16.02 20.96H3.78c-.41 0-.75-.34-.75-.75V7.74c0-.41.34-.75.75-.75h7.87c.21 0 .39.08.53.22l4.37 4.37c.14.14.22.32.22.53v8.11c0 .4-.34.74-.75.74ZM4.53 19.47h10.75v-6.61h-3.62c-.41 0-.75-.34-.75-.75V8.48H4.53v10.99Z"></path><path d="m20.74 7.63-4.37-4.37c-.14-.14-.36-.2-.53-.22H8.01c-.41 0-.75.34-.75.75V5.5h1.49v-.97h6.34v3.62c0 .41.34.75.75.75h3.62v8.19h-1.2v1.49h1.95c.41 0 .75-.34.75-.75V8.16c0-.21-.08-.4-.22-.53Z"></path></svg>'.trim(),e.firstChild}function g(e){console.log(m+"> "+e)}function y(){var e;textWithHeader=this.parentElement.parentElement.innerText.split("\n"),text=1<textWithHeader.length?textWithHeader.slice(1).join(" ")+"\n\n"+textWithHeader[0]:(e=this.parentElement.parentElement.getAttribute("sura"),textWithHeader[0]+"\n\n"+b.suras[e-1].name),navigator.clipboard.writeText(text),alert("⎘ تم نسخ:\n\n"+text)}var t,n,r,o,i,b={content:"Loading .."},a=document.currentScript||document.querySelector(`script[src*="${m}"]`),s=a.getAttribute("data-name")||"Madina05",c=(a.getAttribute("data-font")||"Hafs").replaceAll(" ","%"),a=a.getAttribute("data-font-size")||16;g(s+` with font: ${c} size: `+a);document.getElementById(m)||(n=document.getElementsByTagName("head")[0],(t=document.createElement("link")).id=m,t.rel="stylesheet",t.type="text/css",t.href="https://www.unpkg.com/quran-madina-html/dist/quran-madina-html.min.css?v=1.1",t.media="all",n.appendChild(t)),n=e+`assets/db/${s}-${c}-${a}px.json`,r=function(e){b=e;const t=new FontFace(b.font_family,"url("+encodeURI(b.font_url)+")");t.load().then(()=>{document.fonts.add(t)}),xtag.register(m,{lifecycle:{created:function(){this.render(this)},inserted:function(){},removed:function(){},attributeChanged:function(){}},events:{},accessors:{page:{attribute:{},set:function(e){this.xtag.data.page=e},get:function(){return this.getAttribute("page")}},aya:{attribute:{},set:function(e){this.xtag.data.aya=e},get:function(){return this.getAttribute("aya")}},sura:{attribute:{},set:function(e){this.xtag.data.sura=e},get:function(){return this.getAttribute("sura")}}},methods:{render:function(t){var n,r,o,i,a,s;if(null!=this.sura&&null!=this.aya)s=this.sura,n=Array(2).fill(s.split("-")[0]-1)[0],r=!1,[o,i]=2==(s=this.aya).split("-").length?s.split("-").map(e=>parseInt(e)+1):Array(2).fill(parseInt(s.split("-")[0])+1),null!=this.page&&g("Ignoring page parameter!");else{if(null==this.page)return console.error(m+"> Bad arguments: Not rendering!"),1;for(o=1,i=n=0;b.suras[n].ayas[0].p<this.page;)n+=1;for(n-=1;b.suras[n].ayas[o].p<this.page;)o+=1;for(i=o;b.suras[n].ayas[i].p==this.page;)i+=1;i-=1,r=!0}(s=b.suras[n].ayas[o].r[0].l)!=(a=b.suras[n].ayas[i].r.slice(-1)[0].l)&&(r=!0,t.style="display:block;"),r&&(t.style.setProperty("font-family",b.font_family,""),t.style.setProperty("font-size",b.font_size+"px",""),"me_quran"===b.font_family)&&t.style.setProperty("line-height",2*b.font_size+"px","");var c,u,l,d,e,h="",p=(r&&((h=document.createElement("quran-madina-html-header")).innerHTML=b.suras[n].name,(e=v()).setAttribute("data-copy-sura",n),e.setAttribute("data-copy-aya-from",o),e.setAttribute("data-copy-aya-to",i),e.addEventListener("click",y),h.appendChild(e),t.appendChild(h)),o);for(let e=s;e<=a;e++){const f=e;line=document.createElement("quran-madina-html-line"),t.appendChild(line),r||(line.style.setProperty("font-family",b.font_family,""),line.style.setProperty("font-size",b.font_size+"px","")),r&&(t.style.width=b.line_width+10+"px",c=b.suras[n].ayas[o].p%2==1?"":"-",t.style.setProperty("box-shadow","inset "+c+"8px 0 7px -7px #333",""),line.style.setProperty("display","block",""));for(let e=p;e<p+5&&e<=i;e++)(line_match=b.suras[n].ayas[e].r.filter(e=>e.l==f)).length&&(r&&(""==line.innerHTML.trim()&&(u=line_match[0].o,line.style.setProperty("padding-right",u+"px",""),0<u)&&line.style.setProperty("transform-origin","left"),0<=line_match[0].s?line.style.setProperty("transform",`scaleX(${line_match[0].s})`,""):line.style.setProperty("text-align","center","")),u=document.createElement("div"),l=e-1,d=[m+"-part",m+`-${(d=(e,t)=>String(e).padStart(t,"0"))(n+1,3)}-`+d(l,3)],DOMTokenList.prototype.add.apply(u.classList,d),u.textContent=line_match[0].t,u.style.cssText="display:inline",line.appendChild(u),function(e,t="class",n="lightgrey",r="transparent"){var o="tag"===t.toLowerCase()?document.getElementsByTagName(e):document.getElementsByClassName(e);Array.from(o).forEach(function(e){e.onmouseover=function(){Array.from(o).forEach(function(e){e.style.backgroundColor=n})},e.onmouseout=function(){Array.from(o).forEach(function(e){e.style.backgroundColor=r})}})}(d.slice(-1)[0]),p=e)}r||(h=document.createElement("quran-madina-html-copy"),(e=v()).setAttribute("data-copy-sura",n),e.setAttribute("data-copy-aya-from",o),e.setAttribute("data-copy-aya-to",i),e.addEventListener("click",y),h.appendChild(e),t.appendChild(h))}}})},o=function(e){console.error(e)},(i=new XMLHttpRequest).onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(200===i.status?r&&r(JSON.parse(i.responseText)):o&&o(i))},i.open("GET",n,!0),i.send()}(),function(){function e(e){if((this._element=e).className!=this._classCache&&(this._classCache=e.className,this._classCache))for(var t=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/),n=0;t.length>n;n++)o.call(this,t[n])}function t(e,t){e.className=t.join(" ")}var n,r,o,i,a,s,c,u;void 0===window.Element||"classList"in document.documentElement||(s=Array.prototype,n=s.indexOf,r=s.slice,o=s.push,i=s.splice,a=s.join,e.prototype={add:function(e){this.contains(e)||(o.call(this,e),t(this._element,r.call(this,0)))},contains:function(e){return-1!==n.call(this,e)},item:function(e){return this[e]||null},remove:function(e){e=n.call(this,e);-1!==e&&(i.call(this,e,1),t(this._element,r.call(this,0)))},toString:function(){return a.call(this," ")},toggle:function(e){-1===n.call(this,e)?this.add(e):this.remove(e)}},window.DOMTokenList=e,s=Element.prototype,c="classList",u=function(){return new e(this)},Object.defineProperty?Object.defineProperty(s,c,{get:u}):s.__defineGetter__(c,u))}(),function(){window.WebComponents=window.WebComponents||{flags:{}};var e,t=document.querySelector('script[src*="webcomponents-lite.js"]'),n={};if(!n.noOpts){if(location.search.slice(1).split("&").forEach(function(e){var t,e=e.split("=");e[0]&&(t=e[0].match(/wc-(.+)/))&&(n[t[1]]=e[1]||!0)}),t)for(var r,o=0;r=t.attributes[o];o++)"src"!==r.name&&(n[r.name]=r.value||!0);n.log&&n.log.split?(e=n.log.split(","),n.log={},e.forEach(function(e){n.log[e]=!0})):n.log={}}n.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=n.register),WebComponents.flags=n}(),function(e){"use strict";function g(e){return void 0!==_[e]}function y(){r.call(this),this._isInvalid=!0}function b(e){return""==e&&y.call(this),e.toLowerCase()}function w(e){var t=e.charCodeAt(0);return 32<t&&t<127&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function n(e,t,n){function r(e){d.push(e)}var o,i,a=t||"scheme start",s=0,c="",u=!1,l=!1,d=[];e:for(;(e[s-1]!=T||0==s)&&!this._isInvalid;){var h=e[s];switch(a){case"scheme start":if(!h||!M.test(h)){if(t){r("Invalid scheme.");break e}c="",a="no scheme";continue}c+=h.toLowerCase(),a="scheme";break;case"scheme":if(h&&L.test(h))c+=h.toLowerCase();else{if(":"!=h){if(t){if(T==h)break e;r("Code point not allowed in scheme: "+h);break e}c="",s=0,a="no scheme";continue}if(this._scheme=c,c="",t)break e;g(this._scheme)&&(this._isRelative=!0),a="file"==this._scheme?"relative":this._isRelative&&n&&n._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==h?(this._query="?",a="query"):"#"==h?(this._fragment="#",a="fragment"):T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._schemeData+=w(h));break;case"no scheme":if(n&&g(n._scheme)){a="relative";continue}r("Missing scheme."),y.call(this);break;case"relative or authority":if("/"!=h||"/"!=e[s+1]){r("Expected /, got: "+h),a="relative";continue}a="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=n._scheme),T==h){this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query=n._query,this._username=n._username,this._password=n._password;break e}if("/"==h||"\\"==h)"\\"==h&&r("\\ is an invalid code point."),a="relative slash";else if("?"==h)this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query="?",this._username=n._username,this._password=n._password,a="query";else{if("#"!=h){var p=e[s+1],f=e[s+2];("file"!=this._scheme||!M.test(h)||":"!=p&&"|"!=p||T!=f&&"/"!=f&&"\\"!=f&&"?"!=f&&"#"!=f)&&(this._host=n._host,this._port=n._port,this._username=n._username,this._password=n._password,this._path=n._path.slice(),this._path.pop()),a="relative path";continue}this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query=n._query,this._fragment="#",this._username=n._username,this._password=n._password,a="fragment"}break;case"relative slash":if("/"!=h&&"\\"!=h){"file"!=this._scheme&&(this._host=n._host,this._port=n._port,this._username=n._username,this._password=n._password),a="relative path";continue}"\\"==h&&r("\\ is an invalid code point."),a="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=h){r("Expected '/', got: "+h),a="authority ignore slashes";continue}a="authority second slash";break;case"authority second slash":if(a="authority ignore slashes","/"==h)break;r("Expected '/', got: "+h);continue;case"authority ignore slashes":if("/"!=h&&"\\"!=h){a="authority";continue}r("Expected authority, got: "+h);break;case"authority":if("@"==h){u&&(r("@ already seen."),c+="%40");for(var u=!0,m=0;c.length>m;m++){var v=c[m];"\t"!=v&&"\n"!=v&&"\r"!=v?":"!=v||null!==this._password?(v=w(v),null!==this._password?this._password+=v:this._username+=v):this._password="":r("Invalid whitespace in authority.")}c=""}else{if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){s-=c.length,c="",a="host";continue}c+=h}break;case"file host":if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){a=2!=c.length||!M.test(c[0])||":"!=c[1]&&"|"!=c[1]?(0==c.length||(this._host=b.call(this,c),c=""),"relative path start"):"relative path";continue}"\t"==h||"\n"==h||"\r"==h?r("Invalid whitespace in file host."):c+=h;break;case"host":case"hostname":if(":"!=h||l){if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){if(this._host=b.call(this,c),c="",a="relative path start",t)break e;continue}"\t"!=h&&"\n"!=h&&"\r"!=h?("["==h?l=!0:"]"==h&&(l=!1),c+=h):r("Invalid code point in host/hostname: "+h)}else if(this._host=b.call(this,c),c="",a="port","hostname"==t)break e;break;case"port":if(/[0-9]/.test(h))c+=h;else{if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h||t){if(""!=c&&((p=parseInt(c,10))!=_[this._scheme]&&(this._port=p+""),c=""),t)break e;a="relative path start";continue}"\t"==h||"\n"==h||"\r"==h?r("Invalid code point in port: "+h):y.call(this)}break;case"relative path start":if("\\"==h&&r("'\\' not allowed in path."),a="relative path","/"!=h&&"\\"!=h)continue;break;case"relative path":T!=h&&"/"!=h&&"\\"!=h&&(t||"?"!=h&&"#"!=h)?"\t"!=h&&"\n"!=h&&"\r"!=h&&(c+=w(h)):("\\"==h&&r("\\ not allowed in relative path."),".."==(c=(f=E[c.toLowerCase()])?f:c)?(this._path.pop(),"/"!=h&&"\\"!=h&&this._path.push("")):"."==c&&"/"!=h&&"\\"!=h?this._path.push(""):"."!=c&&("file"==this._scheme&&0==this._path.length&&2==c.length&&M.test(c[0])&&"|"==c[1]&&(c=c[0]+":"),this._path.push(c)),c="","?"==h?(this._query="?",a="query"):"#"==h&&(this._fragment="#",a="fragment"));break;case"query":t||"#"!=h?T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._query+=(i=void 0,32<(i=(o=h).charCodeAt(0))&&i<127&&-1==[34,35,60,62,96].indexOf(i)?o:encodeURIComponent(o))):(this._fragment="#",a="fragment");break;case"fragment":T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._fragment+=h)}s++}}function r(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function o(e,t){void 0===t||t instanceof o||(t=new o(t+"")),this._url=e,r.call(this);e=e.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");n.call(this,e,null,t)}var _,E,T,M,L,t,i=!1;if(!e.forceJURL)try{var a=new URL("b","http://a");a.pathname="c%20d",i="http://a/c%20d"===a.href}catch(e){}i||((_=Object.create(null)).ftp=21,_.file=0,_.gopher=70,_.http=80,_.https=443,_.ws=80,_.wss=443,(E=Object.create(null))["%2e"]=".",E[".%2e"]="..",E["%2e."]="..",T=void(E["%2e%2e"]=".."),M=/[a-zA-Z]/,L=/[a-zA-Z0-9\+\-\.]/,o.prototype={toString:function(){return this.href},get href(){var e;return this._isInvalid?this._url:((e="")==this._username&&null==this._password||(e=this._username+(null!=this._password?":"+this._password:"")+"@"),this.protocol+(this._isRelative?"//"+e+this.host:"")+this.pathname+this._query+this._fragment)},set href(e){r.call(this),n.call(this,e)},get protocol(){return this._scheme+":"},set protocol(e){this._isInvalid||n.call(this,e+":","scheme start")},get host(){return this._isInvalid?"":this._port?this._host+":"+this._port:this._host},set host(e){!this._isInvalid&&this._isRelative&&n.call(this,e,"host")},get hostname(){return this._host},set hostname(e){!this._isInvalid&&this._isRelative&&n.call(this,e,"hostname")},get port(){return this._port},set port(e){!this._isInvalid&&this._isRelative&&n.call(this,e,"port")},get pathname(){return this._isInvalid?"":this._isRelative?"/"+this._path.join("/"):this._schemeData},set pathname(e){!this._isInvalid&&this._isRelative&&(this._path=[],n.call(this,e,"relative path start"))},get search(){return this._isInvalid||!this._query||"?"==this._query?"":this._query},set search(e){!this._isInvalid&&this._isRelative&&((this._query="?")==e[0]&&(e=e.slice(1)),n.call(this,e,"query"))},get hash(){return this._isInvalid||!this._fragment||"#"==this._fragment?"":this._fragment},set hash(e){this._isInvalid||((this._fragment="#")==e[0]&&(e=e.slice(1)),n.call(this,e,"fragment"))},get origin(){var e;if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}return(e=this.host)?this._scheme+"://"+e:""}},(t=e.URL)&&(o.createObjectURL=function(){return t.createObjectURL.apply(t,arguments)},o.revokeObjectURL=function(e){t.revokeObjectURL(e)}),e.URL=o)}(self),"undefined"==typeof WeakMap&&function(){function e(){this.name="__st"+(1e9*Math.random()>>>0)+t+++"__"}var r=Object.defineProperty,t=Date.now()%1e9;e.prototype={set:function(e,t){var n=e[this.name];return n&&n[0]===e?n[1]=t:r(e,this.name,{value:[e,t],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},delete:function(e){var t=e[this.name];return!(!t||t[0]!==e||(t[0]=t[1]=void 0))},has:function(e){var t=e[this.name];return!!t&&t[0]===e}},window.WeakMap=e}(),function(e){function o(){p=!1;var e=f,r=(f=[],e.sort(function(e,t){return e.uid_-t.uid_}),!1);e.forEach(function(e){var t,n=e.takeRecords();(t=e).nodes_.forEach(function(e){e=s.get(e);e&&e.forEach(function(e){e.observer===t&&e.removeTransientObservers()})}),n.length&&(e.callback_(n,e),r=!0)}),r&&o()}function u(e,t){for(var n=e;n;n=n.parentNode){var r=s.get(n);if(r)for(var o=0;r.length>o;o++){var i=r[o],a=i.options;(n===e||a.subtree)&&(a=t(a))&&i.enqueue(a)}}}function t(e){this.callback_=e,this.nodes_=[],this.records_=[],this.uid_=++m}function r(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 l(e,t){return v=new r(e,t)}function d(e){return g||((n=new r((t=v).type,t.target)).addedNodes=t.addedNodes.slice(),n.removedNodes=t.removedNodes.slice(),n.previousSibling=t.previousSibling,n.nextSibling=t.nextSibling,n.attributeName=t.attributeName,n.attributeNamespace=t.attributeNamespace,n.oldValue=t.oldValue,(g=n).oldValue=e,g);var t,n}function i(e,t){return e===t?e:g&&((t=e)===g||t===v)?g:null}function a(e,t,n){this.observer=e,this.target=t,this.options=n,this.transientObservedNodes=[]}var s,n,c,h,p,f,m,v,g;e.JsMutationObserver||(s=new WeakMap,h=/Trident|Edge/.test(navigator.userAgent)?setTimeout:window.setImmediate||(n=[],c=Math.random()+"",window.addEventListener("message",function(e){e.data===c&&(e=n,n=[],e.forEach(function(e){e()}))}),function(e){n.push(e),window.postMessage(c,"*")}),p=!1,f=[],m=0,t.prototype={observe:function(e,t){if(n=e,e=window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(n)||n,!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,r=s.get(e);r||s.set(e,r=[]);for(var o,i=0;r.length>i;i++)if(r[i].observer===this){(o=r[i]).removeListeners(),o.options=t;break}o||(o=new a(this,e,t),r.push(o),this.nodes_.push(e)),o.addListeners()},disconnect:function(){this.nodes_.forEach(function(e){for(var t=s.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}},a.prototype={enqueue:function(e){var t=this.observer.records_,n=t.length;if(0<t.length){var r=i(t[n-1],e);if(r)return void(t[n-1]=r)}else r=this.observer,f.push(r),p||(p=!0,h(o));t[n]=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){var t;e!==this.target&&(this.addListeners_(e),this.transientObservedNodes.push(e),(t=s.get(e))||s.set(e,t=[]),t.push(this))},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=s.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=((i=new l("attributes",r)).attributeName=t,i.attributeNamespace=n,e.attrChange===MutationEvent.ADDITION?null:e.prevValue);u(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?d(o):i});break;case"DOMCharacterDataModified":var i=l("characterData",r=e.target),o=e.prevValue;u(r,function(e){return e.characterData?e.characterDataOldValue?d(o):i:void 0});break;case"DOMNodeRemoved":this.addTransientObserver(e.target);case"DOMNodeInserted":var a,r=e.target,s="DOMNodeInserted"===e.type?(a=[r],[]):(a=[],[r]),c=r.previousSibling,r=r.nextSibling;(i=l("childList",e.target.parentNode)).addedNodes=a,i.removedNodes=s,i.previousSibling=c,i.nextSibling=r,u(e.relatedNode,function(e){return e.childList?i:void 0})}v=g=void 0}},e.JsMutationObserver=t,e.MutationObserver)||((e.MutationObserver=t)._isPolyfilled=!0)}(self),"undefined"==typeof HTMLTemplateElement&&function(){function n(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case" ":return" "}}var r=document.implementation.createHTMLDocument("template"),o=!0,t=((HTMLTemplateElement=function(){}).prototype=Object.create(HTMLElement.prototype),HTMLTemplateElement.decorate=function(e){if(!e.content){e.content=r.createDocumentFragment();for(var t;t=e.firstChild;)e.content.appendChild(t);if(o)try{Object.defineProperty(e,"innerHTML",{get:function(){for(var e="",t=this.content.firstChild;t;t=t.nextSibling)e+=t.outerHTML||t.data.replace(i,n);return e},set:function(e){for(r.body.innerHTML=e,HTMLTemplateElement.bootstrap(r);this.content.firstChild;)this.content.removeChild(this.content.firstChild);for(;r.body.firstChild;)this.content.appendChild(r.body.firstChild)},configurable:!0})}catch(e){o=!1}HTMLTemplateElement.bootstrap(e.content)}},HTMLTemplateElement.bootstrap=function(e){for(var t,n=e.querySelectorAll("template"),r=0,o=n.length;r<o&&(t=n[r]);r++)HTMLTemplateElement.decorate(t)},document.addEventListener("DOMContentLoaded",function(){HTMLTemplateElement.bootstrap(document)}),document.createElement),i=(document.createElement=function(){"use strict";var e=t.apply(document,arguments);return"template"==e.localName&&HTMLTemplateElement.decorate(e),e},/[&\u00A0<>]/g)}(),function(){"use strict";var e,t;window.performance||(e=Date.now(),window.performance={now:function(){return Date.now()-e}}),window.requestAnimationFrame||(window.requestAnimationFrame=(t=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)?function(e){return t(function(){e(performance.now())})}:function(e){return window.setTimeout(e,1e3/60)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}),(r=document.createEvent("Event")).initEvent("foo",!0,!0),r.preventDefault();r.defaultPrevented||(n=Event.prototype.preventDefault,Event.prototype.preventDefault=function(){this.cancelable&&(n.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))});var n,r=/Trident/.test(navigator.userAgent);(!window.CustomEvent||r&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,Boolean(t.bubbles),Boolean(t.cancelable),t.detail),n},window.CustomEvent.prototype=window.Event.prototype),(!window.Event||r&&"function"!=typeof window.Event)&&(r=window.Event,window.Event=function(e,t){t=t||{};var n=document.createEvent("Event");return n.initEvent(e,Boolean(t.bubbles),Boolean(t.cancelable)),n},window.Event.prototype=r.prototype)}(window.WebComponents),window.HTMLImports=window.HTMLImports||{flags:{}},function(e){function t(e,t){(function e(t,n){{var r;o(n)?t&&t():(r=function(){"complete"!==n.readyState&&n.readyState!==s||(n.removeEventListener(c,r),e(t,n))},n.addEventListener(c,r))}})(function(){!function(e,t){function n(){a==s&&e&&e({allImports:i,loadedImports:c,errorImports:u})}function r(e){h(e),c.push(this),a++,n()}function o(){u.push(this),a++,n()}var i=t.querySelectorAll("link[rel=import]"),a=0,s=i.length,c=[],u=[];if(s)for(var l,d=0;d<s&&(l=i[d]);d++)!function(e){return p?e.__loaded||e.import&&"loading"!==e.import.readyState:e.__importParsed}(l)?(l.addEventListener("load",r),l.addEventListener("error",o)):(c.push(this),a++,n());else n()}(e,t)},t=t||i)}function o(e){return"complete"===e.readyState||e.readyState===s}function h(e){e.target.__loaded=!0}function u(e){e.import?h({target:e}):(e.addEventListener("load",h),e.addEventListener("error",h))}function n(e){return r?window.ShadowDOMPolyfill.wrapIfNeeded(e):e}var p=Boolean("import"in document.createElement("link")),r=Boolean(window.ShadowDOMPolyfill),i=n(document),a={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return n(e)},configurable:!0},a=(Object.defineProperty(document,"_currentScript",a),Object.defineProperty(i,"_currentScript",a),/Trident/.test(navigator.userAgent)),s=a?"complete":"interactive",c="readystatechange";if(p&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;n<r&&(t=e[n]);n++)if(t.addedNodes){o=void 0;i=void 0;s=void 0;c=void 0;a=void 0;var o=t.addedNodes;for(var i,a,s=0,c=o.length;s<c&&(i=o[s]);s++)"link"===(a=i).localName&&"import"===a.rel&&u(i)}}).observe(document.head,{childList:!0}),"loading"===document.readyState))for(var l,d=document.querySelectorAll("link[rel=import]"),f=0,m=d.length;f<m&&(l=d[f]);f++)u(l);t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=i.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),i.dispatchEvent(t)}),e.IMPORT_LINK_TYPE="import",e.useNative=p,e.rootDocument=i,e.whenReady=t,e.isIE=a}(window.HTMLImports),function(t){var n=[];t.addModule=function(e){n.push(e)},t.initializeModules=function(){n.forEach(function(e){e(t)})}}(window.HTMLImports),window.HTMLImports.addModule(function(e){var r=/(url\()([^)]*)(\))/g,o=/(@import[\s]+(?!url\())([^;]*)(;)/g;e.path={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,n),e},resolveUrlsInCssText:function(e,t,n){e=this.replaceUrls(e,n,t,r);return this.replaceUrls(e,n,t,o)},replaceUrls:function(e,o,i,t){return e.replace(t,function(e,t,n,r){n=n.replace(/["']/g,"");return i&&(n=new URL(n,i).href),o.href=n,t+"'"+(n=o.href)+"'"+r})}}}),window.HTMLImports.addModule(function(t){var a={async:!0,ok:function(e){return 200<=e.status&&e.status<300||304===e.status||0===e.status},load:function(e,r,o){var i=new XMLHttpRequest;return(t.flags.debug||t.flags.bust)&&(e+="?"+Math.random()),i.open("GET",e,a.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var t=null;try{var n=i.getResponseHeader("Location");n&&(t="/"===n.substr(0,1)?location.origin+n:n)}catch(e){console.error(e.message)}r.call(o,!a.ok(i)&&i,i.response||i.responseText,t)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};t.xhr=a}),window.HTMLImports.addModule(function(e){function t(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}}var i=e.xhr,a=e.flags;t.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;n<r&&(t=e[n]);n++)this.require(t);this.checkDone()},addNode:function(e){this.inflight++,this.require(e),this.checkDone()},require:function(e){var t=e.src||e.href;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,this.cache[e]),this.tail(),!0):!(this.pending[e]=[t])},fetch:function(r,o){var e,t,n;a.load&&console.log("fetch",r,o),r?r.match(/^data:/)?(e=(n=r.split(","))[0],t=n[1],t=(-1<e.indexOf(";base64")?atob:decodeURIComponent)(t),setTimeout(function(){this.receive(r,o,null,t)}.bind(this),0)):(n=function(e,t,n){this.receive(r,o,e,t,n)}.bind(this),i.load(r,n)):setTimeout(function(){this.receive(r,o,{error:"href must be specified"},null)}.bind(this),0)},receive:function(e,t,n,r,o){this.cache[e]=r;for(var i,a=this.pending[e],s=0,c=a.length;s<c&&(i=a[s]);s++)this.onload(e,i,r,n,o),this.tail();this.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},e.Loader=t}),window.HTMLImports.addModule(function(e){function t(e){this.addCallback=e,this.mo=new MutationObserver(this.handler.bind(this))}t.prototype={handler:function(e){for(var t,n=0,r=e.length;n<r&&(t=e[n]);n++)"childList"===t.type&&t.addedNodes.length&&this.addedNodes(t.addedNodes)},addedNodes:function(e){this.addCallback&&this.addCallback(e);for(var t,n=0,r=e.length;n<r&&(t=e[n]);n++)t.children&&t.children.length&&this.addedNodes(t.children)},observe:function(e){this.mo.observe(e,{childList:!0,subtree:!0})}},e.Observer=t}),window.HTMLImports.addModule(function(n){function a(e){return"link"===e.localName&&e.rel===s}function r(e){e=e.textContent+function(e){var t=e.ownerDocument,e=(t.__importedScripts=t.__importedScripts||0,e.ownerDocument.baseURI),n=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+e+n+".js\n"}(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(e)}var o=n.path,t=n.rootDocument,i=n.flags,u=n.isIE,s=n.IMPORT_LINK_TYPE,e="link[rel="+s+"]",c={documentSelectors:e,importsSelectors:[e,"link[rel=stylesheet]:not([type])","style:not([type])","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var e=this.nextToParse();e&&this.parse(e)},parse:function(e){var t;this.isParsed(e)?i.parse&&console.log("[%s] is already parsed",e.localName):(t=this[this.map[e.localName]])&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){i.parse&&console.log("parsing",e),this.parsingElement=e},markParsingComplete:function(e){e.__importParsed=!0,this.markDynamicParsingComplete(e),e.__importElement&&(e.__importElement.__importParsed=!0,this.markDynamicParsingComplete(e.__importElement)),this.parsingElement=null,i.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){e=this.dynamicElements.indexOf(e);0<=e&&this.dynamicElements.splice(e,1)},parseImport:function(e){if(e.import=e.__doc,window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e.import&&(e.import.__importParsed=!0),this.markParsingComplete(e),e.__resource&&!e.__error?e.dispatchEvent(new CustomEvent("load",{bubbles:!1})):e.dispatchEvent(new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)(t=e.__pending.shift())&&t({target:e});this.parseNext()},parseLink:function(e){a(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t,n,r=e;(n=(t=e).ownerDocument.createElement("style")).textContent=t.textContent,o.resolveUrlsInStyle(n),e=n,(r.__appliedElement=e).__importElement=r,this.parseGeneric(e)},parseGeneric:function(e){this.trackElement(e),this.addElementToDocument(e)},rootImportForElement:function(e){for(var t=e;t.ownerDocument.__importLink;)t=t.ownerDocument.__importLink;return t},addElementToDocument:function(e){var t=this.rootImportForElement(e.__importElement||e);t.parentNode.insertBefore(e,t)},trackElement:function(t,n){function r(e){t.removeEventListener("load",r),t.removeEventListener("error",r),n&&n(e),o.markParsingComplete(t),o.parseNext()}var o=this;if(t.addEventListener("load",r),t.addEventListener("error",r),u&&"style"===t.localName){var e=!1;if(-1==t.textContent.indexOf("@import"))e=!0;else if(t.sheet)for(var i,e=!0,a=t.sheet.cssRules,s=a?a.length:0,c=0;c<s&&(i=a[c]);c++)i.type===CSSRule.IMPORT_RULE&&(e=e&&Boolean(i.styleSheet));e&&setTimeout(function(){t.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(e){var t=document.createElement("script");t.__importElement=e,t.src=e.src||r(e),n.currentScript=e,this.trackElement(t,function(){t.parentNode&&t.parentNode.removeChild(t),n.currentScript=null}),this.addElementToDocument(t)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(t)||this.nextToParseDynamic())},nextToParseInDoc:function(e,t){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var n,r=e.querySelectorAll(this.parseSelectorsForNode(e)),o=0,i=r.length;o<i&&(n=r[o]);o++)if(!this.isParsed(n))return this.hasResource(n)?a(n)?this.nextToParseInDoc(n.__doc,n):n:void 0}return t},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){return(e.ownerDocument||e)===t?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return 0<=this.dynamicElements.indexOf(e)},hasResource:function(e){return!a(e)||void 0!==e.__doc}};n.parser=c,n.IMPORT_SELECTOR=e}),window.HTMLImports.addModule(function(e){function s(e,t){var n=document.implementation.createHTMLDocument(u),r=(n._URL=t,n.createElement("base")),t=(r.setAttribute("href",t),n.baseURI||Object.getOwnPropertyDescriptor(n,"baseURI")||Object.defineProperty(n,"baseURI",{value:t}),n.createElement("meta"));return t.setAttribute("charset","utf-8"),n.head.appendChild(t),n.head.appendChild(r),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var c=e.flags,u=e.IMPORT_LINK_TYPE,t=e.IMPORT_SELECTOR,n=e.rootDocument,r=e.Loader,o=e.Observer,l=e.parser,t={documents:{},documentPreloadSelectors:t,importsPreloadSelectors:[t].join(","),loadNode:function(e){i.addNode(e)},loadSubtree:function(e){e=this.marshalNodes(e);i.addNodes(e)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){return(e.ownerDocument||e)===n?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,t,n,r,o){var i,a;c.load&&console.log("loaded",e,t),t.__resource=n,t.__error=r,a=u,"link"===(i=i=t).localName&&i.getAttribute("rel")===a&&(void 0===(i=this.documents[e])&&((i=r?null:s(n,o||e))&&(i.__importLink=t,this.bootDocument(i)),this.documents[e]=i),t.__doc=i),l.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),l.parseNext()},loadedAll:function(){l.parseNext()}},i=new r(t.loaded.bind(t),t.loadedAll.bind(t));t.observer=new o,document.baseURI||(r={get:function(){var e=document.querySelector("base");return(e||window.location).href},configurable:!0},Object.defineProperty(document,"baseURI",r),Object.defineProperty(n,"baseURI",r)),e.importer=t,e.importLoader=i}),window.HTMLImports.addModule(function(e){var s=e.parser,c=e.importer,e={added:function(e){for(var t,n,r,o,i=0,a=e.length;i<a&&(o=e[i]);i++)t||(t=o.ownerDocument,n=s.isParsed(t)),(r=this.shouldLoadNode(o))&&c.loadNode(o),this.shouldParseNode(o)&&n&&s.parseDynamic(o,r)},shouldLoadNode:function(e){return 1===e.nodeType&&t.call(e,c.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&t.call(e,s.parseSelectorsForNode(e))}},t=(c.observer.addCallback=e.added.bind(e),HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector)}),function(e){function t(){window.HTMLImports.importer.bootDocument(n)}var n,r=e.initializeModules;e.isIE,e.useNative||(r(),n=e.rootDocument,"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t))}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(t){var e=t.flags,n=[];t.addModule=function(e){n.push(e)},t.initializeModules=function(){n.forEach(function(e){e(t)})},t.hasNative=Boolean(document.registerElement),t.isIE=/Trident/.test(navigator.userAgent),t.useNative=!e.register&&t.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function r(e,t){(function e(t,n,r){var o=t.firstElementChild;if(!o)for(o=t.firstChild;o&&o.nodeType!==Node.ELEMENT_NODE;)o=o.nextSibling;for(;o;)!0!==n(o,r)&&e(o,n,r),o=o.nextElementSibling;return null})(e,function(e){return!!t(e)||void n(e,t)}),n(e,t)}function n(e,t){for(var n=e.shadowRoot;n;)r(n,t),n=n.olderShadowRoot}var c=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=function(e,t){!function e(t,n,r){if(t=window.wrap(t),!(0<=r.indexOf(t))){r.push(t);for(var o,i=t.querySelectorAll("link[rel="+c+"]"),a=0,s=i.length;a<s&&(o=i[a]);a++)o.import&&e(o.import,n,r);n(t)}}(e,t,[])},e.forSubtree=r}),window.CustomElements.addModule(function(n){function a(e,t){return r(e,t)||o(e,t)}function r(e,t){return!!n.upgrade(e,t)||void(t&&s(e))}function o(e,t){m(e,function(e){return!!r(e,t)||void 0})}function t(e){b.push(e),y||(y=!0,setTimeout(i))}function i(){y=!1;for(var e,t=b,n=0,r=t.length;n<r&&(e=t[n]);n++)e();b=[]}function s(e){g?t(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&!e.__attached&&(e.__attached=!0,e.attachedCallback)&&e.attachedCallback()}function u(e){g?t(function(){l(e)}):l(e)}function l(e){e.__upgraded__&&e.__attached&&(e.__attached=!1,e.detachedCallback)&&e.detachedCallback()}function d(e,t){if(f.dom){var n=t[0];if(n&&"childList"===n.type&&n.addedNodes&&n.addedNodes){for(var r=n.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var o=(o=r&&(r.URL||r._URL||r.host&&r.host.localName)||"").split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",t.length,o||"")}var i=function(e){for(var t=e,n=window.wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}(e);t.forEach(function(e){"childList"===e.type&&(w(e.addedNodes,function(e){e.localName&&a(e,i)}),w(e.removedNodes,function(e){e.localName&&(u(e=e),m(e,function(e){u(e)}))}))}),f.dom&&console.groupEnd()}function h(e){var t;e.__observer||((t=new MutationObserver(d.bind(this,e))).observe(e,{childList:!0,subtree:!0}),e.__observer=t)}function p(e){e=window.wrap(e),f.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop()),a(e,e===window.wrap(document)),h(e),f.dom&&console.groupEnd()}var f=n.flags,m=n.forSubtree,v=n.forDocumentTree,g=window.MutationObserver._isPolyfilled&&f["throttle-attached"],y=(n.hasPolyfillMutations=g,n.hasThrottledAttached=g,!1),b=[],w=Array.prototype.forEach.call.bind(Array.prototype.forEach),_=Element.prototype.createShadowRoot;_&&(Element.prototype.createShadowRoot=function(){var e=_.call(this);return window.CustomElements.watchShadow(this),e}),n.watchShadow=function(e){if(e.shadowRoot&&!e.shadowRoot.__watched){f.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)h(t),t=t.olderShadowRoot}},n.upgradeDocumentTree=function(e){v(e,p)},n.upgradeDocument=p,n.upgradeSubtree=o,n.upgradeAll=a,n.attached=s,n.takeRecords=function(e){for(e=(e=window.wrap(e))||window.wrap(document);e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(d(e,t.takeRecords()),i())}}),window.CustomElements.addModule(function(o){function i(e,t,n){return a.upgrade&&console.group("upgrade:",e.localName),t.is&&e.setAttribute("is",t.is),r(e,t),e.__upgraded__=!0,(t=e).createdCallback&&t.createdCallback(),n&&o.attached(e),o.upgradeSubtree(e,n),a.upgrade&&console.groupEnd(),e}function r(e,t){if(!Object.__proto__)for(var n=e,r=t.prototype,o=t.native,i={},a=r;a!==o&&a!==HTMLElement.prototype;){for(var s,c=Object.getOwnPropertyNames(a),u=0;s=c[u];u++)i[s]||(Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(a,s)),i[s]=1);a=Object.getPrototypeOf(a)}e.__proto__=t.prototype}var a=o.flags;o.upgrade=function(e,t){if("template"===e.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(e),!e.__upgraded__&&e.nodeType===Node.ELEMENT_NODE){var n=e.getAttribute("is"),r=o.getRegisteredDefinition(e.localName)||o.getRegisteredDefinition(n);if(r&&(n&&r.tag==e.localName||!n&&!r.extends))return i(e,r,t)}},o.upgradeWithDefinition=i,o.implementPrototype=r}),window.CustomElements.addModule(function(f){function m(e,t,n){e=e.toLowerCase();var r=this.getAttribute(e),o=(n.apply(this,arguments),this.getAttribute(e));this.attributeChangedCallback&&o!==r&&this.attributeChangedCallback(e,r,o)}function v(e){return e?w[e.toLowerCase()]:void 0}function o(e,t){e=e&&e.toLowerCase();var n,r=v((t=t&&t.toLowerCase())||e);if(r){if(e==r.tag&&t==r.is)return new r.ctor;if(!t&&!r.is)return new r.ctor}return t?(n=o(e)).setAttribute("is",t):(n=_(e),0<=e.indexOf("-")&&i(n,HTMLElement)),n}function e(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return r(e),e}}var n,t=f.isIE,g=f.upgradeDocumentTree,r=f.upgradeAll,y=f.upgradeWithDefinition,i=f.implementPrototype,a=f.useNative,b=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],w={},_=document.createElement.bind(document),s=document.createElementNS.bind(document),a=Object.__proto__||a?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1};e(Node.prototype,"cloneNode"),e(document,"importNode"),t&&(n=document.importNode,document.importNode=function(){var e,t=n.apply(document,arguments);return t.nodeType==t.DOCUMENT_FRAGMENT_NODE?((e=document.createDocumentFragment()).appendChild(t),e):t}),document.registerElement=function(e,t){var n,r,o,t=t||{};if(!e)throw Error("document.registerElement: first argument `name` must not be empty");if(e.indexOf("-")<0)throw Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+e+"'.");if(function(e){for(var t=0;b.length>t;t++)if(e===b[t])return 1}(e))throw Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+e+"'. The type name is invalid.");if(v(e))throw Error("DuplicateDefinitionError: a type with name '"+e+"' is already registered");t.prototype||(t.prototype=Object.create(HTMLElement.prototype)),t.__name=e.toLowerCase(),t.lifecycle=t.lifecycle||{},t.ancestry=function e(t){t=v(t);return t?e(t.extends).concat([t]):[]}(t.extends);for(var i,a=t,s=a.extends,c=0;i=a.ancestry[c];c++)s=i.is&&i.tag;a.tag=s||a.__name,s&&(a.is=a.__name);var e=t;if(!Object.__proto__){var u=HTMLElement.prototype;e.is&&(p=document.createElement(e.tag),u=Object.getPrototypeOf(p));for(var l,d=e.prototype,h=!1;d;)d==u&&(h=!0),(l=Object.getPrototypeOf(d))&&(d.__proto__=l),d=l;h||console.warn(e.tag+" prototype not found in prototype chain for "+e.is),e.native=u}var p=t.prototype;return p.setAttribute._polyfilled||(n=p.setAttribute,p.setAttribute=function(e,t){m.call(this,e,t,n)},r=p.removeAttribute,p.removeAttribute=function(e){m.call(this,e,null,r)},p.setAttribute._polyfilled=!0),e=t.__name,(w[e]=t).ctor=(o=t,function(){return y(_((e=o).tag),e);var e}),t.ctor.prototype=t.prototype,t.prototype.constructor=t.ctor,f.ready&&g(document),t.ctor},document.createElement=o,document.createElementNS=function(e,t,n){return"http://www.w3.org/1999/xhtml"===e?o(t,n):s(e,t)},f.registry=w,f.instanceof=a,f.reservedTagList=b,f.getRegisteredDefinition=v,document.register=document.registerElement}),function(e){function t(){o(window.wrap(document)),window.CustomElements.ready=!0,(window.requestAnimationFrame||function(e){setTimeout(e,16)})(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=e.useNative,r=e.initializeModules,o=(e.isIE,n?(e.watchShadow=n=function(){},e.upgrade=n,e.upgradeAll=n,e.upgradeDocumentTree=n,e.upgradeSubtree=n,e.takeRecords=n,e.instanceof=function(e,t){return e instanceof t}):r(),e.upgradeDocumentTree),i=e.upgradeDocument;window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){e.import&&i(wrap(e.import))}),"complete"!==document.readyState&&!e.flags.eager&&("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready)?(n=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded",window.addEventListener(n,t)):t()}(window.CustomElements),function(){var e=document.createElement("style"),t=(e.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n",document.querySelector("head"));t.insertBefore(e,t.firstChild)}(window.WebComponents),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.PointerEventsPolyfill=t()}(this,function(){"use strict";function e(){this.array=[],this.size=0}function t(e,t,n,r){this.addCallback=e.bind(r),this.removeCallback=t.bind(r),this.changedCallback=n.bind(r),_&&(this.observer=new _(this.mutationWatcher.bind(this)))}function n(e){return"body /shadow-deep/ "+r(e)}function r(e){return'[touch-action="'+e+'"]'}function o(e){return"{ -ms-touch-action: "+e+"; touch-action: "+e+"; touch-action-delay: none; }"}function i(e){if(!m.pointermap.has(e))throw Error("InvalidPointerId")}var a=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],s=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],c=function(e,t){t=t||Object.create(null);var n=document.createEvent("Event");n.initEvent(e,t.bubbles||!1,t.cancelable||!1);for(var r,o=2;o<a.length;o++)n[r=a[o]]=t[r]||s[o];return n.buttons=t.buttons||0,e=t.pressure||(n.buttons?.5:0),n.x=n.clientX,n.y=n.clientY,n.pointerId=t.pointerId||0,n.width=t.width||0,n.height=t.height||0,n.pressure=e,n.tiltX=t.tiltX||0,n.tiltY=t.tiltY||0,n.pointerType=t.pointerType||"",n.hwTimestamp=t.hwTimestamp||0,n.isPrimary=t.isPrimary||!1,n},u=window.Map&&window.Map.prototype.forEach?Map:e,l=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp"],d=[!(e.prototype={set:function(e,t){return void 0===t?this.delete(e):(this.has(e)||this.size++,void(this.array[e]=t))},has:function(e){return void 0!==this.array[e]},delete:function(e){this.has(e)&&(delete this.array[e],this.size--)},get:function(e){return this.array[e]},clear:function(){this.array.length=0,this.size=0},forEach:function(n,r){return this.array.forEach(function(e,t){n.call(r,e,t,this)},this)}}),!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],h={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},p="undefined"!=typeof SVGElementInstance,f={pointermap:new u,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(e,t){var n=t,t=n.events;t&&(t.forEach(function(e){n[e]&&(this.eventMap[e]=n[e].bind(n))},this),this.eventSources[e]=n,this.eventSourceList.push(n))},register:function(e){for(var t,n=this.eventSourceList.length,r=0;r<n&&(t=this.eventSourceList[r]);r++)t.register.call(t,e)},unregister:function(e){for(var t,n=this.eventSourceList.length,r=0;r<n&&(t=this.eventSourceList[r]);r++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(e){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,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){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.contains(e.target,e.relatedTarget)||this.leave(e)},enterOver:function(e){this.over(e),this.contains(e.target,e.relatedTarget)||this.enter(e)},eventHandler:function(e){var t;e._handledByPE||(t=e.type,(t=this.eventMap&&this.eventMap[t])&&t(e),e._handledByPE=!0)},listen:function(t,e){e.forEach(function(e){this.addEvent(t,e)},this)},unlisten:function(t,e){e.forEach(function(e){this.removeEvent(t,e)},this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(e,t){this.captureInfo[t.pointerId]&&(t.relatedTarget=null);e=new c(e,t);return t.preventDefault&&(e.preventDefault=t.preventDefault),e._target=e._target||t.target,e},fireEvent:function(e,t){e=this.makeEvent(e,t);return this.dispatchEvent(e)},cloneEvent:function(e){for(var t,n=Object.create(null),r=0;r<l.length;r++)n[t=l[r]]=e[t]||d[r],!p||"target"!==t&&"relatedTarget"!==t||n[t]instanceof SVGElementInstance&&(n[t]=n[t].correspondingUseElement);return e.preventDefault&&(n.preventDefault=function(){e.preventDefault()}),n},getTarget:function(e){var t=this.captureInfo[e.pointerId];return t?e._target!==t&&e.type in h?void 0:t:e._target},setCapture:function(e,t){this.captureInfo[e]&&this.releaseCapture(e),this.captureInfo[e]=t;var n=document.createEvent("Event");n.initEvent("gotpointercapture",!0,!1),n.pointerId=e,this.implicitRelease=this.releaseCapture.bind(this,e),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease),n._target=t,this.asyncDispatchEvent(n)},releaseCapture:function(e){var t,n=this.captureInfo[e];n&&((t=document.createEvent("Event")).initEvent("lostpointercapture",!0,!1),t.pointerId=e,this.captureInfo[e]=void 0,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease),t._target=n,this.asyncDispatchEvent(t))},dispatchEvent:function(e){var t=this.getTarget(e);return t?t.dispatchEvent(e):void 0},asyncDispatchEvent:function(e){requestAnimationFrame(this.dispatchEvent.bind(this,e))}},m=(f.boundHandler=f.eventHandler.bind(f),f),v={shadow:function(e){return e?e.shadowRoot||e.webkitShadowRoot:void 0},canTarget:function(e){return e&&Boolean(e.elementFromPoint)},targetingShadow:function(e){e=this.shadow(e);return this.canTarget(e)?e:void 0},olderShadow:function(e){var t=e.olderShadowRoot;return t||(e=e.querySelector("shadow"))&&(t=e.olderShadowRoot),t},allShadows:function(e){for(var t=[],n=this.shadow(e);n;)t.push(n),n=this.olderShadow(n);return t},searchRoot:function(e,t,n){if(e){for(var r,o,e=e.elementFromPoint(t,n),i=this.targetingShadow(e);i;){if(r=i.elementFromPoint(t,n))return o=this.targetingShadow(r),this.searchRoot(o,t,n)||r;i=this.olderShadow(i)}return e}},owner:function(e){for(var t=e;t.parentNode;)t=t.parentNode;return t=t.nodeType!==Node.DOCUMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?document:t},findTarget:function(e){var t=e.clientX,n=e.clientY,e=this.owner(e.target);return e.elementFromPoint(t,n)||(e=document),this.searchRoot(e,t,n)}},g=Array.prototype.forEach.call.bind(Array.prototype.forEach),y=Array.prototype.map.call.bind(Array.prototype.map),b=Array.prototype.slice.call.bind(Array.prototype.slice),w=Array.prototype.filter.call.bind(Array.prototype.filter),_=window.MutationObserver||window.WebKitMutationObserver,A={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]},f=(t.prototype={watchSubtree:function(e){this.observer&&v.canTarget(e)&&this.observer.observe(e,A)},enableOnSubtree:function(e){this.watchSubtree(e),e===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(e)},installNewSubtree:function(e){g(this.findElements(e),this.addElement,this)},findElements:function(e){return e.querySelectorAll?e.querySelectorAll("[touch-action]"):[]},removeElement:function(e){this.removeCallback(e)},addElement:function(e){this.addCallback(e)},elementChanged:function(e,t){this.changedCallback(e,t)},concatLists:function(e,t){return e.concat(b(t))},installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(e){return e.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(e){var t=y(e,this.findElements,this);return t.push(w(e,this.isElement)),t.reduce(this.concatLists,[])},mutationWatcher:function(e){e.forEach(this.mutationHandler,this)},mutationHandler:function(e){"childList"===e.type?(this.flattenMutationTree(e.addedNodes).forEach(this.addElement,this),this.flattenMutationTree(e.removedNodes).forEach(this.removeElement,this)):"attributes"===e.type&&this.elementChanged(e.target,e.oldValue)}},t),E=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],T="",M=window.PointerEvent||window.MSPointerEvent,L=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,C=m.pointermap,S=[1,4,2,8,16],O=!1;try{O=1===new MouseEvent("test",{buttons:1}).buttons}catch(e){}var P,N={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(e){m.listen(e,this.events)},unregister:function(e){m.unlisten(e,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(e){for(var t,n=this.lastTouches,r=e.clientX,o=e.clientY,i=0,a=n.length;i<a&&(t=n[i]);i++){var s=Math.abs(r-t.x),c=Math.abs(o-t.y);if(s<=25&&c<=25)return!0}},prepareEvent:function(e){var t=m.cloneEvent(e),n=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),n()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var n=C.get(this.POINTER_ID);e.buttons=n?n.buttons:0,t.buttons=e.buttons},mousedown:function(e){var t,n;this.isEventSimulatedFromTouch(e)||(t=C.get(this.POINTER_ID),n=this.prepareEvent(e),O||(n.buttons=S[n.button],t&&(n.buttons|=t.buttons),e.buttons=n.buttons),C.set(this.POINTER_ID,e),t?m.move(n):m.down(n))},mousemove:function(e){var t;this.isEventSimulatedFromTouch(e)||(t=this.prepareEvent(e),O||this.prepareButtonsForMove(t,e),m.move(t))},mouseup:function(e){var t,n,r;this.isEventSimulatedFromTouch(e)||(t=C.get(this.POINTER_ID),n=this.prepareEvent(e),O||(r=S[n.button],n.buttons=t?t.buttons&~r:0,e.buttons=n.buttons),C.set(this.POINTER_ID,e),0===n.buttons||n.buttons===S[n.button]?(this.cleanupMouse(),m.up(n)):m.move(n))},mouseover:function(e){var t;this.isEventSimulatedFromTouch(e)||(t=this.prepareEvent(e),O||this.prepareButtonsForMove(t,e),m.enterOver(t))},mouseout:function(e){var t;this.isEventSimulatedFromTouch(e)||(t=this.prepareEvent(e),O||this.prepareButtonsForMove(t,e),m.leaveOut(t))},cancel:function(e){e=this.prepareEvent(e);m.cancel(e),this.cleanupMouse()},cleanupMouse:function(){C.delete(this.POINTER_ID)}},H=m.captureInfo,j=v.findTarget.bind(v),I=v.allShadows.bind(v),D=m.pointermap,k="touch-action",x={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){q.enableOnSubtree(e)},unregister:function(e){},elementAdded:function(e){var t=e.getAttribute(k),n=this.touchActionToScrollType(t);n&&(e._scrollType=n,m.listen(e,this.events),I(e).forEach(function(e){e._scrollType=n,m.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,m.unlisten(e,this.events),I(e).forEach(function(e){e._scrollType=void 0,m.unlisten(e,this.events)},this)},elementChanged:function(e,t){var n=e.getAttribute(k),r=this.touchActionToScrollType(n),n=this.touchActionToScrollType(t);r&&n?(e._scrollType=r,I(e).forEach(function(e){e._scrollType=r},this)):n?this.elementRemoved(e):r&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=this.scrollTypes;return"none"===e?"none":e===t.XSCROLLER?"X":e===t.YSCROLLER?"Y":t.SCROLLER.exec(e)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===D.size||1===D.size&&D.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){return"touchstart"!==e&&"touchmove"!==e?0:1},touchToPointer:function(e){var t=this.currentTouchEvent,n=m.cloneEvent(e),r=n.pointerId=e.identifier+2,o=(n.target=H[r]||j(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(t.type),n.width=e.radiusX||e.webkitRadiusX||0,n.height=e.radiusY||e.webkitRadiusY||0,n.pressure=e.force||e.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE,this);return n.preventDefault=function(){o.scrolling=!1,o.firstXY=null,t.preventDefault()},n},processTouches:function(e,t){var n=e.changedTouches;this.currentTouchEvent=e;for(var r,o=0;n.length>o;o++)r=n[o],t.call(this,this.touchToPointer(r))},shouldScroll:function(e){var t,n;if(this.firstXY)return e="none"!==(n=e.currentTarget._scrollType)&&("XY"===n||(e=e.changedTouches[0],t="Y"===n?"X":"Y",n=Math.abs(e["client"+n]-this.firstXY[n]),Math.abs(e["client"+t]-this.firstXY[t])<=n)),this.firstXY=null,e},findTouch:function(e,t){for(var n,r=0,o=e.length;r<o&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var n,r=e.touches;D.size>=r.length&&(n=[],D.forEach(function(e,t){1===t||this.findTouch(r,t-2)||(t=e.out,n.push(t))},this),n.forEach(this.cancelOut,this))},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){D.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),m.over(e),m.enter(e),m.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 t,n,r=D.get(e.pointerId);r&&(t=r.out,n=r.outTarget,m.move(e),t&&n!==e.target&&(t.relatedTarget=e.target,e.relatedTarget=n,t.target=n,e.target?(m.leaveOut(t),m.enterOver(e)):(e.target=n,e.relatedTarget=null,this.cancelOut(e))),r.out=e,r.outTarget=e.target)},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(m.up(e),m.out(e),m.leave(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){m.cancel(e),m.out(e),m.leave(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){D.delete(e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=N.lastTouches,e=e.changedTouches[0];this.isPrimaryTouch(e)&&(e={x:e.clientX,y:e.clientY},t.push(e),t=function(e,t){t=e.indexOf(t);-1<t&&e.splice(t,1)}.bind(null,t,e),setTimeout(t,2500))}},q=new f(x.elementAdded,x.elementRemoved,x.elementChanged,x),R=m.pointermap,F=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,U={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){m.listen(e,this.events)},unregister:function(e){m.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return F&&((t=m.cloneEvent(e)).pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){R.delete(e)},MSPointerDown:function(e){R.set(e.pointerId,e);e=this.prepareEvent(e);m.down(e)},MSPointerMove:function(e){e=this.prepareEvent(e);m.move(e)},MSPointerUp:function(e){var t=this.prepareEvent(e);m.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){e=this.prepareEvent(e);m.leaveOut(e)},MSPointerOver:function(e){e=this.prepareEvent(e);m.enterOver(e)},MSPointerCancel:function(e){var t=this.prepareEvent(e);m.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){e=m.makeEvent("lostpointercapture",e);m.dispatchEvent(e)},MSGotPointerCapture:function(e){e=m.makeEvent("gotpointercapture",e);m.dispatchEvent(e)}},Y=window.navigator.msPointerEnabled?(P=function(e){i(e),this.msSetPointerCapture(e)},function(e){i(e),this.msReleasePointerCapture(e)}):(P=function(e){i(e),m.setCapture(e,this)},function(e){i(e),m.releaseCapture(e,this)});return M&&(E.forEach(function(e){e+""===e?(T+=r(e)+o(e)+"\n",L&&(T+=n(e)+o(e)+"\n")):(T+=e.selectors.map(r)+o(e.rule)+"\n",L&&(T+=e.selectors.map(n)+o(e.rule)+"\n"))}),(M=document.createElement("style")).textContent=T,document.head.appendChild(M)),window.PointerEvent||(window.PointerEvent=c,window.navigator.msPointerEnabled?(E=window.navigator.msMaxTouchPoints,Object.defineProperty(window.navigator,"maxTouchPoints",{value:E,enumerable:!0}),m.registerSource("ms",U)):(m.registerSource("mouse",N),void 0!==window.ontouchstart&&m.registerSource("touch",x)),m.register(document)),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:P},releasePointerCapture:{value:Y}}),{dispatcher:m,Installer:f,PointerEvent:c,PointerMap:u,targetFinding:v}}),function(){function s(e){e=N.call(e);return P[e]||(P[e]=e.match(I)[1].toLowerCase())}function o(e,t){t=o[t||s(e)];return t?t(e):e}function p(e){return A[s(e)]?[e]:Array.prototype.slice.call(e,0)}function c(e,t,n){var r=s(n);return"object"==r&&"object"==s(e[t])?R.merge(e[t],n):e[t]=o(n,r),e}function d(e,t,n){var r,o,i={};for(o in t)i[o.split(":")[0]]=o;for(o in n)r=i[o.split(":")[0]],"function"==typeof t[r]?(r.match(":mixins")||(t[r+":mixins"]=t[r],delete t[r],r+=":mixins"),t[r].__mixin__=R.applyPseudos(o+(o.match(":mixins")?"":":mixins"),n[o],e.pseudos,t[r].__mixin__)):(t[o]=n[o],delete t[r])}function f(l){return function e(t,n){for(var r=t.length;r--;)n.unshift(t[r]),R.mixins[t[r]].mixins&&e(R.mixins[t[r]].mixins,n);return n}(l.mixins,[]).forEach(function(e){var t,n=R.mixins[e];for(t in n){var r=n[t],o=l[t];if(o)switch(t){case"mixins":break;case"events":i=c=s=a=void 0;var i,a=l,s=o,c=r;for(i in c)s[i+":__mixin__("+H+++")"]=R.applyPseudos(i,c[i],a.pseudos);break;case"accessors":case"prototype":for(var u in r)o[u]?d(l,o[u],r[u]):o[u]=r[u];break;default:d(l,o,r)}else l[t]=r}}),l}function e(e){return 0===e.button}function i(e,t){var n,r,o,i,a,s=Object.getOwnPropertyDescriptor(e,"target");for(n in t)D[n]||(r=n,o=e,i=t,a=s,a?o[r]=i[r]:Object.defineProperty(o,r,{writable:!0,enumerable:!0,value:i[r]}));e.baseEvent=t}function m(e,t,n,r,o){a[o].call(e,n,t&&t.boolean?"":r)}function v(e,t,n,r,o){if(t&&(t.property||t.selector))for(var i=t.property?[e.xtag[t.property]]:t.selector?R.query(e,t.selector):[],a=i.length;a--;)i[a][o](n,r)}function g(e,t){e.prototype[t]={};var n,r,o,i=e.accessors[t],a=i.attribute;for(r in a&&(n=a.name=(a?a.name||t.replace(T,"$1-$2"):t).toLowerCase(),a.key=t,e.attributes[n]=a),i)!function(e,t,r,o,i,a){var n=r.split(":"),s=n[0];"get"==s?(n[0]=t,e.prototype[t].get=R.applyPseudos(n.join(":"),o[r],e.pseudos,o[r])):"set"==s?(n[0]=t,e.prototype[t].set=R.applyPseudos(n.join(":"),i?function(e){var t,n="setAttribute";i.boolean?(e=!!e,t=this.hasAttribute(a),e||(n="removeAttribute")):(e=i.validate?i.validate.call(this,e):e,t=this.getAttribute(a)),m(this,i,a,e,n),o[r].call(this,e,t),v(this,i,a,e,n)}:o[r]?function(e){o[r].call(this,e)}:null,e.pseudos,o[r]),i&&(i.setter=o[r])):e.prototype[t][r]=o[r]}(e,t,r,i,a,n);a&&(e.prototype[t].get||(o=(a.boolean?"has":"get")+"Attribute",e.prototype[t].get=function(){return this[o](n)}),e.prototype[t].set||(e.prototype[t].set=function(e){e=a.boolean?!!e:a.validate?a.validate.call(this,e):e;var t=!a.boolean||e?"setAttribute":"removeAttribute";m(this,a,n,e,t),v(this,a,n,e,t)}))}function y(e){return"function"==typeof e?j.exec(""+e)[1]:e}function h(){}function b(){return!0}var t,n,w=window,_=document,a={setAttribute:Element.prototype.setAttribute,removeAttribute:Element.prototype.removeAttribute},E=Element.prototype.createShadowRoot,u=_.createElement("div"),l=/,/g,T=/([a-z])([A-Z])/g,r=/\(|\)/g,M=/:(\w+)\u276A(.+?(?=\u276B))|:(\w+)/g,L=/(\d+)/g,C={action:function(e,t){return-1<e.value.match(L).indexOf(t.keyCode+"")==("keypass"==e.name)||null}},S={dom:"ms"==(t=((t=Object.keys(window).join()).match(/,(ms)/)||t.match(/,(moz)/)||t.match(/,(O)/)||[null,"webkit"])[1].toLowerCase())?"MS":t,lowercase:t,css:"-"+t+"-",js:"ms"==t?t:t.charAt(0).toUpperCase()+t.substring(1)},O=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype[S.lowercase+"MatchesSelector"],P={},N=P.toString,I=/\s([a-zA-Z]+)/,A=(o.object=function(e){var t,n={};for(t in e)n[t]=o(e[t]);return n},o.array=function(e){for(var t=e.length,n=Array(t);t--;)n[t]=o(e[t]);return n},{undefined:1,null:1,number:1,boolean:1,string:1,function:1}),H=0,D={};for(n in _.createEvent("CustomEvent"))D[n]=1;var k,x,j=/\/\*!?(?:\@preserve)?[ \t]*(?:\r\n|\n)([\s\S]*?)(?:\r\n|\n)\s*\*\//,R={tags:{},defaultOptions:{pseudos:[],mixins:[],events:{},methods:{},accessors:{},lifecycle:{},attributes:{},prototype:{xtag:{get:function(){return this.__xtag__||(this.__xtag__={data:{}})}}}},register:function(e,t){if("string"!=typeof e)throw"First argument must be a Custom Element string name";e=e.toLowerCase(),R.tags[e]=t||{};var n,o=t.prototype,a=(delete t.prototype,R.tags[e].compiled=f(R.merge({},R.defaultOptions,t))),i=a.prototype,r=a.lifecycle;for(n in a.events)a.events[n]=R.parseEvent(n,a.events[n]);for(n in r)r[n.split(":")[0]]=R.applyPseudos(n,r[n],a.pseudos,r[n]);for(n in a.methods)i[n.split(":")[0]]={value:R.applyPseudos(n,a.methods[n],a.pseudos,a.methods[n]),enumerable:!0};for(n in a.accessors)g(a,n);a.shadow&&(a.shadow=a.shadow.nodeName?a.shadow:R.createFragment(a.shadow)),a.content&&(a.content=a.content.nodeName?a.content.innerHTML:y(a.content));var s=r.created,c=r.finalized,u=(i.createdCallback={enumerable:!0,value:function(){var e,t=this,n=(a.shadow&&E&&this.createShadowRoot().appendChild(a.shadow.cloneNode(!0)),a.content&&(this.appendChild(document.createElement("div")).outerHTML=a.content),s?s.apply(this,arguments):null);for(e in R.addEvents(this,a.events),a.attributes){var r=a.attributes[e],o=this.hasAttribute(e),i=void 0!==r.def;(o||r.boolean||i)&&(this[r.key]=r.boolean?o:!o&&i?r.def:this.getAttribute(e))}return a.pseudos.forEach(function(e){e.onAdd.call(t,e)}),this.xtagComponentReady=!0,c&&c.apply(this,arguments),n}},r.inserted),l=r.removed,t=((u||l)&&(i.attachedCallback={value:function(){return l&&(this.xtag.__parentNode__=this.parentNode),u?u.apply(this,arguments):void 0},enumerable:!0}),l&&(i.detachedCallback={value:function(){var e=p(arguments),e=(e.unshift(this.xtag.__parentNode__),l.apply(this,e));return delete this.xtag.__parentNode__,e},enumerable:!0}),r.attributeChanged&&(i.attributeChangedCallback={value:r.attributeChanged,enumerable:!0}),i.setAttribute={writable:!0,enumerable:!0,value:function(e,t){var n,e=e.toLowerCase(),r=a.attributes[e];r&&(n=this.getAttribute(e),t=r.boolean?"":r.validate?r.validate.call(this,t):t),m(this,r,e,t,"setAttribute"),r&&(r.setter&&r.setter.call(this,!!r.boolean||t,n),v(this,r,e,t,"setAttribute"))}},i.removeAttribute={writable:!0,enumerable:!0,value:function(e){var e=e.toLowerCase(),t=a.attributes[e],n=this.hasAttribute(e);m(this,t,e,"","removeAttribute"),t&&(t.setter&&t.setter.call(this,!t.boolean&&void 0,n),v(this,t,e,"","removeAttribute"))}},{}),d=o instanceof w.HTMLElement,h=a.extends&&(t.extends=a.extends);return o&&Object.getOwnPropertyNames(o).forEach(function(e){var t=i[e],n=d?Object.getOwnPropertyDescriptor(o,e):o[e];if(t)for(var r in n)t[r]="function"==typeof n[r]&&t[r]?R.wrap(n[r],t[r]):n[r];i[e]=t||n}),t.prototype=Object.create((h?Object.create(_.createElement(h).constructor):w.HTMLElement).prototype,i),_.registerElement(e,t)},mixins:{},prefix:S,captureEvents:{focus:1,blur:1,scroll:1,DOMMouseScroll:1},customEvents:{animationstart:{attach:[S.dom+"AnimationStart"]},animationend:{attach:[S.dom+"AnimationEnd"]},transitionend:{attach:[S.dom+"TransitionEnd"]},move:{attach:["pointermove"]},enter:{attach:["pointerenter"]},leave:{attach:["pointerleave"]},scrollwheel:{attach:["DOMMouseScroll","mousewheel"],condition:function(e){return e.delta=e.wheelDelta?e.wheelDelta/40:Math.round(e.detail/3.5*-1),!0}},tap:{attach:["pointerdown","pointerup"],condition:function(e,t){if("pointerdown"==e.type)t.startX=e.clientX,t.startY=e.clientY;else if(0===e.button&&Math.abs(t.startX-e.clientX)<10&&Math.abs(t.startY-e.clientY)<10)return!0}},tapstart:{attach:["pointerdown"],condition:e},tapend:{attach:["pointerup"],condition:e},tapmove:{attach:["pointerdown"],condition:function(e,t){var n;return"pointerdown"==e.type?(n=t.listener.bind(this),t.tapmoveListeners||(t.tapmoveListeners=R.addEvents(document,{pointermove:n,pointerup:n,pointercancel:n}))):"pointerup"!=e.type&&"pointercancel"!=e.type||(R.removeEvents(document,t.tapmoveListeners),t.tapmoveListeners=null),!0}},taphold:{attach:["pointerdown","pointerup"],condition:function(e,t){if("pointerdown"==e.type)(t.pointers=t.pointers||{})[e.pointerId]=setTimeout(R.fireEvent.bind(null,this,"taphold"),t.duration||1e3);else{if("pointerup"!=e.type)return!0;t.pointers&&(clearTimeout(t.pointers[e.pointerId]),delete t.pointers[e.pointerId])}}}},pseudos:{__mixin__:{},mixins:{onCompiled:function(t,e){var n=e.source&&e.source.__mixin__||e.source;if(!n)return t;switch(e.value){case null:case"":case"before":return function(){return n.apply(this,arguments),t.apply(this,arguments)};case"after":return function(){var e=t.apply(this,arguments);return n.apply(this,arguments),e};case"none":return t}}},keypass:C,keyfail:C,delegate:{action:function(e,t){for(var n,r=t.target,o=t.currentTarget;!n&&r&&r!=o;)r.tagName&&O.call(r,e.value)&&(n=r),r=r.parentNode;return(n=!n&&o.tagName&&O.call(o,e.value)?o:n)?e.listener=e.listener.bind(n):null}},preventable:{action:function(e,t){return!t.defaultPrevented}},duration:{onAdd:function(e){e.source.duration=Number(e.value)}},capture:{onCompiled:function(e,t){t.source&&(t.source.capture=!0)}}},clone:o,typeOf:s,toArray:p,wrap:function(t,n){return function(){var e=t.apply(this,arguments);return n.apply(this,arguments),e}},merge:function(e,t,n){if("string"==s(t))return c(e,t,n);for(var r=1,o=arguments.length;r<o;r++){var i,a=arguments[r];for(i in a)c(e,i,a[i])}return e},uid:function(){return Math.random().toString(36).substr(2,10)},query:function(e,t){return(t||"").length?p(e.querySelectorAll(t)):[]},skipTransition:function(e,t,n){var r=S.js+"TransitionProperty",o=(e.style[r]=e.style.transitionProperty="none",t?t.call(n||e):null);return R.skipFrame(function(){e.style[r]=e.style.transitionProperty="",o&&o.call(n||e)})},requestFrame:(x=w.requestAnimationFrame||w[S.lowercase+"RequestAnimationFrame"]||function(e){return w.setTimeout(e,20)},function(e){return x(e)}),cancelFrame:(k=w.cancelAnimationFrame||w[S.lowercase+"CancelAnimationFrame"]||w.clearTimeout,function(e){return k(e)}),skipFrame:function(e){var t=R.requestFrame(function(){t=R.requestFrame(e)});return t},matchSelector:function(e,t){return O.call(e,t)},set:function(e,t,n){e[t]=n,window.CustomElements&&CustomElements.upgradeAll(e)},innerHTML:function(e,t){R.set(e,"innerHTML",t)},hasClass:function(e,t){return-1<e.className.split(" ").indexOf(t.trim())},addClass:function(e,t){var n=e.className.trim().split(" ");return t.trim().split(" ").forEach(function(e){~n.indexOf(e)||n.push(e)}),e.className=n.join(" ").trim(),e},removeClass:function(e,t){var n=t.trim().split(" ");return e.className=e.className.trim().split(" ").filter(function(e){return e&&!~n.indexOf(e)}).join(" "),e},toggleClass:function(e,t){return R[R.hasClass(e,t)?"removeClass":"addClass"].call(null,e,t)},queryChildren:function(e,t){var n=e.id,r="#"+(e.id=n||"x_"+R.uid())+" > ",o=e.parentNode||!u.appendChild(e),r=(t=r+(t+"").replace(l,","+r),e.parentNode.querySelectorAll(t));return n||e.removeAttribute("id"),o||u.removeChild(e),p(r)},createFragment:function(e){var t=document.createElement("template");return e&&(e.nodeName?p(arguments).forEach(function(e){t.content.appendChild(e)}):t.innerHTML=y(e)),document.importNode(t.content,!0)},manipulate:function(e,t){var n=e.nextSibling,r=e.parentNode,t=t.call(e)||e;n?r.insertBefore(t,n):r.appendChild(t)},applyPseudos:function(o,i,a,s){var e,c=i,u={};if(o.match(":")){var l=[],t=0;o.replace(r,function(e){return"("==e?1==++t?"❪":"(":--t?")":"❫"}).replace(M,function(e,t,n,r){l.push([t||r,n])});for(var d=l.length;d--;)!function(){var e=l[d][0],t=l[d][1];if(!R.pseudos[e])throw"pseudo not found: "+e+" "+t;var t=""===t||void 0===t?null:t,n=u[d]=Object.create(R.pseudos[e]),r=(n.key=o,n.name=e,n.value=t,n.arguments=(t||"").split(","),n.action=n.action||b,n.source=s,n.onAdd=n.onAdd||h,n.onRemove=n.onRemove||h,n.listener=c);c=function(){var e=n.action.apply(this,[n].concat(p(arguments)));return null===e||!1===e||(e=n.listener.apply(this,arguments),n.listener=r),e},a?a.push(n):n.onAdd.call(i,n)}()}for(e in u)u[e].onCompiled&&(c=u[e].onCompiled(c,u[e])||c);return c},removePseudos:function(t,e){e.forEach(function(e){e.onRemove.call(t,e)})},parseEvent:function(e,t){var e=e.split(":"),r=e.shift(),n=R.customEvents[r],o=R.merge({type:r,stack:h,condition:b,capture:R.captureEvents[r],attach:[],_attach:[],pseudos:"",_pseudos:[],onAdd:h,onRemove:h},n||{}),i=(o.attach=p(o.base||o.attach),o.chain=r+(o.pseudos.length?":"+o.pseudos:"")+(e.length?":"+e.join(":"):""),R.applyPseudos(o.chain,t,o._pseudos,o));return o.stack=function(e){e.currentTarget=e.currentTarget||this;var t=e.detail||{};return t.__stack__?t.__stack__==i?(e.stopPropagation(),e.cancelBubble=!0,i.apply(this,arguments)):void 0:i.apply(this,arguments)},o.listener=function(e){var t=p(arguments),n=o.condition.apply(this,t.concat([o]));return n&&(e.type!=r&&e.baseEvent&&e.type!=e.baseEvent.type?void R.fireEvent(e.target,r,{baseEvent:e,detail:!0!==n&&(n.__stack__=i)?n:{__stack__:i}}):o.stack.apply(this,t))},o.attach.forEach(function(e){o._attach.push(R.parseEvent(e,o.listener))}),o},addEvent:function(t,e,n,r){e="function"==typeof n?R.parseEvent(e,n):n;return e._pseudos.forEach(function(e){e.onAdd.call(t,e)}),e._attach.forEach(function(e){R.addEvent(t,e.type,e)}),e.onAdd.call(t,e,e.listener),t.addEventListener(e.type,e.stack,r||e.capture),e},addEvents:function(e,t){var n,r={};for(n in t)r[n]=R.addEvent(e,n,t[n]);return r},removeEvent:function(t,e,n){(n=n||e).onRemove.call(t,n,n.listener),R.removePseudos(t,n._pseudos),n._attach.forEach(function(e){R.removeEvent(t,e)}),t.removeEventListener(n.type,n.stack)},removeEvents:function(e,t){for(var n in t)R.removeEvent(e,t[n])},fireEvent:function(e,t,n){var r=_.createEvent("CustomEvent");r.initCustomEvent(t,!1!==(n=n||{}).bubbles,!1!==n.cancelable,n.detail),n.baseEvent&&i(r,n.baseEvent),e.dispatchEvent(r)}};"function"==typeof define&&define.amd?define(R):"undefined"!=typeof module&&module.exports?module.exports=R:w.xtag=R,_.addEventListener("WebComponentsReady",function(){R.fireEvent(_.body,"DOMComponentsLoaded")})}();
|
package/package.json
CHANGED
package/src/quran-madina-html.js
CHANGED
|
@@ -60,6 +60,9 @@
|
|
|
60
60
|
div.innerHTML = htmlString.trim();
|
|
61
61
|
return div.firstChild;
|
|
62
62
|
}
|
|
63
|
+
function print(str){
|
|
64
|
+
console.log(`${name}> ${str}`);
|
|
65
|
+
}
|
|
63
66
|
function copyToClipboard(){
|
|
64
67
|
textWithHeader = this.parentElement.parentElement.innerText.split("\n");
|
|
65
68
|
if(textWithHeader.length > 1){
|
|
@@ -68,7 +71,6 @@
|
|
|
68
71
|
let sura_index = this.parentElement.parentElement.getAttribute("sura");
|
|
69
72
|
text = textWithHeader[0]+ "\n\n" + madina_data.suras[sura_index-1].name;
|
|
70
73
|
}
|
|
71
|
-
|
|
72
74
|
navigator.clipboard.writeText(text);
|
|
73
75
|
alert("\u2398 تم نسخ:\n\n" + text);
|
|
74
76
|
}
|
|
@@ -77,7 +79,7 @@
|
|
|
77
79
|
var doc_name = this_script.getAttribute('data-name') || "Madina05";
|
|
78
80
|
var doc_font = (this_script.getAttribute('data-font') || "Hafs").replaceAll(" ","%");
|
|
79
81
|
var doc_font_sz = this_script.getAttribute('data-font-size') || 16;
|
|
80
|
-
|
|
82
|
+
print(`${doc_name} with font: ${doc_font} size: ${doc_font_sz}`);
|
|
81
83
|
const name_css = cdn+"dist/"+name+".min.css?v=1.1";
|
|
82
84
|
if (!document.getElementById(name))
|
|
83
85
|
{
|
|
@@ -112,7 +114,7 @@
|
|
|
112
114
|
this.xtag.data.page = value;
|
|
113
115
|
},
|
|
114
116
|
get: function(){
|
|
115
|
-
return this.getAttribute("page")
|
|
117
|
+
return this.getAttribute("page");
|
|
116
118
|
}
|
|
117
119
|
},
|
|
118
120
|
aya:{
|
|
@@ -136,20 +138,33 @@
|
|
|
136
138
|
},
|
|
137
139
|
methods: {
|
|
138
140
|
render: function(tag){
|
|
139
|
-
|
|
141
|
+
var sura;
|
|
142
|
+
var multiline;
|
|
143
|
+
var aya_from;
|
|
144
|
+
var aya_to;
|
|
145
|
+
var line_from;
|
|
146
|
+
var line_to;
|
|
140
147
|
if(this.sura != null && this.aya != null ){
|
|
141
148
|
sura = parseSuraRange(this.sura)[0]; // Only a single Sura
|
|
142
149
|
multiline = false;
|
|
143
150
|
[aya_from,aya_to] = parseAyaRange(this.aya);
|
|
144
|
-
|
|
145
|
-
line_to = madina_data.suras[sura].ayas[aya_to].r.slice(-1)[0].l;
|
|
151
|
+
if(this.page != null) print("Ignoring page parameter!");
|
|
146
152
|
} else if(this.page != null){
|
|
147
|
-
|
|
153
|
+
/* Search: only works within a single sura */
|
|
154
|
+
sura = 0; aya_from=1; aya_to=0;
|
|
155
|
+
while(madina_data.suras[sura].ayas[0].p < this.page) sura = sura + 1;
|
|
156
|
+
sura = sura -1;
|
|
157
|
+
while(madina_data.suras[sura].ayas[aya_from].p < this.page) aya_from = aya_from + 1;
|
|
158
|
+
aya_to = aya_from;
|
|
159
|
+
while(madina_data.suras[sura].ayas[aya_to].p == this.page) aya_to = aya_to + 1;
|
|
160
|
+
aya_to = aya_to -1;
|
|
161
|
+
multiline = true;
|
|
148
162
|
} else{
|
|
149
|
-
console.error(
|
|
163
|
+
console.error(`${name}> Bad arguments: Not rendering!`);
|
|
150
164
|
return 1;
|
|
151
165
|
}
|
|
152
|
-
|
|
166
|
+
line_from = madina_data.suras[sura].ayas[aya_from].r[0].l;
|
|
167
|
+
line_to = madina_data.suras[sura].ayas[aya_to].r.slice(-1)[0].l;
|
|
153
168
|
if(line_from!=line_to){
|
|
154
169
|
multiline = true;
|
|
155
170
|
tag.style = "display:block;";
|