diff --git a/dashboard-ui/autoorganizetv.html b/dashboard-ui/autoorganizetv.html
index 263322bf0c..c607f44a01 100644
--- a/dashboard-ui/autoorganizetv.html
+++ b/dashboard-ui/autoorganizetv.html
@@ -169,12 +169,11 @@
diff --git a/dashboard-ui/bower_components/font-roboto/.bower.json b/dashboard-ui/bower_components/font-roboto/.bower.json
new file mode 100644
index 0000000000..432744c592
--- /dev/null
+++ b/dashboard-ui/bower_components/font-roboto/.bower.json
@@ -0,0 +1,31 @@
+{
+ "name": "font-roboto",
+ "version": "1.0.0",
+ "description": "An HTML import for Roboto",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "font",
+ "roboto"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/font-roboto.git"
+ },
+ "main": "roboto.html",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/font-roboto/",
+ "ignore": [
+ "/.*"
+ ],
+ "_release": "1.0.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "1.0.0",
+ "commit": "b85b217e5f4b31f9c03b588e25c977b8104a40cd"
+ },
+ "_source": "git://github.com/PolymerElements/font-roboto.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/font-roboto"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/font-roboto/bower.json b/dashboard-ui/bower_components/font-roboto/bower.json
new file mode 100644
index 0000000000..0962916bea
--- /dev/null
+++ b/dashboard-ui/bower_components/font-roboto/bower.json
@@ -0,0 +1,22 @@
+{
+ "name": "font-roboto",
+ "version": "1.0.0",
+ "description": "An HTML import for Roboto",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "font",
+ "roboto"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/font-roboto.git"
+ },
+ "main": "roboto.html",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/font-roboto/",
+ "ignore": [
+ "/.*"
+ ]
+}
diff --git a/dashboard-ui/bower_components/font-roboto/roboto.html b/dashboard-ui/bower_components/font-roboto/roboto.html
new file mode 100644
index 0000000000..019c972721
--- /dev/null
+++ b/dashboard-ui/bower_components/font-roboto/roboto.html
@@ -0,0 +1,10 @@
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/.bower.json b/dashboard-ui/bower_components/iron-a11y-announcer/.bower.json
new file mode 100644
index 0000000000..786e569307
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/.bower.json
@@ -0,0 +1,42 @@
+{
+ "name": "iron-a11y-announcer",
+ "version": "1.0.1",
+ "description": "A singleton element that simplifies announcing text to screen readers.",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "a11y",
+ "live"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-a11y-announcer.git"
+ },
+ "main": "iron-a11y-announcer.html",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "dependencies": {
+ "polymer": "polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "paper-button": "polymerelements/paper-button#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "web-component-tester": "*"
+ },
+ "homepage": "https://github.com/polymerelements/iron-a11y-announcer",
+ "_release": "1.0.1",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.1",
+ "commit": "699697fe8935400ab11e3e33cd6a5a54d762300e"
+ },
+ "_source": "git://github.com/polymerelements/iron-a11y-announcer.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/iron-a11y-announcer"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/.gitignore b/dashboard-ui/bower_components/iron-a11y-announcer/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/bower.json b/dashboard-ui/bower_components/iron-a11y-announcer/bower.json
new file mode 100644
index 0000000000..cbe80e0a6b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/bower.json
@@ -0,0 +1,32 @@
+{
+ "name": "iron-a11y-announcer",
+ "version": "1.0.1",
+ "description": "A singleton element that simplifies announcing text to screen readers.",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "a11y",
+ "live"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-a11y-announcer.git"
+ },
+ "main": "iron-a11y-announcer.html",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "dependencies": {
+ "polymer": "polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "paper-button": "polymerelements/paper-button#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "web-component-tester": "*"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/demo/index.html b/dashboard-ui/bower_components/iron-a11y-announcer/demo/index.html
new file mode 100644
index 0000000000..d9e939c56b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/demo/index.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
iron-a11y-announcer demo
+
+
+
+
+
+
+
+
+
+
+
+
+ Note: in order to hear the announcements, be sure to turn on your favorite screen reader!
+ Hello, my name is Ava.
+ This true sentence is false.
+ Are you paying attention?
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/demo/x-announces.html b/dashboard-ui/bower_components/iron-a11y-announcer/demo/x-announces.html
new file mode 100644
index 0000000000..404f7c09b5
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/demo/x-announces.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+ Announce
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/index.html b/dashboard-ui/bower_components/iron-a11y-announcer/index.html
new file mode 100644
index 0000000000..1f8889a8da
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
iron-a11y-announcer
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/iron-a11y-announcer.html b/dashboard-ui/bower_components/iron-a11y-announcer/iron-a11y-announcer.html
new file mode 100644
index 0000000000..87e2be1ab0
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/iron-a11y-announcer.html
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+ [[_text]]
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/test/index.html b/dashboard-ui/bower_components/iron-a11y-announcer/test/index.html
new file mode 100644
index 0000000000..c65b8014a6
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/test/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
iron-a11y-announcer tests
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/test/iron-a11y-announcer.html b/dashboard-ui/bower_components/iron-a11y-announcer/test/iron-a11y-announcer.html
new file mode 100644
index 0000000000..f73cf6fdd9
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-announcer/test/iron-a11y-announcer.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
iron-a11y-announcer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json
new file mode 100644
index 0000000000..4072b4af76
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json
@@ -0,0 +1,42 @@
+{
+ "name": "iron-a11y-keys-behavior",
+ "version": "1.0.5",
+ "description": "A behavior that enables keybindings for greater a11y.",
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "a11y",
+ "input"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git"
+ },
+ "main": "iron-a11y-keys-behavior.html",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
+ "_release": "1.0.5",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.5",
+ "commit": "cf833eab5c55a26c5aa92e56d3fcb079120ce66a"
+ },
+ "_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-a11y-keys-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.gitignore b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/bower.json b/dashboard-ui/bower_components/iron-a11y-keys-behavior/bower.json
new file mode 100644
index 0000000000..aa527189c1
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/bower.json
@@ -0,0 +1,32 @@
+{
+ "name": "iron-a11y-keys-behavior",
+ "version": "1.0.5",
+ "description": "A behavior that enables keybindings for greater a11y.",
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "a11y",
+ "input"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git"
+ },
+ "main": "iron-a11y-keys-behavior.html",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/demo/index.html b/dashboard-ui/bower_components/iron-a11y-keys-behavior/demo/index.html
new file mode 100644
index 0000000000..2c3fec7c59
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/demo/index.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
Iron A11y Keys Behavior demo
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/demo/x-key-aware.html b/dashboard-ui/bower_components/iron-a11y-keys-behavior/demo/x-key-aware.html
new file mode 100644
index 0000000000..a7f3205d15
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/demo/x-key-aware.html
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+ Press any of these keys
+
+
+ {{item}}
+
+
+ [[pressed]]
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/index.html b/dashboard-ui/bower_components/iron-a11y-keys-behavior/index.html
new file mode 100644
index 0000000000..e533e79ce2
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/index.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
iron-a11y-keys-behavior
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html b/dashboard-ui/bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html
new file mode 100644
index 0000000000..e95a298038
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html
@@ -0,0 +1,421 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/test/basic-test.html b/dashboard-ui/bower_components/iron-a11y-keys-behavior/test/basic-test.html
new file mode 100644
index 0000000000..8e50c92b40
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/test/basic-test.html
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
iron-a11y-keys
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/test/index.html b/dashboard-ui/bower_components/iron-a11y-keys-behavior/test/index.html
new file mode 100644
index 0000000000..24f9e35ff9
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/test/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/.bower.json b/dashboard-ui/bower_components/iron-autogrow-textarea/.bower.json
new file mode 100644
index 0000000000..3ecd6f0c5d
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/.bower.json
@@ -0,0 +1,48 @@
+{
+ "name": "iron-autogrow-textarea",
+ "version": "1.0.2",
+ "description": "A textarea element that automatically grows with input",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "input",
+ "textarea"
+ ],
+ "main": [
+ "iron-autogrow-textarea.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-autogrow-textarea.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-autogrow-textarea",
+ "ignore": [],
+ "dependencies": {
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "1697690de3010aa7b4d3557e7f3fa582e82dee6a"
+ },
+ "_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-autogrow-textarea"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/.gitignore b/dashboard-ui/bower_components/iron-autogrow-textarea/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/bower.json b/dashboard-ui/bower_components/iron-autogrow-textarea/bower.json
new file mode 100644
index 0000000000..0ff6079644
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/bower.json
@@ -0,0 +1,39 @@
+{
+ "name": "iron-autogrow-textarea",
+ "version": "1.0.2",
+ "description": "A textarea element that automatically grows with input",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "input",
+ "textarea"
+ ],
+ "main": [
+ "iron-autogrow-textarea.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-autogrow-textarea.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-autogrow-textarea",
+ "ignore": [],
+ "dependencies": {
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/demo/index.html b/dashboard-ui/bower_components/iron-autogrow-textarea/demo/index.html
new file mode 100644
index 0000000000..25a1c25a15
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/demo/index.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
iron-autogrow-textarea demo
+
+
+
+
+
+
+
+
+
+
+
Updating the value imperatively
+
+
+
+
+
+
bind-value
:
[[bindValue]]
+
+
+ set bind-value
to:
+
+ set
+
+
+ set textarea.value
to:
+
+ set
+
+
+
+
+
Custom
+
+
Scrolls after 4 rows:
+
+
Initial height of 4 rows
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/hero.svg b/dashboard-ui/bower_components/iron-autogrow-textarea/hero.svg
new file mode 100644
index 0000000000..19ec70a054
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/hero.svg
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/index.html b/dashboard-ui/bower_components/iron-autogrow-textarea/index.html
new file mode 100644
index 0000000000..3be2964faf
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
iron-autogrow-textarea
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html b/dashboard-ui/bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html
new file mode 100644
index 0000000000..54decc8d94
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html
@@ -0,0 +1,266 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/test/basic.html b/dashboard-ui/bower_components/iron-autogrow-textarea/test/basic.html
new file mode 100644
index 0000000000..af736a0a1f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/test/basic.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+
iron-autogrow-textarea tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-autogrow-textarea/test/index.html b/dashboard-ui/bower_components/iron-autogrow-textarea/test/index.html
new file mode 100644
index 0000000000..8790abe4e9
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-autogrow-textarea/test/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
iron-autogrow-textarea tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/.bower.json b/dashboard-ui/bower_components/iron-behaviors/.bower.json
new file mode 100644
index 0000000000..bf8b6cf30f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/.bower.json
@@ -0,0 +1,40 @@
+{
+ "name": "iron-behaviors",
+ "version": "1.0.4",
+ "description": "Provides a set of behaviors for the iron elements",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-behaviors.git"
+ },
+ "main": [
+ "iron-button-state.html",
+ "iron-control-state.html"
+ ],
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/iron-behaviors",
+ "_release": "1.0.4",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.4",
+ "commit": "8792edd457de697a74f398c09b67df30adf7d866"
+ },
+ "_source": "git://github.com/PolymerElements/iron-behaviors.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-behaviors"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-behaviors/.gitignore b/dashboard-ui/bower_components/iron-behaviors/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-behaviors/bower.json b/dashboard-ui/bower_components/iron-behaviors/bower.json
new file mode 100644
index 0000000000..6a18575581
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/bower.json
@@ -0,0 +1,30 @@
+{
+ "name": "iron-behaviors",
+ "version": "1.0.4",
+ "description": "Provides a set of behaviors for the iron elements",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-behaviors.git"
+ },
+ "main": [
+ "iron-button-state.html",
+ "iron-control-state.html"
+ ],
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-behaviors/demo/index.html b/dashboard-ui/bower_components/iron-behaviors/demo/index.html
new file mode 100644
index 0000000000..4001664dfa
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/demo/index.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
simple-button
+
+
+
+
+
+
+
+
+
+
+
Normal
+
+ Hello World
+
+ Toggles
+
+ Hello World
+
+ Disabled
+
+ Hello World
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/demo/simple-button.html b/dashboard-ui/bower_components/iron-behaviors/demo/simple-button.html
new file mode 100644
index 0000000000..ab6432b6c9
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/demo/simple-button.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/index.html b/dashboard-ui/bower_components/iron-behaviors/index.html
new file mode 100644
index 0000000000..220deb0034
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/index.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+
Iron Behaviors
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/iron-button-state.html b/dashboard-ui/bower_components/iron-behaviors/iron-button-state.html
new file mode 100644
index 0000000000..fc52e172f9
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/iron-button-state.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/iron-control-state.html b/dashboard-ui/bower_components/iron-behaviors/iron-control-state.html
new file mode 100644
index 0000000000..33e42ea109
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/iron-control-state.html
@@ -0,0 +1,108 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/test/active-state.html b/dashboard-ui/bower_components/iron-behaviors/test/active-state.html
new file mode 100644
index 0000000000..bffa727b88
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/test/active-state.html
@@ -0,0 +1,154 @@
+
+
+
+
+
active-state
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/test/disabled-state.html b/dashboard-ui/bower_components/iron-behaviors/test/disabled-state.html
new file mode 100644
index 0000000000..af24ee250f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/test/disabled-state.html
@@ -0,0 +1,85 @@
+
+
+
+
+
disabled-state
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/test/focused-state.html b/dashboard-ui/bower_components/iron-behaviors/test/focused-state.html
new file mode 100644
index 0000000000..2d3af69b32
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/test/focused-state.html
@@ -0,0 +1,120 @@
+
+
+
+
+
focused-state
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/test/index.html b/dashboard-ui/bower_components/iron-behaviors/test/index.html
new file mode 100644
index 0000000000..0eef4d67b1
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/test/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-behaviors/test/test-elements.html b/dashboard-ui/bower_components/iron-behaviors/test/test-elements.html
new file mode 100644
index 0000000000..43bd8e52f0
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-behaviors/test/test-elements.html
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/.bower.json b/dashboard-ui/bower_components/iron-fit-behavior/.bower.json
new file mode 100644
index 0000000000..37233913a0
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/.bower.json
@@ -0,0 +1,42 @@
+{
+ "name": "iron-fit-behavior",
+ "version": "1.0.3",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Fits an element inside another element",
+ "private": true,
+ "main": [
+ "iron-fit-behavior.html"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "behavior"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-fit-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/iron-fit-behavior",
+ "_release": "1.0.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.3",
+ "commit": "df9fd83577ea6ebd98f5cad8333daa73dd0f34ba"
+ },
+ "_source": "git://github.com/PolymerElements/iron-fit-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-fit-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/.gitignore b/dashboard-ui/bower_components/iron-fit-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/bower.json b/dashboard-ui/bower_components/iron-fit-behavior/bower.json
new file mode 100644
index 0000000000..3878165f69
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/bower.json
@@ -0,0 +1,32 @@
+{
+ "name": "iron-fit-behavior",
+ "version": "1.0.3",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Fits an element inside another element",
+ "private": true,
+ "main": [
+ "iron-fit-behavior.html"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "behavior"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-fit-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/demo/index.html b/dashboard-ui/bower_components/iron-fit-behavior/demo/index.html
new file mode 100644
index 0000000000..b841deff6e
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/demo/index.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
iron-fit-behavior demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ centered in window
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/demo/simple-fit.html b/dashboard-ui/bower_components/iron-fit-behavior/demo/simple-fit.html
new file mode 100644
index 0000000000..950ee3feab
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/demo/simple-fit.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/index.html b/dashboard-ui/bower_components/iron-fit-behavior/index.html
new file mode 100644
index 0000000000..5ffa7d61ce
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
iron-fit-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/iron-fit-behavior.html b/dashboard-ui/bower_components/iron-fit-behavior/iron-fit-behavior.html
new file mode 100644
index 0000000000..aa776c7a24
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/iron-fit-behavior.html
@@ -0,0 +1,256 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/test/index.html b/dashboard-ui/bower_components/iron-fit-behavior/test/index.html
new file mode 100644
index 0000000000..5c3084c677
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/test/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
iron-fit-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/test/iron-fit-behavior.html b/dashboard-ui/bower_components/iron-fit-behavior/test/iron-fit-behavior.html
new file mode 100644
index 0000000000..c4011bf48a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/test/iron-fit-behavior.html
@@ -0,0 +1,351 @@
+
+
+
+
+
+
iron-fit-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Absolutely positioned
+
+
+
+
+
+
+
+ Sized (x/y), auto center/center
+
+
+
+
+
+
+
+ Sized (x), auto center/center
+
+
+
+
+
+
+
+ Sized (x/y), positioned/positioned
+
+
+
+
+
+
+
+ Sized (x/y), positioned/positioned
+
+
+
+
+
+
+
+
+ Sized (x), auto center/center with scrolling section
+
+
+
+
+
+
+
+
+
+
+
+ Auto center/center to parent element
+
+
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-fit-behavior/test/test-fit.html b/dashboard-ui/bower_components/iron-fit-behavior/test/test-fit.html
new file mode 100644
index 0000000000..b8768fe4c8
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-fit-behavior/test/test-fit.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-flex-layout/.bower.json b/dashboard-ui/bower_components/iron-flex-layout/.bower.json
new file mode 100644
index 0000000000..cfb5824840
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-flex-layout/.bower.json
@@ -0,0 +1,36 @@
+{
+ "name": "iron-flex-layout",
+ "version": "1.0.2",
+ "description": "Provide flexbox-based layouts",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "layout"
+ ],
+ "private": true,
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-flex-layout.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/polymerelements/iron-flex-layout",
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "50bcecf40ab23caa7c2cd90030555e00c5ba7154"
+ },
+ "_source": "git://github.com/polymerelements/iron-flex-layout.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/iron-flex-layout"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-flex-layout/.gitignore b/dashboard-ui/bower_components/iron-flex-layout/.gitignore
new file mode 100644
index 0000000000..1eb1fa5e92
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-flex-layout/.gitignore
@@ -0,0 +1,2 @@
+bower_components
+
diff --git a/dashboard-ui/bower_components/iron-flex-layout/bower.json b/dashboard-ui/bower_components/iron-flex-layout/bower.json
new file mode 100644
index 0000000000..202fbe00af
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-flex-layout/bower.json
@@ -0,0 +1,26 @@
+{
+ "name": "iron-flex-layout",
+ "version": "1.0.2",
+ "description": "Provide flexbox-based layouts",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "layout"
+ ],
+ "private": true,
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-flex-layout.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-flex-layout/classes/iron-flex-layout.html b/dashboard-ui/bower_components/iron-flex-layout/classes/iron-flex-layout.html
new file mode 100644
index 0000000000..283c2a8ddb
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-flex-layout/classes/iron-flex-layout.html
@@ -0,0 +1,307 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-flex-layout/classes/iron-shadow-flex-layout.html b/dashboard-ui/bower_components/iron-flex-layout/classes/iron-shadow-flex-layout.html
new file mode 100644
index 0000000000..c42067af5e
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-flex-layout/classes/iron-shadow-flex-layout.html
@@ -0,0 +1,302 @@
+
+
diff --git a/dashboard-ui/bower_components/iron-flex-layout/demo/index.html b/dashboard-ui/bower_components/iron-flex-layout/demo/index.html
new file mode 100644
index 0000000000..ea4df38362
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-flex-layout/demo/index.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
iron-flex-layout
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-flex-layout/demo/x-app.html b/dashboard-ui/bower_components/iron-flex-layout/demo/x-app.html
new file mode 100644
index 0000000000..489a5f5066
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-flex-layout/demo/x-app.html
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
ITEM 1
+
ITEM 2
+
ITEM 3
+
ITEM 4
+
ITEM 5
+
+
+
+
+
+
+
CARD 1
+
CARD 2
+
CARD 3
+
CARD 4
+
CARD 5
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-flex-layout/iron-flex-layout.html b/dashboard-ui/bower_components/iron-flex-layout/iron-flex-layout.html
new file mode 100644
index 0000000000..ed9cd7bb7b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-flex-layout/iron-flex-layout.html
@@ -0,0 +1,313 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-form-element-behavior/.bower.json b/dashboard-ui/bower_components/iron-form-element-behavior/.bower.json
new file mode 100644
index 0000000000..f1369b1635
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-form-element-behavior/.bower.json
@@ -0,0 +1,37 @@
+{
+ "name": "iron-form-element-behavior",
+ "version": "1.0.1",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "private": true,
+ "main": "iron-form-element-behavior",
+ "authors": "The Polymer Authors",
+ "description": "Enables a custom element to be included in an iron-form",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "form"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-form-element-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/iron-form-element-behavior",
+ "_release": "1.0.1",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.1",
+ "commit": "f386143e866c320025589f3d79798c12103377a4"
+ },
+ "_source": "git://github.com/PolymerElements/iron-form-element-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-form-element-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-form-element-behavior/.gitignore b/dashboard-ui/bower_components/iron-form-element-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-form-element-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-form-element-behavior/bower.json b/dashboard-ui/bower_components/iron-form-element-behavior/bower.json
new file mode 100644
index 0000000000..1e141f2c61
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-form-element-behavior/bower.json
@@ -0,0 +1,27 @@
+{
+ "name": "iron-form-element-behavior",
+ "version": "1.0.1",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "private": true,
+ "main": "iron-form-element-behavior",
+ "authors": "The Polymer Authors",
+ "description": "Enables a custom element to be included in an iron-form",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "form"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-form-element-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-form-element-behavior/demo/index.html b/dashboard-ui/bower_components/iron-form-element-behavior/demo/index.html
new file mode 100644
index 0000000000..b40998de4d
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-form-element-behavior/demo/index.html
@@ -0,0 +1,53 @@
+
+
+
+
+
+
iron-form-element-behavior demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Elements tracked by the form:
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-form-element-behavior/demo/simple-element.html b/dashboard-ui/bower_components/iron-form-element-behavior/demo/simple-element.html
new file mode 100644
index 0000000000..450276923b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-form-element-behavior/demo/simple-element.html
@@ -0,0 +1,27 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-form-element-behavior/demo/simple-form.html b/dashboard-ui/bower_components/iron-form-element-behavior/demo/simple-form.html
new file mode 100644
index 0000000000..82acbe5f36
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-form-element-behavior/demo/simple-form.html
@@ -0,0 +1,42 @@
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-form-element-behavior/index.html b/dashboard-ui/bower_components/iron-form-element-behavior/index.html
new file mode 100644
index 0000000000..8d748c0509
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-form-element-behavior/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
iron-form-element-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-form-element-behavior/iron-form-element-behavior.html b/dashboard-ui/bower_components/iron-form-element-behavior/iron-form-element-behavior.html
new file mode 100644
index 0000000000..d7678a78df
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-form-element-behavior/iron-form-element-behavior.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icon/.bower.json b/dashboard-ui/bower_components/iron-icon/.bower.json
new file mode 100644
index 0000000000..8ce0fb37ca
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/.bower.json
@@ -0,0 +1,43 @@
+{
+ "name": "iron-icon",
+ "private": true,
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "An element that supports displaying an icon",
+ "main": "iron-icon.html",
+ "author": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-icon.git"
+ },
+ "dependencies": {
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-meta": "polymerelements/iron-meta#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "iron-iconset": "polymerelements/iron-iconset#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/polymerelements/iron-icon",
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "f9246c47ecb1c682f0fb9ea48255d5f7debd1e03"
+ },
+ "_source": "git://github.com/polymerelements/iron-icon.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/iron-icon"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-icon/.gitignore b/dashboard-ui/bower_components/iron-icon/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-icon/bower.json b/dashboard-ui/bower_components/iron-icon/bower.json
new file mode 100644
index 0000000000..9361b565c1
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/bower.json
@@ -0,0 +1,33 @@
+{
+ "name": "iron-icon",
+ "private": true,
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "An element that supports displaying an icon",
+ "main": "iron-icon.html",
+ "author": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-icon.git"
+ },
+ "dependencies": {
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-meta": "polymerelements/iron-meta#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "iron-iconset": "polymerelements/iron-iconset#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-icon/demo/index.html b/dashboard-ui/bower_components/iron-icon/demo/index.html
new file mode 100644
index 0000000000..ff712396cf
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/demo/index.html
@@ -0,0 +1,48 @@
+
+
+
+
+
iron-icon demo
+
+
+
+
+
+
+
+
+
+
This demo is for a single <iron-icon>. If you're looking for the
+ whole set of available icons, check out the <iron-icons> demo.
+
+
+
+
+
+
<iron-icon icon="example:location">
+
+
+
+ <iron-icon src="location.png">
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icon/demo/location.png b/dashboard-ui/bower_components/iron-icon/demo/location.png
new file mode 100644
index 0000000000..9bb74236b8
Binary files /dev/null and b/dashboard-ui/bower_components/iron-icon/demo/location.png differ
diff --git a/dashboard-ui/bower_components/iron-icon/hero.svg b/dashboard-ui/bower_components/iron-icon/hero.svg
new file mode 100644
index 0000000000..f0f58536e5
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/hero.svg
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icon/index.html b/dashboard-ui/bower_components/iron-icon/index.html
new file mode 100644
index 0000000000..e871f17d98
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icon/iron-icon.html b/dashboard-ui/bower_components/iron-icon/iron-icon.html
new file mode 100644
index 0000000000..bdb55c7dbb
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/iron-icon.html
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icon/test/index.html b/dashboard-ui/bower_components/iron-icon/test/index.html
new file mode 100644
index 0000000000..0a56bb7693
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/test/index.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icon/test/iron-icon.html b/dashboard-ui/bower_components/iron-icon/test/iron-icon.html
new file mode 100644
index 0000000000..3b8202f12d
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icon/test/iron-icon.html
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
iron-icon
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/.bower.json b/dashboard-ui/bower_components/iron-icons/.bower.json
new file mode 100644
index 0000000000..dd11126a29
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/.bower.json
@@ -0,0 +1,46 @@
+{
+ "name": "iron-icons",
+ "version": "1.0.3",
+ "description": "A set of icons for use with iron-icon",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
+ "main": "iron-icons.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-icons"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-icons",
+ "dependencies": {
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "polymerelements/iron-component-page#1.0.0",
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-meta": "polymerelements/iron-meta#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "ignore": [
+ "util",
+ "update-icons.sh"
+ ],
+ "_release": "1.0.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.3",
+ "commit": "036325be99c33c052ac807a705aacad70be1127f"
+ },
+ "_source": "git://github.com/polymerelements/iron-icons.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/iron-icons"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-icons/.gitignore b/dashboard-ui/bower_components/iron-icons/.gitignore
new file mode 100644
index 0000000000..bb1944ea16
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/.gitignore
@@ -0,0 +1,3 @@
+util/node_modules
+material-design-icons
+bower_components
diff --git a/dashboard-ui/bower_components/iron-icons/av-icons.html b/dashboard-ui/bower_components/iron-icons/av-icons.html
new file mode 100644
index 0000000000..0d6ff37603
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/av-icons.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/bower.json b/dashboard-ui/bower_components/iron-icons/bower.json
new file mode 100644
index 0000000000..8ec25db218
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/bower.json
@@ -0,0 +1,37 @@
+{
+ "name": "iron-icons",
+ "version": "1.0.3",
+ "description": "A set of icons for use with iron-icon",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
+ "main": "iron-icons.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-icons"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-icons",
+ "dependencies": {
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "polymerelements/iron-component-page#1.0.0",
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-meta": "polymerelements/iron-meta#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "ignore": [
+ "util",
+ "update-icons.sh"
+ ]
+}
diff --git a/dashboard-ui/bower_components/iron-icons/communication-icons.html b/dashboard-ui/bower_components/iron-icons/communication-icons.html
new file mode 100644
index 0000000000..ec72704b31
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/communication-icons.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/demo/index.html b/dashboard-ui/bower_components/iron-icons/demo/index.html
new file mode 100644
index 0000000000..d5daf8f685
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/demo/index.html
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
iron-icons
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+ {{item}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/device-icons.html b/dashboard-ui/bower_components/iron-icons/device-icons.html
new file mode 100644
index 0000000000..e875a05597
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/device-icons.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/editor-icons.html b/dashboard-ui/bower_components/iron-icons/editor-icons.html
new file mode 100644
index 0000000000..7fabfe0faa
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/editor-icons.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/hardware-icons.html b/dashboard-ui/bower_components/iron-icons/hardware-icons.html
new file mode 100644
index 0000000000..670cb07c79
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/hardware-icons.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/hero.svg b/dashboard-ui/bower_components/iron-icons/hero.svg
new file mode 100644
index 0000000000..167321c942
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/hero.svg
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/image-icons.html b/dashboard-ui/bower_components/iron-icons/image-icons.html
new file mode 100644
index 0000000000..f6c45f54b6
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/image-icons.html
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/index.html b/dashboard-ui/bower_components/iron-icons/index.html
new file mode 100644
index 0000000000..95d19913a4
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/iron-icons.html b/dashboard-ui/bower_components/iron-icons/iron-icons.html
new file mode 100644
index 0000000000..922d4d8f62
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/iron-icons.html
@@ -0,0 +1,303 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/maps-icons.html b/dashboard-ui/bower_components/iron-icons/maps-icons.html
new file mode 100644
index 0000000000..008a0ef7dc
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/maps-icons.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/notification-icons.html b/dashboard-ui/bower_components/iron-icons/notification-icons.html
new file mode 100644
index 0000000000..39db434627
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/notification-icons.html
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-icons/social-icons.html b/dashboard-ui/bower_components/iron-icons/social-icons.html
new file mode 100644
index 0000000000..5553caa600
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-icons/social-icons.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/.bower.json b/dashboard-ui/bower_components/iron-iconset-svg/.bower.json
new file mode 100644
index 0000000000..7031e24075
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/.bower.json
@@ -0,0 +1,41 @@
+{
+ "name": "iron-iconset-svg",
+ "description": "Manages a set of svg icons",
+ "version": "1.0.4",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-iconset-svg.git"
+ },
+ "dependencies": {
+ "polymer": "polymer/polymer#^1.0.0",
+ "iron-meta": "polymerelements/iron-meta#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "web-component-tester": "*"
+ },
+ "homepage": "https://github.com/polymerelements/iron-iconset-svg",
+ "_release": "1.0.4",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.4",
+ "commit": "795aa82ac22971421bc4375efbd2419ebba9099f"
+ },
+ "_source": "git://github.com/polymerelements/iron-iconset-svg.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/iron-iconset-svg"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/.gitignore b/dashboard-ui/bower_components/iron-iconset-svg/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/bower.json b/dashboard-ui/bower_components/iron-iconset-svg/bower.json
new file mode 100644
index 0000000000..b58569cd6e
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/bower.json
@@ -0,0 +1,31 @@
+{
+ "name": "iron-iconset-svg",
+ "description": "Manages a set of svg icons",
+ "version": "1.0.4",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-iconset-svg.git"
+ },
+ "dependencies": {
+ "polymer": "polymer/polymer#^1.0.0",
+ "iron-meta": "polymerelements/iron-meta#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "web-component-tester": "*"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/demo/index.html b/dashboard-ui/bower_components/iron-iconset-svg/demo/index.html
new file mode 100644
index 0000000000..efe8478e90
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/demo/index.html
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
iron-iconset-svg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/demo/svg-sample-icons.html b/dashboard-ui/bower_components/iron-iconset-svg/demo/svg-sample-icons.html
new file mode 100644
index 0000000000..94c930d574
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/demo/svg-sample-icons.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/index.html b/dashboard-ui/bower_components/iron-iconset-svg/index.html
new file mode 100644
index 0000000000..e871f17d98
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/iron-iconset-svg.html b/dashboard-ui/bower_components/iron-iconset-svg/iron-iconset-svg.html
new file mode 100644
index 0000000000..3cebc2ce1d
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/iron-iconset-svg.html
@@ -0,0 +1,192 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/test/index.html b/dashboard-ui/bower_components/iron-iconset-svg/test/index.html
new file mode 100644
index 0000000000..db4a3f6203
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/test/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-iconset-svg/test/iron-iconset-svg.html b/dashboard-ui/bower_components/iron-iconset-svg/test/iron-iconset-svg.html
new file mode 100644
index 0000000000..4af6f8becd
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-iconset-svg/test/iron-iconset-svg.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
iron-iconset-svg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-input/.bower.json b/dashboard-ui/bower_components/iron-input/.bower.json
new file mode 100644
index 0000000000..1383a44cb5
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/.bower.json
@@ -0,0 +1,45 @@
+{
+ "name": "iron-input",
+ "version": "1.0.3",
+ "description": "An input element with data binding",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "input"
+ ],
+ "main": [
+ "iron-input.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-input.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-input",
+ "ignore": [],
+ "dependencies": {
+ "iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.3",
+ "commit": "edb505f41d67120cb505deedb92aa69e90078d2f"
+ },
+ "_source": "git://github.com/PolymerElements/iron-input.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-input"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-input/.gitignore b/dashboard-ui/bower_components/iron-input/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-input/bower.json b/dashboard-ui/bower_components/iron-input/bower.json
new file mode 100644
index 0000000000..c4c8951c66
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/bower.json
@@ -0,0 +1,36 @@
+{
+ "name": "iron-input",
+ "version": "1.0.3",
+ "description": "An input element with data binding",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "input"
+ ],
+ "main": [
+ "iron-input.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-input.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-input",
+ "ignore": [],
+ "dependencies": {
+ "iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-input/demo/index.html b/dashboard-ui/bower_components/iron-input/demo/index.html
new file mode 100644
index 0000000000..8d4d87915c
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/demo/index.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
iron-input demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-input/hero.svg b/dashboard-ui/bower_components/iron-input/hero.svg
new file mode 100644
index 0000000000..146ffeac67
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/hero.svg
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-input/index.html b/dashboard-ui/bower_components/iron-input/index.html
new file mode 100644
index 0000000000..ca0dac066a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
iron-input
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-input/iron-input.html b/dashboard-ui/bower_components/iron-input/iron-input.html
new file mode 100644
index 0000000000..3d8cccbf70
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/iron-input.html
@@ -0,0 +1,237 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-input/test/index.html b/dashboard-ui/bower_components/iron-input/test/index.html
new file mode 100644
index 0000000000..839cc3f111
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/test/index.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
iron-input ests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-input/test/iron-input.html b/dashboard-ui/bower_components/iron-input/test/iron-input.html
new file mode 100644
index 0000000000..b0ccb8f4df
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/test/iron-input.html
@@ -0,0 +1,139 @@
+
+
+
+
+
+
iron-input tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-input/test/letters-only.html b/dashboard-ui/bower_components/iron-input/test/letters-only.html
new file mode 100644
index 0000000000..bfc301c3e4
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-input/test/letters-only.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-media-query/.bower.json b/dashboard-ui/bower_components/iron-media-query/.bower.json
new file mode 100644
index 0000000000..ce3268073c
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/.bower.json
@@ -0,0 +1,40 @@
+{
+ "name": "iron-media-query",
+ "version": "1.0.2",
+ "description": "Lets you bind to a CSS media query",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "media"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-media-query"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-media-query",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "web-component-tester": "*",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "34abf0a3b8bf9e9e478352dbb3d9e6a76bf3669a"
+ },
+ "_source": "git://github.com/PolymerElements/iron-media-query.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-media-query"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-media-query/.gitignore b/dashboard-ui/bower_components/iron-media-query/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-media-query/bower.json b/dashboard-ui/bower_components/iron-media-query/bower.json
new file mode 100644
index 0000000000..48c342af80
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/bower.json
@@ -0,0 +1,31 @@
+{
+ "name": "iron-media-query",
+ "version": "1.0.2",
+ "description": "Lets you bind to a CSS media query",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "media"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-media-query"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-media-query",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "web-component-tester": "*",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-media-query/demo/index.html b/dashboard-ui/bower_components/iron-media-query/demo/index.html
new file mode 100644
index 0000000000..2f3856fe9e
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/demo/index.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
iron-media-query demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<iron-media-query>
+
+
+
+
+
+ The viewport’s width is greater than 600px
+
+
+
+ The viewport’s width is less than 600px
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-media-query/hero.svg b/dashboard-ui/bower_components/iron-media-query/hero.svg
new file mode 100644
index 0000000000..9b5e2a615a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/hero.svg
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-media-query/index.html b/dashboard-ui/bower_components/iron-media-query/index.html
new file mode 100644
index 0000000000..7aee5c1a2c
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
iron-media-query
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-media-query/iron-media-query.html b/dashboard-ui/bower_components/iron-media-query/iron-media-query.html
new file mode 100644
index 0000000000..8325eb2f7f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/iron-media-query.html
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-media-query/test/basic.html b/dashboard-ui/bower_components/iron-media-query/test/basic.html
new file mode 100644
index 0000000000..34346c290d
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/test/basic.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
iron-media-query-basic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-media-query/test/index.html b/dashboard-ui/bower_components/iron-media-query/test/index.html
new file mode 100644
index 0000000000..7baa57f6df
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-media-query/test/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/.bower.json b/dashboard-ui/bower_components/iron-menu-behavior/.bower.json
new file mode 100644
index 0000000000..7ca24d4128
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/.bower.json
@@ -0,0 +1,41 @@
+{
+ "name": "iron-menu-behavior",
+ "version": "1.0.1",
+ "description": "Provides accessible menu behavior",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "behavior",
+ "menu"
+ ],
+ "main": "iron-menu-behavior.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-menu-behavior"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-menu-behavior",
+ "ignore": [],
+ "dependencies": {
+ "iron-selector": "PolymerElements/iron-selector#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.1",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.1",
+ "commit": "3809f0eb7461c8ca63640aaa238775b3a25aa578"
+ },
+ "_source": "git://github.com/PolymerElements/iron-menu-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-menu-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/.gitignore b/dashboard-ui/bower_components/iron-menu-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/bower.json b/dashboard-ui/bower_components/iron-menu-behavior/bower.json
new file mode 100644
index 0000000000..f0d453c1bd
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/bower.json
@@ -0,0 +1,32 @@
+{
+ "name": "iron-menu-behavior",
+ "version": "1.0.1",
+ "description": "Provides accessible menu behavior",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "behavior",
+ "menu"
+ ],
+ "main": "iron-menu-behavior.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-menu-behavior"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-menu-behavior",
+ "ignore": [],
+ "dependencies": {
+ "iron-selector": "PolymerElements/iron-selector#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/demo/index.html b/dashboard-ui/bower_components/iron-menu-behavior/demo/index.html
new file mode 100644
index 0000000000..6e64d2a2c2
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/demo/index.html
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
iron-menu-behavior demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Simple menu
+
+
+ item 0
+ item 1
+ item 2
+ item 3
+
+
+
+
+
+
+ Multi-select menu
+
+
+ item 0
+ item 1
+ item 2
+ item 3
+ item 4
+
+
+
+
+
+
+ Simple menubar
+
+
+ item 0
+ item 1
+ item 2
+ item 3
+
+
+
+
+
+ Multi-select menubar
+
+
+ item 0
+ item 1
+ item 2
+ item 3
+ item 4
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/demo/simple-menu.html b/dashboard-ui/bower_components/iron-menu-behavior/demo/simple-menu.html
new file mode 100644
index 0000000000..cd1c7cf113
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/demo/simple-menu.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/demo/simple-menubar.html b/dashboard-ui/bower_components/iron-menu-behavior/demo/simple-menubar.html
new file mode 100644
index 0000000000..ad38ecf3d9
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/demo/simple-menubar.html
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/index.html b/dashboard-ui/bower_components/iron-menu-behavior/index.html
new file mode 100644
index 0000000000..2c643c4a03
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
iron-menu-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/iron-menu-behavior.html b/dashboard-ui/bower_components/iron-menu-behavior/iron-menu-behavior.html
new file mode 100644
index 0000000000..aa58c7fe6b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/iron-menu-behavior.html
@@ -0,0 +1,214 @@
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/iron-menubar-behavior.html b/dashboard-ui/bower_components/iron-menu-behavior/iron-menubar-behavior.html
new file mode 100644
index 0000000000..e25304a5ec
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/iron-menubar-behavior.html
@@ -0,0 +1,65 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/index.html b/dashboard-ui/bower_components/iron-menu-behavior/test/index.html
new file mode 100644
index 0000000000..4b1c82f6ce
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/test/index.html
@@ -0,0 +1,35 @@
+
+
+
+
+
+
iron-menu-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menu-behavior.html b/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menu-behavior.html
new file mode 100644
index 0000000000..309dbb163a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menu-behavior.html
@@ -0,0 +1,108 @@
+
+
+
+
+
+
iron-menu-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ item 1
+ item 2
+ item 3
+
+
+
+
+
+
+
+ item 1
+ item 2
+ item 3
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menubar-behavior.html b/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menubar-behavior.html
new file mode 100644
index 0000000000..b007b1c1a7
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menubar-behavior.html
@@ -0,0 +1,108 @@
+
+
+
+
+
+
iron-menubar-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ item 1
+ item 2
+ item 3
+
+
+
+
+
+
+
+ item 1
+ item 2
+ item 3
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/test-menu.html b/dashboard-ui/bower_components/iron-menu-behavior/test/test-menu.html
new file mode 100644
index 0000000000..19b166214b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/test/test-menu.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/test-menubar.html b/dashboard-ui/bower_components/iron-menu-behavior/test/test-menubar.html
new file mode 100644
index 0000000000..5f7ecbcdbe
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-menu-behavior/test/test-menubar.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-meta/.bower.json b/dashboard-ui/bower_components/iron-meta/.bower.json
new file mode 100644
index 0000000000..9e650790be
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/.bower.json
@@ -0,0 +1,38 @@
+{
+ "name": "iron-meta",
+ "version": "1.0.3",
+ "keywords": [
+ "web-components",
+ "polymer"
+ ],
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Useful for sharing information across a DOM tree",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-meta.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.4",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/iron-meta",
+ "_release": "1.0.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.3",
+ "commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04"
+ },
+ "_source": "git://github.com/PolymerElements/iron-meta.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-meta"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-meta/.gitignore b/dashboard-ui/bower_components/iron-meta/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-meta/bower.json b/dashboard-ui/bower_components/iron-meta/bower.json
new file mode 100644
index 0000000000..65a1f8f41f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/bower.json
@@ -0,0 +1,28 @@
+{
+ "name": "iron-meta",
+ "version": "1.0.3",
+ "keywords": [
+ "web-components",
+ "polymer"
+ ],
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Useful for sharing information across a DOM tree",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-meta.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.4",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-meta/demo/index.html b/dashboard-ui/bower_components/iron-meta/demo/index.html
new file mode 100644
index 0000000000..3deee3cbd5
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/demo/index.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
iron-meta
+
+
+
+
+
+
+
+
+
<iron-meta>
+
+ The value
stored at key="info"
is
.
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-meta/hero.svg b/dashboard-ui/bower_components/iron-meta/hero.svg
new file mode 100644
index 0000000000..ea8548dcec
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/hero.svg
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-meta/index.html b/dashboard-ui/bower_components/iron-meta/index.html
new file mode 100644
index 0000000000..c70dc6e5da
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/index.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
iron-meta
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-meta/iron-meta.html b/dashboard-ui/bower_components/iron-meta/iron-meta.html
new file mode 100644
index 0000000000..4b34311828
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/iron-meta.html
@@ -0,0 +1,317 @@
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-meta/test/basic.html b/dashboard-ui/bower_components/iron-meta/test/basic.html
new file mode 100644
index 0000000000..c561dc3cac
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/test/basic.html
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
iron-meta-basic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-meta/test/index.html b/dashboard-ui/bower_components/iron-meta/test/index.html
new file mode 100644
index 0000000000..2b9541b73a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/test/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-meta/test/iron-meta.html b/dashboard-ui/bower_components/iron-meta/test/iron-meta.html
new file mode 100644
index 0000000000..c1a40282eb
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-meta/test/iron-meta.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
iron-meta
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json
new file mode 100644
index 0000000000..861424dcaf
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json
@@ -0,0 +1,47 @@
+{
+ "name": "iron-overlay-behavior",
+ "version": "1.0.4",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Provides a behavior for making an element an overlay",
+ "private": true,
+ "main": [
+ "iron-overlay-behavior.html"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "behavior",
+ "overlay"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-overlay-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-fit-behavior": "PolymerElements/iron-fit-behavior#^1.0.0",
+ "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/iron-overlay-behavior",
+ "_release": "1.0.4",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.4",
+ "commit": "7939cabf4f23467a0d02b572094ef05d35ad0dcc"
+ },
+ "_source": "git://github.com/PolymerElements/iron-overlay-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-overlay-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.gitignore b/dashboard-ui/bower_components/iron-overlay-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json
new file mode 100644
index 0000000000..3ee071c78a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json
@@ -0,0 +1,37 @@
+{
+ "name": "iron-overlay-behavior",
+ "version": "1.0.4",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Provides a behavior for making an element an overlay",
+ "private": true,
+ "main": [
+ "iron-overlay-behavior.html"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "behavior",
+ "overlay"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-overlay-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-fit-behavior": "PolymerElements/iron-fit-behavior#^1.0.0",
+ "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/demo/index.html b/dashboard-ui/bower_components/iron-overlay-behavior/demo/index.html
new file mode 100644
index 0000000000..4fc6bb0aa1
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/demo/index.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
simple-overlay demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
plain
+
+
+ Hello world!
+
+
+
scrolling
+
+
+ This dialog scrolls internally.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
scrolling 2
+
+
+ This dialog has a scrolling child.
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
multiple
+
+
+ click to open another overlay
+ click
+
+
+
+ Hi!
+
+
+
backdrop
+
+
+ Hello world!
+
+
+
autofocus
+
+
+ Hello world!
+ cancel
+ autofocus
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/demo/simple-overlay.html b/dashboard-ui/bower_components/iron-overlay-behavior/demo/simple-overlay.html
new file mode 100644
index 0000000000..fbf305ed35
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/demo/simple-overlay.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/index.html b/dashboard-ui/bower_components/iron-overlay-behavior/index.html
new file mode 100644
index 0000000000..d69e30442e
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
iron-overlay-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html
new file mode 100644
index 0000000000..5682c28505
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html
new file mode 100644
index 0000000000..4bc044da74
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html
@@ -0,0 +1,434 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html
new file mode 100644
index 0000000000..c66f9aa77c
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html
@@ -0,0 +1,107 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/test/index.html b/dashboard-ui/bower_components/iron-overlay-behavior/test/index.html
new file mode 100644
index 0000000000..9041313cfc
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/test/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
iron-overlay-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html b/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html
new file mode 100644
index 0000000000..4829439f0b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html
@@ -0,0 +1,314 @@
+
+
+
+
+
+
iron-overlay-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Basic Overlay
+
+
+
+
+
+
+
+ Basic Overlay
+
+
+
+
+
+
+
+ Autofocus
+ button
+
+
+
+
+
+
+
+ Overlay 1
+
+
+ Overlay 2
+
+
+ Overlay 3
+
+
+
+
+
+
+
+ Overlay 1 with backdrop
+
+
+ Overlay 2 with backdrop
+
+
+ Overlay 3 with backdrop
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/test/test-overlay.html b/dashboard-ui/bower_components/iron-overlay-behavior/test/test-overlay.html
new file mode 100644
index 0000000000..96adc56929
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-overlay-behavior/test/test-overlay.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-pages/.bower.json b/dashboard-ui/bower_components/iron-pages/.bower.json
new file mode 100644
index 0000000000..416bcf2106
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/.bower.json
@@ -0,0 +1,43 @@
+{
+ "name": "iron-pages",
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Organizes a set of pages and shows one at a time",
+ "main": "iron-pages.html",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-pages.git"
+ },
+ "keywords": [
+ "web-components",
+ "polymer",
+ "container"
+ ],
+ "dependencies": {
+ "iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
+ "iron-selector": "polymerelements/iron-selector#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/iron-pages",
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "061e9ea95b58880f0f992b081c52a06665b553c9"
+ },
+ "_source": "git://github.com/PolymerElements/iron-pages.git",
+ "_target": "~1.0.2",
+ "_originalSource": "PolymerElements/iron-pages",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-pages/.gitignore b/dashboard-ui/bower_components/iron-pages/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-pages/bower.json b/dashboard-ui/bower_components/iron-pages/bower.json
new file mode 100644
index 0000000000..c41be27430
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/bower.json
@@ -0,0 +1,32 @@
+{
+ "name": "iron-pages",
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Organizes a set of pages and shows one at a time",
+ "main": "iron-pages.html",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-pages.git"
+ },
+ "keywords": [
+ "web-components",
+ "polymer",
+ "container"
+ ],
+ "dependencies": {
+ "iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
+ "iron-selector": "polymerelements/iron-selector#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-pages/demo/index.html b/dashboard-ui/bower_components/iron-pages/demo/index.html
new file mode 100644
index 0000000000..68425e80ea
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/demo/index.html
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
iron-pages
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Page One
+ Page Two
+ Page Three
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-pages/hero.svg b/dashboard-ui/bower_components/iron-pages/hero.svg
new file mode 100644
index 0000000000..fa1278379f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/hero.svg
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-pages/index.html b/dashboard-ui/bower_components/iron-pages/index.html
new file mode 100644
index 0000000000..67ae088946
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
iron-pages
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-pages/iron-pages.html b/dashboard-ui/bower_components/iron-pages/iron-pages.html
new file mode 100644
index 0000000000..1753f0eb17
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/iron-pages.html
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-pages/test/attr-for-selected.html b/dashboard-ui/bower_components/iron-pages/test/attr-for-selected.html
new file mode 100644
index 0000000000..22fe1629e5
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/test/attr-for-selected.html
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
iron-pages-attr-for-selected
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Page 0
+ Page 1
+ Page 2
+ Page 3
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-pages/test/basic.html b/dashboard-ui/bower_components/iron-pages/test/basic.html
new file mode 100644
index 0000000000..5c83322efe
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/test/basic.html
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
iron-pages-basic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Page 0
+ Page 1
+ Page 2
+ Page 3
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-pages/test/index.html b/dashboard-ui/bower_components/iron-pages/test/index.html
new file mode 100644
index 0000000000..2a3282bb73
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-pages/test/index.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-range-behavior/.bower.json b/dashboard-ui/bower_components/iron-range-behavior/.bower.json
new file mode 100644
index 0000000000..05c3dafcbb
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/.bower.json
@@ -0,0 +1,40 @@
+{
+ "name": "iron-range-behavior",
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Provides a behavior for something with a minimum and maximum value",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "behavior"
+ ],
+ "main": [
+ "iron-range-behavior.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-range-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-input": "PolymerElements/iron-input#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/iron-range-behavior",
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "a743ac0b204a8e76466c2dba349ab2180c9f15f5"
+ },
+ "_source": "git://github.com/PolymerElements/iron-range-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-range-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-range-behavior/.gitignore b/dashboard-ui/bower_components/iron-range-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-range-behavior/bower.json b/dashboard-ui/bower_components/iron-range-behavior/bower.json
new file mode 100644
index 0000000000..6abc83999e
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/bower.json
@@ -0,0 +1,30 @@
+{
+ "name": "iron-range-behavior",
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Provides a behavior for something with a minimum and maximum value",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "behavior"
+ ],
+ "main": [
+ "iron-range-behavior.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-range-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-input": "PolymerElements/iron-input#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-range-behavior/demo/index.html b/dashboard-ui/bower_components/iron-range-behavior/demo/index.html
new file mode 100644
index 0000000000..ce397365e0
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/demo/index.html
@@ -0,0 +1,79 @@
+
+
+
+
+
iron-range-behavior demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-range-behavior/index.html b/dashboard-ui/bower_components/iron-range-behavior/index.html
new file mode 100644
index 0000000000..cc77788735
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/index.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html b/dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html
new file mode 100644
index 0000000000..4306e6924e
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html
@@ -0,0 +1,109 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-range-behavior/test/basic.html b/dashboard-ui/bower_components/iron-range-behavior/test/basic.html
new file mode 100644
index 0000000000..43f93f8975
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/test/basic.html
@@ -0,0 +1,111 @@
+
+
+
+
+
+
iron-range-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-range-behavior/test/index.html b/dashboard-ui/bower_components/iron-range-behavior/test/index.html
new file mode 100644
index 0000000000..155baeabed
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/test/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-range-behavior/test/x-progressbar.html b/dashboard-ui/bower_components/iron-range-behavior/test/x-progressbar.html
new file mode 100644
index 0000000000..f99b0d9d56
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-range-behavior/test/x-progressbar.html
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json b/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json
new file mode 100644
index 0000000000..1f0548f3d7
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json
@@ -0,0 +1,40 @@
+{
+ "name": "iron-resizable-behavior",
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Coordinates the flow of resizeable elements",
+ "private": true,
+ "main": "iron-resizable-behavior.html",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "iron",
+ "behavior"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-resizable-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/polymerelements/iron-resizable-behavior",
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "85de8ba28be2bf17c81d6436ef1119022b003674"
+ },
+ "_source": "git://github.com/polymerelements/iron-resizable-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/iron-resizable-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/.gitignore b/dashboard-ui/bower_components/iron-resizable-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/bower.json b/dashboard-ui/bower_components/iron-resizable-behavior/bower.json
new file mode 100644
index 0000000000..d0591a3f4f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/bower.json
@@ -0,0 +1,30 @@
+{
+ "name": "iron-resizable-behavior",
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Coordinates the flow of resizeable elements",
+ "private": true,
+ "main": "iron-resizable-behavior.html",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "iron",
+ "behavior"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-resizable-behavior.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/demo/index.html b/dashboard-ui/bower_components/iron-resizable-behavior/demo/index.html
new file mode 100644
index 0000000000..2896c50d25
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/demo/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
iron-resizable-behavior demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/demo/src/x-app.html b/dashboard-ui/bower_components/iron-resizable-behavior/demo/src/x-app.html
new file mode 100644
index 0000000000..c334ad3d2f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/demo/src/x-app.html
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+ I'm a resize-aware, thirdifying puck at ({{x}} x {{y}} ).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/index.html b/dashboard-ui/bower_components/iron-resizable-behavior/index.html
new file mode 100644
index 0000000000..b9b8809560
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
iron-resizable-behavior
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/iron-resizable-behavior.html b/dashboard-ui/bower_components/iron-resizable-behavior/iron-resizable-behavior.html
new file mode 100644
index 0000000000..19b8c0225f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/iron-resizable-behavior.html
@@ -0,0 +1,193 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/test/basic.html b/dashboard-ui/bower_components/iron-resizable-behavior/test/basic.html
new file mode 100644
index 0000000000..0ae890d3b5
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/test/basic.html
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
iron-resizable-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/test/index.html b/dashboard-ui/bower_components/iron-resizable-behavior/test/index.html
new file mode 100644
index 0000000000..e1d3fcaee4
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/test/index.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/test/iron-resizable-behavior.html b/dashboard-ui/bower_components/iron-resizable-behavior/test/iron-resizable-behavior.html
new file mode 100644
index 0000000000..695b9770fe
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/test/iron-resizable-behavior.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
iron-resizable-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/test/test-elements.html b/dashboard-ui/bower_components/iron-resizable-behavior/test/test-elements.html
new file mode 100644
index 0000000000..d70561e174
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-resizable-behavior/test/test-elements.html
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/.bower.json b/dashboard-ui/bower_components/iron-selector/.bower.json
new file mode 100644
index 0000000000..68996d04d0
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/.bower.json
@@ -0,0 +1,41 @@
+{
+ "name": "iron-selector",
+ "version": "1.0.2",
+ "description": "Manages a set of elements that can be selected",
+ "private": true,
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "main": [
+ "iron-selector.html"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "selector"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-selector.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/polymerelements/iron-selector",
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "ea22d91d11ba6f72c01faa952d5e600f9d1773cf"
+ },
+ "_source": "git://github.com/polymerelements/iron-selector.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/iron-selector"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-selector/.gitignore b/dashboard-ui/bower_components/iron-selector/.gitignore
new file mode 100644
index 0000000000..b13058c3b8
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/.gitignore
@@ -0,0 +1,2 @@
+bower_components
+.DS_Store
diff --git a/dashboard-ui/bower_components/iron-selector/bower.json b/dashboard-ui/bower_components/iron-selector/bower.json
new file mode 100644
index 0000000000..b9751df128
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/bower.json
@@ -0,0 +1,31 @@
+{
+ "name": "iron-selector",
+ "version": "1.0.2",
+ "description": "Manages a set of elements that can be selected",
+ "private": true,
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "main": [
+ "iron-selector.html"
+ ],
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "selector"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-selector.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-selector/demo/index.html b/dashboard-ui/bower_components/iron-selector/demo/index.html
new file mode 100644
index 0000000000..cdb7f99e21
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/demo/index.html
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
iron-selector
+
+
+
+
+
+
+
+
+
+
+
+
+
Basic
+
+
+ Item 0
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+
+
+
Multi-select
+
+
+ Item 0
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+
+
+
Example
+
+
+ Foo
+ Bar
+ Zot
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/index.html b/dashboard-ui/bower_components/iron-selector/index.html
new file mode 100644
index 0000000000..741693ce70
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
iron-selector
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/iron-multi-selectable.html b/dashboard-ui/bower_components/iron-selector/iron-multi-selectable.html
new file mode 100644
index 0000000000..ba9455ded2
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/iron-multi-selectable.html
@@ -0,0 +1,120 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/iron-selectable.html b/dashboard-ui/bower_components/iron-selector/iron-selectable.html
new file mode 100644
index 0000000000..f0506d58d9
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/iron-selectable.html
@@ -0,0 +1,307 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/iron-selection.html b/dashboard-ui/bower_components/iron-selector/iron-selection.html
new file mode 100644
index 0000000000..0ff04cfae4
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/iron-selection.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/iron-selector.html b/dashboard-ui/bower_components/iron-selector/iron-selector.html
new file mode 100644
index 0000000000..92abe04f1b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/iron-selector.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/activate-event.html b/dashboard-ui/bower_components/iron-selector/test/activate-event.html
new file mode 100644
index 0000000000..8390548f46
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/activate-event.html
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
iron-selector-activate-event
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Item 0
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/basic.html b/dashboard-ui/bower_components/iron-selector/test/basic.html
new file mode 100644
index 0000000000..602de183f8
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/basic.html
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
iron-selector-basic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Item 0
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+
+
+
+
+
+
+
+
+
+ Item 0
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/content-element.html b/dashboard-ui/bower_components/iron-selector/test/content-element.html
new file mode 100644
index 0000000000..d0cd6d7205
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/content-element.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/content.html b/dashboard-ui/bower_components/iron-selector/test/content.html
new file mode 100644
index 0000000000..e869f98d5b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/content.html
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
iron-selector-content
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ item0
+ item1
+ item2
+ item3
+
+
+
+ - item0
+
+ - item1
+ - item2
+
+ - item3
+
+
+
+
+ [[item.name]]
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/index.html b/dashboard-ui/bower_components/iron-selector/test/index.html
new file mode 100644
index 0000000000..17d7e4be57
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/index.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/multi.html b/dashboard-ui/bower_components/iron-selector/test/multi.html
new file mode 100644
index 0000000000..fdc31c716e
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/multi.html
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
iron-selector-multi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Item 0
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/next-previous.html b/dashboard-ui/bower_components/iron-selector/test/next-previous.html
new file mode 100644
index 0000000000..3a830c2915
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/next-previous.html
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
iron-selector-next-previous
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Item 0
+ Item 1
+ Item 2
+
+
+
+
+
+
+
+ Item Foo
+ Item Bar
+ Item Zot
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/selected-attribute.html b/dashboard-ui/bower_components/iron-selector/test/selected-attribute.html
new file mode 100644
index 0000000000..3e1ecaf1a0
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/selected-attribute.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
iron-selector-selected-attribute
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Item 0
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-selector/test/template-repeat.html b/dashboard-ui/bower_components/iron-selector/test/template-repeat.html
new file mode 100644
index 0000000000..eae2729508
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-selector/test/template-repeat.html
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
iron-selector-template-repeat
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/.bower.json b/dashboard-ui/bower_components/iron-validatable-behavior/.bower.json
new file mode 100644
index 0000000000..b1acc42ea1
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/.bower.json
@@ -0,0 +1,44 @@
+{
+ "name": "iron-validatable-behavior",
+ "version": "1.0.2",
+ "description": "Provides a behavior for an element that validates user input",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "iron",
+ "behavior"
+ ],
+ "main": [
+ "iron-validatable-behavior.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-validatable-behavior.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-validatable-behavior",
+ "ignore": [],
+ "dependencies": {
+ "iron-meta": "PolymerElements/iron-meta#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "1.0.2",
+ "commit": "a4fc340fdb268e274f312dadedd0633b025ac3a4"
+ },
+ "_source": "git://github.com/PolymerElements/iron-validatable-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/iron-validatable-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/.gitignore b/dashboard-ui/bower_components/iron-validatable-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/bower.json b/dashboard-ui/bower_components/iron-validatable-behavior/bower.json
new file mode 100644
index 0000000000..eaab38760b
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/bower.json
@@ -0,0 +1,35 @@
+{
+ "name": "iron-validatable-behavior",
+ "version": "1.0.2",
+ "description": "Provides a behavior for an element that validates user input",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "iron",
+ "behavior"
+ ],
+ "main": [
+ "iron-validatable-behavior.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-validatable-behavior.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-validatable-behavior",
+ "ignore": [],
+ "dependencies": {
+ "iron-meta": "PolymerElements/iron-meta#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/demo/cats-only.html b/dashboard-ui/bower_components/iron-validatable-behavior/demo/cats-only.html
new file mode 100644
index 0000000000..83ef9ba617
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/demo/cats-only.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/demo/index.html b/dashboard-ui/bower_components/iron-validatable-behavior/demo/index.html
new file mode 100644
index 0000000000..84b96a8dc2
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/demo/index.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
iron-validatable-behavior demo
+
+
+
+
+
+
+
+
+
+
+
+
+
<iron-validatable-behavior>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/demo/validatable-input.html b/dashboard-ui/bower_components/iron-validatable-behavior/demo/validatable-input.html
new file mode 100644
index 0000000000..19cf477598
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/demo/validatable-input.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/index.html b/dashboard-ui/bower_components/iron-validatable-behavior/index.html
new file mode 100644
index 0000000000..cfaa5b1759
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
iron-validatable-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html b/dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html
new file mode 100644
index 0000000000..c59c47e27d
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html
@@ -0,0 +1,101 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/test/index.html b/dashboard-ui/bower_components/iron-validatable-behavior/test/index.html
new file mode 100644
index 0000000000..05194fdd8f
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/test/index.html
@@ -0,0 +1,35 @@
+
+
+
+
+
+
paper-validatable-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/test/iron-validatable-behavior.html b/dashboard-ui/bower_components/iron-validatable-behavior/test/iron-validatable-behavior.html
new file mode 100644
index 0000000000..435c034c7c
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/test/iron-validatable-behavior.html
@@ -0,0 +1,52 @@
+
+
+
+
+
+
iron-validatable-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/iron-validatable-behavior/test/test-validatable.html b/dashboard-ui/bower_components/iron-validatable-behavior/test/test-validatable.html
new file mode 100644
index 0000000000..51513bff01
--- /dev/null
+++ b/dashboard-ui/bower_components/iron-validatable-behavior/test/test-validatable.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/jquery/.bower.json b/dashboard-ui/bower_components/jquery/.bower.json
new file mode 100644
index 0000000000..de04971f22
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/.bower.json
@@ -0,0 +1,38 @@
+{
+ "name": "jquery",
+ "version": "2.1.4",
+ "main": "dist/jquery.js",
+ "license": "MIT",
+ "ignore": [
+ "**/.*",
+ "build",
+ "dist/cdn",
+ "speed",
+ "test",
+ "*.md",
+ "AUTHORS.txt",
+ "Gruntfile.js",
+ "package.json"
+ ],
+ "devDependencies": {
+ "sizzle": "2.1.1-jquery.2.1.2",
+ "requirejs": "2.1.10",
+ "qunit": "1.14.0",
+ "sinon": "1.8.1"
+ },
+ "keywords": [
+ "jquery",
+ "javascript",
+ "library"
+ ],
+ "homepage": "https://github.com/jquery/jquery",
+ "_release": "2.1.4",
+ "_resolution": {
+ "type": "version",
+ "tag": "2.1.4",
+ "commit": "7751e69b615c6eca6f783a81e292a55725af6b85"
+ },
+ "_source": "git://github.com/jquery/jquery.git",
+ "_target": "*",
+ "_originalSource": "jquery"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/jquery/MIT-LICENSE.txt b/dashboard-ui/bower_components/jquery/MIT-LICENSE.txt
new file mode 100644
index 0000000000..cdd31b5c71
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/MIT-LICENSE.txt
@@ -0,0 +1,21 @@
+Copyright 2014 jQuery Foundation and other contributors
+http://jquery.com/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/dashboard-ui/bower_components/jquery/bower.json b/dashboard-ui/bower_components/jquery/bower.json
new file mode 100644
index 0000000000..0c80cd53a7
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/bower.json
@@ -0,0 +1,28 @@
+{
+ "name": "jquery",
+ "version": "2.1.4",
+ "main": "dist/jquery.js",
+ "license": "MIT",
+ "ignore": [
+ "**/.*",
+ "build",
+ "dist/cdn",
+ "speed",
+ "test",
+ "*.md",
+ "AUTHORS.txt",
+ "Gruntfile.js",
+ "package.json"
+ ],
+ "devDependencies": {
+ "sizzle": "2.1.1-jquery.2.1.2",
+ "requirejs": "2.1.10",
+ "qunit": "1.14.0",
+ "sinon": "1.8.1"
+ },
+ "keywords": [
+ "jquery",
+ "javascript",
+ "library"
+ ]
+}
diff --git a/dashboard-ui/bower_components/jquery/src/ajax.js b/dashboard-ui/bower_components/jquery/src/ajax.js
new file mode 100644
index 0000000000..5c7b4addbd
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/src/ajax.js
@@ -0,0 +1,786 @@
+define([
+ "./core",
+ "./var/rnotwhite",
+ "./ajax/var/nonce",
+ "./ajax/var/rquery",
+ "./core/init",
+ "./ajax/parseJSON",
+ "./ajax/parseXML",
+ "./deferred"
+], function( jQuery, rnotwhite, nonce, rquery ) {
+
+var
+ rhash = /#.*$/,
+ rts = /([?&])_=[^&]*/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat( "*" ),
+
+ // Document location
+ ajaxLocation = window.location.href,
+
+ // Segment location into parts
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+ // For each dataType in the dataTypeExpression
+ while ( (dataType = dataTypes[i++]) ) {
+ // Prepend if requested
+ if ( dataType[0] === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+ // Otherwise append
+ } else {
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ });
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var ct, type, finalDataType, firstDataType,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while ( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var transport,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (prefilters might expect it)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
+ .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+ fireGlobals = jQuery.event && s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // Aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // Extract error from statusText and normalize for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // Shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
+
+return jQuery;
+});
diff --git a/dashboard-ui/bower_components/jquery/src/ajax/jsonp.js b/dashboard-ui/bower_components/jquery/src/ajax/jsonp.js
new file mode 100644
index 0000000000..ff0d53899d
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/src/ajax/jsonp.js
@@ -0,0 +1,89 @@
+define([
+ "../core",
+ "./var/nonce",
+ "./var/rquery",
+ "../ajax"
+], function( jQuery, nonce, rquery ) {
+
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+});
diff --git a/dashboard-ui/bower_components/jquery/src/ajax/load.js b/dashboard-ui/bower_components/jquery/src/ajax/load.js
new file mode 100644
index 0000000000..bff25b1a40
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/src/ajax/load.js
@@ -0,0 +1,75 @@
+define([
+ "../core",
+ "../core/parseHTML",
+ "../ajax",
+ "../traversing",
+ "../manipulation",
+ "../selector",
+ // Optional event/alias dependency
+ "../event/alias"
+], function( jQuery ) {
+
+// Keep a copy of the old load method
+var _load = jQuery.fn.load;
+
+/**
+ * Load a url into a page
+ */
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ var selector, type, response,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = jQuery.trim( url.slice( off ) );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax({
+ url: url,
+
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params
+ }).done(function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery("
").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
+ }
+
+ return this;
+};
+
+});
diff --git a/dashboard-ui/bower_components/jquery/src/ajax/parseJSON.js b/dashboard-ui/bower_components/jquery/src/ajax/parseJSON.js
new file mode 100644
index 0000000000..3a96d15b9d
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/src/ajax/parseJSON.js
@@ -0,0 +1,13 @@
+define([
+ "../core"
+], function( jQuery ) {
+
+// Support: Android 2.3
+// Workaround failure to string-cast null input
+jQuery.parseJSON = function( data ) {
+ return JSON.parse( data + "" );
+};
+
+return jQuery.parseJSON;
+
+});
diff --git a/dashboard-ui/bower_components/jquery/src/ajax/parseXML.js b/dashboard-ui/bower_components/jquery/src/ajax/parseXML.js
new file mode 100644
index 0000000000..9eeb625ff4
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/src/ajax/parseXML.js
@@ -0,0 +1,28 @@
+define([
+ "../core"
+], function( jQuery ) {
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+
+ // Support: IE9
+ try {
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data, "text/xml" );
+ } catch ( e ) {
+ xml = undefined;
+ }
+
+ if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+return jQuery.parseXML;
+
+});
diff --git a/dashboard-ui/bower_components/jquery/src/ajax/script.js b/dashboard-ui/bower_components/jquery/src/ajax/script.js
new file mode 100644
index 0000000000..f44329d4ef
--- /dev/null
+++ b/dashboard-ui/bower_components/jquery/src/ajax/script.js
@@ -0,0 +1,64 @@
+define([
+ "../core",
+ "../ajax"
+], function( jQuery ) {
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and crossDomain
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function( s ) {
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+ var script, callback;
+ return {
+ send: function( _, complete ) {
+ script = jQuery("
diff --git a/dashboard-ui/bower_components/neon-animation/animations/fade-in-animation.html b/dashboard-ui/bower_components/neon-animation/animations/fade-in-animation.html
new file mode 100644
index 0000000000..cdb74e3095
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/fade-in-animation.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/fade-out-animation.html b/dashboard-ui/bower_components/neon-animation/animations/fade-out-animation.html
new file mode 100644
index 0000000000..82cc3997cf
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/fade-out-animation.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/hero-animation.html b/dashboard-ui/bower_components/neon-animation/animations/hero-animation.html
new file mode 100644
index 0000000000..a9075e138f
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/hero-animation.html
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/opaque-animation.html b/dashboard-ui/bower_components/neon-animation/animations/opaque-animation.html
new file mode 100644
index 0000000000..f5b60a4514
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/opaque-animation.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/reverse-ripple-animation.html b/dashboard-ui/bower_components/neon-animation/animations/reverse-ripple-animation.html
new file mode 100644
index 0000000000..8f955084e4
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/reverse-ripple-animation.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/ripple-animation.html b/dashboard-ui/bower_components/neon-animation/animations/ripple-animation.html
new file mode 100644
index 0000000000..1f5c736e3b
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/ripple-animation.html
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/scale-down-animation.html b/dashboard-ui/bower_components/neon-animation/animations/scale-down-animation.html
new file mode 100644
index 0000000000..6dc187b317
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/scale-down-animation.html
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/scale-up-animation.html b/dashboard-ui/bower_components/neon-animation/animations/scale-up-animation.html
new file mode 100644
index 0000000000..b5164f7fe1
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/scale-up-animation.html
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/slide-down-animation.html b/dashboard-ui/bower_components/neon-animation/animations/slide-down-animation.html
new file mode 100644
index 0000000000..83c1f9bfd7
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/slide-down-animation.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/slide-from-left-animation.html b/dashboard-ui/bower_components/neon-animation/animations/slide-from-left-animation.html
new file mode 100644
index 0000000000..d248175221
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/slide-from-left-animation.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/slide-from-right-animation.html b/dashboard-ui/bower_components/neon-animation/animations/slide-from-right-animation.html
new file mode 100644
index 0000000000..4ebbf11b86
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/slide-from-right-animation.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/slide-left-animation.html b/dashboard-ui/bower_components/neon-animation/animations/slide-left-animation.html
new file mode 100644
index 0000000000..7fbc446bcc
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/slide-left-animation.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/slide-right-animation.html b/dashboard-ui/bower_components/neon-animation/animations/slide-right-animation.html
new file mode 100644
index 0000000000..e6441c4f38
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/slide-right-animation.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/slide-up-animation.html b/dashboard-ui/bower_components/neon-animation/animations/slide-up-animation.html
new file mode 100644
index 0000000000..fdf1186d16
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/slide-up-animation.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/animations/transform-animation.html b/dashboard-ui/bower_components/neon-animation/animations/transform-animation.html
new file mode 100644
index 0000000000..e6236a49f1
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/animations/transform-animation.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/bower.json b/dashboard-ui/bower_components/neon-animation/bower.json
new file mode 100644
index 0000000000..c01ee37868
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/bower.json
@@ -0,0 +1,51 @@
+{
+ "name": "neon-animation",
+ "version": "1.0.4",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "web-animations"
+ ],
+ "main": [
+ "neon-animated-pages.html",
+ "neon-animatable-behavior.html",
+ "neon-animation-behavior.html",
+ "neon-animation-runner-behavior.html",
+ "neon-shared-element-animatable-behavior.html",
+ "neon-shared-element-animation-behavior.html",
+ "neon-animatable.html",
+ "neon-animations.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/neon-animation"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/neon-animation",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-meta": "PolymerElements/iron-meta#^1.0.0",
+ "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0",
+ "iron-selector": "PolymerElements/iron-selector#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "web-animations-js": "web-animations/web-animations-js#^2.0.0"
+ },
+ "devDependencies": {
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "paper-toolbar": "PolymerElements/paper-toolbar#^1.0.0",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-item": "PolymerElements/paper-item#^1.0.0",
+ "iron-icon": "PolymerElements/iron-icon#^1.0.0",
+ "iron-icons": "PolymerElements/iron-icons#^1.0.0",
+ "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/neon-animation/demo/card/index.html b/dashboard-ui/bower_components/neon-animation/demo/card/index.html
new file mode 100644
index 0000000000..9cac2f1be7
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/card/index.html
@@ -0,0 +1,166 @@
+
+
+
+
+
neon-animated-pages demo: card
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Choose a subject
+
+
+
+ POLYMER
+
+
+ ANGULAR
+
+
+
+
+
+
+
+
+
+
+
+
+ BACK
+
+
Polymer
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+ tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+ quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+ cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+ proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+
+
+
+
+
+
+ BACK
+
+
Angular
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+ tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+ quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+ cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+ proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/card/x-card.html b/dashboard-ui/bower_components/neon-animation/demo/card/x-card.html
new file mode 100644
index 0000000000..fdcf18c9ac
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/card/x-card.html
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/card/x-cards-list.html b/dashboard-ui/bower_components/neon-animation/demo/card/x-cards-list.html
new file mode 100644
index 0000000000..204cf2c138
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/card/x-cards-list.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/declarative/index.html b/dashboard-ui/bower_components/neon-animation/demo/declarative/index.html
new file mode 100644
index 0000000000..9385bccaa3
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/declarative/index.html
@@ -0,0 +1,108 @@
+
+
+
+
+
neon-animated-pages demo: declarative
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <<
+ >>
+
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/doc/basic.html b/dashboard-ui/bower_components/neon-animation/demo/doc/basic.html
new file mode 100644
index 0000000000..9e79151eea
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/doc/basic.html
@@ -0,0 +1,47 @@
+
+
+
+
+
neon-animation demo: basic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ click me
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/doc/my-animatable.html b/dashboard-ui/bower_components/neon-animation/demo/doc/my-animatable.html
new file mode 100644
index 0000000000..ec74536fa8
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/doc/my-animatable.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/doc/my-dialog.html b/dashboard-ui/bower_components/neon-animation/demo/doc/my-dialog.html
new file mode 100644
index 0000000000..64bb3003fe
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/doc/my-dialog.html
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/doc/types.html b/dashboard-ui/bower_components/neon-animation/demo/doc/types.html
new file mode 100644
index 0000000000..3995b6c931
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/doc/types.html
@@ -0,0 +1,53 @@
+
+
+
+
+
neon-animation demo: basic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Toggle
+
+
+ Hello World!
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/dropdown/animated-dropdown.html b/dashboard-ui/bower_components/neon-animation/demo/dropdown/animated-dropdown.html
new file mode 100644
index 0000000000..87678f5c1e
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/dropdown/animated-dropdown.html
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/dropdown/index.html b/dashboard-ui/bower_components/neon-animation/demo/dropdown/index.html
new file mode 100644
index 0000000000..34cf8219d0
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/dropdown/index.html
@@ -0,0 +1,54 @@
+
+
+
+
+
neon-animated-pages demo: dropdown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dropdown
+
+ Hello world!
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/grid/animated-grid.html b/dashboard-ui/bower_components/neon-animation/demo/grid/animated-grid.html
new file mode 100644
index 0000000000..af976754c1
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/grid/animated-grid.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[item.value]]
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/grid/fullsize-page-with-card.html b/dashboard-ui/bower_components/neon-animation/demo/grid/fullsize-page-with-card.html
new file mode 100644
index 0000000000..a365394e4d
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/grid/fullsize-page-with-card.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/grid/index.html b/dashboard-ui/bower_components/neon-animation/demo/grid/index.html
new file mode 100644
index 0000000000..8b34434de8
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/grid/index.html
@@ -0,0 +1,70 @@
+
+
+
+
+
neon-animated-pages demo: grid
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/index.html b/dashboard-ui/bower_components/neon-animation/demo/index.html
new file mode 100644
index 0000000000..11261455ae
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/index.html
@@ -0,0 +1,7 @@
+
declarative
+
dropdown
+
grid
+
list
+
load
+
tiles
+
card
diff --git a/dashboard-ui/bower_components/neon-animation/demo/list/full-view.html b/dashboard-ui/bower_components/neon-animation/demo/list/full-view.html
new file mode 100644
index 0000000000..817acfab9f
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/list/full-view.html
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/list/index.html b/dashboard-ui/bower_components/neon-animation/demo/list/index.html
new file mode 100644
index 0000000000..4ee8337180
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/list/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+
neon-animated-pages demo: list
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/list/list-demo.html b/dashboard-ui/bower_components/neon-animation/demo/list/list-demo.html
new file mode 100644
index 0000000000..6658ebfd01
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/list/list-demo.html
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/list/list-view.html b/dashboard-ui/bower_components/neon-animation/demo/list/list-view.html
new file mode 100644
index 0000000000..b23b00d4d0
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/list/list-view.html
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[item.fileName]]
+ [[item.modifiedDate]]
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/load/animated-grid.html b/dashboard-ui/bower_components/neon-animation/demo/load/animated-grid.html
new file mode 100644
index 0000000000..f43851b45b
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/load/animated-grid.html
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[item.value]]
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/load/full-page.html b/dashboard-ui/bower_components/neon-animation/demo/load/full-page.html
new file mode 100644
index 0000000000..1488de19c2
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/load/full-page.html
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/load/index.html b/dashboard-ui/bower_components/neon-animation/demo/load/index.html
new file mode 100644
index 0000000000..3c22281f60
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/load/index.html
@@ -0,0 +1,45 @@
+
+
+
+
+
neon-animated-pages demo: load
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/reprojection/animated-grid.html b/dashboard-ui/bower_components/neon-animation/demo/reprojection/animated-grid.html
new file mode 100644
index 0000000000..e65ba51e1b
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/reprojection/animated-grid.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[item.value]]
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/reprojection/fullsize-page-with-card.html b/dashboard-ui/bower_components/neon-animation/demo/reprojection/fullsize-page-with-card.html
new file mode 100644
index 0000000000..a365394e4d
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/reprojection/fullsize-page-with-card.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/reprojection/index.html b/dashboard-ui/bower_components/neon-animation/demo/reprojection/index.html
new file mode 100644
index 0000000000..acd196eaaf
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/reprojection/index.html
@@ -0,0 +1,66 @@
+
+
+
+
+
neon-animated-pages demo: grid
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/reprojection/reprojected-pages.html b/dashboard-ui/bower_components/neon-animation/demo/reprojection/reprojected-pages.html
new file mode 100644
index 0000000000..647289dc15
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/reprojection/reprojected-pages.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/shared.css b/dashboard-ui/bower_components/neon-animation/demo/shared.css
new file mode 100644
index 0000000000..fc1011fe3c
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/shared.css
@@ -0,0 +1,40 @@
+/*
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+*/
+
+.red-100 {
+ background: var(--google-red-100);
+}
+
+.yellow-100 {
+ background: var(--google-yellow-100);
+}
+
+.blue-100 {
+ background: var(--google-blue-100);
+}
+
+.green-100 {
+ background: var(--google-green-100);
+}
+
+.red-300 {
+ background: var(--google-red-300);
+}
+
+.yellow-300 {
+ background: var(--google-yellow-300);
+}
+
+.blue-300 {
+ background: var(--google-blue-300);
+}
+
+.green-300 {
+ background: var(--google-green-300);
+}
diff --git a/dashboard-ui/bower_components/neon-animation/demo/tiles/circles-page.html b/dashboard-ui/bower_components/neon-animation/demo/tiles/circles-page.html
new file mode 100644
index 0000000000..566d69b67f
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/tiles/circles-page.html
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/tiles/index.html b/dashboard-ui/bower_components/neon-animation/demo/tiles/index.html
new file mode 100644
index 0000000000..0afec46ce4
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/tiles/index.html
@@ -0,0 +1,77 @@
+
+
+
+
+
neon-animated-pages demo: tiles
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/demo/tiles/squares-page.html b/dashboard-ui/bower_components/neon-animation/demo/tiles/squares-page.html
new file mode 100644
index 0000000000..f417e6b9c5
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/demo/tiles/squares-page.html
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/guides/neon-animation.md b/dashboard-ui/bower_components/neon-animation/guides/neon-animation.md
new file mode 100644
index 0000000000..7af1659a7e
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/guides/neon-animation.md
@@ -0,0 +1,313 @@
+---
+title: neon-animation
+summary: "A short guide to neon-animation and neon-animated-pages"
+tags: ['animation','core-animated-pages']
+elements: ['neon-animation','neon-animated-pages']
+updated: 2015-05-26
+---
+
+# neon-animation
+
+`neon-animation` is a suite of elements and behaviors to implement pluggable animated transitions for Polymer Elements using [Web Animations](https://w3c.github.io/web-animations/).
+
+*Warning: The API may change.*
+
+* [A basic animatable element](#basic)
+* [Animation configuration](#configuration)
+ * [Animation types](#configuration-types)
+ * [Configuration properties](#configuration-properties)
+ * [Using multiple animations](#configuration-multiple)
+ * [Running animations encapsulated in children nodes](#configuration-encapsulation)
+* [Page transitions](#page-transitions)
+ * [Shared element animations](#shared-element)
+ * [Declarative page transitions](#declarative-page)
+* [Included animations](#animations)
+* [Demos](#demos)
+
+
+## A basic animatable element
+
+Elements that can be animated should implement the `Polymer.NeonAnimatableBehavior` behavior, or `Polymer.NeonAnimationRunnerBehavior` if they're also responsible for running an animation.
+
+```js
+Polymer({
+ is: 'my-animatable',
+ behaviors: [
+ Polymer.NeonAnimationRunnerBehavior
+ ],
+ properties: {
+ animationConfig: {
+ value: function() {
+ return {
+ // provided by neon-animation/animations/scale-down-animation.html
+ name: 'scale-down-animation',
+ node: this
+ }
+ }
+ }
+ },
+ listeners: {
+ // this event is fired when the animation finishes
+ 'neon-animation-finish': '_onNeonAnimationFinish'
+ },
+ animate: function() {
+ // run scale-down-animation
+ this.playAnimation();
+ },
+ _onNeonAnimationFinish: function() {
+ console.log('animation done!');
+ }
+});
+```
+
+[Live demo](http://morethanreal.github.io/neon-animation-demo/bower_components/neon-animation/demo/doc/basic.html)
+
+
+## Animation configuration
+
+
+### Animation types
+
+An element might run different animations, for example it might do something different when it enters the view and when it exits from view. You can set the `animationConfig` property to a map from an animation type to configuration.
+
+```js
+Polymer({
+ is: 'my-dialog',
+ behaviors: [
+ Polymer.NeonAnimationRunnerBehavior
+ ],
+ properties: {
+ opened: {
+ type: Boolean
+ },
+ animationConfig: {
+ value: function() {
+ return {
+ 'entry': {
+ // provided by neon-animation/animations/scale-up-animation.html
+ name: 'scale-up-animation',
+ node: this
+ },
+ 'exit': {
+ // provided by neon-animation-animations/fade-out-animation.html
+ name: 'fade-out-animation',
+ node: this
+ }
+ }
+ }
+ }
+ },
+ listeners: {
+ 'neon-animation-finish': '_onNeonAnimationFinish'
+ },
+ show: function() {
+ this.opened = true;
+ this.style.display = 'inline-block';
+ // run scale-up-animation
+ this.playAnimation('entry');
+ },
+ hide: function() {
+ this.opened = false;
+ // run fade-out-animation
+ this.playAnimation('fade-out-animation');
+ },
+ _onNeonAnimationFinish: function() {
+ if (!this.opened) {
+ this.style.display = 'none';
+ }
+ }
+});
+```
+
+[Live demo](http://morethanreal.github.io/neon-animation-demo/bower_components/neon-animation/demo/doc/types.html)
+
+You can also use the convenience properties `entryAnimation` and `exitAnimation` to set `entry` and `exit` animations:
+
+```js
+properties: {
+ entryAnimation: {
+ value: 'scale-up-animation'
+ },
+ exitAnimation: {
+ value: 'fade-out-animation'
+ }
+}
+```
+
+
+### Configuration properties
+
+You can pass additional parameters to configure an animation in the animation configuration object.
+All animations should accept the following properties:
+
+ * `name`: The name of an animation, ie. an element implementing `Polymer.NeonAnimationBehavior`.
+ * `node`: The target node to apply the animation to. Defaults to `this`.
+ * `timing`: Timing properties to use in this animation. They match the [Web Animations Animation Effect Timing interface](https://w3c.github.io/web-animations/#the-animationeffecttiming-interface). The
+ properties include the following:
+ * `duration`: The duration of the animation in milliseconds.
+ * `delay`: The delay before the start of the animation in milliseconds.
+ * `easing`: A timing function for the animation. Matches the CSS timing function values.
+
+Animations may define additional configuration properties and they are listed in their documentation.
+
+
+### Using multiple animations
+
+Set the animation configuration to an array to combine animations, like this:
+
+```js
+animationConfig: {
+ value: function() {
+ return {
+ // fade-in-animation is run with a 50ms delay from slide-down-animation
+ 'entry': [{
+ name: 'slide-down-animation',
+ node: this
+ }, {
+ name: 'fade-in-animation',
+ node: this,
+ timing: {delay: 50}
+ }]
+ }
+ }
+}
+```
+
+
+### Running animations encapsulated in children nodes
+
+You can include animations in the configuration that are encapsulated in a child element that implement `Polymer.NeonAnimatableBehavior` with the `animatable` property.
+
+```js
+animationConfig: {
+ value: function() {
+ return {
+ // run fade-in-animation on this, and the entry animation on this.$.myAnimatable
+ 'entry': [
+ {name: 'fade-in-animation', node: this},
+ {animatable: this.$.myAnimatable, type: 'entry'}
+ ]
+ }
+ }
+}
+```
+
+
+## Page transitions
+
+*The artist formerly known as `
`*
+
+The `neon-animated-pages` element manages a set of pages to switch between, and runs animations between the page transitions. It implements the `Polymer.IronSelectableBehavior` behavior. Each child node should implement `Polymer.NeonAnimatableBehavior` and define the `entry` and `exit` animations. During a page transition, the `entry` animation is run on the new page and the `exit` animation is run on the old page.
+
+
+### Shared element animations
+
+Shared element animations work on multiple nodes. For example, a "hero" animation is used during a page transition to make two elements from separate pages appear to animate as a single element. Shared element animation configurations have an `id` property that identify they belong in the same animation. Elements containing shared elements also have a `sharedElements` property defines a map from `id` to element, the element involved with the animation.
+
+In the incoming page:
+
+```js
+properties: {
+ animationConfig: {
+ value: function() {
+ return {
+ // the incoming page defines the 'entry' animation
+ 'entry': {
+ name: 'hero-animation',
+ id: 'hero',
+ toPage: this
+ }
+ }
+ }
+ },
+ sharedElements: {
+ value: function() {
+ return {
+ 'hero': this.$.hero
+ }
+ }
+ }
+}
+```
+
+In the outgoing page:
+
+```js
+properties: {
+ animationConfig: {
+ value: function() {
+ return {
+ // the outgoing page defines the 'exit' animation
+ 'exit': {
+ name: 'hero-animation',
+ id: 'hero',
+ fromPage: this
+ }
+ }
+ }
+ },
+ sharedElements: {
+ value: function() {
+ return {
+ 'hero': this.$.otherHero
+ }
+ }
+ }
+}
+```
+
+
+### Declarative page transitions
+
+For convenience, if you define the `entry-animation` and `exit-animation` attributes on ``, those animations will apply for all page transitions.
+
+For example:
+
+```js
+
+ 1
+ 2
+ 3
+ 4
+ 5
+
+```
+
+The new page will slide in from the right, and the old page slide away to the left.
+
+
+## Included animations
+
+Single element animations:
+
+ * `fade-in-animation` Animates opacity from `0` to `1`.
+ * `fade-out-animation` Animates opacity from `1` to `0`.
+ * `scale-down-animation` Animates transform from `scale(1)` to `scale(0)`.
+ * `scale-up-animation` Animates transform from `scale(0)` to `scale(1)`.
+ * `slide-down-animation` Animates transform from `translateY(-100%)` to `none`.
+ * `slide-up-animation` Animates transform from `none` to `translateY(-100%)`.
+ * `slide-left-animation` Animates transform from `none` to `translateX(-100%)`;
+ * `slide-right-animation` Animates transform from `none` to `translateX(100%)`;
+ * `slide-from-left-animation` Animates transform from `translateX(-100%)` to `none`;
+ * `slide-from-right-animation` Animates transform from `translateX(100%)` to `none`;
+
+ * `transform-animation` Animates a custom transform.
+
+Note that there is a restriction that only one transform animation can be applied on the same element at a time. Use the custom `transform-animation` to combine transform properties.
+
+Shared element animations
+
+ * `hero-animation` Animates an element such that it looks like it scales and transforms from another element.
+ * `ripple-animation` Animates an element to full screen such that it looks like it ripples from another element.
+
+Group animations
+ * `cascaded-animation` Applys an animation to an array of elements with a delay between each.
+
+
+## Demos
+
+ * [Grid to full screen](http://morethanreal.github.io/neon-animation-demo/bower_components/neon-animation/demo/grid/index.html)
+ * [Animation on load](http://morethanreal.github.io/neon-animation-demo/bower_components/neon-animation/demo/load/index.html)
+ * [List item to detail](http://morethanreal.github.io/neon-animation-demo/bower_components/neon-animation/demo/list/index.html) (For narrow width)
+ * [Dots to squares](http://morethanreal.github.io/neon-animation-demo/bower_components/neon-animation/demo/tiles/index.html)
+ * [Declarative](http://morethanreal.github.io/neon-animation-demo/bower_components/neon-animation/demo/declarative/index.html)
diff --git a/dashboard-ui/bower_components/neon-animation/index.html b/dashboard-ui/bower_components/neon-animation/index.html
new file mode 100644
index 0000000000..6f5feedf45
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ neon-animation
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-animatable-behavior.html b/dashboard-ui/bower_components/neon-animation/neon-animatable-behavior.html
new file mode 100644
index 0000000000..fac56f8081
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-animatable-behavior.html
@@ -0,0 +1,156 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-animatable.html b/dashboard-ui/bower_components/neon-animation/neon-animatable.html
new file mode 100644
index 0000000000..6db9d83d8b
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-animatable.html
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-animated-pages.html b/dashboard-ui/bower_components/neon-animation/neon-animated-pages.html
new file mode 100644
index 0000000000..66693b5427
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-animated-pages.html
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-animation-behavior.html b/dashboard-ui/bower_components/neon-animation/neon-animation-behavior.html
new file mode 100644
index 0000000000..107d753a7f
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-animation-behavior.html
@@ -0,0 +1,85 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-animation-runner-behavior.html b/dashboard-ui/bower_components/neon-animation/neon-animation-runner-behavior.html
new file mode 100644
index 0000000000..bed94fc8fb
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-animation-runner-behavior.html
@@ -0,0 +1,119 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-animation.html b/dashboard-ui/bower_components/neon-animation/neon-animation.html
new file mode 100644
index 0000000000..150068a3c9
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-animation.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-animations.html b/dashboard-ui/bower_components/neon-animation/neon-animations.html
new file mode 100644
index 0000000000..9a34c97920
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-animations.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-shared-element-animatable-behavior.html b/dashboard-ui/bower_components/neon-animation/neon-shared-element-animatable-behavior.html
new file mode 100644
index 0000000000..e63173d368
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-shared-element-animatable-behavior.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/neon-shared-element-animation-behavior.html b/dashboard-ui/bower_components/neon-animation/neon-shared-element-animation-behavior.html
new file mode 100644
index 0000000000..7787615b03
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/neon-shared-element-animation-behavior.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/test/index.html b/dashboard-ui/bower_components/neon-animation/test/index.html
new file mode 100644
index 0000000000..5f05996316
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/test/index.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ neon-animation tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/test/neon-animated-pages.html b/dashboard-ui/bower_components/neon-animation/test/neon-animated-pages.html
new file mode 100644
index 0000000000..5ecbf07cd6
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/test/neon-animated-pages.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+ neon-animated-pages tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/test/test-resizable-pages.html b/dashboard-ui/bower_components/neon-animation/test/test-resizable-pages.html
new file mode 100644
index 0000000000..973a03a51d
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/test/test-resizable-pages.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/neon-animation/web-animations.html b/dashboard-ui/bower_components/neon-animation/web-animations.html
new file mode 100644
index 0000000000..c871854017
--- /dev/null
+++ b/dashboard-ui/bower_components/neon-animation/web-animations.html
@@ -0,0 +1,11 @@
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/.bower.json b/dashboard-ui/bower_components/paper-behaviors/.bower.json
new file mode 100644
index 0000000000..7c969e4703
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/.bower.json
@@ -0,0 +1,48 @@
+{
+ "name": "paper-behaviors",
+ "version": "1.0.2",
+ "description": "Common behaviors across the paper elements",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "main": [
+ "paper-button-behavior.html",
+ "paper-radio-button-behavior.html"
+ ],
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "paper",
+ "behavior"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-behaviors"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-behaviors",
+ "dependencies": {
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "paper-material": "PolymerElements/paper-material#^1.0.0",
+ "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "4dd226a2cc5b780a73d0058cd9998b6e0af1cb2c"
+ },
+ "_source": "git://github.com/polymerelements/paper-behaviors.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/paper-behaviors"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-behaviors/.gitignore b/dashboard-ui/bower_components/paper-behaviors/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-behaviors/bower.json b/dashboard-ui/bower_components/paper-behaviors/bower.json
new file mode 100644
index 0000000000..d4cae45d7e
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/bower.json
@@ -0,0 +1,39 @@
+{
+ "name": "paper-behaviors",
+ "version": "1.0.2",
+ "description": "Common behaviors across the paper elements",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "main": [
+ "paper-button-behavior.html",
+ "paper-radio-button-behavior.html"
+ ],
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "paper",
+ "behavior"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-behaviors"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-behaviors",
+ "dependencies": {
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "paper-material": "PolymerElements/paper-material#^1.0.0",
+ "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-behaviors/demo/index.html b/dashboard-ui/bower_components/paper-behaviors/demo/index.html
new file mode 100644
index 0000000000..d6b775b8bb
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/demo/index.html
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+ paper-behaviors demo
+
+
+
+
+
+
+
+
+
+
+
+ Normal
+
+ Hello World
+
+ Toggles
+
+ Hello World
+
+ Disabled
+
+ Hello World
+
+ Radio button with focus state
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/demo/paper-button.html b/dashboard-ui/bower_components/paper-behaviors/demo/paper-button.html
new file mode 100644
index 0000000000..c38bd00924
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/demo/paper-button.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/demo/paper-radio-button.html b/dashboard-ui/bower_components/paper-behaviors/demo/paper-radio-button.html
new file mode 100644
index 0000000000..93af1752b5
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/demo/paper-radio-button.html
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/index.html b/dashboard-ui/bower_components/paper-behaviors/index.html
new file mode 100644
index 0000000000..3e003cb3be
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/paper-button-behavior.html b/dashboard-ui/bower_components/paper-behaviors/paper-button-behavior.html
new file mode 100644
index 0000000000..bbe508f334
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/paper-button-behavior.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/paper-inky-focus-behavior.html b/dashboard-ui/bower_components/paper-behaviors/paper-inky-focus-behavior.html
new file mode 100644
index 0000000000..4f6e9f8933
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/paper-inky-focus-behavior.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/test/index.html b/dashboard-ui/bower_components/paper-behaviors/test/index.html
new file mode 100644
index 0000000000..c58bfee5cb
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/test/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/test/paper-button-behavior.html b/dashboard-ui/bower_components/paper-behaviors/test/paper-button-behavior.html
new file mode 100644
index 0000000000..9663938d72
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/test/paper-button-behavior.html
@@ -0,0 +1,82 @@
+
+
+
+
+
+ paper-button-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/test/paper-radio-button-behavior.html b/dashboard-ui/bower_components/paper-behaviors/test/paper-radio-button-behavior.html
new file mode 100644
index 0000000000..890d0bb487
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/test/paper-radio-button-behavior.html
@@ -0,0 +1,62 @@
+
+
+
+
+
+ paper-radio-button-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/test/test-button.html b/dashboard-ui/bower_components/paper-behaviors/test/test-button.html
new file mode 100644
index 0000000000..3bbf356e67
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/test/test-button.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-behaviors/test/test-radio-button.html b/dashboard-ui/bower_components/paper-behaviors/test/test-radio-button.html
new file mode 100644
index 0000000000..afeabbb2c0
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-behaviors/test/test-radio-button.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-button/.bower.json b/dashboard-ui/bower_components/paper-button/.bower.json
new file mode 100644
index 0000000000..5a95d419f7
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-button/.bower.json
@@ -0,0 +1,48 @@
+{
+ "name": "paper-button",
+ "version": "1.0.2",
+ "description": "Material design button",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "paper",
+ "button"
+ ],
+ "main": "paper-button.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-button"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-button",
+ "dependencies": {
+ "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
+ "paper-material": "polymerelements/paper-material#^1.0.0",
+ "paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "e804f62099c79f909ec9f94d78b790bff7b88682"
+ },
+ "_source": "git://github.com/PolymerElements/paper-button.git",
+ "_target": "~1.0.1",
+ "_originalSource": "PolymerElements/paper-button"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-button/.gitignore b/dashboard-ui/bower_components/paper-button/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-button/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-button/bower.json b/dashboard-ui/bower_components/paper-button/bower.json
new file mode 100644
index 0000000000..bd89d5c2ee
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-button/bower.json
@@ -0,0 +1,39 @@
+{
+ "name": "paper-button",
+ "version": "1.0.2",
+ "description": "Material design button",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "paper",
+ "button"
+ ],
+ "main": "paper-button.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-button"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-button",
+ "dependencies": {
+ "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
+ "paper-material": "polymerelements/paper-material#^1.0.0",
+ "paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-button/demo/index.html b/dashboard-ui/bower_components/paper-button/demo/index.html
new file mode 100644
index 0000000000..e8af2969e8
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-button/demo/index.html
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+ paper-button demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Flat
+
+
button
+
colorful
+
disabled
+
noink
+
ok
+
cancel
+
+
+
+
+
+
Raised
+
+
button
+
colorful
+
disabled
+
noink
+
ok
+
cancel
+
+
+
+
+
Toggleable
+
+
button
+
noink
+
colorful
+
colorful
+
ok
+
cancel
+
+
+
+
+
Color
+
+
button
+
noink
+
colorful
+
colorful
+
ok
+
cancel
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-button/index.html b/dashboard-ui/bower_components/paper-button/index.html
new file mode 100644
index 0000000000..e871f17d98
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-button/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-button/paper-button.html b/dashboard-ui/bower_components/paper-button/paper-button.html
new file mode 100644
index 0000000000..57f716c91b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-button/paper-button.html
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-button/test/index.html b/dashboard-ui/bower_components/paper-button/test/index.html
new file mode 100644
index 0000000000..07ed03ccff
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-button/test/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ paper-button tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-button/test/paper-button.html b/dashboard-ui/bower_components/paper-button/test/paper-button.html
new file mode 100644
index 0000000000..797688cefa
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-button/test/paper-button.html
@@ -0,0 +1,83 @@
+
+
+
+
+
+ paper-button basic tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Button
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/.bower.json b/dashboard-ui/bower_components/paper-dialog-behavior/.bower.json
new file mode 100644
index 0000000000..0a7138be23
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/.bower.json
@@ -0,0 +1,46 @@
+{
+ "name": "paper-dialog-behavior",
+ "version": "1.0.4",
+ "description": "Implements a behavior used for material design dialogs",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "dialog",
+ "overlay",
+ "behavior"
+ ],
+ "main": [
+ "paper-dialog-behavior.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-dialog-behavior"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-dialog-behavior",
+ "ignore": [],
+ "dependencies": {
+ "iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-button": "PolymerElements/paper-button#^1.0.0",
+ "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.4",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.4",
+ "commit": "09662387b0bc55651dd7b9ef8d38b3b8f55ecf3c"
+ },
+ "_source": "git://github.com/PolymerElements/paper-dialog-behavior.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/paper-dialog-behavior"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/.gitignore b/dashboard-ui/bower_components/paper-dialog-behavior/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/bower.json b/dashboard-ui/bower_components/paper-dialog-behavior/bower.json
new file mode 100644
index 0000000000..9ff98a0c1c
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/bower.json
@@ -0,0 +1,37 @@
+{
+ "name": "paper-dialog-behavior",
+ "version": "1.0.4",
+ "description": "Implements a behavior used for material design dialogs",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "dialog",
+ "overlay",
+ "behavior"
+ ],
+ "main": [
+ "paper-dialog-behavior.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-dialog-behavior"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-dialog-behavior",
+ "ignore": [],
+ "dependencies": {
+ "iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-button": "PolymerElements/paper-button#^1.0.0",
+ "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/demo/index.html b/dashboard-ui/bower_components/paper-dialog-behavior/demo/index.html
new file mode 100644
index 0000000000..3f354e726c
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/demo/index.html
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+ paper-dialog-behavior demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
dialog
+
+
+ Dialog Title
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
modal alert
+
+
+ Alert
+ Discard draft?
+
+
+
+
scrolling
+
+
+ Scrolling
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/demo/simple-dialog.html b/dashboard-ui/bower_components/paper-dialog-behavior/demo/simple-dialog.html
new file mode 100644
index 0000000000..1bda9cdf29
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/demo/simple-dialog.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/hero.svg b/dashboard-ui/bower_components/paper-dialog-behavior/hero.svg
new file mode 100644
index 0000000000..d47381685f
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/hero.svg
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/index.html b/dashboard-ui/bower_components/paper-dialog-behavior/index.html
new file mode 100644
index 0000000000..af98b85acd
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ paper-dialog-behavior
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-behavior.html b/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-behavior.html
new file mode 100644
index 0000000000..0afcb8b7f8
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-behavior.html
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-common.css b/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-common.css
new file mode 100644
index 0000000000..542f6f3651
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-common.css
@@ -0,0 +1,58 @@
+/*
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+*/
+
+:host {
+ display: block;
+ margin: 24px 40px;
+
+ background: var(--paper-dialog-background-color, --primary-background-color);
+ color: var(--paper-dialog-color, --primary-text-color);
+
+ @apply(--layout-scroll);
+ @apply(--paper-font-body1);
+ @apply(--shadow-elevation-16dp);
+ @apply(--paper-dialog);
+}
+
+:host > ::content > * {
+ margin-top: 20px;
+ padding: 0 24px;
+}
+
+:host > ::content > .no-padding {
+ padding: 0;
+}
+
+:host > ::content > *:first-child {
+ margin-top: 24px;
+}
+
+:host > ::content > *:last-child {
+ margin-bottom: 24px;
+}
+
+:host > ::content h2 {
+ position: relative;
+ margin: 0;
+ @apply(--paper-font-title);
+
+ @apply(--paper-dialog-title);
+}
+
+:host > ::content .buttons {
+ position: relative;
+ padding: 8px 8px 8px 24px;
+ margin: 0;
+
+ color: var(--paper-dialog-button-color, --default-primary-color);
+
+ @apply(--layout-horizontal);
+ @apply(--layout-end-justified);
+}
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/test/index.html b/dashboard-ui/bower_components/paper-dialog-behavior/test/index.html
new file mode 100644
index 0000000000..7a7b2d0db8
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/test/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ paper-dialog tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/test/paper-dialog-behavior.html b/dashboard-ui/bower_components/paper-dialog-behavior/test/paper-dialog-behavior.html
new file mode 100644
index 0000000000..f34bd83589
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/test/paper-dialog-behavior.html
@@ -0,0 +1,231 @@
+
+
+
+
+
+ paper-dialog-behavior tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Dialog
+
+ extra
+ dismiss
+ confirm
+
+
+
+
+
+
+
+
+ Dialog
+
+ dismiss
+ confirm
+
+
+
+
+
+
+
+
+ Dialog
+
+ dismiss
+ confirm
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/test/test-dialog.html b/dashboard-ui/bower_components/paper-dialog-behavior/test/test-dialog.html
new file mode 100644
index 0000000000..6a3952a5a2
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-behavior/test/test-dialog.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/.bower.json b/dashboard-ui/bower_components/paper-dialog-scrollable/.bower.json
new file mode 100644
index 0000000000..0643661d52
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/.bower.json
@@ -0,0 +1,46 @@
+{
+ "name": "paper-dialog-scrollable",
+ "version": "1.0.1",
+ "description": "A scrollable area used inside the material design dialog",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "dialog",
+ "overlay"
+ ],
+ "main": [
+ "paper-dialog-scrollable.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-dialog-scrollable"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-dialog-scrollable",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.1",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.1",
+ "commit": "94e65968791d9166d2d3bf186e449d042b10168f"
+ },
+ "_source": "git://github.com/PolymerElements/paper-dialog-scrollable.git",
+ "_target": "~1.0.1",
+ "_originalSource": "PolymerElements/paper-dialog-scrollable",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/.gitignore b/dashboard-ui/bower_components/paper-dialog-scrollable/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/bower.json b/dashboard-ui/bower_components/paper-dialog-scrollable/bower.json
new file mode 100644
index 0000000000..17ae8f7d4a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/bower.json
@@ -0,0 +1,36 @@
+{
+ "name": "paper-dialog-scrollable",
+ "version": "1.0.1",
+ "description": "A scrollable area used inside the material design dialog",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "dialog",
+ "overlay"
+ ],
+ "main": [
+ "paper-dialog-scrollable.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-dialog-scrollable"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-dialog-scrollable",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/demo/index.html b/dashboard-ui/bower_components/paper-dialog-scrollable/demo/index.html
new file mode 100644
index 0000000000..120aa8702e
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/demo/index.html
@@ -0,0 +1,290 @@
+
+
+
+
+
+
+
+
+
+ paper-dialog-scrollable demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Alice was beginning to get very tired of sitting by her sister
+ on the bank, and of having nothing to do: once or twice she had
+ peeped into the book her sister was reading, but it had no
+ pictures or conversations in it, 'and what is the use of a book,'
+ thought Alice 'without pictures or conversation?'
+
+ So she was considering in her own mind (as well as she could,
+ for the hot day made her feel very sleepy and stupid), whether
+ the pleasure of making a daisy-chain would be worth the trouble
+ of getting up and picking the daisies, when suddenly a White
+ Rabbit with pink eyes ran close by her.
+
+ There was nothing so very remarkable in that; nor did
+ Alice think it so very much out of the way to hear the
+ Rabbit say to itself, 'Oh dear! Oh dear! I shall be late!' (when
+ she thought it over afterwards, it occurred to her that she ought
+ to have wondered at this, but at the time it all seemed quite
+ natural); but when the Rabbit actually took a watch out of its
+ waistcoat-pocket, and looked at it, and then hurried on,
+ Alice started to her feet, for it flashed across her mind that
+ she had never before seen a rabbit with either a
+ waistcoat-pocket, or a watch to take out of it, and burning with
+ curiosity, she ran across the field after it, and fortunately was
+ just in time to see it pop down a large rabbit-hole under the
+ hedge.
+
+ In another moment down went Alice after it, never once
+ considering how in the world she was to get out again.
+
+ The rabbit-hole went straight on like a tunnel for some way,
+ and then dipped suddenly down, so suddenly that Alice had not a
+ moment to think about stopping herself before she found herself
+ falling down a very deep well.
+
+ Either the well was very deep, or she fell very slowly, for
+ she had plenty of time as she went down to look about her and to
+ wonder what was going to happen next. First, she tried to look
+ down and make out what she was coming to, but it was too dark to
+ see anything; then she looked at the sides of the well, and
+ noticed that they were filled with cupboards and book-shelves;
+ here and there she saw maps and pictures hung upon pegs. She took
+ down a jar from one of the shelves as she passed; it was labelled
+ 'ORANGE MARMALADE', but to her great disappointment it was empty:
+ she did not like to drop the jar for fear of killing somebody, so
+ managed to put it into one of the cupboards as she fell past
+ it.
+
+ 'Well!' thought Alice to herself, 'after such a fall as this,
+ I shall think nothing of tumbling down stairs! How brave they'll
+ all think me at home! Why, I wouldn't say anything about it, even
+ if I fell off the top of the house!' (Which was very likely
+ true.)
+
+ Down, down, down. Would the fall never come to an end!
+ 'I wonder how many miles I've fallen by this time?' she said
+ aloud. 'I must be getting somewhere near the centre of the earth.
+ Let me see: that would be four thousand miles down, I think--'
+ (for, you see, Alice had learnt several things of this sort in
+ her lessons in the schoolroom, and though this was not a very
+ good opportunity for showing off her knowledge, as there was no
+ one to listen to her, still it was good practice to say it over)
+ '--yes, that's about the right distance--but then I wonder what
+ Latitude or Longitude I've got to?' (Alice had no idea what
+ Latitude was, or Longitude either, but thought they were nice
+ grand words to say.)
+
+ Presently she began again. 'I wonder if I shall fall right
+ through the earth! How funny it'll seem to come out among
+ the people that walk with their heads downward! The Antipathies,
+ I think--' (she was rather glad there was no one listening, this
+ time, as it didn't sound at all the right word) '--but I shall
+ have to ask them what the name of the country is, you know.
+ Please, Ma'am, is this New Zealand or Australia?' (and she tried
+ to curtsey as she spoke--fancy curtseying as you're
+ falling through the air! Do you think you could manage it?) 'And
+ what an ignorant little girl she'll think me for asking! No,
+ it'll never do to ask: perhaps I shall see it written up
+ somewhere.'
+
+ Down, down, down. There was nothing else to do, so Alice soon
+ began talking again. 'Dinah'll miss me very much to-night, I
+ should think!' (Dinah was the cat.) 'I hope they'll remember her
+ saucer of milk at tea-time. Dinah my dear! I wish you were down
+ here with me! There are no mice in the air, I'm afraid, but you
+ might catch a bat, and that's very like a mouse, you know. But do
+ cats eat bats, I wonder?' And here Alice began to get rather
+ sleepy, and went on saying to herself, in a dreamy sort of way,
+ 'Do cats eat bats? Do cats eat bats?' and sometimes, 'Do bats eat
+ cats?' for, you see, as she couldn't answer either question, it
+ didn't much matter which way she put it. She felt that she was
+ dozing off, and had just begun to dream that she was walking hand
+ in hand with Dinah, and saying to her very earnestly, 'Now,
+ Dinah, tell me the truth: did you ever eat a bat?' when suddenly,
+ thump! thump! down she came upon a heap of sticks and dry leaves,
+ and the fall was over.
+
+ Alice was not a bit hurt, and she jumped up on to her feet in
+ a moment: she looked up, but it was all dark overhead; before her
+ was another long passage, and the White Rabbit was still in
+ sight, hurrying down it. There was not a moment to be lost: away
+ went Alice like the wind, and was just in time to hear it say, as
+ it turned a corner, 'Oh my ears and whiskers, how late it's
+ getting!' She was close behind it when she turned the corner, but
+ the Rabbit was no longer to be seen: she found herself in a long,
+ low hall, which was lit up by a row of lamps hanging from the
+ roof.
+
+ There were doors all round the hall, but they were all locked;
+ and when Alice had been all the way down one side and up the
+ other, trying every door, she walked sadly down the middle,
+ wondering how she was ever to get out again.
+
+ Suddenly she came upon a little three-legged table, all made
+ of solid glass; there was nothing on it except a tiny golden key,
+ and Alice's first thought was that it might belong to one of the
+ doors of the hall; but, alas! either the locks were too large, or
+ the key was too small, but at any rate it would not open any of
+ them. However, on the second time round, she came upon a low
+ curtain she had not noticed before, and behind it was a little
+ door about fifteen inches high: she tried the little golden key
+ in the lock, and to her great delight it fitted!
+
+ Alice opened the door and found that it led into a small
+ passage, not much larger than a rat-hole: she knelt down and
+ looked along the passage into the loveliest garden you ever saw.
+ How she longed to get out of that dark hall, and wander about
+ among those beds of bright flowers and those cool fountains, but
+ she could not even get her head though the doorway; 'and even if
+ my head would go through,' thought poor Alice, 'it would
+ be of very little use without my shoulders. Oh, how I wish I
+ could shut up like a telescope! I think I could, if I only know
+ how to begin.' For, you see, so many out-of-the-way things had
+ happened lately, that Alice had begun to think that very few
+ things indeed were really impossible.
+
+ There seemed to be no use in waiting by the little door, so
+ she went back to the table, half hoping she might find another
+ key on it, or at any rate a book of rules for shutting people up
+ like telescopes: this time she found a little bottle on it,
+ ('which certainly was not here before,' said Alice,) and round
+ the neck of the bottle was a paper label, with the words 'DRINK
+ ME' beautifully printed on it in large letters.
+
+ It was all very well to say 'Drink me,' but the wise little
+ Alice was not going to do that in a hurry. 'No, I'll look
+ first,' she said, 'and see whether it's marked "poison " or
+ not'; for she had read several nice little histories about
+ children who had got burnt, and eaten up by wild beasts and other
+ unpleasant things, all because they would not remember the
+ simple rules their friends had taught them: such as, that a
+ red-hot poker will burn you if you hold it too long; and that if
+ you cut your finger very deeply with a knife, it usually
+ bleeds; and she had never forgotten that, if you drink much from
+ a bottle marked 'poison ,' it is almost certain to disagree
+ with you, sooner or later.
+
+ However, this bottle was not marked 'poison,' so Alice
+ ventured to taste it, and finding it very nice, (it had, in fact,
+ a sort of mixed flavour of cherry-tart, custard, pine-apple,
+ roast turkey, toffee, and hot buttered toast,) she very soon
+ finished it off.
+
+
+
+ * * * * *
+
+ * * * *
+
+ * * * * *
+
+
+
+ 'What a curious feeling!' said Alice; 'I must be shutting up
+ like a telescope.'
+
+ And so it was indeed: she was now only ten inches high, and
+ her face brightened up at the thought that she was now the right
+ size for going through the little door into that lovely garden.
+ First, however, she waited for a few minutes to see if she was
+ going to shrink any further: she felt a little nervous about
+ this; 'for it might end, you know,' said Alice to herself, 'in my
+ going out altogether, like a candle. I wonder what I should be
+ like then?' And she tried to fancy what the flame of a candle is
+ like after the candle is blown out, for she could not remember
+ ever having seen such a thing.
+
+ After a while, finding that nothing more happened, she decided
+ on going into the garden at once; but, alas for poor Alice! when
+ she got to the door, she found she had forgotten the little
+ golden key, and when she went back to the table for it, she found
+ she could not possibly reach it: she could see it quite plainly
+ through the glass, and she tried her best to climb up one of the
+ legs of the table, but it was too slippery; and when she had
+ tired herself out with trying, the poor little thing sat down and
+ cried.
+
+ 'Come, there's no use in crying like that!' said Alice to
+ herself, rather sharply; 'I advise you to leave off this minute!'
+ She generally gave herself very good advice, (though she very
+ seldom followed it), and sometimes she scolded herself so
+ severely as to bring tears into her eyes; and once she remembered
+ trying to box her own ears for having cheated herself in a game
+ of croquet she was playing against herself, for this curious
+ child was very fond of pretending to be two people. 'But it's no
+ use now,' thought poor Alice, 'to pretend to be two people! Why,
+ there's hardly enough of me left to make one respectable
+ person!'
+
+ Soon her eye fell on a little glass box that was lying under
+ the table: she opened it, and found in it a very small cake, on
+ which the words 'EAT ME' were beautifully marked in currants.
+ 'Well, I'll eat it,' said Alice, 'and if it makes me grow larger,
+ I can reach the key; and if it makes me grow smaller, I can creep
+ under the door; so either way I'll get into the garden, and I
+ don't care which happens!'
+
+ She ate a little bit, and said anxiously to herself, 'Which
+ way? Which way?', holding her hand on the top of her head to feel
+ which way it was growing, and she was quite surprised to find
+ that she remained the same size: to be sure, this generally
+ happens when one eats cake, but Alice had got so much into the
+ way of expecting nothing but out-of-the-way things to happen,
+ that it seemed quite dull and stupid for life to go on in the
+ common way.
+
+ So she set to work, and very soon finished off the cake.
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/hero.svg b/dashboard-ui/bower_components/paper-dialog-scrollable/hero.svg
new file mode 100644
index 0000000000..40bc69a22c
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/hero.svg
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/index.html b/dashboard-ui/bower_components/paper-dialog-scrollable/index.html
new file mode 100644
index 0000000000..2d2ec7e245
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ paper-dialog-scrollable
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html b/dashboard-ui/bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html
new file mode 100644
index 0000000000..5f46d9c03f
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/test/index.html b/dashboard-ui/bower_components/paper-dialog-scrollable/test/index.html
new file mode 100644
index 0000000000..cb5a5a9092
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/test/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ paper-dialog tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog-scrollable/test/paper-dialog-scrollable.html b/dashboard-ui/bower_components/paper-dialog-scrollable/test/paper-dialog-scrollable.html
new file mode 100644
index 0000000000..e6606d6c47
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog-scrollable/test/paper-dialog-scrollable.html
@@ -0,0 +1,171 @@
+
+
+
+
+
+ paper-dialog-scrollable tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog/.bower.json b/dashboard-ui/bower_components/paper-dialog/.bower.json
new file mode 100644
index 0000000000..9ba130a919
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/.bower.json
@@ -0,0 +1,45 @@
+{
+ "name": "paper-dialog",
+ "description": "A Material Design dialog",
+ "version": "1.0.0",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "dialog",
+ "overlay"
+ ],
+ "main": "paper-dialog.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-dialog"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-dialog",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "paper-dialog-behavior": "PolymerElements/paper-dialog-behavior#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "neon-animation": "PolymerElements/neon-animation#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-button": "PolymerElements/paper-button#^1.0.0",
+ "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.0",
+ "commit": "6d66cf1e022e56ec28353a2f718e93535c7cac20"
+ },
+ "_source": "git://github.com/PolymerElements/paper-dialog.git",
+ "_target": "~1.0.0",
+ "_originalSource": "PolymerElements/paper-dialog",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-dialog/.gitignore b/dashboard-ui/bower_components/paper-dialog/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-dialog/bower.json b/dashboard-ui/bower_components/paper-dialog/bower.json
new file mode 100644
index 0000000000..2bce00e912
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/bower.json
@@ -0,0 +1,35 @@
+{
+ "name": "paper-dialog",
+ "description": "A Material Design dialog",
+ "version": "1.0.0",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "dialog",
+ "overlay"
+ ],
+ "main": "paper-dialog.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-dialog"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-dialog",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "paper-dialog-behavior": "PolymerElements/paper-dialog-behavior#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "neon-animation": "PolymerElements/neon-animation#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-button": "PolymerElements/paper-button#^1.0.0",
+ "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-dialog/demo/index.html b/dashboard-ui/bower_components/paper-dialog/demo/index.html
new file mode 100644
index 0000000000..619c6dca22
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/demo/index.html
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+ paper-dialog demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Dialog layouts
+
+ plain dialog
+ scrolling dialog
+ dialog with actions
+ modal dialog
+
+
+ Dialog Title
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+ Scrolling
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+
+ Dialog Title
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+ Custom styling
+ colors
+ size & position
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+ Transitions
+ transitions
+
+ Dialog Title
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog/hero.svg b/dashboard-ui/bower_components/paper-dialog/hero.svg
new file mode 100644
index 0000000000..713329b847
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/hero.svg
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog/index.html b/dashboard-ui/bower_components/paper-dialog/index.html
new file mode 100644
index 0000000000..6304b8dc64
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ paper-dialog
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog/paper-dialog.html b/dashboard-ui/bower_components/paper-dialog/paper-dialog.html
new file mode 100644
index 0000000000..002e242c9d
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/paper-dialog.html
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog/test/index.html b/dashboard-ui/bower_components/paper-dialog/test/index.html
new file mode 100644
index 0000000000..ae925b0589
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/test/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ paper-dialog tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-dialog/test/paper-dialog.html b/dashboard-ui/bower_components/paper-dialog/test/paper-dialog.html
new file mode 100644
index 0000000000..2eb005756d
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-dialog/test/paper-dialog.html
@@ -0,0 +1,53 @@
+
+
+
+
+
+ paper-dialog tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Dialog
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-drawer-panel/.bower.json b/dashboard-ui/bower_components/paper-drawer-panel/.bower.json
new file mode 100644
index 0000000000..44bb924e3b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-drawer-panel/.bower.json
@@ -0,0 +1,43 @@
+{
+ "name": "paper-drawer-panel",
+ "version": "1.0.2",
+ "description": "A responsive drawer panel",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "drawer",
+ "responsive",
+ "layout"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-drawer-panel.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-drawer-panel",
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-selector": "PolymerElements/iron-selector#^1.0.0",
+ "iron-media-query": "PolymerElements/iron-media-query#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-button": "PolymerElements/paper-button#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "691739c877914f7231eaca16b724bdca295dfe8d"
+ },
+ "_source": "git://github.com/PolymerElements/paper-drawer-panel.git",
+ "_target": "~1.0.2",
+ "_originalSource": "PolymerElements/paper-drawer-panel",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-drawer-panel/.gitignore b/dashboard-ui/bower_components/paper-drawer-panel/.gitignore
new file mode 100644
index 0000000000..fbe05fc93b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-drawer-panel/.gitignore
@@ -0,0 +1 @@
+bower_components/
diff --git a/dashboard-ui/bower_components/paper-drawer-panel/bower.json b/dashboard-ui/bower_components/paper-drawer-panel/bower.json
new file mode 100644
index 0000000000..f87cca9340
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-drawer-panel/bower.json
@@ -0,0 +1,33 @@
+{
+ "name": "paper-drawer-panel",
+ "version": "1.0.2",
+ "description": "A responsive drawer panel",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "drawer",
+ "responsive",
+ "layout"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-drawer-panel.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-drawer-panel",
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-selector": "PolymerElements/iron-selector#^1.0.0",
+ "iron-media-query": "PolymerElements/iron-media-query#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-button": "PolymerElements/paper-button#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-drawer-panel/demo/index.html b/dashboard-ui/bower_components/paper-drawer-panel/demo/index.html
new file mode 100644
index 0000000000..f69df9fb3c
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-drawer-panel/demo/index.html
@@ -0,0 +1,85 @@
+
+
+
+
+ paper-drawer-panel demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-drawer-panel/hero.svg b/dashboard-ui/bower_components/paper-drawer-panel/hero.svg
new file mode 100644
index 0000000000..5dfef365d9
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-drawer-panel/hero.svg
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-drawer-panel/index.html b/dashboard-ui/bower_components/paper-drawer-panel/index.html
new file mode 100644
index 0000000000..1390eccff0
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-drawer-panel/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+ paper-drawer-panel
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-drawer-panel/paper-drawer-panel.css b/dashboard-ui/bower_components/paper-drawer-panel/paper-drawer-panel.css
new file mode 100644
index 0000000000..747f0bb77f
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-drawer-panel/paper-drawer-panel.css
@@ -0,0 +1,152 @@
+/**
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+*/
+
+:host {
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+}
+
+iron-selector > #drawer {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
+ background-color: white;
+
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+
+ @apply(--paper-drawer-panel-drawer-container);
+}
+
+.transition > #drawer {
+ transition: -webkit-transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;
+ transition: transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;
+}
+
+.left-drawer > #drawer {
+ @apply(--paper-drawer-panel-left-drawer-container);
+}
+
+.right-drawer > #drawer {
+ left: auto;
+ right: 0;
+
+ @apply(--paper-drawer-panel-right-drawer-container);
+}
+
+iron-selector > #main {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+
+ @apply(--paper-drawer-panel-main-container);
+}
+
+.transition > #main {
+ transition: left ease-in-out 0.3s, padding ease-in-out 0.3s;
+}
+
+.right-drawer > #main {
+ left: 0;
+}
+
+.right-drawer.transition > #main {
+ transition: right ease-in-out 0.3s, padding ease-in-out 0.3s;
+}
+
+#main > ::content > [main] {
+ height: 100%;
+}
+
+#drawer > ::content > [drawer] {
+ height: 100%;
+}
+
+#scrim {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ visibility: hidden;
+ opacity: 0;
+ transition: opacity ease-in-out 0.38s, visibility ease-in-out 0.38s;
+ background-color: rgba(0, 0, 0, 0.3);
+}
+
+.narrow-layout > #drawer {
+ will-change: transform;
+}
+
+.narrow-layout > #drawer.iron-selected {
+ box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
+}
+
+.right-drawer.narrow-layout > #drawer.iron-selected {
+ box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.15);
+}
+
+.narrow-layout > #drawer > ::content > [drawer] {
+ border: 0;
+}
+
+.left-drawer.narrow-layout > #drawer:not(.iron-selected) {
+ -webkit-transform: translateX(-100%);
+ transform: translateX(-100%);
+}
+
+.right-drawer.narrow-layout > #drawer:not(.iron-selected) {
+ left: auto;
+ visibility: hidden;
+
+ -webkit-transform: translateX(100%);
+ transform: translateX(100%);
+}
+
+.right-drawer.narrow-layout.dragging > #drawer:not(.iron-selected),
+.right-drawer.narrow-layout.peeking > #drawer:not(.iron-selected) {
+ visibility: visible;
+}
+
+.narrow-layout > #main {
+ padding: 0;
+}
+
+.right-drawer.narrow-layout > #main {
+ left: 0;
+ right: 0;
+}
+
+.narrow-layout > #main:not(.iron-selected) > #scrim,
+.dragging > #main > #scrim {
+ visibility: visible;
+ opacity: var(--paper-drawer-panel-scrim-opacity, 1);
+}
+
+.narrow-layout > #main > * {
+ margin: 0;
+ min-height: 100%;
+ left: 0;
+ right: 0;
+
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
+ display: none;
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-drawer-panel/paper-drawer-panel.html b/dashboard-ui/bower_components/paper-drawer-panel/paper-drawer-panel.html
new file mode 100644
index 0000000000..833380fcdf
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-drawer-panel/paper-drawer-panel.html
@@ -0,0 +1,604 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-fab/.bower.json b/dashboard-ui/bower_components/paper-fab/.bower.json
new file mode 100644
index 0000000000..e0162f557a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/.bower.json
@@ -0,0 +1,49 @@
+{
+ "name": "paper-fab",
+ "version": "1.0.2",
+ "description": "A material design floating action button",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "button"
+ ],
+ "main": "paper-fab.html",
+ "ignore": [],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-fab"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-fab",
+ "dependencies": {
+ "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
+ "paper-material": "polymerelements/paper-material#^1.0.0",
+ "paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "59d2f77f456271f1ae4059b92d83ba7655fb1580"
+ },
+ "_source": "git://github.com/PolymerElements/paper-fab.git",
+ "_target": "~1.0.2",
+ "_originalSource": "PolymerElements/paper-fab",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-fab/.gitignore b/dashboard-ui/bower_components/paper-fab/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-fab/bower.json b/dashboard-ui/bower_components/paper-fab/bower.json
new file mode 100644
index 0000000000..f3738a24ef
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/bower.json
@@ -0,0 +1,39 @@
+{
+ "name": "paper-fab",
+ "version": "1.0.2",
+ "description": "A material design floating action button",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "button"
+ ],
+ "main": "paper-fab.html",
+ "ignore": [],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-fab"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-fab",
+ "dependencies": {
+ "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
+ "paper-material": "polymerelements/paper-material#^1.0.0",
+ "paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-fab/demo/index.html b/dashboard-ui/bower_components/paper-fab/demo/index.html
new file mode 100644
index 0000000000..3bd99355e5
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/demo/index.html
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+ paper-fab demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-fab/index.html b/dashboard-ui/bower_components/paper-fab/index.html
new file mode 100644
index 0000000000..c98a658d9b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/index.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ paper-fab
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-fab/paper-fab.html b/dashboard-ui/bower_components/paper-fab/paper-fab.html
new file mode 100644
index 0000000000..f607ca4711
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/paper-fab.html
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-fab/test/a11y.html b/dashboard-ui/bower_components/paper-fab/test/a11y.html
new file mode 100644
index 0000000000..2a2cbe3141
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/test/a11y.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+ paper-fab a11y tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-fab/test/basic.html b/dashboard-ui/bower_components/paper-fab/test/basic.html
new file mode 100644
index 0000000000..6c8a48aeb1
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/test/basic.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+ paper-fab basic tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-fab/test/index.html b/dashboard-ui/bower_components/paper-fab/test/index.html
new file mode 100644
index 0000000000..9f9021424f
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-fab/test/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ paper-fab tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-icon-button/.bower.json b/dashboard-ui/bower_components/paper-icon-button/.bower.json
new file mode 100644
index 0000000000..42648d462b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/.bower.json
@@ -0,0 +1,44 @@
+{
+ "name": "paper-icon-button",
+ "private": true,
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "A material design icon button",
+ "main": "paper-icon-button.html",
+ "author": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "button",
+ "icon",
+ "control"
+ ],
+ "dependencies": {
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
+ "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/paper-icon-button",
+ "_release": "1.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.2",
+ "commit": "b22ade2080f2527760eae41e4700c52d4689a866"
+ },
+ "_source": "git://github.com/PolymerElements/paper-icon-button.git",
+ "_target": "~1.0.2",
+ "_originalSource": "PolymerElements/paper-icon-button",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-icon-button/.gitignore b/dashboard-ui/bower_components/paper-icon-button/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-icon-button/bower.json b/dashboard-ui/bower_components/paper-icon-button/bower.json
new file mode 100644
index 0000000000..6886757eaa
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/bower.json
@@ -0,0 +1,33 @@
+{
+ "name": "paper-icon-button",
+ "private": true,
+ "version": "1.0.2",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "A material design icon button",
+ "main": "paper-icon-button.html",
+ "author": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "button",
+ "icon",
+ "control"
+ ],
+ "dependencies": {
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "paper-behaviors": "polymerelements/paper-behaviors#^1.0.0",
+ "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-icon-button/demo/index.html b/dashboard-ui/bower_components/paper-icon-button/demo/index.html
new file mode 100644
index 0000000000..cbe6795146
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/demo/index.html
@@ -0,0 +1,154 @@
+
+
+
+
+ paper-icon-button
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-icon-button/index.html b/dashboard-ui/bower_components/paper-icon-button/index.html
new file mode 100644
index 0000000000..94c3720cd7
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/index.html
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-icon-button/paper-icon-button.html b/dashboard-ui/bower_components/paper-icon-button/paper-icon-button.html
new file mode 100644
index 0000000000..f4164ce06d
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/paper-icon-button.html
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-icon-button/test/a11y.html b/dashboard-ui/bower_components/paper-icon-button/test/a11y.html
new file mode 100644
index 0000000000..f6bf6fd448
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/test/a11y.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+ paper-icon-button a11y tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-icon-button/test/basic.html b/dashboard-ui/bower_components/paper-icon-button/test/basic.html
new file mode 100644
index 0000000000..e98689c6cc
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/test/basic.html
@@ -0,0 +1,77 @@
+
+
+
+
+
+ paper-icon-button basic tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-icon-button/test/index.html b/dashboard-ui/bower_components/paper-icon-button/test/index.html
new file mode 100644
index 0000000000..321c261243
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-icon-button/test/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ paper-icon-button tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/.bower.json b/dashboard-ui/bower_components/paper-input/.bower.json
new file mode 100644
index 0000000000..ad35939b91
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/.bower.json
@@ -0,0 +1,54 @@
+{
+ "name": "paper-input",
+ "version": "1.0.5",
+ "description": "Material design text fields",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "input"
+ ],
+ "main": [
+ "paper-input.html",
+ "paper-textarea.html",
+ "paper-input-behavior.html",
+ "paper-input-container.html",
+ "paper-input-error.html",
+ "paper-input-char-counter.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-input.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-input",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0",
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
+ "iron-input": "PolymerElements/iron-input#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
+ "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.5",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.5",
+ "commit": "72821a081710d9d5443e7b2311ff561def260807"
+ },
+ "_source": "git://github.com/PolymerElements/paper-input.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/paper-input"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-input/.gitignore b/dashboard-ui/bower_components/paper-input/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-input/all-imports.html b/dashboard-ui/bower_components/paper-input/all-imports.html
new file mode 100644
index 0000000000..0f45771864
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/all-imports.html
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/bower.json b/dashboard-ui/bower_components/paper-input/bower.json
new file mode 100644
index 0000000000..a306a1087a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/bower.json
@@ -0,0 +1,45 @@
+{
+ "name": "paper-input",
+ "version": "1.0.5",
+ "description": "Material design text fields",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "input"
+ ],
+ "main": [
+ "paper-input.html",
+ "paper-textarea.html",
+ "paper-input-behavior.html",
+ "paper-input-container.html",
+ "paper-input-error.html",
+ "paper-input-char-counter.html"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-input.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-input",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0",
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
+ "iron-input": "PolymerElements/iron-input#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
+ "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-input/demo/index.html b/dashboard-ui/bower_components/paper-input/demo/index.html
new file mode 100644
index 0000000000..57150bd5f9
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/demo/index.html
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+ paper-input demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Text input
+
+
+
Text area
+
+
+
Validation
+
+
+
Character counter
+
+
+
Complex inputs
+
+
+
+ Social Security Number
+
+ SSN invalid!
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/demo/ssn-input.html b/dashboard-ui/bower_components/paper-input/demo/ssn-input.html
new file mode 100644
index 0000000000..6037909214
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/demo/ssn-input.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+ -
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/demo/ssn-validator.html b/dashboard-ui/bower_components/paper-input/demo/ssn-validator.html
new file mode 100644
index 0000000000..4ab92f77ab
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/demo/ssn-validator.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/hero.svg b/dashboard-ui/bower_components/paper-input/hero.svg
new file mode 100644
index 0000000000..146ffeac67
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/hero.svg
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/index.html b/dashboard-ui/bower_components/paper-input/index.html
new file mode 100644
index 0000000000..e6c9fadcee
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+ paper-input
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/paper-input-addon-behavior.html b/dashboard-ui/bower_components/paper-input/paper-input-addon-behavior.html
new file mode 100644
index 0000000000..0b021a5dd4
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/paper-input-addon-behavior.html
@@ -0,0 +1,47 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/paper-input-behavior.html b/dashboard-ui/bower_components/paper-input/paper-input-behavior.html
new file mode 100644
index 0000000000..0afbc832c4
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/paper-input-behavior.html
@@ -0,0 +1,328 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/paper-input-char-counter.html b/dashboard-ui/bower_components/paper-input/paper-input-char-counter.html
new file mode 100644
index 0000000000..566f8c63ff
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/paper-input-char-counter.html
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[_charCounterStr]]
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/paper-input-container.html b/dashboard-ui/bower_components/paper-input/paper-input-container.html
new file mode 100644
index 0000000000..e9088c26df
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/paper-input-container.html
@@ -0,0 +1,506 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/paper-input-error.html b/dashboard-ui/bower_components/paper-input/paper-input-error.html
new file mode 100644
index 0000000000..c034e9624c
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/paper-input-error.html
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/paper-input.html b/dashboard-ui/bower_components/paper-input/paper-input.html
new file mode 100644
index 0000000000..5aa4a6eec3
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/paper-input.html
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[label]]
+
+
+
+
+ [[errorMessage]]
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/paper-textarea.html b/dashboard-ui/bower_components/paper-input/paper-textarea.html
new file mode 100644
index 0000000000..d47a5b5071
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/paper-textarea.html
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[label]]
+
+
+
+
+ [[errorMessage]]
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/test/index.html b/dashboard-ui/bower_components/paper-input/test/index.html
new file mode 100644
index 0000000000..cfed0b120d
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/test/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+ paper-input tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/test/letters-only.html b/dashboard-ui/bower_components/paper-input/test/letters-only.html
new file mode 100644
index 0000000000..bfc301c3e4
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/test/letters-only.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/test/paper-input-char-counter.html b/dashboard-ui/bower_components/paper-input/test/paper-input-char-counter.html
new file mode 100644
index 0000000000..6986aa7ff5
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/test/paper-input-char-counter.html
@@ -0,0 +1,112 @@
+
+
+
+
+
+ paper-input-counter tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/test/paper-input-container.html b/dashboard-ui/bower_components/paper-input/test/paper-input-container.html
new file mode 100644
index 0000000000..0b7acf87c8
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/test/paper-input-container.html
@@ -0,0 +1,237 @@
+
+
+
+
+
+ paper-input-container tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/test/paper-input-error.html b/dashboard-ui/bower_components/paper-input/test/paper-input-error.html
new file mode 100644
index 0000000000..2753b857cc
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/test/paper-input-error.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+ paper-input-error tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error
+
+
+
+
+
+ label
+
+ error
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/test/paper-input.html b/dashboard-ui/bower_components/paper-input/test/paper-input.html
new file mode 100644
index 0000000000..1c4dc25a3a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/test/paper-input.html
@@ -0,0 +1,244 @@
+
+
+
+
+
+ paper-input tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-input/test/paper-textarea.html b/dashboard-ui/bower_components/paper-input/test/paper-textarea.html
new file mode 100644
index 0000000000..7371a778d5
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-input/test/paper-textarea.html
@@ -0,0 +1,200 @@
+
+
+
+
+
+ paper-textarea tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-material/.bower.json b/dashboard-ui/bower_components/paper-material/.bower.json
new file mode 100644
index 0000000000..1933706bca
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-material/.bower.json
@@ -0,0 +1,45 @@
+{
+ "name": "paper-material",
+ "version": "1.0.0",
+ "description": "A material design container that looks like a lifted sheet of paper",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "paper",
+ "container"
+ ],
+ "main": [
+ "paper-material.html"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-material"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-material",
+ "ignore": [],
+ "dependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.0",
+ "commit": "bd769d2b8c4f9ab000aee22582d76b5935793dc1"
+ },
+ "_source": "git://github.com/polymerelements/paper-material.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/paper-material"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-material/.gitignore b/dashboard-ui/bower_components/paper-material/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-material/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-material/bower.json b/dashboard-ui/bower_components/paper-material/bower.json
new file mode 100644
index 0000000000..e6f78bc3be
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-material/bower.json
@@ -0,0 +1,36 @@
+{
+ "name": "paper-material",
+ "version": "1.0.0",
+ "description": "A material design container that looks like a lifted sheet of paper",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "web-component",
+ "polymer",
+ "paper",
+ "container"
+ ],
+ "main": [
+ "paper-material.html"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-material"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-material",
+ "ignore": [],
+ "dependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-material/demo/index.html b/dashboard-ui/bower_components/paper-material/demo/index.html
new file mode 100644
index 0000000000..864f696391
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-material/demo/index.html
@@ -0,0 +1,113 @@
+
+
+
+
+ paper-material demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Paper Elevations
+
+
+ elevation = 0
+
+
+
+ elevation = 1
+
+
+
+ elevation = 2
+
+
+
+ elevation = 3
+
+
+
+ elevation = 4
+
+
+
+ elevation = 5
+
+
+
+
+ Animated
+
+
+ tap
+
+
+
+ tap
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-material/index.html b/dashboard-ui/bower_components/paper-material/index.html
new file mode 100644
index 0000000000..7209e6d095
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-material/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ paper-material
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-material/paper-material.html b/dashboard-ui/bower_components/paper-material/paper-material.html
new file mode 100644
index 0000000000..60f87ba511
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-material/paper-material.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-material/test/index.html b/dashboard-ui/bower_components/paper-material/test/index.html
new file mode 100644
index 0000000000..492a5677f4
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-material/test/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ paper-material tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-material/test/paper-material.html b/dashboard-ui/bower_components/paper-material/test/paper-material.html
new file mode 100644
index 0000000000..0a593fb581
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-material/test/paper-material.html
@@ -0,0 +1,92 @@
+
+
+
+
+
+ paper-material basic tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-menu/.bower.json b/dashboard-ui/bower_components/paper-menu/.bower.json
new file mode 100644
index 0000000000..75f9604b52
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/.bower.json
@@ -0,0 +1,42 @@
+{
+ "name": "paper-menu",
+ "version": "1.0.0",
+ "description": "Implements an accessible material design menu",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "menu"
+ ],
+ "main": "paper-menu.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-menu"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-menu",
+ "ignore": [],
+ "dependencies": {
+ "iron-menu-behavior": "PolymerElements/iron-menu-behavior#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-item": "PolymerElements/paper-item#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.0",
+ "commit": "0642450ec9df0fc0b1d909842f436c3dea79ed1e"
+ },
+ "_source": "git://github.com/PolymerElements/paper-menu.git",
+ "_target": "~1.0.0",
+ "_originalSource": "PolymerElements/paper-menu",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-menu/.gitignore b/dashboard-ui/bower_components/paper-menu/.gitignore
new file mode 100644
index 0000000000..fbe05fc93b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/.gitignore
@@ -0,0 +1 @@
+bower_components/
diff --git a/dashboard-ui/bower_components/paper-menu/bower.json b/dashboard-ui/bower_components/paper-menu/bower.json
new file mode 100644
index 0000000000..dd2a5cde00
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/bower.json
@@ -0,0 +1,32 @@
+{
+ "name": "paper-menu",
+ "version": "1.0.0",
+ "description": "Implements an accessible material design menu",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "menu"
+ ],
+ "main": "paper-menu.html",
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-menu"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-menu",
+ "ignore": [],
+ "dependencies": {
+ "iron-menu-behavior": "PolymerElements/iron-menu-behavior#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-item": "PolymerElements/paper-item#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-menu/demo/index.html b/dashboard-ui/bower_components/paper-menu/demo/index.html
new file mode 100644
index 0000000000..9734cac337
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/demo/index.html
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+ paper-menu demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Standard
+
+
+ Inbox
+ Starred
+ Sent mail
+ Drafts
+
+
+
+
+
+
Pre-selected
+
+
+ Inbox
+ Starred
+ Sent mail
+ Drafts
+
+
+
+
+
+
Multi-select
+
+
+ Bold
+ Italic
+ Underline
+ Strikethrough
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-menu/hero.svg b/dashboard-ui/bower_components/paper-menu/hero.svg
new file mode 100644
index 0000000000..91af1f60ea
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/hero.svg
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-menu/index.html b/dashboard-ui/bower_components/paper-menu/index.html
new file mode 100644
index 0000000000..fc8841148b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ paper-menu
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-menu/paper-menu.html b/dashboard-ui/bower_components/paper-menu/paper-menu.html
new file mode 100644
index 0000000000..45ecd722c5
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/paper-menu.html
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-menu/test/index.html b/dashboard-ui/bower_components/paper-menu/test/index.html
new file mode 100644
index 0000000000..e6b26d5498
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/test/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ paper-menu tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-menu/test/paper-menu.html b/dashboard-ui/bower_components/paper-menu/test/paper-menu.html
new file mode 100644
index 0000000000..5856775710
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-menu/test/paper-menu.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+ paper-menu tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ item 1
+ item 2
+ item 3
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-progress/.bower.json b/dashboard-ui/bower_components/paper-progress/.bower.json
new file mode 100644
index 0000000000..100fe00c40
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/.bower.json
@@ -0,0 +1,41 @@
+{
+ "name": "paper-progress",
+ "version": "1.0.0",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "A material design progress bar",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "progress"
+ ],
+ "main": [
+ "paper-progress.html"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-progress.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-range-behavior": "PolymerElements/iron-range-behavior#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "paper-button": "PolymerElements/paper-button#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/paper-progress",
+ "_release": "1.0.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.0",
+ "commit": "1bef80a0d4110654b85746e70c006796ce8cdc2c"
+ },
+ "_source": "git://github.com/PolymerElements/paper-progress.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/paper-progress"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-progress/.gitignore b/dashboard-ui/bower_components/paper-progress/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-progress/bower.json b/dashboard-ui/bower_components/paper-progress/bower.json
new file mode 100644
index 0000000000..8c17acbbf0
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/bower.json
@@ -0,0 +1,31 @@
+{
+ "name": "paper-progress",
+ "version": "1.0.0",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "A material design progress bar",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "progress"
+ ],
+ "main": [
+ "paper-progress.html"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-progress.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-range-behavior": "PolymerElements/iron-range-behavior#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "paper-button": "PolymerElements/paper-button#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-progress/demo/index.html b/dashboard-ui/bower_components/paper-progress/demo/index.html
new file mode 100644
index 0000000000..97f8c1b40c
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/demo/index.html
@@ -0,0 +1,122 @@
+
+
+
+
+ paper-progress demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Progress bar
+
+
+
Indeterminate
+
+
+
Color
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-progress/hero.svg b/dashboard-ui/bower_components/paper-progress/hero.svg
new file mode 100644
index 0000000000..dc422a4912
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/hero.svg
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-progress/index.html b/dashboard-ui/bower_components/paper-progress/index.html
new file mode 100644
index 0000000000..225e3dd93d
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+ paper-progress
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-progress/paper-progress.html b/dashboard-ui/bower_components/paper-progress/paper-progress.html
new file mode 100644
index 0000000000..949e1bc510
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/paper-progress.html
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-progress/test/basic.html b/dashboard-ui/bower_components/paper-progress/test/basic.html
new file mode 100644
index 0000000000..dddb6efff6
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/test/basic.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+ paper-progress test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-progress/test/index.html b/dashboard-ui/bower_components/paper-progress/test/index.html
new file mode 100644
index 0000000000..f07aca92de
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-progress/test/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ Tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-ripple/.bower.json b/dashboard-ui/bower_components/paper-ripple/.bower.json
new file mode 100644
index 0000000000..0cbf50c9ff
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/.bower.json
@@ -0,0 +1,39 @@
+{
+ "name": "paper-ripple",
+ "version": "1.0.1",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Adds a material design ripple to any container",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "ripple"
+ ],
+ "main": "paper-ripple.html",
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/polymerelements/paper-ripple",
+ "_release": "1.0.1",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.1",
+ "commit": "af19d904802437c305390bb03415c11661de3d0a"
+ },
+ "_source": "git://github.com/polymerelements/paper-ripple.git",
+ "_target": "^1.0.0",
+ "_originalSource": "polymerelements/paper-ripple"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-ripple/.gitignore b/dashboard-ui/bower_components/paper-ripple/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-ripple/bower.json b/dashboard-ui/bower_components/paper-ripple/bower.json
new file mode 100644
index 0000000000..b9bb0d9f23
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/bower.json
@@ -0,0 +1,29 @@
+{
+ "name": "paper-ripple",
+ "version": "1.0.1",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Adds a material design ripple to any container",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "ripple"
+ ],
+ "main": "paper-ripple.html",
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-icons": "polymerelements/iron-icons#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-ripple/demo/index.html b/dashboard-ui/bower_components/paper-ripple/demo/index.html
new file mode 100644
index 0000000000..365eb3e5b9
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/demo/index.html
@@ -0,0 +1,413 @@
+
+
+
+
+ paper-ripple demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Permission
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-ripple/hero.svg b/dashboard-ui/bower_components/paper-ripple/hero.svg
new file mode 100644
index 0000000000..f8a872f1e6
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/hero.svg
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-ripple/index.html b/dashboard-ui/bower_components/paper-ripple/index.html
new file mode 100644
index 0000000000..3c371fa31a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/index.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ paper-ripple
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-ripple/paper-ripple.html b/dashboard-ui/bower_components/paper-ripple/paper-ripple.html
new file mode 100644
index 0000000000..08d3da1ac0
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/paper-ripple.html
@@ -0,0 +1,716 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-ripple/test/index.html b/dashboard-ui/bower_components/paper-ripple/test/index.html
new file mode 100644
index 0000000000..48197c08a5
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/test/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ Tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-ripple/test/paper-ripple.html b/dashboard-ui/bower_components/paper-ripple/test/paper-ripple.html
new file mode 100644
index 0000000000..81232069ac
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-ripple/test/paper-ripple.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+ paper-ripple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-slider/.bower.json b/dashboard-ui/bower_components/paper-slider/.bower.json
new file mode 100644
index 0000000000..85a0eee31f
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/.bower.json
@@ -0,0 +1,50 @@
+{
+ "name": "paper-slider",
+ "version": "1.0.3",
+ "description": "A material design-style slider",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "slider",
+ "control"
+ ],
+ "main": [
+ "paper-slider.html"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-slider.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "paper-input": "PolymerElements/paper-input#^1.0.0",
+ "paper-progress": "PolymerElements/paper-progress#^1.0.0",
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
+ "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0",
+ "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/paper-slider",
+ "_release": "1.0.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.3",
+ "commit": "d2b1542b6f02595fa124359945a4cc00cb0fca44"
+ },
+ "_source": "git://github.com/PolymerElements/paper-slider.git",
+ "_target": "~1.0.3",
+ "_originalSource": "PolymerElements/paper-slider",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-slider/.gitignore b/dashboard-ui/bower_components/paper-slider/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-slider/bower.json b/dashboard-ui/bower_components/paper-slider/bower.json
new file mode 100644
index 0000000000..ac199154ec
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/bower.json
@@ -0,0 +1,39 @@
+{
+ "name": "paper-slider",
+ "version": "1.0.3",
+ "description": "A material design-style slider",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "authors": "The Polymer Authors",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "slider",
+ "control"
+ ],
+ "main": [
+ "paper-slider.html"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-slider.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.0.0",
+ "paper-input": "PolymerElements/paper-input#^1.0.0",
+ "paper-progress": "PolymerElements/paper-progress#^1.0.0",
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
+ "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0",
+ "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-slider/demo/index.html b/dashboard-ui/bower_components/paper-slider/demo/index.html
new file mode 100644
index 0000000000..ccc06f279b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/demo/index.html
@@ -0,0 +1,117 @@
+
+
+
+
+ paper-slider demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Default
+
+
Oxygen
+
+
Argon
+
+
Hydrogen
+
+
Nitrogen
+
+
Sprinkles
+
+
+
+
Editable
+
+
+
Labelled pins
+
+
Brightness
+
+
Ratings:
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-slider/hero.svg b/dashboard-ui/bower_components/paper-slider/hero.svg
new file mode 100644
index 0000000000..8a518e1ee0
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/hero.svg
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-slider/index.html b/dashboard-ui/bower_components/paper-slider/index.html
new file mode 100644
index 0000000000..6add0749d3
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/index.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+ paper-slider
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-slider/paper-slider.css b/dashboard-ui/bower_components/paper-slider/paper-slider.css
new file mode 100644
index 0000000000..af769f4aee
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/paper-slider.css
@@ -0,0 +1,257 @@
+/**
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+*/
+
+:host {
+ display: inline-block;
+ width: 200px;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+:host(:not([disabled])) #sliderBar::shadow #activeProgress {
+ background-color: var(--paper-slider-active-color, --google-blue-700);
+}
+
+:host(:not([disabled])) #sliderBar::shadow #secondaryProgress {
+ background-color: var(--paper-slider-secondary-color, --google-blue-300);
+}
+
+:host([disabled]) #sliderBar::shadow #activeProgress {
+ background-color: var(--paper-slider-disabled-active-color, --google-grey-500);
+}
+
+:host([disabled]) #sliderBar::shadow #secondaryProgress {
+ background-color: var(--paper-slider-disabled-secondary-color, --google-grey-300);
+}
+
+:host(:focus) {
+ outline: none;
+}
+
+#sliderContainer {
+ position: relative;
+ width: calc(100% - 32px);
+ height: 32px;
+}
+
+#sliderContainer.editable {
+ float: left;
+ width: calc(100% - 72px);
+ margin: 12px 0;
+}
+
+.bar-container {
+ position: absolute;
+ top: 0;
+ left: 16px;
+ height: 100%;
+ width: 100%;
+ overflow: hidden;
+}
+
+.ring > .bar-container {
+ left: 20px;
+ width: calc(100% - 4px);
+ transition: left 0.18s ease, width 0.18s ease;
+}
+
+.ring.expand:not(.pin) > .bar-container {
+ left: 30px;
+ width: calc(100% - 14px);
+}
+
+.ring.expand.dragging > .bar-container {
+ transition: none;
+}
+
+#sliderBar {
+ position: absolute;
+ top: 15px;
+ left: 0;
+ height: 2px;
+ width: 100%;
+ padding: 8px 0;
+ margin: -8px 0;
+ background-color: var(--paper-slider-bar-color, transparent);
+}
+
+.ring #sliderBar {
+ left: -4px;
+ width: calc(100% + 4px);
+}
+
+.ring.expand:not(.pin) #sliderBar {
+ left: -14px;
+ width: calc(100% + 14px);
+}
+
+.slider-markers {
+ position: absolute;
+ top: 15px;
+ left: 15px;
+ height: 2px;
+ width: calc(100% + 2px);
+ box-sizing: border-box;
+ pointer-events: none;
+}
+
+.slider-markers::after,
+.slider-marker::after {
+ content: "";
+ display: block;
+ width: 2px;
+ height: 2px;
+ border-radius: 50%;
+ background-color: black;
+}
+
+.transiting #sliderBar::shadow #activeProgress {
+ -webkit-transition: -webkit-transform 0.08s ease;
+ transition: transform 0.08s ease;
+}
+
+#sliderKnob {
+ @apply(--layout-center-justified);
+ @apply(--layout-center);
+ @apply(--layout-horizontal);
+
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 32px;
+ height: 32px;
+}
+
+.transiting > #sliderKnob {
+ transition: left 0.08s ease;
+}
+
+#sliderKnob:focus {
+ outline: none;
+}
+
+#sliderKnob.dragging {
+ transition: none;
+}
+
+.snaps > #sliderKnob.dragging {
+ transition: -webkit-transform 0.08s ease;
+ transition: transform 0.08s ease;
+}
+
+#sliderKnobInner {
+ width: 12px;
+ height: 12px;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ border-radius: 50%;
+ background-color: var(--paper-slider-knob-color, --google-blue-700);
+ transition-property: height, width, background-color, border;
+ transition-duration: 0.1s;
+ transition-timing-function: ease;
+}
+
+.expand:not(.pin) > #sliderKnob > #sliderKnobInner {
+ width: 100%;
+ height: 100%;
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0);
+}
+
+.ring > #sliderKnob > #sliderKnobInner {
+ background-color: transparent;
+ border: 2px solid #c8c8c8;
+}
+
+#sliderKnobInner::before {
+ background-color: var(--paper-slider-pin-color, --google-blue-700);
+}
+
+.pin > #sliderKnob > #sliderKnobInner::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 26px;
+ height: 26px;
+ margin-left: 3px;
+ border-radius: 50% 50% 50% 0;
+ -webkit-transform: rotate(-45deg) scale(0) translate(0);
+ transform: rotate(-45deg) scale(0) translate(0);
+}
+
+#sliderKnobInner::before,
+#sliderKnobInner::after {
+ transition: -webkit-transform .2s ease, background-color .18s ease;
+ transition: transform .2s ease, background-color .18s ease;
+}
+
+.pin.ring > #sliderKnob > #sliderKnobInner::before {
+ background-color: #c8c8c8;
+}
+
+.pin.expand > #sliderKnob > #sliderKnobInner::before {
+ -webkit-transform: rotate(-45deg) scale(1) translate(17px, -17px);
+ transform: rotate(-45deg) scale(1) translate(17px, -17px);
+}
+
+.pin > #sliderKnob > #sliderKnobInner::after {
+ content: attr(value);
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 32px;
+ height: 26px;
+ text-align: center;
+ color: var(--paper-slider-font-color, #fff);
+ font-size: 10px;
+ -webkit-transform: scale(0) translate(0);
+ transform: scale(0) translate(0);
+}
+
+.pin.expand > #sliderKnob > #sliderKnobInner::after {
+ -webkit-transform: scale(1) translate(0, -17px);
+ transform: scale(1) translate(0, -17px);
+}
+
+/* editable: paper-input */
+.slider-input {
+ width: 40px;
+ float: right;
+ overflow: hidden;
+}
+
+.slider-input::shadow input {
+ /* FIXME(ffu): should one be able set text-align directly on paper-input? */
+ text-align: center;
+}
+
+/* disabled state */
+#sliderContainer.disabled {
+ pointer-events: none;
+}
+
+.disabled > #sliderKnob > #sliderKnobInner {
+ width: 8px;
+ height: 8px;
+ background-color: var(--paper-slider-disabled-knob-color, --google-grey-500);
+}
+
+.disabled.ring > #sliderKnob > #sliderKnobInner {
+ background-color: transparent;
+}
+
+paper-ripple {
+ color: var(--paper-slider-knob-color, --google-blue-700);
+}
diff --git a/dashboard-ui/bower_components/paper-slider/paper-slider.html b/dashboard-ui/bower_components/paper-slider/paper-slider.html
new file mode 100644
index 0000000000..9d255627ba
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/paper-slider.html
@@ -0,0 +1,490 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-slider/test/basic.html b/dashboard-ui/bower_components/paper-slider/test/basic.html
new file mode 100644
index 0000000000..bf421e91a6
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/test/basic.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+ paper-slider test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-slider/test/index.html b/dashboard-ui/bower_components/paper-slider/test/index.html
new file mode 100644
index 0000000000..155baeabed
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-slider/test/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ Tests
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-spinner/.bower.json b/dashboard-ui/bower_components/paper-spinner/.bower.json
new file mode 100644
index 0000000000..33491d5962
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/.bower.json
@@ -0,0 +1,43 @@
+{
+ "name": "paper-spinner",
+ "version": "1.0.1",
+ "description": "A material design spinner",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "spinner",
+ "loading"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-spinner"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-spinner",
+ "ignore": [],
+ "dependencies": {
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "web-component-tester": "*",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.1",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.1",
+ "commit": "5e2b7412922259c9eed1805d69abb18e433efaad"
+ },
+ "_source": "git://github.com/PolymerElements/paper-spinner.git",
+ "_target": "~1.0.1",
+ "_originalSource": "PolymerElements/paper-spinner",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-spinner/.gitignore b/dashboard-ui/bower_components/paper-spinner/.gitignore
new file mode 100644
index 0000000000..fbe05fc93b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/.gitignore
@@ -0,0 +1 @@
+bower_components/
diff --git a/dashboard-ui/bower_components/paper-spinner/bower.json b/dashboard-ui/bower_components/paper-spinner/bower.json
new file mode 100644
index 0000000000..d27e049ff2
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/bower.json
@@ -0,0 +1,33 @@
+{
+ "name": "paper-spinner",
+ "version": "1.0.1",
+ "description": "A material design spinner",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "spinner",
+ "loading"
+ ],
+ "private": true,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-spinner"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/paper-spinner",
+ "ignore": [],
+ "dependencies": {
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "web-component-tester": "*",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-spinner/demo/index.html b/dashboard-ui/bower_components/paper-spinner/demo/index.html
new file mode 100644
index 0000000000..15f6385efe
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/demo/index.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+ paper-spinner demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-spinner/hero.svg b/dashboard-ui/bower_components/paper-spinner/hero.svg
new file mode 100644
index 0000000000..034b1f11ad
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/hero.svg
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-spinner/index.html b/dashboard-ui/bower_components/paper-spinner/index.html
new file mode 100644
index 0000000000..9874334610
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ paper-spinner
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-spinner/paper-spinner.css b/dashboard-ui/bower_components/paper-spinner/paper-spinner.css
new file mode 100644
index 0000000000..30c4e7ec69
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/paper-spinner.css
@@ -0,0 +1,325 @@
+/**
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+
+*/
+/**************************/
+/* STYLES FOR THE SPINNER */
+/**************************/
+
+/*
+ * Constants:
+ * STROKEWIDTH = 3px
+ * ARCSIZE = 270 degrees (amount of circle the arc takes up)
+ * ARCTIME = 1333ms (time it takes to expand and contract arc)
+ * ARCSTARTROT = 216 degrees (how much the start location of the arc
+ * should rotate each time, 216 gives us a
+ * 5 pointed star shape (it's 360/5 * 3).
+ * For a 7 pointed star, we might do
+ * 360/7 * 3 = 154.286)
+ * CONTAINERWIDTH = 28px
+ * SHRINK_TIME = 400ms
+ */
+
+ :host {
+ display: inline-block;
+ position: relative;
+ width: 28px; /* CONTAINERWIDTH */
+ height: 28px; /* CONTAINERWIDTH */
+}
+
+#spinnerContainer {
+ width: 100%;
+ height: 100%;
+}
+
+#spinnerContainer.active {
+ /* duration: 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */
+ -webkit-animation: container-rotate 1568ms linear infinite;
+ animation: container-rotate 1568ms linear infinite;
+}
+
+@-webkit-keyframes container-rotate {
+ to { -webkit-transform: rotate(360deg) }
+}
+
+@keyframes container-rotate {
+ to { transform: rotate(360deg) }
+}
+
+.spinner-layer {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+}
+
+.layer-1 {
+ border-color: var(--paper-spinner-layer-1-color, --google-blue-500);
+}
+
+.layer-2 {
+ border-color: var(--paper-spinner-layer-2-color, --google-red-500);
+}
+
+.layer-3 {
+ border-color: var(--paper-spinner-layer-3-color, --google-yellow-500);
+}
+
+.layer-4 {
+ border-color: var(--paper-spinner-layer-4-color, --google-blue-500);
+}
+
+/**
+ * IMPORTANT NOTE ABOUT CSS ANIMATION PROPERTIES (keanulee):
+ *
+ * iOS Safari (tested on iOS 8.1) does not handle animation-delay very well - it doesn't
+ * guarantee that the animation will start _exactly_ after that value. So we avoid using
+ * animation-delay and instead set custom keyframes for each color (as layer-2undant as it
+ * seems).
+ *
+ * We write out each animation in full (instead of separating animation-name,
+ * animation-duration, etc.) because under the polyfill, Safari does not recognize those
+ * specific properties properly, treats them as -webkit-animation, and overrides the
+ * other animation rules. See https://github.com/Polymer/platform/issues/53.
+ */
+.active .spinner-layer.layer-1 {
+ /* durations: 4 * ARCTIME */
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-1-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-1-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+}
+
+.active .spinner-layer.layer-2 {
+ /* durations: 4 * ARCTIME */
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-2-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-2-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+}
+
+.active .spinner-layer.layer-3 {
+ /* durations: 4 * ARCTIME */
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-3-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-3-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+}
+
+.active .spinner-layer.layer-4 {
+ /* durations: 4 * ARCTIME */
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-4-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-4-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+}
+
+@-webkit-keyframes fill-unfill-rotate {
+ 12.5% { -webkit-transform: rotate(135deg); } /* 0.5 * ARCSIZE */
+ 25% { -webkit-transform: rotate(270deg); } /* 1 * ARCSIZE */
+ 37.5% { -webkit-transform: rotate(405deg); } /* 1.5 * ARCSIZE */
+ 50% { -webkit-transform: rotate(540deg); } /* 2 * ARCSIZE */
+ 62.5% { -webkit-transform: rotate(675deg); } /* 2.5 * ARCSIZE */
+ 75% { -webkit-transform: rotate(810deg); } /* 3 * ARCSIZE */
+ 87.5% { -webkit-transform: rotate(945deg); } /* 3.5 * ARCSIZE */
+ to { -webkit-transform: rotate(1080deg); } /* 4 * ARCSIZE */
+}
+
+@keyframes fill-unfill-rotate {
+ 12.5% { transform: rotate(135deg); } /* 0.5 * ARCSIZE */
+ 25% { transform: rotate(270deg); } /* 1 * ARCSIZE */
+ 37.5% { transform: rotate(405deg); } /* 1.5 * ARCSIZE */
+ 50% { transform: rotate(540deg); } /* 2 * ARCSIZE */
+ 62.5% { transform: rotate(675deg); } /* 2.5 * ARCSIZE */
+ 75% { transform: rotate(810deg); } /* 3 * ARCSIZE */
+ 87.5% { transform: rotate(945deg); } /* 3.5 * ARCSIZE */
+ to { transform: rotate(1080deg); } /* 4 * ARCSIZE */
+}
+
+/**
+ * HACK: Even though the intention is to have the current .spinner-layer at
+ * `opacity: 1`, we set it to `opacity: 0.99` instead since this forces Chrome
+ * to do proper subpixel rendering for the elements being animated. This is
+ * especially visible in Chrome 39 on Ubuntu 14.04. See:
+ *
+ * - https://github.com/Polymer/paper-spinner/issues/9
+ * - https://code.google.com/p/chromium/issues/detail?id=436255
+ */
+@-webkit-keyframes layer-1-fade-in-out {
+ from { opacity: 0.99; }
+ 25% { opacity: 0.99; }
+ 26% { opacity: 0; }
+ 89% { opacity: 0; }
+ 90% { opacity: 0.99; }
+ 100% { opacity: 0.99; }
+}
+
+@keyframes layer-1-fade-in-out {
+ from { opacity: 0.99; }
+ 25% { opacity: 0.99; }
+ 26% { opacity: 0; }
+ 89% { opacity: 0; }
+ 90% { opacity: 0.99; }
+ 100% { opacity: 0.99; }
+}
+
+@-webkit-keyframes layer-2-fade-in-out {
+ from { opacity: 0; }
+ 15% { opacity: 0; }
+ 25% { opacity: 0.99; }
+ 50% { opacity: 0.99; }
+ 51% { opacity: 0; }
+}
+
+@keyframes layer-2-fade-in-out {
+ from { opacity: 0; }
+ 15% { opacity: 0; }
+ 25% { opacity: 0.99; }
+ 50% { opacity: 0.99; }
+ 51% { opacity: 0; }
+}
+
+@-webkit-keyframes layer-3-fade-in-out {
+ from { opacity: 0; }
+ 40% { opacity: 0; }
+ 50% { opacity: 0.99; }
+ 75% { opacity: 0.99; }
+ 76% { opacity: 0; }
+}
+
+@keyframes layer-3-fade-in-out {
+ from { opacity: 0; }
+ 40% { opacity: 0; }
+ 50% { opacity: 0.99; }
+ 75% { opacity: 0.99; }
+ 76% { opacity: 0; }
+}
+
+@-webkit-keyframes layer-4-fade-in-out {
+ from { opacity: 0; }
+ 65% { opacity: 0; }
+ 75% { opacity: 0.99; }
+ 90% { opacity: 0.99; }
+ 100% { opacity: 0; }
+}
+
+@keyframes layer-4-fade-in-out {
+ from { opacity: 0; }
+ 65% { opacity: 0; }
+ 75% { opacity: 0.99; }
+ 90% { opacity: 0.99; }
+ 100% { opacity: 0; }
+}
+
+/**
+ * Patch the gap that appear between the two adjacent div.circle-clipper while the
+ * spinner is rotating (appears on Chrome 38, Safari 7.1, and IE 11).
+ *
+ * Update: the gap no longer appears on Chrome when .spinner-layer's opacity is 0.99,
+ * but still does on Safari and IE.
+ */
+.gap-patch {
+ position: absolute;
+ box-sizing: border-box;
+ top: 0;
+ left: 45%;
+ width: 10%;
+ height: 100%;
+ overflow: hidden;
+ border-color: inherit;
+}
+
+.gap-patch .circle {
+ width: 1000%;
+ left: -450%;
+}
+
+.circle-clipper {
+ display: inline-block;
+ position: relative;
+ width: 50%;
+ height: 100%;
+ overflow: hidden;
+ border-color: inherit;
+}
+
+.circle-clipper .circle {
+ width: 200%;
+}
+
+.circle {
+ box-sizing: border-box;
+ height: 100%;
+ border-width: 3px; /* STROKEWIDTH */
+ border-style: solid;
+ border-color: inherit;
+ border-bottom-color: transparent !important;
+ border-radius: 50%;
+ -webkit-animation: none;
+ animation: none;
+
+ @apply(--layout-fit);
+}
+
+.circle-clipper.left .circle {
+ border-right-color: transparent !important;
+ -webkit-transform: rotate(129deg);
+ transform: rotate(129deg);
+}
+
+.circle-clipper.right .circle {
+ left: -100%;
+ border-left-color: transparent !important;
+ -webkit-transform: rotate(-129deg);
+ transform: rotate(-129deg);
+}
+
+.active .circle-clipper.left .circle {
+ /* duration: ARCTIME */
+ -webkit-animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+ animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+}
+
+.active .circle-clipper.right .circle {
+ /* duration: ARCTIME */
+ -webkit-animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+ animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
+}
+
+@-webkit-keyframes left-spin {
+ from { -webkit-transform: rotate(130deg); }
+ 50% { -webkit-transform: rotate(-5deg); }
+ to { -webkit-transform: rotate(130deg); }
+}
+
+@keyframes left-spin {
+ from { transform: rotate(130deg); }
+ 50% { transform: rotate(-5deg); }
+ to { transform: rotate(130deg); }
+}
+
+@-webkit-keyframes right-spin {
+ from { -webkit-transform: rotate(-130deg); }
+ 50% { -webkit-transform: rotate(5deg); }
+ to { -webkit-transform: rotate(-130deg); }
+}
+
+@keyframes right-spin {
+ from { transform: rotate(-130deg); }
+ 50% { transform: rotate(5deg); }
+ to { transform: rotate(-130deg); }
+}
+
+#spinnerContainer.cooldown {
+ /* duration: SHRINK_TIME */
+ -webkit-animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
+ animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
+}
+
+@-webkit-keyframes fade-out {
+ from { opacity: 0.99; }
+ to { opacity: 0; }
+}
+
+@keyframes fade-out {
+ from { opacity: 0.99; }
+ to { opacity: 0; }
+}
diff --git a/dashboard-ui/bower_components/paper-spinner/paper-spinner.html b/dashboard-ui/bower_components/paper-spinner/paper-spinner.html
new file mode 100644
index 0000000000..b5503cc6ac
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/paper-spinner.html
@@ -0,0 +1,222 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-spinner/test/index.html b/dashboard-ui/bower_components/paper-spinner/test/index.html
new file mode 100644
index 0000000000..469b3eeac4
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/test/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ paper-spinner tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-spinner/test/paper-spinner.html b/dashboard-ui/bower_components/paper-spinner/test/paper-spinner.html
new file mode 100644
index 0000000000..f270c33b78
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-spinner/test/paper-spinner.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ paper-spinner basic tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/.bower.json b/dashboard-ui/bower_components/paper-styles/.bower.json
new file mode 100644
index 0000000000..32205aaa01
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/.bower.json
@@ -0,0 +1,40 @@
+{
+ "name": "paper-styles",
+ "version": "1.0.7",
+ "description": "Common (global) styles for Material Design elements.",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-component",
+ "polymer",
+ "style"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-styles.git"
+ },
+ "main": "paper-styles.html",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/polymerelements/paper-styles/",
+ "ignore": [
+ "/.*"
+ ],
+ "dependencies": {
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "font-roboto": "PolymerElements/font-roboto#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "_release": "1.0.7",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.7",
+ "commit": "c65f5ce6b898bb756fca35cedaa53c3e8011abeb"
+ },
+ "_source": "git://github.com/PolymerElements/paper-styles.git",
+ "_target": "^1.0.0",
+ "_originalSource": "PolymerElements/paper-styles"
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-styles/bower.json b/dashboard-ui/bower_components/paper-styles/bower.json
new file mode 100644
index 0000000000..576dc4ce45
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/bower.json
@@ -0,0 +1,31 @@
+{
+ "name": "paper-styles",
+ "version": "1.0.7",
+ "description": "Common (global) styles for Material Design elements.",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-component",
+ "polymer",
+ "style"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/paper-styles.git"
+ },
+ "main": "paper-styles.html",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/polymerelements/paper-styles/",
+ "ignore": [
+ "/.*"
+ ],
+ "dependencies": {
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
+ "font-roboto": "PolymerElements/font-roboto#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0"
+ },
+ "devDependencies": {
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-styles/classes/global.html b/dashboard-ui/bower_components/paper-styles/classes/global.html
new file mode 100644
index 0000000000..6f0d5ddee1
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/classes/global.html
@@ -0,0 +1,96 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/classes/shadow-layout.html b/dashboard-ui/bower_components/paper-styles/classes/shadow-layout.html
new file mode 100644
index 0000000000..c42067af5e
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/classes/shadow-layout.html
@@ -0,0 +1,302 @@
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/classes/shadow.html b/dashboard-ui/bower_components/paper-styles/classes/shadow.html
new file mode 100644
index 0000000000..4c40a147a5
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/classes/shadow.html
@@ -0,0 +1,52 @@
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/classes/typography.html b/dashboard-ui/bower_components/paper-styles/classes/typography.html
new file mode 100644
index 0000000000..5514abb9d7
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/classes/typography.html
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/color.html b/dashboard-ui/bower_components/paper-styles/color.html
new file mode 100644
index 0000000000..f0be341822
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/color.html
@@ -0,0 +1,333 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/default-theme.html b/dashboard-ui/bower_components/paper-styles/default-theme.html
new file mode 100644
index 0000000000..add581cdae
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/default-theme.html
@@ -0,0 +1,39 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/demo-pages.html b/dashboard-ui/bower_components/paper-styles/demo-pages.html
new file mode 100644
index 0000000000..44f2288727
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/demo-pages.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/demo.css b/dashboard-ui/bower_components/paper-styles/demo.css
new file mode 100644
index 0000000000..efd8b471b5
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/demo.css
@@ -0,0 +1,25 @@
+/**
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+
+*/
+body {
+ font-family: 'Roboto', 'Noto', sans-serif;
+ font-size: 14px;
+ margin: 0;
+ padding: 24px;
+}
+
+section {
+ padding: 20px 0;
+}
+
+section > div {
+ padding: 14px;
+ font-size: 16px;
+}
diff --git a/dashboard-ui/bower_components/paper-styles/demo/index.html b/dashboard-ui/bower_components/paper-styles/demo/index.html
new file mode 100644
index 0000000000..42f449f06b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/demo/index.html
@@ -0,0 +1,358 @@
+
+
+
+
+
+
+
+
+
+
+ paper-styles demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ paper-styles
+
+
+ default-theme.html
+
+
+
+ Title
+
+
+
+
+
Primary text
+
Secondary text
+
+
+ Disabled
+
+
+
+
+
+ typography.html
+
+ Grumpy wizards make toxic brew for the evil Queen and Jack.
+
+
+ Display 4
+ Display 3
+ Display 2
+ Display 1
+ Headline
+ Title
+ Subhead
+ Body 2
+ Body 1
+ Caption
+
+ Button
+
+
+ Paragraphs
+
+ body2
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
+ tincidunt dui sit amet mi auctor, ac gravida magna aliquam. Fusce quis
+ purus elementum, tempus nisi vel, volutpat nulla. Vestibulum mollis
+ dictum tellus, vulputate porttitor arcu. Curabitur imperdiet risus id
+ egestas accumsan. Donec lectus felis, dignissim id iaculis sit amet,
+ faucibus in leo.
+
+
+ Mauris id urna ac ante ultrices commodo a imperdiet elit. Vivamus
+ interdum neque magna, eget dapibus est auctor et. Donec accumsan
+ libero nec augue scelerisque, ac egestas ante tincidunt. Proin
+ sollicitudin, mi eget sagittis mollis, arcu orci scelerisque turpis, a
+ sollicitudin tellus quam non sapien.
+
+
+
+ body1
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
+ tincidunt dui sit amet mi auctor, ac gravida magna aliquam. Fusce quis
+ purus elementum, tempus nisi vel, volutpat nulla. Vestibulum mollis
+ dictum tellus, vulputate porttitor arcu. Curabitur imperdiet risus id
+ egestas accumsan. Donec lectus felis, dignissim id iaculis sit amet,
+ faucibus in leo.
+
+
+ Mauris id urna ac ante ultrices commodo a imperdiet elit. Vivamus
+ interdum neque magna, eget dapibus est auctor et. Donec accumsan
+ libero nec augue scelerisque, ac egestas ante tincidunt. Proin
+ sollicitudin, mi eget sagittis mollis, arcu orci scelerisque turpis, a
+ sollicitudin tellus quam non sapien.
+
+
+
+
+
+ shadow.html
+ 2dp
+ 3dp
+ 4dp
+ 6dp
+ 8dp
+ 16dp
+
+
+
+
+
+
+
+
+
+
+ demo-pages.html
+
+ Horizontal sections
+
+
+
Column 1
+
+
Oxygen
+
Carbon
+
Hydrogen
+
Nitrogen
+
Calcium
+
+
+
+
+
Column 2
+
+
Oxygen
+
Carbon
+
Hydrogen
+
Nitrogen
+
Calcium
+
+
+
+
+
Column 3
+
+
Oxygen
+
Carbon
+
Hydrogen
+
Nitrogen
+
Calcium
+
+
+
+
+ Vertical sections
+
+
+
Section 1
+
+
Oxygen
+
Carbon
+
Hydrogen
+
Nitrogen
+
Calcium
+
+
+
+
+
+
Section 2 (centered)
+
+
Oxygen
+
Carbon
+
Hydrogen
+
Nitrogen
+
Calcium
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/paper-styles-classes.html b/dashboard-ui/bower_components/paper-styles/paper-styles-classes.html
new file mode 100644
index 0000000000..ae315a57f8
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/paper-styles-classes.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/paper-styles.html b/dashboard-ui/bower_components/paper-styles/paper-styles.html
new file mode 100644
index 0000000000..1e4fce59f7
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/paper-styles.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/shadow.html b/dashboard-ui/bower_components/paper-styles/shadow.html
new file mode 100644
index 0000000000..dfb7e8a061
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/shadow.html
@@ -0,0 +1,65 @@
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-styles/typography.html b/dashboard-ui/bower_components/paper-styles/typography.html
new file mode 100644
index 0000000000..15ae1156a0
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-styles/typography.html
@@ -0,0 +1,238 @@
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/.bower.json b/dashboard-ui/bower_components/paper-tabs/.bower.json
new file mode 100644
index 0000000000..73b89cdd6d
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/.bower.json
@@ -0,0 +1,48 @@
+{
+ "name": "paper-tabs",
+ "version": "1.0.0",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Material design tabs",
+ "private": true,
+ "main": "paper-tabs.html",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "tabs",
+ "control"
+ ],
+ "repository": "https://github.com/PolymerElements/paper-tabs.git",
+ "dependencies": {
+ "iron-behaviors": "polymerelements/iron-behaviors#^1.0.0",
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
+ "iron-menu-behavior": "polymerelements/iron-menu-behavior#^1.0.0",
+ "iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
+ "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0",
+ "paper-icon-button": "polymerelements/paper-icon-button#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-toolbar": "polymerelements/paper-toolbar#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "web-component-tester": "*"
+ },
+ "homepage": "https://github.com/PolymerElements/paper-tabs",
+ "_release": "1.0.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.0",
+ "commit": "af6820e55f73fc5aa8c8e4d5294085e46374c7ca"
+ },
+ "_source": "git://github.com/PolymerElements/paper-tabs.git",
+ "_target": "~1.0.0",
+ "_originalSource": "PolymerElements/paper-tabs",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-tabs/.gitignore b/dashboard-ui/bower_components/paper-tabs/.gitignore
new file mode 100644
index 0000000000..fbe05fc93b
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/.gitignore
@@ -0,0 +1 @@
+bower_components/
diff --git a/dashboard-ui/bower_components/paper-tabs/bower.json b/dashboard-ui/bower_components/paper-tabs/bower.json
new file mode 100644
index 0000000000..cff76e9661
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/bower.json
@@ -0,0 +1,37 @@
+{
+ "name": "paper-tabs",
+ "version": "1.0.0",
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "description": "Material design tabs",
+ "private": true,
+ "main": "paper-tabs.html",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "tabs",
+ "control"
+ ],
+ "repository": "https://github.com/PolymerElements/paper-tabs.git",
+ "dependencies": {
+ "iron-behaviors": "polymerelements/iron-behaviors#^1.0.0",
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "iron-icon": "polymerelements/iron-icon#^1.0.0",
+ "iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
+ "iron-menu-behavior": "polymerelements/iron-menu-behavior#^1.0.0",
+ "iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
+ "paper-ripple": "polymerelements/paper-ripple#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0",
+ "paper-icon-button": "polymerelements/paper-icon-button#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "paper-toolbar": "polymerelements/paper-toolbar#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "web-component-tester": "*"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-tabs/demo/index.html b/dashboard-ui/bower_components/paper-tabs/demo/index.html
new file mode 100644
index 0000000000..8ec80554bd
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/demo/index.html
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+ paper-tabs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A. No ink effect and no sliding bar
+
+
+
+ ITEM ONE
+ ITEM TWO
+ ITEM THREE
+
+
+
+ B. The bottom bar appears to indicate the selected tab, but without sliding effect.
+
+
+
+ ITEM ONE
+ ITEM TWO
+ ITEM THREE
+
+
+
+ C. The bar slides to the selected tab
+
+
+
+ ITEM ONE
+ ITEM TWO
+ ITEM THREE
+
+
+
+ D. Inky Tabs
+
+
+
+ ITEM ONE
+ ITEM TWO
+ ITEM THREE
+
+
+
+ E. Scrollable Tabs
+
+
+
+ NUMBER ONE ITEM
+ ITEM TWO
+ THE THIRD ITEM
+ THE ITEM FOUR
+ FIFTH
+ THE SIXTH TAB
+ NUMBER SEVEN
+ EIGHT
+ NUMBER NINE
+ THE TENTH
+ THE ITEM ELEVEN
+ TWELFTH ITEM
+
+
+
+ F. Link Tabs
+
+
+
+ ITEM ONE
+ ITEM TWO
+ ITEM THREE
+
+
+
+ G. Tabs in Toolbar
+
+
+
+
+
+ ITEM ONE
+ ITEM TWO
+
+
+
+
+
+
+
+ H. Tabs aligned to bottom
+
+
+
+ ITEM ONE
+ ITEM TWO
+ ITEM THREE
+
+
+
+ I. Bound Selection
+
+
+ Current Tab: [[selected]]
+
+
+ ITEM ONE
+ ITEM TWO
+ ITEM THREE
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/hero.svg b/dashboard-ui/bower_components/paper-tabs/hero.svg
new file mode 100644
index 0000000000..bfcbdac259
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/hero.svg
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/index.html b/dashboard-ui/bower_components/paper-tabs/index.html
new file mode 100644
index 0000000000..98ab07d95d
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+ paper-tabs
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/paper-tab.html b/dashboard-ui/bower_components/paper-tabs/paper-tab.html
new file mode 100644
index 0000000000..4737ec8623
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/paper-tab.html
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/paper-tabs-icons.html b/dashboard-ui/bower_components/paper-tabs/paper-tabs-icons.html
new file mode 100644
index 0000000000..c299046a63
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/paper-tabs-icons.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/paper-tabs.html b/dashboard-ui/bower_components/paper-tabs/paper-tabs.html
new file mode 100644
index 0000000000..ca648df818
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/paper-tabs.html
@@ -0,0 +1,483 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/test/attr-for-selected.html b/dashboard-ui/bower_components/paper-tabs/test/attr-for-selected.html
new file mode 100644
index 0000000000..2f5aa6dc36
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/test/attr-for-selected.html
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+ paper-tabs-attr-for-selected
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ITEM FOO
+ ITEM BAR
+ ITEM ZOT
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/test/basic.html b/dashboard-ui/bower_components/paper-tabs/test/basic.html
new file mode 100644
index 0000000000..aa74207e34
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/test/basic.html
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+ paper-tabs-basic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ITEM ONE
+ ITEM TWO
+ ITEM THREE
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-tabs/test/index.html b/dashboard-ui/bower_components/paper-tabs/test/index.html
new file mode 100644
index 0000000000..2a3282bb73
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-tabs/test/index.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ Tests
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-toast/.bower.json b/dashboard-ui/bower_components/paper-toast/.bower.json
new file mode 100644
index 0000000000..c1109b6ef9
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-toast/.bower.json
@@ -0,0 +1,39 @@
+{
+ "name": "paper-toast",
+ "version": "1.0.0",
+ "description": "A material design notification toast",
+ "private": true,
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "toast",
+ "notification"
+ ],
+ "main": "paper-toast.html",
+ "dependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-a11y-announcer": "polymerelements/iron-a11y-announcer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "paper-button": "polymerelements/paper-button#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ },
+ "homepage": "https://github.com/PolymerElements/paper-toast",
+ "_release": "1.0.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.0",
+ "commit": "71e6c327f7aafe9c71010c83d4c4571f63990072"
+ },
+ "_source": "git://github.com/PolymerElements/paper-toast.git",
+ "_target": "~1.0.0",
+ "_originalSource": "PolymerElements/paper-toast",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/paper-toast/.gitignore b/dashboard-ui/bower_components/paper-toast/.gitignore
new file mode 100644
index 0000000000..8d4ae2536a
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-toast/.gitignore
@@ -0,0 +1 @@
+bower_components
diff --git a/dashboard-ui/bower_components/paper-toast/bower.json b/dashboard-ui/bower_components/paper-toast/bower.json
new file mode 100644
index 0000000000..a4fd51abfe
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-toast/bower.json
@@ -0,0 +1,28 @@
+{
+ "name": "paper-toast",
+ "version": "1.0.0",
+ "description": "A material design notification toast",
+ "private": true,
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "toast",
+ "notification"
+ ],
+ "main": "paper-toast.html",
+ "dependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "polymer": "Polymer/polymer#^1.0.0",
+ "iron-a11y-announcer": "polymerelements/iron-a11y-announcer#^1.0.0"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "paper-button": "polymerelements/paper-button#^1.0.0",
+ "web-component-tester": "*",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ }
+}
diff --git a/dashboard-ui/bower_components/paper-toast/demo/index.html b/dashboard-ui/bower_components/paper-toast/demo/index.html
new file mode 100644
index 0000000000..fbd0f0ecbd
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-toast/demo/index.html
@@ -0,0 +1,56 @@
+
+
+
+
+ paper-toast
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Discard Draft
+
+ Get Messages
+
+
+
+
+ Retry
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-toast/hero.svg b/dashboard-ui/bower_components/paper-toast/hero.svg
new file mode 100644
index 0000000000..bfdc1808bd
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-toast/hero.svg
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-toast/index.html b/dashboard-ui/bower_components/paper-toast/index.html
new file mode 100644
index 0000000000..e871f17d98
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-toast/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/paper-toast/paper-toast.html b/dashboard-ui/bower_components/paper-toast/paper-toast.html
new file mode 100644
index 0000000000..5afdae368f
--- /dev/null
+++ b/dashboard-ui/bower_components/paper-toast/paper-toast.html
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+
+
+ {{text}}
+
+
+
+
diff --git a/dashboard-ui/bower_components/polymer/.bower.json b/dashboard-ui/bower_components/polymer/.bower.json
new file mode 100644
index 0000000000..d0373eea32
--- /dev/null
+++ b/dashboard-ui/bower_components/polymer/.bower.json
@@ -0,0 +1,36 @@
+{
+ "name": "polymer",
+ "version": "1.0.5",
+ "main": [
+ "polymer.html"
+ ],
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "ignore": [
+ "/.*",
+ "/test/"
+ ],
+ "authors": [
+ "The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Polymer/polymer.git"
+ },
+ "dependencies": {
+ "webcomponentsjs": "^0.7.2"
+ },
+ "devDependencies": {
+ "web-component-tester": "*"
+ },
+ "private": true,
+ "homepage": "https://github.com/Polymer/polymer",
+ "_release": "1.0.5",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.0.5",
+ "commit": "b93f076d7b2606733d7166f311b77550deb98a39"
+ },
+ "_source": "git://github.com/Polymer/polymer.git",
+ "_target": "^1.0.0",
+ "_originalSource": "Polymer/polymer"
+}
\ No newline at end of file
diff --git a/dashboard-ui/thirdparty/polymer/LICENSE.txt b/dashboard-ui/bower_components/polymer/LICENSE.txt
similarity index 100%
rename from dashboard-ui/thirdparty/polymer/LICENSE.txt
rename to dashboard-ui/bower_components/polymer/LICENSE.txt
diff --git a/dashboard-ui/thirdparty/polymer/bower.json b/dashboard-ui/bower_components/polymer/bower.json
similarity index 95%
rename from dashboard-ui/thirdparty/polymer/bower.json
rename to dashboard-ui/bower_components/polymer/bower.json
index 055cf8a8cb..a8799d3568 100644
--- a/dashboard-ui/thirdparty/polymer/bower.json
+++ b/dashboard-ui/bower_components/polymer/bower.json
@@ -1,6 +1,6 @@
{
"name": "polymer",
- "version": "1.0.0",
+ "version": "1.0.5",
"main": [
"polymer.html"
],
diff --git a/dashboard-ui/thirdparty/polymer/polymer-micro.html b/dashboard-ui/bower_components/polymer/polymer-micro.html
similarity index 63%
rename from dashboard-ui/thirdparty/polymer/polymer-micro.html
rename to dashboard-ui/bower_components/polymer/polymer-micro.html
index 999d2eb9bd..4bf423461b 100644
--- a/dashboard-ui/thirdparty/polymer/polymer-micro.html
+++ b/dashboard-ui/bower_components/polymer/polymer-micro.html
@@ -6,29 +6,32 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--->
diff --git a/dashboard-ui/thirdparty/polymer/polymer.html b/dashboard-ui/bower_components/polymer/polymer.html
similarity index 61%
rename from dashboard-ui/thirdparty/polymer/polymer.html
rename to dashboard-ui/bower_components/polymer/polymer.html
index e632532d88..a4ecb33d7b 100644
--- a/dashboard-ui/thirdparty/polymer/polymer.html
+++ b/dashboard-ui/bower_components/polymer/polymer.html
@@ -17,44 +17,46 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
-->
diff --git a/dashboard-ui/bower_components/swipebox/.bower.json b/dashboard-ui/bower_components/swipebox/.bower.json
new file mode 100644
index 0000000000..49613cab0f
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/.bower.json
@@ -0,0 +1,17 @@
+{
+ "name": "swipebox",
+ "version": "1.4.1",
+ "main": "src/js/jquery.swipebox.js",
+ "ignore": [],
+ "homepage": "https://github.com/brutaldesign/swipebox",
+ "_release": "1.4.1",
+ "_resolution": {
+ "type": "version",
+ "tag": "1.4.1",
+ "commit": "80c68575772aacfbcffe4203a9f0ad57d4db8a62"
+ },
+ "_source": "git://github.com/brutaldesign/swipebox.git",
+ "_target": "~1.4.1",
+ "_originalSource": "swipebox",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/swipebox/.gitattributes b/dashboard-ui/bower_components/swipebox/.gitattributes
new file mode 100644
index 0000000000..dfe0770424
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/.gitattributes
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
diff --git a/dashboard-ui/bower_components/swipebox/.gitignore b/dashboard-ui/bower_components/swipebox/.gitignore
new file mode 100644
index 0000000000..733be0a119
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/.gitignore
@@ -0,0 +1,20 @@
+# Ignore dist
+dist/
+stage/
+
+# Ignore demo scss
+demo/scss/
+
+# Ignore grunt stuff
+**/.sass-cache
+**/.grunt
+**/node_modules
+
+# Windows image file caches
+Thumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Mac crap
+.DS_Store
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/swipebox/bower.json b/dashboard-ui/bower_components/swipebox/bower.json
new file mode 100644
index 0000000000..8a5c3dea17
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/bower.json
@@ -0,0 +1,6 @@
+{
+ "name": "swipebox",
+ "version": "1.4.1",
+ "main": "src/js/jquery.swipebox.js",
+ "ignore": []
+}
diff --git a/dashboard-ui/bower_components/swipebox/demo/bagpakk.min.css b/dashboard-ui/bower_components/swipebox/demo/bagpakk.min.css
new file mode 100644
index 0000000000..fd6db6fb61
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/demo/bagpakk.min.css
@@ -0,0 +1 @@
+/*! Bagpakk v1.0.0b | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/bagpakk */*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.centered,.clear,.clearfix,.pagination ul.page-numbers,.small-width,.wrap,blockquote,hr{zoom:1}.centered:after,.centered:before,.clear:after,.clear:before,.clearfix:after,.clearfix:before,.pagination ul.page-numbers:after,.pagination ul.page-numbers:before,.small-width:after,.small-width:before,.wrap:after,.wrap:before,blockquote:after,blockquote:before,hr:after,hr:before{content:"";display:table}.centered:after,.clear:after,.clearfix:after,.pagination ul.page-numbers:after,.small-width:after,.wrap:after,blockquote:after,hr:after{clear:both}html{height:100%;max-height:100%;overflow-x:hidden!important}body{overflow-x:hidden!important;overflow-y:auto}article,aside,details,div,figcaption,figure,footer,header,hgroup,main,nav,section,summary{-ms-word-wrap:break-word;word-wrap:break-word}a>img{-webkit-backface-visibility:hidden;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-ms-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}a>img:hover{opacity:.8}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.text-justify{text-align:justify}.left{float:left}.right{float:right}.caption{opacity:.8}.centered,.small-width,blockquote{margin-left:auto!important;margin-right:auto!important;display:block;float:none!important}.no-margin{margin:0!important}.no-padding{padding:0!important}.no-border,.no-border img{border:none!important}.table{display:table}.table .table-cell{display:table-cell;vertical-align:middle}ul.inline-list li{display:inline;margin:0 1rem;list-style-type:none!important}.wrap{margin:0 auto;max-width:1140px;width:92%}.hero{font-size:1.1rem;padding:6rem 0}.container{padding:4.2358rem 0}.small-width{max-width:740px}.font-color-alt{color:#f2f2f2}.font-color-alt a,.font-color-alt h1,.font-color-alt h2,.font-color-alt h3,.font-color-alt h4,.font-color-alt h5,.font-color-alt h6{color:#fff}.box-emboss{background:rgba(0,0,0,.05);-webkit-box-shadow:rgba(255,255,255,.5)0 1px 0,inset rgba(0,0,0,.05)0 1px 0;-moz-box-shadow:rgba(255,255,255,.5)0 1px 0,inset rgba(0,0,0,.05)0 1px 0;box-shadow:rgba(255,255,255,.5)0 1px 0,inset rgba(0,0,0,.05)0 1px 0}.col-1,.col-10,.col-11,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9{width:100%;margin-bottom:3rem}.site-footer{padding:5rem 0;background:#393939;color:#767676}.site-footer h1,.site-footer h2,.site-footer h3,.site-footer h4,.site-footer h5,.site-footer h6{color:#767676}.site-footer a{color:#b6b6b6;text-decoration:none}.site-footer a:hover{color:#4bbd93}.gist{margin:1.618em 0}.gist a{border:none!important}table{border-collapse:collapse;border-spacing:0;font-size:1.618rem;line-height:2;margin:0 0 1.5em;width:100%}caption,td,th{font-weight:400;text-align:left}caption{font-size:1em;margin:.5em 0}th{font-weight:700;text-transform:uppercase}td{border-bottom:2px solid rgba(0,0,0,.05);padding:.5rem .5rem .5rem 0}.gist table{margin-bottom:0}.gist table td{border-bottom:none}html{font-size:62.5%}body{background:#fff;color:#666;font-size:1.8rem;line-height:1.7;font-family:Georgia,serif}a{color:#4bbd93}a:focus{outline:0}h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:#333}h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover{color:#4bbd93}i{-webkit-backface-visibility:hidden}h1,h2,h3,h4,h5{font-family:Helvetica,Arial,sans-serif}h1,h2,h3,h4,h5,h6{font-weight:700;text-rendering:optimizeLegibility;line-height:1.618;margin-top:0;margin-bottom:1rem}h1,h2,h3,h4{color:#333}h1,h2{font-size:3rem;line-height:1.1em}h3{font-size:2.8rem}h4{font-size:2.3rem}h5{font-size:2.5rem}h6{font-size:2rem}ol,p,ul{margin:0 0 1.618rem}.dropcap:first-letter{color:#333;font-size:6rem;margin-top:-1.618rem;margin-right:1.3rem;margin-bottom:0;float:left}hr{display:block;border:none;height:4px;background:rgba(0,0,0,.05);margin:4rem auto;width:100%}blockquote{font-size:1.1em;font-style:italic;max-width:740px;color:#333;font-family:Georgia,serif;margin:1em 0 1.618em -2.2em;padding:0 0 0 1em;border-left:rgba(0,0,0,.05).5em solid}blockquote p{margin:.8em 0;font-style:italic}blockquote .small,blockquote small{display:inline-block;margin:.8em 0 .8em 1.5em;font-size:.9em;color:#ccc}cite{font-size:.8em;font-weight:400;display:inline-block;width:100%;font-style:normal}cite:before{content:'\2014 \00A0'}.small,small{font-size:.9em}ol,ul{margin:0;padding:0;margin-bottom:1.5em;margin-left:1em}ul li{list-style-type:square}code,pre{font:.7em "andale mono","lucida console",monospace;line-height:1.618;color:#333}code{margin:0 .5em;background:#FFF;line-height:1em;display:inline;padding:.5em}pre{-ms-word-wrap:normal;word-wrap:normal;background:#FFF;padding:.5em 1em;overflow-x:auto;overflow-y:hidden;margin:1.618em 0 3em;border:1px solid rgba(0,0,0,.1)}pre span{color:green}address{margin-bottom:.875rem}address p{margin-bottom:0}abbr[title],acronym[title]{border-bottom:1px dotted;cursor:help}dt{font-weight:700;text-decoration:underline}dd{margin:0;padding:0 0 .5rem}.big{font-size:3em}.pagination{margin:2rem 0}.pagination ul.page-numbers{font-family:Helvetica,Arial,sans-serif;margin-left:0}.pagination ul.page-numbers li{list-style-type:none;display:inline-block}.pagination ul.page-numbers li .page-numbers{font-size:15px;line-height:27px;position:relative;color:#333!important;font-weight:700;float:left;cursor:pointer;display:inline-block;height:28px;width:28px;margin:10px 5px 10px 0;text-align:center;text-shadow:none;text-decoration:none!important;border:none;border:solid 1px rgba(0,0,0,.08)}.pagination ul.page-numbers li .page-numbers:hover{opacity:.7}.pagination ul.page-numbers li .page-numbers.current{color:#fff!important;background-color:#4bbd93!important;border:solid 1px #4bbd93;opacity:1}.pagination ul.page-numbers li .page-numbers.dots{opacity:1!important;background:0 0;border:none}.pagination ul.page-numbers li .page-numbers.next,.pagination ul.page-numbers li .page-numbers.prev{line-height:25px}@font-face{font-family:icomoon;src:url(fonts/icomoon.eot);src:url(fonts/icomoon.eot?#iefix) format("embedded-opentype"),url(fonts/icomoon.svg#icomoon) format("svg"),url(fonts/icomoon.woff) format("woff"),url(fonts/icomoon.ttf) format("truetype");font-weight:400;font-style:normal}[class*=" icon-"],[class^=icon-]{font-weight:400!important;font-style:normal!important;text-decoration:none!important;border:none!important;display:inline-block;width:auto;height:auto;vertical-align:middle;background-image:none!important;background-position:0 0;background-repeat:repeat;position:relative;margin-bottom:1rem}.icon-align-left,.icon-align-right{margin-bottom:5px}.icon-align-left{float:left;margin-right:10px}.icon-align-right{float:right;margin-left:10px}.icon-align-center{display:block;margin-left:auto;margin-right:auto;text-align:center;margin-bottom:1.618em}.icon-align-none{display:inline-block;margin:.1em .3em}[class*=" icon-"]:before,[class^=icon-]:before{display:inline-block;vertical-align:baseline;speak:none;line-height:1;color:#333}.icon-1x{position:relative;font-size:1em}.icon-1x.icon-align-left{margin-top:11px;margin-right:11px}.icon-1x.icon-align-right{margin-top:11px;margin-left:11px}.icon-1x.icon-type-round{border-radius:1em}.icon-2x{position:relative;font-size:2em}.icon-2x.icon-align-left{margin-top:12px;margin-right:12px}.icon-2x.icon-align-right{margin-top:12px;margin-left:12px}.icon-2x.icon-type-round{border-radius:2em}.icon-3x{position:relative;font-size:3em}.icon-3x.icon-align-left{margin-top:13px;margin-right:13px}.icon-3x.icon-align-right{margin-top:13px;margin-left:13px}.icon-3x.icon-type-round{border-radius:3em}.icon-4x{position:relative;font-size:4em}.icon-4x.icon-align-left{margin-top:14px;margin-right:14px}.icon-4x.icon-align-right{margin-top:14px;margin-left:14px}.icon-4x.icon-type-round{border-radius:4em}.icon-5x{position:relative;font-size:5em}.icon-5x.icon-align-left{margin-top:15px;margin-right:15px}.icon-5x.icon-align-right{margin-top:15px;margin-left:15px}.icon-5x.icon-type-round{border-radius:5em}.icon-6x{position:relative;font-size:6em}.icon-6x.icon-align-left{margin-top:16px;margin-right:16px}.icon-6x.icon-align-right{margin-top:16px;margin-left:16px}.icon-6x.icon-type-round{border-radius:6em}.icon-7x{position:relative;font-size:7em}.icon-7x.icon-align-left{margin-top:17px;margin-right:17px}.icon-7x.icon-align-right{margin-top:17px;margin-left:17px}.icon-7x.icon-type-round{border-radius:7em}.icon-8x{position:relative;font-size:8em}.icon-8x.icon-align-left{margin-top:18px;margin-right:18px}.icon-8x.icon-align-right{margin-top:18px;margin-left:18px}.icon-8x.icon-type-round{border-radius:8em}.icon-9x{position:relative;font-size:9em}.icon-9x.icon-align-left{margin-top:19px;margin-right:19px}.icon-9x.icon-align-right{margin-top:19px;margin-left:19px}.icon-9x.icon-type-round{border-radius:9em}.icon-10x{position:relative;font-size:10em}.icon-10x.icon-align-left{margin-top:110px;margin-right:110px}.icon-10x.icon-align-right{margin-top:110px;margin-left:110px}.icon-10x.icon-type-round{border-radius:10em}.icon-type-round,.icon-type-square{background:#333;padding:1em}.icon-type-round:before,.icon-type-square:before{color:#fff;margin-top:-.5em;margin-left:-1em;width:100%;text-align:center;position:absolute;top:50%;left:50%}.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}[class*=" icon-"],[class^=icon-]{font-family:icomoon;speak:none;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-pinterest:before{content:"\e600"}.icon-facebook:before{content:"\e601"}.icon-twitter:before{content:"\e602"}.icon-tumblr:before{content:"\e603"}.icon-soundcloud:before{content:"\e604"}.icon-skype:before{content:"\e605"}.icon-deviantart:before{content:"\e606"}.icon-forrst:before{content:"\e607"}.icon-dribbble:before{content:"\e608"}.icon-flickr:before{content:"\e609"}.icon-vimeo:before{content:"\e60a"}.icon-lastfm:before{content:"\e60b"}.icon-stackoverflow:before{content:"\e60c"}.icon-feed:before{content:"\e60d"}.icon-css3:before{content:"\e60e"}.icon-html5:before{content:"\e60f"}.icon-chrome:before{content:"\e610"}.icon-firefox:before{content:"\e611"}.icon-IE:before{content:"\e612"}.icon-opera:before{content:"\e613"}.icon-safari:before{content:"\e614"}.icon-googleplus:before{content:"\e615"}.icon-github:before{content:"\e616"}.icon-stumbleupon:before{content:"\e617"}.icon-foursquare:before{content:"\e618"}.icon-paypal:before{content:"\e619"}.icon-pencil:before{content:"\e61a"}.icon-pen:before{content:"\e61b"}.icon-droplet:before{content:"\e61c"}.icon-music:before{content:"\e61d"}.icon-play:before{content:"\e61e"}.icon-camera:before{content:"\e61f"}.icon-film:before{content:"\e620"}.icon-folder-open:before{content:"\e621"}.icon-tag:before{content:"\e622"}.icon-tags:before{content:"\e623"}.icon-cart:before{content:"\e624"}.icon-support:before{content:"\e625"}.icon-phone:before{content:"\e626"}.icon-envelope:before{content:"\e627"}.icon-pushpin:before{content:"\e628"}.icon-clock:before{content:"\e629"}.icon-calendar:before{content:"\e62a"}.icon-print:before{content:"\e62b"}.icon-settings:before{content:"\e62c"}.icon-home:before{content:"\e62e"}.icon-image:before{content:"\e62f"}.icon-images:before{content:"\e630"}.icon-camera2:before{content:"\e631"}.icon-bullhorn:before{content:"\e632"}.icon-books:before{content:"\e633"}.icon-library:before{content:"\e634"}.icon-file:before{content:"\e635"}.icon-profile:before{content:"\e636"}.icon-ticket:before{content:"\e637"}.icon-location:before{content:"\e638"}.icon-screen:before{content:"\e639"}.icon-laptop:before{content:"\e63a"}.icon-mobile:before{content:"\e63b"}.icon-mobile2:before{content:"\e63c"}.icon-tablet:before{content:"\e63d"}.icon-spinner:before{content:"\e63e"}.icon-spinner2:before{content:"\e63f"}.icon-spinner3:before{content:"\e640"}.icon-zoomin:before{content:"\e641"}.icon-zoomout:before{content:"\e642"}.icon-expand:before{content:"\e643"}.icon-reply:before{content:"\e644"}.icon-forward:before{content:"\e645"}.icon-bubbles:before{content:"\e646"}.icon-bubble:before{content:"\e647"}.icon-user:before{content:"\e648"}.icon-users:before{content:"\e649"}.icon-quotes-left:before{content:"\e64a"}.icon-search:before{content:"\e64b"}.icon-binoculars:before{content:"\e64c"}.icon-key:before{content:"\e64d"}.icon-lock:before{content:"\e64e"}.icon-unlocked:before{content:"\e64f"}.icon-cogs:before{content:"\e650"}.icon-cog:before{content:"\e651"}.icon-bug:before{content:"\e652"}.icon-stats:before{content:"\e653"}.icon-glass:before{content:"\e654"}.icon-mug:before{content:"\e655"}.icon-rocket:before{content:"\e656"}.icon-meter:before{content:"\e657"}.icon-fire:before{content:"\e658"}.icon-lab:before{content:"\e659"}.icon-remove:before{content:"\e65a"}.icon-truck:before{content:"\e65b"}.icon-powercord:before{content:"\e65c"}.icon-list:before{content:"\e65d"}.icon-numbered-list:before{content:"\e65e"}.icon-menu:before{content:"\e65f"}.icon-tree:before{content:"\e660"}.icon-cloud-download:before{content:"\e661"}.icon-cloud-upload:before{content:"\e662"}.icon-earth:before{content:"\e663"}.icon-link:before{content:"\e664"}.icon-flag:before{content:"\e665"}.icon-attachment:before{content:"\e666"}.icon-eye:before{content:"\e667"}.icon-bookmark:before{content:"\e668"}.icon-heart:before{content:"\e669"}.icon-heart2:before{content:"\e66a"}.icon-smiley:before{content:"\e66b"}.icon-sad:before{content:"\e66c"}.icon-tongue:before{content:"\e66d"}.icon-happy:before{content:"\e66e"}.icon-shocked:before{content:"\e66f"}.icon-confused:before{content:"\e670"}.icon-neutral:before{content:"\e671"}.icon-wondering:before{content:"\e672"}.icon-wink:before{content:"\e673"}.icon-cool:before{content:"\e674"}.icon-grin:before{content:"\e675"}.icon-angry:before{content:"\e676"}.icon-evil:before{content:"\e677"}.icon-info:before{content:"\e678"}.icon-warning:before{content:"\e679"}.icon-checkmark:before{content:"\e67a"}.icon-close:before{content:"\e67b"}.icon-minus:before{content:"\e67c"}.icon-plus:before{content:"\e67d"}.icon-enter:before{content:"\e67e"}.icon-exit:before{content:"\e67f"}.icon-volume-medium:before{content:"\e680"}.icon-loop:before{content:"\e681"}.icon-loop2:before{content:"\e682"}.icon-shuffle:before{content:"\e683"}.icon-loop3:before{content:"\e684"}.icon-crop:before{content:"\e685"}.icon-console:before{content:"\e686"}.icon-share:before{content:"\e687"}.icon-google-drive:before{content:"\e688"}.icon-youtube:before{content:"\e689"}.icon-picassa:before{content:"\e68a"}.icon-steam:before{content:"\e68b"}.icon-wordpress:before{content:"\e68c"}.icon-joomla:before{content:"\e68d"}.icon-yahoo:before{content:"\e68e"}.icon-apple:before{content:"\e68f"}.icon-code:before{content:"\e690"}.icon-embed:before{content:"\e691"}.icon-newtab:before{content:"\e692"}.icon-file-pdf:before{content:"\e693"}.icon-file-word:before{content:"\e694"}.icon-yelp:before{content:"\e695"}.icon-file-zip:before{content:"\e696"}.icon-file-xml:before{content:"\e697"}.icon-file-css:before{content:"\e698"}.icon-file-excel:before{content:"\e699"}.icon-delicious:before{content:"\e69a"}.icon-font:before{content:"\e62d"}.icon-thumbs-up:before{content:"\e69b"}.icon-thumbs-down:before{content:"\e69c"}.icon-camera-retro:before{content:"\e69d"}.icon-star:before{content:"\e69e"}.icon-star-empty:before{content:"\e69f"}.icon-youtube2:before{content:"\e6a0"}.icon-windows:before{content:"\e6a1"}.icon-android:before{content:"\e6a2"}.icon-dropbox:before{content:"\e6a3"}.icon-anchor:before{content:"\e6a4"}.icon-euro:before{content:"\e6a5"}.icon-gbp:before{content:"\e6a6"}.icon-dollar:before{content:"\e6a7"}.icon-yen:before{content:"\e6a8"}.icon-shield:before{content:"\e6a9"}.icon-linkedin:before{content:"\e6aa"}.icon-coffee:before{content:"\e6ab"}.icon-code-fork:before{content:"\e6ac"}.icon-magic:before{content:"\e6ad"}.icon-credit:before{content:"\e6ae"}.icon-legal:before{content:"\e6af"}.icon-medkit:before{content:"\e6b0"}.icon-beer:before{content:"\e6b1"}.icon-sun:before{content:"\e6b2"}.icon-moon:before{content:"\e6b3"}.icon-money:before{content:"\e6b4"}.icon-right-arrow:before{content:"\e04b"}.icon-top-arrow:before{content:"\e04c"}.icon-bottom-arrow:before{content:"\e04d"}.icon-left-arrow:before{content:"\e04a"}.icon-spotify:before{content:"\e045"}.icon-behance:before{content:"\e055"}.icon-digg:before{content:"\e054"}.icon-evernote:before{content:"\e053"}.icon-app-store:before{content:"\e056"}.icon-500px:before{content:"\e059"}.icon-amazon:before{content:"\e058"}.icon-grooveshark:before{content:"\e052"}.icon-myspace:before{content:"\e051"}.icon-zerply:before{content:"\e050"}.icon-amp:before{content:"\e01d"}.icon-quote-top:before{content:"\e002"}.icon-quote-bottom:before{content:"\e003"}.icon-instagram:before{content:"\e04f"}.icon-diamond:before{content:"\e6b6"}img{max-width:100%;height:auto}audio,canvas,embed,iframe,object,video{border:none!important;max-width:100%}.fluid-video{display:block;width:100%;margin-bottom:2rem;height:0;padding-bottom:56.25%;overflow:hidden;position:relative}.fluid-video embed,.fluid-video iframe,.fluid-video object,.fluid-video video{width:100%!important;height:100%!important;position:absolute;top:0;left:0}form{margin-top:2rem}input[name=post_password],input[type=email],input[type=password],input[type=search],input[type=tel],input[type=text],select,textarea{max-width:100%!important;font-family:inherit;font-size:inherit;color:#333;line-height:inherit;padding:.5rem .7rem;border:1px solid rgba(0,0,0,.1);border-color:rgba(0,0,0,.3);text-shadow:none}input[name=post_password]:focus,input[type=email]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,select:focus,textarea:focus{outline:0;border-color:rgba(0,0,0,.5)}option,select{padding:.5rem .7rem;min-width:200px}textarea{height:250px}input[type=submit]{margin-left:0!important}input[type=email],input[type=search],input[type=tel],input[type=text],select,textarea{width:100%}input[type=email],input[type=search],input[type=tel],input[type=text],textarea{background:rgba(255,255,255,.9);color:#000}input[type=checkbox],input[type=radio]{margin-left:.1rem;margin-right:.625rem}p label{display:block;margin-bottom:.5rem;width:100%}.button,input[type=submit]{cursor:pointer;outline:0!important;position:relative;opacity:1!important;line-height:1!important;font-style:normal!important;vertical-align:middle;text-shadow:none!important;font-family:Helvetica,Arial,sans-serif;text-align:center;font-weight:700!important;text-decoration:none!important;display:inline-block;letter-spacing:0;color:#fff!important;border:none!important;background-image:none;background-color:#4bbd93;-webkit-border-radius:4px;border-radius:4px;padding:1.618rem 3.236rem;font-size:1.618rem;width:100%;margin-bottom:1.618rem;box-shadow:0 4px 0 #328969;top:-2px}.button:active,.button:focus,.button:hover,input[type=submit]:active,input[type=submit]:focus,input[type=submit]:hover{background-color:#4bbd93}.button:hover,input[type=submit]:hover{top:0;box-shadow:0 2px 0 #328969}.button:active,.button:focus,input[type=submit]:active,input[type=submit]:focus{top:2px;box-shadow:0 0 0 #328969}.button-big{cursor:pointer;outline:0!important;position:relative;opacity:1!important;line-height:1!important;font-style:normal!important;vertical-align:middle;text-shadow:none!important;font-family:Helvetica,Arial,sans-serif;text-align:center;font-weight:700!important;text-decoration:none!important;display:inline-block;letter-spacing:0;color:#fff!important;border:none!important;background-image:none;background-color:#4bbd93;-webkit-border-radius:4px;border-radius:4px;width:100%;margin-bottom:1.618rem;box-shadow:0 6px 0 #328969;top:-3px}.button-big:active,.button-big:focus,.button-big:hover{background-color:#4bbd93}.button-big:hover{top:-1px;box-shadow:0 4px 0 #328969}.button-big:active,.button-big:focus{top:3px;box-shadow:0 0 0 #328969}.button-alt,.button-alt-big,.button-alt-light,.button-alt-light-big{-webkit-transition:all .1s;-moz-transition:all .1s;-ms-transition:all .1s;-o-transition:all .1s;transition:all .1s;cursor:pointer;outline:0!important;position:relative;opacity:1!important;line-height:1!important;font-style:normal!important;vertical-align:middle;text-shadow:none!important;font-family:Helvetica,Arial,sans-serif;text-align:center;font-weight:700!important;text-decoration:none!important;display:inline-block;letter-spacing:0;border:none!important;padding:1.618rem 3.236rem;font-size:1.618rem;width:100%;margin-bottom:1.618rem;color:#666!important;-webkit-border-radius:0;border-radius:0;box-shadow:0 0 0 transparent;background:none!important;border-color:#666!important;border-style:solid!important;border-width:2px!important}.button-alt-big:active,.button-alt-big:focus,.button-alt-big:hover,.button-alt-light-big:active,.button-alt-light-big:focus,.button-alt-light-big:hover,.button-alt-light:active,.button-alt-light:focus,.button-alt-light:hover,.button-alt:active,.button-alt:focus,.button-alt:hover{box-shadow:0 0 transparent;color:#fff!important;background-color:#4bbd93!important;border-color:#4bbd93!important}.button-alt-light-big{border-width:3px!important}.button-alt-light,.button-alt-light-big{color:#fff!important;border-color:#fff!important}.button-alt-light-big:active,.button-alt-light-big:focus,.button-alt-light-big:hover,.button-alt-light:active,.button-alt-light:focus,.button-alt-light:hover{color:#fff!important}.button-alt-big,.button-alt-light-big,.button-big{padding:2.1034rem 4.2068rem;font-size:2.1034rem}@media screen and (min-width:500px){h1{font-size:4.8rem;line-height:1.2em}h2{font-size:3.8rem;line-height:1.2em}h3{font-size:3.3rem}h4{font-size:2.8rem}blockquote{margin-left:1.6em}.button,.button-alt,.button-alt-big,.button-alt-light,.button-alt-light-big,.button-big,input[type=submit]{width:auto}.button,.button-alt,.button-alt-light,.button-alt-light-big,input[type=submit]{margin:.3rem}.button-alt-big,.button-alt-light-big,.button-big{margin:.4rem}input[type=email],input[type=search],input[type=tel],input[type=text],select{width:60%}}@media screen and (min-width:900px){h1{font-size:5rem;line-height:1.2em}h2{font-size:4rem;line-height:1.2em}h3{font-size:3.5rem}h4{font-size:3rem}.container{padding:6.85353rem 0}hr{margin:4rem 0}ol,ul{margin-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9{float:left;position:relative;margin-left:3.236%;margin-right:3.236%;margin-bottom:0}.col-1{width:2.40067%}.col-2{width:11.27333%}.col-3{width:20.146%}.col-4{width:29.01867%}.col-5{width:37.89133%}.col-6{width:46.764%}.col-7{width:55.63667%}.col-8{width:64.50933%}.col-9{width:73.382%}.col-10{width:82.25467%}.col-11{width:91.12733%}.col-12{width:100%}.alpha,.first{margin-left:0!important}.last,.omega{margin-right:0!important}}@media screen and (min-width:1600px){.container{padding:11.08901rem 0}hr{margin:5rem 0}}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/swipebox/demo/fork.png b/dashboard-ui/bower_components/swipebox/demo/fork.png
new file mode 100644
index 0000000000..0edf76c3dd
Binary files /dev/null and b/dashboard-ui/bower_components/swipebox/demo/fork.png differ
diff --git a/dashboard-ui/bower_components/swipebox/demo/normalize.css b/dashboard-ui/bower_components/swipebox/demo/normalize.css
new file mode 100644
index 0000000000..b14732420e
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/demo/normalize.css
@@ -0,0 +1 @@
+/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/swipebox/demo/style.css b/dashboard-ui/bower_components/swipebox/demo/style.css
new file mode 100644
index 0000000000..5e52773d5c
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/demo/style.css
@@ -0,0 +1 @@
+body{font-family:'Merriweather', serif;border-top:5px solid #4BBD93;overflow-x:hidden !important;background:#FFF;color:#666}body img{opacity:1 !important}h1,h2,h3,h4,h4,h6{font-family:'Raleway', sans-serif}a{text-decoration:none}ol{margin-left:2em;margin-bottom:2em}ul{margin-left:1em;margin-bottom:0}ul ul{margin-left:1em}header h1{margin-top:0;font-size:12rem}.lead{margin-bottom:2em}#fork-this{position:absolute;z-index:1;right:0;top:5px;width:0px;height:0px;border-style:solid;border-width:0 150px 150px 0;border-color:transparent #4BBD93 transparent transparent}#fork-this a{display:block;position:absolute;z-index:10;width:150px;height:150px;top:0;right:-150px;z-index:10;background:url("fork.png") no-repeat 0 0;background-size:150px 150px}#share{margin-bottom:3rem}#share #fb,#share #twitter{display:inline-block}#share #fb{position:relative;top:-8px}.container:nth-child(even){background:whitesmoke}.container:nth-child(odd){background:#fff}#box-container{margin:0;padding:0}.box{list-style-type:none;float:left;margin-bottom:1rem;margin-left:1%;margin-right:1%;width:48%}.box:nth-child(2n+1){clear:both;margin-left:0}.box:nth-child(2n+0){margin-right:0}.box a{display:block;width:100%;height:auto}.box a img{-webkit-back-visibility:hidden;display:block;width:100%;height:auto;vertical-align:bottom}footer{font-size:1.3rem;font-family:"Helvetica neue", Helvetica, Arial, sans-serif;text-align:center;color:#666;margin:2rem 0}footer a{color:#666}@media screen and (max-width: 799px){header h1{font-size:8rem}hr{margin:2rem 0}#fork-this{display:none}#share #fb{top:-8px}.button{margin-left:0;margin-right:0;width:100%}.button{font-size:1.3rem;padding:1.4rem 2rem}}@media screen and (max-width: 410px){header h1{font-size:5rem}.box{width:100%;margin-left:0;margin-right:0}}
diff --git a/dashboard-ui/bower_components/swipebox/grunt/.jshintrc b/dashboard-ui/bower_components/swipebox/grunt/.jshintrc
new file mode 100644
index 0000000000..2039914926
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/grunt/.jshintrc
@@ -0,0 +1,24 @@
+{
+ "boss": true,
+ "curly": true,
+ "eqeqeq": true,
+ "eqnull": true,
+ "es3": true,
+ "expr": true,
+ "immed": true,
+ "noarg": true,
+ "onevar": true,
+ "quotmark": "single",
+ "trailing": true,
+ "undef": true,
+ "unused": true,
+
+ "browser": true,
+
+ "globals": {
+ "_": false,
+ "Backbone": false,
+ "jQuery": false,
+ "wp": false
+ }
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/swipebox/grunt/gruntfile.js b/dashboard-ui/bower_components/swipebox/grunt/gruntfile.js
new file mode 100644
index 0000000000..d17f411cc5
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/grunt/gruntfile.js
@@ -0,0 +1,168 @@
+module.exports = function(grunt) {
+
+ // don't forget to update the version in the package.json and bower.json file
+
+ // load dependencies
+ require('load-grunt-tasks')(grunt);
+
+ grunt.initConfig({
+
+ version: grunt.file.readJSON('package.json').version,
+ pkg: grunt.file.readJSON('package.json'),
+
+ // notify cross-OS - see https://github.com/dylang/grunt-notify
+ notify: {
+
+ scss: {
+ options: {
+ title: 'SCSS compiled',
+ message: 'CSS is in the hood'
+ }
+ },
+
+ js: {
+ options: {
+ title: 'JS checked and minified',
+ message: 'JS is all good'
+ }
+ },
+
+ dist: {
+ options: {
+ title: 'Project Compiled',
+ message: 'All good'
+ }
+ }
+ },
+
+ // compile scss
+ sass: {
+
+ dist:{
+ options:{
+ style: 'expanded'
+ },
+
+ files:{
+ '../src/css/swipebox.css': '../scss/swipebox.scss',
+ }
+ },
+
+ demo:{
+ options:{
+ style: 'compressed'
+ },
+
+ files:{
+ '../demo/style.css': '../demo/scss/style.scss',
+ }
+ }
+
+ },
+
+ // https://github.com/nDmitry/grunt-autoprefixer
+ autoprefixer: {
+ options: {
+ browsers: ['last 3 versions', 'bb 10', 'android 3']
+ },
+ no_dest: {
+ src: '../src/css/swipebox.css',
+ }
+ },
+
+ // minify css asset files
+ cssmin: {
+ minify: {
+ expand: true,
+ cwd: '../src/css/',
+ src: ['*.css', '!*.min.css'],
+ dest: '../src/css/',
+ ext: '.min.css'
+ }
+ },
+
+ // chech our JS
+ jshint: {
+ options : {
+ jshintrc : '.jshintrc'
+ },
+ all: [ '../src/js/jquery.swipebox.js' ]
+ },
+
+ // minify JS
+ uglify: {
+
+ options:{
+ banner : '/*! Swipebox v<%= version %> | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */\n'
+ },
+
+ admin: {
+ files: {
+ '../src/js/jquery.swipebox.min.js': [ '../src/js/jquery.swipebox.js']
+ }
+ }
+ },
+
+ // watch it live
+ watch: {
+ js: {
+ files: [ '../src/js/*.js' ],
+ tasks: [
+ 'jshint',
+ 'uglify',
+ 'notify:js'
+ ],
+ },
+ scss: {
+
+ files: ['../scss/*.scss', '../demo/scss/*.scss'],
+ tasks: [
+ 'sass',
+ 'autoprefixer',
+ 'cssmin',
+ 'notify:scss'
+ ],
+ },
+
+ css: {
+ files: ['*.css']
+ },
+
+ livereload: {
+ files: [ '../src/css/*.css', '../demo/*.css' ],
+ options: { livereload: true }
+ }
+ },
+
+
+ } ); // end init config
+
+ /**
+ * Default task
+ */
+ grunt.registerTask( 'default', [
+ 'sass:dist',
+ 'autoprefixer',
+ 'cssmin',
+ 'jshint',
+ 'uglify',
+ 'sass:demo',
+ 'notify:dist'
+ ] );
+
+ /**
+ * Dev task
+ *
+ * The main tasks for development
+ *
+ */
+ grunt.registerTask( 'dev', [
+ 'sass:dist',
+ 'autoprefixer',
+ 'cssmin',
+ 'jshint',
+ 'uglify',
+ 'sass:demo',
+ 'watch'
+ ] );
+};
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/swipebox/grunt/package.json b/dashboard-ui/bower_components/swipebox/grunt/package.json
new file mode 100644
index 0000000000..a7675de795
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/grunt/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "grunt-swipebox",
+ "version": "1.4.1",
+ "description": "A touchable jQuery lightbox",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/brutaldesign/swipebox.git"
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "grunt": "~0.4.5",
+ "load-grunt-tasks": "~1.0.0",
+ "grunt-contrib-sass": "~0.8.1",
+ "grunt-autoprefixer": "~2.0.0",
+ "grunt-contrib-cssmin": "~0.10.0",
+ "grunt-contrib-jshint": "~0.10.0",
+ "grunt-contrib-uglify": "~0.6.0",
+ "grunt-contrib-watch": "~0.6.1",
+ "grunt-notify": "~0.3.1"
+ }
+}
diff --git a/dashboard-ui/bower_components/swipebox/index.html b/dashboard-ui/bower_components/swipebox/index.html
new file mode 100644
index 0000000000..c2294071de
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/index.html
@@ -0,0 +1,274 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Swipebox | A touchable jQuery lightbox
+
+
+
+
+
+
+
+
+
+
+
+
Swipebox.
+
A touchable jQuery lightbox
+
+
+
+
+
+
+
+
+
+
+
+
+
What is Swipebox ?
+
Swipebox is a jQuery "lightbox" plugin for desktop, mobile and tablet.
+
+
+
Main Features
+
+ Swipe gestures for mobile
+ Keyboard Navigation for desktop
+ CSS transitions with jQuery fallback
+ Retina support for UI icons
+ Easy CSS customization
+
+
+
+
Compatibility
+
Chrome, Safari, Firefox, Opera, IE9+, IOS4+, Android, windows phone.
+
+
+
+
+
+
+
Basic Usage
+
Javascript
+
+
Include jquery and the swipebox script in your head
tags or right before your body
closing tag.
+
<script src="lib/jquery-2.0.3.js"></script>
+<script src="src/js/jquery.swipebox.js"></script>
+
+
CSS
+
Include the swipebox CSS style in your head
tags.
+
<link rel="stylesheet" href="src/css/swipebox.css">
+
HTML
+
Use a specific class for your links and use the title attribute as caption.
+
<a href="big/image.jpg" class="swipebox" title="My Caption">
+<img src="small/image.jpg" alt="image">
+</a>
+
Fire the plugin
+
Bind the swipebox behaviour on every link with the "swipebox" class.
+
<script type="text/javascript">
+;( function( $ ) {
+
+ $( '.swipebox' ).swipebox();
+
+} )( jQuery );
+</script>
+
+
+
+
+
+
+
Advanced
+
+
+
Gallery
+
You can add a rel
attribute to your links to seperate your galleries.
+
+<!-- Gallery 1 -->
+<a rel="gallery-1" href="big/image1.jpg" class="swipebox">
+ <img src="small/image1.jpg" alt="image">
+</a>
+<a rel="gallery-1" href="big/image2.jpg" class="swipebox">
+ <img src="small/image2.jpg" alt="image">
+</a>
+<!-- Gallery 2 -->
+<a rel="gallery-2" href="big/image3.jpg" class="swipebox">
+ <img src="small/image3.jpg" alt="image">
+</a>
+<a rel="gallery-2" href="big/image4.jpg" class="swipebox">
+ <img src="small/image4.jpg" alt="image">
+</a>
+
+
+
Video support
+
Simply paste a youtube or vimeo video URL in your href attribute. The script will automatically check if it's a youtube or vimeo URL and open the video in the swipebox.
+
+ My Video
+
+
<a class="swipebox-video" rel="vimeo" href="http://vimeo.com/29193046">My Videos</a>
+
+
+
Load slides dynamically
+
You can set your gallery dynamically by passing an array object to the swipebox.
+
View gallery
+
+
+$( '#gallery' ).click( function( e ) {
+ e.preventDefault();
+ $.swipebox( [
+ { href:'big/image1.jpg', title:'My Caption' },
+ { href:'big/image2.jpg', title:'My Second Caption' }
+ ] );
+} );
+
+
Check open state
+
if ( $.swipebox.isOpen ) {
+ // do stuff
+}
+
+
+
Options
+
+<script type="text/javascript">
+;( function( $ ) {
+
+ $( '.swipebox' ).swipebox( {
+ useCSS : true, // false will force the use of jQuery for animations
+ useSVG : true, // false to force the use of png for buttons
+ initialIndexOnArray : 0, // which image index to init when a array is passed
+ hideCloseButtonOnMobile : false, // true will hide the close button on mobile devices
+ hideBarsDelay : 3000, // delay before hiding bars on desktop
+ videoMaxWidth : 1140, // videos max width
+ beforeOpen: function() {}, // called before opening
+ afterOpen: null, // called after opening
+ afterClose: function() {}, // called after closing
+ loopAtEnd: false // true will return to the first image after the last image is reached
+ } );
+
+} )( jQuery );
+</script>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/swipebox/lib/ios-orientationchange-fix.js b/dashboard-ui/bower_components/swipebox/lib/ios-orientationchange-fix.js
new file mode 100644
index 0000000000..2cf6241c93
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/lib/ios-orientationchange-fix.js
@@ -0,0 +1,56 @@
+/*! A fix for the iOS orientationchange zoom bug.
+ Script by @scottjehl, rebound by @wilto.
+ MIT / GPLv2 License.
+*/
+(function(w){
+
+ // This fix addresses an iOS bug, so return early if the UA claims it's something else.
+ var ua = navigator.userAgent;
+ if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && /OS [1-5]_[0-9_]* like Mac OS X/i.test(ua) && ua.indexOf( "AppleWebKit" ) > -1 ) ){
+ return;
+ }
+
+ var doc = w.document;
+
+ if( !doc.querySelector ){ return; }
+
+ var meta = doc.querySelector( "meta[name=viewport]" ),
+ initialContent = meta && meta.getAttribute( "content" ),
+ disabledZoom = initialContent + ",maximum-scale=1",
+ enabledZoom = initialContent + ",maximum-scale=10",
+ enabled = true,
+ x, y, z, aig;
+
+ if( !meta ){ return; }
+
+ function restoreZoom(){
+ meta.setAttribute( "content", enabledZoom );
+ enabled = true;
+ }
+
+ function disableZoom(){
+ meta.setAttribute( "content", disabledZoom );
+ enabled = false;
+ }
+
+ function checkTilt( e ){
+ aig = e.accelerationIncludingGravity;
+ x = Math.abs( aig.x );
+ y = Math.abs( aig.y );
+ z = Math.abs( aig.z );
+
+ // If portrait orientation and in one of the danger zones
+ if( (!w.orientation || w.orientation === 180) && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){
+ if( enabled ){
+ disableZoom();
+ }
+ }
+ else if( !enabled ){
+ restoreZoom();
+ }
+ }
+
+ w.addEventListener( "orientationchange", restoreZoom, false );
+ w.addEventListener( "devicemotion", checkTilt, false );
+
+})( this );
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/swipebox/lib/jquery-2.1.0.min.js b/dashboard-ui/bower_components/swipebox/lib/jquery-2.1.0.min.js
new file mode 100644
index 0000000000..2adda35a5b
--- /dev/null
+++ b/dashboard-ui/bower_components/swipebox/lib/jquery-2.1.0.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v2.1.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m=a.document,n="2.1.0",o=function(a,b){return new o.fn.init(a,b)},p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};o.fn=o.prototype={jquery:n,constructor:o,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=o.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return o.each(this,a,b)},map:function(a){return this.pushStack(o.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},o.extend=o.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||o.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(o.isPlainObject(d)||(e=o.isArray(d)))?(e?(e=!1,f=c&&o.isArray(c)?c:[]):f=c&&o.isPlainObject(c)?c:{},g[b]=o.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},o.extend({expando:"jQuery"+(n+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===o.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isPlainObject:function(a){if("object"!==o.type(a)||a.nodeType||o.isWindow(a))return!1;try{if(a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=o.trim(a),a&&(1===a.indexOf("use strict")?(b=m.createElement("script"),b.text=a,m.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":k.call(a)},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?o.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),o.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||o.guid++,f):void 0},now:Date.now,support:l}),o.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=o.type(a);return"function"===c||o.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML=" ",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML=" ","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML=" ",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);o.find=t,o.expr=t.selectors,o.expr[":"]=o.expr.pseudos,o.unique=t.uniqueSort,o.text=t.getText,o.isXMLDoc=t.isXML,o.contains=t.contains;var u=o.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(o.isFunction(b))return o.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return o.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return o.filter(b,a,c);b=o.filter(b,a)}return o.grep(a,function(a){return g.call(b,a)>=0!==c})}o.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?o.find.matchesSelector(d,a)?[d]:[]:o.find.matches(a,o.grep(b,function(a){return 1===a.nodeType}))},o.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(o(a).filter(function(){for(b=0;c>b;b++)if(o.contains(e[b],this))return!0}));for(b=0;c>b;b++)o.find(a,e[b],d);return d=this.pushStack(c>1?o.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?o(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=o.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof o?b[0]:b,o.merge(this,o.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:m,!0)),v.test(c[1])&&o.isPlainObject(b))for(c in b)o.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=m.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=m,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):o.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(o):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),o.makeArray(a,this))};A.prototype=o.fn,y=o(m);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};o.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&o(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),o.fn.extend({has:function(a){var b=o(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(o.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?o(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&o.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?o.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(o(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(o.unique(o.merge(this.get(),o(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}o.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return o.dir(a,"parentNode")},parentsUntil:function(a,b,c){return o.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return o.dir(a,"nextSibling")},prevAll:function(a){return o.dir(a,"previousSibling")},nextUntil:function(a,b,c){return o.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return o.dir(a,"previousSibling",c)},siblings:function(a){return o.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return o.sibling(a.firstChild)},contents:function(a){return a.contentDocument||o.merge([],a.childNodes)}},function(a,b){o.fn[a]=function(c,d){var e=o.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=o.filter(d,e)),this.length>1&&(C[a]||o.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return o.each(a.match(E)||[],function(a,c){b[c]=!0}),b}o.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):o.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){o.each(b,function(b,c){var d=o.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&o.each(arguments,function(a,b){var c;while((c=o.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?o.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},o.extend({Deferred:function(a){var b=[["resolve","done",o.Callbacks("once memory"),"resolved"],["reject","fail",o.Callbacks("once memory"),"rejected"],["notify","progress",o.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return o.Deferred(function(c){o.each(b,function(b,f){var g=o.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&o.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?o.extend(a,d):d}},e={};return d.pipe=d.then,o.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&o.isFunction(a.promise)?e:0,g=1===f?a:o.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&o.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;o.fn.ready=function(a){return o.ready.promise().done(a),this},o.extend({isReady:!1,readyWait:1,holdReady:function(a){a?o.readyWait++:o.ready(!0)},ready:function(a){(a===!0?--o.readyWait:o.isReady)||(o.isReady=!0,a!==!0&&--o.readyWait>0||(H.resolveWith(m,[o]),o.fn.trigger&&o(m).trigger("ready").off("ready")))}});function I(){m.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),o.ready()}o.ready.promise=function(b){return H||(H=o.Deferred(),"complete"===m.readyState?setTimeout(o.ready):(m.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},o.ready.promise();var J=o.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===o.type(c)){e=!0;for(h in c)o.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,o.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(o(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};o.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=o.expando+Math.random()}K.uid=1,K.accepts=o.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,o.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(o.isEmptyObject(f))o.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,o.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{o.isArray(b)?d=b.concat(b.map(o.camelCase)):(e=o.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!o.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?o.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}o.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),o.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;
+while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=o.camelCase(d.slice(5)),P(f,d,e[d]));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=o.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),o.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||o.isArray(c)?d=L.access(a,b,o.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=o.queue(a,b),d=c.length,e=c.shift(),f=o._queueHooks(a,b),g=function(){o.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:o.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),o.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length ",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";l.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return m.activeElement}catch(a){}}o.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=o.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof o!==U&&o.event.triggered!==b.type?o.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],n=q=h[1],p=(h[2]||"").split(".").sort(),n&&(l=o.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=o.event.special[n]||{},k=o.extend({type:n,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&o.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(n,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),o.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],n=q=h[1],p=(h[2]||"").split(".").sort(),n){l=o.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||o.removeEvent(a,n,r.handle),delete i[n])}else for(n in i)o.event.remove(a,n+b[j],c,d,!0);o.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,p=[d||m],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||m,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+o.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[o.expando]?b:new o.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:o.makeArray(c,[b]),n=o.event.special[q]||{},e||!n.trigger||n.trigger.apply(d,c)!==!1)){if(!e&&!n.noBubble&&!o.isWindow(d)){for(i=n.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||m)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:n.bindType||q,l=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),l&&l.apply(g,c),l=k&&g[k],l&&l.apply&&o.acceptData(g)&&(b.result=l.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||n._default&&n._default.apply(p.pop(),c)!==!1||!o.acceptData(d)||k&&o.isFunction(d[q])&&!o.isWindow(d)&&(h=d[k],h&&(d[k]=null),o.event.triggered=q,d[q](),o.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=o.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=o.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=o.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((o.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?o(e,this).index(i)>=0:o.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""," "],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return o.nodeName(a,"table")&&o.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)o.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=o.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&o.nodeName(a,b)?o.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}o.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=o.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||o.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,n=a.length;n>m;m++)if(e=a[m],e||0===e)if("object"===o.type(e))o.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>$2>")+h[2],j=h[0];while(j--)f=f.lastChild;o.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===o.inArray(e,d))&&(i=o.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f,g,h=o.event.special,i=0;void 0!==(c=a[i]);i++){if(o.acceptData(c)&&(f=c[L.expando],f&&(b=L.cache[f]))){if(d=Object.keys(b.events||{}),d.length)for(g=0;void 0!==(e=d[g]);g++)h[e]?o.event.remove(c,e):o.removeEvent(c,e,b.handle);L.cache[f]&&delete L.cache[f]}delete M.cache[c[M.expando]]}}}),o.fn.extend({text:function(a){return J(this,function(a){return void 0===a?o.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?o.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||o.cleanData(ob(c)),c.parentNode&&(b&&o.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(o.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return o.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(o.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,o.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,n=k-1,p=a[0],q=o.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(c=o.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=o.map(ob(c,"script"),kb),g=f.length;k>j;j++)h=c,j!==n&&(h=o.clone(h,!0,!0),g&&o.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,o.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&o.contains(i,h)&&(h.src?o._evalUrl&&o._evalUrl(h.src):o.globalEval(h.textContent.replace(hb,"")))}return this}}),o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){o.fn[a]=function(a){for(var c,d=[],e=o(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),o(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d=o(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:o.css(d[0],"display");return d.detach(),e}function tb(a){var b=m,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||o("")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||o.contains(a.ownerDocument,a)||(g=o.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",e=m.documentElement,f=m.createElement("div"),g=m.createElement("div");g.style.backgroundClip="content-box",g.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===g.style.backgroundClip,f.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",f.appendChild(g);function h(){g.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",e.appendChild(f);var d=a.getComputedStyle(g,null);b="1%"!==d.top,c="4px"===d.width,e.removeChild(f)}a.getComputedStyle&&o.extend(l,{pixelPosition:function(){return h(),b},boxSizingReliable:function(){return null==c&&h(),c},reliableMarginRight:function(){var b,c=g.appendChild(m.createElement("div"));return c.style.cssText=g.style.cssText=d,c.style.marginRight=c.style.width="0",g.style.width="1px",e.appendChild(f),b=!parseFloat(a.getComputedStyle(c,null).marginRight),e.removeChild(f),g.innerHTML="",b}})}(),o.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:0,fontWeight:400},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=o.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=o.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=o.css(a,"border"+R[f]+"Width",!0,e))):(g+=o.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=o.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===o.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):f[g]||(e=S(d),(c&&"none"!==c||!e)&&L.set(d,"olddisplay",e?c:o.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}o.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=o.camelCase(b),i=a.style;return b=o.cssProps[h]||(o.cssProps[h]=Fb(i,h)),g=o.cssHooks[b]||o.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(o.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||o.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]="",i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=o.camelCase(b);return b=o.cssProps[h]||(o.cssProps[h]=Fb(a.style,h)),g=o.cssHooks[b]||o.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||o.isNumeric(f)?f||0:e):e}}),o.each(["height","width"],function(a,b){o.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&zb.test(o.css(a,"display"))?o.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===o.css(a,"boxSizing",!1,e),e):0)}}}),o.cssHooks.marginRight=yb(l.reliableMarginRight,function(a,b){return b?o.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),o.each({margin:"",padding:"",border:"Width"},function(a,b){o.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(o.cssHooks[a+b].set=Gb)}),o.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(o.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=o.css(a,b[g],!1,d);return f}return void 0!==c?o.style(a,b,c):o.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?o(this).show():o(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}o.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(o.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?o.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=o.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){o.fx.step[a.prop]?o.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[o.cssProps[a.prop]]||o.cssHooks[a.prop])?o.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},o.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},o.fx=Kb.prototype.init,o.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(o.cssNumber[a]?"":"px"),g=(o.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(o.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,o.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=o.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k=this,l={},m=a.style,n=a.nodeType&&S(a),p=L.get(a,"fxshow");c.queue||(h=o._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,k.always(function(){k.always(function(){h.unqueued--,o.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],j=o.css(a,"display"),"none"===j&&(j=tb(a.nodeName)),"inline"===j&&"none"===o.css(a,"float")&&(m.display="inline-block")),c.overflow&&(m.overflow="hidden",k.always(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(n?"hide":"show")){if("show"!==e||!p||void 0===p[d])continue;n=!0}l[d]=p&&p[d]||o.style(a,d)}if(!o.isEmptyObject(l)){p?"hidden"in p&&(n=p.hidden):p=L.access(a,"fxshow",{}),f&&(p.hidden=!n),n?o(a).show():k.done(function(){o(a).hide()}),k.done(function(){var b;L.remove(a,"fxshow");for(b in l)o.style(a,b,l[b])});for(d in l)g=Ub(n?p[d]:0,d,k),d in p||(p[d]=g.start,n&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=o.camelCase(c),e=b[d],f=a[c],o.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=o.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=o.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:o.extend({},b),opts:o.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=o.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return o.map(k,Ub,j),o.isFunction(j.opts.start)&&j.opts.start.call(a,j),o.fx.timer(o.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}o.Animation=o.extend(Xb,{tweener:function(a,b){o.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),o.speed=function(a,b,c){var d=a&&"object"==typeof a?o.extend({},a):{complete:c||!c&&b||o.isFunction(a)&&a,duration:a,easing:c&&b||b&&!o.isFunction(b)&&b};return d.duration=o.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in o.fx.speeds?o.fx.speeds[d.duration]:o.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){o.isFunction(d.old)&&d.old.call(this),d.queue&&o.dequeue(this,d.queue)},d},o.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=o.isEmptyObject(a),f=o.speed(b,c,d),g=function(){var b=Xb(this,o.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=o.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&o.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=o.timers,g=d?d.length:0;for(c.finish=!0,o.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),o.each(["toggle","show","hide"],function(a,b){var c=o.fn[b];o.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),o.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){o.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),o.timers=[],o.fx.tick=function(){var a,b=0,c=o.timers;for(Lb=o.now();b1)},removeAttr:function(a){return this.each(function(){o.removeAttr(this,a)})}}),o.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?o.prop(a,b,c):(1===f&&o.isXMLDoc(a)||(b=b.toLowerCase(),d=o.attrHooks[b]||(o.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=o.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void o.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=o.propFix[c]||c,o.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&o.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?o.removeAttr(a,c):a.setAttribute(c,c),c}},o.each(o.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||o.find.attr;$b[b]=function(a,b,d){var e,f;
+return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;o.fn.extend({prop:function(a,b){return J(this,o.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[o.propFix[a]||a]})}}),o.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!o.isXMLDoc(a),f&&(b=o.propFix[b]||b,e=o.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),l.optSelected||(o.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),o.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){o.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;o.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(o.isFunction(a))return this.each(function(b){o(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=o.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(o.isFunction(a))return this.each(function(b){o(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?o.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(o.isFunction(a)?function(c){o(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=o(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;o.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=o.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,o(this).val()):a,null==e?e="":"number"==typeof e?e+="":o.isArray(e)&&(e=o.map(e,function(a){return null==a?"":a+""})),b=o.valHooks[this.type]||o.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=o.valHooks[e.type]||o.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),o.extend({valHooks:{select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&o.nodeName(c.parentNode,"optgroup"))){if(b=o(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=o.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=o.inArray(o(d).val(),f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),o.each(["radio","checkbox"],function(){o.valHooks[this]={set:function(a,b){return o.isArray(b)?a.checked=o.inArray(o(a).val(),b)>=0:void 0}},l.checkOn||(o.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),o.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){o.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),o.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=o.now(),dc=/\?/;o.parseJSON=function(a){return JSON.parse(a+"")},o.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&o.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=m.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(o.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,o.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=o.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&o.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}o.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":o.parseJSON,"text xml":o.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,o.ajaxSettings),b):tc(o.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=o.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?o(l):o.event,n=o.Deferred(),p=o.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(n.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=o.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=o.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===o.active++&&o.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(o.lastModified[d]&&v.setRequestHeader("If-Modified-Since",o.lastModified[d]),o.etag[d]&&v.setRequestHeader("If-None-Match",o.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(o.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(o.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?n.resolveWith(l,[r,x,v]):n.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--o.active||o.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return o.get(a,b,c,"json")},getScript:function(a,b){return o.get(a,void 0,b,"script")}}),o.each(["get","post"],function(a,b){o[b]=function(a,c,d,e){return o.isFunction(c)&&(e=e||d,d=c,c=void 0),o.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),o.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){o.fn[b]=function(a){return this.on(b,a)}}),o._evalUrl=function(a){return o.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},o.fn.extend({wrapAll:function(a){var b;return o.isFunction(a)?this.each(function(b){o(this).wrapAll(a.call(this,b))}):(this[0]&&(b=o(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(o.isFunction(a)?function(b){o(this).wrapInner(a.call(this,b))}:function(){var b=o(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=o.isFunction(a);return this.each(function(c){o(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){o.nodeName(this,"body")||o(this).replaceWith(this.childNodes)}).end()}}),o.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},o.expr.filters.visible=function(a){return!o.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(o.isArray(b))o.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==o.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}o.param=function(a,b){var c,d=[],e=function(a,b){b=o.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=o.ajaxSettings&&o.ajaxSettings.traditional),o.isArray(a)||a.jquery&&!o.isPlainObject(a))o.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},o.fn.extend({serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=o.prop(this,"elements");return a?o.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!o(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=o(this).val();return null==c?null:o.isArray(c)?o.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),o.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=o.ajaxSettings.xhr();a.ActiveXObject&&o(a).on("unload",function(){for(var a in Dc)Dc[a]()}),l.cors=!!Fc&&"withCredentials"in Fc,l.ajax=Fc=!!Fc,o.ajaxTransport(function(a){var b;return l.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort"),f.send(a.hasContent&&a.data||null)},abort:function(){b&&b()}}:void 0}),o.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return o.globalEval(a),a}}}),o.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),o.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=o("
+
+
+
+
+
+
+
+
+
+
+ Unit tests: current document .
+
+
+ Performance tests: See Performance pane in docs .
+
+
+ Property support tests: Run the Property Support pane's auto-cycler .
+
+
+ Visual tests: See demo . Read demo's source for intended behavior.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/velocity/test/jquery-1.11.1.js b/dashboard-ui/bower_components/velocity/test/jquery-1.11.1.js
new file mode 100644
index 0000000000..996315eb45
--- /dev/null
+++ b/dashboard-ui/bower_components/velocity/test/jquery-1.11.1.js
@@ -0,0 +1,10308 @@
+/*!
+ * jQuery JavaScript Library v1.11.1
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2014-05-01T17:42Z
+ */
+
+(function( global, factory ) {
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+ // For CommonJS and CommonJS-like environments where a proper window is present,
+ // execute the factory and get jQuery
+ // For environments that do not inherently posses a window with a document
+ // (such as Node.js), expose a jQuery-making factory as module.exports
+ // This accentuates the need for the creation of a real window
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Can't do this because several apps including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+// Support: Firefox 18+
+//
+
+var deletedIds = [];
+
+var slice = deletedIds.slice;
+
+var concat = deletedIds.concat;
+
+var push = deletedIds.push;
+
+var indexOf = deletedIds.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var support = {};
+
+
+
+var
+ version = "1.11.1",
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ // Need init if jQuery is called (just allow error to be thrown if not included)
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Support: Android<4.1, IE<9
+ // Make sure we trim BOM and NBSP
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn = jQuery.prototype = {
+ // The current version of jQuery being used
+ jquery: version,
+
+ constructor: jQuery,
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num != null ?
+
+ // Return just the one element from the set
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
+
+ // Return all the elements in a clean array
+ slice.call( this );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: deletedIds.sort,
+ splice: deletedIds.splice
+};
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var src, copyIsArray, copy, name, options, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+
+ // skip the boolean and the target
+ target = arguments[ i ] || {};
+ i++;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( i === length ) {
+ target = this;
+ i--;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
+
+ // Assume jQuery is ready without the ready module
+ isReady: true,
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ noop: function() {},
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ isWindow: function( obj ) {
+ /* jshint eqeqeq: false */
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ isPlainObject: function( obj ) {
+ var key;
+
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Support: IE<9
+ // Handle iteration over inherited properties before own properties.
+ if ( support.ownLast ) {
+ for ( key in obj ) {
+ return hasOwn.call( obj, key );
+ }
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call(obj) ] || "object" :
+ typeof obj;
+ },
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && jQuery.trim( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var value,
+ i = 0,
+ length = obj.length,
+ isArray = isArraylike( obj );
+
+ if ( args ) {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Support: Android<4.1, IE<9
+ trim: function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArraylike( Object(arr) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ var len;
+
+ if ( arr ) {
+ if ( indexOf ) {
+ return indexOf.call( arr, elem, i );
+ }
+
+ len = arr.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in arr && arr[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var len = +second.length,
+ j = 0,
+ i = first.length;
+
+ while ( j < len ) {
+ first[ i++ ] = second[ j++ ];
+ }
+
+ // Support: IE<9
+ // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
+ if ( len !== len ) {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, invert ) {
+ var callbackInverse,
+ matches = [],
+ i = 0,
+ length = elems.length,
+ callbackExpect = !invert;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ callbackInverse = !callback( elems[ i ], i );
+ if ( callbackInverse !== callbackExpect ) {
+ matches.push( elems[ i ] );
+ }
+ }
+
+ return matches;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value,
+ i = 0,
+ length = elems.length,
+ isArray = isArraylike( elems ),
+ ret = [];
+
+ // Go through the array, translating each of the items to their new values
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var args, proxy, tmp;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: function() {
+ return +( new Date() );
+ },
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+ var length = obj.length,
+ type = jQuery.type( obj );
+
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.nodeType === 1 && length ) {
+ return true;
+ }
+
+ return type === "array" || length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
+}
+var Sizzle =
+/*!
+ * Sizzle CSS Selector Engine v1.10.19
+ * http://sizzlejs.com/
+ *
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2014-04-18
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ tokenize,
+ compile,
+ select,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf if we can't use a native one
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
+ // Operator (capture 2)
+ "*([*^$|!~]?=)" + whitespace +
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+ "*\\]",
+
+ pseudos = ":(" + characterEncoding + ")(?:\\((" +
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+ // 1. quoted (capture 3; capture 4 or capture 5)
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+ // 2. simple (capture 6)
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+ // 3. anything else (capture 2)
+ ".*" +
+ ")\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox<24
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ // BMP codepoint
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ // Shortcuts
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document (jQuery #6963)
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== strundefined && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare,
+ doc = node ? node.ownerDocument || node : preferredDoc,
+ parent = doc.defaultView;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+
+ // Support tests
+ documentIsHTML = !isXML( doc );
+
+ // Support: IE>8
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+ // IE6-8 do not support the defaultView property so parent will be undefined
+ if ( parent && parent !== parent.top ) {
+ // IE11 does not have attachEvent, so all must suffer
+ if ( parent.addEventListener ) {
+ parent.addEventListener( "unload", function() {
+ setDocument();
+ }, false );
+ } else if ( parent.attachEvent ) {
+ parent.attachEvent( "onunload", function() {
+ setDocument();
+ });
+ }
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Check if getElementsByClassName can be trusted
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
+ div.innerHTML = "
";
+
+ // Support: Safari<4
+ // Catch class over-caching
+ div.firstChild.className = "i";
+ // Support: Opera<10
+ // Catch gEBCN failure to find non-leading classes
+ return div.getElementsByClassName("i").length === 2;
+ });
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [ m ] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = " ";
+
+ // Support: IE8, Opera 11-12.16
+ // Nothing should be selected when empty strings follow ^= or $= or *=
+ // The test attribute must be unknown in Opera but "safe" for WinRT
+ // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+ if ( div.querySelectorAll("[msallowclip^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE8
+ // Enforce case-sensitivity of name attribute
+ if ( div.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+ docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendent
+ // As in, an element does not contain itself
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ // Sort on method existence if only one input has compareDocumentPosition
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ // Calculate position if both inputs belong to the same document
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ // Otherwise we know they are disconnected
+ 1;
+
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Parentless nodes are either documents or disconnected
+ if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ // Clear input after sorting to release objects
+ // See https://github.com/jquery/sizzle/pull/225
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ while ( (node = elem[i++]) ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (jQuery #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[6] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] ) {
+ match[2] = match[4] || match[5] || "";
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+ // but not by others (comment: 8; processing instruction: 7; etc.)
+ // nodeType < 6 works because attributes (2) do not appear as children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ // Support: IE<8
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var oldCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (oldCache = outerCache[ dir ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ // Assign to newCache so results back-propagate to previous elements
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ // Reuse newcache so results back-propagate to previous elements
+ outerCache[ dir ] = newCache;
+
+ // A match means we're done; a fail means we have to keep checking
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ // We must always have either seed elements or outermost context
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ // Support: IE<9, Safari
+ // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !match ) {
+ match = tokenize( selector );
+ }
+ i = match.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( match[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+ // Save selector and tokenization
+ cached.selector = selector;
+ }
+ return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ * selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ * selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ compiled = typeof selector === "function" && selector,
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+ results = results || [];
+
+ // Try to minimize operations if there is no seed and only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+
+ // Precompiled matchers will still verify ancestry, so step up a level
+ } else if ( compiled ) {
+ context = context.parentNode;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function if one is not provided
+ // Provide `match` to avoid retokenization if we modified the selector above
+ ( compiled || compile( selector, match ) )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome<14
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = " ";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = " ";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+return Sizzle;
+
+})( window );
+
+
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+
+var rneedsContext = jQuery.expr.match.needsContext;
+
+var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
+
+
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ /* jshint -W018 */
+ return !!qualifier.call( elem, i, elem ) !== not;
+ });
+
+ }
+
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ });
+
+ }
+
+ if ( typeof qualifier === "string" ) {
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+
+ return jQuery.grep( elements, function( elem ) {
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
+ });
+}
+
+jQuery.filter = function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 && elem.nodeType === 1 ?
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ }));
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var i,
+ ret = [],
+ self = this,
+ len = self.length;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ }) );
+ }
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
+ return ret;
+ },
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], false) );
+ },
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], true) );
+ },
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ }
+});
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ init = jQuery.fn.init = function( selector, context ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+
+ // scripts is true for back-compat
+ // Intentionally let the error be thrown if parseHTML is not present
+ jQuery.merge( this, jQuery.parseHTML(
+ match[1],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return typeof rootjQuery.ready !== "undefined" ?
+ rootjQuery.ready( selector ) :
+ // Execute immediately if ready is not present
+ selector( jQuery );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ };
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.extend({
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+jQuery.fn.extend({
+ has: function( target ) {
+ var i,
+ targets = jQuery( target, this ),
+ len = targets.length;
+
+ return this.filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && (pos ?
+ pos.index(cur) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector(cur, selectors)) ) {
+
+ matched.push( cur );
+ break;
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ return this.pushStack(
+ jQuery.unique(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter(selector)
+ );
+ }
+});
+
+function sibling( cur, dir ) {
+ do {
+ cur = cur[ dir ];
+ } while ( cur && cur.nodeType !== 1 );
+
+ return cur;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ if ( this.length > 1 ) {
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ ret = jQuery.unique( ret );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+ }
+
+ return this.pushStack( ret );
+ };
+});
+var rnotwhite = (/\S+/g);
+
+
+
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ firingLength = 0;
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( list && ( !fired || stack ) ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[0] ] = function() {
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+ if ( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+
+ } else if ( !(--remaining) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+
+
+// The deferred used on DOM ready
+var readyList;
+
+jQuery.fn.ready = function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+};
+
+jQuery.extend({
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ jQuery( document ).off( "ready" );
+ }
+ }
+});
+
+/**
+ * Clean-up method for dom ready events
+ */
+function detach() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", completed, false );
+ window.removeEventListener( "load", completed, false );
+
+ } else {
+ document.detachEvent( "onreadystatechange", completed );
+ window.detachEvent( "onload", completed );
+ }
+}
+
+/**
+ * The ready event handler and self cleanup method
+ */
+function completed() {
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
+ detach();
+ jQuery.ready();
+ }
+}
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready );
+
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed, false );
+
+ // If IE event model is used
+ } else {
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", completed );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", completed );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
+
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch(e) {}
+
+ if ( top && top.doScroll ) {
+ (function doScrollCheck() {
+ if ( !jQuery.isReady ) {
+
+ try {
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll("left");
+ } catch(e) {
+ return setTimeout( doScrollCheck, 50 );
+ }
+
+ // detach all dom ready events
+ detach();
+
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ })();
+ }
+ }
+ }
+ return readyList.promise( obj );
+};
+
+
+var strundefined = typeof undefined;
+
+
+
+// Support: IE<9
+// Iteration over object's inherited properties before its own
+var i;
+for ( i in jQuery( support ) ) {
+ break;
+}
+support.ownLast = i !== "0";
+
+// Note: most support tests are defined in their respective modules.
+// false until the test is run
+support.inlineBlockNeedsLayout = false;
+
+// Execute ASAP in case we need to set body.style.zoom
+jQuery(function() {
+ // Minified: var a,b,c,d
+ var val, div, body, container;
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body || !body.style ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ // Setup
+ div = document.createElement( "div" );
+ container = document.createElement( "div" );
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+ body.appendChild( container ).appendChild( div );
+
+ if ( typeof div.style.zoom !== strundefined ) {
+ // Support: IE<8
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
+
+ support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
+ if ( val ) {
+ // Prevent IE 6 from affecting layout for positioned elements #11048
+ // Prevent IE from shrinking the body in IE 7 mode #12869
+ // Support: IE<8
+ body.style.zoom = 1;
+ }
+ }
+
+ body.removeChild( container );
+});
+
+
+
+
+(function() {
+ var div = document.createElement( "div" );
+
+ // Execute the test only if not already executed in another module.
+ if (support.deleteExpando == null) {
+ // Support: IE<9
+ support.deleteExpando = true;
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+ }
+
+ // Null elements to avoid leaks in IE.
+ div = null;
+})();
+
+
+/**
+ * Determines whether an object can have data
+ */
+jQuery.acceptData = function( elem ) {
+ var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
+ nodeType = +elem.nodeType || 1;
+
+ // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
+ return nodeType !== 1 && nodeType !== 9 ?
+ false :
+
+ // Nodes accept data unless otherwise specified; rejection can be conditional
+ !noData || noData !== true && elem.getAttribute("classid") === noData;
+};
+
+
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ var name;
+ for ( name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var ret, thisCache,
+ internalKey = jQuery.expando,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ // Avoid exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( typeof name === "string" ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+}
+
+function internalRemoveData( elem, name, pvt ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i,
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split(" ");
+ }
+ }
+ } else {
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
+ return;
+ }
+ }
+
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ /* jshint eqeqeq: false */
+ } else if ( support.deleteExpando || cache != cache.window ) {
+ /* jshint eqeqeq: true */
+ delete cache[ id ];
+
+ // When all else fails, null
+ } else {
+ cache[ id ] = null;
+ }
+}
+
+jQuery.extend({
+ cache: {},
+
+ // The following elements (space-suffixed to avoid Object.prototype collisions)
+ // throw uncatchable exceptions if you attempt to set expando properties
+ noData: {
+ "applet ": true,
+ "embed ": true,
+ // ...but Flash objects (which have this classid) *can* handle expandos
+ "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return internalData( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ return internalRemoveData( elem, name );
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return internalData( elem, name, data, true );
+ },
+
+ _removeData: function( elem, name ) {
+ return internalRemoveData( elem, name, true );
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var i, name, data,
+ elem = this[0],
+ attrs = elem && elem.attributes;
+
+ // Special expections of .data basically thwart jQuery.access,
+ // so implement the relevant behavior ourselves
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ i = attrs.length;
+ while ( i-- ) {
+
+ // Support: IE11+
+ // The attrs elements can be null (#14894)
+ if ( attrs[ i ] ) {
+ name = attrs[ i ].name;
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.slice(5) );
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ return arguments.length > 1 ?
+
+ // Sets one value
+ this.each(function() {
+ jQuery.data( this, key, value );
+ }) :
+
+ // Gets one value
+ // Try to fetch any internally stored data first
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray(data) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ jQuery._removeData( elem, type + "queue" );
+ jQuery._removeData( elem, key );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while ( i-- ) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHidden = function( elem, el ) {
+ // isHidden might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+ };
+
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ length = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < length; i++ ) {
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+};
+var rcheckableType = (/^(?:checkbox|radio)$/i);
+
+
+
+(function() {
+ // Minified: var a,b,c
+ var input = document.createElement( "input" ),
+ div = document.createElement( "div" ),
+ fragment = document.createDocumentFragment();
+
+ // Setup
+ div.innerHTML = " a ";
+
+ // IE strips leading whitespace when .innerHTML is used
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ support.tbody = !div.getElementsByTagName( "tbody" ).length;
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ support.html5Clone =
+ document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>";
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ input.type = "checkbox";
+ input.checked = true;
+ fragment.appendChild( input );
+ support.appendChecked = input.checked;
+
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ // Support: IE6-IE11+
+ div.innerHTML = "";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ fragment.appendChild( div );
+ div.innerHTML = " ";
+
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
+ // old WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<9
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+ support.noCloneEvent = true;
+ if ( div.attachEvent ) {
+ div.attachEvent( "onclick", function() {
+ support.noCloneEvent = false;
+ });
+
+ div.cloneNode( true ).click();
+ }
+
+ // Execute the test only if not already executed in another module.
+ if (support.deleteExpando == null) {
+ // Support: IE<9
+ support.deleteExpando = true;
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+ }
+})();
+
+
+(function() {
+ var i, eventName,
+ div = document.createElement( "div" );
+
+ // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
+ for ( i in { submit: true, change: true, focusin: true }) {
+ eventName = "on" + i;
+
+ if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+ div.setAttribute( eventName, "t" );
+ support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
+ }
+ }
+
+ // Null elements to avoid leaks in IE.
+ div = null;
+})();
+
+
+var rformElems = /^(?:input|select|textarea)$/i,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+ var tmp, events, t, handleObjIn,
+ special, eventHandle, handleObj,
+ handlers, type, namespaces, origType,
+ elemData = jQuery._data( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !(events = elemData.events) ) {
+ events = elemData.events = {};
+ }
+ if ( !(eventHandle = elemData.handle) ) {
+ eventHandle = elemData.handle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !(handlers = events[ type ]) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+ var j, handleObj, tmp,
+ origCount, t, events,
+ special, handlers, type,
+ namespaces, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery._removeData( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ var handle, ontype, cur,
+ bubbleType, special, tmp, i,
+ eventPath = [ elem || document ],
+ type = hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf(":") < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === (elem.ownerDocument || document) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
+ event.result = handle.apply( cur, data );
+ if ( event.result === false ) {
+ event.preventDefault();
+ }
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+ jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ try {
+ elem[ type ]();
+ } catch ( e ) {
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+ }
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, ret, handleObj, matched, j,
+ handlerQueue = [],
+ args = slice.call( arguments ),
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( (event.result = ret) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var sel, handleObj, matches, i,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ // Black-hole SVG instance trees (#13180)
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+
+ /* jshint eqeqeq: false */
+ for ( ; cur != this; cur = cur.parentNode || this ) {
+ /* jshint eqeqeq: true */
+
+ // Don't check non-elements (#13208)
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matches[ sel ] === undefined ) {
+ matches[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matches[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, handlers: matches });
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
+ }
+
+ return handlerQueue;
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop, copy,
+ type = event.type,
+ originalEvent = event,
+ fixHook = this.fixHooks[ type ];
+
+ if ( !fixHook ) {
+ this.fixHooks[ type ] = fixHook =
+ rmouseEvent.test( type ) ? this.mouseHooks :
+ rkeyEvent.test( type ) ? this.keyHooks :
+ {};
+ }
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = new jQuery.Event( originalEvent );
+
+ i = copy.length;
+ while ( i-- ) {
+ prop = copy[ i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Support: IE<9
+ // Fix target property (#1925)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Support: Chrome 23+, Safari?
+ // Target should not be a text node (#504, #13143)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Support: IE<9
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
+ event.metaKey = !!event.metaKey;
+
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var body, eventDoc, doc,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ special: {
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ try {
+ this.focus();
+ return false;
+ } catch ( e ) {
+ // Support: IE<9
+ // If we error on focus to hidden element (#1486, #12518),
+ // let .trigger() run the handlers
+ }
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return jQuery.nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Support: Firefox 20+
+ // Firefox doesn't alert if the returnValue field is not set.
+ if ( event.result !== undefined && event.originalEvent ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ {
+ type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ var name = "on" + type;
+
+ if ( elem.detachEvent ) {
+
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
+ if ( typeof elem[ name ] === strundefined ) {
+ elem[ name ] = null;
+ }
+
+ elem.detachEvent( name, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = src.defaultPrevented ||
+ src.defaultPrevented === undefined &&
+ // Support: IE < 9, Android < 4.0
+ src.returnValue === false ?
+ returnTrue :
+ returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+ if ( !e ) {
+ return;
+ }
+
+ // If preventDefault exists, run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // Support: IE
+ // Otherwise set the returnValue property of the original event to false
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+ if ( !e ) {
+ return;
+ }
+ // If stopPropagation exists, run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+
+ // Support: IE
+ // Set the cancelBubble property of the original event to true
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ var e = this.originalEvent;
+
+ this.isImmediatePropagationStopped = returnTrue;
+
+ if ( e && e.stopImmediatePropagation ) {
+ e.stopImmediatePropagation();
+ }
+
+ this.stopPropagation();
+ }
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout",
+ pointerenter: "pointerover",
+ pointerleave: "pointerout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// IE submit delegation
+if ( !support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+ if ( form && !jQuery._data( form, "submitBubbles" ) ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ event._submit_bubble = true;
+ });
+ jQuery._data( form, "submitBubbles", true );
+ }
+ });
+ // return undefined since we don't need an event listener
+ },
+
+ postDispatch: function( event ) {
+ // If form was submitted by the user, bubble the event up the tree
+ if ( event._submit_bubble ) {
+ delete event._submit_bubble;
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ }
+ },
+
+ teardown: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !support.changeBubbles ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._just_changed = true;
+ }
+ });
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._just_changed && !event.isTrigger ) {
+ this._just_changed = false;
+ }
+ // Allow triggered, simulated change events (#11500)
+ jQuery.event.simulate( "change", this, event, true );
+ });
+ }
+ return false;
+ }
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+ jQuery.event.simulate( "change", this.parentNode, event, true );
+ }
+ });
+ jQuery._data( elem, "changeBubbles", true );
+ }
+ });
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return !rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Create "bubbling" focus and blur events
+if ( !support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler on the document while someone wants focusin/focusout
+ var handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ var doc = this.ownerDocument || this,
+ attaches = jQuery._data( doc, fix );
+
+ if ( !attaches ) {
+ doc.addEventListener( orig, handler, true );
+ }
+ jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
+ },
+ teardown: function() {
+ var doc = this.ownerDocument || this,
+ attaches = jQuery._data( doc, fix ) - 1;
+
+ if ( !attaches ) {
+ doc.removeEventListener( orig, handler, true );
+ jQuery._removeData( doc, fix );
+ } else {
+ jQuery._data( doc, fix, attaches );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var type, origFn;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on( types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ var elem = this[0];
+ if ( elem ) {
+ return jQuery.event.trigger( type, data, elem, true );
+ }
+ }
+});
+
+
+function createSafeFragment( document ) {
+ var list = nodeNames.split( "|" ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+ rtagName = /<([\w:]+)/,
+ rtbody = /\s*$/g,
+
+ // We have to close these tags to support XHTML (#13200)
+ wrapMap = {
+ option: [ 1, "", " " ],
+ legend: [ 1, "", " " ],
+ area: [ 1, "", " " ],
+ param: [ 1, "", " " ],
+ thead: [ 1, "" ],
+ tr: [ 2, "" ],
+ col: [ 2, "" ],
+ td: [ 3, "" ],
+
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+ // unless wrapped in a div with non-breaking characters in front of it.
+ _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X", "
" ]
+ },
+ safeFragment = createSafeFragment( document ),
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+function getAll( context, tag ) {
+ var elems, elem,
+ i = 0,
+ found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
+ typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
+ undefined;
+
+ if ( !found ) {
+ for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
+ found.push( elem );
+ } else {
+ jQuery.merge( found, getAll( elem, tag ) );
+ }
+ }
+ }
+
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+ jQuery.merge( [ context ], found ) :
+ found;
+}
+
+// Used in buildFragment, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( rcheckableType.test( elem.type ) ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+
+// Support: IE<8
+// Manipulating tables requires a tbody
+function manipulationTarget( elem, content ) {
+ return jQuery.nodeName( elem, "table" ) &&
+ jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
+
+ elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
+ elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+ elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
+ return elem;
+}
+function restoreScript( elem ) {
+ var match = rscriptTypeMasked.exec( elem.type );
+ if ( match ) {
+ elem.type = match[1];
+ } else {
+ elem.removeAttribute("type");
+ }
+ return elem;
+}
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var elem,
+ i = 0;
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
+ }
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function fixCloneNodeIssues( src, dest ) {
+ var nodeName, e, data;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
+ if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
+ data = jQuery._data( dest );
+
+ for ( e in data.events ) {
+ jQuery.removeEvent( dest, e, data.handle );
+ }
+
+ // Event data gets referenced instead of copied if the expando gets copied too
+ dest.removeAttribute( jQuery.expando );
+ }
+
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
+ if ( nodeName === "script" && dest.text !== src.text ) {
+ disableScript( dest ).text = src.text;
+ restoreScript( dest );
+
+ // IE6-10 improperly clones children of object elements using classid.
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
+ } else if ( nodeName === "object" ) {
+ if ( dest.parentNode ) {
+ dest.outerHTML = src.outerHTML;
+ }
+
+ // This path appears unavoidable for IE9. When cloning an object
+ // element in IE9, the outerHTML strategy above is not sufficient.
+ // If the src has innerHTML and the destination does not,
+ // copy the src.innerHTML into the dest.innerHTML. #10324
+ if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
+ dest.innerHTML = src.innerHTML;
+ }
+
+ } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+
+ dest.defaultChecked = dest.checked = src.checked;
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.defaultSelected = dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var destElements, node, clone, i, srcElements,
+ inPage = jQuery.contains( elem.ownerDocument, elem );
+
+ if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+ clone = elem.cloneNode( true );
+
+ // IE<=8 does not properly clone detached, unknown element nodes
+ } else {
+ fragmentDiv.innerHTML = elem.outerHTML;
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+ }
+
+ if ( (!support.noCloneEvent || !support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+ destElements = getAll( clone );
+ srcElements = getAll( elem );
+
+ // Fix all IE cloning issues
+ for ( i = 0; (node = srcElements[i]) != null; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ fixCloneNodeIssues( node, destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ if ( deepDataAndEvents ) {
+ srcElements = srcElements || getAll( elem );
+ destElements = destElements || getAll( clone );
+
+ for ( i = 0; (node = srcElements[i]) != null; i++ ) {
+ cloneCopyEvent( node, destElements[i] );
+ }
+ } else {
+ cloneCopyEvent( elem, clone );
+ }
+ }
+
+ // Preserve script evaluation history
+ destElements = getAll( clone, "script" );
+ if ( destElements.length > 0 ) {
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+ }
+
+ destElements = srcElements = node = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ buildFragment: function( elems, context, scripts, selection ) {
+ var j, elem, contains,
+ tmp, tag, tbody, wrap,
+ l = elems.length,
+
+ // Ensure a safe fragment
+ safe = createSafeFragment( context ),
+
+ nodes = [],
+ i = 0;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || safe.appendChild( context.createElement("div") );
+
+ // Deserialize a standard representation
+ tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>$2>" ) + wrap[2];
+
+ // Descend through wrappers to the right content
+ j = wrap[0];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Manually add leading whitespace removed by IE
+ if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
+ }
+
+ // Remove IE's autoinserted from table fragments
+ if ( !support.tbody ) {
+
+ // String was a , *may* have spurious
+ elem = tag === "table" && !rtbody.test( elem ) ?
+ tmp.firstChild :
+
+ // String was a bare or
+ wrap[1] === "" && !rtbody.test( elem ) ?
+ tmp :
+ 0;
+
+ j = elem && elem.childNodes.length;
+ while ( j-- ) {
+ if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
+ elem.removeChild( tbody );
+ }
+ }
+ }
+
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Fix #12392 for WebKit and IE > 9
+ tmp.textContent = "";
+
+ // Fix #12392 for oldIE
+ while ( tmp.firstChild ) {
+ tmp.removeChild( tmp.firstChild );
+ }
+
+ // Remember the top-level container for proper cleanup
+ tmp = safe.lastChild;
+ }
+ }
+ }
+
+ // Fix #11356: Clear elements from fragment
+ if ( tmp ) {
+ safe.removeChild( tmp );
+ }
+
+ // Reset defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ if ( !support.appendChecked ) {
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
+ }
+
+ i = 0;
+ while ( (elem = nodes[ i++ ]) ) {
+
+ // #4087 - If origin and destination elements are the same, and this is
+ // that element, do not do anything
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( safe.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( (elem = tmp[ j++ ]) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ tmp = null;
+
+ return safe;
+ },
+
+ cleanData: function( elems, /* internal */ acceptData ) {
+ var elem, type, id, data,
+ i = 0,
+ internalKey = jQuery.expando,
+ cache = jQuery.cache,
+ deleteExpando = support.deleteExpando,
+ special = jQuery.event.special;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( acceptData || jQuery.acceptData( elem ) ) {
+
+ id = elem[ internalKey ];
+ data = id && cache[ id ];
+
+ if ( data ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ // Remove cache only if it was not already removed by jQuery.event.remove
+ if ( cache[ id ] ) {
+
+ delete cache[ id ];
+
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( deleteExpando ) {
+ delete elem[ internalKey ];
+
+ } else if ( typeof elem.removeAttribute !== strundefined ) {
+ elem.removeAttribute( internalKey );
+
+ } else {
+ elem[ internalKey ] = null;
+ }
+
+ deletedIds.push( id );
+ }
+ }
+ }
+ }
+ }
+});
+
+jQuery.fn.extend({
+ text: function( value ) {
+ return access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+ }, null, value, arguments.length );
+ },
+
+ append: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.insertBefore( elem, target.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this );
+ }
+ });
+ },
+
+ after: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ }
+ });
+ },
+
+ remove: function( selector, keepData /* Internal Use Only */ ) {
+ var elem,
+ elems = selector ? jQuery.filter( selector, this ) : this,
+ i = 0;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem ) );
+ }
+
+ if ( elem.parentNode ) {
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
+ setGlobalEval( getAll( elem, "script" ) );
+ }
+ elem.parentNode.removeChild( elem );
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+
+ // If this is a select, ensure that it displays empty (#12336)
+ // Support: IE<9
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
+ elem.options.length = 0;
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map(function() {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ return access( this, function( value ) {
+ var elem = this[ 0 ] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined ) {
+ return elem.nodeType === 1 ?
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
+ undefined;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
+ ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+ !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
+
+ value = value.replace( rxhtmlTag, "<$1>$2>" );
+
+ try {
+ for (; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ elem = this[i] || {};
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function() {
+ var arg = arguments[ 0 ];
+
+ // Make the changes, replacing each context element with the new content
+ this.domManip( arguments, function( elem ) {
+ arg = this.parentNode;
+
+ jQuery.cleanData( getAll( this ) );
+
+ if ( arg ) {
+ arg.replaceChild( elem, this );
+ }
+ });
+
+ // Force removal if there was no new content (e.g., from empty arguments)
+ return arg && (arg.length || arg.nodeType) ? this : this.remove();
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, callback ) {
+
+ // Flatten any nested arrays
+ args = concat.apply( [], args );
+
+ var first, node, hasScripts,
+ scripts, doc, fragment,
+ i = 0,
+ l = this.length,
+ set = this,
+ iNoClone = l - 1,
+ value = args[0],
+ isFunction = jQuery.isFunction( value );
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( isFunction ||
+ ( l > 1 && typeof value === "string" &&
+ !support.checkClone && rchecked.test( value ) ) ) {
+ return this.each(function( index ) {
+ var self = set.eq( index );
+ if ( isFunction ) {
+ args[0] = value.call( this, index, self.html() );
+ }
+ self.domManip( args, callback );
+ });
+ }
+
+ if ( l ) {
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ if ( first ) {
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+ hasScripts = scripts.length;
+
+ // Use the original fragment for the last item instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ for ( ; i < l; i++ ) {
+ node = fragment;
+
+ if ( i !== iNoClone ) {
+ node = jQuery.clone( node, true, true );
+
+ // Keep references to cloned scripts for later restoration
+ if ( hasScripts ) {
+ jQuery.merge( scripts, getAll( node, "script" ) );
+ }
+ }
+
+ callback.call( this[i], node, i );
+ }
+
+ if ( hasScripts ) {
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+ // Reenable scripts
+ jQuery.map( scripts, restoreScript );
+
+ // Evaluate executable scripts on first document insertion
+ for ( i = 0; i < hasScripts; i++ ) {
+ node = scripts[ i ];
+ if ( rscriptType.test( node.type || "" ) &&
+ !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
+
+ if ( node.src ) {
+ // Optional AJAX dependency, but won't run scripts if not present
+ if ( jQuery._evalUrl ) {
+ jQuery._evalUrl( node.src );
+ }
+ } else {
+ jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
+ }
+ }
+ }
+ }
+
+ // Fix #11809: Avoid leaking memory
+ fragment = first = null;
+ }
+ }
+
+ return this;
+ }
+});
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ i = 0,
+ ret = [],
+ insert = jQuery( selector ),
+ last = insert.length - 1;
+
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone(true);
+ jQuery( insert[i] )[ original ]( elems );
+
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+ push.apply( ret, elems.get() );
+ }
+
+ return this.pushStack( ret );
+ };
+});
+
+
+var iframe,
+ elemdisplay = {};
+
+/**
+ * Retrieve the actual display of a element
+ * @param {String} name nodeName of the element
+ * @param {Object} doc Document object
+ */
+// Called only from within defaultDisplay
+function actualDisplay( name, doc ) {
+ var style,
+ elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+
+ // getDefaultComputedStyle might be reliably used only on attached element
+ display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
+
+ // Use of this method is a temporary fix (more like optmization) until something better comes along,
+ // since it was removed from specification and supported only in FF
+ style.display : jQuery.css( elem[ 0 ], "display" );
+
+ // We don't have any data stored on the element,
+ // so use "detach" method as fast way to get rid of the element
+ elem.detach();
+
+ return display;
+}
+
+/**
+ * Try to determine the default display value of an element
+ * @param {String} nodeName
+ */
+function defaultDisplay( nodeName ) {
+ var doc = document,
+ display = elemdisplay[ nodeName ];
+
+ if ( !display ) {
+ display = actualDisplay( nodeName, doc );
+
+ // If the simple way fails, read from inside an iframe
+ if ( display === "none" || !display ) {
+
+ // Use the already-created iframe if possible
+ iframe = (iframe || jQuery( "" )).appendTo( doc.documentElement );
+
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+ doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
+
+ // Support: IE
+ doc.write();
+ doc.close();
+
+ display = actualDisplay( nodeName, doc );
+ iframe.detach();
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return display;
+}
+
+
+(function() {
+ var shrinkWrapBlocksVal;
+
+ support.shrinkWrapBlocks = function() {
+ if ( shrinkWrapBlocksVal != null ) {
+ return shrinkWrapBlocksVal;
+ }
+
+ // Will be changed later if needed.
+ shrinkWrapBlocksVal = false;
+
+ // Minified: var b,c,d
+ var div, body, container;
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body || !body.style ) {
+ // Test fired too early or in an unsupported environment, exit.
+ return;
+ }
+
+ // Setup
+ div = document.createElement( "div" );
+ container = document.createElement( "div" );
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+ body.appendChild( container ).appendChild( div );
+
+ // Support: IE6
+ // Check if elements with layout shrink-wrap their children
+ if ( typeof div.style.zoom !== strundefined ) {
+ // Reset CSS: box-sizing; display; margin; border
+ div.style.cssText =
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+ "box-sizing:content-box;display:block;margin:0;border:0;" +
+ "padding:1px;width:1px;zoom:1";
+ div.appendChild( document.createElement( "div" ) ).style.width = "5px";
+ shrinkWrapBlocksVal = div.offsetWidth !== 3;
+ }
+
+ body.removeChild( container );
+
+ return shrinkWrapBlocksVal;
+ };
+
+})();
+var rmargin = (/^margin/);
+
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
+
+
+
+var getStyles, curCSS,
+ rposition = /^(top|right|bottom|left)$/;
+
+if ( window.getComputedStyle ) {
+ getStyles = function( elem ) {
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ };
+
+ curCSS = function( elem, name, computed ) {
+ var width, minWidth, maxWidth, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
+
+ if ( computed ) {
+
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+ // Remember the original values
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ // Put in the new values to get a computed value out
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ // Revert the changed values
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ return ret === undefined ?
+ ret :
+ ret + "";
+ };
+} else if ( document.documentElement.currentStyle ) {
+ getStyles = function( elem ) {
+ return elem.currentStyle;
+ };
+
+ curCSS = function( elem, name, computed ) {
+ var left, rs, rsLeft, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+ ret = computed ? computed[ name ] : undefined;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret == null && style && style[ name ] ) {
+ ret = style[ name ];
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // but not position css attributes, as those are proportional to the parent element instead
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rs = elem.runtimeStyle;
+ rsLeft = rs && rs.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ rs.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ret;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ rs.left = rsLeft;
+ }
+ }
+
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ return ret === undefined ?
+ ret :
+ ret + "" || "auto";
+ };
+}
+
+
+
+
+function addGetHookIf( conditionFn, hookFn ) {
+ // Define the hook, we'll check on the first run if it's really needed.
+ return {
+ get: function() {
+ var condition = conditionFn();
+
+ if ( condition == null ) {
+ // The test was not ready at this point; screw the hook this time
+ // but check again when needed next time.
+ return;
+ }
+
+ if ( condition ) {
+ // Hook not needed (or it's not possible to use it due to missing dependency),
+ // remove it.
+ // Since there are no other hooks for marginRight, remove the whole object.
+ delete this.get;
+ return;
+ }
+
+ // Hook needed; redefine it so that the support test is not executed again.
+
+ return (this.get = hookFn).apply( this, arguments );
+ }
+ };
+}
+
+
+(function() {
+ // Minified: var b,c,d,e,f,g, h,i
+ var div, style, a, pixelPositionVal, boxSizingReliableVal,
+ reliableHiddenOffsetsVal, reliableMarginRightVal;
+
+ // Setup
+ div = document.createElement( "div" );
+ div.innerHTML = " a ";
+ a = div.getElementsByTagName( "a" )[ 0 ];
+ style = a && a.style;
+
+ // Finish early in limited (non-browser) environments
+ if ( !style ) {
+ return;
+ }
+
+ style.cssText = "float:left;opacity:.5";
+
+ // Support: IE<9
+ // Make sure that element opacity exists (as opposed to filter)
+ support.opacity = style.opacity === "0.5";
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ support.cssFloat = !!style.cssFloat;
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
+ style.WebkitBoxSizing === "";
+
+ jQuery.extend(support, {
+ reliableHiddenOffsets: function() {
+ if ( reliableHiddenOffsetsVal == null ) {
+ computeStyleTests();
+ }
+ return reliableHiddenOffsetsVal;
+ },
+
+ boxSizingReliable: function() {
+ if ( boxSizingReliableVal == null ) {
+ computeStyleTests();
+ }
+ return boxSizingReliableVal;
+ },
+
+ pixelPosition: function() {
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return pixelPositionVal;
+ },
+
+ // Support: Android 2.3
+ reliableMarginRight: function() {
+ if ( reliableMarginRightVal == null ) {
+ computeStyleTests();
+ }
+ return reliableMarginRightVal;
+ }
+ });
+
+ function computeStyleTests() {
+ // Minified: var b,c,d,j
+ var div, body, container, contents;
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body || !body.style ) {
+ // Test fired too early or in an unsupported environment, exit.
+ return;
+ }
+
+ // Setup
+ div = document.createElement( "div" );
+ container = document.createElement( "div" );
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+ body.appendChild( container ).appendChild( div );
+
+ div.style.cssText =
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
+ "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
+ "border:1px;padding:1px;width:4px;position:absolute";
+
+ // Support: IE<9
+ // Assume reasonable values in the absence of getComputedStyle
+ pixelPositionVal = boxSizingReliableVal = false;
+ reliableMarginRightVal = true;
+
+ // Check for getComputedStyle so that this code is not run in IE<9.
+ if ( window.getComputedStyle ) {
+ pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ boxSizingReliableVal =
+ ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+ // Support: Android 2.3
+ // Div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container (#3333)
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ contents = div.appendChild( document.createElement( "div" ) );
+
+ // Reset CSS: box-sizing; display; margin; border; padding
+ contents.style.cssText = div.style.cssText =
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+ "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
+ contents.style.marginRight = contents.style.width = "0";
+ div.style.width = "1px";
+
+ reliableMarginRightVal =
+ !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
+ }
+
+ // Support: IE8
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ div.innerHTML = "";
+ contents = div.getElementsByTagName( "td" );
+ contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+ if ( reliableHiddenOffsetsVal ) {
+ contents[ 0 ].style.display = "";
+ contents[ 1 ].style.display = "none";
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+ }
+
+ body.removeChild( container );
+ }
+
+})();
+
+
+// A method for quickly swapping in/out CSS properties to get correct calculations.
+jQuery.swap = function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+};
+
+
+var
+ ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity\s*=\s*([^)]*)/,
+
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
+ rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: "0",
+ fontWeight: "400"
+ },
+
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+ // shortcut for names that are not vendor prefixed
+ if ( name in style ) {
+ return name;
+ }
+
+ // check for vendor prefixed names
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
+ origName = name,
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in style ) {
+ return name;
+ }
+ }
+
+ return origName;
+}
+
+function showHide( elements, show ) {
+ var display, elem, hidden,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ values[ index ] = jQuery._data( elem, "olddisplay" );
+ display = elem.style.display;
+ if ( show ) {
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
+ }
+ } else {
+ hidden = isHidden( elem );
+
+ if ( display && display !== "none" || !hidden ) {
+ jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+ // both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+ }
+
+ if ( isBorderBox ) {
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+ }
+
+ // at this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ } else {
+ // at this point, extra isn't content, so add padding
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+ // at this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var valueIsBorderBox = true,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ styles = getStyles( elem ),
+ isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, styles );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // we need the check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
+
+ // use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox,
+ styles
+ )
+ ) + "px";
+}
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+ }
+ }
+ }
+ },
+
+ // Don't automatically add "px" to these possibly-unitless properties
+ cssNumber: {
+ "columnCount": true,
+ "fillOpacity": true,
+ "flexGrow": true,
+ "flexShrink": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "order": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
+
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that null and NaN values aren't set. See: #7116
+ if ( value == null || value !== value ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
+ // but it would mean to define eight (for every problematic property) identical functions
+ if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+ style[ name ] = "inherit";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
+
+ // Support: IE
+ // Swallow errors from 'invalid' CSS values (#5509)
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra, styles ) {
+ var num, val, hooks,
+ origName = jQuery.camelCase( name );
+
+ // Make sure that we're working with the right name
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name, styles );
+ }
+
+ //convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
+ if ( extra === "" || extra ) {
+ num = parseFloat( val );
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
+ }
+ return val;
+ }
+});
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+ // certain elements can have dimension info if we invisibly show them
+ // however, it must have a current display style that would benefit from this
+ return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
+ jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ }) :
+ getWidthOrHeight( elem, name, extra );
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ var styles = extra && getStyles( elem );
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ styles
+ ) : 0
+ );
+ }
+ };
+});
+
+if ( !support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ // if value === "", then remove inline opacity #12685
+ if ( ( value >= 1 || value === "" ) &&
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+ style.removeAttribute ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there is no filter style applied in a css rule or unset inline opacity, we are done
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
+ function( elem, computed ) {
+ if ( computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ return jQuery.swap( elem, { "display": "inline-block" },
+ curCSS, [ elem, "marginRight" ] );
+ }
+ }
+);
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i = 0,
+ expanded = {},
+
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
+
+ for ( ; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+});
+
+jQuery.fn.extend({
+ css: function( name, value ) {
+ return access( this, function( elem, name, value ) {
+ var styles, len,
+ map = {},
+ i = 0;
+
+ if ( jQuery.isArray( name ) ) {
+ styles = getStyles( elem );
+ len = name.length;
+
+ for ( ; i < len; i++ ) {
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+ }
+
+ return map;
+ }
+
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each(function() {
+ if ( isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ });
+ }
+});
+
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE <=9
+// Panic based approach to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
+ }
+};
+
+jQuery.fx = Tween.prototype.init;
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+
+
+
+var
+ fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [ function( prop, value ) {
+ var tween = this.createTween( prop, value ),
+ target = tween.cur(),
+ parts = rfxnum.exec( value ),
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+ scale = 1,
+ maxIterations = 20;
+
+ if ( start && start[ 3 ] !== unit ) {
+ // Trust units reported by jQuery.css
+ unit = unit || start[ 3 ];
+
+ // Make sure we update the tween properties later on
+ parts = parts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ start = +target || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ // Update tween properties
+ if ( parts ) {
+ start = tween.start = +start || +target || 0;
+ tween.unit = unit;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[ 1 ] ?
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+ +parts[ 2 ];
+ }
+
+ return tween;
+ } ]
+ };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ });
+ return ( fxNow = jQuery.now() );
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth ? 1 : 0;
+ for ( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
+
+ // we're done with this property
+ return tween;
+ }
+ }
+}
+
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = jQuery._data( elem, "fxshow" );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ display = jQuery.css( elem, "display" );
+
+ // Test default display if display is currently "none"
+ checkDisplay = display === "none" ?
+ jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
+
+ if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
+ style.display = "inline-block";
+ } else {
+ style.zoom = 1;
+ }
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !support.shrinkWrapBlocks() ) {
+ anim.always(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+ }
+
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+
+ // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+ hidden = true;
+ } else {
+ continue;
+ }
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+
+ // Any non-fx value stops us from restoring the original display value
+ } else {
+ display = undefined;
+ }
+ }
+
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = jQuery._data( elem, "fxshow", {} );
+ }
+
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+ jQuery._removeData( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+
+ // If this is a noop like .hide().hide(), restore an overwritten display value
+ } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
+ style.display = display;
+ }
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ })
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || jQuery._data( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each(function() {
+ var index,
+ data = jQuery._data( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // enable finishing flag on private data
+ data.finish = true;
+
+ // empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // turn off finishing flag
+ delete data.finish;
+ });
+ }
+});
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.timers = [];
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ jQuery.timers.push( timer );
+ if ( timer() ) {
+ jQuery.fx.start();
+ } else {
+ jQuery.timers.pop();
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+ if ( !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
+
+
+// Based off of the plugin by Clint Helfers, with permission.
+// http://blindsignals.com/index.php/2009/07/jquery-delay/
+jQuery.fn.delay = function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+};
+
+
+(function() {
+ // Minified: var a,b,c,d,e
+ var input, div, select, a, opt;
+
+ // Setup
+ div = document.createElement( "div" );
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " a ";
+ a = div.getElementsByTagName("a")[ 0 ];
+
+ // First batch of tests.
+ select = document.createElement("select");
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName("input")[ 0 ];
+
+ a.style.cssText = "top:1px";
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ support.getSetAttribute = div.className !== "t";
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ support.style = /top/.test( a.getAttribute("style") );
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ support.hrefNormalized = a.getAttribute("href") === "/a";
+
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+ support.checkOn = !!input.value;
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ support.optSelected = opt.selected;
+
+ // Tests for enctype support on a form (#6743)
+ support.enctype = !!document.createElement("form").enctype;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Support: IE8 only
+ // Check if we can trust getAttribute("value")
+ input = document.createElement( "input" );
+ input.setAttribute( "value", "" );
+ support.input = input.getAttribute( "value" ) === "";
+
+ // Check if an input maintains its value after becoming a radio
+ input.value = "t";
+ input.setAttribute( "type", "radio" );
+ support.radioValue = input.value === "t";
+})();
+
+
+var rreturn = /\r/g;
+
+jQuery.fn.extend({
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map( val, function( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+ // Support: IE10-11+
+ // option.text throws exceptions (#14686, #14858)
+ jQuery.trim( jQuery.text( elem ) );
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // oldIE doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+
+ if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
+
+ // Support: IE6
+ // When new option element is added to select box we need to
+ // force reflow of newly added node in order to workaround delay
+ // of initialization properties
+ try {
+ option.selected = optionSet = true;
+
+ } catch ( _ ) {
+
+ // Will be executed only in IE6
+ option.scrollHeight;
+ }
+
+ } else {
+ option.selected = false;
+ }
+ }
+
+ // Force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+
+ return options;
+ }
+ }
+ }
+});
+
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ };
+ if ( !support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ // Support: Webkit
+ // "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ };
+ }
+});
+
+
+
+
+var nodeHook, boolHook,
+ attrHandle = jQuery.expr.attrHandle,
+ ruseDefault = /^(?:checked|selected)$/i,
+ getSetAttribute = support.getSetAttribute,
+ getSetInput = support.input;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ }
+});
+
+jQuery.extend({
+ attr: function( elem, name, value ) {
+ var hooks, ret,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === strundefined ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( (name = attrNames[i++]) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+ // Set corresponding property to false
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ elem[ propName ] = false;
+ // Support: IE<9
+ // Also clear defaultChecked/defaultSelected (if appropriate)
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] =
+ elem[ propName ] = false;
+ }
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ } else {
+ jQuery.attr( elem, name, "" );
+ }
+
+ elem.removeAttribute( getSetAttribute ? name : propName );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to default in case type is set after value during creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ }
+});
+
+// Hook for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ // IE<8 needs the *property* name
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+ // Use defaultChecked and defaultSelected for oldIE
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+ }
+
+ return name;
+ }
+};
+
+// Retrieve booleans specially
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+
+ var getter = attrHandle[ name ] || jQuery.find.attr;
+
+ attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
+ function( elem, name, isXML ) {
+ var ret, handle;
+ if ( !isXML ) {
+ // Avoid an infinite loop by temporarily removing this function from the getter
+ handle = attrHandle[ name ];
+ attrHandle[ name ] = ret;
+ ret = getter( elem, name, isXML ) != null ?
+ name.toLowerCase() :
+ null;
+ attrHandle[ name ] = handle;
+ }
+ return ret;
+ } :
+ function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem[ jQuery.camelCase( "default-" + name ) ] ?
+ name.toLowerCase() :
+ null;
+ }
+ };
+});
+
+// fix oldIE attroperties
+if ( !getSetInput || !getSetAttribute ) {
+ jQuery.attrHooks.value = {
+ set: function( elem, value, name ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ // Does not return so that setAttribute is also used
+ elem.defaultValue = value;
+ } else {
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+ return nodeHook && nodeHook.set( elem, value, name );
+ }
+ }
+ };
+}
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = {
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ elem.setAttributeNode(
+ (ret = elem.ownerDocument.createAttribute( name ))
+ );
+ }
+
+ ret.value = value += "";
+
+ // Break association with cloned elements by also using setAttribute (#9646)
+ if ( name === "value" || value === elem.getAttribute( name ) ) {
+ return value;
+ }
+ }
+ };
+
+ // Some attributes are constructed with empty-string values when not defined
+ attrHandle.id = attrHandle.name = attrHandle.coords =
+ function( elem, name, isXML ) {
+ var ret;
+ if ( !isXML ) {
+ return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
+ ret.value :
+ null;
+ }
+ };
+
+ // Fixing value retrieval on a button requires this module
+ jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret = elem.getAttributeNode( name );
+ if ( ret && ret.specified ) {
+ return ret.value;
+ }
+ },
+ set: nodeHook.set
+ };
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ set: function( elem, value, name ) {
+ nodeHook.set( elem, value === "" ? false : value, name );
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ };
+ });
+}
+
+if ( !support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
+ return elem.style.cssText || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = value + "" );
+ }
+ };
+}
+
+
+
+
+var rfocusable = /^(?:input|select|textarea|button|object)$/i,
+ rclickable = /^(?:a|area)$/i;
+
+jQuery.fn.extend({
+ prop: function( name, value ) {
+ return access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ }
+});
+
+jQuery.extend({
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+ ret :
+ ( elem[ name ] = value );
+
+ } else {
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+ ret :
+ elem[ name ];
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ // Use proper attribute retrieval(#12072)
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+ return tabindex ?
+ parseInt( tabindex, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ -1;
+ }
+ }
+ }
+});
+
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !support.hrefNormalized ) {
+ // href/src property should get the full normalized URL (#10299/#12915)
+ jQuery.each([ "href", "src" ], function( i, name ) {
+ jQuery.propHooks[ name ] = {
+ get: function( elem ) {
+ return elem.getAttribute( name, 4 );
+ }
+ };
+ });
+}
+
+// Support: Safari, IE9+
+// mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each([
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+});
+
+// IE6/7 call enctype encoding
+if ( !support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+
+
+
+var rclass = /[\t\r\n\f]/g;
+
+jQuery.fn.extend({
+ addClass: function( value ) {
+ var classes, elem, cur, clazz, j, finalValue,
+ i = 0,
+ len = this.length,
+ proceed = typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
+ });
+ }
+
+ if ( proceed ) {
+ // The disjunction here is for better compressibility (see removeClass)
+ classes = ( value || "" ).match( rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ " "
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+
+ // only assign if different to avoid unneeded rendering.
+ finalValue = jQuery.trim( cur );
+ if ( elem.className !== finalValue ) {
+ elem.className = finalValue;
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, clazz, j, finalValue,
+ i = 0,
+ len = this.length,
+ proceed = arguments.length === 0 || typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
+ });
+ }
+ if ( proceed ) {
+ classes = ( value || "" ).match( rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ ""
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+
+ // only assign if different to avoid unneeded rendering.
+ finalValue = value ? jQuery.trim( cur ) : "";
+ if ( elem.className !== finalValue ) {
+ elem.className = finalValue;
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ classNames = value.match( rnotwhite ) || [];
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( type === strundefined || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // If the element has a class name or if we're passed "false",
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+});
+
+
+
+
+// Return jQuery for attributes-only inclusion
+
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+});
+
+jQuery.fn.extend({
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ }
+});
+
+
+var nonce = jQuery.now();
+
+var rquery = (/\?/);
+
+
+
+var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
+
+jQuery.parseJSON = function( data ) {
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ // Support: Android 2.3
+ // Workaround failure to string-cast null input
+ return window.JSON.parse( data + "" );
+ }
+
+ var requireNonComma,
+ depth = null,
+ str = jQuery.trim( data + "" );
+
+ // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
+ // after removing valid tokens
+ return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
+
+ // Force termination if we see a misplaced comma
+ if ( requireNonComma && comma ) {
+ depth = 0;
+ }
+
+ // Perform no more replacements after returning to outermost depth
+ if ( depth === 0 ) {
+ return token;
+ }
+
+ // Commas must not follow "[", "{", or ","
+ requireNonComma = open || comma;
+
+ // Determine new depth
+ // array/object open ("[" or "{"): depth += true - false (increment)
+ // array/object close ("]" or "}"): depth += false - true (decrement)
+ // other cases ("," or primitive): depth += true - true (numeric cast)
+ depth += !close - !open;
+
+ // Remove this token
+ return "";
+ }) ) ?
+ ( Function( "return " + str ) )() :
+ jQuery.error( "Invalid JSON: " + data );
+};
+
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data, "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+
+var
+ // Document location
+ ajaxLocParts,
+ ajaxLocation,
+
+ rhash = /#.*$/,
+ rts = /([?&])_=[^&]*/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat("*");
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+ // For each dataType in the dataTypeExpression
+ while ( (dataType = dataTypes[i++]) ) {
+ // Prepend if requested
+ if ( dataType.charAt( 0 ) === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+ // Otherwise append
+ } else {
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ });
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var deep, key,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+ var firstDataType, ct, finalDataType, type,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while ( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Cross-domain detection vars
+ parts,
+ // Loop variable
+ i,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers as string
+ responseHeadersString,
+ // timeout handle
+ timeoutTimer,
+
+ // To know if global events are to be dispatched
+ fireGlobals,
+
+ transport,
+ // Response headers
+ responseHeaders,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+ jQuery.fn[ type ] = function( fn ) {
+ return this.on( type, fn );
+ };
+});
+
+
+jQuery._evalUrl = function( url ) {
+ return jQuery.ajax({
+ url: url,
+ type: "GET",
+ dataType: "script",
+ async: false,
+ global: false,
+ "throws": true
+ });
+};
+
+
+jQuery.fn.extend({
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function(i) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ }
+});
+
+
+jQuery.expr.filters.hidden = function( elem ) {
+ // Support: Opera <= 12.12
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
+ (!support.reliableHiddenOffsets() &&
+ ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+};
+
+jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+};
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // Item is non-scalar (array or object), encode its numeric index.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// Serialize an array of form elements or a set of
+// key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
+
+jQuery.fn.extend({
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ // Can add propHook for "elements" to filter or add form elements
+ var elements = jQuery.prop( this, "elements" );
+ return elements ? jQuery.makeArray( elements ) : this;
+ })
+ .filter(function() {
+ var type = this.type;
+ // Use .is(":disabled") so that fieldset[disabled] works
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+ ( this.checked || !rcheckableType.test( type ) );
+ })
+ .map(function( i, elem ) {
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val ) {
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
+ // Support: IE6+
+ function() {
+
+ // XHR cannot access local files, always use ActiveX for that case
+ return !this.isLocal &&
+
+ // Support: IE7-8
+ // oldIE XHR does not support non-RFC2616 methods (#13240)
+ // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
+ // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
+ // Although this check for six methods instead of eight
+ // since IE also does not support "trace" and "connect"
+ /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
+
+ createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+var xhrId = 0,
+ xhrCallbacks = {},
+ xhrSupported = jQuery.ajaxSettings.xhr();
+
+// Support: IE<10
+// Open requests must be manually aborted on unload (#5280)
+if ( window.ActiveXObject ) {
+ jQuery( window ).on( "unload", function() {
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( undefined, true );
+ }
+ });
+}
+
+// Determine support properties
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = support.ajax = !!xhrSupported;
+
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
+
+ jQuery.ajaxTransport(function( options ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !options.crossDomain || support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+ var i,
+ xhr = options.xhr(),
+ id = ++xhrId;
+
+ // Open the socket
+ xhr.open( options.type, options.url, options.async, options.username, options.password );
+
+ // Apply custom fields if provided
+ if ( options.xhrFields ) {
+ for ( i in options.xhrFields ) {
+ xhr[ i ] = options.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( options.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( options.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !options.crossDomain && !headers["X-Requested-With"] ) {
+ headers["X-Requested-With"] = "XMLHttpRequest";
+ }
+
+ // Set headers
+ for ( i in headers ) {
+ // Support: IE<9
+ // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
+ // request header to a null-value.
+ //
+ // To keep consistent with other XHR implementations, cast the value
+ // to string and ignore `undefined`.
+ if ( headers[ i ] !== undefined ) {
+ xhr.setRequestHeader( i, headers[ i ] + "" );
+ }
+ }
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( options.hasContent && options.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+ var status, statusText, responses;
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+ // Clean up
+ delete xhrCallbacks[ id ];
+ callback = undefined;
+ xhr.onreadystatechange = jQuery.noop;
+
+ // Abort manually if needed
+ if ( isAbort ) {
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ responses = {};
+ status = xhr.status;
+
+ // Support: IE<10
+ // Accessing binary-data responseText throws an exception
+ // (#11426)
+ if ( typeof xhr.responseText === "string" ) {
+ responses.text = xhr.responseText;
+ }
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && options.isLocal && !options.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, xhr.getAllResponseHeaders() );
+ }
+ };
+
+ if ( !options.async ) {
+ // if we're in sync mode we fire the callback
+ callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback );
+ } else {
+ // Add to the list of active xhr callbacks
+ xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback( undefined, true );
+ }
+ }
+ };
+ }
+ });
+}
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || jQuery("head")[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement("script");
+
+ script.async = true;
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( script.parentNode ) {
+ script.parentNode.removeChild( script );
+ }
+
+ // Dereference the script
+ script = null;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( undefined, true );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// data: string of html
+// context (optional): If specified, the fragment will be created in this context, defaults to document
+// keepScripts (optional): If true, will include scripts passed in the html string
+jQuery.parseHTML = function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+ context = context || document;
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
+
+ if ( scripts && scripts.length ) {
+ jQuery( scripts ).remove();
+ }
+
+ return jQuery.merge( [], parsed.childNodes );
+};
+
+
+// Keep a copy of the old load method
+var _load = jQuery.fn.load;
+
+/**
+ * Load a url into a page
+ */
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ var selector, response, type,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = jQuery.trim( url.slice( off, url.length ) );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax({
+ url: url,
+
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params
+ }).done(function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery("").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
+ }
+
+ return this;
+};
+
+
+
+
+jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+};
+
+
+
+
+
+var docElem = window.document.documentElement;
+
+/**
+ * Gets a window from an element
+ */
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+jQuery.offset = {
+ setOffset: function( elem, options, i ) {
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
+ position = jQuery.css( elem, "position" ),
+ curElem = jQuery( elem ),
+ props = {};
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ curOffset = curElem.offset();
+ curCSSTop = jQuery.css( elem, "top" );
+ curCSSLeft = jQuery.css( elem, "left" );
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&
+ jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+jQuery.fn.extend({
+ offset: function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var docElem, win,
+ box = { top: 0, left: 0 },
+ elem = this[ 0 ],
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== strundefined ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ return {
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+ };
+ },
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ parentOffset = { top: 0, left: 0 },
+ elem = this[ 0 ];
+
+ // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+ // we assume that getBoundingClientRect is available when computed position is fixed
+ offset = elem.getBoundingClientRect();
+ } else {
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+ }
+
+ // Subtract parent offsets and element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || docElem;
+
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent || docElem;
+ });
+ }
+});
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
+ var top = /Y/.test( prop );
+
+ jQuery.fn[ method ] = function( val ) {
+ return access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? (prop in win) ? win[ prop ] :
+ win.document.documentElement[ method ] :
+ elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+// Add the top/left cssHooks using jQuery.fn.position
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+// getComputedStyle returns percent when specified for top/left/bottom/right
+// rather than make the css module depend on the offset module, we just check for it here
+jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
+ function( elem, computed ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
+ }
+ }
+ );
+});
+
+
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
+});
+
+
+// The number of elements contained in the matched element set
+jQuery.fn.size = function() {
+ return this.length;
+};
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+
+
+
+// Register as a named AMD module, since jQuery can be concatenated with other
+// files that may use define, but not via a proper concatenation script that
+// understands anonymous AMD modules. A named AMD is safest and most robust
+// way to register. Lowercase jquery is used because AMD module names are
+// derived from file names, and jQuery is normally delivered in a lowercase
+// file name. Do this after creating the global so that if an AMD module wants
+// to call noConflict to hide this version of jQuery, it will work.
+
+// Note that for maximum portability, libraries that are not jQuery should
+// declare themselves as anonymous modules, and avoid setting a global if an
+// AMD loader is present. jQuery is a special case. For more information, see
+// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
+
+if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function() {
+ return jQuery;
+ });
+}
+
+
+
+
+var
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$;
+
+jQuery.noConflict = function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+};
+
+// Expose jQuery and $ identifiers, even in
+// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (#13566)
+if ( typeof noGlobal === strundefined ) {
+ window.jQuery = window.$ = jQuery;
+}
+
+
+
+
+return jQuery;
+
+}));
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/velocity/test/jquery-1.4.3.js b/dashboard-ui/bower_components/velocity/test/jquery-1.4.3.js
new file mode 100644
index 0000000000..ad9a79c433
--- /dev/null
+++ b/dashboard-ui/bower_components/velocity/test/jquery-1.4.3.js
@@ -0,0 +1,6883 @@
+/*!
+ * jQuery JavaScript Library v1.4.3
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Oct 14 23:10:06 2010 -0400
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
+
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+ rwhite = /\s/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Check for non-word characters
+ rnonword = /\W/,
+
+ // Check for digits
+ rdigit = /\d/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // Has the ready events already been bound?
+ readyBound = false,
+
+ // The functions to execute on DOM ready
+ readyList = [],
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = "body";
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $("TAG")
+ } else if ( !context && !rnonword.test( selector ) ) {
+ this.selector = selector;
+ this.context = document;
+ selector = document.getElementsByTagName( selector );
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return jQuery( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.4.3",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady ) {
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ } else if ( readyList ) {
+ // Add the function to the wait list
+ readyList.push( fn );
+ }
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || jQuery(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy, copyIsArray;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // A third-party is pushing the ready event forwards
+ if ( wait === true ) {
+ jQuery.readyWait--;
+ }
+
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ if ( readyList ) {
+ // Execute all of them
+ var fn, i = 0;
+ while ( (fn = readyList[ i++ ]) ) {
+ fn.call( document, jQuery );
+ }
+
+ // Reset the list of functions
+ readyList = null;
+ }
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyBound ) {
+ return;
+ }
+
+ readyBound = true;
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ // A crude way of determining if an object is a window
+ isWindow: function( obj ) {
+ return obj && typeof obj === "object" && "setInterval" in obj;
+ },
+
+ isNaN: function( obj ) {
+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test(data.replace(rvalidescape, "@")
+ .replace(rvalidtokens, "]")
+ .replace(rvalidbraces, "")) ) {
+
+ // Try to use the native JSON parser first
+ return window.JSON && window.JSON.parse ?
+ window.JSON.parse( data ) :
+ (new Function("return " + data))();
+
+ } else {
+ jQuery.error( "Invalid JSON: " + data );
+ }
+ },
+
+ noop: function() {},
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+
+ if ( jQuery.support.scriptEval ) {
+ script.appendChild( document.createTextNode( data ) );
+ } else {
+ script.text = data;
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction(object);
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type(array);
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ if ( array.indexOf ) {
+ return array.indexOf( elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length, j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var ret = [], value;
+
+ // Go through the array, translating each of the items to their
+ // new value (or values).
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ proxy: function( fn, proxy, thisObject ) {
+ if ( arguments.length === 2 ) {
+ if ( typeof proxy === "string" ) {
+ thisObject = fn;
+ fn = thisObject[ proxy ];
+ proxy = undefined;
+
+ } else if ( proxy && !jQuery.isFunction( proxy ) ) {
+ thisObject = proxy;
+ proxy = undefined;
+ }
+ }
+
+ if ( !proxy && fn ) {
+ proxy = function() {
+ return fn.apply( thisObject || this, arguments );
+ };
+ }
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ if ( fn ) {
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ }
+
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can be optionally by executed if its a function
+ access: function( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ jQuery.access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+ },
+
+ now: function() {
+ return (new Date()).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+// Verify that \s matches non-breaking spaces
+// (IE fails on this test)
+if ( !rwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+// Expose jQuery to the global object
+return (window.jQuery = window.$ = jQuery);
+
+})();
+
+
+(function() {
+
+ jQuery.support = {};
+
+ var root = document.documentElement,
+ script = document.createElement("script"),
+ div = document.createElement("div"),
+ id = "script" + jQuery.now();
+
+ div.style.display = "none";
+ div.innerHTML = "
a ";
+
+ var all = div.getElementsByTagName("*"),
+ a = div.getElementsByTagName("a")[0],
+ select = document.createElement("select"),
+ opt = select.appendChild( document.createElement("option") );
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return;
+ }
+
+ jQuery.support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: div.firstChild.nodeType === 3,
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText insted)
+ style: /red/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: a.getAttribute("href") === "/a",
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: div.getElementsByTagName("input")[0].value === "on",
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Will be defined later
+ optDisabled: false,
+ checkClone: false,
+ scriptEval: false,
+ noCloneEvent: true,
+ boxModel: null,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableHiddenOffsets: true
+ };
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as diabled)
+ select.disabled = true;
+ jQuery.support.optDisabled = !opt.disabled;
+
+ script.type = "text/javascript";
+ try {
+ script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+ } catch(e) {}
+
+ root.insertBefore( script, root.firstChild );
+
+ // Make sure that the execution of code works by injecting a script
+ // tag with appendChild/createTextNode
+ // (IE doesn't support this, fails, and uses .text instead)
+ if ( window[ id ] ) {
+ jQuery.support.scriptEval = true;
+ delete window[ id ];
+ }
+
+ root.removeChild( script );
+
+ if ( div.attachEvent && div.fireEvent ) {
+ div.attachEvent("onclick", function click() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ jQuery.support.noCloneEvent = false;
+ div.detachEvent("onclick", click);
+ });
+ div.cloneNode(true).fireEvent("onclick");
+ }
+
+ div = document.createElement("div");
+ div.innerHTML = "
";
+
+ var fragment = document.createDocumentFragment();
+ fragment.appendChild( div.firstChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
+
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ jQuery(function() {
+ var div = document.createElement("div");
+ div.style.width = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+
+ if ( "zoom" in div.style ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "";
+ div.innerHTML = "
";
+ jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
+ }
+
+ div.innerHTML = "
";
+ var tds = div.getElementsByTagName("td");
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
+
+ tds[0].style.display = "";
+ tds[1].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE < 8 fail this test)
+ jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
+ div.innerHTML = "";
+
+ document.body.removeChild( div ).style.display = "none";
+ div = tds = null;
+ });
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+ var eventSupported = function( eventName ) {
+ var el = document.createElement("div");
+ eventName = "on" + eventName;
+
+ var isSupported = (eventName in el);
+ if ( !isSupported ) {
+ el.setAttribute(eventName, "return;");
+ isSupported = typeof el[eventName] === "function";
+ }
+ el = null;
+
+ return isSupported;
+ };
+
+ jQuery.support.submitBubbles = eventSupported("submit");
+ jQuery.support.changeBubbles = eventSupported("change");
+
+ // release memory in IE
+ root = script = div = all = a = null;
+})();
+
+jQuery.props = {
+ "for": "htmlFor",
+ "class": "className",
+ readonly: "readOnly",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ tabindex: "tabIndex",
+ usemap: "useMap",
+ frameborder: "frameBorder"
+};
+
+
+
+
+var windowData = {},
+ rbrace = /^(?:\{.*\}|\[.*\])$/;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + jQuery.now(),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ data: function( elem, name, data ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var isNode = elem.nodeType,
+ id = isNode ? elem[ jQuery.expando ] : null,
+ cache = jQuery.cache, thisCache;
+
+ if ( isNode && !id && typeof name === "string" && data === undefined ) {
+ return;
+ }
+
+ // Get the data from the object directly
+ if ( !isNode ) {
+ cache = elem;
+
+ // Compute a unique ID for the element
+ } else if ( !id ) {
+ elem[ jQuery.expando ] = id = ++jQuery.uuid;
+ }
+
+ // Avoid generating a new cache unless none exists and we
+ // want to manipulate it.
+ if ( typeof name === "object" ) {
+ if ( isNode ) {
+ cache[ id ] = jQuery.extend(cache[ id ], name);
+
+ } else {
+ jQuery.extend( cache, name );
+ }
+
+ } else if ( isNode && !cache[ id ] ) {
+ cache[ id ] = {};
+ }
+
+ thisCache = isNode ? cache[ id ] : cache;
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined ) {
+ thisCache[ name ] = data;
+ }
+
+ return typeof name === "string" ? thisCache[ name ] : thisCache;
+ },
+
+ removeData: function( elem, name ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var isNode = elem.nodeType,
+ id = isNode ? elem[ jQuery.expando ] : elem,
+ cache = jQuery.cache,
+ thisCache = isNode ? cache[ id ] : id;
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( thisCache ) {
+ // Remove the section of cache data
+ delete thisCache[ name ];
+
+ // If we've removed all the data, remove the element's cache
+ if ( isNode && jQuery.isEmptyObject(thisCache) ) {
+ jQuery.removeData( elem );
+ }
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ if ( isNode && jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+
+ // Completely remove the data cache
+ } else if ( isNode ) {
+ delete cache[ id ];
+
+ // Remove all fields from the object
+ } else {
+ for ( var n in elem ) {
+ delete elem[ n ];
+ }
+ }
+ }
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ if ( typeof key === "undefined" ) {
+ return this.length ? jQuery.data( this[0] ) : null;
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && this[0].nodeType === 1 ) {
+ data = this[0].getAttribute( "data-" + key );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ !jQuery.isNaN( data ) ? parseFloat( data ) :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ } else {
+ data = undefined;
+ }
+ }
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+
+ } else {
+ return this.each(function() {
+ var $this = jQuery( this ), args = [ parts[0], value ];
+
+ $this.triggerHandler( "setData" + parts[1] + "!", args );
+ jQuery.data( this, key, value );
+ $this.triggerHandler( "changeData" + parts[1] + "!", args );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+
+
+
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ if ( !elem ) {
+ return;
+ }
+
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( !data ) {
+ return q || [];
+ }
+
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+
+ } else {
+ q.push( data );
+ }
+
+ return q;
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ), fn = queue.shift();
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function( i ) {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ }
+});
+
+
+
+
+var rclass = /[\n\t]/g,
+ rspaces = /\s+/,
+ rreturn = /\r/g,
+ rspecialurl = /^(?:href|src|style)$/,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rradiocheck = /^(?:radio|checkbox)$/i;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name, fn ) {
+ return this.each(function(){
+ jQuery.attr( this, name, "" );
+ if ( this.nodeType === 1 ) {
+ this.removeAttribute( name );
+ }
+ });
+ },
+
+ addClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.addClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ var classNames = (value || "").split( rspaces );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className ) {
+ elem.className = value;
+
+ } else {
+ var className = " " + elem.className + " ", setClass = elem.className;
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+ setClass += " " + classNames[c];
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.removeClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ var classNames = (value || "").split( rspaces );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ var className = (" " + elem.className + " ").replace(rclass, " ");
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value, isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className, i = 0, self = jQuery(this),
+ state = stateVal,
+ classNames = value.split( rspaces );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery.data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ if ( !arguments.length ) {
+ var elem = this[0];
+
+ if ( elem ) {
+ if ( jQuery.nodeName( elem, "option" ) ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+
+ // We need to handle select boxes special
+ if ( jQuery.nodeName( elem, "select" ) ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery(option).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ }
+
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+
+
+ // Everything else, we just grab the value
+ return (elem.value || "").replace(rreturn, "");
+
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction(value);
+
+ return this.each(function(i) {
+ var self = jQuery(this), val = value;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call(this, i, self.val());
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray(val) ) {
+ val = jQuery.map(val, function (value) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
+ this.checked = jQuery.inArray( self.val(), val ) >= 0;
+
+ } else if ( jQuery.nodeName( this, "select" ) ) {
+ var values = jQuery.makeArray(val);
+
+ jQuery( "option", this ).each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ this.selectedIndex = -1;
+ }
+
+ } else {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ // don't set attributes on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery(elem)[name](value);
+ }
+
+ var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
+ // Whether we are setting (or getting)
+ set = value !== undefined;
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.props[ name ] || name;
+
+ // Only do all the following if this is a node (faster for style)
+ if ( elem.nodeType === 1 ) {
+ // These attributes require special treatment
+ var special = rspecialurl.test( name );
+
+ // Safari mis-reports the default selected property of an option
+ // Accessing the parent's selectedIndex property fixes it
+ if ( name === "selected" && !jQuery.support.optSelected ) {
+ var parent = elem.parentNode;
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+
+ // If applicable, access the attribute via the DOM 0 way
+ // 'in' checks fail in Blackberry 4.7 #6931
+ if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
+ if ( set ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ }
+
+ if ( value === null ) {
+ if ( elem.nodeType === 1 ) {
+ elem.removeAttribute( name );
+ }
+
+ } else {
+ elem[ name ] = value;
+ }
+ }
+
+ // browsers index elements by id/name on forms, give priority to attributes.
+ if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
+ return elem.getAttributeNode( name ).nodeValue;
+ }
+
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ if ( name === "tabIndex" ) {
+ var attributeNode = elem.getAttributeNode( "tabIndex" );
+
+ return attributeNode && attributeNode.specified ?
+ attributeNode.value :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+
+ return elem[ name ];
+ }
+
+ if ( !jQuery.support.style && notxml && name === "style" ) {
+ if ( set ) {
+ elem.style.cssText = "" + value;
+ }
+
+ return elem.style.cssText;
+ }
+
+ if ( set ) {
+ // convert the value to a string (all browsers do this but IE) see #1070
+ elem.setAttribute( name, "" + value );
+ }
+
+ // Ensure that missing attributes return undefined
+ // Blackberry 4.7 returns "" from getAttribute #6938
+ if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
+ return undefined;
+ }
+
+ var attr = !jQuery.support.hrefNormalized && notxml && special ?
+ // Some attributes require a special call on IE
+ elem.getAttribute( name, 2 ) :
+ elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return attr === null ? undefined : attr;
+ }
+ }
+});
+
+
+
+
+var rnamespaces = /\.(.*)$/,
+ rformElems = /^(?:textarea|input|select)$/i,
+ rperiod = /\./g,
+ rspace = / /g,
+ rescape = /[^\w\s.|`]/g,
+ fcleanup = function( nm ) {
+ return nm.replace(rescape, "\\$&");
+ },
+ focusCounts = { focusin: 0, focusout: 0 };
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // For whatever reason, IE has trouble passing the window object
+ // around, causing it to be cloned in the process
+ if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
+ elem = window;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ }
+
+ var handleObjIn, handleObj;
+
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure
+ var elemData = jQuery.data( elem );
+
+ // If no elemData is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !elemData ) {
+ return;
+ }
+
+ // Use a key less likely to result in collisions for plain JS objects.
+ // Fixes bug #7150.
+ var eventKey = elem.nodeType ? "events" : "__events__",
+ events = elemData[ eventKey ],
+ eventHandle = elemData.handle;
+
+ if ( typeof events === "function" ) {
+ // On plain objects events is a fn that holds the the data
+ // which prevents this data from being JSON serialized
+ // the function does not need to be called, it just contains the data
+ eventHandle = events.handle;
+ events = events.events;
+
+ } else if ( !events ) {
+ if ( !elem.nodeType ) {
+ // On plain objects, create a fn that acts as the holder
+ // of the values to avoid JSON serialization of event data
+ elemData[ eventKey ] = elemData = function(){};
+ }
+
+ elemData.events = events = {};
+ }
+
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function() {
+ // Handle the second event of a trigger and when
+ // an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native events in IE.
+ eventHandle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ var type, i = 0, namespaces;
+
+ while ( (type = types[ i++ ]) ) {
+ handleObj = handleObjIn ?
+ jQuery.extend({}, handleObjIn) :
+ { handler: handler, data: data };
+
+ // Namespaced event handlers
+ if ( type.indexOf(".") > -1 ) {
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+ } else {
+ namespaces = [];
+ handleObj.namespace = "";
+ }
+
+ handleObj.type = type;
+ if ( !handleObj.guid ) {
+ handleObj.guid = handler.guid;
+ }
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = jQuery.event.special[ type ] || {};
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers.push( handleObj );
+
+ // Keep track of which events have been used, for global triggering
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, pos ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ if ( handler === false ) {
+ handler = returnFalse;
+ }
+
+ var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+ eventKey = elem.nodeType ? "events" : "__events__",
+ elemData = jQuery.data( elem ),
+ events = elemData && elemData[ eventKey ];
+
+ if ( !elemData || !events ) {
+ return;
+ }
+
+ if ( typeof events === "function" ) {
+ elemData = events;
+ events = events.events;
+ }
+
+ // types is actually an event object here
+ if ( types && types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Unbind all events for the element
+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+ types = types || "";
+
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types );
+ }
+
+ return;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ while ( (type = types[ i++ ]) ) {
+ origType = type;
+ handleObj = null;
+ all = type.indexOf(".") < 0;
+ namespaces = [];
+
+ if ( !all ) {
+ // Namespaced event handlers
+ namespaces = type.split(".");
+ type = namespaces.shift();
+
+ namespace = new RegExp("(^|\\.)" +
+ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ eventType = events[ type ];
+
+ if ( !eventType ) {
+ continue;
+ }
+
+ if ( !handler ) {
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ jQuery.event.remove( elem, origType, handleObj.handler, j );
+ eventType.splice( j--, 1 );
+ }
+ }
+
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+
+ for ( j = pos || 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( handler.guid === handleObj.guid ) {
+ // remove the given handler for the given type
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ if ( pos == null ) {
+ eventType.splice( j--, 1 );
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+
+ if ( pos != null ) {
+ break;
+ }
+ }
+ }
+
+ // remove generic event handler if no more handlers exist
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ ret = null;
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ var handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ delete elemData.events;
+ delete elemData.handle;
+
+ if ( typeof elemData === "function" ) {
+ jQuery.removeData( elem, eventKey );
+
+ } else if ( jQuery.isEmptyObject( elemData ) ) {
+ jQuery.removeData( elem );
+ }
+ }
+ },
+
+ // bubbling is internal
+ trigger: function( event, data, elem /*, bubbling */ ) {
+ // Event object or event type
+ var type = event.type || event,
+ bubbling = arguments[3];
+
+ if ( !bubbling ) {
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ jQuery.extend( jQuery.Event(type), event ) :
+ // Just the event type (string)
+ jQuery.Event(type);
+
+ if ( type.indexOf("!") >= 0 ) {
+ event.type = type = type.slice(0, -1);
+ event.exclusive = true;
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // Don't bubble custom events when global (to avoid too much overhead)
+ event.stopPropagation();
+
+ // Only trigger if we've ever bound an event for it
+ if ( jQuery.event.global[ type ] ) {
+ jQuery.each( jQuery.cache, function() {
+ if ( this.events && this.events[type] ) {
+ jQuery.event.trigger( event, data, this.handle.elem );
+ }
+ });
+ }
+ }
+
+ // Handle triggering a single element
+
+ // don't do events on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // Clean up in case it is reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone the incoming data, if any
+ data = jQuery.makeArray( data );
+ data.unshift( event );
+ }
+
+ event.currentTarget = elem;
+
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = elem.nodeType ?
+ jQuery.data( elem, "handle" ) :
+ (jQuery.data( elem, "__events__" ) || {}).handle;
+
+ if ( handle ) {
+ handle.apply( elem, data );
+ }
+
+ var parent = elem.parentNode || elem.ownerDocument;
+
+ // Trigger an inline bound script
+ try {
+ if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
+ if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
+ event.result = false;
+ event.preventDefault();
+ }
+ }
+
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (inlineError) {}
+
+ if ( !event.isPropagationStopped() && parent ) {
+ jQuery.event.trigger( event, data, parent, true );
+
+ } else if ( !event.isDefaultPrevented() ) {
+ var target = event.target, old, targetType = type.replace(rnamespaces, ""),
+ isClick = jQuery.nodeName(target, "a") && targetType === "click",
+ special = jQuery.event.special[ targetType ] || {};
+
+ if ( (!special._default || special._default.call( elem, event ) === false) &&
+ !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
+
+ try {
+ if ( target[ targetType ] ) {
+ // Make sure that we don't accidentally re-trigger the onFOO events
+ old = target[ "on" + targetType ];
+
+ if ( old ) {
+ target[ "on" + targetType ] = null;
+ }
+
+ jQuery.event.triggered = true;
+ target[ targetType ]();
+ }
+
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (triggerError) {}
+
+ if ( old ) {
+ target[ "on" + targetType ] = old;
+ }
+
+ jQuery.event.triggered = false;
+ }
+ }
+ },
+
+ handle: function( event ) {
+ var all, handlers, namespaces, namespace_sort = [], namespace_re, events, args = jQuery.makeArray( arguments );
+
+ event = args[0] = jQuery.event.fix( event || window.event );
+ event.currentTarget = this;
+
+ // Namespaced event handlers
+ all = event.type.indexOf(".") < 0 && !event.exclusive;
+
+ if ( !all ) {
+ namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+ namespace_sort = namespaces.slice(0).sort();
+ namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ event.namespace = event.namespace || namespace_sort.join(".");
+
+ events = jQuery.data(this, this.nodeType ? "events" : "__events__");
+
+ if ( typeof events === "function" ) {
+ events = events.events;
+ }
+
+ handlers = (events || {})[ event.type ];
+
+ if ( events && handlers ) {
+ // Clone the handlers to prevent manipulation
+ handlers = handlers.slice(0);
+
+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
+ var handleObj = handlers[ j ];
+
+ // Filter the functions by class
+ if ( all || namespace_re.test( handleObj.namespace ) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handleObj.handler;
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ var ret = handleObj.handler.apply( this, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var doc = document.documentElement, body = document.body;
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
+ event.which = event.charCode != null ? event.charCode : event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( handleObj ) {
+ jQuery.event.add( this,
+ liveConvert( handleObj.origType, handleObj.selector ),
+ jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
+ },
+
+ remove: function( handleObj ) {
+ jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
+ }
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
+ parent = parent.parentNode;
+ }
+
+ if ( parent !== this ) {
+ // set the correct event type
+ event.type = event.data;
+
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) { }
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function( data, namespaces ) {
+ if ( this.nodeName.toLowerCase() !== "form" ) {
+ jQuery.event.add(this, "click.specialSubmit", function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ e.liveFired = undefined;
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ e.liveFired = undefined;
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialSubmit" );
+ }
+ };
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+ var changeFilters,
+
+ getVal = function( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( elem.nodeName.toLowerCase() === "select" ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+ },
+
+ testChange = function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery.data( elem, "_change_data" );
+ val = getVal(elem);
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery.data( elem, "_change_data", val );
+ }
+
+ if ( data === undefined || val === data ) {
+ return;
+ }
+
+ if ( data != null || val ) {
+ e.type = "change";
+ e.liveFired = undefined;
+ return jQuery.event.trigger( e, arguments[1], elem );
+ }
+ };
+
+ jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ beforedeactivate: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information
+ beforeactivate: function( e ) {
+ var elem = e.target;
+ jQuery.data( elem, "_change_data", getVal(elem) );
+ }
+ },
+
+ setup: function( data, namespaces ) {
+ if ( this.type === "file" ) {
+ return false;
+ }
+
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
+ }
+
+ return rformElems.test( this.nodeName );
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialChange" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+
+ changeFilters = jQuery.event.special.change.filters;
+
+ // Handle when the input is .focus()'d
+ changeFilters.focus = changeFilters.beforeactivate;
+}
+
+function trigger( type, elem, args ) {
+ args[0].type = type;
+ return jQuery.event.handle.apply( elem, args );
+}
+
+// Create "bubbling" focus and blur events
+if ( document.addEventListener ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( focusCounts[fix]++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --focusCounts[fix] === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+
+ function handler( e ) {
+ e = jQuery.event.fix( e );
+ e.type = fix;
+ return jQuery.event.trigger( e, null, e.target );
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( jQuery.isFunction( data ) || data === false ) {
+ fn = data;
+ data = undefined;
+ }
+
+ var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ }) : fn;
+
+ if ( type === "unload" && name !== "one" ) {
+ this.one( type, data, fn );
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.add( this[i], type, handler, data );
+ }
+ }
+
+ return this;
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.remove( this[i], type, fn );
+ }
+ }
+
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.live( types, data, fn, selector );
+ },
+
+ undelegate: function( selector, types, fn ) {
+ if ( arguments.length === 0 ) {
+ return this.unbind( "live" );
+
+ } else {
+ return this.die( types, null, fn, selector );
+ }
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ var event = jQuery.Event( type );
+ event.preventDefault();
+ event.stopPropagation();
+ jQuery.event.trigger( event, data, this[0] );
+ return event.result;
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments, i = 1;
+
+ // link all the functions, so any of them can unbind this click handler
+ while ( i < args.length ) {
+ jQuery.proxy( fn, args[ i++ ] );
+ }
+
+ return this.click( jQuery.proxy( fn, function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ }));
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+var liveMap = {
+ focus: "focusin",
+ blur: "focusout",
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+ var type, i = 0, match, namespaces, preType,
+ selector = origSelector || this.selector,
+ context = origSelector ? this : jQuery( this.context );
+
+ if ( typeof types === "object" && !types.preventDefault ) {
+ for ( var key in types ) {
+ context[ name ]( key, data, types[key], selector );
+ }
+
+ return this;
+ }
+
+ if ( jQuery.isFunction( data ) ) {
+ fn = data;
+ data = undefined;
+ }
+
+ types = (types || "").split(" ");
+
+ while ( (type = types[ i++ ]) != null ) {
+ match = rnamespaces.exec( type );
+ namespaces = "";
+
+ if ( match ) {
+ namespaces = match[0];
+ type = type.replace( rnamespaces, "" );
+ }
+
+ if ( type === "hover" ) {
+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+ continue;
+ }
+
+ preType = type;
+
+ if ( type === "focus" || type === "blur" ) {
+ types.push( liveMap[ type ] + namespaces );
+ type = type + namespaces;
+
+ } else {
+ type = (liveMap[ type ] || type) + namespaces;
+ }
+
+ if ( name === "live" ) {
+ // bind live handler
+ for ( var j = 0, l = context.length; j < l; j++ ) {
+ jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+ }
+
+ } else {
+ // unbind live handler
+ context.unbind( "live." + liveConvert( type, selector ), fn );
+ }
+ }
+
+ return this;
+ };
+});
+
+function liveHandler( event ) {
+ var stop, maxLevel, elems = [], selectors = [],
+ related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+ events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
+
+ if ( typeof events === "function" ) {
+ events = events.events;
+ }
+
+ // Make sure we avoid non-left-click bubbling in Firefox (#3861)
+ if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
+ return;
+ }
+
+ if ( event.namespace ) {
+ namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ event.liveFired = this;
+
+ var live = events.live.slice(0);
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+ selectors.push( handleObj.selector );
+
+ } else {
+ live.splice( j--, 1 );
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ close = match[i];
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
+ elem = close.elem;
+ related = null;
+
+ // Those two events require additional checking
+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+ event.type = handleObj.preType;
+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, handleObj: handleObj, level: close.level });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+
+ if ( maxLevel && match.level > maxLevel ) {
+ break;
+ }
+
+ event.currentTarget = match.elem;
+ event.data = match.handleObj.data;
+ event.handleObj = match.handleObj;
+
+ ret = match.handleObj.origHandler.apply( match.elem, arguments );
+
+ if ( ret === false || event.isPropagationStopped() ) {
+ maxLevel = match.level;
+
+ if ( ret === false ) {
+ stop = false;
+ }
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
+}
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.bind( name, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+// Prevent memory leaks in IE
+// Window isn't included so as not to unbind existing unload events
+// More info:
+// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
+if ( window.attachEvent && !window.addEventListener ) {
+ jQuery(window).bind("unload", function() {
+ for ( var id in jQuery.cache ) {
+ if ( jQuery.cache[ id ].handle ) {
+ // Try/Catch is to handle iframes being unloaded, see #4280
+ try {
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+ } catch(e) {}
+ }
+ }
+ });
+}
+
+
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function(){
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context),
+ soFar = selector, ret, cur, pop, i;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec("");
+ m = chunker.exec(soFar);
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function(results){
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.matchesSelector = function(node, expr){
+ return Sizzle(expr, null, null, [node]).length > 0;
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && Sizzle.isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var filter = Expr.filter[ type ], found, item, left = match[1];
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+ },
+ leftMatch: {},
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ elem, i = 0, l = checkSet.length;
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck, nodeCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck, nodeCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+ NAME: function(match, context){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ return match[1].toLowerCase();
+ },
+ CHILD: function(match){
+ if ( match[1] === "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return (/h\d/i).test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
+ },
+ input: function(elem){
+ return (/input|select|textarea|button/i).test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 === i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ Sizzle.error( "Syntax error, unrecognized expression: " + name );
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ if ( type === "first" ) {
+ return true;
+ }
+ node = elem;
+ case 'last':
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first === 0 ) {
+ return diff === 0;
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [], i = 0;
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+} else {
+ sortOrder = function( a, b ) {
+ var ap = [], bp = [], aup = a.parentNode, bup = b.parentNode,
+ cur = aup, al, bl;
+
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+Sizzle.getText = function( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += Sizzle.getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+};
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime();
+ form.innerHTML = "
";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+ root = form = null; // release memory in IE
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "
";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+
+ div = null; // release memory in IE
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "
";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ if ( context.nodeType === 9 ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var old = context.id, id = context.id = "__sizzle__";
+
+ try {
+ return makeArray( context.querySelectorAll( "#" + id + " " + query ), extra );
+
+ } catch(pseudoError) {
+ } finally {
+ if ( old ) {
+ context.id = old;
+
+ } else {
+ context.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ div = null; // release memory in IE
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, ":sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ if ( matches ) {
+ Sizzle.matchesSelector = function( node, expr ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) ) {
+ return matches.call( node, expr );
+ }
+ } catch(e) {}
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "
";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ div = null; // release memory in IE
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+Sizzle.contains = document.documentElement.contains ? function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+} : function(a, b){
+ return !!(a.compareDocumentPosition(b) & 16);
+};
+
+Sizzle.isXML = function(elem){
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.POS;
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var ret = this.pushStack( "", "find", selector ), length = 0;
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( var n = length; n < ret.length; n++ ) {
+ for ( var r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && jQuery.filter( selector, this ).length > 0;
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ if ( jQuery.isArray( selectors ) ) {
+ var match, matches = {}, selector, level = 1;
+
+ if ( cur && selectors.length ) {
+ for ( i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[selector] ) {
+ matches[selector] = jQuery.expr.match.POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[selector];
+
+ if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
+ ret.push({ selector: selector, elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+ }
+
+ return ret;
+ }
+
+ var pos = POS.test( selectors ) ?
+ jQuery( selectors, context || this.context ) : null;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique(ret) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context || this.context ) :
+ jQuery.makeArray( selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, slice.call(arguments).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [], cur = elem[dir];
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+}
+
+
+
+
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /
\s]+\/)>/g,
+ wrapMap = {
+ option: [ 1, "", " " ],
+ legend: [ 1, "", " " ],
+ thead: [ 1, "" ],
+ tr: [ 2, "" ],
+ td: [ 3, "" ],
+ col: [ 2, "" ],
+ area: [ 1, "", " " ],
+ _default: [ 0, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize and
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard-ui/bower_components/web-animations-js/web-animations.min.js b/dashboard-ui/bower_components/web-animations-js/web-animations.min.js
new file mode 100644
index 0000000000..62c3ae57b7
--- /dev/null
+++ b/dashboard-ui/bower_components/web-animations-js/web-animations.min.js
@@ -0,0 +1,17 @@
+// Copyright 2014 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+!function(a,b){b["true"]=a,function(){if(document.documentElement.animate){var a=document.documentElement.animate([],0),b=!0;if(a&&(b=!1,"play|currentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split("|").forEach(function(c){void 0===a[c]&&(b=!0)})),!b)return}var c={},d={},e={},f=null;!function(a){function b(a){if("number"==typeof a)return a;var b={};for(var c in a)b[c]=a[c];return b}function c(b,c){var d={delay:0,endDelay:0,fill:c?"both":"none",iterationStart:0,iterations:1,duration:c?"auto":0,playbackRate:1,direction:"normal",easing:"linear"};return"number"!=typeof b||isNaN(b)?void 0!==b&&Object.getOwnPropertyNames(b).forEach(function(c){if("auto"!=b[c]){if(("number"==typeof d[c]||"duration"==c)&&("number"!=typeof b[c]||isNaN(b[c])))return;if("fill"==c&&-1==q.indexOf(b[c]))return;if("direction"==c&&-1==r.indexOf(b[c]))return;if("playbackRate"==c&&1!==b[c]&&a.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;d[c]=b[c]}}):d.duration=b,d}function d(a,b){var d=c(a,b);return d.easing=g(d.easing),d}function e(a,b,c,d){return 0>a||a>1||0>c||c>1?z:function(e){function f(a,b,c){return 3*a*(1-c)*(1-c)*c+3*b*(1-c)*c*c+c*c*c}if(0==e||1==e)return e;for(var g=0,h=1;;){var i=(g+h)/2,j=f(a,c,i);if(Math.abs(e-j)<.001)return f(b,d,i);e>j?g=i:h=i}}}function f(a,b){return function(c){if(c>=1)return 1;var d=1/a;return c+=b*d,c-c%d}}function g(a){var b=x.exec(a);if(b)return e.apply(this,b.slice(1).map(Number));var c=y.exec(a);if(c)return f(Number(c[1]),{start:s,middle:t,end:u}[c[2]]);var d=v[a];return d?d:z}function h(a){return Math.abs(i(a)/a.playbackRate)}function i(a){return a.duration*a.iterations}function j(a,b,c){return null==b?A:b=c.delay+a?C:D}function k(a,b,c,d,e){switch(d){case B:return"backwards"==b||"both"==b?0:null;case D:return c-e;case C:return"forwards"==b||"both"==b?a:null;case A:return null}}function l(a,b,c,d){return(d.playbackRate<0?b-a:b)*d.playbackRate+c}function m(a,b,c,d,e){return 1/0===c||c===-1/0||c-d==b&&e.iterations&&(e.iterations+e.iterationStart)%1==0?a:c%a}function n(a,b,c,d){return 0===c?0:b==a?d.iterationStart+d.iterations-1:Math.floor(c/a)}function o(a,b,c,d){var e=a%2>=1,f="normal"==d.direction||d.direction==(e?"alternate-reverse":"alternate"),g=f?c:b-c,h=g/b;return b*d.easing(h)}function p(a,b,c){var d=j(a,b,c),e=k(a,c.fill,b,d,c.delay);if(null===e)return null;if(0===a)return d===B?0:1;var f=c.iterationStart*c.duration,g=l(a,e,f,c),h=m(c.duration,i(c),g,f,c),p=n(c.duration,h,g,c);return o(p,c.duration,h,c)/c.duration}var q="backwards|forwards|both|none".split("|"),r="reverse|alternate|alternate-reverse".split("|"),s=1,t=.5,u=0,v={ease:e(.25,.1,.25,1),"ease-in":e(.42,0,1,1),"ease-out":e(0,0,.58,1),"ease-in-out":e(.42,0,.58,1),"step-start":f(1,s),"step-middle":f(1,t),"step-end":f(1,u)},w="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",x=new RegExp("cubic-bezier\\("+w+","+w+","+w+","+w+"\\)"),y=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,z=function(a){return a},A=0,B=1,C=2,D=3;a.cloneTimingInput=b,a.makeTiming=c,a.normalizeTimingInput=d,a.calculateActiveDuration=h,a.calculateTimeFraction=p,a.calculatePhase=j,a.toTimingFunction=g}(c,f),function(a){function b(a,b){return a in h?h[a][b]||b:b}function c(a,c,d){var g=e[a];if(g){f.style[a]=c;for(var h in g){var i=g[h],j=f.style[i];d[i]=b(i,j)}}else d[a]=b(a,c)}function d(b){function d(){var a=e.length;null==e[a-1].offset&&(e[a-1].offset=1),a>1&&null==e[0].offset&&(e[0].offset=0);for(var b=0,c=e[0].offset,d=1;a>d;d++){var f=e[d].offset;if(null!=f){for(var g=1;d-b>g;g++)e[b+g].offset=c+(f-c)*g/(d-b);b=d,c=f}}}if(!Array.isArray(b)&&null!==b)throw new TypeError("Keyframes must be null or an array of keyframes");if(null==b)return[];for(var e=b.map(function(b){var d={};for(var e in b){var f=b[e];if("offset"==e){if(null!=f&&(f=Number(f),!isFinite(f)))throw new TypeError("keyframe offsets must be numbers.")}else{if("composite"==e)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};f="easing"==e?a.toTimingFunction(f):""+f}c(e,f,d)}return void 0==d.offset&&(d.offset=null),void 0==d.easing&&(d.easing=a.toTimingFunction("linear")),d}),f=!0,g=-1/0,h=0;hi)throw{code:DOMException.INVALID_MODIFICATION_ERR,name:"InvalidModificationError",message:"Keyframes are not loosely sorted by offset. Sort or specify offsets."};g=i}else f=!1}return e=e.filter(function(a){return a.offset>=0&&a.offset<=1}),f||d(),e}var e={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},f=document.createElementNS("http://www.w3.org/1999/xhtml","div"),g={thin:"1px",medium:"3px",thick:"5px"},h={borderBottomWidth:g,borderLeftWidth:g,borderRightWidth:g,borderTopWidth:g,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:g,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};a.normalizeKeyframes=d}(c,f),function(a){var b={};a.isDeprecated=function(a,c,d,e){var f=e?"are":"is",g=new Date,h=new Date(c);return h.setMonth(h.getMonth()+3),h>g?(a in b||console.warn("Web Animations: "+a+" "+f+" deprecated and will stop working on "+h.toDateString()+". "+d),b[a]=!0,!1):!0},a.deprecated=function(b,c,d,e){var f=e?"are":"is";if(a.isDeprecated(b,c,d,e))throw new Error(b+" "+f+" no longer supported. "+d)}}(c),function(a,b){function c(a){for(var b={},c=0;c=c&&0==a.startTime||c>=1&&1==a.endTime||c>=a.startTime&&c<=a.endTime}).forEach(function(d){var e=c-d.startTime,f=d.endTime-d.startTime,g=0==f?0:d.easing(e/f);b.apply(a,d.property,d.interpolation(g))});else for(var d in g)"offset"!=d&&"easing"!=d&&"composite"!=d&&b.clear(a,d)}}}(c,d,f),function(a){function b(a,b,c){e[c]=e[c]||[],e[c].push([a,b])}function c(a,c,d){for(var e=0;ethis._surrogateStyle.length;)this._length--,Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,value:void 0})},_set:function(a,b){this._style[a]=b,this._isAnimatedProperty[a]=!0},_clear:function(a){this._style[a]=this._surrogateStyle[a],delete this._isAnimatedProperty[a]}};for(var h in f)c.prototype[h]=function(a,b){return function(){var c=this._surrogateStyle[a].apply(this._surrogateStyle,arguments);return b&&(this._isAnimatedProperty[arguments[0]]||this._style[a].apply(this._style,arguments),this._updateIndices()),c}}(h,h in g);for(var i in document.documentElement.style)i in e||i in f||!function(a){b(c.prototype,a,{get:function(){return this._surrogateStyle[a]},set:function(b){this._surrogateStyle[a]=b,this._updateIndices(),this._isAnimatedProperty[a]||(this._style[a]=b)}})}(i);a.apply=function(b,c,e){d(b),b.style._set(a.propertyName(c),e)},a.clear=function(b,c){b._webAnimationsPatchedStyle&&b.style._clear(a.propertyName(c))}}(d,f),function(a){window.Element.prototype.animate=function(b,c){return a.timeline._play(a.KeyframeEffect(this,b,c))}}(d),function(a){function b(a,c,d){if("number"==typeof a&&"number"==typeof c)return a*(1-d)+c*d;if("boolean"==typeof a&&"boolean"==typeof c)return.5>d?a:c;if(a.length==c.length){for(var e=[],f=0;fj;j++)g.push(c[j]*(Math.cos(e*h)-f*i)+d[j]*i);return g}var d=function(){function a(a,b){for(var c=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],d=0;4>d;d++)for(var e=0;4>e;e++)for(var f=0;4>f;f++)c[d][e]+=b[d][f]*a[f][e];return c}function b(a){return 0==a[0][2]&&0==a[0][3]&&0==a[1][2]&&0==a[1][3]&&0==a[2][0]&&0==a[2][1]&&1==a[2][2]&&0==a[2][3]&&0==a[3][2]&&1==a[3][3]}function c(c,d,e,f,g){for(var h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],i=0;4>i;i++)h[i][3]=g[i];for(var i=0;3>i;i++)for(var j=0;3>j;j++)h[3][i]+=c[j]*h[j][i];var k=f[0],l=f[1],m=f[2],n=f[3],o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];o[0][0]=1-2*(l*l+m*m),o[0][1]=2*(k*l-m*n),o[0][2]=2*(k*m+l*n),o[1][0]=2*(k*l+m*n),o[1][1]=1-2*(k*k+m*m),o[1][2]=2*(l*m-k*n),o[2][0]=2*(k*m-l*n),o[2][1]=2*(l*m+k*n),o[2][2]=1-2*(k*k+l*l),h=a(h,o);var p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];e[2]&&(p[2][1]=e[2],h=a(h,p)),e[1]&&(p[2][1]=0,p[2][0]=e[0],h=a(h,p)),e[0]&&(p[2][0]=0,p[1][0]=e[0],h=a(h,p));for(var i=0;3>i;i++)for(var j=0;3>j;j++)h[i][j]*=d[i];return b(h)?[h[0][0],h[0][1],h[1][0],h[1][1],h[3][0],h[3][1]]:h[0].concat(h[1],h[2],h[3])}return c}();a.composeMatrix=d,a.quat=c}(d,f),function(a,b){a.sequenceNumber=0;var c=function(a,b,c){this.target=a,this.currentTime=b,this.timelineTime=c,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=a,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};b.Animation=function(b){this._sequenceNumber=a.sequenceNumber++,this._currentTime=0,this._startTime=null,this._paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!1,this.onfinish=null,this._finishHandlers=[],this._effect=b,this._inEffect=this._effect._update(0),this._idle=!0,this._currentTimePending=!1},b.Animation.prototype={_ensureAlive:function(){this._inEffect=this._effect._update(this.playbackRate<0&&0===this.currentTime?-1:this.currentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,b.timeline._animations.push(this))},_tickCurrentTime:function(a,b){a!=this._currentTime&&(this._currentTime=a,this._isFinished&&!b&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(a){a=+a,isNaN(a)||(b.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-a/this._playbackRate),this._currentTimePending=!1,this._currentTime!=a&&(this._tickCurrentTime(a,!0),b.invalidateEffects()))},get startTime(){return this._startTime},set startTime(a){a=+a,isNaN(a)||this._paused||this._idle||(this._startTime=a,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),b.invalidateEffects())},get playbackRate(){return this._playbackRate},set playbackRate(a){if(a!=this._playbackRate){var b=this.currentTime;this._playbackRate=a,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&this.play(),null!=b&&(this.currentTime=b)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._currentTime=this._playbackRate>0?0:this._totalDuration,this._startTime=null,b.invalidateEffects()),this._finishedFlag=!1,b.restart(),this._idle=!1,this._ensureAlive()},pause:function(){this._isFinished||this._paused||this._idle||(this._currentTimePending=!0),this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1)},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this.currentTime=0,this._startTime=null,this._effect._update(null),b.invalidateEffects(),b.restart())},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(a,b){"function"==typeof b&&"finish"==a&&this._finishHandlers.push(b)},removeEventListener:function(a,b){if("finish"==a){var c=this._finishHandlers.indexOf(b);c>=0&&this._finishHandlers.splice(c,1)}},_fireEvents:function(a){var b=this._isFinished;if((b||this._idle)&&!this._finishedFlag){var d=new c(this,this._currentTime,a),e=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout(function(){e.forEach(function(a){a.call(d.target,d)})},0)}this._finishedFlag=b},_tick:function(a){return this._idle||this._paused||(null==this._startTime?this.startTime=a-this._currentTime/this.playbackRate:this._isFinished||this._tickCurrentTime((a-this._startTime)*this.playbackRate)),this._currentTimePending=!1,this._fireEvents(a),!this._idle&&(this._inEffect||!this._finishedFlag)}}}(c,d,f),function(a,b){function c(a){var b=i;i=[],a0&&(s.currentTime+=q*(Math.floor((a-s.currentTime)/q)+1)),g(s.currentTime)}return f(),r.apply(this,arguments)}});var s=new e;b.timeline=s}(c,d,f),function(a){function b(a,b){for(var c=0,d=0;do;o++){for(var p=0,q=0;3>q;q++)p+=b[3][q]*m[q][o];n.push(p)}return n.push(1),m.push(n),m}function d(a){return[[a[0][0],a[1][0],a[2][0],a[3][0]],[a[0][1],a[1][1],a[2][1],a[3][1]],[a[0][2],a[1][2],a[2][2],a[3][2]],[a[0][3],a[1][3],a[2][3],a[3][3]]]}function e(a,b){for(var c=[],d=0;4>d;d++){for(var e=0,f=0;4>f;f++)e+=a[f]*b[f][d];c.push(e)}return c}function f(a){var b=g(a);return[a[0]/b,a[1]/b,a[2]/b]}function g(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2])}function h(a,b,c,d){return[c*a[0]+d*b[0],c*a[1]+d*b[1],c*a[2]+d*b[2]]}function i(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function j(j){var k=[j.slice(0,4),j.slice(4,8),j.slice(8,12),j.slice(12,16)];if(1!==k[3][3])return null;for(var l=[],m=0;4>m;m++)l.push(k[m].slice());for(var m=0;3>m;m++)l[m][3]=0;if(0===a(l))return!1;var n,o=[];if(k[0][3]||k[1][3]||k[2][3]){o.push(k[0][3]),o.push(k[1][3]),o.push(k[2][3]),o.push(k[3][3]);var p=c(l),q=d(p);n=e(o,q)}else n=[0,0,0,1];var r=k[3].slice(0,3),s=[];s.push(k[0].slice(0,3));var t=[];t.push(g(s[0])),s[0]=f(s[0]);var u=[];s.push(k[1].slice(0,3)),u.push(b(s[0],s[1])),s[1]=h(s[1],s[0],1,-u[0]),t.push(g(s[1])),s[1]=f(s[1]),u[0]/=t[1],s.push(k[2].slice(0,3)),u.push(b(s[0],s[2])),s[2]=h(s[2],s[0],1,-u[1]),u.push(b(s[1],s[2])),s[2]=h(s[2],s[1],1,-u[2]),t.push(g(s[2])),s[2]=f(s[2]),u[1]/=t[2],u[2]/=t[2];var v=i(s[1],s[2]);if(b(s[0],v)<0)for(var m=0;3>m;m++)t[m]*=-1,s[m][0]*=-1,s[m][1]*=-1,s[m][2]*=-1;var w,x,y=s[0][0]+s[1][1]+s[2][2]+1;return y>1e-4?(w=.5/Math.sqrt(y),x=[(s[2][1]-s[1][2])*w,(s[0][2]-s[2][0])*w,(s[1][0]-s[0][1])*w,.25/w]):s[0][0]>s[1][1]&&s[0][0]>s[2][2]?(w=2*Math.sqrt(1+s[0][0]-s[1][1]-s[2][2]),x=[.25*w,(s[0][1]+s[1][0])/w,(s[0][2]+s[2][0])/w,(s[2][1]-s[1][2])/w]):s[1][1]>s[2][2]?(w=2*Math.sqrt(1+s[1][1]-s[0][0]-s[2][2]),x=[(s[0][1]+s[1][0])/w,.25*w,(s[1][2]+s[2][1])/w,(s[0][2]-s[2][0])/w]):(w=2*Math.sqrt(1+s[2][2]-s[0][0]-s[1][1]),x=[(s[0][2]+s[2][0])/w,(s[1][2]+s[2][1])/w,.25*w,(s[1][0]-s[0][1])/w]),[r,t,u,x,n]}return j}();a.dot=b,a.makeMatrixDecomposition=f}(d,f),function(a){function b(a,b){var c=a.exec(b);return c?(c=a.ignoreCase?c[0].toLowerCase():c[0],[c,b.substr(c.length)]):void 0}function c(a,b){b=b.replace(/^\s*/,"");var c=a(b);return c?[c[0],c[1].replace(/^\s*/,"")]:void 0}function d(a,d,e){a=c.bind(null,a);for(var f=[];;){var g=a(e);if(!g)return[f,e];if(f.push(g[0]),e=g[1],g=b(d,e),!g||""==g[1])return[f,e];e=g[1]}}function e(a,b){for(var c=0,d=0;d=c))break;var e=a(b.substr(0,d));return void 0==e?void 0:[e,b.substr(d)]}function f(a,b){for(var c=a,d=b;c&&d;)c>d?c%=d:d%=c;return c=a*b/(c+d)}function g(a){return function(b){var c=a(b);return c&&(c[0]=void 0),c}}function h(a,b){return function(c){var d=a(c);return d?d:[b,c]}}function i(b,c){for(var d=[],e=0;ek;k++){var l=b(d[k%d.length],e[k%e.length]);if(!l)return;g.push(l[0]),h.push(l[1]),i.push(l[2])}return[g,h,function(b){var d=b.map(function(a,b){return i[b](a)}).join(c);return a?a(d):d}]}function k(a,b,c){for(var d=[],e=[],f=[],g=0,h=0;h=c?a:c>=1?b:"visible"}]:void 0}a.addPropertiesHandler(String,b,["visibility"])}(d),function(a){function b(a){a=a.trim(),e.fillStyle="#000",e.fillStyle=a;var b=e.fillStyle;if(e.fillStyle="#fff",e.fillStyle=a,b==e.fillStyle){e.fillRect(0,0,1,1);var c=e.getImageData(0,0,1,1).data;e.clearRect(0,0,1,1);var d=c[3]/255;return[c[0]*d,c[1]*d,c[2]*d,d]}}function c(b,c){return[b,c,function(b){function c(a){return Math.max(0,Math.min(255,a))}if(b[3])for(var d=0;3>d;d++)b[d]=Math.round(c(b[d]/b[3]));return b[3]=a.numberToString(a.clamp(0,1,b[3])),"rgba("+b.join(",")+")"}]}var d=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");d.width=d.height=1;var e=d.getContext("2d");a.addPropertiesHandler(b,c,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","outline-color","text-decoration-color"]),a.consumeColor=a.consumeParenthesised.bind(null,b),a.mergeColors=c}(d,f),function(a,b){function c(a,b){if(b=b.trim().toLowerCase(),"0"==b&&"px".search(a)>=0)return{px:0};if(/^[^(]*$|^calc/.test(b)){b=b.replace(/calc\(/g,"(");var c={};b=b.replace(a,function(a){return c[a]=null,"U"+a});for(var d="U("+a.source+")",e=b.replace(/[-+]?(\d*\.)?\d+/g,"N").replace(new RegExp("N"+d,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),f=[/N\*(D)/g,/(N|D)[*/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],g=0;g1?"calc("+c+")":c}]}var f="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",g=c.bind(null,new RegExp(f,"g")),h=c.bind(null,new RegExp(f+"|%","g")),i=c.bind(null,/deg|rad|grad|turn/g);a.parseLength=g,a.parseLengthOrPercent=h,a.consumeLengthOrPercent=a.consumeParenthesised.bind(null,h),a.parseAngle=i,a.mergeDimensions=e;
+var j=a.consumeParenthesised.bind(null,g),k=a.consumeRepeated.bind(void 0,j,/^/),l=a.consumeRepeated.bind(void 0,k,/^,/);a.consumeSizePairList=l;var m=function(a){var b=l(a);return b&&""==b[1]?b[0]:void 0},n=a.mergeNestedRepeated.bind(void 0,d," "),o=a.mergeNestedRepeated.bind(void 0,n,",");a.mergeNonNegativeSizePair=n,a.addPropertiesHandler(m,o,["background-size"]),a.addPropertiesHandler(h,d,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),a.addPropertiesHandler(h,e,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","text-indent","top","vertical-align","word-spacing"])}(d,f),function(a){function b(b){return a.consumeLengthOrPercent(b)||a.consumeToken(/^auto/,b)}function c(c){var d=a.consumeList([a.ignore(a.consumeToken.bind(null,/^rect/)),a.ignore(a.consumeToken.bind(null,/^\(/)),a.consumeRepeated.bind(null,b,/^,/),a.ignore(a.consumeToken.bind(null,/^\)/))],c);return d&&4==d[0].length?d[0]:void 0}function d(b,c){return"auto"==b||"auto"==c?[!0,!1,function(d){var e=d?b:c;if("auto"==e)return"auto";var f=a.mergeDimensions(e,e);return f[2](f[0])}]:a.mergeDimensions(b,c)}function e(a){return"rect("+a+")"}var f=a.mergeWrappedNestedRepeated.bind(null,e,d,", ");a.parseBox=c,a.mergeBoxes=f,a.addPropertiesHandler(c,f,["clip"])}(d,f),function(a){function b(a){return function(b){var c=0;return a.map(function(a){return a===j?b[c++]:a})}}function c(a){return a}function d(b){if(b=b.toLowerCase().trim(),"none"==b)return[];for(var c,d=/\s*(\w+)\(([^)]*)\)/g,e=[],f=0;c=d.exec(b);){if(c.index!=f)return;f=c.index+c[0].length;var g=c[1],h=m[g];if(!h)return;var i=c[2].split(","),j=h[0];if(j.lengthb||b>900||b%100!==0?void 0:b}function c(b){return b=100*Math.round(b/100),b=a.clamp(100,900,b),400===b?"normal":700===b?"bold":String(b)}function d(a,b){return[a,b,c]}a.addPropertiesHandler(b,d,["font-weight"])}(d),function(a){function b(a){var b={};for(var c in a)b[c]=-a[c];return b}function c(b){return a.consumeToken(/^(left|center|right|top|bottom)\b/i,b)||a.consumeLengthOrPercent(b)}function d(b,d){var e=a.consumeRepeated(c,/^/,d);if(e&&""==e[1]){var f=e[0];if(f[0]=f[0]||"center",f[1]=f[1]||"center",3==b&&(f[2]=f[2]||{px:0}),f.length==b){if(/top|bottom/.test(f[0])||/left|right/.test(f[1])){var h=f[0];f[0]=f[1],f[1]=h}if(/left|right|center|Object/.test(f[0])&&/top|bottom|center|Object/.test(f[1]))return f.map(function(a){return"object"==typeof a?a:g[a]})}}}function e(d){var e=a.consumeRepeated(c,/^/,d);if(e){for(var f=e[0],h=[{"%":50},{"%":50}],i=0,j=!1,k=0;k= 0) {
return;
}
@@ -564,9 +564,9 @@ window.CustomElements.addModule(function(scope) {
flags.dom && console.groupEnd();
}
function takeRecords(node) {
- node = wrap(node);
+ node = window.wrap(node);
if (!node) {
- node = wrap(document);
+ node = window.wrap(document);
}
while (node.parentNode) {
node = node.parentNode;
@@ -590,7 +590,7 @@ window.CustomElements.addModule(function(scope) {
inRoot.__observer = observer;
}
function upgradeDocument(doc) {
- doc = wrap(doc);
+ doc = window.wrap(doc);
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
addedNode(doc);
observe(doc);
@@ -603,7 +603,7 @@ window.CustomElements.addModule(function(scope) {
if (originalCreateShadowRoot) {
Element.prototype.createShadowRoot = function() {
var root = originalCreateShadowRoot.call(this);
- CustomElements.watchShadow(this);
+ window.CustomElements.watchShadow(this);
return root;
};
}
@@ -909,8 +909,8 @@ window.CustomElements.addModule(function(scope) {
var upgradeDocumentTree = scope.upgradeDocumentTree;
if (!window.wrap) {
if (window.ShadowDOMPolyfill) {
- window.wrap = ShadowDOMPolyfill.wrapIfNeeded;
- window.unwrap = ShadowDOMPolyfill.unwrapIfNeeded;
+ window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;
+ window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;
} else {
window.wrap = window.unwrap = function(node) {
return node;
@@ -918,17 +918,17 @@ window.CustomElements.addModule(function(scope) {
}
}
function bootstrap() {
- upgradeDocumentTree(wrap(document));
+ upgradeDocumentTree(window.wrap(document));
if (window.HTMLImports) {
- HTMLImports.__importsParsingHook = function(elt) {
+ window.HTMLImports.__importsParsingHook = function(elt) {
upgradeDocumentTree(wrap(elt.import));
};
}
- CustomElements.ready = true;
+ window.CustomElements.ready = true;
setTimeout(function() {
- CustomElements.readyTime = Date.now();
+ window.CustomElements.readyTime = Date.now();
if (window.HTMLImports) {
- CustomElements.elapsed = CustomElements.readyTime - HTMLImports.readyTime;
+ window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;
}
document.dispatchEvent(new CustomEvent("WebComponentsReady", {
bubbles: true
@@ -940,6 +940,13 @@ window.CustomElements.addModule(function(scope) {
params = params || {};
var e = document.createEvent("CustomEvent");
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
+ e.preventDefault = function() {
+ Object.defineProperty(this, "defaultPrevented", {
+ get: function() {
+ return true;
+ }
+ });
+ };
return e;
};
window.CustomEvent.prototype = window.Event.prototype;
@@ -949,7 +956,7 @@ window.CustomElements.addModule(function(scope) {
} else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
bootstrap();
} else {
- var loadEvent = window.HTMLImports && !HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
+ var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
window.addEventListener(loadEvent, bootstrap);
}
scope.isIE11OrOlder = isIE11OrOlder;
diff --git a/dashboard-ui/bower_components/webcomponentsjs/CustomElements.min.js b/dashboard-ui/bower_components/webcomponentsjs/CustomElements.min.js
new file mode 100644
index 0000000000..c4eff21f45
--- /dev/null
+++ b/dashboard-ui/bower_components/webcomponentsjs/CustomElements.min.js
@@ -0,0 +1,11 @@
+/**
+ * @license
+ * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+ * Code distributed by Google as part of the polymer project is also
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+ */
+// @version 0.7.5
+"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var o=t[this.name];return o&&o[0]===t?o[1]=n:e(t,this.name,{value:[t,n],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,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){_.push(e),b||(b=!0,h(o))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function o(){b=!1;var e=_;_=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();r(e),n.length&&(e.callback_(n,e),t=!0)}),t&&o()}function r(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var o=v.get(n);if(o)for(var r=0;r0){var r=n[o-1],i=p(r,e);if(i)return void(n[o-1]=i)}else t(this.observer);n[o]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;n=0)){n.push(e);for(var o,r=e.querySelectorAll("link[rel="+a+"]"),d=0,s=r.length;s>d&&(o=r[d]);d++)o["import"]&&i(o["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=r,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e){return n(e)||o(e)}function n(t){return e.upgrade(t)?!0:void d(t)}function o(e){_(e,function(e){return n(e)?!0:void 0})}function r(e){d(e),f(e)&&_(e,function(e){d(e)})}function i(e){O.push(e),N||(N=!0,setTimeout(a))}function a(){N=!1;for(var e,t=O,n=0,o=t.length;o>n&&(e=t[n]);n++)e();O=[]}function d(e){y?i(function(){s(e)}):s(e)}function s(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&!e.__attached&&f(e)&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function u(e){c(e),_(e,function(e){c(e)})}function c(e){y?i(function(){l(e)}):l(e)}function l(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&e.__attached&&!f(e)&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function f(e){for(var t=e,n=wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function p(e){if(e.shadowRoot&&!e.shadowRoot.__watched){b.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)v(t),t=t.olderShadowRoot}}function m(e){if(b.dom){var n=e[0];if(n&&"childList"===n.type&&n.addedNodes&&n.addedNodes){for(var o=n.addedNodes[0];o&&o!==document&&!o.host;)o=o.parentNode;var r=o&&(o.URL||o._URL||o.host&&o.host.localName)||"";r=r.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,r||"")}e.forEach(function(e){"childList"===e.type&&(M(e.addedNodes,function(e){e.localName&&t(e)}),M(e.removedNodes,function(e){e.localName&&u(e)}))}),b.dom&&console.groupEnd()}function h(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(m(t.takeRecords()),a())}function v(e){if(!e.__observer){var t=new MutationObserver(m);t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function w(e){e=window.wrap(e),b.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop()),t(e),v(e),b.dom&&console.groupEnd()}function g(e){E(e,w)}var b=e.flags,_=e.forSubtree,E=e.forDocumentTree,y=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;e.hasPolyfillMutations=y;var N=!1,O=[],M=Array.prototype.forEach.call.bind(Array.prototype.forEach),L=Element.prototype.createShadowRoot;L&&(Element.prototype.createShadowRoot=function(){var e=L.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=p,e.upgradeDocumentTree=g,e.upgradeSubtree=o,e.upgradeAll=t,e.attachedNode=r,e.takeRecords=h}),window.CustomElements.addModule(function(e){function t(t){if(!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var o=t.getAttribute("is"),r=e.getRegisteredDefinition(o||t.localName);if(r){if(o&&r.tag==t.localName)return n(t,r);if(!o&&!r["extends"])return n(t,r)}}}function n(t,n){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),o(t,n),t.__upgraded__=!0,i(t),e.attachedNode(t),e.upgradeSubtree(t),a.upgrade&&console.groupEnd(),t}function o(e,t){Object.__proto__?e.__proto__=t.prototype:(r(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function r(e,t,n){for(var o={},r=t;r!==n&&r!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(r),d=0;i=a[d];d++)o[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i)),o[i]=1);r=Object.getPrototypeOf(r)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=o}),window.CustomElements.addModule(function(e){function t(t,o){var s=o||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(r(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(u(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return s.prototype||(s.prototype=Object.create(HTMLElement.prototype)),s.__name=t.toLowerCase(),s.lifecycle=s.lifecycle||{},s.ancestry=i(s["extends"]),a(s),d(s),n(s.prototype),c(s.__name,s),s.ctor=l(s),s.ctor.prototype=s.prototype,s.prototype.constructor=s.ctor,e.ready&&w(document),s.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){o.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){o.call(this,e,null,n)},e.setAttribute._polyfilled=!0}}function o(e,t,n){e=e.toLowerCase();var o=this.getAttribute(e);n.apply(this,arguments);var r=this.getAttribute(e);this.attributeChangedCallback&&r!==o&&this.attributeChangedCallback(e,o,r)}function r(e){for(var t=0;t=0&&_(o,HTMLElement),o)}function m(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return g(e),e}}var h,v=e.isIE11OrOlder,w=e.upgradeDocumentTree,g=e.upgradeAll,b=e.upgradeWithDefinition,_=e.implementPrototype,E=e.useNative,y=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],N={},O="http://www.w3.org/1999/xhtml",M=document.createElement.bind(document),L=document.createElementNS.bind(document);h=Object.__proto__||E?function(e,t){return e instanceof t}:function(e,t){for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},m(Node.prototype,"cloneNode"),m(document,"importNode"),v&&!function(){var e=document.importNode;document.importNode=function(){var t=e.apply(document,arguments);if(t.nodeType==t.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(t),n}return t}}(),document.registerElement=t,document.createElement=p,document.createElementNS=f,e.registry=N,e["instanceof"]=h,e.reservedTagList=y,e.getRegisteredDefinition=u,document.register=document.registerElement}),function(e){function t(){a(window.wrap(document)),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){a(wrap(e["import"]))}),window.CustomElements.ready=!0,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,o=e.initializeModules,r=/Trident/.test(navigator.userAgent);if(n){var i=function(){};e.watchShadow=i,e.upgrade=i,e.upgradeAll=i,e.upgradeDocumentTree=i,e.upgradeSubtree=i,e.takeRecords=i,e["instanceof"]=function(e,t){return e instanceof t}}else o();var a=e.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),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.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var d=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(d,t)}else t();e.isIE11OrOlder=r}(window.CustomElements);
\ No newline at end of file
diff --git a/dashboard-ui/thirdparty/webcomponentsjs/HTMLImports.js b/dashboard-ui/bower_components/webcomponentsjs/HTMLImports.js
similarity index 97%
rename from dashboard-ui/thirdparty/webcomponentsjs/HTMLImports.js
rename to dashboard-ui/bower_components/webcomponentsjs/HTMLImports.js
index eb560c4cd6..e9f03ecf81 100644
--- a/dashboard-ui/thirdparty/webcomponentsjs/HTMLImports.js
+++ b/dashboard-ui/bower_components/webcomponentsjs/HTMLImports.js
@@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
-// @version 0.7.3
+// @version 0.7.5
if (typeof WeakMap === "undefined") {
(function() {
var defineProperty = Object.defineProperty;
@@ -352,19 +352,19 @@ window.HTMLImports = window.HTMLImports || {
var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement("link"));
var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill);
var wrap = function(node) {
- return hasShadowDOMPolyfill ? ShadowDOMPolyfill.wrapIfNeeded(node) : node;
+ return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node;
};
var rootDocument = wrap(document);
var currentScriptDescriptor = {
get: function() {
- var script = HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null);
+ var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null);
return wrap(script);
},
configurable: true
};
Object.defineProperty(document, "_currentScript", currentScriptDescriptor);
Object.defineProperty(rootDocument, "_currentScript", currentScriptDescriptor);
- var isIE = /Trident|Edge/.test(navigator.userAgent);
+ var isIE = /Trident/.test(navigator.userAgent);
function whenReady(callback, doc) {
doc = doc || rootDocument;
whenDocumentReady(function() {
@@ -473,8 +473,8 @@ window.HTMLImports = window.HTMLImports || {
})();
}
whenReady(function(detail) {
- HTMLImports.ready = true;
- HTMLImports.readyTime = new Date().getTime();
+ window.HTMLImports.ready = true;
+ window.HTMLImports.readyTime = new Date().getTime();
var evt = rootDocument.createEvent("CustomEvent");
evt.initCustomEvent("HTMLImportsLoaded", true, true, detail);
rootDocument.dispatchEvent(evt);
@@ -748,8 +748,8 @@ window.HTMLImports.addModule(function(scope) {
}
},
parseImport: function(elt) {
- if (HTMLImports.__importsParsingHook) {
- HTMLImports.__importsParsingHook(elt);
+ if (window.HTMLImports.__importsParsingHook) {
+ window.HTMLImports.__importsParsingHook(elt);
}
if (elt.import) {
elt.import.__importParsed = true;
@@ -1061,6 +1061,13 @@ window.HTMLImports.addModule(function(scope) {
params = params || {};
var e = document.createEvent("CustomEvent");
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
+ e.preventDefault = function() {
+ Object.defineProperty(this, "defaultPrevented", {
+ get: function() {
+ return true;
+ }
+ });
+ };
return e;
};
window.CustomEvent.prototype = window.Event.prototype;
@@ -1068,7 +1075,7 @@ window.HTMLImports.addModule(function(scope) {
initializeModules();
var rootDocument = scope.rootDocument;
function bootstrap() {
- HTMLImports.importer.bootDocument(rootDocument);
+ window.HTMLImports.importer.bootDocument(rootDocument);
}
if (document.readyState === "complete" || document.readyState === "interactive" && !window.attachEvent) {
bootstrap();
diff --git a/dashboard-ui/bower_components/webcomponentsjs/HTMLImports.min.js b/dashboard-ui/bower_components/webcomponentsjs/HTMLImports.min.js
new file mode 100644
index 0000000000..c13580a7fe
--- /dev/null
+++ b/dashboard-ui/bower_components/webcomponentsjs/HTMLImports.min.js
@@ -0,0 +1,11 @@
+/**
+ * @license
+ * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+ * Code distributed by Google as part of the polymer project is also
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+ */
+// @version 0.7.5
+"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],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,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){_.push(e),w||(w=!0,f(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){w=!1;var e=_;_=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=v.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=m(o,e);if(i)return void(n[r-1]=i)}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;nm&&(h=s[m]);m++)a(h)?(d++,n()):(h.addEventListener("load",r),h.addEventListener("error",i));else n()}function a(e){return l?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)d(t)&&c(t)}function d(e){return"link"===e.localName&&"import"===e.rel}function c(e){var t=e["import"];t?o({target:e}):(e.addEventListener("load",o),e.addEventListener("error",o))}var u="import",l=Boolean(u in document.createElement("link")),h=Boolean(window.ShadowDOMPolyfill),m=function(e){return h?window.ShadowDOMPolyfill.wrapIfNeeded(e):e},p=m(document),f={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return m(e)},configurable:!0};Object.defineProperty(document,"_currentScript",f),Object.defineProperty(p,"_currentScript",f);var v=/Trident/.test(navigator.userAgent),b=v?"complete":"interactive",g="readystatechange";l&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,r=t.length;r>n&&(e=t[n]);n++)c(e)}()),t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=p.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),p.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=u,e.useNative=l,e.rootDocument=p,e.whenReady=t,e.isIE=v}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},r=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=r}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,r={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,r=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,r),e},resolveUrlsInCssText:function(e,r,o){var i=this.replaceUrls(e,o,r,t);return i=this.replaceUrls(i,o,r,n)},replaceUrls:function(e,t,n,r){return e.replace(r,function(e,r,o,i){var a=o.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,r+"'"+a+"'"+i})}};e.path=r}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,r,o){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var n=i.getResponseHeader("Location"),a=null;if(n)var a="/"===n.substr(0,1)?location.origin+n:n;r.call(o,!t.ok(i)&&i,i.response||i.responseText,a)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,r=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};r.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;r>n&&(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){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,r){if(n.load&&console.log("fetch",e,r),e)if(e.match(/^data:/)){var o=e.split(","),i=o[0],a=o[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,r,null,a)}.bind(this),0)}else{var s=function(t,n,o){this.receive(e,r,t,n,o)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,r,{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,d=a.length;d>s&&(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=r}),window.HTMLImports.addModule(function(e){var t=function(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;r>n&&(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;r>n&&(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(e){function t(e){return"link"===e.localName&&e.rel===u}function n(e){var t=r(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function r(e){return e.textContent+o(e)}function o(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,r=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+r+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,d=e.flags,c=e.isIE,u=e.IMPORT_LINK_TYPE,l="link[rel="+u+"]",h={documentSelectors:l,importsSelectors:[l,"link[rel=stylesheet]","style","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){if(this.isParsed(e))return void(d.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){d.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,d.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.dispatchEvent(e.__resource&&!e.__error?new CustomEvent("load",{bubbles:!1}):new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,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(e,t){var n=this,r=function(r){t&&t(r),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",r),e.addEventListener("error",r),c&&"style"===e.localName){var o=!1;if(-1==e.textContent.indexOf("@import"))o=!0;else if(e.sheet){o=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,d=0;s>d&&(i=a[d]);d++)i.type===CSSRule.IMPORT_RULE&&(o=o&&Boolean(i.styleSheet))}o&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var r=document.createElement("script");r.__importElement=t,r.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(r,function(t){r.parentNode.removeChild(r),e.currentScript=null}),this.addElementToDocument(r)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var r,o=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=o.length;a>i&&(r=o[i]);i++)if(!this.isParsed(r))return this.hasResource(r)?t(r)?this.nextToParseInDoc(r["import"],r):r:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return t(e)&&void 0===e["import"]?!1:!0}};e.parser=h,e.IMPORT_SELECTOR=l}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function o(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var o=n.createElement("base");o.setAttribute("href",t),n.baseURI||r(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(o),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,d=e.rootDocument,c=e.Loader,u=e.Observer,l=e.parser,h={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){m.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);m.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===d?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,r,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=r,n.__error=a,t(n)){var d=this.documents[e];void 0===d&&(d=a?null:o(r,s||e),d&&(d.__importLink=n,this.bootDocument(d)),this.documents[e]=d),n["import"]=d}l.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),l.parseNext()},loadedAll:function(){l.parseNext()}},m=new c(h.loaded.bind(h),h.loadedAll.bind(h));if(h.observer=new u,!document.baseURI){var p={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",p),Object.defineProperty(d,"baseURI",p)}e.importer=h,e.importLoader=m}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,r={added:function(e){for(var r,o,i,a,s=0,d=e.length;d>s&&(a=e[s]);s++)r||(r=a.ownerDocument,o=t.isParsed(r)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&o&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&o.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&o.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=r.added.bind(r);var o=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){window.HTMLImports.importer.bootDocument(o)}var n=e.initializeModules,r=e.isIE;if(!e.useNative){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.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),n();var o=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports);
\ No newline at end of file
diff --git a/dashboard-ui/thirdparty/webcomponentsjs/MutationObserver.js b/dashboard-ui/bower_components/webcomponentsjs/MutationObserver.js
similarity index 99%
rename from dashboard-ui/thirdparty/webcomponentsjs/MutationObserver.js
rename to dashboard-ui/bower_components/webcomponentsjs/MutationObserver.js
index 34a2bb3ccf..b8fb3cf47a 100644
--- a/dashboard-ui/thirdparty/webcomponentsjs/MutationObserver.js
+++ b/dashboard-ui/bower_components/webcomponentsjs/MutationObserver.js
@@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
-// @version 0.7.3
+// @version 0.7.5
if (typeof WeakMap === "undefined") {
(function() {
var defineProperty = Object.defineProperty;
diff --git a/dashboard-ui/thirdparty/webcomponentsjs/MutationObserver.min.js b/dashboard-ui/bower_components/webcomponentsjs/MutationObserver.min.js
similarity index 99%
rename from dashboard-ui/thirdparty/webcomponentsjs/MutationObserver.min.js
rename to dashboard-ui/bower_components/webcomponentsjs/MutationObserver.min.js
index b5751a0d80..45b4cbf880 100644
--- a/dashboard-ui/thirdparty/webcomponentsjs/MutationObserver.min.js
+++ b/dashboard-ui/bower_components/webcomponentsjs/MutationObserver.min.js
@@ -7,5 +7,5 @@
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
-// @version 0.7.3
+// @version 0.7.5
"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,r=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};r.prototype={set:function(t,r){var i=t[this.name];return i&&i[0]===t?i[1]=r:e(t,this.name,{value:[t,r],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,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=r}(),function(e){function t(e){O.push(e),N||(N=!0,b(i))}function r(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function i(){N=!1;var e=O;O=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var r=e.takeRecords();n(e),r.length&&(e.callback_(r,e),t=!0)}),t&&i()}function n(e){e.nodes_.forEach(function(t){var r=p.get(t);r&&r.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function a(e,t){for(var r=e;r;r=r.parentNode){var i=p.get(r);if(i)for(var n=0;n0){var n=r[i-1],a=l(n,e);if(a)return void(r[i-1]=a)}else t(this.observer);r[i]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=p.get(e);t||p.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=p.get(e),r=0;r>> 0) + (counter++ + "__");
+ };
+ WeakMap.prototype = {
+ set: function(key, value) {
+ var entry = key[this.name];
+ if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
+ value: [ key, value ],
+ writable: true
+ });
+ return this;
+ },
+ get: function(key) {
+ var entry;
+ return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
+ },
+ "delete": function(key) {
+ var entry = key[this.name];
+ if (!entry || entry[0] !== key) return false;
+ entry[0] = entry[1] = undefined;
+ return true;
+ },
+ has: function(key) {
+ var entry = key[this.name];
+ if (!entry) return false;
+ return entry[0] === key;
+ }
+ };
+ window.WeakMap = WeakMap;
+ })();
+}
+
+window.ShadowDOMPolyfill = {};
+
+(function(scope) {
+ "use strict";
+ var constructorTable = new WeakMap();
+ var nativePrototypeTable = new WeakMap();
+ var wrappers = Object.create(null);
+ function detectEval() {
+ if (typeof chrome !== "undefined" && chrome.app && chrome.app.runtime) {
+ return false;
+ }
+ if (navigator.getDeviceStorage) {
+ return false;
+ }
+ try {
+ var f = new Function("return true;");
+ return f();
+ } catch (ex) {
+ return false;
+ }
+ }
+ var hasEval = detectEval();
+ function assert(b) {
+ if (!b) throw new Error("Assertion failed");
+ }
+ var defineProperty = Object.defineProperty;
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
+ function mixin(to, from) {
+ var names = getOwnPropertyNames(from);
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
+ defineProperty(to, name, getOwnPropertyDescriptor(from, name));
+ }
+ return to;
+ }
+ function mixinStatics(to, from) {
+ var names = getOwnPropertyNames(from);
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
+ switch (name) {
+ case "arguments":
+ case "caller":
+ case "length":
+ case "name":
+ case "prototype":
+ case "toString":
+ continue;
+ }
+ defineProperty(to, name, getOwnPropertyDescriptor(from, name));
+ }
+ return to;
+ }
+ function oneOf(object, propertyNames) {
+ for (var i = 0; i < propertyNames.length; i++) {
+ if (propertyNames[i] in object) return propertyNames[i];
+ }
+ }
+ var nonEnumerableDataDescriptor = {
+ value: undefined,
+ configurable: true,
+ enumerable: false,
+ writable: true
+ };
+ function defineNonEnumerableDataProperty(object, name, value) {
+ nonEnumerableDataDescriptor.value = value;
+ defineProperty(object, name, nonEnumerableDataDescriptor);
+ }
+ getOwnPropertyNames(window);
+ function getWrapperConstructor(node, opt_instance) {
+ var nativePrototype = node.__proto__ || Object.getPrototypeOf(node);
+ if (isFirefox) {
+ try {
+ getOwnPropertyNames(nativePrototype);
+ } catch (error) {
+ nativePrototype = nativePrototype.__proto__;
+ }
+ }
+ var wrapperConstructor = constructorTable.get(nativePrototype);
+ if (wrapperConstructor) return wrapperConstructor;
+ var parentWrapperConstructor = getWrapperConstructor(nativePrototype);
+ var GeneratedWrapper = createWrapperConstructor(parentWrapperConstructor);
+ registerInternal(nativePrototype, GeneratedWrapper, opt_instance);
+ return GeneratedWrapper;
+ }
+ function addForwardingProperties(nativePrototype, wrapperPrototype) {
+ installProperty(nativePrototype, wrapperPrototype, true);
+ }
+ function registerInstanceProperties(wrapperPrototype, instanceObject) {
+ installProperty(instanceObject, wrapperPrototype, false);
+ }
+ var isFirefox = /Firefox/.test(navigator.userAgent);
+ var dummyDescriptor = {
+ get: function() {},
+ set: function(v) {},
+ configurable: true,
+ enumerable: true
+ };
+ function isEventHandlerName(name) {
+ return /^on[a-z]+$/.test(name);
+ }
+ function isIdentifierName(name) {
+ return /^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(name);
+ }
+ function getGetter(name) {
+ return hasEval && isIdentifierName(name) ? new Function("return this.__impl4cf1e782hg__." + name) : function() {
+ return this.__impl4cf1e782hg__[name];
+ };
+ }
+ function getSetter(name) {
+ return hasEval && isIdentifierName(name) ? new Function("v", "this.__impl4cf1e782hg__." + name + " = v") : function(v) {
+ this.__impl4cf1e782hg__[name] = v;
+ };
+ }
+ function getMethod(name) {
+ return hasEval && isIdentifierName(name) ? new Function("return this.__impl4cf1e782hg__." + name + ".apply(this.__impl4cf1e782hg__, arguments)") : function() {
+ return this.__impl4cf1e782hg__[name].apply(this.__impl4cf1e782hg__, arguments);
+ };
+ }
+ function getDescriptor(source, name) {
+ try {
+ return Object.getOwnPropertyDescriptor(source, name);
+ } catch (ex) {
+ return dummyDescriptor;
+ }
+ }
+ var isBrokenSafari = function() {
+ var descr = Object.getOwnPropertyDescriptor(Node.prototype, "nodeType");
+ return descr && !descr.get && !descr.set;
+ }();
+ function installProperty(source, target, allowMethod, opt_blacklist) {
+ var names = getOwnPropertyNames(source);
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
+ if (name === "polymerBlackList_") continue;
+ if (name in target) continue;
+ if (source.polymerBlackList_ && source.polymerBlackList_[name]) continue;
+ if (isFirefox) {
+ source.__lookupGetter__(name);
+ }
+ var descriptor = getDescriptor(source, name);
+ var getter, setter;
+ if (typeof descriptor.value === "function") {
+ if (allowMethod) {
+ target[name] = getMethod(name);
+ }
+ continue;
+ }
+ var isEvent = isEventHandlerName(name);
+ if (isEvent) getter = scope.getEventHandlerGetter(name); else getter = getGetter(name);
+ if (descriptor.writable || descriptor.set || isBrokenSafari) {
+ if (isEvent) setter = scope.getEventHandlerSetter(name); else setter = getSetter(name);
+ }
+ var configurable = isBrokenSafari || descriptor.configurable;
+ defineProperty(target, name, {
+ get: getter,
+ set: setter,
+ configurable: configurable,
+ enumerable: descriptor.enumerable
+ });
+ }
+ }
+ function register(nativeConstructor, wrapperConstructor, opt_instance) {
+ if (nativeConstructor == null) {
+ return;
+ }
+ var nativePrototype = nativeConstructor.prototype;
+ registerInternal(nativePrototype, wrapperConstructor, opt_instance);
+ mixinStatics(wrapperConstructor, nativeConstructor);
+ }
+ function registerInternal(nativePrototype, wrapperConstructor, opt_instance) {
+ var wrapperPrototype = wrapperConstructor.prototype;
+ assert(constructorTable.get(nativePrototype) === undefined);
+ constructorTable.set(nativePrototype, wrapperConstructor);
+ nativePrototypeTable.set(wrapperPrototype, nativePrototype);
+ addForwardingProperties(nativePrototype, wrapperPrototype);
+ if (opt_instance) registerInstanceProperties(wrapperPrototype, opt_instance);
+ defineNonEnumerableDataProperty(wrapperPrototype, "constructor", wrapperConstructor);
+ wrapperConstructor.prototype = wrapperPrototype;
+ }
+ function isWrapperFor(wrapperConstructor, nativeConstructor) {
+ return constructorTable.get(nativeConstructor.prototype) === wrapperConstructor;
+ }
+ function registerObject(object) {
+ var nativePrototype = Object.getPrototypeOf(object);
+ var superWrapperConstructor = getWrapperConstructor(nativePrototype);
+ var GeneratedWrapper = createWrapperConstructor(superWrapperConstructor);
+ registerInternal(nativePrototype, GeneratedWrapper, object);
+ return GeneratedWrapper;
+ }
+ function createWrapperConstructor(superWrapperConstructor) {
+ function GeneratedWrapper(node) {
+ superWrapperConstructor.call(this, node);
+ }
+ var p = Object.create(superWrapperConstructor.prototype);
+ p.constructor = GeneratedWrapper;
+ GeneratedWrapper.prototype = p;
+ return GeneratedWrapper;
+ }
+ function isWrapper(object) {
+ return object && object.__impl4cf1e782hg__;
+ }
+ function isNative(object) {
+ return !isWrapper(object);
+ }
+ function wrap(impl) {
+ if (impl === null) return null;
+ assert(isNative(impl));
+ var wrapper = impl.__wrapper8e3dd93a60__;
+ if (wrapper != null) {
+ return wrapper;
+ }
+ return impl.__wrapper8e3dd93a60__ = new (getWrapperConstructor(impl, impl))(impl);
+ }
+ function unwrap(wrapper) {
+ if (wrapper === null) return null;
+ assert(isWrapper(wrapper));
+ return wrapper.__impl4cf1e782hg__;
+ }
+ function unsafeUnwrap(wrapper) {
+ return wrapper.__impl4cf1e782hg__;
+ }
+ function setWrapper(impl, wrapper) {
+ wrapper.__impl4cf1e782hg__ = impl;
+ impl.__wrapper8e3dd93a60__ = wrapper;
+ }
+ function unwrapIfNeeded(object) {
+ return object && isWrapper(object) ? unwrap(object) : object;
+ }
+ function wrapIfNeeded(object) {
+ return object && !isWrapper(object) ? wrap(object) : object;
+ }
+ function rewrap(node, wrapper) {
+ if (wrapper === null) return;
+ assert(isNative(node));
+ assert(wrapper === undefined || isWrapper(wrapper));
+ node.__wrapper8e3dd93a60__ = wrapper;
+ }
+ var getterDescriptor = {
+ get: undefined,
+ configurable: true,
+ enumerable: true
+ };
+ function defineGetter(constructor, name, getter) {
+ getterDescriptor.get = getter;
+ defineProperty(constructor.prototype, name, getterDescriptor);
+ }
+ function defineWrapGetter(constructor, name) {
+ defineGetter(constructor, name, function() {
+ return wrap(this.__impl4cf1e782hg__[name]);
+ });
+ }
+ function forwardMethodsToWrapper(constructors, names) {
+ constructors.forEach(function(constructor) {
+ names.forEach(function(name) {
+ constructor.prototype[name] = function() {
+ var w = wrapIfNeeded(this);
+ return w[name].apply(w, arguments);
+ };
+ });
+ });
+ }
+ scope.assert = assert;
+ scope.constructorTable = constructorTable;
+ scope.defineGetter = defineGetter;
+ scope.defineWrapGetter = defineWrapGetter;
+ scope.forwardMethodsToWrapper = forwardMethodsToWrapper;
+ scope.isIdentifierName = isIdentifierName;
+ scope.isWrapper = isWrapper;
+ scope.isWrapperFor = isWrapperFor;
+ scope.mixin = mixin;
+ scope.nativePrototypeTable = nativePrototypeTable;
+ scope.oneOf = oneOf;
+ scope.registerObject = registerObject;
+ scope.registerWrapper = register;
+ scope.rewrap = rewrap;
+ scope.setWrapper = setWrapper;
+ scope.unsafeUnwrap = unsafeUnwrap;
+ scope.unwrap = unwrap;
+ scope.unwrapIfNeeded = unwrapIfNeeded;
+ scope.wrap = wrap;
+ scope.wrapIfNeeded = wrapIfNeeded;
+ scope.wrappers = wrappers;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ function newSplice(index, removed, addedCount) {
+ return {
+ index: index,
+ removed: removed,
+ addedCount: addedCount
+ };
+ }
+ var EDIT_LEAVE = 0;
+ var EDIT_UPDATE = 1;
+ var EDIT_ADD = 2;
+ var EDIT_DELETE = 3;
+ function ArraySplice() {}
+ ArraySplice.prototype = {
+ calcEditDistances: function(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+ var rowCount = oldEnd - oldStart + 1;
+ var columnCount = currentEnd - currentStart + 1;
+ var distances = new Array(rowCount);
+ for (var i = 0; i < rowCount; i++) {
+ distances[i] = new Array(columnCount);
+ distances[i][0] = i;
+ }
+ for (var j = 0; j < columnCount; j++) distances[0][j] = j;
+ for (var i = 1; i < rowCount; i++) {
+ for (var j = 1; j < columnCount; j++) {
+ if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1])) distances[i][j] = distances[i - 1][j - 1]; else {
+ var north = distances[i - 1][j] + 1;
+ var west = distances[i][j - 1] + 1;
+ distances[i][j] = north < west ? north : west;
+ }
+ }
+ }
+ return distances;
+ },
+ spliceOperationsFromEditDistances: function(distances) {
+ var i = distances.length - 1;
+ var j = distances[0].length - 1;
+ var current = distances[i][j];
+ var edits = [];
+ while (i > 0 || j > 0) {
+ if (i == 0) {
+ edits.push(EDIT_ADD);
+ j--;
+ continue;
+ }
+ if (j == 0) {
+ edits.push(EDIT_DELETE);
+ i--;
+ continue;
+ }
+ var northWest = distances[i - 1][j - 1];
+ var west = distances[i - 1][j];
+ var north = distances[i][j - 1];
+ var min;
+ if (west < north) min = west < northWest ? west : northWest; else min = north < northWest ? north : northWest;
+ if (min == northWest) {
+ if (northWest == current) {
+ edits.push(EDIT_LEAVE);
+ } else {
+ edits.push(EDIT_UPDATE);
+ current = northWest;
+ }
+ i--;
+ j--;
+ } else if (min == west) {
+ edits.push(EDIT_DELETE);
+ i--;
+ current = west;
+ } else {
+ edits.push(EDIT_ADD);
+ j--;
+ current = north;
+ }
+ }
+ edits.reverse();
+ return edits;
+ },
+ calcSplices: function(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+ var prefixCount = 0;
+ var suffixCount = 0;
+ var minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);
+ if (currentStart == 0 && oldStart == 0) prefixCount = this.sharedPrefix(current, old, minLength);
+ if (currentEnd == current.length && oldEnd == old.length) suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);
+ currentStart += prefixCount;
+ oldStart += prefixCount;
+ currentEnd -= suffixCount;
+ oldEnd -= suffixCount;
+ if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0) return [];
+ if (currentStart == currentEnd) {
+ var splice = newSplice(currentStart, [], 0);
+ while (oldStart < oldEnd) splice.removed.push(old[oldStart++]);
+ return [ splice ];
+ } else if (oldStart == oldEnd) return [ newSplice(currentStart, [], currentEnd - currentStart) ];
+ var ops = this.spliceOperationsFromEditDistances(this.calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));
+ var splice = undefined;
+ var splices = [];
+ var index = currentStart;
+ var oldIndex = oldStart;
+ for (var i = 0; i < ops.length; i++) {
+ switch (ops[i]) {
+ case EDIT_LEAVE:
+ if (splice) {
+ splices.push(splice);
+ splice = undefined;
+ }
+ index++;
+ oldIndex++;
+ break;
+
+ case EDIT_UPDATE:
+ if (!splice) splice = newSplice(index, [], 0);
+ splice.addedCount++;
+ index++;
+ splice.removed.push(old[oldIndex]);
+ oldIndex++;
+ break;
+
+ case EDIT_ADD:
+ if (!splice) splice = newSplice(index, [], 0);
+ splice.addedCount++;
+ index++;
+ break;
+
+ case EDIT_DELETE:
+ if (!splice) splice = newSplice(index, [], 0);
+ splice.removed.push(old[oldIndex]);
+ oldIndex++;
+ break;
+ }
+ }
+ if (splice) {
+ splices.push(splice);
+ }
+ return splices;
+ },
+ sharedPrefix: function(current, old, searchLength) {
+ for (var i = 0; i < searchLength; i++) if (!this.equals(current[i], old[i])) return i;
+ return searchLength;
+ },
+ sharedSuffix: function(current, old, searchLength) {
+ var index1 = current.length;
+ var index2 = old.length;
+ var count = 0;
+ while (count < searchLength && this.equals(current[--index1], old[--index2])) count++;
+ return count;
+ },
+ calculateSplices: function(current, previous) {
+ return this.calcSplices(current, 0, current.length, previous, 0, previous.length);
+ },
+ equals: function(currentValue, previousValue) {
+ return currentValue === previousValue;
+ }
+ };
+ scope.ArraySplice = ArraySplice;
+})(window.ShadowDOMPolyfill);
+
+(function(context) {
+ "use strict";
+ var OriginalMutationObserver = window.MutationObserver;
+ var callbacks = [];
+ var pending = false;
+ var timerFunc;
+ function handle() {
+ pending = false;
+ var copies = callbacks.slice(0);
+ callbacks = [];
+ for (var i = 0; i < copies.length; i++) {
+ (0, copies[i])();
+ }
+ }
+ if (OriginalMutationObserver) {
+ var counter = 1;
+ var observer = new OriginalMutationObserver(handle);
+ var textNode = document.createTextNode(counter);
+ observer.observe(textNode, {
+ characterData: true
+ });
+ timerFunc = function() {
+ counter = (counter + 1) % 2;
+ textNode.data = counter;
+ };
+ } else {
+ timerFunc = window.setTimeout;
+ }
+ function setEndOfMicrotask(func) {
+ callbacks.push(func);
+ if (pending) return;
+ pending = true;
+ timerFunc(handle, 0);
+ }
+ context.setEndOfMicrotask = setEndOfMicrotask;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var setEndOfMicrotask = scope.setEndOfMicrotask;
+ var wrapIfNeeded = scope.wrapIfNeeded;
+ var wrappers = scope.wrappers;
+ var registrationsTable = new WeakMap();
+ var globalMutationObservers = [];
+ var isScheduled = false;
+ function scheduleCallback(observer) {
+ if (observer.scheduled_) return;
+ observer.scheduled_ = true;
+ globalMutationObservers.push(observer);
+ if (isScheduled) return;
+ setEndOfMicrotask(notifyObservers);
+ isScheduled = true;
+ }
+ function notifyObservers() {
+ isScheduled = false;
+ while (globalMutationObservers.length) {
+ var notifyList = globalMutationObservers;
+ globalMutationObservers = [];
+ notifyList.sort(function(x, y) {
+ return x.uid_ - y.uid_;
+ });
+ for (var i = 0; i < notifyList.length; i++) {
+ var mo = notifyList[i];
+ mo.scheduled_ = false;
+ var queue = mo.takeRecords();
+ removeTransientObserversFor(mo);
+ if (queue.length) {
+ mo.callback_(queue, mo);
+ }
+ }
+ }
+ }
+ function MutationRecord(type, target) {
+ this.type = type;
+ this.target = target;
+ this.addedNodes = new wrappers.NodeList();
+ this.removedNodes = new wrappers.NodeList();
+ this.previousSibling = null;
+ this.nextSibling = null;
+ this.attributeName = null;
+ this.attributeNamespace = null;
+ this.oldValue = null;
+ }
+ function registerTransientObservers(ancestor, node) {
+ for (;ancestor; ancestor = ancestor.parentNode) {
+ var registrations = registrationsTable.get(ancestor);
+ if (!registrations) continue;
+ for (var i = 0; i < registrations.length; i++) {
+ var registration = registrations[i];
+ if (registration.options.subtree) registration.addTransientObserver(node);
+ }
+ }
+ }
+ function removeTransientObserversFor(observer) {
+ for (var i = 0; i < observer.nodes_.length; i++) {
+ var node = observer.nodes_[i];
+ var registrations = registrationsTable.get(node);
+ if (!registrations) return;
+ for (var j = 0; j < registrations.length; j++) {
+ var registration = registrations[j];
+ if (registration.observer === observer) registration.removeTransientObservers();
+ }
+ }
+ }
+ function enqueueMutation(target, type, data) {
+ var interestedObservers = Object.create(null);
+ var associatedStrings = Object.create(null);
+ for (var node = target; node; node = node.parentNode) {
+ var registrations = registrationsTable.get(node);
+ if (!registrations) continue;
+ for (var j = 0; j < registrations.length; j++) {
+ var registration = registrations[j];
+ var options = registration.options;
+ if (node !== target && !options.subtree) continue;
+ if (type === "attributes" && !options.attributes) continue;
+ if (type === "attributes" && options.attributeFilter && (data.namespace !== null || options.attributeFilter.indexOf(data.name) === -1)) {
+ continue;
+ }
+ if (type === "characterData" && !options.characterData) continue;
+ if (type === "childList" && !options.childList) continue;
+ var observer = registration.observer;
+ interestedObservers[observer.uid_] = observer;
+ if (type === "attributes" && options.attributeOldValue || type === "characterData" && options.characterDataOldValue) {
+ associatedStrings[observer.uid_] = data.oldValue;
+ }
+ }
+ }
+ for (var uid in interestedObservers) {
+ var observer = interestedObservers[uid];
+ var record = new MutationRecord(type, target);
+ if ("name" in data && "namespace" in data) {
+ record.attributeName = data.name;
+ record.attributeNamespace = data.namespace;
+ }
+ if (data.addedNodes) record.addedNodes = data.addedNodes;
+ if (data.removedNodes) record.removedNodes = data.removedNodes;
+ if (data.previousSibling) record.previousSibling = data.previousSibling;
+ if (data.nextSibling) record.nextSibling = data.nextSibling;
+ if (associatedStrings[uid] !== undefined) record.oldValue = associatedStrings[uid];
+ scheduleCallback(observer);
+ observer.records_.push(record);
+ }
+ }
+ var slice = Array.prototype.slice;
+ function MutationObserverOptions(options) {
+ this.childList = !!options.childList;
+ this.subtree = !!options.subtree;
+ if (!("attributes" in options) && ("attributeOldValue" in options || "attributeFilter" in options)) {
+ this.attributes = true;
+ } else {
+ this.attributes = !!options.attributes;
+ }
+ if ("characterDataOldValue" in options && !("characterData" in options)) this.characterData = true; else this.characterData = !!options.characterData;
+ if (!this.attributes && (options.attributeOldValue || "attributeFilter" in options) || !this.characterData && options.characterDataOldValue) {
+ throw new TypeError();
+ }
+ this.characterData = !!options.characterData;
+ this.attributeOldValue = !!options.attributeOldValue;
+ this.characterDataOldValue = !!options.characterDataOldValue;
+ if ("attributeFilter" in options) {
+ if (options.attributeFilter == null || typeof options.attributeFilter !== "object") {
+ throw new TypeError();
+ }
+ this.attributeFilter = slice.call(options.attributeFilter);
+ } else {
+ this.attributeFilter = null;
+ }
+ }
+ var uidCounter = 0;
+ function MutationObserver(callback) {
+ this.callback_ = callback;
+ this.nodes_ = [];
+ this.records_ = [];
+ this.uid_ = ++uidCounter;
+ this.scheduled_ = false;
+ }
+ MutationObserver.prototype = {
+ constructor: MutationObserver,
+ observe: function(target, options) {
+ target = wrapIfNeeded(target);
+ var newOptions = new MutationObserverOptions(options);
+ var registration;
+ var registrations = registrationsTable.get(target);
+ if (!registrations) registrationsTable.set(target, registrations = []);
+ for (var i = 0; i < registrations.length; i++) {
+ if (registrations[i].observer === this) {
+ registration = registrations[i];
+ registration.removeTransientObservers();
+ registration.options = newOptions;
+ }
+ }
+ if (!registration) {
+ registration = new Registration(this, target, newOptions);
+ registrations.push(registration);
+ this.nodes_.push(target);
+ }
+ },
+ disconnect: function() {
+ this.nodes_.forEach(function(node) {
+ var registrations = registrationsTable.get(node);
+ for (var i = 0; i < registrations.length; i++) {
+ var registration = registrations[i];
+ if (registration.observer === this) {
+ registrations.splice(i, 1);
+ break;
+ }
+ }
+ }, this);
+ this.records_ = [];
+ },
+ takeRecords: function() {
+ var copyOfRecords = this.records_;
+ this.records_ = [];
+ return copyOfRecords;
+ }
+ };
+ function Registration(observer, target, options) {
+ this.observer = observer;
+ this.target = target;
+ this.options = options;
+ this.transientObservedNodes = [];
+ }
+ Registration.prototype = {
+ addTransientObserver: function(node) {
+ if (node === this.target) return;
+ scheduleCallback(this.observer);
+ this.transientObservedNodes.push(node);
+ var registrations = registrationsTable.get(node);
+ if (!registrations) registrationsTable.set(node, registrations = []);
+ registrations.push(this);
+ },
+ removeTransientObservers: function() {
+ var transientObservedNodes = this.transientObservedNodes;
+ this.transientObservedNodes = [];
+ for (var i = 0; i < transientObservedNodes.length; i++) {
+ var node = transientObservedNodes[i];
+ var registrations = registrationsTable.get(node);
+ for (var j = 0; j < registrations.length; j++) {
+ if (registrations[j] === this) {
+ registrations.splice(j, 1);
+ break;
+ }
+ }
+ }
+ }
+ };
+ scope.enqueueMutation = enqueueMutation;
+ scope.registerTransientObservers = registerTransientObservers;
+ scope.wrappers.MutationObserver = MutationObserver;
+ scope.wrappers.MutationRecord = MutationRecord;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ function TreeScope(root, parent) {
+ this.root = root;
+ this.parent = parent;
+ }
+ TreeScope.prototype = {
+ get renderer() {
+ if (this.root instanceof scope.wrappers.ShadowRoot) {
+ return scope.getRendererForHost(this.root.host);
+ }
+ return null;
+ },
+ contains: function(treeScope) {
+ for (;treeScope; treeScope = treeScope.parent) {
+ if (treeScope === this) return true;
+ }
+ return false;
+ }
+ };
+ function setTreeScope(node, treeScope) {
+ if (node.treeScope_ !== treeScope) {
+ node.treeScope_ = treeScope;
+ for (var sr = node.shadowRoot; sr; sr = sr.olderShadowRoot) {
+ sr.treeScope_.parent = treeScope;
+ }
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ setTreeScope(child, treeScope);
+ }
+ }
+ }
+ function getTreeScope(node) {
+ if (node instanceof scope.wrappers.Window) {
+ debugger;
+ }
+ if (node.treeScope_) return node.treeScope_;
+ var parent = node.parentNode;
+ var treeScope;
+ if (parent) treeScope = getTreeScope(parent); else treeScope = new TreeScope(node, null);
+ return node.treeScope_ = treeScope;
+ }
+ scope.TreeScope = TreeScope;
+ scope.getTreeScope = getTreeScope;
+ scope.setTreeScope = setTreeScope;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;
+ var getTreeScope = scope.getTreeScope;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var wrappers = scope.wrappers;
+ var wrappedFuns = new WeakMap();
+ var listenersTable = new WeakMap();
+ var handledEventsTable = new WeakMap();
+ var currentlyDispatchingEvents = new WeakMap();
+ var targetTable = new WeakMap();
+ var currentTargetTable = new WeakMap();
+ var relatedTargetTable = new WeakMap();
+ var eventPhaseTable = new WeakMap();
+ var stopPropagationTable = new WeakMap();
+ var stopImmediatePropagationTable = new WeakMap();
+ var eventHandlersTable = new WeakMap();
+ var eventPathTable = new WeakMap();
+ function isShadowRoot(node) {
+ return node instanceof wrappers.ShadowRoot;
+ }
+ function rootOfNode(node) {
+ return getTreeScope(node).root;
+ }
+ function getEventPath(node, event) {
+ var path = [];
+ var current = node;
+ path.push(current);
+ while (current) {
+ var destinationInsertionPoints = getDestinationInsertionPoints(current);
+ if (destinationInsertionPoints && destinationInsertionPoints.length > 0) {
+ for (var i = 0; i < destinationInsertionPoints.length; i++) {
+ var insertionPoint = destinationInsertionPoints[i];
+ if (isShadowInsertionPoint(insertionPoint)) {
+ var shadowRoot = rootOfNode(insertionPoint);
+ var olderShadowRoot = shadowRoot.olderShadowRoot;
+ if (olderShadowRoot) path.push(olderShadowRoot);
+ }
+ path.push(insertionPoint);
+ }
+ current = destinationInsertionPoints[destinationInsertionPoints.length - 1];
+ } else {
+ if (isShadowRoot(current)) {
+ if (inSameTree(node, current) && eventMustBeStopped(event)) {
+ break;
+ }
+ current = current.host;
+ path.push(current);
+ } else {
+ current = current.parentNode;
+ if (current) path.push(current);
+ }
+ }
+ }
+ return path;
+ }
+ function eventMustBeStopped(event) {
+ if (!event) return false;
+ switch (event.type) {
+ case "abort":
+ case "error":
+ case "select":
+ case "change":
+ case "load":
+ case "reset":
+ case "resize":
+ case "scroll":
+ case "selectstart":
+ return true;
+ }
+ return false;
+ }
+ function isShadowInsertionPoint(node) {
+ return node instanceof HTMLShadowElement;
+ }
+ function getDestinationInsertionPoints(node) {
+ return scope.getDestinationInsertionPoints(node);
+ }
+ function eventRetargetting(path, currentTarget) {
+ if (path.length === 0) return currentTarget;
+ if (currentTarget instanceof wrappers.Window) currentTarget = currentTarget.document;
+ var currentTargetTree = getTreeScope(currentTarget);
+ var originalTarget = path[0];
+ var originalTargetTree = getTreeScope(originalTarget);
+ var relativeTargetTree = lowestCommonInclusiveAncestor(currentTargetTree, originalTargetTree);
+ for (var i = 0; i < path.length; i++) {
+ var node = path[i];
+ if (getTreeScope(node) === relativeTargetTree) return node;
+ }
+ return path[path.length - 1];
+ }
+ function getTreeScopeAncestors(treeScope) {
+ var ancestors = [];
+ for (;treeScope; treeScope = treeScope.parent) {
+ ancestors.push(treeScope);
+ }
+ return ancestors;
+ }
+ function lowestCommonInclusiveAncestor(tsA, tsB) {
+ var ancestorsA = getTreeScopeAncestors(tsA);
+ var ancestorsB = getTreeScopeAncestors(tsB);
+ var result = null;
+ while (ancestorsA.length > 0 && ancestorsB.length > 0) {
+ var a = ancestorsA.pop();
+ var b = ancestorsB.pop();
+ if (a === b) result = a; else break;
+ }
+ return result;
+ }
+ function getTreeScopeRoot(ts) {
+ if (!ts.parent) return ts;
+ return getTreeScopeRoot(ts.parent);
+ }
+ function relatedTargetResolution(event, currentTarget, relatedTarget) {
+ if (currentTarget instanceof wrappers.Window) currentTarget = currentTarget.document;
+ var currentTargetTree = getTreeScope(currentTarget);
+ var relatedTargetTree = getTreeScope(relatedTarget);
+ var relatedTargetEventPath = getEventPath(relatedTarget, event);
+ var lowestCommonAncestorTree;
+ var lowestCommonAncestorTree = lowestCommonInclusiveAncestor(currentTargetTree, relatedTargetTree);
+ if (!lowestCommonAncestorTree) lowestCommonAncestorTree = relatedTargetTree.root;
+ for (var commonAncestorTree = lowestCommonAncestorTree; commonAncestorTree; commonAncestorTree = commonAncestorTree.parent) {
+ var adjustedRelatedTarget;
+ for (var i = 0; i < relatedTargetEventPath.length; i++) {
+ var node = relatedTargetEventPath[i];
+ if (getTreeScope(node) === commonAncestorTree) return node;
+ }
+ }
+ return null;
+ }
+ function inSameTree(a, b) {
+ return getTreeScope(a) === getTreeScope(b);
+ }
+ var NONE = 0;
+ var CAPTURING_PHASE = 1;
+ var AT_TARGET = 2;
+ var BUBBLING_PHASE = 3;
+ var pendingError;
+ function dispatchOriginalEvent(originalEvent) {
+ if (handledEventsTable.get(originalEvent)) return;
+ handledEventsTable.set(originalEvent, true);
+ dispatchEvent(wrap(originalEvent), wrap(originalEvent.target));
+ if (pendingError) {
+ var err = pendingError;
+ pendingError = null;
+ throw err;
+ }
+ }
+ function isLoadLikeEvent(event) {
+ switch (event.type) {
+ case "load":
+ case "beforeunload":
+ case "unload":
+ return true;
+ }
+ return false;
+ }
+ function dispatchEvent(event, originalWrapperTarget) {
+ if (currentlyDispatchingEvents.get(event)) throw new Error("InvalidStateError");
+ currentlyDispatchingEvents.set(event, true);
+ scope.renderAllPending();
+ var eventPath;
+ var overrideTarget;
+ var win;
+ if (isLoadLikeEvent(event) && !event.bubbles) {
+ var doc = originalWrapperTarget;
+ if (doc instanceof wrappers.Document && (win = doc.defaultView)) {
+ overrideTarget = doc;
+ eventPath = [];
+ }
+ }
+ if (!eventPath) {
+ if (originalWrapperTarget instanceof wrappers.Window) {
+ win = originalWrapperTarget;
+ eventPath = [];
+ } else {
+ eventPath = getEventPath(originalWrapperTarget, event);
+ if (!isLoadLikeEvent(event)) {
+ var doc = eventPath[eventPath.length - 1];
+ if (doc instanceof wrappers.Document) win = doc.defaultView;
+ }
+ }
+ }
+ eventPathTable.set(event, eventPath);
+ if (dispatchCapturing(event, eventPath, win, overrideTarget)) {
+ if (dispatchAtTarget(event, eventPath, win, overrideTarget)) {
+ dispatchBubbling(event, eventPath, win, overrideTarget);
+ }
+ }
+ eventPhaseTable.set(event, NONE);
+ currentTargetTable.delete(event, null);
+ currentlyDispatchingEvents.delete(event);
+ return event.defaultPrevented;
+ }
+ function dispatchCapturing(event, eventPath, win, overrideTarget) {
+ var phase = CAPTURING_PHASE;
+ if (win) {
+ if (!invoke(win, event, phase, eventPath, overrideTarget)) return false;
+ }
+ for (var i = eventPath.length - 1; i > 0; i--) {
+ if (!invoke(eventPath[i], event, phase, eventPath, overrideTarget)) return false;
+ }
+ return true;
+ }
+ function dispatchAtTarget(event, eventPath, win, overrideTarget) {
+ var phase = AT_TARGET;
+ var currentTarget = eventPath[0] || win;
+ return invoke(currentTarget, event, phase, eventPath, overrideTarget);
+ }
+ function dispatchBubbling(event, eventPath, win, overrideTarget) {
+ var phase = BUBBLING_PHASE;
+ for (var i = 1; i < eventPath.length; i++) {
+ if (!invoke(eventPath[i], event, phase, eventPath, overrideTarget)) return;
+ }
+ if (win && eventPath.length > 0) {
+ invoke(win, event, phase, eventPath, overrideTarget);
+ }
+ }
+ function invoke(currentTarget, event, phase, eventPath, overrideTarget) {
+ var listeners = listenersTable.get(currentTarget);
+ if (!listeners) return true;
+ var target = overrideTarget || eventRetargetting(eventPath, currentTarget);
+ if (target === currentTarget) {
+ if (phase === CAPTURING_PHASE) return true;
+ if (phase === BUBBLING_PHASE) phase = AT_TARGET;
+ } else if (phase === BUBBLING_PHASE && !event.bubbles) {
+ return true;
+ }
+ if ("relatedTarget" in event) {
+ var originalEvent = unwrap(event);
+ var unwrappedRelatedTarget = originalEvent.relatedTarget;
+ if (unwrappedRelatedTarget) {
+ if (unwrappedRelatedTarget instanceof Object && unwrappedRelatedTarget.addEventListener) {
+ var relatedTarget = wrap(unwrappedRelatedTarget);
+ var adjusted = relatedTargetResolution(event, currentTarget, relatedTarget);
+ if (adjusted === target) return true;
+ } else {
+ adjusted = null;
+ }
+ relatedTargetTable.set(event, adjusted);
+ }
+ }
+ eventPhaseTable.set(event, phase);
+ var type = event.type;
+ var anyRemoved = false;
+ targetTable.set(event, target);
+ currentTargetTable.set(event, currentTarget);
+ listeners.depth++;
+ for (var i = 0, len = listeners.length; i < len; i++) {
+ var listener = listeners[i];
+ if (listener.removed) {
+ anyRemoved = true;
+ continue;
+ }
+ if (listener.type !== type || !listener.capture && phase === CAPTURING_PHASE || listener.capture && phase === BUBBLING_PHASE) {
+ continue;
+ }
+ try {
+ if (typeof listener.handler === "function") listener.handler.call(currentTarget, event); else listener.handler.handleEvent(event);
+ if (stopImmediatePropagationTable.get(event)) return false;
+ } catch (ex) {
+ if (!pendingError) pendingError = ex;
+ }
+ }
+ listeners.depth--;
+ if (anyRemoved && listeners.depth === 0) {
+ var copy = listeners.slice();
+ listeners.length = 0;
+ for (var i = 0; i < copy.length; i++) {
+ if (!copy[i].removed) listeners.push(copy[i]);
+ }
+ }
+ return !stopPropagationTable.get(event);
+ }
+ function Listener(type, handler, capture) {
+ this.type = type;
+ this.handler = handler;
+ this.capture = Boolean(capture);
+ }
+ Listener.prototype = {
+ equals: function(that) {
+ return this.handler === that.handler && this.type === that.type && this.capture === that.capture;
+ },
+ get removed() {
+ return this.handler === null;
+ },
+ remove: function() {
+ this.handler = null;
+ }
+ };
+ var OriginalEvent = window.Event;
+ OriginalEvent.prototype.polymerBlackList_ = {
+ returnValue: true,
+ keyLocation: true
+ };
+ function Event(type, options) {
+ if (type instanceof OriginalEvent) {
+ var impl = type;
+ if (!OriginalBeforeUnloadEvent && impl.type === "beforeunload" && !(this instanceof BeforeUnloadEvent)) {
+ return new BeforeUnloadEvent(impl);
+ }
+ setWrapper(impl, this);
+ } else {
+ return wrap(constructEvent(OriginalEvent, "Event", type, options));
+ }
+ }
+ Event.prototype = {
+ get target() {
+ return targetTable.get(this);
+ },
+ get currentTarget() {
+ return currentTargetTable.get(this);
+ },
+ get eventPhase() {
+ return eventPhaseTable.get(this);
+ },
+ get path() {
+ var eventPath = eventPathTable.get(this);
+ if (!eventPath) return [];
+ return eventPath.slice();
+ },
+ stopPropagation: function() {
+ stopPropagationTable.set(this, true);
+ },
+ stopImmediatePropagation: function() {
+ stopPropagationTable.set(this, true);
+ stopImmediatePropagationTable.set(this, true);
+ }
+ };
+ registerWrapper(OriginalEvent, Event, document.createEvent("Event"));
+ function unwrapOptions(options) {
+ if (!options || !options.relatedTarget) return options;
+ return Object.create(options, {
+ relatedTarget: {
+ value: unwrap(options.relatedTarget)
+ }
+ });
+ }
+ function registerGenericEvent(name, SuperEvent, prototype) {
+ var OriginalEvent = window[name];
+ var GenericEvent = function(type, options) {
+ if (type instanceof OriginalEvent) setWrapper(type, this); else return wrap(constructEvent(OriginalEvent, name, type, options));
+ };
+ GenericEvent.prototype = Object.create(SuperEvent.prototype);
+ if (prototype) mixin(GenericEvent.prototype, prototype);
+ if (OriginalEvent) {
+ try {
+ registerWrapper(OriginalEvent, GenericEvent, new OriginalEvent("temp"));
+ } catch (ex) {
+ registerWrapper(OriginalEvent, GenericEvent, document.createEvent(name));
+ }
+ }
+ return GenericEvent;
+ }
+ var UIEvent = registerGenericEvent("UIEvent", Event);
+ var CustomEvent = registerGenericEvent("CustomEvent", Event);
+ var relatedTargetProto = {
+ get relatedTarget() {
+ var relatedTarget = relatedTargetTable.get(this);
+ if (relatedTarget !== undefined) return relatedTarget;
+ return wrap(unwrap(this).relatedTarget);
+ }
+ };
+ function getInitFunction(name, relatedTargetIndex) {
+ return function() {
+ arguments[relatedTargetIndex] = unwrap(arguments[relatedTargetIndex]);
+ var impl = unwrap(this);
+ impl[name].apply(impl, arguments);
+ };
+ }
+ var mouseEventProto = mixin({
+ initMouseEvent: getInitFunction("initMouseEvent", 14)
+ }, relatedTargetProto);
+ var focusEventProto = mixin({
+ initFocusEvent: getInitFunction("initFocusEvent", 5)
+ }, relatedTargetProto);
+ var MouseEvent = registerGenericEvent("MouseEvent", UIEvent, mouseEventProto);
+ var FocusEvent = registerGenericEvent("FocusEvent", UIEvent, focusEventProto);
+ var defaultInitDicts = Object.create(null);
+ var supportsEventConstructors = function() {
+ try {
+ new window.FocusEvent("focus");
+ } catch (ex) {
+ return false;
+ }
+ return true;
+ }();
+ function constructEvent(OriginalEvent, name, type, options) {
+ if (supportsEventConstructors) return new OriginalEvent(type, unwrapOptions(options));
+ var event = unwrap(document.createEvent(name));
+ var defaultDict = defaultInitDicts[name];
+ var args = [ type ];
+ Object.keys(defaultDict).forEach(function(key) {
+ var v = options != null && key in options ? options[key] : defaultDict[key];
+ if (key === "relatedTarget") v = unwrap(v);
+ args.push(v);
+ });
+ event["init" + name].apply(event, args);
+ return event;
+ }
+ if (!supportsEventConstructors) {
+ var configureEventConstructor = function(name, initDict, superName) {
+ if (superName) {
+ var superDict = defaultInitDicts[superName];
+ initDict = mixin(mixin({}, superDict), initDict);
+ }
+ defaultInitDicts[name] = initDict;
+ };
+ configureEventConstructor("Event", {
+ bubbles: false,
+ cancelable: false
+ });
+ configureEventConstructor("CustomEvent", {
+ detail: null
+ }, "Event");
+ configureEventConstructor("UIEvent", {
+ view: null,
+ detail: 0
+ }, "Event");
+ configureEventConstructor("MouseEvent", {
+ screenX: 0,
+ screenY: 0,
+ clientX: 0,
+ clientY: 0,
+ ctrlKey: false,
+ altKey: false,
+ shiftKey: false,
+ metaKey: false,
+ button: 0,
+ relatedTarget: null
+ }, "UIEvent");
+ configureEventConstructor("FocusEvent", {
+ relatedTarget: null
+ }, "UIEvent");
+ }
+ var OriginalBeforeUnloadEvent = window.BeforeUnloadEvent;
+ function BeforeUnloadEvent(impl) {
+ Event.call(this, impl);
+ }
+ BeforeUnloadEvent.prototype = Object.create(Event.prototype);
+ mixin(BeforeUnloadEvent.prototype, {
+ get returnValue() {
+ return unsafeUnwrap(this).returnValue;
+ },
+ set returnValue(v) {
+ unsafeUnwrap(this).returnValue = v;
+ }
+ });
+ if (OriginalBeforeUnloadEvent) registerWrapper(OriginalBeforeUnloadEvent, BeforeUnloadEvent);
+ function isValidListener(fun) {
+ if (typeof fun === "function") return true;
+ return fun && fun.handleEvent;
+ }
+ function isMutationEvent(type) {
+ switch (type) {
+ case "DOMAttrModified":
+ case "DOMAttributeNameChanged":
+ case "DOMCharacterDataModified":
+ case "DOMElementNameChanged":
+ case "DOMNodeInserted":
+ case "DOMNodeInsertedIntoDocument":
+ case "DOMNodeRemoved":
+ case "DOMNodeRemovedFromDocument":
+ case "DOMSubtreeModified":
+ return true;
+ }
+ return false;
+ }
+ var OriginalEventTarget = window.EventTarget;
+ function EventTarget(impl) {
+ setWrapper(impl, this);
+ }
+ var methodNames = [ "addEventListener", "removeEventListener", "dispatchEvent" ];
+ [ Node, Window ].forEach(function(constructor) {
+ var p = constructor.prototype;
+ methodNames.forEach(function(name) {
+ Object.defineProperty(p, name + "_", {
+ value: p[name]
+ });
+ });
+ });
+ function getTargetToListenAt(wrapper) {
+ if (wrapper instanceof wrappers.ShadowRoot) wrapper = wrapper.host;
+ return unwrap(wrapper);
+ }
+ EventTarget.prototype = {
+ addEventListener: function(type, fun, capture) {
+ if (!isValidListener(fun) || isMutationEvent(type)) return;
+ var listener = new Listener(type, fun, capture);
+ var listeners = listenersTable.get(this);
+ if (!listeners) {
+ listeners = [];
+ listeners.depth = 0;
+ listenersTable.set(this, listeners);
+ } else {
+ for (var i = 0; i < listeners.length; i++) {
+ if (listener.equals(listeners[i])) return;
+ }
+ }
+ listeners.push(listener);
+ var target = getTargetToListenAt(this);
+ target.addEventListener_(type, dispatchOriginalEvent, true);
+ },
+ removeEventListener: function(type, fun, capture) {
+ capture = Boolean(capture);
+ var listeners = listenersTable.get(this);
+ if (!listeners) return;
+ var count = 0, found = false;
+ for (var i = 0; i < listeners.length; i++) {
+ if (listeners[i].type === type && listeners[i].capture === capture) {
+ count++;
+ if (listeners[i].handler === fun) {
+ found = true;
+ listeners[i].remove();
+ }
+ }
+ }
+ if (found && count === 1) {
+ var target = getTargetToListenAt(this);
+ target.removeEventListener_(type, dispatchOriginalEvent, true);
+ }
+ },
+ dispatchEvent: function(event) {
+ var nativeEvent = unwrap(event);
+ var eventType = nativeEvent.type;
+ handledEventsTable.set(nativeEvent, false);
+ scope.renderAllPending();
+ var tempListener;
+ if (!hasListenerInAncestors(this, eventType)) {
+ tempListener = function() {};
+ this.addEventListener(eventType, tempListener, true);
+ }
+ try {
+ return unwrap(this).dispatchEvent_(nativeEvent);
+ } finally {
+ if (tempListener) this.removeEventListener(eventType, tempListener, true);
+ }
+ }
+ };
+ function hasListener(node, type) {
+ var listeners = listenersTable.get(node);
+ if (listeners) {
+ for (var i = 0; i < listeners.length; i++) {
+ if (!listeners[i].removed && listeners[i].type === type) return true;
+ }
+ }
+ return false;
+ }
+ function hasListenerInAncestors(target, type) {
+ for (var node = unwrap(target); node; node = node.parentNode) {
+ if (hasListener(wrap(node), type)) return true;
+ }
+ return false;
+ }
+ if (OriginalEventTarget) registerWrapper(OriginalEventTarget, EventTarget);
+ function wrapEventTargetMethods(constructors) {
+ forwardMethodsToWrapper(constructors, methodNames);
+ }
+ var originalElementFromPoint = document.elementFromPoint;
+ function elementFromPoint(self, document, x, y) {
+ scope.renderAllPending();
+ var element = wrap(originalElementFromPoint.call(unsafeUnwrap(document), x, y));
+ if (!element) return null;
+ var path = getEventPath(element, null);
+ var idx = path.lastIndexOf(self);
+ if (idx == -1) return null; else path = path.slice(0, idx);
+ return eventRetargetting(path, self);
+ }
+ function getEventHandlerGetter(name) {
+ return function() {
+ var inlineEventHandlers = eventHandlersTable.get(this);
+ return inlineEventHandlers && inlineEventHandlers[name] && inlineEventHandlers[name].value || null;
+ };
+ }
+ function getEventHandlerSetter(name) {
+ var eventType = name.slice(2);
+ return function(value) {
+ var inlineEventHandlers = eventHandlersTable.get(this);
+ if (!inlineEventHandlers) {
+ inlineEventHandlers = Object.create(null);
+ eventHandlersTable.set(this, inlineEventHandlers);
+ }
+ var old = inlineEventHandlers[name];
+ if (old) this.removeEventListener(eventType, old.wrapped, false);
+ if (typeof value === "function") {
+ var wrapped = function(e) {
+ var rv = value.call(this, e);
+ if (rv === false) e.preventDefault(); else if (name === "onbeforeunload" && typeof rv === "string") e.returnValue = rv;
+ };
+ this.addEventListener(eventType, wrapped, false);
+ inlineEventHandlers[name] = {
+ value: value,
+ wrapped: wrapped
+ };
+ }
+ };
+ }
+ scope.elementFromPoint = elementFromPoint;
+ scope.getEventHandlerGetter = getEventHandlerGetter;
+ scope.getEventHandlerSetter = getEventHandlerSetter;
+ scope.wrapEventTargetMethods = wrapEventTargetMethods;
+ scope.wrappers.BeforeUnloadEvent = BeforeUnloadEvent;
+ scope.wrappers.CustomEvent = CustomEvent;
+ scope.wrappers.Event = Event;
+ scope.wrappers.EventTarget = EventTarget;
+ scope.wrappers.FocusEvent = FocusEvent;
+ scope.wrappers.MouseEvent = MouseEvent;
+ scope.wrappers.UIEvent = UIEvent;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var UIEvent = scope.wrappers.UIEvent;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var OriginalTouchEvent = window.TouchEvent;
+ if (!OriginalTouchEvent) return;
+ var nativeEvent;
+ try {
+ nativeEvent = document.createEvent("TouchEvent");
+ } catch (ex) {
+ return;
+ }
+ var nonEnumDescriptor = {
+ enumerable: false
+ };
+ function nonEnum(obj, prop) {
+ Object.defineProperty(obj, prop, nonEnumDescriptor);
+ }
+ function Touch(impl) {
+ setWrapper(impl, this);
+ }
+ Touch.prototype = {
+ get target() {
+ return wrap(unsafeUnwrap(this).target);
+ }
+ };
+ var descr = {
+ configurable: true,
+ enumerable: true,
+ get: null
+ };
+ [ "clientX", "clientY", "screenX", "screenY", "pageX", "pageY", "identifier", "webkitRadiusX", "webkitRadiusY", "webkitRotationAngle", "webkitForce" ].forEach(function(name) {
+ descr.get = function() {
+ return unsafeUnwrap(this)[name];
+ };
+ Object.defineProperty(Touch.prototype, name, descr);
+ });
+ function TouchList() {
+ this.length = 0;
+ nonEnum(this, "length");
+ }
+ TouchList.prototype = {
+ item: function(index) {
+ return this[index];
+ }
+ };
+ function wrapTouchList(nativeTouchList) {
+ var list = new TouchList();
+ for (var i = 0; i < nativeTouchList.length; i++) {
+ list[i] = new Touch(nativeTouchList[i]);
+ }
+ list.length = i;
+ return list;
+ }
+ function TouchEvent(impl) {
+ UIEvent.call(this, impl);
+ }
+ TouchEvent.prototype = Object.create(UIEvent.prototype);
+ mixin(TouchEvent.prototype, {
+ get touches() {
+ return wrapTouchList(unsafeUnwrap(this).touches);
+ },
+ get targetTouches() {
+ return wrapTouchList(unsafeUnwrap(this).targetTouches);
+ },
+ get changedTouches() {
+ return wrapTouchList(unsafeUnwrap(this).changedTouches);
+ },
+ initTouchEvent: function() {
+ throw new Error("Not implemented");
+ }
+ });
+ registerWrapper(OriginalTouchEvent, TouchEvent, nativeEvent);
+ scope.wrappers.Touch = Touch;
+ scope.wrappers.TouchEvent = TouchEvent;
+ scope.wrappers.TouchList = TouchList;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var nonEnumDescriptor = {
+ enumerable: false
+ };
+ function nonEnum(obj, prop) {
+ Object.defineProperty(obj, prop, nonEnumDescriptor);
+ }
+ function NodeList() {
+ this.length = 0;
+ nonEnum(this, "length");
+ }
+ NodeList.prototype = {
+ item: function(index) {
+ return this[index];
+ }
+ };
+ nonEnum(NodeList.prototype, "item");
+ function wrapNodeList(list) {
+ if (list == null) return list;
+ var wrapperList = new NodeList();
+ for (var i = 0, length = list.length; i < length; i++) {
+ wrapperList[i] = wrap(list[i]);
+ }
+ wrapperList.length = length;
+ return wrapperList;
+ }
+ function addWrapNodeListMethod(wrapperConstructor, name) {
+ wrapperConstructor.prototype[name] = function() {
+ return wrapNodeList(unsafeUnwrap(this)[name].apply(unsafeUnwrap(this), arguments));
+ };
+ }
+ scope.wrappers.NodeList = NodeList;
+ scope.addWrapNodeListMethod = addWrapNodeListMethod;
+ scope.wrapNodeList = wrapNodeList;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ scope.wrapHTMLCollection = scope.wrapNodeList;
+ scope.wrappers.HTMLCollection = scope.wrappers.NodeList;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var EventTarget = scope.wrappers.EventTarget;
+ var NodeList = scope.wrappers.NodeList;
+ var TreeScope = scope.TreeScope;
+ var assert = scope.assert;
+ var defineWrapGetter = scope.defineWrapGetter;
+ var enqueueMutation = scope.enqueueMutation;
+ var getTreeScope = scope.getTreeScope;
+ var isWrapper = scope.isWrapper;
+ var mixin = scope.mixin;
+ var registerTransientObservers = scope.registerTransientObservers;
+ var registerWrapper = scope.registerWrapper;
+ var setTreeScope = scope.setTreeScope;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var wrapIfNeeded = scope.wrapIfNeeded;
+ var wrappers = scope.wrappers;
+ function assertIsNodeWrapper(node) {
+ assert(node instanceof Node);
+ }
+ function createOneElementNodeList(node) {
+ var nodes = new NodeList();
+ nodes[0] = node;
+ nodes.length = 1;
+ return nodes;
+ }
+ var surpressMutations = false;
+ function enqueueRemovalForInsertedNodes(node, parent, nodes) {
+ enqueueMutation(parent, "childList", {
+ removedNodes: nodes,
+ previousSibling: node.previousSibling,
+ nextSibling: node.nextSibling
+ });
+ }
+ function enqueueRemovalForInsertedDocumentFragment(df, nodes) {
+ enqueueMutation(df, "childList", {
+ removedNodes: nodes
+ });
+ }
+ function collectNodes(node, parentNode, previousNode, nextNode) {
+ if (node instanceof DocumentFragment) {
+ var nodes = collectNodesForDocumentFragment(node);
+ surpressMutations = true;
+ for (var i = nodes.length - 1; i >= 0; i--) {
+ node.removeChild(nodes[i]);
+ nodes[i].parentNode_ = parentNode;
+ }
+ surpressMutations = false;
+ for (var i = 0; i < nodes.length; i++) {
+ nodes[i].previousSibling_ = nodes[i - 1] || previousNode;
+ nodes[i].nextSibling_ = nodes[i + 1] || nextNode;
+ }
+ if (previousNode) previousNode.nextSibling_ = nodes[0];
+ if (nextNode) nextNode.previousSibling_ = nodes[nodes.length - 1];
+ return nodes;
+ }
+ var nodes = createOneElementNodeList(node);
+ var oldParent = node.parentNode;
+ if (oldParent) {
+ oldParent.removeChild(node);
+ }
+ node.parentNode_ = parentNode;
+ node.previousSibling_ = previousNode;
+ node.nextSibling_ = nextNode;
+ if (previousNode) previousNode.nextSibling_ = node;
+ if (nextNode) nextNode.previousSibling_ = node;
+ return nodes;
+ }
+ function collectNodesNative(node) {
+ if (node instanceof DocumentFragment) return collectNodesForDocumentFragment(node);
+ var nodes = createOneElementNodeList(node);
+ var oldParent = node.parentNode;
+ if (oldParent) enqueueRemovalForInsertedNodes(node, oldParent, nodes);
+ return nodes;
+ }
+ function collectNodesForDocumentFragment(node) {
+ var nodes = new NodeList();
+ var i = 0;
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ nodes[i++] = child;
+ }
+ nodes.length = i;
+ enqueueRemovalForInsertedDocumentFragment(node, nodes);
+ return nodes;
+ }
+ function snapshotNodeList(nodeList) {
+ return nodeList;
+ }
+ function nodeWasAdded(node, treeScope) {
+ setTreeScope(node, treeScope);
+ node.nodeIsInserted_();
+ }
+ function nodesWereAdded(nodes, parent) {
+ var treeScope = getTreeScope(parent);
+ for (var i = 0; i < nodes.length; i++) {
+ nodeWasAdded(nodes[i], treeScope);
+ }
+ }
+ function nodeWasRemoved(node) {
+ setTreeScope(node, new TreeScope(node, null));
+ }
+ function nodesWereRemoved(nodes) {
+ for (var i = 0; i < nodes.length; i++) {
+ nodeWasRemoved(nodes[i]);
+ }
+ }
+ function ensureSameOwnerDocument(parent, child) {
+ var ownerDoc = parent.nodeType === Node.DOCUMENT_NODE ? parent : parent.ownerDocument;
+ if (ownerDoc !== child.ownerDocument) ownerDoc.adoptNode(child);
+ }
+ function adoptNodesIfNeeded(owner, nodes) {
+ if (!nodes.length) return;
+ var ownerDoc = owner.ownerDocument;
+ if (ownerDoc === nodes[0].ownerDocument) return;
+ for (var i = 0; i < nodes.length; i++) {
+ scope.adoptNodeNoRemove(nodes[i], ownerDoc);
+ }
+ }
+ function unwrapNodesForInsertion(owner, nodes) {
+ adoptNodesIfNeeded(owner, nodes);
+ var length = nodes.length;
+ if (length === 1) return unwrap(nodes[0]);
+ var df = unwrap(owner.ownerDocument.createDocumentFragment());
+ for (var i = 0; i < length; i++) {
+ df.appendChild(unwrap(nodes[i]));
+ }
+ return df;
+ }
+ function clearChildNodes(wrapper) {
+ if (wrapper.firstChild_ !== undefined) {
+ var child = wrapper.firstChild_;
+ while (child) {
+ var tmp = child;
+ child = child.nextSibling_;
+ tmp.parentNode_ = tmp.previousSibling_ = tmp.nextSibling_ = undefined;
+ }
+ }
+ wrapper.firstChild_ = wrapper.lastChild_ = undefined;
+ }
+ function removeAllChildNodes(wrapper) {
+ if (wrapper.invalidateShadowRenderer()) {
+ var childWrapper = wrapper.firstChild;
+ while (childWrapper) {
+ assert(childWrapper.parentNode === wrapper);
+ var nextSibling = childWrapper.nextSibling;
+ var childNode = unwrap(childWrapper);
+ var parentNode = childNode.parentNode;
+ if (parentNode) originalRemoveChild.call(parentNode, childNode);
+ childWrapper.previousSibling_ = childWrapper.nextSibling_ = childWrapper.parentNode_ = null;
+ childWrapper = nextSibling;
+ }
+ wrapper.firstChild_ = wrapper.lastChild_ = null;
+ } else {
+ var node = unwrap(wrapper);
+ var child = node.firstChild;
+ var nextSibling;
+ while (child) {
+ nextSibling = child.nextSibling;
+ originalRemoveChild.call(node, child);
+ child = nextSibling;
+ }
+ }
+ }
+ function invalidateParent(node) {
+ var p = node.parentNode;
+ return p && p.invalidateShadowRenderer();
+ }
+ function cleanupNodes(nodes) {
+ for (var i = 0, n; i < nodes.length; i++) {
+ n = nodes[i];
+ n.parentNode.removeChild(n);
+ }
+ }
+ var originalImportNode = document.importNode;
+ var originalCloneNode = window.Node.prototype.cloneNode;
+ function cloneNode(node, deep, opt_doc) {
+ var clone;
+ if (opt_doc) clone = wrap(originalImportNode.call(opt_doc, unsafeUnwrap(node), false)); else clone = wrap(originalCloneNode.call(unsafeUnwrap(node), false));
+ if (deep) {
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ clone.appendChild(cloneNode(child, true, opt_doc));
+ }
+ if (node instanceof wrappers.HTMLTemplateElement) {
+ var cloneContent = clone.content;
+ for (var child = node.content.firstChild; child; child = child.nextSibling) {
+ cloneContent.appendChild(cloneNode(child, true, opt_doc));
+ }
+ }
+ }
+ return clone;
+ }
+ function contains(self, child) {
+ if (!child || getTreeScope(self) !== getTreeScope(child)) return false;
+ for (var node = child; node; node = node.parentNode) {
+ if (node === self) return true;
+ }
+ return false;
+ }
+ var OriginalNode = window.Node;
+ function Node(original) {
+ assert(original instanceof OriginalNode);
+ EventTarget.call(this, original);
+ this.parentNode_ = undefined;
+ this.firstChild_ = undefined;
+ this.lastChild_ = undefined;
+ this.nextSibling_ = undefined;
+ this.previousSibling_ = undefined;
+ this.treeScope_ = undefined;
+ }
+ var OriginalDocumentFragment = window.DocumentFragment;
+ var originalAppendChild = OriginalNode.prototype.appendChild;
+ var originalCompareDocumentPosition = OriginalNode.prototype.compareDocumentPosition;
+ var originalIsEqualNode = OriginalNode.prototype.isEqualNode;
+ var originalInsertBefore = OriginalNode.prototype.insertBefore;
+ var originalRemoveChild = OriginalNode.prototype.removeChild;
+ var originalReplaceChild = OriginalNode.prototype.replaceChild;
+ var isIe = /Trident|Edge/.test(navigator.userAgent);
+ var removeChildOriginalHelper = isIe ? function(parent, child) {
+ try {
+ originalRemoveChild.call(parent, child);
+ } catch (ex) {
+ if (!(parent instanceof OriginalDocumentFragment)) throw ex;
+ }
+ } : function(parent, child) {
+ originalRemoveChild.call(parent, child);
+ };
+ Node.prototype = Object.create(EventTarget.prototype);
+ mixin(Node.prototype, {
+ appendChild: function(childWrapper) {
+ return this.insertBefore(childWrapper, null);
+ },
+ insertBefore: function(childWrapper, refWrapper) {
+ assertIsNodeWrapper(childWrapper);
+ var refNode;
+ if (refWrapper) {
+ if (isWrapper(refWrapper)) {
+ refNode = unwrap(refWrapper);
+ } else {
+ refNode = refWrapper;
+ refWrapper = wrap(refNode);
+ }
+ } else {
+ refWrapper = null;
+ refNode = null;
+ }
+ refWrapper && assert(refWrapper.parentNode === this);
+ var nodes;
+ var previousNode = refWrapper ? refWrapper.previousSibling : this.lastChild;
+ var useNative = !this.invalidateShadowRenderer() && !invalidateParent(childWrapper);
+ if (useNative) nodes = collectNodesNative(childWrapper); else nodes = collectNodes(childWrapper, this, previousNode, refWrapper);
+ if (useNative) {
+ ensureSameOwnerDocument(this, childWrapper);
+ clearChildNodes(this);
+ originalInsertBefore.call(unsafeUnwrap(this), unwrap(childWrapper), refNode);
+ } else {
+ if (!previousNode) this.firstChild_ = nodes[0];
+ if (!refWrapper) {
+ this.lastChild_ = nodes[nodes.length - 1];
+ if (this.firstChild_ === undefined) this.firstChild_ = this.firstChild;
+ }
+ var parentNode = refNode ? refNode.parentNode : unsafeUnwrap(this);
+ if (parentNode) {
+ originalInsertBefore.call(parentNode, unwrapNodesForInsertion(this, nodes), refNode);
+ } else {
+ adoptNodesIfNeeded(this, nodes);
+ }
+ }
+ enqueueMutation(this, "childList", {
+ addedNodes: nodes,
+ nextSibling: refWrapper,
+ previousSibling: previousNode
+ });
+ nodesWereAdded(nodes, this);
+ return childWrapper;
+ },
+ removeChild: function(childWrapper) {
+ assertIsNodeWrapper(childWrapper);
+ if (childWrapper.parentNode !== this) {
+ var found = false;
+ var childNodes = this.childNodes;
+ for (var ieChild = this.firstChild; ieChild; ieChild = ieChild.nextSibling) {
+ if (ieChild === childWrapper) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ throw new Error("NotFoundError");
+ }
+ }
+ var childNode = unwrap(childWrapper);
+ var childWrapperNextSibling = childWrapper.nextSibling;
+ var childWrapperPreviousSibling = childWrapper.previousSibling;
+ if (this.invalidateShadowRenderer()) {
+ var thisFirstChild = this.firstChild;
+ var thisLastChild = this.lastChild;
+ var parentNode = childNode.parentNode;
+ if (parentNode) removeChildOriginalHelper(parentNode, childNode);
+ if (thisFirstChild === childWrapper) this.firstChild_ = childWrapperNextSibling;
+ if (thisLastChild === childWrapper) this.lastChild_ = childWrapperPreviousSibling;
+ if (childWrapperPreviousSibling) childWrapperPreviousSibling.nextSibling_ = childWrapperNextSibling;
+ if (childWrapperNextSibling) {
+ childWrapperNextSibling.previousSibling_ = childWrapperPreviousSibling;
+ }
+ childWrapper.previousSibling_ = childWrapper.nextSibling_ = childWrapper.parentNode_ = undefined;
+ } else {
+ clearChildNodes(this);
+ removeChildOriginalHelper(unsafeUnwrap(this), childNode);
+ }
+ if (!surpressMutations) {
+ enqueueMutation(this, "childList", {
+ removedNodes: createOneElementNodeList(childWrapper),
+ nextSibling: childWrapperNextSibling,
+ previousSibling: childWrapperPreviousSibling
+ });
+ }
+ registerTransientObservers(this, childWrapper);
+ return childWrapper;
+ },
+ replaceChild: function(newChildWrapper, oldChildWrapper) {
+ assertIsNodeWrapper(newChildWrapper);
+ var oldChildNode;
+ if (isWrapper(oldChildWrapper)) {
+ oldChildNode = unwrap(oldChildWrapper);
+ } else {
+ oldChildNode = oldChildWrapper;
+ oldChildWrapper = wrap(oldChildNode);
+ }
+ if (oldChildWrapper.parentNode !== this) {
+ throw new Error("NotFoundError");
+ }
+ var nextNode = oldChildWrapper.nextSibling;
+ var previousNode = oldChildWrapper.previousSibling;
+ var nodes;
+ var useNative = !this.invalidateShadowRenderer() && !invalidateParent(newChildWrapper);
+ if (useNative) {
+ nodes = collectNodesNative(newChildWrapper);
+ } else {
+ if (nextNode === newChildWrapper) nextNode = newChildWrapper.nextSibling;
+ nodes = collectNodes(newChildWrapper, this, previousNode, nextNode);
+ }
+ if (!useNative) {
+ if (this.firstChild === oldChildWrapper) this.firstChild_ = nodes[0];
+ if (this.lastChild === oldChildWrapper) this.lastChild_ = nodes[nodes.length - 1];
+ oldChildWrapper.previousSibling_ = oldChildWrapper.nextSibling_ = oldChildWrapper.parentNode_ = undefined;
+ if (oldChildNode.parentNode) {
+ originalReplaceChild.call(oldChildNode.parentNode, unwrapNodesForInsertion(this, nodes), oldChildNode);
+ }
+ } else {
+ ensureSameOwnerDocument(this, newChildWrapper);
+ clearChildNodes(this);
+ originalReplaceChild.call(unsafeUnwrap(this), unwrap(newChildWrapper), oldChildNode);
+ }
+ enqueueMutation(this, "childList", {
+ addedNodes: nodes,
+ removedNodes: createOneElementNodeList(oldChildWrapper),
+ nextSibling: nextNode,
+ previousSibling: previousNode
+ });
+ nodeWasRemoved(oldChildWrapper);
+ nodesWereAdded(nodes, this);
+ return oldChildWrapper;
+ },
+ nodeIsInserted_: function() {
+ for (var child = this.firstChild; child; child = child.nextSibling) {
+ child.nodeIsInserted_();
+ }
+ },
+ hasChildNodes: function() {
+ return this.firstChild !== null;
+ },
+ get parentNode() {
+ return this.parentNode_ !== undefined ? this.parentNode_ : wrap(unsafeUnwrap(this).parentNode);
+ },
+ get firstChild() {
+ return this.firstChild_ !== undefined ? this.firstChild_ : wrap(unsafeUnwrap(this).firstChild);
+ },
+ get lastChild() {
+ return this.lastChild_ !== undefined ? this.lastChild_ : wrap(unsafeUnwrap(this).lastChild);
+ },
+ get nextSibling() {
+ return this.nextSibling_ !== undefined ? this.nextSibling_ : wrap(unsafeUnwrap(this).nextSibling);
+ },
+ get previousSibling() {
+ return this.previousSibling_ !== undefined ? this.previousSibling_ : wrap(unsafeUnwrap(this).previousSibling);
+ },
+ get parentElement() {
+ var p = this.parentNode;
+ while (p && p.nodeType !== Node.ELEMENT_NODE) {
+ p = p.parentNode;
+ }
+ return p;
+ },
+ get textContent() {
+ var s = "";
+ for (var child = this.firstChild; child; child = child.nextSibling) {
+ if (child.nodeType != Node.COMMENT_NODE) {
+ s += child.textContent;
+ }
+ }
+ return s;
+ },
+ set textContent(textContent) {
+ if (textContent == null) textContent = "";
+ var removedNodes = snapshotNodeList(this.childNodes);
+ if (this.invalidateShadowRenderer()) {
+ removeAllChildNodes(this);
+ if (textContent !== "") {
+ var textNode = unsafeUnwrap(this).ownerDocument.createTextNode(textContent);
+ this.appendChild(textNode);
+ }
+ } else {
+ clearChildNodes(this);
+ unsafeUnwrap(this).textContent = textContent;
+ }
+ var addedNodes = snapshotNodeList(this.childNodes);
+ enqueueMutation(this, "childList", {
+ addedNodes: addedNodes,
+ removedNodes: removedNodes
+ });
+ nodesWereRemoved(removedNodes);
+ nodesWereAdded(addedNodes, this);
+ },
+ get childNodes() {
+ var wrapperList = new NodeList();
+ var i = 0;
+ for (var child = this.firstChild; child; child = child.nextSibling) {
+ wrapperList[i++] = child;
+ }
+ wrapperList.length = i;
+ return wrapperList;
+ },
+ cloneNode: function(deep) {
+ return cloneNode(this, deep);
+ },
+ contains: function(child) {
+ return contains(this, wrapIfNeeded(child));
+ },
+ compareDocumentPosition: function(otherNode) {
+ return originalCompareDocumentPosition.call(unsafeUnwrap(this), unwrapIfNeeded(otherNode));
+ },
+ isEqualNode: function(otherNode) {
+ return originalIsEqualNode.call(unsafeUnwrap(this), unwrapIfNeeded(otherNode));
+ },
+ normalize: function() {
+ var nodes = snapshotNodeList(this.childNodes);
+ var remNodes = [];
+ var s = "";
+ var modNode;
+ for (var i = 0, n; i < nodes.length; i++) {
+ n = nodes[i];
+ if (n.nodeType === Node.TEXT_NODE) {
+ if (!modNode && !n.data.length) this.removeChild(n); else if (!modNode) modNode = n; else {
+ s += n.data;
+ remNodes.push(n);
+ }
+ } else {
+ if (modNode && remNodes.length) {
+ modNode.data += s;
+ cleanupNodes(remNodes);
+ }
+ remNodes = [];
+ s = "";
+ modNode = null;
+ if (n.childNodes.length) n.normalize();
+ }
+ }
+ if (modNode && remNodes.length) {
+ modNode.data += s;
+ cleanupNodes(remNodes);
+ }
+ }
+ });
+ defineWrapGetter(Node, "ownerDocument");
+ registerWrapper(OriginalNode, Node, document.createDocumentFragment());
+ delete Node.prototype.querySelector;
+ delete Node.prototype.querySelectorAll;
+ Node.prototype = mixin(Object.create(EventTarget.prototype), Node.prototype);
+ scope.cloneNode = cloneNode;
+ scope.nodeWasAdded = nodeWasAdded;
+ scope.nodeWasRemoved = nodeWasRemoved;
+ scope.nodesWereAdded = nodesWereAdded;
+ scope.nodesWereRemoved = nodesWereRemoved;
+ scope.originalInsertBefore = originalInsertBefore;
+ scope.originalRemoveChild = originalRemoveChild;
+ scope.snapshotNodeList = snapshotNodeList;
+ scope.wrappers.Node = Node;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLCollection = scope.wrappers.HTMLCollection;
+ var NodeList = scope.wrappers.NodeList;
+ var getTreeScope = scope.getTreeScope;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var originalDocumentQuerySelector = document.querySelector;
+ var originalElementQuerySelector = document.documentElement.querySelector;
+ var originalDocumentQuerySelectorAll = document.querySelectorAll;
+ var originalElementQuerySelectorAll = document.documentElement.querySelectorAll;
+ var originalDocumentGetElementsByTagName = document.getElementsByTagName;
+ var originalElementGetElementsByTagName = document.documentElement.getElementsByTagName;
+ var originalDocumentGetElementsByTagNameNS = document.getElementsByTagNameNS;
+ var originalElementGetElementsByTagNameNS = document.documentElement.getElementsByTagNameNS;
+ var OriginalElement = window.Element;
+ var OriginalDocument = window.HTMLDocument || window.Document;
+ function filterNodeList(list, index, result, deep) {
+ var wrappedItem = null;
+ var root = null;
+ for (var i = 0, length = list.length; i < length; i++) {
+ wrappedItem = wrap(list[i]);
+ if (!deep && (root = getTreeScope(wrappedItem).root)) {
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ continue;
+ }
+ }
+ result[index++] = wrappedItem;
+ }
+ return index;
+ }
+ function shimSelector(selector) {
+ return String(selector).replace(/\/deep\/|::shadow|>>>/g, " ");
+ }
+ function shimMatchesSelector(selector) {
+ return String(selector).replace(/:host\(([^\s]+)\)/g, "$1").replace(/([^\s]):host/g, "$1").replace(":host", "*").replace(/\^|\/shadow\/|\/shadow-deep\/|::shadow|\/deep\/|::content|>>>/g, " ");
+ }
+ function findOne(node, selector) {
+ var m, el = node.firstElementChild;
+ while (el) {
+ if (el.matches(selector)) return el;
+ m = findOne(el, selector);
+ if (m) return m;
+ el = el.nextElementSibling;
+ }
+ return null;
+ }
+ function matchesSelector(el, selector) {
+ return el.matches(selector);
+ }
+ var XHTML_NS = "http://www.w3.org/1999/xhtml";
+ function matchesTagName(el, localName, localNameLowerCase) {
+ var ln = el.localName;
+ return ln === localName || ln === localNameLowerCase && el.namespaceURI === XHTML_NS;
+ }
+ function matchesEveryThing() {
+ return true;
+ }
+ function matchesLocalNameOnly(el, ns, localName) {
+ return el.localName === localName;
+ }
+ function matchesNameSpace(el, ns) {
+ return el.namespaceURI === ns;
+ }
+ function matchesLocalNameNS(el, ns, localName) {
+ return el.namespaceURI === ns && el.localName === localName;
+ }
+ function findElements(node, index, result, p, arg0, arg1) {
+ var el = node.firstElementChild;
+ while (el) {
+ if (p(el, arg0, arg1)) result[index++] = el;
+ index = findElements(el, index, result, p, arg0, arg1);
+ el = el.nextElementSibling;
+ }
+ return index;
+ }
+ function querySelectorAllFiltered(p, index, result, selector, deep) {
+ var target = unsafeUnwrap(this);
+ var list;
+ var root = getTreeScope(this).root;
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findElements(this, index, result, p, selector, null);
+ } else if (target instanceof OriginalElement) {
+ list = originalElementQuerySelectorAll.call(target, selector);
+ } else if (target instanceof OriginalDocument) {
+ list = originalDocumentQuerySelectorAll.call(target, selector);
+ } else {
+ return findElements(this, index, result, p, selector, null);
+ }
+ return filterNodeList(list, index, result, deep);
+ }
+ var SelectorsInterface = {
+ querySelector: function(selector) {
+ var shimmed = shimSelector(selector);
+ var deep = shimmed !== selector;
+ selector = shimmed;
+ var target = unsafeUnwrap(this);
+ var wrappedItem;
+ var root = getTreeScope(this).root;
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findOne(this, selector);
+ } else if (target instanceof OriginalElement) {
+ wrappedItem = wrap(originalElementQuerySelector.call(target, selector));
+ } else if (target instanceof OriginalDocument) {
+ wrappedItem = wrap(originalDocumentQuerySelector.call(target, selector));
+ } else {
+ return findOne(this, selector);
+ }
+ if (!wrappedItem) {
+ return wrappedItem;
+ } else if (!deep && (root = getTreeScope(wrappedItem).root)) {
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findOne(this, selector);
+ }
+ }
+ return wrappedItem;
+ },
+ querySelectorAll: function(selector) {
+ var shimmed = shimSelector(selector);
+ var deep = shimmed !== selector;
+ selector = shimmed;
+ var result = new NodeList();
+ result.length = querySelectorAllFiltered.call(this, matchesSelector, 0, result, selector, deep);
+ return result;
+ }
+ };
+ var MatchesInterface = {
+ matches: function(selector) {
+ selector = shimMatchesSelector(selector);
+ return scope.originalMatches.call(unsafeUnwrap(this), selector);
+ }
+ };
+ function getElementsByTagNameFiltered(p, index, result, localName, lowercase) {
+ var target = unsafeUnwrap(this);
+ var list;
+ var root = getTreeScope(this).root;
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findElements(this, index, result, p, localName, lowercase);
+ } else if (target instanceof OriginalElement) {
+ list = originalElementGetElementsByTagName.call(target, localName, lowercase);
+ } else if (target instanceof OriginalDocument) {
+ list = originalDocumentGetElementsByTagName.call(target, localName, lowercase);
+ } else {
+ return findElements(this, index, result, p, localName, lowercase);
+ }
+ return filterNodeList(list, index, result, false);
+ }
+ function getElementsByTagNameNSFiltered(p, index, result, ns, localName) {
+ var target = unsafeUnwrap(this);
+ var list;
+ var root = getTreeScope(this).root;
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findElements(this, index, result, p, ns, localName);
+ } else if (target instanceof OriginalElement) {
+ list = originalElementGetElementsByTagNameNS.call(target, ns, localName);
+ } else if (target instanceof OriginalDocument) {
+ list = originalDocumentGetElementsByTagNameNS.call(target, ns, localName);
+ } else {
+ return findElements(this, index, result, p, ns, localName);
+ }
+ return filterNodeList(list, index, result, false);
+ }
+ var GetElementsByInterface = {
+ getElementsByTagName: function(localName) {
+ var result = new HTMLCollection();
+ var match = localName === "*" ? matchesEveryThing : matchesTagName;
+ result.length = getElementsByTagNameFiltered.call(this, match, 0, result, localName, localName.toLowerCase());
+ return result;
+ },
+ getElementsByClassName: function(className) {
+ return this.querySelectorAll("." + className);
+ },
+ getElementsByTagNameNS: function(ns, localName) {
+ var result = new HTMLCollection();
+ var match = null;
+ if (ns === "*") {
+ match = localName === "*" ? matchesEveryThing : matchesLocalNameOnly;
+ } else {
+ match = localName === "*" ? matchesNameSpace : matchesLocalNameNS;
+ }
+ result.length = getElementsByTagNameNSFiltered.call(this, match, 0, result, ns || null, localName);
+ return result;
+ }
+ };
+ scope.GetElementsByInterface = GetElementsByInterface;
+ scope.SelectorsInterface = SelectorsInterface;
+ scope.MatchesInterface = MatchesInterface;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var NodeList = scope.wrappers.NodeList;
+ function forwardElement(node) {
+ while (node && node.nodeType !== Node.ELEMENT_NODE) {
+ node = node.nextSibling;
+ }
+ return node;
+ }
+ function backwardsElement(node) {
+ while (node && node.nodeType !== Node.ELEMENT_NODE) {
+ node = node.previousSibling;
+ }
+ return node;
+ }
+ var ParentNodeInterface = {
+ get firstElementChild() {
+ return forwardElement(this.firstChild);
+ },
+ get lastElementChild() {
+ return backwardsElement(this.lastChild);
+ },
+ get childElementCount() {
+ var count = 0;
+ for (var child = this.firstElementChild; child; child = child.nextElementSibling) {
+ count++;
+ }
+ return count;
+ },
+ get children() {
+ var wrapperList = new NodeList();
+ var i = 0;
+ for (var child = this.firstElementChild; child; child = child.nextElementSibling) {
+ wrapperList[i++] = child;
+ }
+ wrapperList.length = i;
+ return wrapperList;
+ },
+ remove: function() {
+ var p = this.parentNode;
+ if (p) p.removeChild(this);
+ }
+ };
+ var ChildNodeInterface = {
+ get nextElementSibling() {
+ return forwardElement(this.nextSibling);
+ },
+ get previousElementSibling() {
+ return backwardsElement(this.previousSibling);
+ }
+ };
+ var NonElementParentNodeInterface = {
+ getElementById: function(id) {
+ if (/[ \t\n\r\f]/.test(id)) return null;
+ return this.querySelector('[id="' + id + '"]');
+ }
+ };
+ scope.ChildNodeInterface = ChildNodeInterface;
+ scope.NonElementParentNodeInterface = NonElementParentNodeInterface;
+ scope.ParentNodeInterface = ParentNodeInterface;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var ChildNodeInterface = scope.ChildNodeInterface;
+ var Node = scope.wrappers.Node;
+ var enqueueMutation = scope.enqueueMutation;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var OriginalCharacterData = window.CharacterData;
+ function CharacterData(node) {
+ Node.call(this, node);
+ }
+ CharacterData.prototype = Object.create(Node.prototype);
+ mixin(CharacterData.prototype, {
+ get nodeValue() {
+ return this.data;
+ },
+ set nodeValue(data) {
+ this.data = data;
+ },
+ get textContent() {
+ return this.data;
+ },
+ set textContent(value) {
+ this.data = value;
+ },
+ get data() {
+ return unsafeUnwrap(this).data;
+ },
+ set data(value) {
+ var oldValue = unsafeUnwrap(this).data;
+ enqueueMutation(this, "characterData", {
+ oldValue: oldValue
+ });
+ unsafeUnwrap(this).data = value;
+ }
+ });
+ mixin(CharacterData.prototype, ChildNodeInterface);
+ registerWrapper(OriginalCharacterData, CharacterData, document.createTextNode(""));
+ scope.wrappers.CharacterData = CharacterData;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var CharacterData = scope.wrappers.CharacterData;
+ var enqueueMutation = scope.enqueueMutation;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ function toUInt32(x) {
+ return x >>> 0;
+ }
+ var OriginalText = window.Text;
+ function Text(node) {
+ CharacterData.call(this, node);
+ }
+ Text.prototype = Object.create(CharacterData.prototype);
+ mixin(Text.prototype, {
+ splitText: function(offset) {
+ offset = toUInt32(offset);
+ var s = this.data;
+ if (offset > s.length) throw new Error("IndexSizeError");
+ var head = s.slice(0, offset);
+ var tail = s.slice(offset);
+ this.data = head;
+ var newTextNode = this.ownerDocument.createTextNode(tail);
+ if (this.parentNode) this.parentNode.insertBefore(newTextNode, this.nextSibling);
+ return newTextNode;
+ }
+ });
+ registerWrapper(OriginalText, Text, document.createTextNode(""));
+ scope.wrappers.Text = Text;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ if (!window.DOMTokenList) {
+ console.warn("Missing DOMTokenList prototype, please include a " + "compatible classList polyfill such as http://goo.gl/uTcepH.");
+ return;
+ }
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var enqueueMutation = scope.enqueueMutation;
+ function getClass(el) {
+ return unsafeUnwrap(el).getAttribute("class");
+ }
+ function enqueueClassAttributeChange(el, oldValue) {
+ enqueueMutation(el, "attributes", {
+ name: "class",
+ namespace: null,
+ oldValue: oldValue
+ });
+ }
+ function invalidateClass(el) {
+ scope.invalidateRendererBasedOnAttribute(el, "class");
+ }
+ function changeClass(tokenList, method, args) {
+ var ownerElement = tokenList.ownerElement_;
+ if (ownerElement == null) {
+ return method.apply(tokenList, args);
+ }
+ var oldValue = getClass(ownerElement);
+ var retv = method.apply(tokenList, args);
+ if (getClass(ownerElement) !== oldValue) {
+ enqueueClassAttributeChange(ownerElement, oldValue);
+ invalidateClass(ownerElement);
+ }
+ return retv;
+ }
+ var oldAdd = DOMTokenList.prototype.add;
+ DOMTokenList.prototype.add = function() {
+ changeClass(this, oldAdd, arguments);
+ };
+ var oldRemove = DOMTokenList.prototype.remove;
+ DOMTokenList.prototype.remove = function() {
+ changeClass(this, oldRemove, arguments);
+ };
+ var oldToggle = DOMTokenList.prototype.toggle;
+ DOMTokenList.prototype.toggle = function() {
+ return changeClass(this, oldToggle, arguments);
+ };
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var ChildNodeInterface = scope.ChildNodeInterface;
+ var GetElementsByInterface = scope.GetElementsByInterface;
+ var Node = scope.wrappers.Node;
+ var ParentNodeInterface = scope.ParentNodeInterface;
+ var SelectorsInterface = scope.SelectorsInterface;
+ var MatchesInterface = scope.MatchesInterface;
+ var addWrapNodeListMethod = scope.addWrapNodeListMethod;
+ var enqueueMutation = scope.enqueueMutation;
+ var mixin = scope.mixin;
+ var oneOf = scope.oneOf;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrappers = scope.wrappers;
+ var OriginalElement = window.Element;
+ var matchesNames = [ "matches", "mozMatchesSelector", "msMatchesSelector", "webkitMatchesSelector" ].filter(function(name) {
+ return OriginalElement.prototype[name];
+ });
+ var matchesName = matchesNames[0];
+ var originalMatches = OriginalElement.prototype[matchesName];
+ function invalidateRendererBasedOnAttribute(element, name) {
+ var p = element.parentNode;
+ if (!p || !p.shadowRoot) return;
+ var renderer = scope.getRendererForHost(p);
+ if (renderer.dependsOnAttribute(name)) renderer.invalidate();
+ }
+ function enqueAttributeChange(element, name, oldValue) {
+ enqueueMutation(element, "attributes", {
+ name: name,
+ namespace: null,
+ oldValue: oldValue
+ });
+ }
+ var classListTable = new WeakMap();
+ function Element(node) {
+ Node.call(this, node);
+ }
+ Element.prototype = Object.create(Node.prototype);
+ mixin(Element.prototype, {
+ createShadowRoot: function() {
+ var newShadowRoot = new wrappers.ShadowRoot(this);
+ unsafeUnwrap(this).polymerShadowRoot_ = newShadowRoot;
+ var renderer = scope.getRendererForHost(this);
+ renderer.invalidate();
+ return newShadowRoot;
+ },
+ get shadowRoot() {
+ return unsafeUnwrap(this).polymerShadowRoot_ || null;
+ },
+ setAttribute: function(name, value) {
+ var oldValue = unsafeUnwrap(this).getAttribute(name);
+ unsafeUnwrap(this).setAttribute(name, value);
+ enqueAttributeChange(this, name, oldValue);
+ invalidateRendererBasedOnAttribute(this, name);
+ },
+ removeAttribute: function(name) {
+ var oldValue = unsafeUnwrap(this).getAttribute(name);
+ unsafeUnwrap(this).removeAttribute(name);
+ enqueAttributeChange(this, name, oldValue);
+ invalidateRendererBasedOnAttribute(this, name);
+ },
+ get classList() {
+ var list = classListTable.get(this);
+ if (!list) {
+ list = unsafeUnwrap(this).classList;
+ if (!list) return;
+ list.ownerElement_ = this;
+ classListTable.set(this, list);
+ }
+ return list;
+ },
+ get className() {
+ return unsafeUnwrap(this).className;
+ },
+ set className(v) {
+ this.setAttribute("class", v);
+ },
+ get id() {
+ return unsafeUnwrap(this).id;
+ },
+ set id(v) {
+ this.setAttribute("id", v);
+ }
+ });
+ matchesNames.forEach(function(name) {
+ if (name !== "matches") {
+ Element.prototype[name] = function(selector) {
+ return this.matches(selector);
+ };
+ }
+ });
+ if (OriginalElement.prototype.webkitCreateShadowRoot) {
+ Element.prototype.webkitCreateShadowRoot = Element.prototype.createShadowRoot;
+ }
+ mixin(Element.prototype, ChildNodeInterface);
+ mixin(Element.prototype, GetElementsByInterface);
+ mixin(Element.prototype, ParentNodeInterface);
+ mixin(Element.prototype, SelectorsInterface);
+ mixin(Element.prototype, MatchesInterface);
+ registerWrapper(OriginalElement, Element, document.createElementNS(null, "x"));
+ scope.invalidateRendererBasedOnAttribute = invalidateRendererBasedOnAttribute;
+ scope.matchesNames = matchesNames;
+ scope.originalMatches = originalMatches;
+ scope.wrappers.Element = Element;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var Element = scope.wrappers.Element;
+ var defineGetter = scope.defineGetter;
+ var enqueueMutation = scope.enqueueMutation;
+ var mixin = scope.mixin;
+ var nodesWereAdded = scope.nodesWereAdded;
+ var nodesWereRemoved = scope.nodesWereRemoved;
+ var registerWrapper = scope.registerWrapper;
+ var snapshotNodeList = scope.snapshotNodeList;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var wrappers = scope.wrappers;
+ var escapeAttrRegExp = /[&\u00A0"]/g;
+ var escapeDataRegExp = /[&\u00A0<>]/g;
+ function escapeReplace(c) {
+ switch (c) {
+ case "&":
+ return "&";
+
+ case "<":
+ return "<";
+
+ case ">":
+ return ">";
+
+ case '"':
+ return """;
+
+ case " ":
+ return " ";
+ }
+ }
+ function escapeAttr(s) {
+ return s.replace(escapeAttrRegExp, escapeReplace);
+ }
+ function escapeData(s) {
+ return s.replace(escapeDataRegExp, escapeReplace);
+ }
+ function makeSet(arr) {
+ var set = {};
+ for (var i = 0; i < arr.length; i++) {
+ set[arr[i]] = true;
+ }
+ return set;
+ }
+ var voidElements = makeSet([ "area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr" ]);
+ var plaintextParents = makeSet([ "style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript" ]);
+ var XHTML_NS = "http://www.w3.org/1999/xhtml";
+ function needsSelfClosingSlash(node) {
+ if (node.namespaceURI !== XHTML_NS) return true;
+ var doctype = node.ownerDocument.doctype;
+ return doctype && doctype.publicId && doctype.systemId;
+ }
+ function getOuterHTML(node, parentNode) {
+ switch (node.nodeType) {
+ case Node.ELEMENT_NODE:
+ var tagName = node.tagName.toLowerCase();
+ var s = "<" + tagName;
+ var attrs = node.attributes;
+ for (var i = 0, attr; attr = attrs[i]; i++) {
+ s += " " + attr.name + '="' + escapeAttr(attr.value) + '"';
+ }
+ if (voidElements[tagName]) {
+ if (needsSelfClosingSlash(node)) s += "/";
+ return s + ">";
+ }
+ return s + ">" + getInnerHTML(node) + "" + tagName + ">";
+
+ case Node.TEXT_NODE:
+ var data = node.data;
+ if (parentNode && plaintextParents[parentNode.localName]) return data;
+ return escapeData(data);
+
+ case Node.COMMENT_NODE:
+ return "";
+
+ default:
+ console.error(node);
+ throw new Error("not implemented");
+ }
+ }
+ function getInnerHTML(node) {
+ if (node instanceof wrappers.HTMLTemplateElement) node = node.content;
+ var s = "";
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ s += getOuterHTML(child, node);
+ }
+ return s;
+ }
+ function setInnerHTML(node, value, opt_tagName) {
+ var tagName = opt_tagName || "div";
+ node.textContent = "";
+ var tempElement = unwrap(node.ownerDocument.createElement(tagName));
+ tempElement.innerHTML = value;
+ var firstChild;
+ while (firstChild = tempElement.firstChild) {
+ node.appendChild(wrap(firstChild));
+ }
+ }
+ var oldIe = /MSIE/.test(navigator.userAgent);
+ var OriginalHTMLElement = window.HTMLElement;
+ var OriginalHTMLTemplateElement = window.HTMLTemplateElement;
+ function HTMLElement(node) {
+ Element.call(this, node);
+ }
+ HTMLElement.prototype = Object.create(Element.prototype);
+ mixin(HTMLElement.prototype, {
+ get innerHTML() {
+ return getInnerHTML(this);
+ },
+ set innerHTML(value) {
+ if (oldIe && plaintextParents[this.localName]) {
+ this.textContent = value;
+ return;
+ }
+ var removedNodes = snapshotNodeList(this.childNodes);
+ if (this.invalidateShadowRenderer()) {
+ if (this instanceof wrappers.HTMLTemplateElement) setInnerHTML(this.content, value); else setInnerHTML(this, value, this.tagName);
+ } else if (!OriginalHTMLTemplateElement && this instanceof wrappers.HTMLTemplateElement) {
+ setInnerHTML(this.content, value);
+ } else {
+ unsafeUnwrap(this).innerHTML = value;
+ }
+ var addedNodes = snapshotNodeList(this.childNodes);
+ enqueueMutation(this, "childList", {
+ addedNodes: addedNodes,
+ removedNodes: removedNodes
+ });
+ nodesWereRemoved(removedNodes);
+ nodesWereAdded(addedNodes, this);
+ },
+ get outerHTML() {
+ return getOuterHTML(this, this.parentNode);
+ },
+ set outerHTML(value) {
+ var p = this.parentNode;
+ if (p) {
+ p.invalidateShadowRenderer();
+ var df = frag(p, value);
+ p.replaceChild(df, this);
+ }
+ },
+ insertAdjacentHTML: function(position, text) {
+ var contextElement, refNode;
+ switch (String(position).toLowerCase()) {
+ case "beforebegin":
+ contextElement = this.parentNode;
+ refNode = this;
+ break;
+
+ case "afterend":
+ contextElement = this.parentNode;
+ refNode = this.nextSibling;
+ break;
+
+ case "afterbegin":
+ contextElement = this;
+ refNode = this.firstChild;
+ break;
+
+ case "beforeend":
+ contextElement = this;
+ refNode = null;
+ break;
+
+ default:
+ return;
+ }
+ var df = frag(contextElement, text);
+ contextElement.insertBefore(df, refNode);
+ },
+ get hidden() {
+ return this.hasAttribute("hidden");
+ },
+ set hidden(v) {
+ if (v) {
+ this.setAttribute("hidden", "");
+ } else {
+ this.removeAttribute("hidden");
+ }
+ }
+ });
+ function frag(contextElement, html) {
+ var p = unwrap(contextElement.cloneNode(false));
+ p.innerHTML = html;
+ var df = unwrap(document.createDocumentFragment());
+ var c;
+ while (c = p.firstChild) {
+ df.appendChild(c);
+ }
+ return wrap(df);
+ }
+ function getter(name) {
+ return function() {
+ scope.renderAllPending();
+ return unsafeUnwrap(this)[name];
+ };
+ }
+ function getterRequiresRendering(name) {
+ defineGetter(HTMLElement, name, getter(name));
+ }
+ [ "clientHeight", "clientLeft", "clientTop", "clientWidth", "offsetHeight", "offsetLeft", "offsetTop", "offsetWidth", "scrollHeight", "scrollWidth" ].forEach(getterRequiresRendering);
+ function getterAndSetterRequiresRendering(name) {
+ Object.defineProperty(HTMLElement.prototype, name, {
+ get: getter(name),
+ set: function(v) {
+ scope.renderAllPending();
+ unsafeUnwrap(this)[name] = v;
+ },
+ configurable: true,
+ enumerable: true
+ });
+ }
+ [ "scrollLeft", "scrollTop" ].forEach(getterAndSetterRequiresRendering);
+ function methodRequiresRendering(name) {
+ Object.defineProperty(HTMLElement.prototype, name, {
+ value: function() {
+ scope.renderAllPending();
+ return unsafeUnwrap(this)[name].apply(unsafeUnwrap(this), arguments);
+ },
+ configurable: true,
+ enumerable: true
+ });
+ }
+ [ "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
+ registerWrapper(OriginalHTMLElement, HTMLElement, document.createElement("b"));
+ scope.wrappers.HTMLElement = HTMLElement;
+ scope.getInnerHTML = getInnerHTML;
+ scope.setInnerHTML = setInnerHTML;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLCanvasElement = window.HTMLCanvasElement;
+ function HTMLCanvasElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLCanvasElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLCanvasElement.prototype, {
+ getContext: function() {
+ var context = unsafeUnwrap(this).getContext.apply(unsafeUnwrap(this), arguments);
+ return context && wrap(context);
+ }
+ });
+ registerWrapper(OriginalHTMLCanvasElement, HTMLCanvasElement, document.createElement("canvas"));
+ scope.wrappers.HTMLCanvasElement = HTMLCanvasElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var OriginalHTMLContentElement = window.HTMLContentElement;
+ function HTMLContentElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLContentElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLContentElement.prototype, {
+ constructor: HTMLContentElement,
+ get select() {
+ return this.getAttribute("select");
+ },
+ set select(value) {
+ this.setAttribute("select", value);
+ },
+ setAttribute: function(n, v) {
+ HTMLElement.prototype.setAttribute.call(this, n, v);
+ if (String(n).toLowerCase() === "select") this.invalidateShadowRenderer(true);
+ }
+ });
+ if (OriginalHTMLContentElement) registerWrapper(OriginalHTMLContentElement, HTMLContentElement);
+ scope.wrappers.HTMLContentElement = HTMLContentElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var wrapHTMLCollection = scope.wrapHTMLCollection;
+ var unwrap = scope.unwrap;
+ var OriginalHTMLFormElement = window.HTMLFormElement;
+ function HTMLFormElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLFormElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLFormElement.prototype, {
+ get elements() {
+ return wrapHTMLCollection(unwrap(this).elements);
+ }
+ });
+ registerWrapper(OriginalHTMLFormElement, HTMLFormElement, document.createElement("form"));
+ scope.wrappers.HTMLFormElement = HTMLFormElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var rewrap = scope.rewrap;
+ var OriginalHTMLImageElement = window.HTMLImageElement;
+ function HTMLImageElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLImageElement.prototype = Object.create(HTMLElement.prototype);
+ registerWrapper(OriginalHTMLImageElement, HTMLImageElement, document.createElement("img"));
+ function Image(width, height) {
+ if (!(this instanceof Image)) {
+ throw new TypeError("DOM object constructor cannot be called as a function.");
+ }
+ var node = unwrap(document.createElement("img"));
+ HTMLElement.call(this, node);
+ rewrap(node, this);
+ if (width !== undefined) node.width = width;
+ if (height !== undefined) node.height = height;
+ }
+ Image.prototype = HTMLImageElement.prototype;
+ scope.wrappers.HTMLImageElement = HTMLImageElement;
+ scope.wrappers.Image = Image;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var NodeList = scope.wrappers.NodeList;
+ var registerWrapper = scope.registerWrapper;
+ var OriginalHTMLShadowElement = window.HTMLShadowElement;
+ function HTMLShadowElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLShadowElement.prototype = Object.create(HTMLElement.prototype);
+ HTMLShadowElement.prototype.constructor = HTMLShadowElement;
+ if (OriginalHTMLShadowElement) registerWrapper(OriginalHTMLShadowElement, HTMLShadowElement);
+ scope.wrappers.HTMLShadowElement = HTMLShadowElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var contentTable = new WeakMap();
+ var templateContentsOwnerTable = new WeakMap();
+ function getTemplateContentsOwner(doc) {
+ if (!doc.defaultView) return doc;
+ var d = templateContentsOwnerTable.get(doc);
+ if (!d) {
+ d = doc.implementation.createHTMLDocument("");
+ while (d.lastChild) {
+ d.removeChild(d.lastChild);
+ }
+ templateContentsOwnerTable.set(doc, d);
+ }
+ return d;
+ }
+ function extractContent(templateElement) {
+ var doc = getTemplateContentsOwner(templateElement.ownerDocument);
+ var df = unwrap(doc.createDocumentFragment());
+ var child;
+ while (child = templateElement.firstChild) {
+ df.appendChild(child);
+ }
+ return df;
+ }
+ var OriginalHTMLTemplateElement = window.HTMLTemplateElement;
+ function HTMLTemplateElement(node) {
+ HTMLElement.call(this, node);
+ if (!OriginalHTMLTemplateElement) {
+ var content = extractContent(node);
+ contentTable.set(this, wrap(content));
+ }
+ }
+ HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLTemplateElement.prototype, {
+ constructor: HTMLTemplateElement,
+ get content() {
+ if (OriginalHTMLTemplateElement) return wrap(unsafeUnwrap(this).content);
+ return contentTable.get(this);
+ }
+ });
+ if (OriginalHTMLTemplateElement) registerWrapper(OriginalHTMLTemplateElement, HTMLTemplateElement);
+ scope.wrappers.HTMLTemplateElement = HTMLTemplateElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var registerWrapper = scope.registerWrapper;
+ var OriginalHTMLMediaElement = window.HTMLMediaElement;
+ if (!OriginalHTMLMediaElement) return;
+ function HTMLMediaElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLMediaElement.prototype = Object.create(HTMLElement.prototype);
+ registerWrapper(OriginalHTMLMediaElement, HTMLMediaElement, document.createElement("audio"));
+ scope.wrappers.HTMLMediaElement = HTMLMediaElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLMediaElement = scope.wrappers.HTMLMediaElement;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var rewrap = scope.rewrap;
+ var OriginalHTMLAudioElement = window.HTMLAudioElement;
+ if (!OriginalHTMLAudioElement) return;
+ function HTMLAudioElement(node) {
+ HTMLMediaElement.call(this, node);
+ }
+ HTMLAudioElement.prototype = Object.create(HTMLMediaElement.prototype);
+ registerWrapper(OriginalHTMLAudioElement, HTMLAudioElement, document.createElement("audio"));
+ function Audio(src) {
+ if (!(this instanceof Audio)) {
+ throw new TypeError("DOM object constructor cannot be called as a function.");
+ }
+ var node = unwrap(document.createElement("audio"));
+ HTMLMediaElement.call(this, node);
+ rewrap(node, this);
+ node.setAttribute("preload", "auto");
+ if (src !== undefined) node.setAttribute("src", src);
+ }
+ Audio.prototype = HTMLAudioElement.prototype;
+ scope.wrappers.HTMLAudioElement = HTMLAudioElement;
+ scope.wrappers.Audio = Audio;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var rewrap = scope.rewrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLOptionElement = window.HTMLOptionElement;
+ function trimText(s) {
+ return s.replace(/\s+/g, " ").trim();
+ }
+ function HTMLOptionElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLOptionElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLOptionElement.prototype, {
+ get text() {
+ return trimText(this.textContent);
+ },
+ set text(value) {
+ this.textContent = trimText(String(value));
+ },
+ get form() {
+ return wrap(unwrap(this).form);
+ }
+ });
+ registerWrapper(OriginalHTMLOptionElement, HTMLOptionElement, document.createElement("option"));
+ function Option(text, value, defaultSelected, selected) {
+ if (!(this instanceof Option)) {
+ throw new TypeError("DOM object constructor cannot be called as a function.");
+ }
+ var node = unwrap(document.createElement("option"));
+ HTMLElement.call(this, node);
+ rewrap(node, this);
+ if (text !== undefined) node.text = text;
+ if (value !== undefined) node.setAttribute("value", value);
+ if (defaultSelected === true) node.setAttribute("selected", "");
+ node.selected = selected === true;
+ }
+ Option.prototype = HTMLOptionElement.prototype;
+ scope.wrappers.HTMLOptionElement = HTMLOptionElement;
+ scope.wrappers.Option = Option;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLSelectElement = window.HTMLSelectElement;
+ function HTMLSelectElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLSelectElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLSelectElement.prototype, {
+ add: function(element, before) {
+ if (typeof before === "object") before = unwrap(before);
+ unwrap(this).add(unwrap(element), before);
+ },
+ remove: function(indexOrNode) {
+ if (indexOrNode === undefined) {
+ HTMLElement.prototype.remove.call(this);
+ return;
+ }
+ if (typeof indexOrNode === "object") indexOrNode = unwrap(indexOrNode);
+ unwrap(this).remove(indexOrNode);
+ },
+ get form() {
+ return wrap(unwrap(this).form);
+ }
+ });
+ registerWrapper(OriginalHTMLSelectElement, HTMLSelectElement, document.createElement("select"));
+ scope.wrappers.HTMLSelectElement = HTMLSelectElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var wrapHTMLCollection = scope.wrapHTMLCollection;
+ var OriginalHTMLTableElement = window.HTMLTableElement;
+ function HTMLTableElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLTableElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLTableElement.prototype, {
+ get caption() {
+ return wrap(unwrap(this).caption);
+ },
+ createCaption: function() {
+ return wrap(unwrap(this).createCaption());
+ },
+ get tHead() {
+ return wrap(unwrap(this).tHead);
+ },
+ createTHead: function() {
+ return wrap(unwrap(this).createTHead());
+ },
+ createTFoot: function() {
+ return wrap(unwrap(this).createTFoot());
+ },
+ get tFoot() {
+ return wrap(unwrap(this).tFoot);
+ },
+ get tBodies() {
+ return wrapHTMLCollection(unwrap(this).tBodies);
+ },
+ createTBody: function() {
+ return wrap(unwrap(this).createTBody());
+ },
+ get rows() {
+ return wrapHTMLCollection(unwrap(this).rows);
+ },
+ insertRow: function(index) {
+ return wrap(unwrap(this).insertRow(index));
+ }
+ });
+ registerWrapper(OriginalHTMLTableElement, HTMLTableElement, document.createElement("table"));
+ scope.wrappers.HTMLTableElement = HTMLTableElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var wrapHTMLCollection = scope.wrapHTMLCollection;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLTableSectionElement = window.HTMLTableSectionElement;
+ function HTMLTableSectionElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLTableSectionElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLTableSectionElement.prototype, {
+ constructor: HTMLTableSectionElement,
+ get rows() {
+ return wrapHTMLCollection(unwrap(this).rows);
+ },
+ insertRow: function(index) {
+ return wrap(unwrap(this).insertRow(index));
+ }
+ });
+ registerWrapper(OriginalHTMLTableSectionElement, HTMLTableSectionElement, document.createElement("thead"));
+ scope.wrappers.HTMLTableSectionElement = HTMLTableSectionElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var wrapHTMLCollection = scope.wrapHTMLCollection;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLTableRowElement = window.HTMLTableRowElement;
+ function HTMLTableRowElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLTableRowElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLTableRowElement.prototype, {
+ get cells() {
+ return wrapHTMLCollection(unwrap(this).cells);
+ },
+ insertCell: function(index) {
+ return wrap(unwrap(this).insertCell(index));
+ }
+ });
+ registerWrapper(OriginalHTMLTableRowElement, HTMLTableRowElement, document.createElement("tr"));
+ scope.wrappers.HTMLTableRowElement = HTMLTableRowElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLContentElement = scope.wrappers.HTMLContentElement;
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var HTMLShadowElement = scope.wrappers.HTMLShadowElement;
+ var HTMLTemplateElement = scope.wrappers.HTMLTemplateElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var OriginalHTMLUnknownElement = window.HTMLUnknownElement;
+ function HTMLUnknownElement(node) {
+ switch (node.localName) {
+ case "content":
+ return new HTMLContentElement(node);
+
+ case "shadow":
+ return new HTMLShadowElement(node);
+
+ case "template":
+ return new HTMLTemplateElement(node);
+ }
+ HTMLElement.call(this, node);
+ }
+ HTMLUnknownElement.prototype = Object.create(HTMLElement.prototype);
+ registerWrapper(OriginalHTMLUnknownElement, HTMLUnknownElement);
+ scope.wrappers.HTMLUnknownElement = HTMLUnknownElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var Element = scope.wrappers.Element;
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var registerObject = scope.registerObject;
+ var defineWrapGetter = scope.defineWrapGetter;
+ var SVG_NS = "http://www.w3.org/2000/svg";
+ var svgTitleElement = document.createElementNS(SVG_NS, "title");
+ var SVGTitleElement = registerObject(svgTitleElement);
+ var SVGElement = Object.getPrototypeOf(SVGTitleElement.prototype).constructor;
+ if (!("classList" in svgTitleElement)) {
+ var descr = Object.getOwnPropertyDescriptor(Element.prototype, "classList");
+ Object.defineProperty(HTMLElement.prototype, "classList", descr);
+ delete Element.prototype.classList;
+ }
+ defineWrapGetter(SVGElement, "ownerSVGElement");
+ scope.wrappers.SVGElement = SVGElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalSVGUseElement = window.SVGUseElement;
+ var SVG_NS = "http://www.w3.org/2000/svg";
+ var gWrapper = wrap(document.createElementNS(SVG_NS, "g"));
+ var useElement = document.createElementNS(SVG_NS, "use");
+ var SVGGElement = gWrapper.constructor;
+ var parentInterfacePrototype = Object.getPrototypeOf(SVGGElement.prototype);
+ var parentInterface = parentInterfacePrototype.constructor;
+ function SVGUseElement(impl) {
+ parentInterface.call(this, impl);
+ }
+ SVGUseElement.prototype = Object.create(parentInterfacePrototype);
+ if ("instanceRoot" in useElement) {
+ mixin(SVGUseElement.prototype, {
+ get instanceRoot() {
+ return wrap(unwrap(this).instanceRoot);
+ },
+ get animatedInstanceRoot() {
+ return wrap(unwrap(this).animatedInstanceRoot);
+ }
+ });
+ }
+ registerWrapper(OriginalSVGUseElement, SVGUseElement, useElement);
+ scope.wrappers.SVGUseElement = SVGUseElement;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var EventTarget = scope.wrappers.EventTarget;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var OriginalSVGElementInstance = window.SVGElementInstance;
+ if (!OriginalSVGElementInstance) return;
+ function SVGElementInstance(impl) {
+ EventTarget.call(this, impl);
+ }
+ SVGElementInstance.prototype = Object.create(EventTarget.prototype);
+ mixin(SVGElementInstance.prototype, {
+ get correspondingElement() {
+ return wrap(unsafeUnwrap(this).correspondingElement);
+ },
+ get correspondingUseElement() {
+ return wrap(unsafeUnwrap(this).correspondingUseElement);
+ },
+ get parentNode() {
+ return wrap(unsafeUnwrap(this).parentNode);
+ },
+ get childNodes() {
+ throw new Error("Not implemented");
+ },
+ get firstChild() {
+ return wrap(unsafeUnwrap(this).firstChild);
+ },
+ get lastChild() {
+ return wrap(unsafeUnwrap(this).lastChild);
+ },
+ get previousSibling() {
+ return wrap(unsafeUnwrap(this).previousSibling);
+ },
+ get nextSibling() {
+ return wrap(unsafeUnwrap(this).nextSibling);
+ }
+ });
+ registerWrapper(OriginalSVGElementInstance, SVGElementInstance);
+ scope.wrappers.SVGElementInstance = SVGElementInstance;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalCanvasRenderingContext2D = window.CanvasRenderingContext2D;
+ function CanvasRenderingContext2D(impl) {
+ setWrapper(impl, this);
+ }
+ mixin(CanvasRenderingContext2D.prototype, {
+ get canvas() {
+ return wrap(unsafeUnwrap(this).canvas);
+ },
+ drawImage: function() {
+ arguments[0] = unwrapIfNeeded(arguments[0]);
+ unsafeUnwrap(this).drawImage.apply(unsafeUnwrap(this), arguments);
+ },
+ createPattern: function() {
+ arguments[0] = unwrap(arguments[0]);
+ return unsafeUnwrap(this).createPattern.apply(unsafeUnwrap(this), arguments);
+ }
+ });
+ registerWrapper(OriginalCanvasRenderingContext2D, CanvasRenderingContext2D, document.createElement("canvas").getContext("2d"));
+ scope.wrappers.CanvasRenderingContext2D = CanvasRenderingContext2D;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalWebGLRenderingContext = window.WebGLRenderingContext;
+ if (!OriginalWebGLRenderingContext) return;
+ function WebGLRenderingContext(impl) {
+ setWrapper(impl, this);
+ }
+ mixin(WebGLRenderingContext.prototype, {
+ get canvas() {
+ return wrap(unsafeUnwrap(this).canvas);
+ },
+ texImage2D: function() {
+ arguments[5] = unwrapIfNeeded(arguments[5]);
+ unsafeUnwrap(this).texImage2D.apply(unsafeUnwrap(this), arguments);
+ },
+ texSubImage2D: function() {
+ arguments[6] = unwrapIfNeeded(arguments[6]);
+ unsafeUnwrap(this).texSubImage2D.apply(unsafeUnwrap(this), arguments);
+ }
+ });
+ var instanceProperties = /WebKit/.test(navigator.userAgent) ? {
+ drawingBufferHeight: null,
+ drawingBufferWidth: null
+ } : {};
+ registerWrapper(OriginalWebGLRenderingContext, WebGLRenderingContext, instanceProperties);
+ scope.wrappers.WebGLRenderingContext = WebGLRenderingContext;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var GetElementsByInterface = scope.GetElementsByInterface;
+ var NonElementParentNodeInterface = scope.NonElementParentNodeInterface;
+ var ParentNodeInterface = scope.ParentNodeInterface;
+ var SelectorsInterface = scope.SelectorsInterface;
+ var mixin = scope.mixin;
+ var registerObject = scope.registerObject;
+ var DocumentFragment = registerObject(document.createDocumentFragment());
+ mixin(DocumentFragment.prototype, ParentNodeInterface);
+ mixin(DocumentFragment.prototype, SelectorsInterface);
+ mixin(DocumentFragment.prototype, GetElementsByInterface);
+ mixin(DocumentFragment.prototype, NonElementParentNodeInterface);
+ var Comment = registerObject(document.createComment(""));
+ scope.wrappers.Comment = Comment;
+ scope.wrappers.DocumentFragment = DocumentFragment;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var DocumentFragment = scope.wrappers.DocumentFragment;
+ var TreeScope = scope.TreeScope;
+ var elementFromPoint = scope.elementFromPoint;
+ var getInnerHTML = scope.getInnerHTML;
+ var getTreeScope = scope.getTreeScope;
+ var mixin = scope.mixin;
+ var rewrap = scope.rewrap;
+ var setInnerHTML = scope.setInnerHTML;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var shadowHostTable = new WeakMap();
+ var nextOlderShadowTreeTable = new WeakMap();
+ function ShadowRoot(hostWrapper) {
+ var node = unwrap(unsafeUnwrap(hostWrapper).ownerDocument.createDocumentFragment());
+ DocumentFragment.call(this, node);
+ rewrap(node, this);
+ var oldShadowRoot = hostWrapper.shadowRoot;
+ nextOlderShadowTreeTable.set(this, oldShadowRoot);
+ this.treeScope_ = new TreeScope(this, getTreeScope(oldShadowRoot || hostWrapper));
+ shadowHostTable.set(this, hostWrapper);
+ }
+ ShadowRoot.prototype = Object.create(DocumentFragment.prototype);
+ mixin(ShadowRoot.prototype, {
+ constructor: ShadowRoot,
+ get innerHTML() {
+ return getInnerHTML(this);
+ },
+ set innerHTML(value) {
+ setInnerHTML(this, value);
+ this.invalidateShadowRenderer();
+ },
+ get olderShadowRoot() {
+ return nextOlderShadowTreeTable.get(this) || null;
+ },
+ get host() {
+ return shadowHostTable.get(this) || null;
+ },
+ invalidateShadowRenderer: function() {
+ return shadowHostTable.get(this).invalidateShadowRenderer();
+ },
+ elementFromPoint: function(x, y) {
+ return elementFromPoint(this, this.ownerDocument, x, y);
+ }
+ });
+ scope.wrappers.ShadowRoot = ShadowRoot;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var getTreeScope = scope.getTreeScope;
+ var OriginalRange = window.Range;
+ var ShadowRoot = scope.wrappers.ShadowRoot;
+ function getHost(node) {
+ var root = getTreeScope(node).root;
+ if (root instanceof ShadowRoot) {
+ return root.host;
+ }
+ return null;
+ }
+ function hostNodeToShadowNode(refNode, offset) {
+ if (refNode.shadowRoot) {
+ offset = Math.min(refNode.childNodes.length - 1, offset);
+ var child = refNode.childNodes[offset];
+ if (child) {
+ var insertionPoint = scope.getDestinationInsertionPoints(child);
+ if (insertionPoint.length > 0) {
+ var parentNode = insertionPoint[0].parentNode;
+ if (parentNode.nodeType == Node.ELEMENT_NODE) {
+ refNode = parentNode;
+ }
+ }
+ }
+ }
+ return refNode;
+ }
+ function shadowNodeToHostNode(node) {
+ node = wrap(node);
+ return getHost(node) || node;
+ }
+ function Range(impl) {
+ setWrapper(impl, this);
+ }
+ Range.prototype = {
+ get startContainer() {
+ return shadowNodeToHostNode(unsafeUnwrap(this).startContainer);
+ },
+ get endContainer() {
+ return shadowNodeToHostNode(unsafeUnwrap(this).endContainer);
+ },
+ get commonAncestorContainer() {
+ return shadowNodeToHostNode(unsafeUnwrap(this).commonAncestorContainer);
+ },
+ setStart: function(refNode, offset) {
+ refNode = hostNodeToShadowNode(refNode, offset);
+ unsafeUnwrap(this).setStart(unwrapIfNeeded(refNode), offset);
+ },
+ setEnd: function(refNode, offset) {
+ refNode = hostNodeToShadowNode(refNode, offset);
+ unsafeUnwrap(this).setEnd(unwrapIfNeeded(refNode), offset);
+ },
+ setStartBefore: function(refNode) {
+ unsafeUnwrap(this).setStartBefore(unwrapIfNeeded(refNode));
+ },
+ setStartAfter: function(refNode) {
+ unsafeUnwrap(this).setStartAfter(unwrapIfNeeded(refNode));
+ },
+ setEndBefore: function(refNode) {
+ unsafeUnwrap(this).setEndBefore(unwrapIfNeeded(refNode));
+ },
+ setEndAfter: function(refNode) {
+ unsafeUnwrap(this).setEndAfter(unwrapIfNeeded(refNode));
+ },
+ selectNode: function(refNode) {
+ unsafeUnwrap(this).selectNode(unwrapIfNeeded(refNode));
+ },
+ selectNodeContents: function(refNode) {
+ unsafeUnwrap(this).selectNodeContents(unwrapIfNeeded(refNode));
+ },
+ compareBoundaryPoints: function(how, sourceRange) {
+ return unsafeUnwrap(this).compareBoundaryPoints(how, unwrap(sourceRange));
+ },
+ extractContents: function() {
+ return wrap(unsafeUnwrap(this).extractContents());
+ },
+ cloneContents: function() {
+ return wrap(unsafeUnwrap(this).cloneContents());
+ },
+ insertNode: function(node) {
+ unsafeUnwrap(this).insertNode(unwrapIfNeeded(node));
+ },
+ surroundContents: function(newParent) {
+ unsafeUnwrap(this).surroundContents(unwrapIfNeeded(newParent));
+ },
+ cloneRange: function() {
+ return wrap(unsafeUnwrap(this).cloneRange());
+ },
+ isPointInRange: function(node, offset) {
+ return unsafeUnwrap(this).isPointInRange(unwrapIfNeeded(node), offset);
+ },
+ comparePoint: function(node, offset) {
+ return unsafeUnwrap(this).comparePoint(unwrapIfNeeded(node), offset);
+ },
+ intersectsNode: function(node) {
+ return unsafeUnwrap(this).intersectsNode(unwrapIfNeeded(node));
+ },
+ toString: function() {
+ return unsafeUnwrap(this).toString();
+ }
+ };
+ if (OriginalRange.prototype.createContextualFragment) {
+ Range.prototype.createContextualFragment = function(html) {
+ return wrap(unsafeUnwrap(this).createContextualFragment(html));
+ };
+ }
+ registerWrapper(window.Range, Range, document.createRange());
+ scope.wrappers.Range = Range;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var Element = scope.wrappers.Element;
+ var HTMLContentElement = scope.wrappers.HTMLContentElement;
+ var HTMLShadowElement = scope.wrappers.HTMLShadowElement;
+ var Node = scope.wrappers.Node;
+ var ShadowRoot = scope.wrappers.ShadowRoot;
+ var assert = scope.assert;
+ var getTreeScope = scope.getTreeScope;
+ var mixin = scope.mixin;
+ var oneOf = scope.oneOf;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var ArraySplice = scope.ArraySplice;
+ function updateWrapperUpAndSideways(wrapper) {
+ wrapper.previousSibling_ = wrapper.previousSibling;
+ wrapper.nextSibling_ = wrapper.nextSibling;
+ wrapper.parentNode_ = wrapper.parentNode;
+ }
+ function updateWrapperDown(wrapper) {
+ wrapper.firstChild_ = wrapper.firstChild;
+ wrapper.lastChild_ = wrapper.lastChild;
+ }
+ function updateAllChildNodes(parentNodeWrapper) {
+ assert(parentNodeWrapper instanceof Node);
+ for (var childWrapper = parentNodeWrapper.firstChild; childWrapper; childWrapper = childWrapper.nextSibling) {
+ updateWrapperUpAndSideways(childWrapper);
+ }
+ updateWrapperDown(parentNodeWrapper);
+ }
+ function insertBefore(parentNodeWrapper, newChildWrapper, refChildWrapper) {
+ var parentNode = unwrap(parentNodeWrapper);
+ var newChild = unwrap(newChildWrapper);
+ var refChild = refChildWrapper ? unwrap(refChildWrapper) : null;
+ remove(newChildWrapper);
+ updateWrapperUpAndSideways(newChildWrapper);
+ if (!refChildWrapper) {
+ parentNodeWrapper.lastChild_ = parentNodeWrapper.lastChild;
+ if (parentNodeWrapper.lastChild === parentNodeWrapper.firstChild) parentNodeWrapper.firstChild_ = parentNodeWrapper.firstChild;
+ var lastChildWrapper = wrap(parentNode.lastChild);
+ if (lastChildWrapper) lastChildWrapper.nextSibling_ = lastChildWrapper.nextSibling;
+ } else {
+ if (parentNodeWrapper.firstChild === refChildWrapper) parentNodeWrapper.firstChild_ = refChildWrapper;
+ refChildWrapper.previousSibling_ = refChildWrapper.previousSibling;
+ }
+ scope.originalInsertBefore.call(parentNode, newChild, refChild);
+ }
+ function remove(nodeWrapper) {
+ var node = unwrap(nodeWrapper);
+ var parentNode = node.parentNode;
+ if (!parentNode) return;
+ var parentNodeWrapper = wrap(parentNode);
+ updateWrapperUpAndSideways(nodeWrapper);
+ if (nodeWrapper.previousSibling) nodeWrapper.previousSibling.nextSibling_ = nodeWrapper;
+ if (nodeWrapper.nextSibling) nodeWrapper.nextSibling.previousSibling_ = nodeWrapper;
+ if (parentNodeWrapper.lastChild === nodeWrapper) parentNodeWrapper.lastChild_ = nodeWrapper;
+ if (parentNodeWrapper.firstChild === nodeWrapper) parentNodeWrapper.firstChild_ = nodeWrapper;
+ scope.originalRemoveChild.call(parentNode, node);
+ }
+ var distributedNodesTable = new WeakMap();
+ var destinationInsertionPointsTable = new WeakMap();
+ var rendererForHostTable = new WeakMap();
+ function resetDistributedNodes(insertionPoint) {
+ distributedNodesTable.set(insertionPoint, []);
+ }
+ function getDistributedNodes(insertionPoint) {
+ var rv = distributedNodesTable.get(insertionPoint);
+ if (!rv) distributedNodesTable.set(insertionPoint, rv = []);
+ return rv;
+ }
+ function getChildNodesSnapshot(node) {
+ var result = [], i = 0;
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ result[i++] = child;
+ }
+ return result;
+ }
+ var request = oneOf(window, [ "requestAnimationFrame", "mozRequestAnimationFrame", "webkitRequestAnimationFrame", "setTimeout" ]);
+ var pendingDirtyRenderers = [];
+ var renderTimer;
+ function renderAllPending() {
+ for (var i = 0; i < pendingDirtyRenderers.length; i++) {
+ var renderer = pendingDirtyRenderers[i];
+ var parentRenderer = renderer.parentRenderer;
+ if (parentRenderer && parentRenderer.dirty) continue;
+ renderer.render();
+ }
+ pendingDirtyRenderers = [];
+ }
+ function handleRequestAnimationFrame() {
+ renderTimer = null;
+ renderAllPending();
+ }
+ function getRendererForHost(host) {
+ var renderer = rendererForHostTable.get(host);
+ if (!renderer) {
+ renderer = new ShadowRenderer(host);
+ rendererForHostTable.set(host, renderer);
+ }
+ return renderer;
+ }
+ function getShadowRootAncestor(node) {
+ var root = getTreeScope(node).root;
+ if (root instanceof ShadowRoot) return root;
+ return null;
+ }
+ function getRendererForShadowRoot(shadowRoot) {
+ return getRendererForHost(shadowRoot.host);
+ }
+ var spliceDiff = new ArraySplice();
+ spliceDiff.equals = function(renderNode, rawNode) {
+ return unwrap(renderNode.node) === rawNode;
+ };
+ function RenderNode(node) {
+ this.skip = false;
+ this.node = node;
+ this.childNodes = [];
+ }
+ RenderNode.prototype = {
+ append: function(node) {
+ var rv = new RenderNode(node);
+ this.childNodes.push(rv);
+ return rv;
+ },
+ sync: function(opt_added) {
+ if (this.skip) return;
+ var nodeWrapper = this.node;
+ var newChildren = this.childNodes;
+ var oldChildren = getChildNodesSnapshot(unwrap(nodeWrapper));
+ var added = opt_added || new WeakMap();
+ var splices = spliceDiff.calculateSplices(newChildren, oldChildren);
+ var newIndex = 0, oldIndex = 0;
+ var lastIndex = 0;
+ for (var i = 0; i < splices.length; i++) {
+ var splice = splices[i];
+ for (;lastIndex < splice.index; lastIndex++) {
+ oldIndex++;
+ newChildren[newIndex++].sync(added);
+ }
+ var removedCount = splice.removed.length;
+ for (var j = 0; j < removedCount; j++) {
+ var wrapper = wrap(oldChildren[oldIndex++]);
+ if (!added.get(wrapper)) remove(wrapper);
+ }
+ var addedCount = splice.addedCount;
+ var refNode = oldChildren[oldIndex] && wrap(oldChildren[oldIndex]);
+ for (var j = 0; j < addedCount; j++) {
+ var newChildRenderNode = newChildren[newIndex++];
+ var newChildWrapper = newChildRenderNode.node;
+ insertBefore(nodeWrapper, newChildWrapper, refNode);
+ added.set(newChildWrapper, true);
+ newChildRenderNode.sync(added);
+ }
+ lastIndex += addedCount;
+ }
+ for (var i = lastIndex; i < newChildren.length; i++) {
+ newChildren[i].sync(added);
+ }
+ }
+ };
+ function ShadowRenderer(host) {
+ this.host = host;
+ this.dirty = false;
+ this.invalidateAttributes();
+ this.associateNode(host);
+ }
+ ShadowRenderer.prototype = {
+ render: function(opt_renderNode) {
+ if (!this.dirty) return;
+ this.invalidateAttributes();
+ var host = this.host;
+ this.distribution(host);
+ var renderNode = opt_renderNode || new RenderNode(host);
+ this.buildRenderTree(renderNode, host);
+ var topMostRenderer = !opt_renderNode;
+ if (topMostRenderer) renderNode.sync();
+ this.dirty = false;
+ },
+ get parentRenderer() {
+ return getTreeScope(this.host).renderer;
+ },
+ invalidate: function() {
+ if (!this.dirty) {
+ this.dirty = true;
+ var parentRenderer = this.parentRenderer;
+ if (parentRenderer) parentRenderer.invalidate();
+ pendingDirtyRenderers.push(this);
+ if (renderTimer) return;
+ renderTimer = window[request](handleRequestAnimationFrame, 0);
+ }
+ },
+ distribution: function(root) {
+ this.resetAllSubtrees(root);
+ this.distributionResolution(root);
+ },
+ resetAll: function(node) {
+ if (isInsertionPoint(node)) resetDistributedNodes(node); else resetDestinationInsertionPoints(node);
+ this.resetAllSubtrees(node);
+ },
+ resetAllSubtrees: function(node) {
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ this.resetAll(child);
+ }
+ if (node.shadowRoot) this.resetAll(node.shadowRoot);
+ if (node.olderShadowRoot) this.resetAll(node.olderShadowRoot);
+ },
+ distributionResolution: function(node) {
+ if (isShadowHost(node)) {
+ var shadowHost = node;
+ var pool = poolPopulation(shadowHost);
+ var shadowTrees = getShadowTrees(shadowHost);
+ for (var i = 0; i < shadowTrees.length; i++) {
+ this.poolDistribution(shadowTrees[i], pool);
+ }
+ for (var i = shadowTrees.length - 1; i >= 0; i--) {
+ var shadowTree = shadowTrees[i];
+ var shadow = getShadowInsertionPoint(shadowTree);
+ if (shadow) {
+ var olderShadowRoot = shadowTree.olderShadowRoot;
+ if (olderShadowRoot) {
+ pool = poolPopulation(olderShadowRoot);
+ }
+ for (var j = 0; j < pool.length; j++) {
+ destributeNodeInto(pool[j], shadow);
+ }
+ }
+ this.distributionResolution(shadowTree);
+ }
+ }
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ this.distributionResolution(child);
+ }
+ },
+ poolDistribution: function(node, pool) {
+ if (node instanceof HTMLShadowElement) return;
+ if (node instanceof HTMLContentElement) {
+ var content = node;
+ this.updateDependentAttributes(content.getAttribute("select"));
+ var anyDistributed = false;
+ for (var i = 0; i < pool.length; i++) {
+ var node = pool[i];
+ if (!node) continue;
+ if (matches(node, content)) {
+ destributeNodeInto(node, content);
+ pool[i] = undefined;
+ anyDistributed = true;
+ }
+ }
+ if (!anyDistributed) {
+ for (var child = content.firstChild; child; child = child.nextSibling) {
+ destributeNodeInto(child, content);
+ }
+ }
+ return;
+ }
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ this.poolDistribution(child, pool);
+ }
+ },
+ buildRenderTree: function(renderNode, node) {
+ var children = this.compose(node);
+ for (var i = 0; i < children.length; i++) {
+ var child = children[i];
+ var childRenderNode = renderNode.append(child);
+ this.buildRenderTree(childRenderNode, child);
+ }
+ if (isShadowHost(node)) {
+ var renderer = getRendererForHost(node);
+ renderer.dirty = false;
+ }
+ },
+ compose: function(node) {
+ var children = [];
+ var p = node.shadowRoot || node;
+ for (var child = p.firstChild; child; child = child.nextSibling) {
+ if (isInsertionPoint(child)) {
+ this.associateNode(p);
+ var distributedNodes = getDistributedNodes(child);
+ for (var j = 0; j < distributedNodes.length; j++) {
+ var distributedNode = distributedNodes[j];
+ if (isFinalDestination(child, distributedNode)) children.push(distributedNode);
+ }
+ } else {
+ children.push(child);
+ }
+ }
+ return children;
+ },
+ invalidateAttributes: function() {
+ this.attributes = Object.create(null);
+ },
+ updateDependentAttributes: function(selector) {
+ if (!selector) return;
+ var attributes = this.attributes;
+ if (/\.\w+/.test(selector)) attributes["class"] = true;
+ if (/#\w+/.test(selector)) attributes["id"] = true;
+ selector.replace(/\[\s*([^\s=\|~\]]+)/g, function(_, name) {
+ attributes[name] = true;
+ });
+ },
+ dependsOnAttribute: function(name) {
+ return this.attributes[name];
+ },
+ associateNode: function(node) {
+ unsafeUnwrap(node).polymerShadowRenderer_ = this;
+ }
+ };
+ function poolPopulation(node) {
+ var pool = [];
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ if (isInsertionPoint(child)) {
+ pool.push.apply(pool, getDistributedNodes(child));
+ } else {
+ pool.push(child);
+ }
+ }
+ return pool;
+ }
+ function getShadowInsertionPoint(node) {
+ if (node instanceof HTMLShadowElement) return node;
+ if (node instanceof HTMLContentElement) return null;
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ var res = getShadowInsertionPoint(child);
+ if (res) return res;
+ }
+ return null;
+ }
+ function destributeNodeInto(child, insertionPoint) {
+ getDistributedNodes(insertionPoint).push(child);
+ var points = destinationInsertionPointsTable.get(child);
+ if (!points) destinationInsertionPointsTable.set(child, [ insertionPoint ]); else points.push(insertionPoint);
+ }
+ function getDestinationInsertionPoints(node) {
+ return destinationInsertionPointsTable.get(node);
+ }
+ function resetDestinationInsertionPoints(node) {
+ destinationInsertionPointsTable.set(node, undefined);
+ }
+ var selectorStartCharRe = /^(:not\()?[*.#[a-zA-Z_|]/;
+ function matches(node, contentElement) {
+ var select = contentElement.getAttribute("select");
+ if (!select) return true;
+ select = select.trim();
+ if (!select) return true;
+ if (!(node instanceof Element)) return false;
+ if (!selectorStartCharRe.test(select)) return false;
+ try {
+ return node.matches(select);
+ } catch (ex) {
+ return false;
+ }
+ }
+ function isFinalDestination(insertionPoint, node) {
+ var points = getDestinationInsertionPoints(node);
+ return points && points[points.length - 1] === insertionPoint;
+ }
+ function isInsertionPoint(node) {
+ return node instanceof HTMLContentElement || node instanceof HTMLShadowElement;
+ }
+ function isShadowHost(shadowHost) {
+ return shadowHost.shadowRoot;
+ }
+ function getShadowTrees(host) {
+ var trees = [];
+ for (var tree = host.shadowRoot; tree; tree = tree.olderShadowRoot) {
+ trees.push(tree);
+ }
+ return trees;
+ }
+ function render(host) {
+ new ShadowRenderer(host).render();
+ }
+ Node.prototype.invalidateShadowRenderer = function(force) {
+ var renderer = unsafeUnwrap(this).polymerShadowRenderer_;
+ if (renderer) {
+ renderer.invalidate();
+ return true;
+ }
+ return false;
+ };
+ HTMLContentElement.prototype.getDistributedNodes = HTMLShadowElement.prototype.getDistributedNodes = function() {
+ renderAllPending();
+ return getDistributedNodes(this);
+ };
+ Element.prototype.getDestinationInsertionPoints = function() {
+ renderAllPending();
+ return getDestinationInsertionPoints(this) || [];
+ };
+ HTMLContentElement.prototype.nodeIsInserted_ = HTMLShadowElement.prototype.nodeIsInserted_ = function() {
+ this.invalidateShadowRenderer();
+ var shadowRoot = getShadowRootAncestor(this);
+ var renderer;
+ if (shadowRoot) renderer = getRendererForShadowRoot(shadowRoot);
+ unsafeUnwrap(this).polymerShadowRenderer_ = renderer;
+ if (renderer) renderer.invalidate();
+ };
+ scope.getRendererForHost = getRendererForHost;
+ scope.getShadowTrees = getShadowTrees;
+ scope.renderAllPending = renderAllPending;
+ scope.getDestinationInsertionPoints = getDestinationInsertionPoints;
+ scope.visual = {
+ insertBefore: insertBefore,
+ remove: remove
+ };
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var assert = scope.assert;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var elementsWithFormProperty = [ "HTMLButtonElement", "HTMLFieldSetElement", "HTMLInputElement", "HTMLKeygenElement", "HTMLLabelElement", "HTMLLegendElement", "HTMLObjectElement", "HTMLOutputElement", "HTMLTextAreaElement" ];
+ function createWrapperConstructor(name) {
+ if (!window[name]) return;
+ assert(!scope.wrappers[name]);
+ var GeneratedWrapper = function(node) {
+ HTMLElement.call(this, node);
+ };
+ GeneratedWrapper.prototype = Object.create(HTMLElement.prototype);
+ mixin(GeneratedWrapper.prototype, {
+ get form() {
+ return wrap(unwrap(this).form);
+ }
+ });
+ registerWrapper(window[name], GeneratedWrapper, document.createElement(name.slice(4, -7)));
+ scope.wrappers[name] = GeneratedWrapper;
+ }
+ elementsWithFormProperty.forEach(createWrapperConstructor);
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalSelection = window.Selection;
+ function Selection(impl) {
+ setWrapper(impl, this);
+ }
+ Selection.prototype = {
+ get anchorNode() {
+ return wrap(unsafeUnwrap(this).anchorNode);
+ },
+ get focusNode() {
+ return wrap(unsafeUnwrap(this).focusNode);
+ },
+ addRange: function(range) {
+ unsafeUnwrap(this).addRange(unwrapIfNeeded(range));
+ },
+ collapse: function(node, index) {
+ unsafeUnwrap(this).collapse(unwrapIfNeeded(node), index);
+ },
+ containsNode: function(node, allowPartial) {
+ return unsafeUnwrap(this).containsNode(unwrapIfNeeded(node), allowPartial);
+ },
+ getRangeAt: function(index) {
+ return wrap(unsafeUnwrap(this).getRangeAt(index));
+ },
+ removeRange: function(range) {
+ unsafeUnwrap(this).removeRange(unwrap(range));
+ },
+ selectAllChildren: function(node) {
+ unsafeUnwrap(this).selectAllChildren(unwrapIfNeeded(node));
+ },
+ toString: function() {
+ return unsafeUnwrap(this).toString();
+ }
+ };
+ if (OriginalSelection.prototype.extend) {
+ Selection.prototype.extend = function(node, offset) {
+ unsafeUnwrap(this).extend(unwrapIfNeeded(node), offset);
+ };
+ }
+ registerWrapper(window.Selection, Selection, window.getSelection());
+ scope.wrappers.Selection = Selection;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalTreeWalker = window.TreeWalker;
+ function TreeWalker(impl) {
+ setWrapper(impl, this);
+ }
+ TreeWalker.prototype = {
+ get root() {
+ return wrap(unsafeUnwrap(this).root);
+ },
+ get currentNode() {
+ return wrap(unsafeUnwrap(this).currentNode);
+ },
+ set currentNode(node) {
+ unsafeUnwrap(this).currentNode = unwrapIfNeeded(node);
+ },
+ get filter() {
+ return unsafeUnwrap(this).filter;
+ },
+ parentNode: function() {
+ return wrap(unsafeUnwrap(this).parentNode());
+ },
+ firstChild: function() {
+ return wrap(unsafeUnwrap(this).firstChild());
+ },
+ lastChild: function() {
+ return wrap(unsafeUnwrap(this).lastChild());
+ },
+ previousSibling: function() {
+ return wrap(unsafeUnwrap(this).previousSibling());
+ },
+ previousNode: function() {
+ return wrap(unsafeUnwrap(this).previousNode());
+ },
+ nextNode: function() {
+ return wrap(unsafeUnwrap(this).nextNode());
+ }
+ };
+ registerWrapper(OriginalTreeWalker, TreeWalker);
+ scope.wrappers.TreeWalker = TreeWalker;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var GetElementsByInterface = scope.GetElementsByInterface;
+ var Node = scope.wrappers.Node;
+ var ParentNodeInterface = scope.ParentNodeInterface;
+ var NonElementParentNodeInterface = scope.NonElementParentNodeInterface;
+ var Selection = scope.wrappers.Selection;
+ var SelectorsInterface = scope.SelectorsInterface;
+ var ShadowRoot = scope.wrappers.ShadowRoot;
+ var TreeScope = scope.TreeScope;
+ var cloneNode = scope.cloneNode;
+ var defineWrapGetter = scope.defineWrapGetter;
+ var elementFromPoint = scope.elementFromPoint;
+ var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;
+ var matchesNames = scope.matchesNames;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var renderAllPending = scope.renderAllPending;
+ var rewrap = scope.rewrap;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var wrapEventTargetMethods = scope.wrapEventTargetMethods;
+ var wrapNodeList = scope.wrapNodeList;
+ var implementationTable = new WeakMap();
+ function Document(node) {
+ Node.call(this, node);
+ this.treeScope_ = new TreeScope(this, null);
+ }
+ Document.prototype = Object.create(Node.prototype);
+ defineWrapGetter(Document, "documentElement");
+ defineWrapGetter(Document, "body");
+ defineWrapGetter(Document, "head");
+ function wrapMethod(name) {
+ var original = document[name];
+ Document.prototype[name] = function() {
+ return wrap(original.apply(unsafeUnwrap(this), arguments));
+ };
+ }
+ [ "createComment", "createDocumentFragment", "createElement", "createElementNS", "createEvent", "createEventNS", "createRange", "createTextNode" ].forEach(wrapMethod);
+ var originalAdoptNode = document.adoptNode;
+ function adoptNodeNoRemove(node, doc) {
+ originalAdoptNode.call(unsafeUnwrap(doc), unwrap(node));
+ adoptSubtree(node, doc);
+ }
+ function adoptSubtree(node, doc) {
+ if (node.shadowRoot) doc.adoptNode(node.shadowRoot);
+ if (node instanceof ShadowRoot) adoptOlderShadowRoots(node, doc);
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ adoptSubtree(child, doc);
+ }
+ }
+ function adoptOlderShadowRoots(shadowRoot, doc) {
+ var oldShadowRoot = shadowRoot.olderShadowRoot;
+ if (oldShadowRoot) doc.adoptNode(oldShadowRoot);
+ }
+ var originalGetSelection = document.getSelection;
+ mixin(Document.prototype, {
+ adoptNode: function(node) {
+ if (node.parentNode) node.parentNode.removeChild(node);
+ adoptNodeNoRemove(node, this);
+ return node;
+ },
+ elementFromPoint: function(x, y) {
+ return elementFromPoint(this, this, x, y);
+ },
+ importNode: function(node, deep) {
+ return cloneNode(node, deep, unsafeUnwrap(this));
+ },
+ getSelection: function() {
+ renderAllPending();
+ return new Selection(originalGetSelection.call(unwrap(this)));
+ },
+ getElementsByName: function(name) {
+ return SelectorsInterface.querySelectorAll.call(this, "[name=" + JSON.stringify(String(name)) + "]");
+ }
+ });
+ var originalCreateTreeWalker = document.createTreeWalker;
+ var TreeWalkerWrapper = scope.wrappers.TreeWalker;
+ Document.prototype.createTreeWalker = function(root, whatToShow, filter, expandEntityReferences) {
+ var newFilter = null;
+ if (filter) {
+ if (filter.acceptNode && typeof filter.acceptNode === "function") {
+ newFilter = {
+ acceptNode: function(node) {
+ return filter.acceptNode(wrap(node));
+ }
+ };
+ } else if (typeof filter === "function") {
+ newFilter = function(node) {
+ return filter(wrap(node));
+ };
+ }
+ }
+ return new TreeWalkerWrapper(originalCreateTreeWalker.call(unwrap(this), unwrap(root), whatToShow, newFilter, expandEntityReferences));
+ };
+ if (document.registerElement) {
+ var originalRegisterElement = document.registerElement;
+ Document.prototype.registerElement = function(tagName, object) {
+ var prototype, extendsOption;
+ if (object !== undefined) {
+ prototype = object.prototype;
+ extendsOption = object.extends;
+ }
+ if (!prototype) prototype = Object.create(HTMLElement.prototype);
+ if (scope.nativePrototypeTable.get(prototype)) {
+ throw new Error("NotSupportedError");
+ }
+ var proto = Object.getPrototypeOf(prototype);
+ var nativePrototype;
+ var prototypes = [];
+ while (proto) {
+ nativePrototype = scope.nativePrototypeTable.get(proto);
+ if (nativePrototype) break;
+ prototypes.push(proto);
+ proto = Object.getPrototypeOf(proto);
+ }
+ if (!nativePrototype) {
+ throw new Error("NotSupportedError");
+ }
+ var newPrototype = Object.create(nativePrototype);
+ for (var i = prototypes.length - 1; i >= 0; i--) {
+ newPrototype = Object.create(newPrototype);
+ }
+ [ "createdCallback", "attachedCallback", "detachedCallback", "attributeChangedCallback" ].forEach(function(name) {
+ var f = prototype[name];
+ if (!f) return;
+ newPrototype[name] = function() {
+ if (!(wrap(this) instanceof CustomElementConstructor)) {
+ rewrap(this);
+ }
+ f.apply(wrap(this), arguments);
+ };
+ });
+ var p = {
+ prototype: newPrototype
+ };
+ if (extendsOption) p.extends = extendsOption;
+ function CustomElementConstructor(node) {
+ if (!node) {
+ if (extendsOption) {
+ return document.createElement(extendsOption, tagName);
+ } else {
+ return document.createElement(tagName);
+ }
+ }
+ setWrapper(node, this);
+ }
+ CustomElementConstructor.prototype = prototype;
+ CustomElementConstructor.prototype.constructor = CustomElementConstructor;
+ scope.constructorTable.set(newPrototype, CustomElementConstructor);
+ scope.nativePrototypeTable.set(prototype, newPrototype);
+ var nativeConstructor = originalRegisterElement.call(unwrap(this), tagName, p);
+ return CustomElementConstructor;
+ };
+ forwardMethodsToWrapper([ window.HTMLDocument || window.Document ], [ "registerElement" ]);
+ }
+ forwardMethodsToWrapper([ window.HTMLBodyElement, window.HTMLDocument || window.Document, window.HTMLHeadElement, window.HTMLHtmlElement ], [ "appendChild", "compareDocumentPosition", "contains", "getElementsByClassName", "getElementsByTagName", "getElementsByTagNameNS", "insertBefore", "querySelector", "querySelectorAll", "removeChild", "replaceChild" ]);
+ forwardMethodsToWrapper([ window.HTMLBodyElement, window.HTMLHeadElement, window.HTMLHtmlElement ], matchesNames);
+ forwardMethodsToWrapper([ window.HTMLDocument || window.Document ], [ "adoptNode", "importNode", "contains", "createComment", "createDocumentFragment", "createElement", "createElementNS", "createEvent", "createEventNS", "createRange", "createTextNode", "createTreeWalker", "elementFromPoint", "getElementById", "getElementsByName", "getSelection" ]);
+ mixin(Document.prototype, GetElementsByInterface);
+ mixin(Document.prototype, ParentNodeInterface);
+ mixin(Document.prototype, SelectorsInterface);
+ mixin(Document.prototype, NonElementParentNodeInterface);
+ mixin(Document.prototype, {
+ get implementation() {
+ var implementation = implementationTable.get(this);
+ if (implementation) return implementation;
+ implementation = new DOMImplementation(unwrap(this).implementation);
+ implementationTable.set(this, implementation);
+ return implementation;
+ },
+ get defaultView() {
+ return wrap(unwrap(this).defaultView);
+ }
+ });
+ registerWrapper(window.Document, Document, document.implementation.createHTMLDocument(""));
+ if (window.HTMLDocument) registerWrapper(window.HTMLDocument, Document);
+ wrapEventTargetMethods([ window.HTMLBodyElement, window.HTMLDocument || window.Document, window.HTMLHeadElement ]);
+ function DOMImplementation(impl) {
+ setWrapper(impl, this);
+ }
+ var originalCreateDocument = document.implementation.createDocument;
+ DOMImplementation.prototype.createDocument = function() {
+ arguments[2] = unwrap(arguments[2]);
+ return wrap(originalCreateDocument.apply(unsafeUnwrap(this), arguments));
+ };
+ function wrapImplMethod(constructor, name) {
+ var original = document.implementation[name];
+ constructor.prototype[name] = function() {
+ return wrap(original.apply(unsafeUnwrap(this), arguments));
+ };
+ }
+ function forwardImplMethod(constructor, name) {
+ var original = document.implementation[name];
+ constructor.prototype[name] = function() {
+ return original.apply(unsafeUnwrap(this), arguments);
+ };
+ }
+ wrapImplMethod(DOMImplementation, "createDocumentType");
+ wrapImplMethod(DOMImplementation, "createHTMLDocument");
+ forwardImplMethod(DOMImplementation, "hasFeature");
+ registerWrapper(window.DOMImplementation, DOMImplementation);
+ forwardMethodsToWrapper([ window.DOMImplementation ], [ "createDocument", "createDocumentType", "createHTMLDocument", "hasFeature" ]);
+ scope.adoptNodeNoRemove = adoptNodeNoRemove;
+ scope.wrappers.DOMImplementation = DOMImplementation;
+ scope.wrappers.Document = Document;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var EventTarget = scope.wrappers.EventTarget;
+ var Selection = scope.wrappers.Selection;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var renderAllPending = scope.renderAllPending;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalWindow = window.Window;
+ var originalGetComputedStyle = window.getComputedStyle;
+ var originalGetDefaultComputedStyle = window.getDefaultComputedStyle;
+ var originalGetSelection = window.getSelection;
+ function Window(impl) {
+ EventTarget.call(this, impl);
+ }
+ Window.prototype = Object.create(EventTarget.prototype);
+ OriginalWindow.prototype.getComputedStyle = function(el, pseudo) {
+ return wrap(this || window).getComputedStyle(unwrapIfNeeded(el), pseudo);
+ };
+ if (originalGetDefaultComputedStyle) {
+ OriginalWindow.prototype.getDefaultComputedStyle = function(el, pseudo) {
+ return wrap(this || window).getDefaultComputedStyle(unwrapIfNeeded(el), pseudo);
+ };
+ }
+ OriginalWindow.prototype.getSelection = function() {
+ return wrap(this || window).getSelection();
+ };
+ delete window.getComputedStyle;
+ delete window.getDefaultComputedStyle;
+ delete window.getSelection;
+ [ "addEventListener", "removeEventListener", "dispatchEvent" ].forEach(function(name) {
+ OriginalWindow.prototype[name] = function() {
+ var w = wrap(this || window);
+ return w[name].apply(w, arguments);
+ };
+ delete window[name];
+ });
+ mixin(Window.prototype, {
+ getComputedStyle: function(el, pseudo) {
+ renderAllPending();
+ return originalGetComputedStyle.call(unwrap(this), unwrapIfNeeded(el), pseudo);
+ },
+ getSelection: function() {
+ renderAllPending();
+ return new Selection(originalGetSelection.call(unwrap(this)));
+ },
+ get document() {
+ return wrap(unwrap(this).document);
+ }
+ });
+ if (originalGetDefaultComputedStyle) {
+ Window.prototype.getDefaultComputedStyle = function(el, pseudo) {
+ renderAllPending();
+ return originalGetDefaultComputedStyle.call(unwrap(this), unwrapIfNeeded(el), pseudo);
+ };
+ }
+ registerWrapper(OriginalWindow, Window, window);
+ scope.wrappers.Window = Window;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var unwrap = scope.unwrap;
+ var OriginalDataTransfer = window.DataTransfer || window.Clipboard;
+ var OriginalDataTransferSetDragImage = OriginalDataTransfer.prototype.setDragImage;
+ if (OriginalDataTransferSetDragImage) {
+ OriginalDataTransfer.prototype.setDragImage = function(image, x, y) {
+ OriginalDataTransferSetDragImage.call(this, unwrap(image), x, y);
+ };
+ }
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unwrap = scope.unwrap;
+ var OriginalFormData = window.FormData;
+ if (!OriginalFormData) return;
+ function FormData(formElement) {
+ var impl;
+ if (formElement instanceof OriginalFormData) {
+ impl = formElement;
+ } else {
+ impl = new OriginalFormData(formElement && unwrap(formElement));
+ }
+ setWrapper(impl, this);
+ }
+ registerWrapper(OriginalFormData, FormData, new OriginalFormData());
+ scope.wrappers.FormData = FormData;
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var originalSend = XMLHttpRequest.prototype.send;
+ XMLHttpRequest.prototype.send = function(obj) {
+ return originalSend.call(this, unwrapIfNeeded(obj));
+ };
+})(window.ShadowDOMPolyfill);
+
+(function(scope) {
+ "use strict";
+ var isWrapperFor = scope.isWrapperFor;
+ var elements = {
+ a: "HTMLAnchorElement",
+ area: "HTMLAreaElement",
+ audio: "HTMLAudioElement",
+ base: "HTMLBaseElement",
+ body: "HTMLBodyElement",
+ br: "HTMLBRElement",
+ button: "HTMLButtonElement",
+ canvas: "HTMLCanvasElement",
+ caption: "HTMLTableCaptionElement",
+ col: "HTMLTableColElement",
+ content: "HTMLContentElement",
+ data: "HTMLDataElement",
+ datalist: "HTMLDataListElement",
+ del: "HTMLModElement",
+ dir: "HTMLDirectoryElement",
+ div: "HTMLDivElement",
+ dl: "HTMLDListElement",
+ embed: "HTMLEmbedElement",
+ fieldset: "HTMLFieldSetElement",
+ font: "HTMLFontElement",
+ form: "HTMLFormElement",
+ frame: "HTMLFrameElement",
+ frameset: "HTMLFrameSetElement",
+ h1: "HTMLHeadingElement",
+ head: "HTMLHeadElement",
+ hr: "HTMLHRElement",
+ html: "HTMLHtmlElement",
+ iframe: "HTMLIFrameElement",
+ img: "HTMLImageElement",
+ input: "HTMLInputElement",
+ keygen: "HTMLKeygenElement",
+ label: "HTMLLabelElement",
+ legend: "HTMLLegendElement",
+ li: "HTMLLIElement",
+ link: "HTMLLinkElement",
+ map: "HTMLMapElement",
+ marquee: "HTMLMarqueeElement",
+ menu: "HTMLMenuElement",
+ menuitem: "HTMLMenuItemElement",
+ meta: "HTMLMetaElement",
+ meter: "HTMLMeterElement",
+ object: "HTMLObjectElement",
+ ol: "HTMLOListElement",
+ optgroup: "HTMLOptGroupElement",
+ option: "HTMLOptionElement",
+ output: "HTMLOutputElement",
+ p: "HTMLParagraphElement",
+ param: "HTMLParamElement",
+ pre: "HTMLPreElement",
+ progress: "HTMLProgressElement",
+ q: "HTMLQuoteElement",
+ script: "HTMLScriptElement",
+ select: "HTMLSelectElement",
+ shadow: "HTMLShadowElement",
+ source: "HTMLSourceElement",
+ span: "HTMLSpanElement",
+ style: "HTMLStyleElement",
+ table: "HTMLTableElement",
+ tbody: "HTMLTableSectionElement",
+ template: "HTMLTemplateElement",
+ textarea: "HTMLTextAreaElement",
+ thead: "HTMLTableSectionElement",
+ time: "HTMLTimeElement",
+ title: "HTMLTitleElement",
+ tr: "HTMLTableRowElement",
+ track: "HTMLTrackElement",
+ ul: "HTMLUListElement",
+ video: "HTMLVideoElement"
+ };
+ function overrideConstructor(tagName) {
+ var nativeConstructorName = elements[tagName];
+ var nativeConstructor = window[nativeConstructorName];
+ if (!nativeConstructor) return;
+ var element = document.createElement(tagName);
+ var wrapperConstructor = element.constructor;
+ window[nativeConstructorName] = wrapperConstructor;
+ }
+ Object.keys(elements).forEach(overrideConstructor);
+ Object.getOwnPropertyNames(scope.wrappers).forEach(function(name) {
+ window[name] = scope.wrappers[name];
+ });
+})(window.ShadowDOMPolyfill);
\ No newline at end of file
diff --git a/dashboard-ui/thirdparty/webcomponentsjs/ShadowDOM.min.js b/dashboard-ui/bower_components/webcomponentsjs/ShadowDOM.min.js
similarity index 99%
rename from dashboard-ui/thirdparty/webcomponentsjs/ShadowDOM.min.js
rename to dashboard-ui/bower_components/webcomponentsjs/ShadowDOM.min.js
index 1d8e1b8ba6..1380d543b6 100644
--- a/dashboard-ui/thirdparty/webcomponentsjs/ShadowDOM.min.js
+++ b/dashboard-ui/bower_components/webcomponentsjs/ShadowDOM.min.js
@@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
-// @version 0.7.3
+// @version 0.7.5
"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],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,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),window.ShadowDOMPolyfill={},function(e){"use strict";function t(){if("undefined"!=typeof chrome&&chrome.app&&chrome.app.runtime)return!1;if(navigator.getDeviceStorage)return!1;try{var e=new Function("return true;");return e()}catch(t){return!1}}function n(e){if(!e)throw new Error("Assertion failed")}function r(e,t){for(var n=k(t),r=0;ru;u++)c[u]=new Array(s),c[u][0]=u;for(var l=0;s>l;l++)c[0][l]=l;for(var u=1;a>u;u++)for(var l=1;s>l;l++)if(this.equals(e[t+l-1],r[o+u-1]))c[u][l]=c[u-1][l-1];else{var p=c[u-1][l]+1,d=c[u][l-1]+1;c[u][l]=d>p?p:d}return c},spliceOperationsFromEditDistances:function(e){for(var t=e.length-1,n=e[0].length-1,s=e[t][n],c=[];t>0||n>0;)if(0!=t)if(0!=n){var u,l=e[t-1][n-1],p=e[t-1][n],d=e[t][n-1];u=d>p?l>p?p:l:l>d?d:l,u==l?(l==s?c.push(r):(c.push(o),s=l),t--,n--):u==p?(c.push(a),t--,s=p):(c.push(i),n--,s=d)}else c.push(a),t--;else c.push(i),n--;return c.reverse(),c},calcSplices:function(e,n,s,c,u,l){var p=0,d=0,f=Math.min(s-n,l-u);if(0==n&&0==u&&(p=this.sharedPrefix(e,c,f)),s==e.length&&l==c.length&&(d=this.sharedSuffix(e,c,f-p)),n+=p,u+=p,s-=d,l-=d,s-n==0&&l-u==0)return[];if(n==s){for(var h=t(n,[],0);l>u;)h.removed.push(c[u++]);return[h]}if(u==l)return[t(n,[],s-n)];for(var w=this.spliceOperationsFromEditDistances(this.calcEditDistances(e,n,s,c,u,l)),h=void 0,m=[],g=n,v=u,b=0;br;r++)if(!this.equals(e[r],t[r]))return r;return n},sharedSuffix:function(e,t,n){for(var r=e.length,o=t.length,i=0;n>i&&this.equals(e[--r],t[--o]);)i++;return i},calculateSplices:function(e,t){return this.calcSplices(e,0,e.length,t,0,t.length)},equals:function(e,t){return e===t}},e.ArraySplice=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(){a=!1;var e=i.slice(0);i=[];for(var t=0;t0){for(var l=0;l0&&r.length>0;){var i=n.pop(),a=r.pop();if(i!==a)break;o=i}return o}function l(e,t,n){t instanceof G.Window&&(t=t.document);var o,i=A(t),a=A(n),s=r(n,e),o=u(i,a);o||(o=a.root);for(var c=o;c;c=c.parent)for(var l=0;l0;i--)if(!v(t[i],e,o,t,r))return!1;return!0}function m(e,t,n,r){var o=ie,i=t[0]||n;return v(i,e,o,t,r)}function g(e,t,n,r){for(var o=ae,i=1;i0&&v(n,e,o,t,r)}function v(e,t,n,r,o){var i=z.get(e);if(!i)return!0;var a=o||s(r,e);if(a===e){if(n===oe)return!0;n===ae&&(n=ie)}else if(n===ae&&!t.bubbles)return!0;if("relatedTarget"in t){var c=q(t),u=c.relatedTarget;if(u){if(u instanceof Object&&u.addEventListener){var p=V(u),d=l(t,e,p);if(d===a)return!0}else d=null;Z.set(t,d)}}J.set(t,n);var f=t.type,h=!1;Y.set(t,a),$.set(t,e),i.depth++;for(var w=0,m=i.length;m>w;w++){var g=i[w];if(g.removed)h=!0;else if(!(g.type!==f||!g.capture&&n===oe||g.capture&&n===ae))try{if("function"==typeof g.handler?g.handler.call(e,t):g.handler.handleEvent(t),ee.get(t))return!1}catch(v){W||(W=v)}}if(i.depth--,h&&0===i.depth){var b=i.slice();i.length=0;for(var w=0;wr;r++)t[r]=a(e[r]);return t.length=o,t}function o(e,t){e.prototype[t]=function(){return r(i(this)[t].apply(i(this),arguments))}}var i=e.unsafeUnwrap,a=e.wrap,s={enumerable:!1};n.prototype={item:function(e){return this[e]}},t(n.prototype,"item"),e.wrappers.NodeList=n,e.addWrapNodeListMethod=o,e.wrapNodeList=r}(window.ShadowDOMPolyfill),function(e){"use strict";e.wrapHTMLCollection=e.wrapNodeList,e.wrappers.HTMLCollection=e.wrappers.NodeList}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){N(e instanceof S)}function n(e){var t=new T;return t[0]=e,t.length=1,t}function r(e,t,n){L(t,"childList",{removedNodes:n,previousSibling:e.previousSibling,nextSibling:e.nextSibling})}function o(e,t){L(e,"childList",{removedNodes:t})}function i(e,t,r,o){if(e instanceof DocumentFragment){var i=s(e);B=!0;for(var a=i.length-1;a>=0;a--)e.removeChild(i[a]),i[a].parentNode_=t;B=!1;for(var a=0;ao;o++)r.appendChild(W(t[o]));return r}function m(e){if(void 0!==e.firstChild_)for(var t=e.firstChild_;t;){var n=t;t=t.nextSibling_,n.parentNode_=n.previousSibling_=n.nextSibling_=void 0}e.firstChild_=e.lastChild_=void 0}function g(e){if(e.invalidateShadowRenderer()){for(var t=e.firstChild;t;){N(t.parentNode===e);var n=t.nextSibling,r=W(t),o=r.parentNode;o&&Y.call(o,r),t.previousSibling_=t.nextSibling_=t.parentNode_=null,t=n}e.firstChild_=e.lastChild_=null}else for(var n,i=W(e),a=i.firstChild;a;)n=a.nextSibling,Y.call(i,a),a=n}function v(e){var t=e.parentNode;return t&&t.invalidateShadowRenderer()}function b(e){for(var t,n=0;ns;s++)i=b(t[s]),!o&&(a=g(i).root)&&a instanceof e.wrappers.ShadowRoot||(r[n++]=i);return n}function n(e){return String(e).replace(/\/deep\/|::shadow|>>>/g," ")}function r(e){return String(e).replace(/:host\(([^\s]+)\)/g,"$1").replace(/([^\s]):host/g,"$1").replace(":host","*").replace(/\^|\/shadow\/|\/shadow-deep\/|::shadow|\/deep\/|::content|>>>/g," ")}function o(e,t){for(var n,r=e.firstElementChild;r;){if(r.matches(t))return r;if(n=o(r,t))return n;r=r.nextElementSibling}return null}function i(e,t){return e.matches(t)}function a(e,t,n){var r=e.localName;return r===t||r===n&&e.namespaceURI===C}function s(){return!0}function c(e,t,n){return e.localName===n}function u(e,t){return e.namespaceURI===t}function l(e,t,n){return e.namespaceURI===t&&e.localName===n}function p(e,t,n,r,o,i){for(var a=e.firstElementChild;a;)r(a,o,i)&&(n[t++]=a),t=p(a,t,n,r,o,i),a=a.nextElementSibling;return t}function d(n,r,o,i,a){var s,c=v(this),u=g(this).root;if(u instanceof e.wrappers.ShadowRoot)return p(this,r,o,n,i,null);if(c instanceof L)s=M.call(c,i);else{if(!(c instanceof _))return p(this,r,o,n,i,null);s=S.call(c,i)}return t(s,r,o,a)}function f(n,r,o,i,a){var s,c=v(this),u=g(this).root;if(u instanceof e.wrappers.ShadowRoot)return p(this,r,o,n,i,a);if(c instanceof L)s=O.call(c,i,a);else{if(!(c instanceof _))return p(this,r,o,n,i,a);s=T.call(c,i,a)}return t(s,r,o,!1)}function h(n,r,o,i,a){var s,c=v(this),u=g(this).root;if(u instanceof e.wrappers.ShadowRoot)return p(this,r,o,n,i,a);if(c instanceof L)s=j.call(c,i,a);else{if(!(c instanceof _))return p(this,r,o,n,i,a);s=N.call(c,i,a)}return t(s,r,o,!1)}var w=e.wrappers.HTMLCollection,m=e.wrappers.NodeList,g=e.getTreeScope,v=e.unsafeUnwrap,b=e.wrap,y=document.querySelector,E=document.documentElement.querySelector,S=document.querySelectorAll,M=document.documentElement.querySelectorAll,T=document.getElementsByTagName,O=document.documentElement.getElementsByTagName,N=document.getElementsByTagNameNS,j=document.documentElement.getElementsByTagNameNS,L=window.Element,_=window.HTMLDocument||window.Document,C="http://www.w3.org/1999/xhtml",D={querySelector:function(t){var r=n(t),i=r!==t;t=r;var a,s=v(this),c=g(this).root;if(c instanceof e.wrappers.ShadowRoot)return o(this,t);if(s instanceof L)a=b(E.call(s,t));else{if(!(s instanceof _))return o(this,t);a=b(y.call(s,t))}return a&&!i&&(c=g(a).root)&&c instanceof e.wrappers.ShadowRoot?o(this,t):a},querySelectorAll:function(e){var t=n(e),r=t!==e;e=t;var o=new m;return o.length=d.call(this,i,0,o,e,r),o}},H={matches:function(t){return t=r(t),e.originalMatches.call(v(this),t)}},x={getElementsByTagName:function(e){var t=new w,n="*"===e?s:a;return t.length=f.call(this,n,0,t,e,e.toLowerCase()),t},getElementsByClassName:function(e){return this.querySelectorAll("."+e)},getElementsByTagNameNS:function(e,t){var n=new w,r=null;return r="*"===e?"*"===t?s:c:"*"===t?u:l,n.length=h.call(this,r,0,n,e||null,t),n}};e.GetElementsByInterface=x,e.SelectorsInterface=D,e.MatchesInterface=H}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.nextSibling;
return e}function n(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.previousSibling;return e}var r=e.wrappers.NodeList,o={get firstElementChild(){return t(this.firstChild)},get lastElementChild(){return n(this.lastChild)},get childElementCount(){for(var e=0,t=this.firstElementChild;t;t=t.nextElementSibling)e++;return e},get children(){for(var e=new r,t=0,n=this.firstElementChild;n;n=n.nextElementSibling)e[t++]=n;return e.length=t,e},remove:function(){var e=this.parentNode;e&&e.removeChild(this)}},i={get nextElementSibling(){return t(this.nextSibling)},get previousElementSibling(){return n(this.previousSibling)}},a={getElementById:function(e){return/[ \t\n\r\f]/.test(e)?null:this.querySelector('[id="'+e+'"]')}};e.ChildNodeInterface=i,e.NonElementParentNodeInterface=a,e.ParentNodeInterface=o}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}var n=e.ChildNodeInterface,r=e.wrappers.Node,o=e.enqueueMutation,i=e.mixin,a=e.registerWrapper,s=e.unsafeUnwrap,c=window.CharacterData;t.prototype=Object.create(r.prototype),i(t.prototype,{get nodeValue(){return this.data},set nodeValue(e){this.data=e},get textContent(){return this.data},set textContent(e){this.data=e},get data(){return s(this).data},set data(e){var t=s(this).data;o(this,"characterData",{oldValue:t}),s(this).data=e}}),i(t.prototype,n),a(c,t,document.createTextNode("")),e.wrappers.CharacterData=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e>>>0}function n(e){r.call(this,e)}var r=e.wrappers.CharacterData,o=(e.enqueueMutation,e.mixin),i=e.registerWrapper,a=window.Text;n.prototype=Object.create(r.prototype),o(n.prototype,{splitText:function(e){e=t(e);var n=this.data;if(e>n.length)throw new Error("IndexSizeError");var r=n.slice(0,e),o=n.slice(e);this.data=r;var i=this.ownerDocument.createTextNode(o);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}}),i(a,n,document.createTextNode("")),e.wrappers.Text=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return i(e).getAttribute("class")}function n(e,t){a(e,"attributes",{name:"class",namespace:null,oldValue:t})}function r(t){e.invalidateRendererBasedOnAttribute(t,"class")}function o(e,o,i){var a=e.ownerElement_;if(null==a)return o.apply(e,i);var s=t(a),c=o.apply(e,i);return t(a)!==s&&(n(a,s),r(a)),c}if(!window.DOMTokenList)return void console.warn("Missing DOMTokenList prototype, please include a compatible classList polyfill such as http://goo.gl/uTcepH.");var i=e.unsafeUnwrap,a=e.enqueueMutation,s=DOMTokenList.prototype.add;DOMTokenList.prototype.add=function(){o(this,s,arguments)};var c=DOMTokenList.prototype.remove;DOMTokenList.prototype.remove=function(){o(this,c,arguments)};var u=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(){return o(this,u,arguments)}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(t,n){var r=t.parentNode;if(r&&r.shadowRoot){var o=e.getRendererForHost(r);o.dependsOnAttribute(n)&&o.invalidate()}}function n(e,t,n){l(e,"attributes",{name:t,namespace:null,oldValue:n})}function r(e){a.call(this,e)}var o=e.ChildNodeInterface,i=e.GetElementsByInterface,a=e.wrappers.Node,s=e.ParentNodeInterface,c=e.SelectorsInterface,u=e.MatchesInterface,l=(e.addWrapNodeListMethod,e.enqueueMutation),p=e.mixin,d=(e.oneOf,e.registerWrapper),f=e.unsafeUnwrap,h=e.wrappers,w=window.Element,m=["matches","mozMatchesSelector","msMatchesSelector","webkitMatchesSelector"].filter(function(e){return w.prototype[e]}),g=m[0],v=w.prototype[g],b=new WeakMap;r.prototype=Object.create(a.prototype),p(r.prototype,{createShadowRoot:function(){var t=new h.ShadowRoot(this);f(this).polymerShadowRoot_=t;var n=e.getRendererForHost(this);return n.invalidate(),t},get shadowRoot(){return f(this).polymerShadowRoot_||null},setAttribute:function(e,r){var o=f(this).getAttribute(e);f(this).setAttribute(e,r),n(this,e,o),t(this,e)},removeAttribute:function(e){var r=f(this).getAttribute(e);f(this).removeAttribute(e),n(this,e,r),t(this,e)},get classList(){var e=b.get(this);if(!e){if(e=f(this).classList,!e)return;e.ownerElement_=this,b.set(this,e)}return e},get className(){return f(this).className},set className(e){this.setAttribute("class",e)},get id(){return f(this).id},set id(e){this.setAttribute("id",e)}}),m.forEach(function(e){"matches"!==e&&(r.prototype[e]=function(e){return this.matches(e)})}),w.prototype.webkitCreateShadowRoot&&(r.prototype.webkitCreateShadowRoot=r.prototype.createShadowRoot),p(r.prototype,o),p(r.prototype,i),p(r.prototype,s),p(r.prototype,c),p(r.prototype,u),d(w,r,document.createElementNS(null,"x")),e.invalidateRendererBasedOnAttribute=t,e.matchesNames=m,e.originalMatches=v,e.wrappers.Element=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case" ":return" "}}function n(e){return e.replace(j,t)}function r(e){return e.replace(L,t)}function o(e){for(var t={},n=0;n"):c+">"+s(e)+""+a+">";case Node.TEXT_NODE:var p=e.data;return t&&C[t.localName]?p:r(p);case Node.COMMENT_NODE:return"";default:throw console.error(e),new Error("not implemented")}}function s(e){e instanceof N.HTMLTemplateElement&&(e=e.content);for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=a(n,e);return t}function c(e,t,n){var r=n||"div";e.textContent="";var o=T(e.ownerDocument.createElement(r));o.innerHTML=t;for(var i;i=o.firstChild;)e.appendChild(O(i))}function u(e){w.call(this,e)}function l(e,t){var n=T(e.cloneNode(!1));n.innerHTML=t;for(var r,o=T(document.createDocumentFragment());r=n.firstChild;)o.appendChild(r);return O(o)}function p(t){return function(){return e.renderAllPending(),M(this)[t]}}function d(e){m(u,e,p(e))}function f(t){Object.defineProperty(u.prototype,t,{get:p(t),set:function(n){e.renderAllPending(),M(this)[t]=n},configurable:!0,enumerable:!0})}function h(t){Object.defineProperty(u.prototype,t,{value:function(){return e.renderAllPending(),M(this)[t].apply(M(this),arguments)},configurable:!0,enumerable:!0})}var w=e.wrappers.Element,m=e.defineGetter,g=e.enqueueMutation,v=e.mixin,b=e.nodesWereAdded,y=e.nodesWereRemoved,E=e.registerWrapper,S=e.snapshotNodeList,M=e.unsafeUnwrap,T=e.unwrap,O=e.wrap,N=e.wrappers,j=/[&\u00A0"]/g,L=/[&\u00A0<>]/g,_=o(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),C=o(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]),D="http://www.w3.org/1999/xhtml",H=/MSIE/.test(navigator.userAgent),x=window.HTMLElement,R=window.HTMLTemplateElement;u.prototype=Object.create(w.prototype),v(u.prototype,{get innerHTML(){return s(this)},set innerHTML(e){if(H&&C[this.localName])return void(this.textContent=e);var t=S(this.childNodes);this.invalidateShadowRenderer()?this instanceof N.HTMLTemplateElement?c(this.content,e):c(this,e,this.tagName):!R&&this instanceof N.HTMLTemplateElement?c(this.content,e):M(this).innerHTML=e;var n=S(this.childNodes);g(this,"childList",{addedNodes:n,removedNodes:t}),y(t),b(n,this)},get outerHTML(){return a(this,this.parentNode)},set outerHTML(e){var t=this.parentNode;if(t){t.invalidateShadowRenderer();var n=l(t,e);t.replaceChild(n,this)}},insertAdjacentHTML:function(e,t){var n,r;switch(String(e).toLowerCase()){case"beforebegin":n=this.parentNode,r=this;break;case"afterend":n=this.parentNode,r=this.nextSibling;break;case"afterbegin":n=this,r=this.firstChild;break;case"beforeend":n=this,r=null;break;default:return}var o=l(n,t);n.insertBefore(o,r)},get hidden(){return this.hasAttribute("hidden")},set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollWidth"].forEach(d),["scrollLeft","scrollTop"].forEach(f),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(h),E(x,u,document.createElement("b")),e.wrappers.HTMLElement=u,e.getInnerHTML=s,e.setInnerHTML=c}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unsafeUnwrap,a=e.wrap,s=window.HTMLCanvasElement;t.prototype=Object.create(n.prototype),r(t.prototype,{getContext:function(){var e=i(this).getContext.apply(i(this),arguments);return e&&a(e)}}),o(s,t,document.createElement("canvas")),e.wrappers.HTMLCanvasElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=window.HTMLContentElement;t.prototype=Object.create(n.prototype),r(t.prototype,{constructor:t,get select(){return this.getAttribute("select")},set select(e){this.setAttribute("select",e)},setAttribute:function(e,t){n.prototype.setAttribute.call(this,e,t),"select"===String(e).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),i&&o(i,t),e.wrappers.HTMLContentElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=window.HTMLFormElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get elements(){return i(a(this).elements)}}),o(s,t,document.createElement("form")),e.wrappers.HTMLFormElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}function n(e,t){if(!(this instanceof n))throw new TypeError("DOM object constructor cannot be called as a function.");var o=i(document.createElement("img"));r.call(this,o),a(o,this),void 0!==e&&(o.width=e),void 0!==t&&(o.height=t)}var r=e.wrappers.HTMLElement,o=e.registerWrapper,i=e.unwrap,a=e.rewrap,s=window.HTMLImageElement;t.prototype=Object.create(r.prototype),o(s,t,document.createElement("img")),n.prototype=t.prototype,e.wrappers.HTMLImageElement=t,e.wrappers.Image=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=(e.mixin,e.wrappers.NodeList,e.registerWrapper),o=window.HTMLShadowElement;t.prototype=Object.create(n.prototype),t.prototype.constructor=t,o&&r(o,t),e.wrappers.HTMLShadowElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){if(!e.defaultView)return e;var t=p.get(e);if(!t){for(t=e.implementation.createHTMLDocument("");t.lastChild;)t.removeChild(t.lastChild);p.set(e,t)}return t}function n(e){for(var n,r=t(e.ownerDocument),o=c(r.createDocumentFragment());n=e.firstChild;)o.appendChild(n);return o}function r(e){if(o.call(this,e),!d){var t=n(e);l.set(this,u(t))}}var o=e.wrappers.HTMLElement,i=e.mixin,a=e.registerWrapper,s=e.unsafeUnwrap,c=e.unwrap,u=e.wrap,l=new WeakMap,p=new WeakMap,d=window.HTMLTemplateElement;r.prototype=Object.create(o.prototype),i(r.prototype,{constructor:r,get content(){return d?u(s(this).content):l.get(this)}}),d&&a(d,r),e.wrappers.HTMLTemplateElement=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.registerWrapper,o=window.HTMLMediaElement;o&&(t.prototype=Object.create(n.prototype),r(o,t,document.createElement("audio")),e.wrappers.HTMLMediaElement=t)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}function n(e){if(!(this instanceof n))throw new TypeError("DOM object constructor cannot be called as a function.");var t=i(document.createElement("audio"));r.call(this,t),a(t,this),t.setAttribute("preload","auto"),void 0!==e&&t.setAttribute("src",e)}var r=e.wrappers.HTMLMediaElement,o=e.registerWrapper,i=e.unwrap,a=e.rewrap,s=window.HTMLAudioElement;s&&(t.prototype=Object.create(r.prototype),o(s,t,document.createElement("audio")),n.prototype=t.prototype,e.wrappers.HTMLAudioElement=t,e.wrappers.Audio=n)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e.replace(/\s+/g," ").trim()}function n(e){o.call(this,e)}function r(e,t,n,i){if(!(this instanceof r))throw new TypeError("DOM object constructor cannot be called as a function.");var a=c(document.createElement("option"));o.call(this,a),s(a,this),void 0!==e&&(a.text=e),void 0!==t&&a.setAttribute("value",t),n===!0&&a.setAttribute("selected",""),a.selected=i===!0}var o=e.wrappers.HTMLElement,i=e.mixin,a=e.registerWrapper,s=e.rewrap,c=e.unwrap,u=e.wrap,l=window.HTMLOptionElement;n.prototype=Object.create(o.prototype),i(n.prototype,{get text(){return t(this.textContent)},set text(e){this.textContent=t(String(e))},get form(){return u(c(this).form)}}),a(l,n,document.createElement("option")),r.prototype=n.prototype,e.wrappers.HTMLOptionElement=n,e.wrappers.Option=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unwrap,a=e.wrap,s=window.HTMLSelectElement;t.prototype=Object.create(n.prototype),r(t.prototype,{add:function(e,t){"object"==typeof t&&(t=i(t)),i(this).add(i(e),t)},remove:function(e){return void 0===e?void n.prototype.remove.call(this):("object"==typeof e&&(e=i(e)),void i(this).remove(e))},get form(){return a(i(this).form)}}),o(s,t,document.createElement("select")),e.wrappers.HTMLSelectElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unwrap,a=e.wrap,s=e.wrapHTMLCollection,c=window.HTMLTableElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get caption(){return a(i(this).caption)},createCaption:function(){return a(i(this).createCaption())},get tHead(){return a(i(this).tHead)},createTHead:function(){return a(i(this).createTHead())},createTFoot:function(){return a(i(this).createTFoot())},get tFoot(){return a(i(this).tFoot)},get tBodies(){return s(i(this).tBodies)},createTBody:function(){return a(i(this).createTBody())},get rows(){return s(i(this).rows)},insertRow:function(e){return a(i(this).insertRow(e))}}),o(c,t,document.createElement("table")),e.wrappers.HTMLTableElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=e.wrap,c=window.HTMLTableSectionElement;t.prototype=Object.create(n.prototype),r(t.prototype,{constructor:t,get rows(){return i(a(this).rows)},insertRow:function(e){return s(a(this).insertRow(e))}}),o(c,t,document.createElement("thead")),e.wrappers.HTMLTableSectionElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=e.wrap,c=window.HTMLTableRowElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get cells(){return i(a(this).cells)},insertCell:function(e){return s(a(this).insertCell(e))}}),o(c,t,document.createElement("tr")),e.wrappers.HTMLTableRowElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e.localName){case"content":return new n(e);case"shadow":return new o(e);case"template":return new i(e)}r.call(this,e)}var n=e.wrappers.HTMLContentElement,r=e.wrappers.HTMLElement,o=e.wrappers.HTMLShadowElement,i=e.wrappers.HTMLTemplateElement,a=(e.mixin,e.registerWrapper),s=window.HTMLUnknownElement;t.prototype=Object.create(r.prototype),a(s,t),e.wrappers.HTMLUnknownElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.wrappers.Element,n=e.wrappers.HTMLElement,r=e.registerObject,o=e.defineWrapGetter,i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"title"),s=r(a),c=Object.getPrototypeOf(s.prototype).constructor;if(!("classList"in a)){var u=Object.getOwnPropertyDescriptor(t.prototype,"classList");Object.defineProperty(n.prototype,"classList",u),delete t.prototype.classList}o(c,"ownerSVGElement"),e.wrappers.SVGElement=c}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){d.call(this,e)}var n=e.mixin,r=e.registerWrapper,o=e.unwrap,i=e.wrap,a=window.SVGUseElement,s="http://www.w3.org/2000/svg",c=i(document.createElementNS(s,"g")),u=document.createElementNS(s,"use"),l=c.constructor,p=Object.getPrototypeOf(l.prototype),d=p.constructor;t.prototype=Object.create(p),"instanceRoot"in u&&n(t.prototype,{get instanceRoot(){return i(o(this).instanceRoot)},get animatedInstanceRoot(){return i(o(this).animatedInstanceRoot)}}),r(a,t,u),e.wrappers.SVGUseElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.EventTarget,r=e.mixin,o=e.registerWrapper,i=e.unsafeUnwrap,a=e.wrap,s=window.SVGElementInstance;s&&(t.prototype=Object.create(n.prototype),r(t.prototype,{get correspondingElement(){return a(i(this).correspondingElement)},get correspondingUseElement(){return a(i(this).correspondingUseElement)},get parentNode(){return a(i(this).parentNode)},get childNodes(){throw new Error("Not implemented")},get firstChild(){return a(i(this).firstChild)},get lastChild(){return a(i(this).lastChild)},get previousSibling(){return a(i(this).previousSibling)},get nextSibling(){return a(i(this).nextSibling)}}),o(s,t),e.wrappers.SVGElementInstance=t)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){o(e,this)}var n=e.mixin,r=e.registerWrapper,o=e.setWrapper,i=e.unsafeUnwrap,a=e.unwrap,s=e.unwrapIfNeeded,c=e.wrap,u=window.CanvasRenderingContext2D;n(t.prototype,{get canvas(){return c(i(this).canvas)},drawImage:function(){arguments[0]=s(arguments[0]),i(this).drawImage.apply(i(this),arguments)},createPattern:function(){return arguments[0]=a(arguments[0]),i(this).createPattern.apply(i(this),arguments)}}),r(u,t,document.createElement("canvas").getContext("2d")),e.wrappers.CanvasRenderingContext2D=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){o(e,this)}var n=e.mixin,r=e.registerWrapper,o=e.setWrapper,i=e.unsafeUnwrap,a=e.unwrapIfNeeded,s=e.wrap,c=window.WebGLRenderingContext;if(c){n(t.prototype,{get canvas(){return s(i(this).canvas)},texImage2D:function(){arguments[5]=a(arguments[5]),i(this).texImage2D.apply(i(this),arguments)},texSubImage2D:function(){arguments[6]=a(arguments[6]),i(this).texSubImage2D.apply(i(this),arguments)}});var u=/WebKit/.test(navigator.userAgent)?{drawingBufferHeight:null,drawingBufferWidth:null}:{};r(c,t,u),e.wrappers.WebGLRenderingContext=t}}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.GetElementsByInterface,n=e.NonElementParentNodeInterface,r=e.ParentNodeInterface,o=e.SelectorsInterface,i=e.mixin,a=e.registerObject,s=a(document.createDocumentFragment());i(s.prototype,r),i(s.prototype,o),i(s.prototype,t),i(s.prototype,n);var c=a(document.createComment(""));e.wrappers.Comment=c,e.wrappers.DocumentFragment=s}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=p(l(e).ownerDocument.createDocumentFragment());n.call(this,t),c(t,this);var o=e.shadowRoot;f.set(this,o),this.treeScope_=new r(this,a(o||e)),d.set(this,e)}var n=e.wrappers.DocumentFragment,r=e.TreeScope,o=e.elementFromPoint,i=e.getInnerHTML,a=e.getTreeScope,s=e.mixin,c=e.rewrap,u=e.setInnerHTML,l=e.unsafeUnwrap,p=e.unwrap,d=new WeakMap,f=new WeakMap;t.prototype=Object.create(n.prototype),s(t.prototype,{constructor:t,get innerHTML(){return i(this)},set innerHTML(e){u(this,e),this.invalidateShadowRenderer()},get olderShadowRoot(){return f.get(this)||null},get host(){return d.get(this)||null},invalidateShadowRenderer:function(){return d.get(this).invalidateShadowRenderer()},elementFromPoint:function(e,t){return o(this,this.ownerDocument,e,t)}}),e.wrappers.ShadowRoot=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=p(e).root;return t instanceof f?t.host:null}function n(t,n){if(t.shadowRoot){n=Math.min(t.childNodes.length-1,n);var r=t.childNodes[n];if(r){var o=e.getDestinationInsertionPoints(r);if(o.length>0){var i=o[0].parentNode;i.nodeType==Node.ELEMENT_NODE&&(t=i)}}}return t}function r(e){return e=l(e),t(e)||e}function o(e){a(e,this)}var i=e.registerWrapper,a=e.setWrapper,s=e.unsafeUnwrap,c=e.unwrap,u=e.unwrapIfNeeded,l=e.wrap,p=e.getTreeScope,d=window.Range,f=e.wrappers.ShadowRoot;o.prototype={get startContainer(){return r(s(this).startContainer)},get endContainer(){return r(s(this).endContainer)},get commonAncestorContainer(){return r(s(this).commonAncestorContainer)},setStart:function(e,t){e=n(e,t),s(this).setStart(u(e),t)},setEnd:function(e,t){e=n(e,t),s(this).setEnd(u(e),t)},setStartBefore:function(e){s(this).setStartBefore(u(e))},setStartAfter:function(e){s(this).setStartAfter(u(e))},setEndBefore:function(e){s(this).setEndBefore(u(e))},setEndAfter:function(e){s(this).setEndAfter(u(e))},selectNode:function(e){s(this).selectNode(u(e))},selectNodeContents:function(e){s(this).selectNodeContents(u(e))},compareBoundaryPoints:function(e,t){return s(this).compareBoundaryPoints(e,c(t))},extractContents:function(){return l(s(this).extractContents())},cloneContents:function(){return l(s(this).cloneContents())},insertNode:function(e){s(this).insertNode(u(e))},surroundContents:function(e){s(this).surroundContents(u(e))},cloneRange:function(){return l(s(this).cloneRange())},isPointInRange:function(e,t){return s(this).isPointInRange(u(e),t)},comparePoint:function(e,t){return s(this).comparePoint(u(e),t)},intersectsNode:function(e){return s(this).intersectsNode(u(e))},toString:function(){return s(this).toString()}},d.prototype.createContextualFragment&&(o.prototype.createContextualFragment=function(e){return l(s(this).createContextualFragment(e))}),i(window.Range,o,document.createRange()),e.wrappers.Range=o}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){e.previousSibling_=e.previousSibling,e.nextSibling_=e.nextSibling,e.parentNode_=e.parentNode}function n(n,o,i){var a=x(n),s=x(o),c=i?x(i):null;if(r(o),t(o),i)n.firstChild===i&&(n.firstChild_=i),i.previousSibling_=i.previousSibling;else{n.lastChild_=n.lastChild,n.lastChild===n.firstChild&&(n.firstChild_=n.firstChild);var u=R(a.lastChild);u&&(u.nextSibling_=u.nextSibling)}e.originalInsertBefore.call(a,s,c)}function r(n){var r=x(n),o=r.parentNode;if(o){var i=R(o);t(n),n.previousSibling&&(n.previousSibling.nextSibling_=n),n.nextSibling&&(n.nextSibling.previousSibling_=n),i.lastChild===n&&(i.lastChild_=n),i.firstChild===n&&(i.firstChild_=n),e.originalRemoveChild.call(o,r)}}function o(e){W.set(e,[])}function i(e){var t=W.get(e);return t||W.set(e,t=[]),t}function a(e){for(var t=[],n=0,r=e.firstChild;r;r=r.nextSibling)t[n++]=r;return t}function s(){for(var e=0;ew;w++){var m=R(i[l++]);s.get(m)||r(m)}for(var g=f.addedCount,v=i[l]&&R(i[l]),w=0;g>w;w++){var b=o[u++],y=b.node;n(t,y,v),s.set(y,!0),b.sync(s)}p+=g}for(var d=p;d=0;o--){var i=r[o],a=w(i);if(a){var s=i.olderShadowRoot;s&&(n=h(s));for(var c=0;c 32 && unicode < 127 && [ 34, 35, 60, 62, 63, 96 ].indexOf(unicode) == -1) {
+ return c;
+ }
+ return encodeURIComponent(c);
+ }
+ function percentEscapeQuery(c) {
+ var unicode = c.charCodeAt(0);
+ if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 96 ].indexOf(unicode) == -1) {
+ return c;
+ }
+ return encodeURIComponent(c);
+ }
+ var EOF = undefined, ALPHA = /[a-zA-Z]/, ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/;
+ function parse(input, stateOverride, base) {
+ function err(message) {
+ errors.push(message);
+ }
+ var state = stateOverride || "scheme start", cursor = 0, buffer = "", seenAt = false, seenBracket = false, errors = [];
+ loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {
+ var c = input[cursor];
+ switch (state) {
+ case "scheme start":
+ if (c && ALPHA.test(c)) {
+ buffer += c.toLowerCase();
+ state = "scheme";
+ } else if (!stateOverride) {
+ buffer = "";
+ state = "no scheme";
+ continue;
+ } else {
+ err("Invalid scheme.");
+ break loop;
+ }
+ break;
+
+ case "scheme":
+ if (c && ALPHANUMERIC.test(c)) {
+ buffer += c.toLowerCase();
+ } else if (":" == c) {
+ this._scheme = buffer;
+ buffer = "";
+ if (stateOverride) {
+ break loop;
+ }
+ if (isRelativeScheme(this._scheme)) {
+ this._isRelative = true;
+ }
+ if ("file" == this._scheme) {
+ state = "relative";
+ } else if (this._isRelative && base && base._scheme == this._scheme) {
+ state = "relative or authority";
+ } else if (this._isRelative) {
+ state = "authority first slash";
+ } else {
+ state = "scheme data";
+ }
+ } else if (!stateOverride) {
+ buffer = "";
+ cursor = 0;
+ state = "no scheme";
+ continue;
+ } else if (EOF == c) {
+ break loop;
+ } else {
+ err("Code point not allowed in scheme: " + c);
+ break loop;
+ }
+ break;
+
+ case "scheme data":
+ if ("?" == c) {
+ this._query = "?";
+ state = "query";
+ } else if ("#" == c) {
+ this._fragment = "#";
+ state = "fragment";
+ } else {
+ if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ this._schemeData += percentEscape(c);
+ }
+ }
+ break;
+
+ case "no scheme":
+ if (!base || !isRelativeScheme(base._scheme)) {
+ err("Missing scheme.");
+ invalid.call(this);
+ } else {
+ state = "relative";
+ continue;
+ }
+ break;
+
+ case "relative or authority":
+ if ("/" == c && "/" == input[cursor + 1]) {
+ state = "authority ignore slashes";
+ } else {
+ err("Expected /, got: " + c);
+ state = "relative";
+ continue;
+ }
+ break;
+
+ case "relative":
+ this._isRelative = true;
+ if ("file" != this._scheme) this._scheme = base._scheme;
+ if (EOF == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = base._query;
+ this._username = base._username;
+ this._password = base._password;
+ break loop;
+ } else if ("/" == c || "\\" == c) {
+ if ("\\" == c) err("\\ is an invalid code point.");
+ state = "relative slash";
+ } else if ("?" == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = "?";
+ this._username = base._username;
+ this._password = base._password;
+ state = "query";
+ } else if ("#" == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = base._query;
+ this._fragment = "#";
+ this._username = base._username;
+ this._password = base._password;
+ state = "fragment";
+ } else {
+ var nextC = input[cursor + 1];
+ var nextNextC = input[cursor + 2];
+ if ("file" != this._scheme || !ALPHA.test(c) || nextC != ":" && nextC != "|" || EOF != nextNextC && "/" != nextNextC && "\\" != nextNextC && "?" != nextNextC && "#" != nextNextC) {
+ this._host = base._host;
+ this._port = base._port;
+ this._username = base._username;
+ this._password = base._password;
+ this._path = base._path.slice();
+ this._path.pop();
+ }
+ state = "relative path";
+ continue;
+ }
+ break;
+
+ case "relative slash":
+ if ("/" == c || "\\" == c) {
+ if ("\\" == c) {
+ err("\\ is an invalid code point.");
+ }
+ if ("file" == this._scheme) {
+ state = "file host";
+ } else {
+ state = "authority ignore slashes";
+ }
+ } else {
+ if ("file" != this._scheme) {
+ this._host = base._host;
+ this._port = base._port;
+ this._username = base._username;
+ this._password = base._password;
+ }
+ state = "relative path";
+ continue;
+ }
+ break;
+
+ case "authority first slash":
+ if ("/" == c) {
+ state = "authority second slash";
+ } else {
+ err("Expected '/', got: " + c);
+ state = "authority ignore slashes";
+ continue;
+ }
+ break;
+
+ case "authority second slash":
+ state = "authority ignore slashes";
+ if ("/" != c) {
+ err("Expected '/', got: " + c);
+ continue;
+ }
+ break;
+
+ case "authority ignore slashes":
+ if ("/" != c && "\\" != c) {
+ state = "authority";
+ continue;
+ } else {
+ err("Expected authority, got: " + c);
+ }
+ break;
+
+ case "authority":
+ if ("@" == c) {
+ if (seenAt) {
+ err("@ already seen.");
+ buffer += "%40";
+ }
+ seenAt = true;
+ for (var i = 0; i < buffer.length; i++) {
+ var cp = buffer[i];
+ if (" " == cp || "\n" == cp || "\r" == cp) {
+ err("Invalid whitespace in authority.");
+ continue;
+ }
+ if (":" == cp && null === this._password) {
+ this._password = "";
+ continue;
+ }
+ var tempC = percentEscape(cp);
+ null !== this._password ? this._password += tempC : this._username += tempC;
+ }
+ buffer = "";
+ } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
+ cursor -= buffer.length;
+ buffer = "";
+ state = "host";
+ continue;
+ } else {
+ buffer += c;
+ }
+ break;
+
+ case "file host":
+ if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
+ if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ":" || buffer[1] == "|")) {
+ state = "relative path";
+ } else if (buffer.length == 0) {
+ state = "relative path start";
+ } else {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = "";
+ state = "relative path start";
+ }
+ continue;
+ } else if (" " == c || "\n" == c || "\r" == c) {
+ err("Invalid whitespace in file host.");
+ } else {
+ buffer += c;
+ }
+ break;
+
+ case "host":
+ case "hostname":
+ if (":" == c && !seenBracket) {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = "";
+ state = "port";
+ if ("hostname" == stateOverride) {
+ break loop;
+ }
+ } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = "";
+ state = "relative path start";
+ if (stateOverride) {
+ break loop;
+ }
+ continue;
+ } else if (" " != c && "\n" != c && "\r" != c) {
+ if ("[" == c) {
+ seenBracket = true;
+ } else if ("]" == c) {
+ seenBracket = false;
+ }
+ buffer += c;
+ } else {
+ err("Invalid code point in host/hostname: " + c);
+ }
+ break;
+
+ case "port":
+ if (/[0-9]/.test(c)) {
+ buffer += c;
+ } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c || stateOverride) {
+ if ("" != buffer) {
+ var temp = parseInt(buffer, 10);
+ if (temp != relative[this._scheme]) {
+ this._port = temp + "";
+ }
+ buffer = "";
+ }
+ if (stateOverride) {
+ break loop;
+ }
+ state = "relative path start";
+ continue;
+ } else if (" " == c || "\n" == c || "\r" == c) {
+ err("Invalid code point in port: " + c);
+ } else {
+ invalid.call(this);
+ }
+ break;
+
+ case "relative path start":
+ if ("\\" == c) err("'\\' not allowed in path.");
+ state = "relative path";
+ if ("/" != c && "\\" != c) {
+ continue;
+ }
+ break;
+
+ case "relative path":
+ if (EOF == c || "/" == c || "\\" == c || !stateOverride && ("?" == c || "#" == c)) {
+ if ("\\" == c) {
+ err("\\ not allowed in relative path.");
+ }
+ var tmp;
+ if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {
+ buffer = tmp;
+ }
+ if (".." == buffer) {
+ this._path.pop();
+ if ("/" != c && "\\" != c) {
+ this._path.push("");
+ }
+ } else if ("." == buffer && "/" != c && "\\" != c) {
+ this._path.push("");
+ } else if ("." != buffer) {
+ if ("file" == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == "|") {
+ buffer = buffer[0] + ":";
+ }
+ this._path.push(buffer);
+ }
+ buffer = "";
+ if ("?" == c) {
+ this._query = "?";
+ state = "query";
+ } else if ("#" == c) {
+ this._fragment = "#";
+ state = "fragment";
+ }
+ } else if (" " != c && "\n" != c && "\r" != c) {
+ buffer += percentEscape(c);
+ }
+ break;
+
+ case "query":
+ if (!stateOverride && "#" == c) {
+ this._fragment = "#";
+ state = "fragment";
+ } else if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ this._query += percentEscapeQuery(c);
+ }
+ break;
+
+ case "fragment":
+ if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ this._fragment += c;
+ }
+ break;
+ }
+ cursor++;
+ }
+ }
+ function clear() {
+ this._scheme = "";
+ this._schemeData = "";
+ this._username = "";
+ this._password = null;
+ this._host = "";
+ this._port = "";
+ this._path = [];
+ this._query = "";
+ this._fragment = "";
+ this._isInvalid = false;
+ this._isRelative = false;
+ }
+ function jURL(url, base) {
+ if (base !== undefined && !(base instanceof jURL)) base = new jURL(String(base));
+ this._url = url;
+ clear.call(this);
+ var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, "");
+ parse.call(this, input, null, base);
+ }
+ jURL.prototype = {
+ toString: function() {
+ return this.href;
+ },
+ get href() {
+ if (this._isInvalid) return this._url;
+ var authority = "";
+ if ("" != this._username || null != this._password) {
+ authority = this._username + (null != this._password ? ":" + this._password : "") + "@";
+ }
+ return this.protocol + (this._isRelative ? "//" + authority + this.host : "") + this.pathname + this._query + this._fragment;
+ },
+ set href(href) {
+ clear.call(this);
+ parse.call(this, href);
+ },
+ get protocol() {
+ return this._scheme + ":";
+ },
+ set protocol(protocol) {
+ if (this._isInvalid) return;
+ parse.call(this, protocol + ":", "scheme start");
+ },
+ get host() {
+ return this._isInvalid ? "" : this._port ? this._host + ":" + this._port : this._host;
+ },
+ set host(host) {
+ if (this._isInvalid || !this._isRelative) return;
+ parse.call(this, host, "host");
+ },
+ get hostname() {
+ return this._host;
+ },
+ set hostname(hostname) {
+ if (this._isInvalid || !this._isRelative) return;
+ parse.call(this, hostname, "hostname");
+ },
+ get port() {
+ return this._port;
+ },
+ set port(port) {
+ if (this._isInvalid || !this._isRelative) return;
+ parse.call(this, port, "port");
+ },
+ get pathname() {
+ return this._isInvalid ? "" : this._isRelative ? "/" + this._path.join("/") : this._schemeData;
+ },
+ set pathname(pathname) {
+ if (this._isInvalid || !this._isRelative) return;
+ this._path = [];
+ parse.call(this, pathname, "relative path start");
+ },
+ get search() {
+ return this._isInvalid || !this._query || "?" == this._query ? "" : this._query;
+ },
+ set search(search) {
+ if (this._isInvalid || !this._isRelative) return;
+ this._query = "?";
+ if ("?" == search[0]) search = search.slice(1);
+ parse.call(this, search, "query");
+ },
+ get hash() {
+ return this._isInvalid || !this._fragment || "#" == this._fragment ? "" : this._fragment;
+ },
+ set hash(hash) {
+ if (this._isInvalid) return;
+ this._fragment = "#";
+ if ("#" == hash[0]) hash = hash.slice(1);
+ parse.call(this, hash, "fragment");
+ },
+ get origin() {
+ var host;
+ if (this._isInvalid || !this._scheme) {
+ return "";
+ }
+ switch (this._scheme) {
+ case "data":
+ case "file":
+ case "javascript":
+ case "mailto":
+ return "null";
+ }
+ host = this.host;
+ if (!host) {
+ return "";
+ }
+ return this._scheme + "://" + host;
+ }
+ };
+ var OriginalURL = scope.URL;
+ if (OriginalURL) {
+ jURL.createObjectURL = function(blob) {
+ return OriginalURL.createObjectURL.apply(OriginalURL, arguments);
+ };
+ jURL.revokeObjectURL = function(url) {
+ OriginalURL.revokeObjectURL(url);
+ };
+ }
+ scope.URL = jURL;
+})(this);
+
+if (typeof WeakMap === "undefined") {
+ (function() {
+ var defineProperty = Object.defineProperty;
+ var counter = Date.now() % 1e9;
+ var WeakMap = function() {
+ this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
+ };
+ WeakMap.prototype = {
+ set: function(key, value) {
+ var entry = key[this.name];
+ if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
+ value: [ key, value ],
+ writable: true
+ });
+ return this;
+ },
+ get: function(key) {
+ var entry;
+ return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
+ },
+ "delete": function(key) {
+ var entry = key[this.name];
+ if (!entry || entry[0] !== key) return false;
+ entry[0] = entry[1] = undefined;
+ return true;
+ },
+ has: function(key) {
+ var entry = key[this.name];
+ if (!entry) return false;
+ return entry[0] === key;
+ }
+ };
+ window.WeakMap = WeakMap;
+ })();
+}
+
+(function(global) {
+ var registrationsTable = new WeakMap();
+ var setImmediate;
+ if (/Trident|Edge/.test(navigator.userAgent)) {
+ setImmediate = setTimeout;
+ } else if (window.setImmediate) {
+ setImmediate = window.setImmediate;
+ } else {
+ var setImmediateQueue = [];
+ var sentinel = String(Math.random());
+ window.addEventListener("message", function(e) {
+ if (e.data === sentinel) {
+ var queue = setImmediateQueue;
+ setImmediateQueue = [];
+ queue.forEach(function(func) {
+ func();
+ });
+ }
+ });
+ setImmediate = function(func) {
+ setImmediateQueue.push(func);
+ window.postMessage(sentinel, "*");
+ };
+ }
+ var isScheduled = false;
+ var scheduledObservers = [];
+ function scheduleCallback(observer) {
+ scheduledObservers.push(observer);
+ if (!isScheduled) {
+ isScheduled = true;
+ setImmediate(dispatchCallbacks);
+ }
+ }
+ function wrapIfNeeded(node) {
+ return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
+ }
+ function dispatchCallbacks() {
+ isScheduled = false;
+ var observers = scheduledObservers;
+ scheduledObservers = [];
+ observers.sort(function(o1, o2) {
+ return o1.uid_ - o2.uid_;
+ });
+ var anyNonEmpty = false;
+ observers.forEach(function(observer) {
+ var queue = observer.takeRecords();
+ removeTransientObserversFor(observer);
+ if (queue.length) {
+ observer.callback_(queue, observer);
+ anyNonEmpty = true;
+ }
+ });
+ if (anyNonEmpty) dispatchCallbacks();
+ }
+ function removeTransientObserversFor(observer) {
+ observer.nodes_.forEach(function(node) {
+ var registrations = registrationsTable.get(node);
+ if (!registrations) return;
+ registrations.forEach(function(registration) {
+ if (registration.observer === observer) registration.removeTransientObservers();
+ });
+ });
+ }
+ function forEachAncestorAndObserverEnqueueRecord(target, callback) {
+ for (var node = target; node; node = node.parentNode) {
+ var registrations = registrationsTable.get(node);
+ if (registrations) {
+ for (var j = 0; j < registrations.length; j++) {
+ var registration = registrations[j];
+ var options = registration.options;
+ if (node !== target && !options.subtree) continue;
+ var record = callback(options);
+ if (record) registration.enqueue(record);
+ }
+ }
+ }
+ }
+ var uidCounter = 0;
+ function JsMutationObserver(callback) {
+ this.callback_ = callback;
+ this.nodes_ = [];
+ this.records_ = [];
+ this.uid_ = ++uidCounter;
+ }
+ JsMutationObserver.prototype = {
+ observe: function(target, options) {
+ target = wrapIfNeeded(target);
+ if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
+ throw new SyntaxError();
+ }
+ var registrations = registrationsTable.get(target);
+ if (!registrations) registrationsTable.set(target, registrations = []);
+ var registration;
+ for (var i = 0; i < registrations.length; i++) {
+ if (registrations[i].observer === this) {
+ registration = registrations[i];
+ registration.removeListeners();
+ registration.options = options;
+ break;
+ }
+ }
+ if (!registration) {
+ registration = new Registration(this, target, options);
+ registrations.push(registration);
+ this.nodes_.push(target);
+ }
+ registration.addListeners();
+ },
+ disconnect: function() {
+ this.nodes_.forEach(function(node) {
+ var registrations = registrationsTable.get(node);
+ for (var i = 0; i < registrations.length; i++) {
+ var registration = registrations[i];
+ if (registration.observer === this) {
+ registration.removeListeners();
+ registrations.splice(i, 1);
+ break;
+ }
+ }
+ }, this);
+ this.records_ = [];
+ },
+ takeRecords: function() {
+ var copyOfRecords = this.records_;
+ this.records_ = [];
+ return copyOfRecords;
+ }
+ };
+ function MutationRecord(type, target) {
+ this.type = type;
+ this.target = target;
+ this.addedNodes = [];
+ this.removedNodes = [];
+ this.previousSibling = null;
+ this.nextSibling = null;
+ this.attributeName = null;
+ this.attributeNamespace = null;
+ this.oldValue = null;
+ }
+ function copyMutationRecord(original) {
+ var record = new MutationRecord(original.type, original.target);
+ record.addedNodes = original.addedNodes.slice();
+ record.removedNodes = original.removedNodes.slice();
+ record.previousSibling = original.previousSibling;
+ record.nextSibling = original.nextSibling;
+ record.attributeName = original.attributeName;
+ record.attributeNamespace = original.attributeNamespace;
+ record.oldValue = original.oldValue;
+ return record;
+ }
+ var currentRecord, recordWithOldValue;
+ function getRecord(type, target) {
+ return currentRecord = new MutationRecord(type, target);
+ }
+ function getRecordWithOldValue(oldValue) {
+ if (recordWithOldValue) return recordWithOldValue;
+ recordWithOldValue = copyMutationRecord(currentRecord);
+ recordWithOldValue.oldValue = oldValue;
+ return recordWithOldValue;
+ }
+ function clearRecords() {
+ currentRecord = recordWithOldValue = undefined;
+ }
+ function recordRepresentsCurrentMutation(record) {
+ return record === recordWithOldValue || record === currentRecord;
+ }
+ function selectRecord(lastRecord, newRecord) {
+ if (lastRecord === newRecord) return lastRecord;
+ if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
+ return null;
+ }
+ function Registration(observer, target, options) {
+ this.observer = observer;
+ this.target = target;
+ this.options = options;
+ this.transientObservedNodes = [];
+ }
+ Registration.prototype = {
+ enqueue: function(record) {
+ var records = this.observer.records_;
+ var length = records.length;
+ if (records.length > 0) {
+ var lastRecord = records[length - 1];
+ var recordToReplaceLast = selectRecord(lastRecord, record);
+ if (recordToReplaceLast) {
+ records[length - 1] = recordToReplaceLast;
+ return;
+ }
+ } else {
+ scheduleCallback(this.observer);
+ }
+ records[length] = record;
+ },
+ addListeners: function() {
+ this.addListeners_(this.target);
+ },
+ addListeners_: function(node) {
+ var options = this.options;
+ if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
+ if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
+ if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
+ if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
+ },
+ removeListeners: function() {
+ this.removeListeners_(this.target);
+ },
+ removeListeners_: function(node) {
+ var options = this.options;
+ if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
+ if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
+ if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
+ if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
+ },
+ addTransientObserver: function(node) {
+ if (node === this.target) return;
+ this.addListeners_(node);
+ this.transientObservedNodes.push(node);
+ var registrations = registrationsTable.get(node);
+ if (!registrations) registrationsTable.set(node, registrations = []);
+ registrations.push(this);
+ },
+ removeTransientObservers: function() {
+ var transientObservedNodes = this.transientObservedNodes;
+ this.transientObservedNodes = [];
+ transientObservedNodes.forEach(function(node) {
+ this.removeListeners_(node);
+ var registrations = registrationsTable.get(node);
+ for (var i = 0; i < registrations.length; i++) {
+ if (registrations[i] === this) {
+ registrations.splice(i, 1);
+ break;
+ }
+ }
+ }, this);
+ },
+ handleEvent: function(e) {
+ e.stopImmediatePropagation();
+ switch (e.type) {
+ case "DOMAttrModified":
+ var name = e.attrName;
+ var namespace = e.relatedNode.namespaceURI;
+ var target = e.target;
+ var record = new getRecord("attributes", target);
+ record.attributeName = name;
+ record.attributeNamespace = namespace;
+ var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
+ forEachAncestorAndObserverEnqueueRecord(target, function(options) {
+ if (!options.attributes) return;
+ if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
+ return;
+ }
+ if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
+ return record;
+ });
+ break;
+
+ case "DOMCharacterDataModified":
+ var target = e.target;
+ var record = getRecord("characterData", target);
+ var oldValue = e.prevValue;
+ forEachAncestorAndObserverEnqueueRecord(target, function(options) {
+ if (!options.characterData) return;
+ if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
+ return record;
+ });
+ break;
+
+ case "DOMNodeRemoved":
+ this.addTransientObserver(e.target);
+
+ case "DOMNodeInserted":
+ var changedNode = e.target;
+ var addedNodes, removedNodes;
+ if (e.type === "DOMNodeInserted") {
+ addedNodes = [ changedNode ];
+ removedNodes = [];
+ } else {
+ addedNodes = [];
+ removedNodes = [ changedNode ];
+ }
+ var previousSibling = changedNode.previousSibling;
+ var nextSibling = changedNode.nextSibling;
+ var record = getRecord("childList", e.target.parentNode);
+ record.addedNodes = addedNodes;
+ record.removedNodes = removedNodes;
+ record.previousSibling = previousSibling;
+ record.nextSibling = nextSibling;
+ forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
+ if (!options.childList) return;
+ return record;
+ });
+ }
+ clearRecords();
+ }
+ };
+ global.JsMutationObserver = JsMutationObserver;
+ if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
+})(this);
+
+window.HTMLImports = window.HTMLImports || {
+ flags: {}
+};
+
+(function(scope) {
+ var IMPORT_LINK_TYPE = "import";
+ var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement("link"));
+ var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill);
+ var wrap = function(node) {
+ return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node;
+ };
+ var rootDocument = wrap(document);
+ var currentScriptDescriptor = {
+ get: function() {
+ var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null);
+ return wrap(script);
+ },
+ configurable: true
+ };
+ Object.defineProperty(document, "_currentScript", currentScriptDescriptor);
+ Object.defineProperty(rootDocument, "_currentScript", currentScriptDescriptor);
+ var isIE = /Trident/.test(navigator.userAgent);
+ function whenReady(callback, doc) {
+ doc = doc || rootDocument;
+ whenDocumentReady(function() {
+ watchImportsLoad(callback, doc);
+ }, doc);
+ }
+ var requiredReadyState = isIE ? "complete" : "interactive";
+ var READY_EVENT = "readystatechange";
+ function isDocumentReady(doc) {
+ return doc.readyState === "complete" || doc.readyState === requiredReadyState;
+ }
+ function whenDocumentReady(callback, doc) {
+ if (!isDocumentReady(doc)) {
+ var checkReady = function() {
+ if (doc.readyState === "complete" || doc.readyState === requiredReadyState) {
+ doc.removeEventListener(READY_EVENT, checkReady);
+ whenDocumentReady(callback, doc);
+ }
+ };
+ doc.addEventListener(READY_EVENT, checkReady);
+ } else if (callback) {
+ callback();
+ }
+ }
+ function markTargetLoaded(event) {
+ event.target.__loaded = true;
+ }
+ function watchImportsLoad(callback, doc) {
+ var imports = doc.querySelectorAll("link[rel=import]");
+ var parsedCount = 0, importCount = imports.length, newImports = [], errorImports = [];
+ function checkDone() {
+ if (parsedCount == importCount && callback) {
+ callback({
+ allImports: imports,
+ loadedImports: newImports,
+ errorImports: errorImports
+ });
+ }
+ }
+ function loadedImport(e) {
+ markTargetLoaded(e);
+ newImports.push(this);
+ parsedCount++;
+ checkDone();
+ }
+ function errorLoadingImport(e) {
+ errorImports.push(this);
+ parsedCount++;
+ checkDone();
+ }
+ if (importCount) {
+ for (var i = 0, imp; i < importCount && (imp = imports[i]); i++) {
+ if (isImportLoaded(imp)) {
+ parsedCount++;
+ checkDone();
+ } else {
+ imp.addEventListener("load", loadedImport);
+ imp.addEventListener("error", errorLoadingImport);
+ }
+ }
+ } else {
+ checkDone();
+ }
+ }
+ function isImportLoaded(link) {
+ return useNative ? link.__loaded || link.import && link.import.readyState !== "loading" : link.__importParsed;
+ }
+ if (useNative) {
+ new MutationObserver(function(mxns) {
+ for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) {
+ if (m.addedNodes) {
+ handleImports(m.addedNodes);
+ }
+ }
+ }).observe(document.head, {
+ childList: true
+ });
+ function handleImports(nodes) {
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
+ if (isImport(n)) {
+ handleImport(n);
+ }
+ }
+ }
+ function isImport(element) {
+ return element.localName === "link" && element.rel === "import";
+ }
+ function handleImport(element) {
+ var loaded = element.import;
+ if (loaded) {
+ markTargetLoaded({
+ target: element
+ });
+ } else {
+ element.addEventListener("load", markTargetLoaded);
+ element.addEventListener("error", markTargetLoaded);
+ }
+ }
+ (function() {
+ if (document.readyState === "loading") {
+ var imports = document.querySelectorAll("link[rel=import]");
+ for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) {
+ handleImport(imp);
+ }
+ }
+ })();
+ }
+ whenReady(function(detail) {
+ window.HTMLImports.ready = true;
+ window.HTMLImports.readyTime = new Date().getTime();
+ var evt = rootDocument.createEvent("CustomEvent");
+ evt.initCustomEvent("HTMLImportsLoaded", true, true, detail);
+ rootDocument.dispatchEvent(evt);
+ });
+ scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;
+ scope.useNative = useNative;
+ scope.rootDocument = rootDocument;
+ scope.whenReady = whenReady;
+ scope.isIE = isIE;
+})(window.HTMLImports);
+
+(function(scope) {
+ var modules = [];
+ var addModule = function(module) {
+ modules.push(module);
+ };
+ var initializeModules = function() {
+ modules.forEach(function(module) {
+ module(scope);
+ });
+ };
+ scope.addModule = addModule;
+ scope.initializeModules = initializeModules;
+})(window.HTMLImports);
+
+window.HTMLImports.addModule(function(scope) {
+ var CSS_URL_REGEXP = /(url\()([^)]*)(\))/g;
+ var CSS_IMPORT_REGEXP = /(@import[\s]+(?!url\())([^;]*)(;)/g;
+ var path = {
+ resolveUrlsInStyle: function(style, linkUrl) {
+ var doc = style.ownerDocument;
+ var resolver = doc.createElement("a");
+ style.textContent = this.resolveUrlsInCssText(style.textContent, linkUrl, resolver);
+ return style;
+ },
+ resolveUrlsInCssText: function(cssText, linkUrl, urlObj) {
+ var r = this.replaceUrls(cssText, urlObj, linkUrl, CSS_URL_REGEXP);
+ r = this.replaceUrls(r, urlObj, linkUrl, CSS_IMPORT_REGEXP);
+ return r;
+ },
+ replaceUrls: function(text, urlObj, linkUrl, regexp) {
+ return text.replace(regexp, function(m, pre, url, post) {
+ var urlPath = url.replace(/["']/g, "");
+ if (linkUrl) {
+ urlPath = new URL(urlPath, linkUrl).href;
+ }
+ urlObj.href = urlPath;
+ urlPath = urlObj.href;
+ return pre + "'" + urlPath + "'" + post;
+ });
+ }
+ };
+ scope.path = path;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var xhr = {
+ async: true,
+ ok: function(request) {
+ return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0;
+ },
+ load: function(url, next, nextContext) {
+ var request = new XMLHttpRequest();
+ if (scope.flags.debug || scope.flags.bust) {
+ url += "?" + Math.random();
+ }
+ request.open("GET", url, xhr.async);
+ request.addEventListener("readystatechange", function(e) {
+ if (request.readyState === 4) {
+ var locationHeader = request.getResponseHeader("Location");
+ var redirectedUrl = null;
+ if (locationHeader) {
+ var redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
+ }
+ next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);
+ }
+ });
+ request.send();
+ return request;
+ },
+ loadDocument: function(url, next, nextContext) {
+ this.load(url, next, nextContext).responseType = "document";
+ }
+ };
+ scope.xhr = xhr;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var xhr = scope.xhr;
+ var flags = scope.flags;
+ var Loader = function(onLoad, onComplete) {
+ this.cache = {};
+ this.onload = onLoad;
+ this.oncomplete = onComplete;
+ this.inflight = 0;
+ this.pending = {};
+ };
+ Loader.prototype = {
+ addNodes: function(nodes) {
+ this.inflight += nodes.length;
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
+ this.require(n);
+ }
+ this.checkDone();
+ },
+ addNode: function(node) {
+ this.inflight++;
+ this.require(node);
+ this.checkDone();
+ },
+ require: function(elt) {
+ var url = elt.src || elt.href;
+ elt.__nodeUrl = url;
+ if (!this.dedupe(url, elt)) {
+ this.fetch(url, elt);
+ }
+ },
+ dedupe: function(url, elt) {
+ if (this.pending[url]) {
+ this.pending[url].push(elt);
+ return true;
+ }
+ var resource;
+ if (this.cache[url]) {
+ this.onload(url, elt, this.cache[url]);
+ this.tail();
+ return true;
+ }
+ this.pending[url] = [ elt ];
+ return false;
+ },
+ fetch: function(url, elt) {
+ flags.load && console.log("fetch", url, elt);
+ if (!url) {
+ setTimeout(function() {
+ this.receive(url, elt, {
+ error: "href must be specified"
+ }, null);
+ }.bind(this), 0);
+ } else if (url.match(/^data:/)) {
+ var pieces = url.split(",");
+ var header = pieces[0];
+ var body = pieces[1];
+ if (header.indexOf(";base64") > -1) {
+ body = atob(body);
+ } else {
+ body = decodeURIComponent(body);
+ }
+ setTimeout(function() {
+ this.receive(url, elt, null, body);
+ }.bind(this), 0);
+ } else {
+ var receiveXhr = function(err, resource, redirectedUrl) {
+ this.receive(url, elt, err, resource, redirectedUrl);
+ }.bind(this);
+ xhr.load(url, receiveXhr);
+ }
+ },
+ receive: function(url, elt, err, resource, redirectedUrl) {
+ this.cache[url] = resource;
+ var $p = this.pending[url];
+ for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
+ this.onload(url, p, resource, err, redirectedUrl);
+ this.tail();
+ }
+ this.pending[url] = null;
+ },
+ tail: function() {
+ --this.inflight;
+ this.checkDone();
+ },
+ checkDone: function() {
+ if (!this.inflight) {
+ this.oncomplete();
+ }
+ }
+ };
+ scope.Loader = Loader;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var Observer = function(addCallback) {
+ this.addCallback = addCallback;
+ this.mo = new MutationObserver(this.handler.bind(this));
+ };
+ Observer.prototype = {
+ handler: function(mutations) {
+ for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) {
+ if (m.type === "childList" && m.addedNodes.length) {
+ this.addedNodes(m.addedNodes);
+ }
+ }
+ },
+ addedNodes: function(nodes) {
+ if (this.addCallback) {
+ this.addCallback(nodes);
+ }
+ for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) {
+ if (n.children && n.children.length) {
+ this.addedNodes(n.children);
+ }
+ }
+ },
+ observe: function(root) {
+ this.mo.observe(root, {
+ childList: true,
+ subtree: true
+ });
+ }
+ };
+ scope.Observer = Observer;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var path = scope.path;
+ var rootDocument = scope.rootDocument;
+ var flags = scope.flags;
+ var isIE = scope.isIE;
+ var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;
+ var IMPORT_SELECTOR = "link[rel=" + IMPORT_LINK_TYPE + "]";
+ var importParser = {
+ documentSelectors: IMPORT_SELECTOR,
+ importsSelectors: [ IMPORT_SELECTOR, "link[rel=stylesheet]", "style", "script:not([type])", 'script[type="application/javascript"]', 'script[type="text/javascript"]' ].join(","),
+ map: {
+ link: "parseLink",
+ script: "parseScript",
+ style: "parseStyle"
+ },
+ dynamicElements: [],
+ parseNext: function() {
+ var next = this.nextToParse();
+ if (next) {
+ this.parse(next);
+ }
+ },
+ parse: function(elt) {
+ if (this.isParsed(elt)) {
+ flags.parse && console.log("[%s] is already parsed", elt.localName);
+ return;
+ }
+ var fn = this[this.map[elt.localName]];
+ if (fn) {
+ this.markParsing(elt);
+ fn.call(this, elt);
+ }
+ },
+ parseDynamic: function(elt, quiet) {
+ this.dynamicElements.push(elt);
+ if (!quiet) {
+ this.parseNext();
+ }
+ },
+ markParsing: function(elt) {
+ flags.parse && console.log("parsing", elt);
+ this.parsingElement = elt;
+ },
+ markParsingComplete: function(elt) {
+ elt.__importParsed = true;
+ this.markDynamicParsingComplete(elt);
+ if (elt.__importElement) {
+ elt.__importElement.__importParsed = true;
+ this.markDynamicParsingComplete(elt.__importElement);
+ }
+ this.parsingElement = null;
+ flags.parse && console.log("completed", elt);
+ },
+ markDynamicParsingComplete: function(elt) {
+ var i = this.dynamicElements.indexOf(elt);
+ if (i >= 0) {
+ this.dynamicElements.splice(i, 1);
+ }
+ },
+ parseImport: function(elt) {
+ if (window.HTMLImports.__importsParsingHook) {
+ window.HTMLImports.__importsParsingHook(elt);
+ }
+ if (elt.import) {
+ elt.import.__importParsed = true;
+ }
+ this.markParsingComplete(elt);
+ if (elt.__resource && !elt.__error) {
+ elt.dispatchEvent(new CustomEvent("load", {
+ bubbles: false
+ }));
+ } else {
+ elt.dispatchEvent(new CustomEvent("error", {
+ bubbles: false
+ }));
+ }
+ if (elt.__pending) {
+ var fn;
+ while (elt.__pending.length) {
+ fn = elt.__pending.shift();
+ if (fn) {
+ fn({
+ target: elt
+ });
+ }
+ }
+ }
+ this.parseNext();
+ },
+ parseLink: function(linkElt) {
+ if (nodeIsImport(linkElt)) {
+ this.parseImport(linkElt);
+ } else {
+ linkElt.href = linkElt.href;
+ this.parseGeneric(linkElt);
+ }
+ },
+ parseStyle: function(elt) {
+ var src = elt;
+ elt = cloneStyle(elt);
+ src.__appliedElement = elt;
+ elt.__importElement = src;
+ this.parseGeneric(elt);
+ },
+ parseGeneric: function(elt) {
+ this.trackElement(elt);
+ this.addElementToDocument(elt);
+ },
+ rootImportForElement: function(elt) {
+ var n = elt;
+ while (n.ownerDocument.__importLink) {
+ n = n.ownerDocument.__importLink;
+ }
+ return n;
+ },
+ addElementToDocument: function(elt) {
+ var port = this.rootImportForElement(elt.__importElement || elt);
+ port.parentNode.insertBefore(elt, port);
+ },
+ trackElement: function(elt, callback) {
+ var self = this;
+ var done = function(e) {
+ if (callback) {
+ callback(e);
+ }
+ self.markParsingComplete(elt);
+ self.parseNext();
+ };
+ elt.addEventListener("load", done);
+ elt.addEventListener("error", done);
+ if (isIE && elt.localName === "style") {
+ var fakeLoad = false;
+ if (elt.textContent.indexOf("@import") == -1) {
+ fakeLoad = true;
+ } else if (elt.sheet) {
+ fakeLoad = true;
+ var csr = elt.sheet.cssRules;
+ var len = csr ? csr.length : 0;
+ for (var i = 0, r; i < len && (r = csr[i]); i++) {
+ if (r.type === CSSRule.IMPORT_RULE) {
+ fakeLoad = fakeLoad && Boolean(r.styleSheet);
+ }
+ }
+ }
+ if (fakeLoad) {
+ setTimeout(function() {
+ elt.dispatchEvent(new CustomEvent("load", {
+ bubbles: false
+ }));
+ });
+ }
+ }
+ },
+ parseScript: function(scriptElt) {
+ var script = document.createElement("script");
+ script.__importElement = scriptElt;
+ script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
+ scope.currentScript = scriptElt;
+ this.trackElement(script, function(e) {
+ script.parentNode.removeChild(script);
+ scope.currentScript = null;
+ });
+ this.addElementToDocument(script);
+ },
+ nextToParse: function() {
+ this._mayParse = [];
+ return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic());
+ },
+ nextToParseInDoc: function(doc, link) {
+ if (doc && this._mayParse.indexOf(doc) < 0) {
+ this._mayParse.push(doc);
+ var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));
+ for (var i = 0, l = nodes.length, p = 0, n; i < l && (n = nodes[i]); i++) {
+ if (!this.isParsed(n)) {
+ if (this.hasResource(n)) {
+ return nodeIsImport(n) ? this.nextToParseInDoc(n.import, n) : n;
+ } else {
+ return;
+ }
+ }
+ }
+ }
+ return link;
+ },
+ nextToParseDynamic: function() {
+ return this.dynamicElements[0];
+ },
+ parseSelectorsForNode: function(node) {
+ var doc = node.ownerDocument || node;
+ return doc === rootDocument ? this.documentSelectors : this.importsSelectors;
+ },
+ isParsed: function(node) {
+ return node.__importParsed;
+ },
+ needsDynamicParsing: function(elt) {
+ return this.dynamicElements.indexOf(elt) >= 0;
+ },
+ hasResource: function(node) {
+ if (nodeIsImport(node) && node.import === undefined) {
+ return false;
+ }
+ return true;
+ }
+ };
+ function nodeIsImport(elt) {
+ return elt.localName === "link" && elt.rel === IMPORT_LINK_TYPE;
+ }
+ function generateScriptDataUrl(script) {
+ var scriptContent = generateScriptContent(script);
+ return "data:text/javascript;charset=utf-8," + encodeURIComponent(scriptContent);
+ }
+ function generateScriptContent(script) {
+ return script.textContent + generateSourceMapHint(script);
+ }
+ function generateSourceMapHint(script) {
+ var owner = script.ownerDocument;
+ owner.__importedScripts = owner.__importedScripts || 0;
+ var moniker = script.ownerDocument.baseURI;
+ var num = owner.__importedScripts ? "-" + owner.__importedScripts : "";
+ owner.__importedScripts++;
+ return "\n//# sourceURL=" + moniker + num + ".js\n";
+ }
+ function cloneStyle(style) {
+ var clone = style.ownerDocument.createElement("style");
+ clone.textContent = style.textContent;
+ path.resolveUrlsInStyle(clone);
+ return clone;
+ }
+ scope.parser = importParser;
+ scope.IMPORT_SELECTOR = IMPORT_SELECTOR;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var flags = scope.flags;
+ var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;
+ var IMPORT_SELECTOR = scope.IMPORT_SELECTOR;
+ var rootDocument = scope.rootDocument;
+ var Loader = scope.Loader;
+ var Observer = scope.Observer;
+ var parser = scope.parser;
+ var importer = {
+ documents: {},
+ documentPreloadSelectors: IMPORT_SELECTOR,
+ importsPreloadSelectors: [ IMPORT_SELECTOR ].join(","),
+ loadNode: function(node) {
+ importLoader.addNode(node);
+ },
+ loadSubtree: function(parent) {
+ var nodes = this.marshalNodes(parent);
+ importLoader.addNodes(nodes);
+ },
+ marshalNodes: function(parent) {
+ return parent.querySelectorAll(this.loadSelectorsForNode(parent));
+ },
+ loadSelectorsForNode: function(node) {
+ var doc = node.ownerDocument || node;
+ return doc === rootDocument ? this.documentPreloadSelectors : this.importsPreloadSelectors;
+ },
+ loaded: function(url, elt, resource, err, redirectedUrl) {
+ flags.load && console.log("loaded", url, elt);
+ elt.__resource = resource;
+ elt.__error = err;
+ if (isImportLink(elt)) {
+ var doc = this.documents[url];
+ if (doc === undefined) {
+ doc = err ? null : makeDocument(resource, redirectedUrl || url);
+ if (doc) {
+ doc.__importLink = elt;
+ this.bootDocument(doc);
+ }
+ this.documents[url] = doc;
+ }
+ elt.import = doc;
+ }
+ parser.parseNext();
+ },
+ bootDocument: function(doc) {
+ this.loadSubtree(doc);
+ this.observer.observe(doc);
+ parser.parseNext();
+ },
+ loadedAll: function() {
+ parser.parseNext();
+ }
+ };
+ var importLoader = new Loader(importer.loaded.bind(importer), importer.loadedAll.bind(importer));
+ importer.observer = new Observer();
+ function isImportLink(elt) {
+ return isLinkRel(elt, IMPORT_LINK_TYPE);
+ }
+ function isLinkRel(elt, rel) {
+ return elt.localName === "link" && elt.getAttribute("rel") === rel;
+ }
+ function hasBaseURIAccessor(doc) {
+ return !!Object.getOwnPropertyDescriptor(doc, "baseURI");
+ }
+ function makeDocument(resource, url) {
+ var doc = document.implementation.createHTMLDocument(IMPORT_LINK_TYPE);
+ doc._URL = url;
+ var base = doc.createElement("base");
+ base.setAttribute("href", url);
+ if (!doc.baseURI && !hasBaseURIAccessor(doc)) {
+ Object.defineProperty(doc, "baseURI", {
+ value: url
+ });
+ }
+ var meta = doc.createElement("meta");
+ meta.setAttribute("charset", "utf-8");
+ doc.head.appendChild(meta);
+ doc.head.appendChild(base);
+ doc.body.innerHTML = resource;
+ if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {
+ HTMLTemplateElement.bootstrap(doc);
+ }
+ return doc;
+ }
+ if (!document.baseURI) {
+ var baseURIDescriptor = {
+ get: function() {
+ var base = document.querySelector("base");
+ return base ? base.href : window.location.href;
+ },
+ configurable: true
+ };
+ Object.defineProperty(document, "baseURI", baseURIDescriptor);
+ Object.defineProperty(rootDocument, "baseURI", baseURIDescriptor);
+ }
+ scope.importer = importer;
+ scope.importLoader = importLoader;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var parser = scope.parser;
+ var importer = scope.importer;
+ var dynamic = {
+ added: function(nodes) {
+ var owner, parsed, loading;
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
+ if (!owner) {
+ owner = n.ownerDocument;
+ parsed = parser.isParsed(owner);
+ }
+ loading = this.shouldLoadNode(n);
+ if (loading) {
+ importer.loadNode(n);
+ }
+ if (this.shouldParseNode(n) && parsed) {
+ parser.parseDynamic(n, loading);
+ }
+ }
+ },
+ shouldLoadNode: function(node) {
+ return node.nodeType === 1 && matches.call(node, importer.loadSelectorsForNode(node));
+ },
+ shouldParseNode: function(node) {
+ return node.nodeType === 1 && matches.call(node, parser.parseSelectorsForNode(node));
+ }
+ };
+ importer.observer.addCallback = dynamic.added.bind(dynamic);
+ var matches = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector;
+});
+
+(function(scope) {
+ var initializeModules = scope.initializeModules;
+ var isIE = scope.isIE;
+ if (scope.useNative) {
+ return;
+ }
+ if (isIE && typeof window.CustomEvent !== "function") {
+ window.CustomEvent = function(inType, params) {
+ params = params || {};
+ var e = document.createEvent("CustomEvent");
+ e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
+ e.preventDefault = function() {
+ Object.defineProperty(this, "defaultPrevented", {
+ get: function() {
+ return true;
+ }
+ });
+ };
+ return e;
+ };
+ window.CustomEvent.prototype = window.Event.prototype;
+ }
+ initializeModules();
+ var rootDocument = scope.rootDocument;
+ function bootstrap() {
+ window.HTMLImports.importer.bootDocument(rootDocument);
+ }
+ if (document.readyState === "complete" || document.readyState === "interactive" && !window.attachEvent) {
+ bootstrap();
+ } else {
+ document.addEventListener("DOMContentLoaded", bootstrap);
+ }
+})(window.HTMLImports);
+
+window.CustomElements = window.CustomElements || {
+ flags: {}
+};
+
+(function(scope) {
+ var flags = scope.flags;
+ var modules = [];
+ var addModule = function(module) {
+ modules.push(module);
+ };
+ var initializeModules = function() {
+ modules.forEach(function(module) {
+ module(scope);
+ });
+ };
+ scope.addModule = addModule;
+ scope.initializeModules = initializeModules;
+ scope.hasNative = Boolean(document.registerElement);
+ scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
+})(window.CustomElements);
+
+window.CustomElements.addModule(function(scope) {
+ var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none";
+ function forSubtree(node, cb) {
+ findAllElements(node, function(e) {
+ if (cb(e)) {
+ return true;
+ }
+ forRoots(e, cb);
+ });
+ forRoots(node, cb);
+ }
+ function findAllElements(node, find, data) {
+ var e = node.firstElementChild;
+ if (!e) {
+ e = node.firstChild;
+ while (e && e.nodeType !== Node.ELEMENT_NODE) {
+ e = e.nextSibling;
+ }
+ }
+ while (e) {
+ if (find(e, data) !== true) {
+ findAllElements(e, find, data);
+ }
+ e = e.nextElementSibling;
+ }
+ return null;
+ }
+ function forRoots(node, cb) {
+ var root = node.shadowRoot;
+ while (root) {
+ forSubtree(root, cb);
+ root = root.olderShadowRoot;
+ }
+ }
+ function forDocumentTree(doc, cb) {
+ _forDocumentTree(doc, cb, []);
+ }
+ function _forDocumentTree(doc, cb, processingDocuments) {
+ doc = window.wrap(doc);
+ if (processingDocuments.indexOf(doc) >= 0) {
+ return;
+ }
+ processingDocuments.push(doc);
+ var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]");
+ for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {
+ if (n.import) {
+ _forDocumentTree(n.import, cb, processingDocuments);
+ }
+ }
+ cb(doc);
+ }
+ scope.forDocumentTree = forDocumentTree;
+ scope.forSubtree = forSubtree;
+});
+
+window.CustomElements.addModule(function(scope) {
+ var flags = scope.flags;
+ var forSubtree = scope.forSubtree;
+ var forDocumentTree = scope.forDocumentTree;
+ function addedNode(node) {
+ return added(node) || addedSubtree(node);
+ }
+ function added(node) {
+ if (scope.upgrade(node)) {
+ return true;
+ }
+ attached(node);
+ }
+ function addedSubtree(node) {
+ forSubtree(node, function(e) {
+ if (added(e)) {
+ return true;
+ }
+ });
+ }
+ function attachedNode(node) {
+ attached(node);
+ if (inDocument(node)) {
+ forSubtree(node, function(e) {
+ attached(e);
+ });
+ }
+ }
+ var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
+ scope.hasPolyfillMutations = hasPolyfillMutations;
+ var isPendingMutations = false;
+ var pendingMutations = [];
+ function deferMutation(fn) {
+ pendingMutations.push(fn);
+ if (!isPendingMutations) {
+ isPendingMutations = true;
+ setTimeout(takeMutations);
+ }
+ }
+ function takeMutations() {
+ isPendingMutations = false;
+ var $p = pendingMutations;
+ for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
+ p();
+ }
+ pendingMutations = [];
+ }
+ function attached(element) {
+ if (hasPolyfillMutations) {
+ deferMutation(function() {
+ _attached(element);
+ });
+ } else {
+ _attached(element);
+ }
+ }
+ function _attached(element) {
+ if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
+ if (!element.__attached && inDocument(element)) {
+ element.__attached = true;
+ if (element.attachedCallback) {
+ element.attachedCallback();
+ }
+ }
+ }
+ }
+ function detachedNode(node) {
+ detached(node);
+ forSubtree(node, function(e) {
+ detached(e);
+ });
+ }
+ function detached(element) {
+ if (hasPolyfillMutations) {
+ deferMutation(function() {
+ _detached(element);
+ });
+ } else {
+ _detached(element);
+ }
+ }
+ function _detached(element) {
+ if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
+ if (element.__attached && !inDocument(element)) {
+ element.__attached = false;
+ if (element.detachedCallback) {
+ element.detachedCallback();
+ }
+ }
+ }
+ }
+ function inDocument(element) {
+ var p = element;
+ var doc = wrap(document);
+ while (p) {
+ if (p == doc) {
+ return true;
+ }
+ p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;
+ }
+ }
+ function watchShadow(node) {
+ if (node.shadowRoot && !node.shadowRoot.__watched) {
+ flags.dom && console.log("watching shadow-root for: ", node.localName);
+ var root = node.shadowRoot;
+ while (root) {
+ observe(root);
+ root = root.olderShadowRoot;
+ }
+ }
+ }
+ function handler(mutations) {
+ if (flags.dom) {
+ var mx = mutations[0];
+ if (mx && mx.type === "childList" && mx.addedNodes) {
+ if (mx.addedNodes) {
+ var d = mx.addedNodes[0];
+ while (d && d !== document && !d.host) {
+ d = d.parentNode;
+ }
+ var u = d && (d.URL || d._URL || d.host && d.host.localName) || "";
+ u = u.split("/?").shift().split("/").pop();
+ }
+ }
+ console.group("mutations (%d) [%s]", mutations.length, u || "");
+ }
+ mutations.forEach(function(mx) {
+ if (mx.type === "childList") {
+ forEach(mx.addedNodes, function(n) {
+ if (!n.localName) {
+ return;
+ }
+ addedNode(n);
+ });
+ forEach(mx.removedNodes, function(n) {
+ if (!n.localName) {
+ return;
+ }
+ detachedNode(n);
+ });
+ }
+ });
+ flags.dom && console.groupEnd();
+ }
+ function takeRecords(node) {
+ node = window.wrap(node);
+ if (!node) {
+ node = window.wrap(document);
+ }
+ while (node.parentNode) {
+ node = node.parentNode;
+ }
+ var observer = node.__observer;
+ if (observer) {
+ handler(observer.takeRecords());
+ takeMutations();
+ }
+ }
+ var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
+ function observe(inRoot) {
+ if (inRoot.__observer) {
+ return;
+ }
+ var observer = new MutationObserver(handler);
+ observer.observe(inRoot, {
+ childList: true,
+ subtree: true
+ });
+ inRoot.__observer = observer;
+ }
+ function upgradeDocument(doc) {
+ doc = window.wrap(doc);
+ flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
+ addedNode(doc);
+ observe(doc);
+ flags.dom && console.groupEnd();
+ }
+ function upgradeDocumentTree(doc) {
+ forDocumentTree(doc, upgradeDocument);
+ }
+ var originalCreateShadowRoot = Element.prototype.createShadowRoot;
+ if (originalCreateShadowRoot) {
+ Element.prototype.createShadowRoot = function() {
+ var root = originalCreateShadowRoot.call(this);
+ window.CustomElements.watchShadow(this);
+ return root;
+ };
+ }
+ scope.watchShadow = watchShadow;
+ scope.upgradeDocumentTree = upgradeDocumentTree;
+ scope.upgradeSubtree = addedSubtree;
+ scope.upgradeAll = addedNode;
+ scope.attachedNode = attachedNode;
+ scope.takeRecords = takeRecords;
+});
+
+window.CustomElements.addModule(function(scope) {
+ var flags = scope.flags;
+ function upgrade(node) {
+ if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
+ var is = node.getAttribute("is");
+ var definition = scope.getRegisteredDefinition(is || node.localName);
+ if (definition) {
+ if (is && definition.tag == node.localName) {
+ return upgradeWithDefinition(node, definition);
+ } else if (!is && !definition.extends) {
+ return upgradeWithDefinition(node, definition);
+ }
+ }
+ }
+ }
+ function upgradeWithDefinition(element, definition) {
+ flags.upgrade && console.group("upgrade:", element.localName);
+ if (definition.is) {
+ element.setAttribute("is", definition.is);
+ }
+ implementPrototype(element, definition);
+ element.__upgraded__ = true;
+ created(element);
+ scope.attachedNode(element);
+ scope.upgradeSubtree(element);
+ flags.upgrade && console.groupEnd();
+ return element;
+ }
+ function implementPrototype(element, definition) {
+ if (Object.__proto__) {
+ element.__proto__ = definition.prototype;
+ } else {
+ customMixin(element, definition.prototype, definition.native);
+ element.__proto__ = definition.prototype;
+ }
+ }
+ function customMixin(inTarget, inSrc, inNative) {
+ var used = {};
+ var p = inSrc;
+ while (p !== inNative && p !== HTMLElement.prototype) {
+ var keys = Object.getOwnPropertyNames(p);
+ for (var i = 0, k; k = keys[i]; i++) {
+ if (!used[k]) {
+ Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));
+ used[k] = 1;
+ }
+ }
+ p = Object.getPrototypeOf(p);
+ }
+ }
+ function created(element) {
+ if (element.createdCallback) {
+ element.createdCallback();
+ }
+ }
+ scope.upgrade = upgrade;
+ scope.upgradeWithDefinition = upgradeWithDefinition;
+ scope.implementPrototype = implementPrototype;
+});
+
+window.CustomElements.addModule(function(scope) {
+ var isIE11OrOlder = scope.isIE11OrOlder;
+ var upgradeDocumentTree = scope.upgradeDocumentTree;
+ var upgradeAll = scope.upgradeAll;
+ var upgradeWithDefinition = scope.upgradeWithDefinition;
+ var implementPrototype = scope.implementPrototype;
+ var useNative = scope.useNative;
+ function register(name, options) {
+ var definition = options || {};
+ if (!name) {
+ throw new Error("document.registerElement: first argument `name` must not be empty");
+ }
+ if (name.indexOf("-") < 0) {
+ throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'.");
+ }
+ if (isReservedTag(name)) {
+ throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid.");
+ }
+ if (getRegisteredDefinition(name)) {
+ throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered");
+ }
+ if (!definition.prototype) {
+ definition.prototype = Object.create(HTMLElement.prototype);
+ }
+ definition.__name = name.toLowerCase();
+ definition.lifecycle = definition.lifecycle || {};
+ definition.ancestry = ancestry(definition.extends);
+ resolveTagName(definition);
+ resolvePrototypeChain(definition);
+ overrideAttributeApi(definition.prototype);
+ registerDefinition(definition.__name, definition);
+ definition.ctor = generateConstructor(definition);
+ definition.ctor.prototype = definition.prototype;
+ definition.prototype.constructor = definition.ctor;
+ if (scope.ready) {
+ upgradeDocumentTree(document);
+ }
+ return definition.ctor;
+ }
+ function overrideAttributeApi(prototype) {
+ if (prototype.setAttribute._polyfilled) {
+ return;
+ }
+ var setAttribute = prototype.setAttribute;
+ prototype.setAttribute = function(name, value) {
+ changeAttribute.call(this, name, value, setAttribute);
+ };
+ var removeAttribute = prototype.removeAttribute;
+ prototype.removeAttribute = function(name) {
+ changeAttribute.call(this, name, null, removeAttribute);
+ };
+ prototype.setAttribute._polyfilled = true;
+ }
+ function changeAttribute(name, value, operation) {
+ name = name.toLowerCase();
+ var oldValue = this.getAttribute(name);
+ operation.apply(this, arguments);
+ var newValue = this.getAttribute(name);
+ if (this.attributeChangedCallback && newValue !== oldValue) {
+ this.attributeChangedCallback(name, oldValue, newValue);
+ }
+ }
+ function isReservedTag(name) {
+ for (var i = 0; i < reservedTagList.length; i++) {
+ if (name === reservedTagList[i]) {
+ return true;
+ }
+ }
+ }
+ var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ];
+ function ancestry(extnds) {
+ var extendee = getRegisteredDefinition(extnds);
+ if (extendee) {
+ return ancestry(extendee.extends).concat([ extendee ]);
+ }
+ return [];
+ }
+ function resolveTagName(definition) {
+ var baseTag = definition.extends;
+ for (var i = 0, a; a = definition.ancestry[i]; i++) {
+ baseTag = a.is && a.tag;
+ }
+ definition.tag = baseTag || definition.__name;
+ if (baseTag) {
+ definition.is = definition.__name;
+ }
+ }
+ function resolvePrototypeChain(definition) {
+ if (!Object.__proto__) {
+ var nativePrototype = HTMLElement.prototype;
+ if (definition.is) {
+ var inst = document.createElement(definition.tag);
+ var expectedPrototype = Object.getPrototypeOf(inst);
+ if (expectedPrototype === definition.prototype) {
+ nativePrototype = expectedPrototype;
+ }
+ }
+ var proto = definition.prototype, ancestor;
+ while (proto && proto !== nativePrototype) {
+ ancestor = Object.getPrototypeOf(proto);
+ proto.__proto__ = ancestor;
+ proto = ancestor;
+ }
+ definition.native = nativePrototype;
+ }
+ }
+ function instantiate(definition) {
+ return upgradeWithDefinition(domCreateElement(definition.tag), definition);
+ }
+ var registry = {};
+ function getRegisteredDefinition(name) {
+ if (name) {
+ return registry[name.toLowerCase()];
+ }
+ }
+ function registerDefinition(name, definition) {
+ registry[name] = definition;
+ }
+ function generateConstructor(definition) {
+ return function() {
+ return instantiate(definition);
+ };
+ }
+ var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
+ function createElementNS(namespace, tag, typeExtension) {
+ if (namespace === HTML_NAMESPACE) {
+ return createElement(tag, typeExtension);
+ } else {
+ return domCreateElementNS(namespace, tag);
+ }
+ }
+ function createElement(tag, typeExtension) {
+ if (tag) {
+ tag = tag.toLowerCase();
+ }
+ if (typeExtension) {
+ typeExtension = typeExtension.toLowerCase();
+ }
+ var definition = getRegisteredDefinition(typeExtension || tag);
+ if (definition) {
+ if (tag == definition.tag && typeExtension == definition.is) {
+ return new definition.ctor();
+ }
+ if (!typeExtension && !definition.is) {
+ return new definition.ctor();
+ }
+ }
+ var element;
+ if (typeExtension) {
+ element = createElement(tag);
+ element.setAttribute("is", typeExtension);
+ return element;
+ }
+ element = domCreateElement(tag);
+ if (tag.indexOf("-") >= 0) {
+ implementPrototype(element, HTMLElement);
+ }
+ return element;
+ }
+ var domCreateElement = document.createElement.bind(document);
+ var domCreateElementNS = document.createElementNS.bind(document);
+ var isInstance;
+ if (!Object.__proto__ && !useNative) {
+ isInstance = function(obj, ctor) {
+ var p = obj;
+ while (p) {
+ if (p === ctor.prototype) {
+ return true;
+ }
+ p = p.__proto__;
+ }
+ return false;
+ };
+ } else {
+ isInstance = function(obj, base) {
+ return obj instanceof base;
+ };
+ }
+ function wrapDomMethodToForceUpgrade(obj, methodName) {
+ var orig = obj[methodName];
+ obj[methodName] = function() {
+ var n = orig.apply(this, arguments);
+ upgradeAll(n);
+ return n;
+ };
+ }
+ wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
+ wrapDomMethodToForceUpgrade(document, "importNode");
+ if (isIE11OrOlder) {
+ (function() {
+ var importNode = document.importNode;
+ document.importNode = function() {
+ var n = importNode.apply(document, arguments);
+ if (n.nodeType == n.DOCUMENT_FRAGMENT_NODE) {
+ var f = document.createDocumentFragment();
+ f.appendChild(n);
+ return f;
+ } else {
+ return n;
+ }
+ };
+ })();
+ }
+ document.registerElement = register;
+ document.createElement = createElement;
+ document.createElementNS = createElementNS;
+ scope.registry = registry;
+ scope.instanceof = isInstance;
+ scope.reservedTagList = reservedTagList;
+ scope.getRegisteredDefinition = getRegisteredDefinition;
+ document.register = document.registerElement;
+});
+
+(function(scope) {
+ var useNative = scope.useNative;
+ var initializeModules = scope.initializeModules;
+ var isIE11OrOlder = /Trident/.test(navigator.userAgent);
+ if (useNative) {
+ var nop = function() {};
+ scope.watchShadow = nop;
+ scope.upgrade = nop;
+ scope.upgradeAll = nop;
+ scope.upgradeDocumentTree = nop;
+ scope.upgradeSubtree = nop;
+ scope.takeRecords = nop;
+ scope.instanceof = function(obj, base) {
+ return obj instanceof base;
+ };
+ } else {
+ initializeModules();
+ }
+ var upgradeDocumentTree = scope.upgradeDocumentTree;
+ if (!window.wrap) {
+ if (window.ShadowDOMPolyfill) {
+ window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;
+ window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;
+ } else {
+ window.wrap = window.unwrap = function(node) {
+ return node;
+ };
+ }
+ }
+ function bootstrap() {
+ upgradeDocumentTree(window.wrap(document));
+ if (window.HTMLImports) {
+ window.HTMLImports.__importsParsingHook = function(elt) {
+ upgradeDocumentTree(wrap(elt.import));
+ };
+ }
+ window.CustomElements.ready = true;
+ setTimeout(function() {
+ window.CustomElements.readyTime = Date.now();
+ if (window.HTMLImports) {
+ window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;
+ }
+ document.dispatchEvent(new CustomEvent("WebComponentsReady", {
+ bubbles: true
+ }));
+ });
+ }
+ if (isIE11OrOlder && typeof window.CustomEvent !== "function") {
+ window.CustomEvent = function(inType, params) {
+ params = params || {};
+ var e = document.createEvent("CustomEvent");
+ e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
+ e.preventDefault = function() {
+ Object.defineProperty(this, "defaultPrevented", {
+ get: function() {
+ return true;
+ }
+ });
+ };
+ return e;
+ };
+ window.CustomEvent.prototype = window.Event.prototype;
+ }
+ if (document.readyState === "complete" || scope.flags.eager) {
+ bootstrap();
+ } else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
+ bootstrap();
+ } else {
+ var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
+ window.addEventListener(loadEvent, bootstrap);
+ }
+ scope.isIE11OrOlder = isIE11OrOlder;
+})(window.CustomElements);
+
+if (typeof HTMLTemplateElement === "undefined") {
+ (function() {
+ var TEMPLATE_TAG = "template";
+ HTMLTemplateElement = function() {};
+ HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);
+ HTMLTemplateElement.decorate = function(template) {
+ if (!template.content) {
+ template.content = template.ownerDocument.createDocumentFragment();
+ }
+ var child;
+ while (child = template.firstChild) {
+ template.content.appendChild(child);
+ }
+ };
+ HTMLTemplateElement.bootstrap = function(doc) {
+ var templates = doc.querySelectorAll(TEMPLATE_TAG);
+ for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {
+ HTMLTemplateElement.decorate(t);
+ }
+ };
+ window.addEventListener("DOMContentLoaded", function() {
+ HTMLTemplateElement.bootstrap(document);
+ });
+ var createElement = document.createElement;
+ document.createElement = function() {
+ "use strict";
+ var el = createElement.apply(document, arguments);
+ if (el.localName == "template") {
+ HTMLTemplateElement.decorate(el);
+ }
+ return el;
+ };
+ })();
+}
+
+(function(scope) {
+ var style = document.createElement("style");
+ style.textContent = "" + "body {" + "transition: opacity ease-in 0.2s;" + " } \n" + "body[unresolved] {" + "opacity: 0; display: block; overflow: hidden; position: relative;" + " } \n";
+ var head = document.querySelector("head");
+ head.insertBefore(style, head.firstChild);
+})(window.WebComponents);
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/webcomponentsjs/webcomponents-lite.min.js b/dashboard-ui/bower_components/webcomponentsjs/webcomponents-lite.min.js
new file mode 100644
index 0000000000..abb6ff6700
--- /dev/null
+++ b/dashboard-ui/bower_components/webcomponentsjs/webcomponents-lite.min.js
@@ -0,0 +1,13 @@
+/**
+ * @license
+ * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+ * Code distributed by Google as part of the polymer project is also
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+ */
+// @version 0.7.5
+window.WebComponents=window.WebComponents||{},function(e){var t=e.flags||{},n="webcomponents-lite.js",r=document.querySelector('script[src*="'+n+'"]');if(!t.noOpts){if(location.search.slice(1).split("&").forEach(function(e){var n,r=e.split("=");r[0]&&(n=r[0].match(/wc-(.+)/))&&(t[n[1]]=r[1]||!0)}),r)for(var o,i=0;o=r.attributes[i];i++)"src"!==o.name&&(t[o.name]=o.value||!0);if(t.log){var a=t.log.split(",");t.log={},a.forEach(function(e){t.log[e]=!0})}else t.log={}}t.shadow=t.shadow||t.shadowdom||t.polyfill,t.shadow="native"===t.shadow?!1:t.shadow||!HTMLElement.prototype.createShadowRoot,t.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=t.register),e.flags=t}(window.WebComponents),function(e){"use strict";function t(e){return void 0!==h[e]}function n(){s.call(this),this._isInvalid=!0}function r(e){return""==e&&n.call(this),e.toLowerCase()}function o(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function i(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,96].indexOf(t)?e:encodeURIComponent(e)}function a(e,a,s){function c(e){b.push(e)}var d=a||"scheme start",u=0,l="",_=!1,w=!1,b=[];e:for(;(e[u-1]!=f||0==u)&&!this._isInvalid;){var g=e[u];switch(d){case"scheme start":if(!g||!m.test(g)){if(a){c("Invalid scheme.");break e}l="",d="no scheme";continue}l+=g.toLowerCase(),d="scheme";break;case"scheme":if(g&&v.test(g))l+=g.toLowerCase();else{if(":"!=g){if(a){if(f==g)break e;c("Code point not allowed in scheme: "+g);break e}l="",u=0,d="no scheme";continue}if(this._scheme=l,l="",a)break e;t(this._scheme)&&(this._isRelative=!0),d="file"==this._scheme?"relative":this._isRelative&&s&&s._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==g?(this._query="?",d="query"):"#"==g?(this._fragment="#",d="fragment"):f!=g&&" "!=g&&"\n"!=g&&"\r"!=g&&(this._schemeData+=o(g));break;case"no scheme":if(s&&t(s._scheme)){d="relative";continue}c("Missing scheme."),n.call(this);break;case"relative or authority":if("/"!=g||"/"!=e[u+1]){c("Expected /, got: "+g),d="relative";continue}d="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=s._scheme),f==g){this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._username=s._username,this._password=s._password;break e}if("/"==g||"\\"==g)"\\"==g&&c("\\ is an invalid code point."),d="relative slash";else if("?"==g)this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query="?",this._username=s._username,this._password=s._password,d="query";else{if("#"!=g){var y=e[u+1],E=e[u+2];("file"!=this._scheme||!m.test(g)||":"!=y&&"|"!=y||f!=E&&"/"!=E&&"\\"!=E&&"?"!=E&&"#"!=E)&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password,this._path=s._path.slice(),this._path.pop()),d="relative path";continue}this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._fragment="#",this._username=s._username,this._password=s._password,d="fragment"}break;case"relative slash":if("/"!=g&&"\\"!=g){"file"!=this._scheme&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password),d="relative path";continue}"\\"==g&&c("\\ is an invalid code point."),d="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=g){c("Expected '/', got: "+g),d="authority ignore slashes";continue}d="authority second slash";break;case"authority second slash":if(d="authority ignore slashes","/"!=g){c("Expected '/', got: "+g);continue}break;case"authority ignore slashes":if("/"!=g&&"\\"!=g){d="authority";continue}c("Expected authority, got: "+g);break;case"authority":if("@"==g){_&&(c("@ already seen."),l+="%40"),_=!0;for(var L=0;L>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],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,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){g.push(e),b||(b=!0,m(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){b=!1;var e=g;g=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=v.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=p(o,e);if(i)return void(n[r-1]=i)}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;np&&(h=s[p]);p++)a(h)?(c++,n()):(h.addEventListener("load",r),h.addEventListener("error",i));else n()}function a(e){return l?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)c(t)&&d(t)}function c(e){return"link"===e.localName&&"import"===e.rel}function d(e){var t=e["import"];t?o({target:e}):(e.addEventListener("load",o),e.addEventListener("error",o))}var u="import",l=Boolean(u in document.createElement("link")),h=Boolean(window.ShadowDOMPolyfill),p=function(e){return h?window.ShadowDOMPolyfill.wrapIfNeeded(e):e},f=p(document),m={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return p(e)},configurable:!0};Object.defineProperty(document,"_currentScript",m),Object.defineProperty(f,"_currentScript",m);var v=/Trident/.test(navigator.userAgent),_=v?"complete":"interactive",w="readystatechange";l&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,r=t.length;r>n&&(e=t[n]);n++)d(e)}()),t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=f.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),f.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=u,e.useNative=l,e.rootDocument=f,e.whenReady=t,e.isIE=v}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},r=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=r}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,r={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,r=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,r),e},resolveUrlsInCssText:function(e,r,o){var i=this.replaceUrls(e,o,r,t);return i=this.replaceUrls(i,o,r,n)},replaceUrls:function(e,t,n,r){return e.replace(r,function(e,r,o,i){var a=o.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,r+"'"+a+"'"+i})}};e.path=r}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,r,o){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var n=i.getResponseHeader("Location"),a=null;if(n)var a="/"===n.substr(0,1)?location.origin+n:n;r.call(o,!t.ok(i)&&i,i.response||i.responseText,a)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,r=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};r.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;r>n&&(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){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,r){if(n.load&&console.log("fetch",e,r),e)if(e.match(/^data:/)){var o=e.split(","),i=o[0],a=o[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,r,null,a)}.bind(this),0)}else{var s=function(t,n,o){this.receive(e,r,t,n,o)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,r,{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;c>s&&(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=r}),window.HTMLImports.addModule(function(e){var t=function(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;r>n&&(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;r>n&&(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(e){function t(e){return"link"===e.localName&&e.rel===u}function n(e){var t=r(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function r(e){return e.textContent+o(e)}function o(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,r=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+r+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,c=e.flags,d=e.isIE,u=e.IMPORT_LINK_TYPE,l="link[rel="+u+"]",h={documentSelectors:l,importsSelectors:[l,"link[rel=stylesheet]","style","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){if(this.isParsed(e))return void(c.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){c.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,c.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.dispatchEvent(e.__resource&&!e.__error?new CustomEvent("load",{bubbles:!1}):new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,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(e,t){var n=this,r=function(r){t&&t(r),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",r),e.addEventListener("error",r),d&&"style"===e.localName){var o=!1;if(-1==e.textContent.indexOf("@import"))o=!0;else if(e.sheet){o=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,c=0;s>c&&(i=a[c]);c++)i.type===CSSRule.IMPORT_RULE&&(o=o&&Boolean(i.styleSheet))}o&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var r=document.createElement("script");r.__importElement=t,r.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(r,function(t){r.parentNode.removeChild(r),e.currentScript=null}),this.addElementToDocument(r)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var r,o=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=o.length;a>i&&(r=o[i]);i++)if(!this.isParsed(r))return this.hasResource(r)?t(r)?this.nextToParseInDoc(r["import"],r):r:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return t(e)&&void 0===e["import"]?!1:!0}};e.parser=h,e.IMPORT_SELECTOR=l}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function o(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var o=n.createElement("base");o.setAttribute("href",t),n.baseURI||r(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(o),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,c=e.rootDocument,d=e.Loader,u=e.Observer,l=e.parser,h={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){p.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);p.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===c?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,r,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=r,n.__error=a,t(n)){var c=this.documents[e];void 0===c&&(c=a?null:o(r,s||e),c&&(c.__importLink=n,this.bootDocument(c)),this.documents[e]=c),n["import"]=c}l.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),l.parseNext()},loadedAll:function(){l.parseNext()}},p=new d(h.loaded.bind(h),h.loadedAll.bind(h));if(h.observer=new u,!document.baseURI){var f={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",f),Object.defineProperty(c,"baseURI",f)}e.importer=h,e.importLoader=p}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,r={added:function(e){for(var r,o,i,a,s=0,c=e.length;c>s&&(a=e[s]);s++)r||(r=a.ownerDocument,o=t.isParsed(r)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&o&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&o.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&o.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=r.added.bind(r);var o=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){window.HTMLImports.importer.bootDocument(o)}var n=e.initializeModules,r=e.isIE;if(!e.useNative){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.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),n();var o=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[],r=function(e){n.push(e)},o=function(){n.forEach(function(t){t(e)})};e.addModule=r,e.initializeModules=o,e.hasNative=Boolean(document.registerElement),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function t(e,t){n(e,function(e){return t(e)?!0:void r(e,t)}),r(e,t)}function n(e,t,r){var o=e.firstElementChild;if(!o)for(o=e.firstChild;o&&o.nodeType!==Node.ELEMENT_NODE;)o=o.nextSibling;for(;o;)t(o,r)!==!0&&n(o,t,r),o=o.nextElementSibling;return null}function r(e,n){for(var r=e.shadowRoot;r;)t(r,n),r=r.olderShadowRoot}function o(e,t){i(e,t,[])}function i(e,t,n){if(e=window.wrap(e),!(n.indexOf(e)>=0)){n.push(e);for(var r,o=e.querySelectorAll("link[rel="+a+"]"),s=0,c=o.length;c>s&&(r=o[s]);s++)r["import"]&&i(r["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=o,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e){return n(e)||r(e)}function n(t){return e.upgrade(t)?!0:void s(t)}function r(e){g(e,function(e){return n(e)?!0:void 0})}function o(e){s(e),h(e)&&g(e,function(e){s(e)})}function i(e){M.push(e),L||(L=!0,setTimeout(a))}function a(){L=!1;for(var e,t=M,n=0,r=t.length;r>n&&(e=t[n]);n++)e();M=[]}function s(e){E?i(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&!e.__attached&&h(e)&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function d(e){u(e),g(e,function(e){u(e)})}function u(e){E?i(function(){l(e)}):l(e)}function l(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&e.__attached&&!h(e)&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function h(e){for(var t=e,n=wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function p(e){if(e.shadowRoot&&!e.shadowRoot.__watched){b.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)v(t),t=t.olderShadowRoot}}function f(e){if(b.dom){var n=e[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=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";o=o.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,o||"")}e.forEach(function(e){"childList"===e.type&&(T(e.addedNodes,function(e){e.localName&&t(e)}),T(e.removedNodes,function(e){e.localName&&d(e)}))}),b.dom&&console.groupEnd()}function m(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(f(t.takeRecords()),a())}function v(e){if(!e.__observer){var t=new MutationObserver(f);t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function _(e){e=window.wrap(e),b.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop()),t(e),v(e),b.dom&&console.groupEnd()}function w(e){y(e,_)}var b=e.flags,g=e.forSubtree,y=e.forDocumentTree,E=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;e.hasPolyfillMutations=E;var L=!1,M=[],T=Array.prototype.forEach.call.bind(Array.prototype.forEach),N=Element.prototype.createShadowRoot;N&&(Element.prototype.createShadowRoot=function(){var e=N.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=p,e.upgradeDocumentTree=w,e.upgradeSubtree=r,e.upgradeAll=t,e.attachedNode=o,e.takeRecords=m}),window.CustomElements.addModule(function(e){function t(t){if(!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var r=t.getAttribute("is"),o=e.getRegisteredDefinition(r||t.localName);if(o){if(r&&o.tag==t.localName)return n(t,o);if(!r&&!o["extends"])return n(t,o)}}}function n(t,n){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),r(t,n),t.__upgraded__=!0,i(t),e.attachedNode(t),e.upgradeSubtree(t),a.upgrade&&console.groupEnd(),t}function r(e,t){Object.__proto__?e.__proto__=t.prototype:(o(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function o(e,t,n){for(var r={},o=t;o!==n&&o!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(o),s=0;i=a[s];s++)r[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(o,i)),r[i]=1);o=Object.getPrototypeOf(o)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=r}),window.CustomElements.addModule(function(e){function t(t,r){var c=r||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(o(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(d(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return c.prototype||(c.prototype=Object.create(HTMLElement.prototype)),c.__name=t.toLowerCase(),c.lifecycle=c.lifecycle||{},c.ancestry=i(c["extends"]),a(c),s(c),n(c.prototype),u(c.__name,c),c.ctor=l(c),c.ctor.prototype=c.prototype,c.prototype.constructor=c.ctor,e.ready&&_(document),c.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){r.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){r.call(this,e,null,n);
+
+},e.setAttribute._polyfilled=!0}}function r(e,t,n){e=e.toLowerCase();var r=this.getAttribute(e);n.apply(this,arguments);var o=this.getAttribute(e);this.attributeChangedCallback&&o!==r&&this.attributeChangedCallback(e,r,o)}function o(e){for(var t=0;t=0&&g(r,HTMLElement),r)}function f(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return w(e),e}}var m,v=e.isIE11OrOlder,_=e.upgradeDocumentTree,w=e.upgradeAll,b=e.upgradeWithDefinition,g=e.implementPrototype,y=e.useNative,E=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],L={},M="http://www.w3.org/1999/xhtml",T=document.createElement.bind(document),N=document.createElementNS.bind(document);m=Object.__proto__||y?function(e,t){return e instanceof t}:function(e,t){for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},f(Node.prototype,"cloneNode"),f(document,"importNode"),v&&!function(){var e=document.importNode;document.importNode=function(){var t=e.apply(document,arguments);if(t.nodeType==t.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(t),n}return t}}(),document.registerElement=t,document.createElement=p,document.createElementNS=h,e.registry=L,e["instanceof"]=m,e.reservedTagList=E,e.getRegisteredDefinition=d,document.register=document.registerElement}),function(e){function t(){a(window.wrap(document)),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){a(wrap(e["import"]))}),window.CustomElements.ready=!0,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=/Trident/.test(navigator.userAgent);if(n){var i=function(){};e.watchShadow=i,e.upgrade=i,e.upgradeAll=i,e.upgradeDocumentTree=i,e.upgradeSubtree=i,e.takeRecords=i,e["instanceof"]=function(e,t){return e instanceof t}}else r();var a=e.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),o&&"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.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var s=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(s,t)}else t();e.isIE11OrOlder=o}(window.CustomElements),"undefined"==typeof HTMLTemplateElement&&!function(){var e="template";HTMLTemplateElement=function(){},HTMLTemplateElement.prototype=Object.create(HTMLElement.prototype),HTMLTemplateElement.decorate=function(e){e.content||(e.content=e.ownerDocument.createDocumentFragment());for(var t;t=e.firstChild;)e.content.appendChild(t)},HTMLTemplateElement.bootstrap=function(t){for(var n,r=t.querySelectorAll(e),o=0,i=r.length;i>o&&(n=r[o]);o++)HTMLTemplateElement.decorate(n)},window.addEventListener("DOMContentLoaded",function(){HTMLTemplateElement.bootstrap(document)});var t=document.createElement;document.createElement=function(){"use strict";var e=t.apply(document,arguments);return"template"==e.localName&&HTMLTemplateElement.decorate(e),e}}(),function(e){var t=document.createElement("style");t.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var n=document.querySelector("head");n.insertBefore(t,n.firstChild)}(window.WebComponents);
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/webcomponentsjs/webcomponents.js b/dashboard-ui/bower_components/webcomponentsjs/webcomponents.js
new file mode 100644
index 0000000000..6d7154174e
--- /dev/null
+++ b/dashboard-ui/bower_components/webcomponentsjs/webcomponents.js
@@ -0,0 +1,7126 @@
+/**
+ * @license
+ * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+ * Code distributed by Google as part of the polymer project is also
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+ */
+// @version 0.7.5
+window.WebComponents = window.WebComponents || {};
+
+(function(scope) {
+ var flags = scope.flags || {};
+ var file = "webcomponents.js";
+ var script = document.querySelector('script[src*="' + file + '"]');
+ if (!flags.noOpts) {
+ location.search.slice(1).split("&").forEach(function(option) {
+ var parts = option.split("=");
+ var match;
+ if (parts[0] && (match = parts[0].match(/wc-(.+)/))) {
+ flags[match[1]] = parts[1] || true;
+ }
+ });
+ if (script) {
+ for (var i = 0, a; a = script.attributes[i]; i++) {
+ if (a.name !== "src") {
+ flags[a.name] = a.value || true;
+ }
+ }
+ }
+ if (flags.log && flags.log.split) {
+ var parts = flags.log.split(",");
+ flags.log = {};
+ parts.forEach(function(f) {
+ flags.log[f] = true;
+ });
+ } else {
+ flags.log = {};
+ }
+ }
+ flags.shadow = flags.shadow || flags.shadowdom || flags.polyfill;
+ if (flags.shadow === "native") {
+ flags.shadow = false;
+ } else {
+ flags.shadow = flags.shadow || !HTMLElement.prototype.createShadowRoot;
+ }
+ if (flags.register) {
+ window.CustomElements = window.CustomElements || {
+ flags: {}
+ };
+ window.CustomElements.flags.register = flags.register;
+ }
+ scope.flags = flags;
+})(WebComponents);
+
+if (WebComponents.flags.shadow) {
+ if (typeof WeakMap === "undefined") {
+ (function() {
+ var defineProperty = Object.defineProperty;
+ var counter = Date.now() % 1e9;
+ var WeakMap = function() {
+ this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
+ };
+ WeakMap.prototype = {
+ set: function(key, value) {
+ var entry = key[this.name];
+ if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
+ value: [ key, value ],
+ writable: true
+ });
+ return this;
+ },
+ get: function(key) {
+ var entry;
+ return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
+ },
+ "delete": function(key) {
+ var entry = key[this.name];
+ if (!entry || entry[0] !== key) return false;
+ entry[0] = entry[1] = undefined;
+ return true;
+ },
+ has: function(key) {
+ var entry = key[this.name];
+ if (!entry) return false;
+ return entry[0] === key;
+ }
+ };
+ window.WeakMap = WeakMap;
+ })();
+ }
+ window.ShadowDOMPolyfill = {};
+ (function(scope) {
+ "use strict";
+ var constructorTable = new WeakMap();
+ var nativePrototypeTable = new WeakMap();
+ var wrappers = Object.create(null);
+ function detectEval() {
+ if (typeof chrome !== "undefined" && chrome.app && chrome.app.runtime) {
+ return false;
+ }
+ if (navigator.getDeviceStorage) {
+ return false;
+ }
+ try {
+ var f = new Function("return true;");
+ return f();
+ } catch (ex) {
+ return false;
+ }
+ }
+ var hasEval = detectEval();
+ function assert(b) {
+ if (!b) throw new Error("Assertion failed");
+ }
+ var defineProperty = Object.defineProperty;
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
+ function mixin(to, from) {
+ var names = getOwnPropertyNames(from);
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
+ defineProperty(to, name, getOwnPropertyDescriptor(from, name));
+ }
+ return to;
+ }
+ function mixinStatics(to, from) {
+ var names = getOwnPropertyNames(from);
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
+ switch (name) {
+ case "arguments":
+ case "caller":
+ case "length":
+ case "name":
+ case "prototype":
+ case "toString":
+ continue;
+ }
+ defineProperty(to, name, getOwnPropertyDescriptor(from, name));
+ }
+ return to;
+ }
+ function oneOf(object, propertyNames) {
+ for (var i = 0; i < propertyNames.length; i++) {
+ if (propertyNames[i] in object) return propertyNames[i];
+ }
+ }
+ var nonEnumerableDataDescriptor = {
+ value: undefined,
+ configurable: true,
+ enumerable: false,
+ writable: true
+ };
+ function defineNonEnumerableDataProperty(object, name, value) {
+ nonEnumerableDataDescriptor.value = value;
+ defineProperty(object, name, nonEnumerableDataDescriptor);
+ }
+ getOwnPropertyNames(window);
+ function getWrapperConstructor(node, opt_instance) {
+ var nativePrototype = node.__proto__ || Object.getPrototypeOf(node);
+ if (isFirefox) {
+ try {
+ getOwnPropertyNames(nativePrototype);
+ } catch (error) {
+ nativePrototype = nativePrototype.__proto__;
+ }
+ }
+ var wrapperConstructor = constructorTable.get(nativePrototype);
+ if (wrapperConstructor) return wrapperConstructor;
+ var parentWrapperConstructor = getWrapperConstructor(nativePrototype);
+ var GeneratedWrapper = createWrapperConstructor(parentWrapperConstructor);
+ registerInternal(nativePrototype, GeneratedWrapper, opt_instance);
+ return GeneratedWrapper;
+ }
+ function addForwardingProperties(nativePrototype, wrapperPrototype) {
+ installProperty(nativePrototype, wrapperPrototype, true);
+ }
+ function registerInstanceProperties(wrapperPrototype, instanceObject) {
+ installProperty(instanceObject, wrapperPrototype, false);
+ }
+ var isFirefox = /Firefox/.test(navigator.userAgent);
+ var dummyDescriptor = {
+ get: function() {},
+ set: function(v) {},
+ configurable: true,
+ enumerable: true
+ };
+ function isEventHandlerName(name) {
+ return /^on[a-z]+$/.test(name);
+ }
+ function isIdentifierName(name) {
+ return /^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(name);
+ }
+ function getGetter(name) {
+ return hasEval && isIdentifierName(name) ? new Function("return this.__impl4cf1e782hg__." + name) : function() {
+ return this.__impl4cf1e782hg__[name];
+ };
+ }
+ function getSetter(name) {
+ return hasEval && isIdentifierName(name) ? new Function("v", "this.__impl4cf1e782hg__." + name + " = v") : function(v) {
+ this.__impl4cf1e782hg__[name] = v;
+ };
+ }
+ function getMethod(name) {
+ return hasEval && isIdentifierName(name) ? new Function("return this.__impl4cf1e782hg__." + name + ".apply(this.__impl4cf1e782hg__, arguments)") : function() {
+ return this.__impl4cf1e782hg__[name].apply(this.__impl4cf1e782hg__, arguments);
+ };
+ }
+ function getDescriptor(source, name) {
+ try {
+ return Object.getOwnPropertyDescriptor(source, name);
+ } catch (ex) {
+ return dummyDescriptor;
+ }
+ }
+ var isBrokenSafari = function() {
+ var descr = Object.getOwnPropertyDescriptor(Node.prototype, "nodeType");
+ return descr && !descr.get && !descr.set;
+ }();
+ function installProperty(source, target, allowMethod, opt_blacklist) {
+ var names = getOwnPropertyNames(source);
+ for (var i = 0; i < names.length; i++) {
+ var name = names[i];
+ if (name === "polymerBlackList_") continue;
+ if (name in target) continue;
+ if (source.polymerBlackList_ && source.polymerBlackList_[name]) continue;
+ if (isFirefox) {
+ source.__lookupGetter__(name);
+ }
+ var descriptor = getDescriptor(source, name);
+ var getter, setter;
+ if (typeof descriptor.value === "function") {
+ if (allowMethod) {
+ target[name] = getMethod(name);
+ }
+ continue;
+ }
+ var isEvent = isEventHandlerName(name);
+ if (isEvent) getter = scope.getEventHandlerGetter(name); else getter = getGetter(name);
+ if (descriptor.writable || descriptor.set || isBrokenSafari) {
+ if (isEvent) setter = scope.getEventHandlerSetter(name); else setter = getSetter(name);
+ }
+ var configurable = isBrokenSafari || descriptor.configurable;
+ defineProperty(target, name, {
+ get: getter,
+ set: setter,
+ configurable: configurable,
+ enumerable: descriptor.enumerable
+ });
+ }
+ }
+ function register(nativeConstructor, wrapperConstructor, opt_instance) {
+ if (nativeConstructor == null) {
+ return;
+ }
+ var nativePrototype = nativeConstructor.prototype;
+ registerInternal(nativePrototype, wrapperConstructor, opt_instance);
+ mixinStatics(wrapperConstructor, nativeConstructor);
+ }
+ function registerInternal(nativePrototype, wrapperConstructor, opt_instance) {
+ var wrapperPrototype = wrapperConstructor.prototype;
+ assert(constructorTable.get(nativePrototype) === undefined);
+ constructorTable.set(nativePrototype, wrapperConstructor);
+ nativePrototypeTable.set(wrapperPrototype, nativePrototype);
+ addForwardingProperties(nativePrototype, wrapperPrototype);
+ if (opt_instance) registerInstanceProperties(wrapperPrototype, opt_instance);
+ defineNonEnumerableDataProperty(wrapperPrototype, "constructor", wrapperConstructor);
+ wrapperConstructor.prototype = wrapperPrototype;
+ }
+ function isWrapperFor(wrapperConstructor, nativeConstructor) {
+ return constructorTable.get(nativeConstructor.prototype) === wrapperConstructor;
+ }
+ function registerObject(object) {
+ var nativePrototype = Object.getPrototypeOf(object);
+ var superWrapperConstructor = getWrapperConstructor(nativePrototype);
+ var GeneratedWrapper = createWrapperConstructor(superWrapperConstructor);
+ registerInternal(nativePrototype, GeneratedWrapper, object);
+ return GeneratedWrapper;
+ }
+ function createWrapperConstructor(superWrapperConstructor) {
+ function GeneratedWrapper(node) {
+ superWrapperConstructor.call(this, node);
+ }
+ var p = Object.create(superWrapperConstructor.prototype);
+ p.constructor = GeneratedWrapper;
+ GeneratedWrapper.prototype = p;
+ return GeneratedWrapper;
+ }
+ function isWrapper(object) {
+ return object && object.__impl4cf1e782hg__;
+ }
+ function isNative(object) {
+ return !isWrapper(object);
+ }
+ function wrap(impl) {
+ if (impl === null) return null;
+ assert(isNative(impl));
+ var wrapper = impl.__wrapper8e3dd93a60__;
+ if (wrapper != null) {
+ return wrapper;
+ }
+ return impl.__wrapper8e3dd93a60__ = new (getWrapperConstructor(impl, impl))(impl);
+ }
+ function unwrap(wrapper) {
+ if (wrapper === null) return null;
+ assert(isWrapper(wrapper));
+ return wrapper.__impl4cf1e782hg__;
+ }
+ function unsafeUnwrap(wrapper) {
+ return wrapper.__impl4cf1e782hg__;
+ }
+ function setWrapper(impl, wrapper) {
+ wrapper.__impl4cf1e782hg__ = impl;
+ impl.__wrapper8e3dd93a60__ = wrapper;
+ }
+ function unwrapIfNeeded(object) {
+ return object && isWrapper(object) ? unwrap(object) : object;
+ }
+ function wrapIfNeeded(object) {
+ return object && !isWrapper(object) ? wrap(object) : object;
+ }
+ function rewrap(node, wrapper) {
+ if (wrapper === null) return;
+ assert(isNative(node));
+ assert(wrapper === undefined || isWrapper(wrapper));
+ node.__wrapper8e3dd93a60__ = wrapper;
+ }
+ var getterDescriptor = {
+ get: undefined,
+ configurable: true,
+ enumerable: true
+ };
+ function defineGetter(constructor, name, getter) {
+ getterDescriptor.get = getter;
+ defineProperty(constructor.prototype, name, getterDescriptor);
+ }
+ function defineWrapGetter(constructor, name) {
+ defineGetter(constructor, name, function() {
+ return wrap(this.__impl4cf1e782hg__[name]);
+ });
+ }
+ function forwardMethodsToWrapper(constructors, names) {
+ constructors.forEach(function(constructor) {
+ names.forEach(function(name) {
+ constructor.prototype[name] = function() {
+ var w = wrapIfNeeded(this);
+ return w[name].apply(w, arguments);
+ };
+ });
+ });
+ }
+ scope.assert = assert;
+ scope.constructorTable = constructorTable;
+ scope.defineGetter = defineGetter;
+ scope.defineWrapGetter = defineWrapGetter;
+ scope.forwardMethodsToWrapper = forwardMethodsToWrapper;
+ scope.isIdentifierName = isIdentifierName;
+ scope.isWrapper = isWrapper;
+ scope.isWrapperFor = isWrapperFor;
+ scope.mixin = mixin;
+ scope.nativePrototypeTable = nativePrototypeTable;
+ scope.oneOf = oneOf;
+ scope.registerObject = registerObject;
+ scope.registerWrapper = register;
+ scope.rewrap = rewrap;
+ scope.setWrapper = setWrapper;
+ scope.unsafeUnwrap = unsafeUnwrap;
+ scope.unwrap = unwrap;
+ scope.unwrapIfNeeded = unwrapIfNeeded;
+ scope.wrap = wrap;
+ scope.wrapIfNeeded = wrapIfNeeded;
+ scope.wrappers = wrappers;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ function newSplice(index, removed, addedCount) {
+ return {
+ index: index,
+ removed: removed,
+ addedCount: addedCount
+ };
+ }
+ var EDIT_LEAVE = 0;
+ var EDIT_UPDATE = 1;
+ var EDIT_ADD = 2;
+ var EDIT_DELETE = 3;
+ function ArraySplice() {}
+ ArraySplice.prototype = {
+ calcEditDistances: function(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+ var rowCount = oldEnd - oldStart + 1;
+ var columnCount = currentEnd - currentStart + 1;
+ var distances = new Array(rowCount);
+ for (var i = 0; i < rowCount; i++) {
+ distances[i] = new Array(columnCount);
+ distances[i][0] = i;
+ }
+ for (var j = 0; j < columnCount; j++) distances[0][j] = j;
+ for (var i = 1; i < rowCount; i++) {
+ for (var j = 1; j < columnCount; j++) {
+ if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1])) distances[i][j] = distances[i - 1][j - 1]; else {
+ var north = distances[i - 1][j] + 1;
+ var west = distances[i][j - 1] + 1;
+ distances[i][j] = north < west ? north : west;
+ }
+ }
+ }
+ return distances;
+ },
+ spliceOperationsFromEditDistances: function(distances) {
+ var i = distances.length - 1;
+ var j = distances[0].length - 1;
+ var current = distances[i][j];
+ var edits = [];
+ while (i > 0 || j > 0) {
+ if (i == 0) {
+ edits.push(EDIT_ADD);
+ j--;
+ continue;
+ }
+ if (j == 0) {
+ edits.push(EDIT_DELETE);
+ i--;
+ continue;
+ }
+ var northWest = distances[i - 1][j - 1];
+ var west = distances[i - 1][j];
+ var north = distances[i][j - 1];
+ var min;
+ if (west < north) min = west < northWest ? west : northWest; else min = north < northWest ? north : northWest;
+ if (min == northWest) {
+ if (northWest == current) {
+ edits.push(EDIT_LEAVE);
+ } else {
+ edits.push(EDIT_UPDATE);
+ current = northWest;
+ }
+ i--;
+ j--;
+ } else if (min == west) {
+ edits.push(EDIT_DELETE);
+ i--;
+ current = west;
+ } else {
+ edits.push(EDIT_ADD);
+ j--;
+ current = north;
+ }
+ }
+ edits.reverse();
+ return edits;
+ },
+ calcSplices: function(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+ var prefixCount = 0;
+ var suffixCount = 0;
+ var minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);
+ if (currentStart == 0 && oldStart == 0) prefixCount = this.sharedPrefix(current, old, minLength);
+ if (currentEnd == current.length && oldEnd == old.length) suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);
+ currentStart += prefixCount;
+ oldStart += prefixCount;
+ currentEnd -= suffixCount;
+ oldEnd -= suffixCount;
+ if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0) return [];
+ if (currentStart == currentEnd) {
+ var splice = newSplice(currentStart, [], 0);
+ while (oldStart < oldEnd) splice.removed.push(old[oldStart++]);
+ return [ splice ];
+ } else if (oldStart == oldEnd) return [ newSplice(currentStart, [], currentEnd - currentStart) ];
+ var ops = this.spliceOperationsFromEditDistances(this.calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));
+ var splice = undefined;
+ var splices = [];
+ var index = currentStart;
+ var oldIndex = oldStart;
+ for (var i = 0; i < ops.length; i++) {
+ switch (ops[i]) {
+ case EDIT_LEAVE:
+ if (splice) {
+ splices.push(splice);
+ splice = undefined;
+ }
+ index++;
+ oldIndex++;
+ break;
+
+ case EDIT_UPDATE:
+ if (!splice) splice = newSplice(index, [], 0);
+ splice.addedCount++;
+ index++;
+ splice.removed.push(old[oldIndex]);
+ oldIndex++;
+ break;
+
+ case EDIT_ADD:
+ if (!splice) splice = newSplice(index, [], 0);
+ splice.addedCount++;
+ index++;
+ break;
+
+ case EDIT_DELETE:
+ if (!splice) splice = newSplice(index, [], 0);
+ splice.removed.push(old[oldIndex]);
+ oldIndex++;
+ break;
+ }
+ }
+ if (splice) {
+ splices.push(splice);
+ }
+ return splices;
+ },
+ sharedPrefix: function(current, old, searchLength) {
+ for (var i = 0; i < searchLength; i++) if (!this.equals(current[i], old[i])) return i;
+ return searchLength;
+ },
+ sharedSuffix: function(current, old, searchLength) {
+ var index1 = current.length;
+ var index2 = old.length;
+ var count = 0;
+ while (count < searchLength && this.equals(current[--index1], old[--index2])) count++;
+ return count;
+ },
+ calculateSplices: function(current, previous) {
+ return this.calcSplices(current, 0, current.length, previous, 0, previous.length);
+ },
+ equals: function(currentValue, previousValue) {
+ return currentValue === previousValue;
+ }
+ };
+ scope.ArraySplice = ArraySplice;
+ })(window.ShadowDOMPolyfill);
+ (function(context) {
+ "use strict";
+ var OriginalMutationObserver = window.MutationObserver;
+ var callbacks = [];
+ var pending = false;
+ var timerFunc;
+ function handle() {
+ pending = false;
+ var copies = callbacks.slice(0);
+ callbacks = [];
+ for (var i = 0; i < copies.length; i++) {
+ (0, copies[i])();
+ }
+ }
+ if (OriginalMutationObserver) {
+ var counter = 1;
+ var observer = new OriginalMutationObserver(handle);
+ var textNode = document.createTextNode(counter);
+ observer.observe(textNode, {
+ characterData: true
+ });
+ timerFunc = function() {
+ counter = (counter + 1) % 2;
+ textNode.data = counter;
+ };
+ } else {
+ timerFunc = window.setTimeout;
+ }
+ function setEndOfMicrotask(func) {
+ callbacks.push(func);
+ if (pending) return;
+ pending = true;
+ timerFunc(handle, 0);
+ }
+ context.setEndOfMicrotask = setEndOfMicrotask;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var setEndOfMicrotask = scope.setEndOfMicrotask;
+ var wrapIfNeeded = scope.wrapIfNeeded;
+ var wrappers = scope.wrappers;
+ var registrationsTable = new WeakMap();
+ var globalMutationObservers = [];
+ var isScheduled = false;
+ function scheduleCallback(observer) {
+ if (observer.scheduled_) return;
+ observer.scheduled_ = true;
+ globalMutationObservers.push(observer);
+ if (isScheduled) return;
+ setEndOfMicrotask(notifyObservers);
+ isScheduled = true;
+ }
+ function notifyObservers() {
+ isScheduled = false;
+ while (globalMutationObservers.length) {
+ var notifyList = globalMutationObservers;
+ globalMutationObservers = [];
+ notifyList.sort(function(x, y) {
+ return x.uid_ - y.uid_;
+ });
+ for (var i = 0; i < notifyList.length; i++) {
+ var mo = notifyList[i];
+ mo.scheduled_ = false;
+ var queue = mo.takeRecords();
+ removeTransientObserversFor(mo);
+ if (queue.length) {
+ mo.callback_(queue, mo);
+ }
+ }
+ }
+ }
+ function MutationRecord(type, target) {
+ this.type = type;
+ this.target = target;
+ this.addedNodes = new wrappers.NodeList();
+ this.removedNodes = new wrappers.NodeList();
+ this.previousSibling = null;
+ this.nextSibling = null;
+ this.attributeName = null;
+ this.attributeNamespace = null;
+ this.oldValue = null;
+ }
+ function registerTransientObservers(ancestor, node) {
+ for (;ancestor; ancestor = ancestor.parentNode) {
+ var registrations = registrationsTable.get(ancestor);
+ if (!registrations) continue;
+ for (var i = 0; i < registrations.length; i++) {
+ var registration = registrations[i];
+ if (registration.options.subtree) registration.addTransientObserver(node);
+ }
+ }
+ }
+ function removeTransientObserversFor(observer) {
+ for (var i = 0; i < observer.nodes_.length; i++) {
+ var node = observer.nodes_[i];
+ var registrations = registrationsTable.get(node);
+ if (!registrations) return;
+ for (var j = 0; j < registrations.length; j++) {
+ var registration = registrations[j];
+ if (registration.observer === observer) registration.removeTransientObservers();
+ }
+ }
+ }
+ function enqueueMutation(target, type, data) {
+ var interestedObservers = Object.create(null);
+ var associatedStrings = Object.create(null);
+ for (var node = target; node; node = node.parentNode) {
+ var registrations = registrationsTable.get(node);
+ if (!registrations) continue;
+ for (var j = 0; j < registrations.length; j++) {
+ var registration = registrations[j];
+ var options = registration.options;
+ if (node !== target && !options.subtree) continue;
+ if (type === "attributes" && !options.attributes) continue;
+ if (type === "attributes" && options.attributeFilter && (data.namespace !== null || options.attributeFilter.indexOf(data.name) === -1)) {
+ continue;
+ }
+ if (type === "characterData" && !options.characterData) continue;
+ if (type === "childList" && !options.childList) continue;
+ var observer = registration.observer;
+ interestedObservers[observer.uid_] = observer;
+ if (type === "attributes" && options.attributeOldValue || type === "characterData" && options.characterDataOldValue) {
+ associatedStrings[observer.uid_] = data.oldValue;
+ }
+ }
+ }
+ for (var uid in interestedObservers) {
+ var observer = interestedObservers[uid];
+ var record = new MutationRecord(type, target);
+ if ("name" in data && "namespace" in data) {
+ record.attributeName = data.name;
+ record.attributeNamespace = data.namespace;
+ }
+ if (data.addedNodes) record.addedNodes = data.addedNodes;
+ if (data.removedNodes) record.removedNodes = data.removedNodes;
+ if (data.previousSibling) record.previousSibling = data.previousSibling;
+ if (data.nextSibling) record.nextSibling = data.nextSibling;
+ if (associatedStrings[uid] !== undefined) record.oldValue = associatedStrings[uid];
+ scheduleCallback(observer);
+ observer.records_.push(record);
+ }
+ }
+ var slice = Array.prototype.slice;
+ function MutationObserverOptions(options) {
+ this.childList = !!options.childList;
+ this.subtree = !!options.subtree;
+ if (!("attributes" in options) && ("attributeOldValue" in options || "attributeFilter" in options)) {
+ this.attributes = true;
+ } else {
+ this.attributes = !!options.attributes;
+ }
+ if ("characterDataOldValue" in options && !("characterData" in options)) this.characterData = true; else this.characterData = !!options.characterData;
+ if (!this.attributes && (options.attributeOldValue || "attributeFilter" in options) || !this.characterData && options.characterDataOldValue) {
+ throw new TypeError();
+ }
+ this.characterData = !!options.characterData;
+ this.attributeOldValue = !!options.attributeOldValue;
+ this.characterDataOldValue = !!options.characterDataOldValue;
+ if ("attributeFilter" in options) {
+ if (options.attributeFilter == null || typeof options.attributeFilter !== "object") {
+ throw new TypeError();
+ }
+ this.attributeFilter = slice.call(options.attributeFilter);
+ } else {
+ this.attributeFilter = null;
+ }
+ }
+ var uidCounter = 0;
+ function MutationObserver(callback) {
+ this.callback_ = callback;
+ this.nodes_ = [];
+ this.records_ = [];
+ this.uid_ = ++uidCounter;
+ this.scheduled_ = false;
+ }
+ MutationObserver.prototype = {
+ constructor: MutationObserver,
+ observe: function(target, options) {
+ target = wrapIfNeeded(target);
+ var newOptions = new MutationObserverOptions(options);
+ var registration;
+ var registrations = registrationsTable.get(target);
+ if (!registrations) registrationsTable.set(target, registrations = []);
+ for (var i = 0; i < registrations.length; i++) {
+ if (registrations[i].observer === this) {
+ registration = registrations[i];
+ registration.removeTransientObservers();
+ registration.options = newOptions;
+ }
+ }
+ if (!registration) {
+ registration = new Registration(this, target, newOptions);
+ registrations.push(registration);
+ this.nodes_.push(target);
+ }
+ },
+ disconnect: function() {
+ this.nodes_.forEach(function(node) {
+ var registrations = registrationsTable.get(node);
+ for (var i = 0; i < registrations.length; i++) {
+ var registration = registrations[i];
+ if (registration.observer === this) {
+ registrations.splice(i, 1);
+ break;
+ }
+ }
+ }, this);
+ this.records_ = [];
+ },
+ takeRecords: function() {
+ var copyOfRecords = this.records_;
+ this.records_ = [];
+ return copyOfRecords;
+ }
+ };
+ function Registration(observer, target, options) {
+ this.observer = observer;
+ this.target = target;
+ this.options = options;
+ this.transientObservedNodes = [];
+ }
+ Registration.prototype = {
+ addTransientObserver: function(node) {
+ if (node === this.target) return;
+ scheduleCallback(this.observer);
+ this.transientObservedNodes.push(node);
+ var registrations = registrationsTable.get(node);
+ if (!registrations) registrationsTable.set(node, registrations = []);
+ registrations.push(this);
+ },
+ removeTransientObservers: function() {
+ var transientObservedNodes = this.transientObservedNodes;
+ this.transientObservedNodes = [];
+ for (var i = 0; i < transientObservedNodes.length; i++) {
+ var node = transientObservedNodes[i];
+ var registrations = registrationsTable.get(node);
+ for (var j = 0; j < registrations.length; j++) {
+ if (registrations[j] === this) {
+ registrations.splice(j, 1);
+ break;
+ }
+ }
+ }
+ }
+ };
+ scope.enqueueMutation = enqueueMutation;
+ scope.registerTransientObservers = registerTransientObservers;
+ scope.wrappers.MutationObserver = MutationObserver;
+ scope.wrappers.MutationRecord = MutationRecord;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ function TreeScope(root, parent) {
+ this.root = root;
+ this.parent = parent;
+ }
+ TreeScope.prototype = {
+ get renderer() {
+ if (this.root instanceof scope.wrappers.ShadowRoot) {
+ return scope.getRendererForHost(this.root.host);
+ }
+ return null;
+ },
+ contains: function(treeScope) {
+ for (;treeScope; treeScope = treeScope.parent) {
+ if (treeScope === this) return true;
+ }
+ return false;
+ }
+ };
+ function setTreeScope(node, treeScope) {
+ if (node.treeScope_ !== treeScope) {
+ node.treeScope_ = treeScope;
+ for (var sr = node.shadowRoot; sr; sr = sr.olderShadowRoot) {
+ sr.treeScope_.parent = treeScope;
+ }
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ setTreeScope(child, treeScope);
+ }
+ }
+ }
+ function getTreeScope(node) {
+ if (node instanceof scope.wrappers.Window) {
+ debugger;
+ }
+ if (node.treeScope_) return node.treeScope_;
+ var parent = node.parentNode;
+ var treeScope;
+ if (parent) treeScope = getTreeScope(parent); else treeScope = new TreeScope(node, null);
+ return node.treeScope_ = treeScope;
+ }
+ scope.TreeScope = TreeScope;
+ scope.getTreeScope = getTreeScope;
+ scope.setTreeScope = setTreeScope;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;
+ var getTreeScope = scope.getTreeScope;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var wrappers = scope.wrappers;
+ var wrappedFuns = new WeakMap();
+ var listenersTable = new WeakMap();
+ var handledEventsTable = new WeakMap();
+ var currentlyDispatchingEvents = new WeakMap();
+ var targetTable = new WeakMap();
+ var currentTargetTable = new WeakMap();
+ var relatedTargetTable = new WeakMap();
+ var eventPhaseTable = new WeakMap();
+ var stopPropagationTable = new WeakMap();
+ var stopImmediatePropagationTable = new WeakMap();
+ var eventHandlersTable = new WeakMap();
+ var eventPathTable = new WeakMap();
+ function isShadowRoot(node) {
+ return node instanceof wrappers.ShadowRoot;
+ }
+ function rootOfNode(node) {
+ return getTreeScope(node).root;
+ }
+ function getEventPath(node, event) {
+ var path = [];
+ var current = node;
+ path.push(current);
+ while (current) {
+ var destinationInsertionPoints = getDestinationInsertionPoints(current);
+ if (destinationInsertionPoints && destinationInsertionPoints.length > 0) {
+ for (var i = 0; i < destinationInsertionPoints.length; i++) {
+ var insertionPoint = destinationInsertionPoints[i];
+ if (isShadowInsertionPoint(insertionPoint)) {
+ var shadowRoot = rootOfNode(insertionPoint);
+ var olderShadowRoot = shadowRoot.olderShadowRoot;
+ if (olderShadowRoot) path.push(olderShadowRoot);
+ }
+ path.push(insertionPoint);
+ }
+ current = destinationInsertionPoints[destinationInsertionPoints.length - 1];
+ } else {
+ if (isShadowRoot(current)) {
+ if (inSameTree(node, current) && eventMustBeStopped(event)) {
+ break;
+ }
+ current = current.host;
+ path.push(current);
+ } else {
+ current = current.parentNode;
+ if (current) path.push(current);
+ }
+ }
+ }
+ return path;
+ }
+ function eventMustBeStopped(event) {
+ if (!event) return false;
+ switch (event.type) {
+ case "abort":
+ case "error":
+ case "select":
+ case "change":
+ case "load":
+ case "reset":
+ case "resize":
+ case "scroll":
+ case "selectstart":
+ return true;
+ }
+ return false;
+ }
+ function isShadowInsertionPoint(node) {
+ return node instanceof HTMLShadowElement;
+ }
+ function getDestinationInsertionPoints(node) {
+ return scope.getDestinationInsertionPoints(node);
+ }
+ function eventRetargetting(path, currentTarget) {
+ if (path.length === 0) return currentTarget;
+ if (currentTarget instanceof wrappers.Window) currentTarget = currentTarget.document;
+ var currentTargetTree = getTreeScope(currentTarget);
+ var originalTarget = path[0];
+ var originalTargetTree = getTreeScope(originalTarget);
+ var relativeTargetTree = lowestCommonInclusiveAncestor(currentTargetTree, originalTargetTree);
+ for (var i = 0; i < path.length; i++) {
+ var node = path[i];
+ if (getTreeScope(node) === relativeTargetTree) return node;
+ }
+ return path[path.length - 1];
+ }
+ function getTreeScopeAncestors(treeScope) {
+ var ancestors = [];
+ for (;treeScope; treeScope = treeScope.parent) {
+ ancestors.push(treeScope);
+ }
+ return ancestors;
+ }
+ function lowestCommonInclusiveAncestor(tsA, tsB) {
+ var ancestorsA = getTreeScopeAncestors(tsA);
+ var ancestorsB = getTreeScopeAncestors(tsB);
+ var result = null;
+ while (ancestorsA.length > 0 && ancestorsB.length > 0) {
+ var a = ancestorsA.pop();
+ var b = ancestorsB.pop();
+ if (a === b) result = a; else break;
+ }
+ return result;
+ }
+ function getTreeScopeRoot(ts) {
+ if (!ts.parent) return ts;
+ return getTreeScopeRoot(ts.parent);
+ }
+ function relatedTargetResolution(event, currentTarget, relatedTarget) {
+ if (currentTarget instanceof wrappers.Window) currentTarget = currentTarget.document;
+ var currentTargetTree = getTreeScope(currentTarget);
+ var relatedTargetTree = getTreeScope(relatedTarget);
+ var relatedTargetEventPath = getEventPath(relatedTarget, event);
+ var lowestCommonAncestorTree;
+ var lowestCommonAncestorTree = lowestCommonInclusiveAncestor(currentTargetTree, relatedTargetTree);
+ if (!lowestCommonAncestorTree) lowestCommonAncestorTree = relatedTargetTree.root;
+ for (var commonAncestorTree = lowestCommonAncestorTree; commonAncestorTree; commonAncestorTree = commonAncestorTree.parent) {
+ var adjustedRelatedTarget;
+ for (var i = 0; i < relatedTargetEventPath.length; i++) {
+ var node = relatedTargetEventPath[i];
+ if (getTreeScope(node) === commonAncestorTree) return node;
+ }
+ }
+ return null;
+ }
+ function inSameTree(a, b) {
+ return getTreeScope(a) === getTreeScope(b);
+ }
+ var NONE = 0;
+ var CAPTURING_PHASE = 1;
+ var AT_TARGET = 2;
+ var BUBBLING_PHASE = 3;
+ var pendingError;
+ function dispatchOriginalEvent(originalEvent) {
+ if (handledEventsTable.get(originalEvent)) return;
+ handledEventsTable.set(originalEvent, true);
+ dispatchEvent(wrap(originalEvent), wrap(originalEvent.target));
+ if (pendingError) {
+ var err = pendingError;
+ pendingError = null;
+ throw err;
+ }
+ }
+ function isLoadLikeEvent(event) {
+ switch (event.type) {
+ case "load":
+ case "beforeunload":
+ case "unload":
+ return true;
+ }
+ return false;
+ }
+ function dispatchEvent(event, originalWrapperTarget) {
+ if (currentlyDispatchingEvents.get(event)) throw new Error("InvalidStateError");
+ currentlyDispatchingEvents.set(event, true);
+ scope.renderAllPending();
+ var eventPath;
+ var overrideTarget;
+ var win;
+ if (isLoadLikeEvent(event) && !event.bubbles) {
+ var doc = originalWrapperTarget;
+ if (doc instanceof wrappers.Document && (win = doc.defaultView)) {
+ overrideTarget = doc;
+ eventPath = [];
+ }
+ }
+ if (!eventPath) {
+ if (originalWrapperTarget instanceof wrappers.Window) {
+ win = originalWrapperTarget;
+ eventPath = [];
+ } else {
+ eventPath = getEventPath(originalWrapperTarget, event);
+ if (!isLoadLikeEvent(event)) {
+ var doc = eventPath[eventPath.length - 1];
+ if (doc instanceof wrappers.Document) win = doc.defaultView;
+ }
+ }
+ }
+ eventPathTable.set(event, eventPath);
+ if (dispatchCapturing(event, eventPath, win, overrideTarget)) {
+ if (dispatchAtTarget(event, eventPath, win, overrideTarget)) {
+ dispatchBubbling(event, eventPath, win, overrideTarget);
+ }
+ }
+ eventPhaseTable.set(event, NONE);
+ currentTargetTable.delete(event, null);
+ currentlyDispatchingEvents.delete(event);
+ return event.defaultPrevented;
+ }
+ function dispatchCapturing(event, eventPath, win, overrideTarget) {
+ var phase = CAPTURING_PHASE;
+ if (win) {
+ if (!invoke(win, event, phase, eventPath, overrideTarget)) return false;
+ }
+ for (var i = eventPath.length - 1; i > 0; i--) {
+ if (!invoke(eventPath[i], event, phase, eventPath, overrideTarget)) return false;
+ }
+ return true;
+ }
+ function dispatchAtTarget(event, eventPath, win, overrideTarget) {
+ var phase = AT_TARGET;
+ var currentTarget = eventPath[0] || win;
+ return invoke(currentTarget, event, phase, eventPath, overrideTarget);
+ }
+ function dispatchBubbling(event, eventPath, win, overrideTarget) {
+ var phase = BUBBLING_PHASE;
+ for (var i = 1; i < eventPath.length; i++) {
+ if (!invoke(eventPath[i], event, phase, eventPath, overrideTarget)) return;
+ }
+ if (win && eventPath.length > 0) {
+ invoke(win, event, phase, eventPath, overrideTarget);
+ }
+ }
+ function invoke(currentTarget, event, phase, eventPath, overrideTarget) {
+ var listeners = listenersTable.get(currentTarget);
+ if (!listeners) return true;
+ var target = overrideTarget || eventRetargetting(eventPath, currentTarget);
+ if (target === currentTarget) {
+ if (phase === CAPTURING_PHASE) return true;
+ if (phase === BUBBLING_PHASE) phase = AT_TARGET;
+ } else if (phase === BUBBLING_PHASE && !event.bubbles) {
+ return true;
+ }
+ if ("relatedTarget" in event) {
+ var originalEvent = unwrap(event);
+ var unwrappedRelatedTarget = originalEvent.relatedTarget;
+ if (unwrappedRelatedTarget) {
+ if (unwrappedRelatedTarget instanceof Object && unwrappedRelatedTarget.addEventListener) {
+ var relatedTarget = wrap(unwrappedRelatedTarget);
+ var adjusted = relatedTargetResolution(event, currentTarget, relatedTarget);
+ if (adjusted === target) return true;
+ } else {
+ adjusted = null;
+ }
+ relatedTargetTable.set(event, adjusted);
+ }
+ }
+ eventPhaseTable.set(event, phase);
+ var type = event.type;
+ var anyRemoved = false;
+ targetTable.set(event, target);
+ currentTargetTable.set(event, currentTarget);
+ listeners.depth++;
+ for (var i = 0, len = listeners.length; i < len; i++) {
+ var listener = listeners[i];
+ if (listener.removed) {
+ anyRemoved = true;
+ continue;
+ }
+ if (listener.type !== type || !listener.capture && phase === CAPTURING_PHASE || listener.capture && phase === BUBBLING_PHASE) {
+ continue;
+ }
+ try {
+ if (typeof listener.handler === "function") listener.handler.call(currentTarget, event); else listener.handler.handleEvent(event);
+ if (stopImmediatePropagationTable.get(event)) return false;
+ } catch (ex) {
+ if (!pendingError) pendingError = ex;
+ }
+ }
+ listeners.depth--;
+ if (anyRemoved && listeners.depth === 0) {
+ var copy = listeners.slice();
+ listeners.length = 0;
+ for (var i = 0; i < copy.length; i++) {
+ if (!copy[i].removed) listeners.push(copy[i]);
+ }
+ }
+ return !stopPropagationTable.get(event);
+ }
+ function Listener(type, handler, capture) {
+ this.type = type;
+ this.handler = handler;
+ this.capture = Boolean(capture);
+ }
+ Listener.prototype = {
+ equals: function(that) {
+ return this.handler === that.handler && this.type === that.type && this.capture === that.capture;
+ },
+ get removed() {
+ return this.handler === null;
+ },
+ remove: function() {
+ this.handler = null;
+ }
+ };
+ var OriginalEvent = window.Event;
+ OriginalEvent.prototype.polymerBlackList_ = {
+ returnValue: true,
+ keyLocation: true
+ };
+ function Event(type, options) {
+ if (type instanceof OriginalEvent) {
+ var impl = type;
+ if (!OriginalBeforeUnloadEvent && impl.type === "beforeunload" && !(this instanceof BeforeUnloadEvent)) {
+ return new BeforeUnloadEvent(impl);
+ }
+ setWrapper(impl, this);
+ } else {
+ return wrap(constructEvent(OriginalEvent, "Event", type, options));
+ }
+ }
+ Event.prototype = {
+ get target() {
+ return targetTable.get(this);
+ },
+ get currentTarget() {
+ return currentTargetTable.get(this);
+ },
+ get eventPhase() {
+ return eventPhaseTable.get(this);
+ },
+ get path() {
+ var eventPath = eventPathTable.get(this);
+ if (!eventPath) return [];
+ return eventPath.slice();
+ },
+ stopPropagation: function() {
+ stopPropagationTable.set(this, true);
+ },
+ stopImmediatePropagation: function() {
+ stopPropagationTable.set(this, true);
+ stopImmediatePropagationTable.set(this, true);
+ }
+ };
+ registerWrapper(OriginalEvent, Event, document.createEvent("Event"));
+ function unwrapOptions(options) {
+ if (!options || !options.relatedTarget) return options;
+ return Object.create(options, {
+ relatedTarget: {
+ value: unwrap(options.relatedTarget)
+ }
+ });
+ }
+ function registerGenericEvent(name, SuperEvent, prototype) {
+ var OriginalEvent = window[name];
+ var GenericEvent = function(type, options) {
+ if (type instanceof OriginalEvent) setWrapper(type, this); else return wrap(constructEvent(OriginalEvent, name, type, options));
+ };
+ GenericEvent.prototype = Object.create(SuperEvent.prototype);
+ if (prototype) mixin(GenericEvent.prototype, prototype);
+ if (OriginalEvent) {
+ try {
+ registerWrapper(OriginalEvent, GenericEvent, new OriginalEvent("temp"));
+ } catch (ex) {
+ registerWrapper(OriginalEvent, GenericEvent, document.createEvent(name));
+ }
+ }
+ return GenericEvent;
+ }
+ var UIEvent = registerGenericEvent("UIEvent", Event);
+ var CustomEvent = registerGenericEvent("CustomEvent", Event);
+ var relatedTargetProto = {
+ get relatedTarget() {
+ var relatedTarget = relatedTargetTable.get(this);
+ if (relatedTarget !== undefined) return relatedTarget;
+ return wrap(unwrap(this).relatedTarget);
+ }
+ };
+ function getInitFunction(name, relatedTargetIndex) {
+ return function() {
+ arguments[relatedTargetIndex] = unwrap(arguments[relatedTargetIndex]);
+ var impl = unwrap(this);
+ impl[name].apply(impl, arguments);
+ };
+ }
+ var mouseEventProto = mixin({
+ initMouseEvent: getInitFunction("initMouseEvent", 14)
+ }, relatedTargetProto);
+ var focusEventProto = mixin({
+ initFocusEvent: getInitFunction("initFocusEvent", 5)
+ }, relatedTargetProto);
+ var MouseEvent = registerGenericEvent("MouseEvent", UIEvent, mouseEventProto);
+ var FocusEvent = registerGenericEvent("FocusEvent", UIEvent, focusEventProto);
+ var defaultInitDicts = Object.create(null);
+ var supportsEventConstructors = function() {
+ try {
+ new window.FocusEvent("focus");
+ } catch (ex) {
+ return false;
+ }
+ return true;
+ }();
+ function constructEvent(OriginalEvent, name, type, options) {
+ if (supportsEventConstructors) return new OriginalEvent(type, unwrapOptions(options));
+ var event = unwrap(document.createEvent(name));
+ var defaultDict = defaultInitDicts[name];
+ var args = [ type ];
+ Object.keys(defaultDict).forEach(function(key) {
+ var v = options != null && key in options ? options[key] : defaultDict[key];
+ if (key === "relatedTarget") v = unwrap(v);
+ args.push(v);
+ });
+ event["init" + name].apply(event, args);
+ return event;
+ }
+ if (!supportsEventConstructors) {
+ var configureEventConstructor = function(name, initDict, superName) {
+ if (superName) {
+ var superDict = defaultInitDicts[superName];
+ initDict = mixin(mixin({}, superDict), initDict);
+ }
+ defaultInitDicts[name] = initDict;
+ };
+ configureEventConstructor("Event", {
+ bubbles: false,
+ cancelable: false
+ });
+ configureEventConstructor("CustomEvent", {
+ detail: null
+ }, "Event");
+ configureEventConstructor("UIEvent", {
+ view: null,
+ detail: 0
+ }, "Event");
+ configureEventConstructor("MouseEvent", {
+ screenX: 0,
+ screenY: 0,
+ clientX: 0,
+ clientY: 0,
+ ctrlKey: false,
+ altKey: false,
+ shiftKey: false,
+ metaKey: false,
+ button: 0,
+ relatedTarget: null
+ }, "UIEvent");
+ configureEventConstructor("FocusEvent", {
+ relatedTarget: null
+ }, "UIEvent");
+ }
+ var OriginalBeforeUnloadEvent = window.BeforeUnloadEvent;
+ function BeforeUnloadEvent(impl) {
+ Event.call(this, impl);
+ }
+ BeforeUnloadEvent.prototype = Object.create(Event.prototype);
+ mixin(BeforeUnloadEvent.prototype, {
+ get returnValue() {
+ return unsafeUnwrap(this).returnValue;
+ },
+ set returnValue(v) {
+ unsafeUnwrap(this).returnValue = v;
+ }
+ });
+ if (OriginalBeforeUnloadEvent) registerWrapper(OriginalBeforeUnloadEvent, BeforeUnloadEvent);
+ function isValidListener(fun) {
+ if (typeof fun === "function") return true;
+ return fun && fun.handleEvent;
+ }
+ function isMutationEvent(type) {
+ switch (type) {
+ case "DOMAttrModified":
+ case "DOMAttributeNameChanged":
+ case "DOMCharacterDataModified":
+ case "DOMElementNameChanged":
+ case "DOMNodeInserted":
+ case "DOMNodeInsertedIntoDocument":
+ case "DOMNodeRemoved":
+ case "DOMNodeRemovedFromDocument":
+ case "DOMSubtreeModified":
+ return true;
+ }
+ return false;
+ }
+ var OriginalEventTarget = window.EventTarget;
+ function EventTarget(impl) {
+ setWrapper(impl, this);
+ }
+ var methodNames = [ "addEventListener", "removeEventListener", "dispatchEvent" ];
+ [ Node, Window ].forEach(function(constructor) {
+ var p = constructor.prototype;
+ methodNames.forEach(function(name) {
+ Object.defineProperty(p, name + "_", {
+ value: p[name]
+ });
+ });
+ });
+ function getTargetToListenAt(wrapper) {
+ if (wrapper instanceof wrappers.ShadowRoot) wrapper = wrapper.host;
+ return unwrap(wrapper);
+ }
+ EventTarget.prototype = {
+ addEventListener: function(type, fun, capture) {
+ if (!isValidListener(fun) || isMutationEvent(type)) return;
+ var listener = new Listener(type, fun, capture);
+ var listeners = listenersTable.get(this);
+ if (!listeners) {
+ listeners = [];
+ listeners.depth = 0;
+ listenersTable.set(this, listeners);
+ } else {
+ for (var i = 0; i < listeners.length; i++) {
+ if (listener.equals(listeners[i])) return;
+ }
+ }
+ listeners.push(listener);
+ var target = getTargetToListenAt(this);
+ target.addEventListener_(type, dispatchOriginalEvent, true);
+ },
+ removeEventListener: function(type, fun, capture) {
+ capture = Boolean(capture);
+ var listeners = listenersTable.get(this);
+ if (!listeners) return;
+ var count = 0, found = false;
+ for (var i = 0; i < listeners.length; i++) {
+ if (listeners[i].type === type && listeners[i].capture === capture) {
+ count++;
+ if (listeners[i].handler === fun) {
+ found = true;
+ listeners[i].remove();
+ }
+ }
+ }
+ if (found && count === 1) {
+ var target = getTargetToListenAt(this);
+ target.removeEventListener_(type, dispatchOriginalEvent, true);
+ }
+ },
+ dispatchEvent: function(event) {
+ var nativeEvent = unwrap(event);
+ var eventType = nativeEvent.type;
+ handledEventsTable.set(nativeEvent, false);
+ scope.renderAllPending();
+ var tempListener;
+ if (!hasListenerInAncestors(this, eventType)) {
+ tempListener = function() {};
+ this.addEventListener(eventType, tempListener, true);
+ }
+ try {
+ return unwrap(this).dispatchEvent_(nativeEvent);
+ } finally {
+ if (tempListener) this.removeEventListener(eventType, tempListener, true);
+ }
+ }
+ };
+ function hasListener(node, type) {
+ var listeners = listenersTable.get(node);
+ if (listeners) {
+ for (var i = 0; i < listeners.length; i++) {
+ if (!listeners[i].removed && listeners[i].type === type) return true;
+ }
+ }
+ return false;
+ }
+ function hasListenerInAncestors(target, type) {
+ for (var node = unwrap(target); node; node = node.parentNode) {
+ if (hasListener(wrap(node), type)) return true;
+ }
+ return false;
+ }
+ if (OriginalEventTarget) registerWrapper(OriginalEventTarget, EventTarget);
+ function wrapEventTargetMethods(constructors) {
+ forwardMethodsToWrapper(constructors, methodNames);
+ }
+ var originalElementFromPoint = document.elementFromPoint;
+ function elementFromPoint(self, document, x, y) {
+ scope.renderAllPending();
+ var element = wrap(originalElementFromPoint.call(unsafeUnwrap(document), x, y));
+ if (!element) return null;
+ var path = getEventPath(element, null);
+ var idx = path.lastIndexOf(self);
+ if (idx == -1) return null; else path = path.slice(0, idx);
+ return eventRetargetting(path, self);
+ }
+ function getEventHandlerGetter(name) {
+ return function() {
+ var inlineEventHandlers = eventHandlersTable.get(this);
+ return inlineEventHandlers && inlineEventHandlers[name] && inlineEventHandlers[name].value || null;
+ };
+ }
+ function getEventHandlerSetter(name) {
+ var eventType = name.slice(2);
+ return function(value) {
+ var inlineEventHandlers = eventHandlersTable.get(this);
+ if (!inlineEventHandlers) {
+ inlineEventHandlers = Object.create(null);
+ eventHandlersTable.set(this, inlineEventHandlers);
+ }
+ var old = inlineEventHandlers[name];
+ if (old) this.removeEventListener(eventType, old.wrapped, false);
+ if (typeof value === "function") {
+ var wrapped = function(e) {
+ var rv = value.call(this, e);
+ if (rv === false) e.preventDefault(); else if (name === "onbeforeunload" && typeof rv === "string") e.returnValue = rv;
+ };
+ this.addEventListener(eventType, wrapped, false);
+ inlineEventHandlers[name] = {
+ value: value,
+ wrapped: wrapped
+ };
+ }
+ };
+ }
+ scope.elementFromPoint = elementFromPoint;
+ scope.getEventHandlerGetter = getEventHandlerGetter;
+ scope.getEventHandlerSetter = getEventHandlerSetter;
+ scope.wrapEventTargetMethods = wrapEventTargetMethods;
+ scope.wrappers.BeforeUnloadEvent = BeforeUnloadEvent;
+ scope.wrappers.CustomEvent = CustomEvent;
+ scope.wrappers.Event = Event;
+ scope.wrappers.EventTarget = EventTarget;
+ scope.wrappers.FocusEvent = FocusEvent;
+ scope.wrappers.MouseEvent = MouseEvent;
+ scope.wrappers.UIEvent = UIEvent;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var UIEvent = scope.wrappers.UIEvent;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var OriginalTouchEvent = window.TouchEvent;
+ if (!OriginalTouchEvent) return;
+ var nativeEvent;
+ try {
+ nativeEvent = document.createEvent("TouchEvent");
+ } catch (ex) {
+ return;
+ }
+ var nonEnumDescriptor = {
+ enumerable: false
+ };
+ function nonEnum(obj, prop) {
+ Object.defineProperty(obj, prop, nonEnumDescriptor);
+ }
+ function Touch(impl) {
+ setWrapper(impl, this);
+ }
+ Touch.prototype = {
+ get target() {
+ return wrap(unsafeUnwrap(this).target);
+ }
+ };
+ var descr = {
+ configurable: true,
+ enumerable: true,
+ get: null
+ };
+ [ "clientX", "clientY", "screenX", "screenY", "pageX", "pageY", "identifier", "webkitRadiusX", "webkitRadiusY", "webkitRotationAngle", "webkitForce" ].forEach(function(name) {
+ descr.get = function() {
+ return unsafeUnwrap(this)[name];
+ };
+ Object.defineProperty(Touch.prototype, name, descr);
+ });
+ function TouchList() {
+ this.length = 0;
+ nonEnum(this, "length");
+ }
+ TouchList.prototype = {
+ item: function(index) {
+ return this[index];
+ }
+ };
+ function wrapTouchList(nativeTouchList) {
+ var list = new TouchList();
+ for (var i = 0; i < nativeTouchList.length; i++) {
+ list[i] = new Touch(nativeTouchList[i]);
+ }
+ list.length = i;
+ return list;
+ }
+ function TouchEvent(impl) {
+ UIEvent.call(this, impl);
+ }
+ TouchEvent.prototype = Object.create(UIEvent.prototype);
+ mixin(TouchEvent.prototype, {
+ get touches() {
+ return wrapTouchList(unsafeUnwrap(this).touches);
+ },
+ get targetTouches() {
+ return wrapTouchList(unsafeUnwrap(this).targetTouches);
+ },
+ get changedTouches() {
+ return wrapTouchList(unsafeUnwrap(this).changedTouches);
+ },
+ initTouchEvent: function() {
+ throw new Error("Not implemented");
+ }
+ });
+ registerWrapper(OriginalTouchEvent, TouchEvent, nativeEvent);
+ scope.wrappers.Touch = Touch;
+ scope.wrappers.TouchEvent = TouchEvent;
+ scope.wrappers.TouchList = TouchList;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var nonEnumDescriptor = {
+ enumerable: false
+ };
+ function nonEnum(obj, prop) {
+ Object.defineProperty(obj, prop, nonEnumDescriptor);
+ }
+ function NodeList() {
+ this.length = 0;
+ nonEnum(this, "length");
+ }
+ NodeList.prototype = {
+ item: function(index) {
+ return this[index];
+ }
+ };
+ nonEnum(NodeList.prototype, "item");
+ function wrapNodeList(list) {
+ if (list == null) return list;
+ var wrapperList = new NodeList();
+ for (var i = 0, length = list.length; i < length; i++) {
+ wrapperList[i] = wrap(list[i]);
+ }
+ wrapperList.length = length;
+ return wrapperList;
+ }
+ function addWrapNodeListMethod(wrapperConstructor, name) {
+ wrapperConstructor.prototype[name] = function() {
+ return wrapNodeList(unsafeUnwrap(this)[name].apply(unsafeUnwrap(this), arguments));
+ };
+ }
+ scope.wrappers.NodeList = NodeList;
+ scope.addWrapNodeListMethod = addWrapNodeListMethod;
+ scope.wrapNodeList = wrapNodeList;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ scope.wrapHTMLCollection = scope.wrapNodeList;
+ scope.wrappers.HTMLCollection = scope.wrappers.NodeList;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var EventTarget = scope.wrappers.EventTarget;
+ var NodeList = scope.wrappers.NodeList;
+ var TreeScope = scope.TreeScope;
+ var assert = scope.assert;
+ var defineWrapGetter = scope.defineWrapGetter;
+ var enqueueMutation = scope.enqueueMutation;
+ var getTreeScope = scope.getTreeScope;
+ var isWrapper = scope.isWrapper;
+ var mixin = scope.mixin;
+ var registerTransientObservers = scope.registerTransientObservers;
+ var registerWrapper = scope.registerWrapper;
+ var setTreeScope = scope.setTreeScope;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var wrapIfNeeded = scope.wrapIfNeeded;
+ var wrappers = scope.wrappers;
+ function assertIsNodeWrapper(node) {
+ assert(node instanceof Node);
+ }
+ function createOneElementNodeList(node) {
+ var nodes = new NodeList();
+ nodes[0] = node;
+ nodes.length = 1;
+ return nodes;
+ }
+ var surpressMutations = false;
+ function enqueueRemovalForInsertedNodes(node, parent, nodes) {
+ enqueueMutation(parent, "childList", {
+ removedNodes: nodes,
+ previousSibling: node.previousSibling,
+ nextSibling: node.nextSibling
+ });
+ }
+ function enqueueRemovalForInsertedDocumentFragment(df, nodes) {
+ enqueueMutation(df, "childList", {
+ removedNodes: nodes
+ });
+ }
+ function collectNodes(node, parentNode, previousNode, nextNode) {
+ if (node instanceof DocumentFragment) {
+ var nodes = collectNodesForDocumentFragment(node);
+ surpressMutations = true;
+ for (var i = nodes.length - 1; i >= 0; i--) {
+ node.removeChild(nodes[i]);
+ nodes[i].parentNode_ = parentNode;
+ }
+ surpressMutations = false;
+ for (var i = 0; i < nodes.length; i++) {
+ nodes[i].previousSibling_ = nodes[i - 1] || previousNode;
+ nodes[i].nextSibling_ = nodes[i + 1] || nextNode;
+ }
+ if (previousNode) previousNode.nextSibling_ = nodes[0];
+ if (nextNode) nextNode.previousSibling_ = nodes[nodes.length - 1];
+ return nodes;
+ }
+ var nodes = createOneElementNodeList(node);
+ var oldParent = node.parentNode;
+ if (oldParent) {
+ oldParent.removeChild(node);
+ }
+ node.parentNode_ = parentNode;
+ node.previousSibling_ = previousNode;
+ node.nextSibling_ = nextNode;
+ if (previousNode) previousNode.nextSibling_ = node;
+ if (nextNode) nextNode.previousSibling_ = node;
+ return nodes;
+ }
+ function collectNodesNative(node) {
+ if (node instanceof DocumentFragment) return collectNodesForDocumentFragment(node);
+ var nodes = createOneElementNodeList(node);
+ var oldParent = node.parentNode;
+ if (oldParent) enqueueRemovalForInsertedNodes(node, oldParent, nodes);
+ return nodes;
+ }
+ function collectNodesForDocumentFragment(node) {
+ var nodes = new NodeList();
+ var i = 0;
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ nodes[i++] = child;
+ }
+ nodes.length = i;
+ enqueueRemovalForInsertedDocumentFragment(node, nodes);
+ return nodes;
+ }
+ function snapshotNodeList(nodeList) {
+ return nodeList;
+ }
+ function nodeWasAdded(node, treeScope) {
+ setTreeScope(node, treeScope);
+ node.nodeIsInserted_();
+ }
+ function nodesWereAdded(nodes, parent) {
+ var treeScope = getTreeScope(parent);
+ for (var i = 0; i < nodes.length; i++) {
+ nodeWasAdded(nodes[i], treeScope);
+ }
+ }
+ function nodeWasRemoved(node) {
+ setTreeScope(node, new TreeScope(node, null));
+ }
+ function nodesWereRemoved(nodes) {
+ for (var i = 0; i < nodes.length; i++) {
+ nodeWasRemoved(nodes[i]);
+ }
+ }
+ function ensureSameOwnerDocument(parent, child) {
+ var ownerDoc = parent.nodeType === Node.DOCUMENT_NODE ? parent : parent.ownerDocument;
+ if (ownerDoc !== child.ownerDocument) ownerDoc.adoptNode(child);
+ }
+ function adoptNodesIfNeeded(owner, nodes) {
+ if (!nodes.length) return;
+ var ownerDoc = owner.ownerDocument;
+ if (ownerDoc === nodes[0].ownerDocument) return;
+ for (var i = 0; i < nodes.length; i++) {
+ scope.adoptNodeNoRemove(nodes[i], ownerDoc);
+ }
+ }
+ function unwrapNodesForInsertion(owner, nodes) {
+ adoptNodesIfNeeded(owner, nodes);
+ var length = nodes.length;
+ if (length === 1) return unwrap(nodes[0]);
+ var df = unwrap(owner.ownerDocument.createDocumentFragment());
+ for (var i = 0; i < length; i++) {
+ df.appendChild(unwrap(nodes[i]));
+ }
+ return df;
+ }
+ function clearChildNodes(wrapper) {
+ if (wrapper.firstChild_ !== undefined) {
+ var child = wrapper.firstChild_;
+ while (child) {
+ var tmp = child;
+ child = child.nextSibling_;
+ tmp.parentNode_ = tmp.previousSibling_ = tmp.nextSibling_ = undefined;
+ }
+ }
+ wrapper.firstChild_ = wrapper.lastChild_ = undefined;
+ }
+ function removeAllChildNodes(wrapper) {
+ if (wrapper.invalidateShadowRenderer()) {
+ var childWrapper = wrapper.firstChild;
+ while (childWrapper) {
+ assert(childWrapper.parentNode === wrapper);
+ var nextSibling = childWrapper.nextSibling;
+ var childNode = unwrap(childWrapper);
+ var parentNode = childNode.parentNode;
+ if (parentNode) originalRemoveChild.call(parentNode, childNode);
+ childWrapper.previousSibling_ = childWrapper.nextSibling_ = childWrapper.parentNode_ = null;
+ childWrapper = nextSibling;
+ }
+ wrapper.firstChild_ = wrapper.lastChild_ = null;
+ } else {
+ var node = unwrap(wrapper);
+ var child = node.firstChild;
+ var nextSibling;
+ while (child) {
+ nextSibling = child.nextSibling;
+ originalRemoveChild.call(node, child);
+ child = nextSibling;
+ }
+ }
+ }
+ function invalidateParent(node) {
+ var p = node.parentNode;
+ return p && p.invalidateShadowRenderer();
+ }
+ function cleanupNodes(nodes) {
+ for (var i = 0, n; i < nodes.length; i++) {
+ n = nodes[i];
+ n.parentNode.removeChild(n);
+ }
+ }
+ var originalImportNode = document.importNode;
+ var originalCloneNode = window.Node.prototype.cloneNode;
+ function cloneNode(node, deep, opt_doc) {
+ var clone;
+ if (opt_doc) clone = wrap(originalImportNode.call(opt_doc, unsafeUnwrap(node), false)); else clone = wrap(originalCloneNode.call(unsafeUnwrap(node), false));
+ if (deep) {
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ clone.appendChild(cloneNode(child, true, opt_doc));
+ }
+ if (node instanceof wrappers.HTMLTemplateElement) {
+ var cloneContent = clone.content;
+ for (var child = node.content.firstChild; child; child = child.nextSibling) {
+ cloneContent.appendChild(cloneNode(child, true, opt_doc));
+ }
+ }
+ }
+ return clone;
+ }
+ function contains(self, child) {
+ if (!child || getTreeScope(self) !== getTreeScope(child)) return false;
+ for (var node = child; node; node = node.parentNode) {
+ if (node === self) return true;
+ }
+ return false;
+ }
+ var OriginalNode = window.Node;
+ function Node(original) {
+ assert(original instanceof OriginalNode);
+ EventTarget.call(this, original);
+ this.parentNode_ = undefined;
+ this.firstChild_ = undefined;
+ this.lastChild_ = undefined;
+ this.nextSibling_ = undefined;
+ this.previousSibling_ = undefined;
+ this.treeScope_ = undefined;
+ }
+ var OriginalDocumentFragment = window.DocumentFragment;
+ var originalAppendChild = OriginalNode.prototype.appendChild;
+ var originalCompareDocumentPosition = OriginalNode.prototype.compareDocumentPosition;
+ var originalIsEqualNode = OriginalNode.prototype.isEqualNode;
+ var originalInsertBefore = OriginalNode.prototype.insertBefore;
+ var originalRemoveChild = OriginalNode.prototype.removeChild;
+ var originalReplaceChild = OriginalNode.prototype.replaceChild;
+ var isIe = /Trident|Edge/.test(navigator.userAgent);
+ var removeChildOriginalHelper = isIe ? function(parent, child) {
+ try {
+ originalRemoveChild.call(parent, child);
+ } catch (ex) {
+ if (!(parent instanceof OriginalDocumentFragment)) throw ex;
+ }
+ } : function(parent, child) {
+ originalRemoveChild.call(parent, child);
+ };
+ Node.prototype = Object.create(EventTarget.prototype);
+ mixin(Node.prototype, {
+ appendChild: function(childWrapper) {
+ return this.insertBefore(childWrapper, null);
+ },
+ insertBefore: function(childWrapper, refWrapper) {
+ assertIsNodeWrapper(childWrapper);
+ var refNode;
+ if (refWrapper) {
+ if (isWrapper(refWrapper)) {
+ refNode = unwrap(refWrapper);
+ } else {
+ refNode = refWrapper;
+ refWrapper = wrap(refNode);
+ }
+ } else {
+ refWrapper = null;
+ refNode = null;
+ }
+ refWrapper && assert(refWrapper.parentNode === this);
+ var nodes;
+ var previousNode = refWrapper ? refWrapper.previousSibling : this.lastChild;
+ var useNative = !this.invalidateShadowRenderer() && !invalidateParent(childWrapper);
+ if (useNative) nodes = collectNodesNative(childWrapper); else nodes = collectNodes(childWrapper, this, previousNode, refWrapper);
+ if (useNative) {
+ ensureSameOwnerDocument(this, childWrapper);
+ clearChildNodes(this);
+ originalInsertBefore.call(unsafeUnwrap(this), unwrap(childWrapper), refNode);
+ } else {
+ if (!previousNode) this.firstChild_ = nodes[0];
+ if (!refWrapper) {
+ this.lastChild_ = nodes[nodes.length - 1];
+ if (this.firstChild_ === undefined) this.firstChild_ = this.firstChild;
+ }
+ var parentNode = refNode ? refNode.parentNode : unsafeUnwrap(this);
+ if (parentNode) {
+ originalInsertBefore.call(parentNode, unwrapNodesForInsertion(this, nodes), refNode);
+ } else {
+ adoptNodesIfNeeded(this, nodes);
+ }
+ }
+ enqueueMutation(this, "childList", {
+ addedNodes: nodes,
+ nextSibling: refWrapper,
+ previousSibling: previousNode
+ });
+ nodesWereAdded(nodes, this);
+ return childWrapper;
+ },
+ removeChild: function(childWrapper) {
+ assertIsNodeWrapper(childWrapper);
+ if (childWrapper.parentNode !== this) {
+ var found = false;
+ var childNodes = this.childNodes;
+ for (var ieChild = this.firstChild; ieChild; ieChild = ieChild.nextSibling) {
+ if (ieChild === childWrapper) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ throw new Error("NotFoundError");
+ }
+ }
+ var childNode = unwrap(childWrapper);
+ var childWrapperNextSibling = childWrapper.nextSibling;
+ var childWrapperPreviousSibling = childWrapper.previousSibling;
+ if (this.invalidateShadowRenderer()) {
+ var thisFirstChild = this.firstChild;
+ var thisLastChild = this.lastChild;
+ var parentNode = childNode.parentNode;
+ if (parentNode) removeChildOriginalHelper(parentNode, childNode);
+ if (thisFirstChild === childWrapper) this.firstChild_ = childWrapperNextSibling;
+ if (thisLastChild === childWrapper) this.lastChild_ = childWrapperPreviousSibling;
+ if (childWrapperPreviousSibling) childWrapperPreviousSibling.nextSibling_ = childWrapperNextSibling;
+ if (childWrapperNextSibling) {
+ childWrapperNextSibling.previousSibling_ = childWrapperPreviousSibling;
+ }
+ childWrapper.previousSibling_ = childWrapper.nextSibling_ = childWrapper.parentNode_ = undefined;
+ } else {
+ clearChildNodes(this);
+ removeChildOriginalHelper(unsafeUnwrap(this), childNode);
+ }
+ if (!surpressMutations) {
+ enqueueMutation(this, "childList", {
+ removedNodes: createOneElementNodeList(childWrapper),
+ nextSibling: childWrapperNextSibling,
+ previousSibling: childWrapperPreviousSibling
+ });
+ }
+ registerTransientObservers(this, childWrapper);
+ return childWrapper;
+ },
+ replaceChild: function(newChildWrapper, oldChildWrapper) {
+ assertIsNodeWrapper(newChildWrapper);
+ var oldChildNode;
+ if (isWrapper(oldChildWrapper)) {
+ oldChildNode = unwrap(oldChildWrapper);
+ } else {
+ oldChildNode = oldChildWrapper;
+ oldChildWrapper = wrap(oldChildNode);
+ }
+ if (oldChildWrapper.parentNode !== this) {
+ throw new Error("NotFoundError");
+ }
+ var nextNode = oldChildWrapper.nextSibling;
+ var previousNode = oldChildWrapper.previousSibling;
+ var nodes;
+ var useNative = !this.invalidateShadowRenderer() && !invalidateParent(newChildWrapper);
+ if (useNative) {
+ nodes = collectNodesNative(newChildWrapper);
+ } else {
+ if (nextNode === newChildWrapper) nextNode = newChildWrapper.nextSibling;
+ nodes = collectNodes(newChildWrapper, this, previousNode, nextNode);
+ }
+ if (!useNative) {
+ if (this.firstChild === oldChildWrapper) this.firstChild_ = nodes[0];
+ if (this.lastChild === oldChildWrapper) this.lastChild_ = nodes[nodes.length - 1];
+ oldChildWrapper.previousSibling_ = oldChildWrapper.nextSibling_ = oldChildWrapper.parentNode_ = undefined;
+ if (oldChildNode.parentNode) {
+ originalReplaceChild.call(oldChildNode.parentNode, unwrapNodesForInsertion(this, nodes), oldChildNode);
+ }
+ } else {
+ ensureSameOwnerDocument(this, newChildWrapper);
+ clearChildNodes(this);
+ originalReplaceChild.call(unsafeUnwrap(this), unwrap(newChildWrapper), oldChildNode);
+ }
+ enqueueMutation(this, "childList", {
+ addedNodes: nodes,
+ removedNodes: createOneElementNodeList(oldChildWrapper),
+ nextSibling: nextNode,
+ previousSibling: previousNode
+ });
+ nodeWasRemoved(oldChildWrapper);
+ nodesWereAdded(nodes, this);
+ return oldChildWrapper;
+ },
+ nodeIsInserted_: function() {
+ for (var child = this.firstChild; child; child = child.nextSibling) {
+ child.nodeIsInserted_();
+ }
+ },
+ hasChildNodes: function() {
+ return this.firstChild !== null;
+ },
+ get parentNode() {
+ return this.parentNode_ !== undefined ? this.parentNode_ : wrap(unsafeUnwrap(this).parentNode);
+ },
+ get firstChild() {
+ return this.firstChild_ !== undefined ? this.firstChild_ : wrap(unsafeUnwrap(this).firstChild);
+ },
+ get lastChild() {
+ return this.lastChild_ !== undefined ? this.lastChild_ : wrap(unsafeUnwrap(this).lastChild);
+ },
+ get nextSibling() {
+ return this.nextSibling_ !== undefined ? this.nextSibling_ : wrap(unsafeUnwrap(this).nextSibling);
+ },
+ get previousSibling() {
+ return this.previousSibling_ !== undefined ? this.previousSibling_ : wrap(unsafeUnwrap(this).previousSibling);
+ },
+ get parentElement() {
+ var p = this.parentNode;
+ while (p && p.nodeType !== Node.ELEMENT_NODE) {
+ p = p.parentNode;
+ }
+ return p;
+ },
+ get textContent() {
+ var s = "";
+ for (var child = this.firstChild; child; child = child.nextSibling) {
+ if (child.nodeType != Node.COMMENT_NODE) {
+ s += child.textContent;
+ }
+ }
+ return s;
+ },
+ set textContent(textContent) {
+ if (textContent == null) textContent = "";
+ var removedNodes = snapshotNodeList(this.childNodes);
+ if (this.invalidateShadowRenderer()) {
+ removeAllChildNodes(this);
+ if (textContent !== "") {
+ var textNode = unsafeUnwrap(this).ownerDocument.createTextNode(textContent);
+ this.appendChild(textNode);
+ }
+ } else {
+ clearChildNodes(this);
+ unsafeUnwrap(this).textContent = textContent;
+ }
+ var addedNodes = snapshotNodeList(this.childNodes);
+ enqueueMutation(this, "childList", {
+ addedNodes: addedNodes,
+ removedNodes: removedNodes
+ });
+ nodesWereRemoved(removedNodes);
+ nodesWereAdded(addedNodes, this);
+ },
+ get childNodes() {
+ var wrapperList = new NodeList();
+ var i = 0;
+ for (var child = this.firstChild; child; child = child.nextSibling) {
+ wrapperList[i++] = child;
+ }
+ wrapperList.length = i;
+ return wrapperList;
+ },
+ cloneNode: function(deep) {
+ return cloneNode(this, deep);
+ },
+ contains: function(child) {
+ return contains(this, wrapIfNeeded(child));
+ },
+ compareDocumentPosition: function(otherNode) {
+ return originalCompareDocumentPosition.call(unsafeUnwrap(this), unwrapIfNeeded(otherNode));
+ },
+ isEqualNode: function(otherNode) {
+ return originalIsEqualNode.call(unsafeUnwrap(this), unwrapIfNeeded(otherNode));
+ },
+ normalize: function() {
+ var nodes = snapshotNodeList(this.childNodes);
+ var remNodes = [];
+ var s = "";
+ var modNode;
+ for (var i = 0, n; i < nodes.length; i++) {
+ n = nodes[i];
+ if (n.nodeType === Node.TEXT_NODE) {
+ if (!modNode && !n.data.length) this.removeChild(n); else if (!modNode) modNode = n; else {
+ s += n.data;
+ remNodes.push(n);
+ }
+ } else {
+ if (modNode && remNodes.length) {
+ modNode.data += s;
+ cleanupNodes(remNodes);
+ }
+ remNodes = [];
+ s = "";
+ modNode = null;
+ if (n.childNodes.length) n.normalize();
+ }
+ }
+ if (modNode && remNodes.length) {
+ modNode.data += s;
+ cleanupNodes(remNodes);
+ }
+ }
+ });
+ defineWrapGetter(Node, "ownerDocument");
+ registerWrapper(OriginalNode, Node, document.createDocumentFragment());
+ delete Node.prototype.querySelector;
+ delete Node.prototype.querySelectorAll;
+ Node.prototype = mixin(Object.create(EventTarget.prototype), Node.prototype);
+ scope.cloneNode = cloneNode;
+ scope.nodeWasAdded = nodeWasAdded;
+ scope.nodeWasRemoved = nodeWasRemoved;
+ scope.nodesWereAdded = nodesWereAdded;
+ scope.nodesWereRemoved = nodesWereRemoved;
+ scope.originalInsertBefore = originalInsertBefore;
+ scope.originalRemoveChild = originalRemoveChild;
+ scope.snapshotNodeList = snapshotNodeList;
+ scope.wrappers.Node = Node;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLCollection = scope.wrappers.HTMLCollection;
+ var NodeList = scope.wrappers.NodeList;
+ var getTreeScope = scope.getTreeScope;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var originalDocumentQuerySelector = document.querySelector;
+ var originalElementQuerySelector = document.documentElement.querySelector;
+ var originalDocumentQuerySelectorAll = document.querySelectorAll;
+ var originalElementQuerySelectorAll = document.documentElement.querySelectorAll;
+ var originalDocumentGetElementsByTagName = document.getElementsByTagName;
+ var originalElementGetElementsByTagName = document.documentElement.getElementsByTagName;
+ var originalDocumentGetElementsByTagNameNS = document.getElementsByTagNameNS;
+ var originalElementGetElementsByTagNameNS = document.documentElement.getElementsByTagNameNS;
+ var OriginalElement = window.Element;
+ var OriginalDocument = window.HTMLDocument || window.Document;
+ function filterNodeList(list, index, result, deep) {
+ var wrappedItem = null;
+ var root = null;
+ for (var i = 0, length = list.length; i < length; i++) {
+ wrappedItem = wrap(list[i]);
+ if (!deep && (root = getTreeScope(wrappedItem).root)) {
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ continue;
+ }
+ }
+ result[index++] = wrappedItem;
+ }
+ return index;
+ }
+ function shimSelector(selector) {
+ return String(selector).replace(/\/deep\/|::shadow|>>>/g, " ");
+ }
+ function shimMatchesSelector(selector) {
+ return String(selector).replace(/:host\(([^\s]+)\)/g, "$1").replace(/([^\s]):host/g, "$1").replace(":host", "*").replace(/\^|\/shadow\/|\/shadow-deep\/|::shadow|\/deep\/|::content|>>>/g, " ");
+ }
+ function findOne(node, selector) {
+ var m, el = node.firstElementChild;
+ while (el) {
+ if (el.matches(selector)) return el;
+ m = findOne(el, selector);
+ if (m) return m;
+ el = el.nextElementSibling;
+ }
+ return null;
+ }
+ function matchesSelector(el, selector) {
+ return el.matches(selector);
+ }
+ var XHTML_NS = "http://www.w3.org/1999/xhtml";
+ function matchesTagName(el, localName, localNameLowerCase) {
+ var ln = el.localName;
+ return ln === localName || ln === localNameLowerCase && el.namespaceURI === XHTML_NS;
+ }
+ function matchesEveryThing() {
+ return true;
+ }
+ function matchesLocalNameOnly(el, ns, localName) {
+ return el.localName === localName;
+ }
+ function matchesNameSpace(el, ns) {
+ return el.namespaceURI === ns;
+ }
+ function matchesLocalNameNS(el, ns, localName) {
+ return el.namespaceURI === ns && el.localName === localName;
+ }
+ function findElements(node, index, result, p, arg0, arg1) {
+ var el = node.firstElementChild;
+ while (el) {
+ if (p(el, arg0, arg1)) result[index++] = el;
+ index = findElements(el, index, result, p, arg0, arg1);
+ el = el.nextElementSibling;
+ }
+ return index;
+ }
+ function querySelectorAllFiltered(p, index, result, selector, deep) {
+ var target = unsafeUnwrap(this);
+ var list;
+ var root = getTreeScope(this).root;
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findElements(this, index, result, p, selector, null);
+ } else if (target instanceof OriginalElement) {
+ list = originalElementQuerySelectorAll.call(target, selector);
+ } else if (target instanceof OriginalDocument) {
+ list = originalDocumentQuerySelectorAll.call(target, selector);
+ } else {
+ return findElements(this, index, result, p, selector, null);
+ }
+ return filterNodeList(list, index, result, deep);
+ }
+ var SelectorsInterface = {
+ querySelector: function(selector) {
+ var shimmed = shimSelector(selector);
+ var deep = shimmed !== selector;
+ selector = shimmed;
+ var target = unsafeUnwrap(this);
+ var wrappedItem;
+ var root = getTreeScope(this).root;
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findOne(this, selector);
+ } else if (target instanceof OriginalElement) {
+ wrappedItem = wrap(originalElementQuerySelector.call(target, selector));
+ } else if (target instanceof OriginalDocument) {
+ wrappedItem = wrap(originalDocumentQuerySelector.call(target, selector));
+ } else {
+ return findOne(this, selector);
+ }
+ if (!wrappedItem) {
+ return wrappedItem;
+ } else if (!deep && (root = getTreeScope(wrappedItem).root)) {
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findOne(this, selector);
+ }
+ }
+ return wrappedItem;
+ },
+ querySelectorAll: function(selector) {
+ var shimmed = shimSelector(selector);
+ var deep = shimmed !== selector;
+ selector = shimmed;
+ var result = new NodeList();
+ result.length = querySelectorAllFiltered.call(this, matchesSelector, 0, result, selector, deep);
+ return result;
+ }
+ };
+ var MatchesInterface = {
+ matches: function(selector) {
+ selector = shimMatchesSelector(selector);
+ return scope.originalMatches.call(unsafeUnwrap(this), selector);
+ }
+ };
+ function getElementsByTagNameFiltered(p, index, result, localName, lowercase) {
+ var target = unsafeUnwrap(this);
+ var list;
+ var root = getTreeScope(this).root;
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findElements(this, index, result, p, localName, lowercase);
+ } else if (target instanceof OriginalElement) {
+ list = originalElementGetElementsByTagName.call(target, localName, lowercase);
+ } else if (target instanceof OriginalDocument) {
+ list = originalDocumentGetElementsByTagName.call(target, localName, lowercase);
+ } else {
+ return findElements(this, index, result, p, localName, lowercase);
+ }
+ return filterNodeList(list, index, result, false);
+ }
+ function getElementsByTagNameNSFiltered(p, index, result, ns, localName) {
+ var target = unsafeUnwrap(this);
+ var list;
+ var root = getTreeScope(this).root;
+ if (root instanceof scope.wrappers.ShadowRoot) {
+ return findElements(this, index, result, p, ns, localName);
+ } else if (target instanceof OriginalElement) {
+ list = originalElementGetElementsByTagNameNS.call(target, ns, localName);
+ } else if (target instanceof OriginalDocument) {
+ list = originalDocumentGetElementsByTagNameNS.call(target, ns, localName);
+ } else {
+ return findElements(this, index, result, p, ns, localName);
+ }
+ return filterNodeList(list, index, result, false);
+ }
+ var GetElementsByInterface = {
+ getElementsByTagName: function(localName) {
+ var result = new HTMLCollection();
+ var match = localName === "*" ? matchesEveryThing : matchesTagName;
+ result.length = getElementsByTagNameFiltered.call(this, match, 0, result, localName, localName.toLowerCase());
+ return result;
+ },
+ getElementsByClassName: function(className) {
+ return this.querySelectorAll("." + className);
+ },
+ getElementsByTagNameNS: function(ns, localName) {
+ var result = new HTMLCollection();
+ var match = null;
+ if (ns === "*") {
+ match = localName === "*" ? matchesEveryThing : matchesLocalNameOnly;
+ } else {
+ match = localName === "*" ? matchesNameSpace : matchesLocalNameNS;
+ }
+ result.length = getElementsByTagNameNSFiltered.call(this, match, 0, result, ns || null, localName);
+ return result;
+ }
+ };
+ scope.GetElementsByInterface = GetElementsByInterface;
+ scope.SelectorsInterface = SelectorsInterface;
+ scope.MatchesInterface = MatchesInterface;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var NodeList = scope.wrappers.NodeList;
+ function forwardElement(node) {
+ while (node && node.nodeType !== Node.ELEMENT_NODE) {
+ node = node.nextSibling;
+ }
+ return node;
+ }
+ function backwardsElement(node) {
+ while (node && node.nodeType !== Node.ELEMENT_NODE) {
+ node = node.previousSibling;
+ }
+ return node;
+ }
+ var ParentNodeInterface = {
+ get firstElementChild() {
+ return forwardElement(this.firstChild);
+ },
+ get lastElementChild() {
+ return backwardsElement(this.lastChild);
+ },
+ get childElementCount() {
+ var count = 0;
+ for (var child = this.firstElementChild; child; child = child.nextElementSibling) {
+ count++;
+ }
+ return count;
+ },
+ get children() {
+ var wrapperList = new NodeList();
+ var i = 0;
+ for (var child = this.firstElementChild; child; child = child.nextElementSibling) {
+ wrapperList[i++] = child;
+ }
+ wrapperList.length = i;
+ return wrapperList;
+ },
+ remove: function() {
+ var p = this.parentNode;
+ if (p) p.removeChild(this);
+ }
+ };
+ var ChildNodeInterface = {
+ get nextElementSibling() {
+ return forwardElement(this.nextSibling);
+ },
+ get previousElementSibling() {
+ return backwardsElement(this.previousSibling);
+ }
+ };
+ var NonElementParentNodeInterface = {
+ getElementById: function(id) {
+ if (/[ \t\n\r\f]/.test(id)) return null;
+ return this.querySelector('[id="' + id + '"]');
+ }
+ };
+ scope.ChildNodeInterface = ChildNodeInterface;
+ scope.NonElementParentNodeInterface = NonElementParentNodeInterface;
+ scope.ParentNodeInterface = ParentNodeInterface;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var ChildNodeInterface = scope.ChildNodeInterface;
+ var Node = scope.wrappers.Node;
+ var enqueueMutation = scope.enqueueMutation;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var OriginalCharacterData = window.CharacterData;
+ function CharacterData(node) {
+ Node.call(this, node);
+ }
+ CharacterData.prototype = Object.create(Node.prototype);
+ mixin(CharacterData.prototype, {
+ get nodeValue() {
+ return this.data;
+ },
+ set nodeValue(data) {
+ this.data = data;
+ },
+ get textContent() {
+ return this.data;
+ },
+ set textContent(value) {
+ this.data = value;
+ },
+ get data() {
+ return unsafeUnwrap(this).data;
+ },
+ set data(value) {
+ var oldValue = unsafeUnwrap(this).data;
+ enqueueMutation(this, "characterData", {
+ oldValue: oldValue
+ });
+ unsafeUnwrap(this).data = value;
+ }
+ });
+ mixin(CharacterData.prototype, ChildNodeInterface);
+ registerWrapper(OriginalCharacterData, CharacterData, document.createTextNode(""));
+ scope.wrappers.CharacterData = CharacterData;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var CharacterData = scope.wrappers.CharacterData;
+ var enqueueMutation = scope.enqueueMutation;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ function toUInt32(x) {
+ return x >>> 0;
+ }
+ var OriginalText = window.Text;
+ function Text(node) {
+ CharacterData.call(this, node);
+ }
+ Text.prototype = Object.create(CharacterData.prototype);
+ mixin(Text.prototype, {
+ splitText: function(offset) {
+ offset = toUInt32(offset);
+ var s = this.data;
+ if (offset > s.length) throw new Error("IndexSizeError");
+ var head = s.slice(0, offset);
+ var tail = s.slice(offset);
+ this.data = head;
+ var newTextNode = this.ownerDocument.createTextNode(tail);
+ if (this.parentNode) this.parentNode.insertBefore(newTextNode, this.nextSibling);
+ return newTextNode;
+ }
+ });
+ registerWrapper(OriginalText, Text, document.createTextNode(""));
+ scope.wrappers.Text = Text;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ if (!window.DOMTokenList) {
+ console.warn("Missing DOMTokenList prototype, please include a " + "compatible classList polyfill such as http://goo.gl/uTcepH.");
+ return;
+ }
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var enqueueMutation = scope.enqueueMutation;
+ function getClass(el) {
+ return unsafeUnwrap(el).getAttribute("class");
+ }
+ function enqueueClassAttributeChange(el, oldValue) {
+ enqueueMutation(el, "attributes", {
+ name: "class",
+ namespace: null,
+ oldValue: oldValue
+ });
+ }
+ function invalidateClass(el) {
+ scope.invalidateRendererBasedOnAttribute(el, "class");
+ }
+ function changeClass(tokenList, method, args) {
+ var ownerElement = tokenList.ownerElement_;
+ if (ownerElement == null) {
+ return method.apply(tokenList, args);
+ }
+ var oldValue = getClass(ownerElement);
+ var retv = method.apply(tokenList, args);
+ if (getClass(ownerElement) !== oldValue) {
+ enqueueClassAttributeChange(ownerElement, oldValue);
+ invalidateClass(ownerElement);
+ }
+ return retv;
+ }
+ var oldAdd = DOMTokenList.prototype.add;
+ DOMTokenList.prototype.add = function() {
+ changeClass(this, oldAdd, arguments);
+ };
+ var oldRemove = DOMTokenList.prototype.remove;
+ DOMTokenList.prototype.remove = function() {
+ changeClass(this, oldRemove, arguments);
+ };
+ var oldToggle = DOMTokenList.prototype.toggle;
+ DOMTokenList.prototype.toggle = function() {
+ return changeClass(this, oldToggle, arguments);
+ };
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var ChildNodeInterface = scope.ChildNodeInterface;
+ var GetElementsByInterface = scope.GetElementsByInterface;
+ var Node = scope.wrappers.Node;
+ var ParentNodeInterface = scope.ParentNodeInterface;
+ var SelectorsInterface = scope.SelectorsInterface;
+ var MatchesInterface = scope.MatchesInterface;
+ var addWrapNodeListMethod = scope.addWrapNodeListMethod;
+ var enqueueMutation = scope.enqueueMutation;
+ var mixin = scope.mixin;
+ var oneOf = scope.oneOf;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrappers = scope.wrappers;
+ var OriginalElement = window.Element;
+ var matchesNames = [ "matches", "mozMatchesSelector", "msMatchesSelector", "webkitMatchesSelector" ].filter(function(name) {
+ return OriginalElement.prototype[name];
+ });
+ var matchesName = matchesNames[0];
+ var originalMatches = OriginalElement.prototype[matchesName];
+ function invalidateRendererBasedOnAttribute(element, name) {
+ var p = element.parentNode;
+ if (!p || !p.shadowRoot) return;
+ var renderer = scope.getRendererForHost(p);
+ if (renderer.dependsOnAttribute(name)) renderer.invalidate();
+ }
+ function enqueAttributeChange(element, name, oldValue) {
+ enqueueMutation(element, "attributes", {
+ name: name,
+ namespace: null,
+ oldValue: oldValue
+ });
+ }
+ var classListTable = new WeakMap();
+ function Element(node) {
+ Node.call(this, node);
+ }
+ Element.prototype = Object.create(Node.prototype);
+ mixin(Element.prototype, {
+ createShadowRoot: function() {
+ var newShadowRoot = new wrappers.ShadowRoot(this);
+ unsafeUnwrap(this).polymerShadowRoot_ = newShadowRoot;
+ var renderer = scope.getRendererForHost(this);
+ renderer.invalidate();
+ return newShadowRoot;
+ },
+ get shadowRoot() {
+ return unsafeUnwrap(this).polymerShadowRoot_ || null;
+ },
+ setAttribute: function(name, value) {
+ var oldValue = unsafeUnwrap(this).getAttribute(name);
+ unsafeUnwrap(this).setAttribute(name, value);
+ enqueAttributeChange(this, name, oldValue);
+ invalidateRendererBasedOnAttribute(this, name);
+ },
+ removeAttribute: function(name) {
+ var oldValue = unsafeUnwrap(this).getAttribute(name);
+ unsafeUnwrap(this).removeAttribute(name);
+ enqueAttributeChange(this, name, oldValue);
+ invalidateRendererBasedOnAttribute(this, name);
+ },
+ get classList() {
+ var list = classListTable.get(this);
+ if (!list) {
+ list = unsafeUnwrap(this).classList;
+ if (!list) return;
+ list.ownerElement_ = this;
+ classListTable.set(this, list);
+ }
+ return list;
+ },
+ get className() {
+ return unsafeUnwrap(this).className;
+ },
+ set className(v) {
+ this.setAttribute("class", v);
+ },
+ get id() {
+ return unsafeUnwrap(this).id;
+ },
+ set id(v) {
+ this.setAttribute("id", v);
+ }
+ });
+ matchesNames.forEach(function(name) {
+ if (name !== "matches") {
+ Element.prototype[name] = function(selector) {
+ return this.matches(selector);
+ };
+ }
+ });
+ if (OriginalElement.prototype.webkitCreateShadowRoot) {
+ Element.prototype.webkitCreateShadowRoot = Element.prototype.createShadowRoot;
+ }
+ mixin(Element.prototype, ChildNodeInterface);
+ mixin(Element.prototype, GetElementsByInterface);
+ mixin(Element.prototype, ParentNodeInterface);
+ mixin(Element.prototype, SelectorsInterface);
+ mixin(Element.prototype, MatchesInterface);
+ registerWrapper(OriginalElement, Element, document.createElementNS(null, "x"));
+ scope.invalidateRendererBasedOnAttribute = invalidateRendererBasedOnAttribute;
+ scope.matchesNames = matchesNames;
+ scope.originalMatches = originalMatches;
+ scope.wrappers.Element = Element;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var Element = scope.wrappers.Element;
+ var defineGetter = scope.defineGetter;
+ var enqueueMutation = scope.enqueueMutation;
+ var mixin = scope.mixin;
+ var nodesWereAdded = scope.nodesWereAdded;
+ var nodesWereRemoved = scope.nodesWereRemoved;
+ var registerWrapper = scope.registerWrapper;
+ var snapshotNodeList = scope.snapshotNodeList;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var wrappers = scope.wrappers;
+ var escapeAttrRegExp = /[&\u00A0"]/g;
+ var escapeDataRegExp = /[&\u00A0<>]/g;
+ function escapeReplace(c) {
+ switch (c) {
+ case "&":
+ return "&";
+
+ case "<":
+ return "<";
+
+ case ">":
+ return ">";
+
+ case '"':
+ return """;
+
+ case " ":
+ return " ";
+ }
+ }
+ function escapeAttr(s) {
+ return s.replace(escapeAttrRegExp, escapeReplace);
+ }
+ function escapeData(s) {
+ return s.replace(escapeDataRegExp, escapeReplace);
+ }
+ function makeSet(arr) {
+ var set = {};
+ for (var i = 0; i < arr.length; i++) {
+ set[arr[i]] = true;
+ }
+ return set;
+ }
+ var voidElements = makeSet([ "area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr" ]);
+ var plaintextParents = makeSet([ "style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript" ]);
+ var XHTML_NS = "http://www.w3.org/1999/xhtml";
+ function needsSelfClosingSlash(node) {
+ if (node.namespaceURI !== XHTML_NS) return true;
+ var doctype = node.ownerDocument.doctype;
+ return doctype && doctype.publicId && doctype.systemId;
+ }
+ function getOuterHTML(node, parentNode) {
+ switch (node.nodeType) {
+ case Node.ELEMENT_NODE:
+ var tagName = node.tagName.toLowerCase();
+ var s = "<" + tagName;
+ var attrs = node.attributes;
+ for (var i = 0, attr; attr = attrs[i]; i++) {
+ s += " " + attr.name + '="' + escapeAttr(attr.value) + '"';
+ }
+ if (voidElements[tagName]) {
+ if (needsSelfClosingSlash(node)) s += "/";
+ return s + ">";
+ }
+ return s + ">" + getInnerHTML(node) + "" + tagName + ">";
+
+ case Node.TEXT_NODE:
+ var data = node.data;
+ if (parentNode && plaintextParents[parentNode.localName]) return data;
+ return escapeData(data);
+
+ case Node.COMMENT_NODE:
+ return "";
+
+ default:
+ console.error(node);
+ throw new Error("not implemented");
+ }
+ }
+ function getInnerHTML(node) {
+ if (node instanceof wrappers.HTMLTemplateElement) node = node.content;
+ var s = "";
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ s += getOuterHTML(child, node);
+ }
+ return s;
+ }
+ function setInnerHTML(node, value, opt_tagName) {
+ var tagName = opt_tagName || "div";
+ node.textContent = "";
+ var tempElement = unwrap(node.ownerDocument.createElement(tagName));
+ tempElement.innerHTML = value;
+ var firstChild;
+ while (firstChild = tempElement.firstChild) {
+ node.appendChild(wrap(firstChild));
+ }
+ }
+ var oldIe = /MSIE/.test(navigator.userAgent);
+ var OriginalHTMLElement = window.HTMLElement;
+ var OriginalHTMLTemplateElement = window.HTMLTemplateElement;
+ function HTMLElement(node) {
+ Element.call(this, node);
+ }
+ HTMLElement.prototype = Object.create(Element.prototype);
+ mixin(HTMLElement.prototype, {
+ get innerHTML() {
+ return getInnerHTML(this);
+ },
+ set innerHTML(value) {
+ if (oldIe && plaintextParents[this.localName]) {
+ this.textContent = value;
+ return;
+ }
+ var removedNodes = snapshotNodeList(this.childNodes);
+ if (this.invalidateShadowRenderer()) {
+ if (this instanceof wrappers.HTMLTemplateElement) setInnerHTML(this.content, value); else setInnerHTML(this, value, this.tagName);
+ } else if (!OriginalHTMLTemplateElement && this instanceof wrappers.HTMLTemplateElement) {
+ setInnerHTML(this.content, value);
+ } else {
+ unsafeUnwrap(this).innerHTML = value;
+ }
+ var addedNodes = snapshotNodeList(this.childNodes);
+ enqueueMutation(this, "childList", {
+ addedNodes: addedNodes,
+ removedNodes: removedNodes
+ });
+ nodesWereRemoved(removedNodes);
+ nodesWereAdded(addedNodes, this);
+ },
+ get outerHTML() {
+ return getOuterHTML(this, this.parentNode);
+ },
+ set outerHTML(value) {
+ var p = this.parentNode;
+ if (p) {
+ p.invalidateShadowRenderer();
+ var df = frag(p, value);
+ p.replaceChild(df, this);
+ }
+ },
+ insertAdjacentHTML: function(position, text) {
+ var contextElement, refNode;
+ switch (String(position).toLowerCase()) {
+ case "beforebegin":
+ contextElement = this.parentNode;
+ refNode = this;
+ break;
+
+ case "afterend":
+ contextElement = this.parentNode;
+ refNode = this.nextSibling;
+ break;
+
+ case "afterbegin":
+ contextElement = this;
+ refNode = this.firstChild;
+ break;
+
+ case "beforeend":
+ contextElement = this;
+ refNode = null;
+ break;
+
+ default:
+ return;
+ }
+ var df = frag(contextElement, text);
+ contextElement.insertBefore(df, refNode);
+ },
+ get hidden() {
+ return this.hasAttribute("hidden");
+ },
+ set hidden(v) {
+ if (v) {
+ this.setAttribute("hidden", "");
+ } else {
+ this.removeAttribute("hidden");
+ }
+ }
+ });
+ function frag(contextElement, html) {
+ var p = unwrap(contextElement.cloneNode(false));
+ p.innerHTML = html;
+ var df = unwrap(document.createDocumentFragment());
+ var c;
+ while (c = p.firstChild) {
+ df.appendChild(c);
+ }
+ return wrap(df);
+ }
+ function getter(name) {
+ return function() {
+ scope.renderAllPending();
+ return unsafeUnwrap(this)[name];
+ };
+ }
+ function getterRequiresRendering(name) {
+ defineGetter(HTMLElement, name, getter(name));
+ }
+ [ "clientHeight", "clientLeft", "clientTop", "clientWidth", "offsetHeight", "offsetLeft", "offsetTop", "offsetWidth", "scrollHeight", "scrollWidth" ].forEach(getterRequiresRendering);
+ function getterAndSetterRequiresRendering(name) {
+ Object.defineProperty(HTMLElement.prototype, name, {
+ get: getter(name),
+ set: function(v) {
+ scope.renderAllPending();
+ unsafeUnwrap(this)[name] = v;
+ },
+ configurable: true,
+ enumerable: true
+ });
+ }
+ [ "scrollLeft", "scrollTop" ].forEach(getterAndSetterRequiresRendering);
+ function methodRequiresRendering(name) {
+ Object.defineProperty(HTMLElement.prototype, name, {
+ value: function() {
+ scope.renderAllPending();
+ return unsafeUnwrap(this)[name].apply(unsafeUnwrap(this), arguments);
+ },
+ configurable: true,
+ enumerable: true
+ });
+ }
+ [ "getBoundingClientRect", "getClientRects", "scrollIntoView" ].forEach(methodRequiresRendering);
+ registerWrapper(OriginalHTMLElement, HTMLElement, document.createElement("b"));
+ scope.wrappers.HTMLElement = HTMLElement;
+ scope.getInnerHTML = getInnerHTML;
+ scope.setInnerHTML = setInnerHTML;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLCanvasElement = window.HTMLCanvasElement;
+ function HTMLCanvasElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLCanvasElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLCanvasElement.prototype, {
+ getContext: function() {
+ var context = unsafeUnwrap(this).getContext.apply(unsafeUnwrap(this), arguments);
+ return context && wrap(context);
+ }
+ });
+ registerWrapper(OriginalHTMLCanvasElement, HTMLCanvasElement, document.createElement("canvas"));
+ scope.wrappers.HTMLCanvasElement = HTMLCanvasElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var OriginalHTMLContentElement = window.HTMLContentElement;
+ function HTMLContentElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLContentElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLContentElement.prototype, {
+ constructor: HTMLContentElement,
+ get select() {
+ return this.getAttribute("select");
+ },
+ set select(value) {
+ this.setAttribute("select", value);
+ },
+ setAttribute: function(n, v) {
+ HTMLElement.prototype.setAttribute.call(this, n, v);
+ if (String(n).toLowerCase() === "select") this.invalidateShadowRenderer(true);
+ }
+ });
+ if (OriginalHTMLContentElement) registerWrapper(OriginalHTMLContentElement, HTMLContentElement);
+ scope.wrappers.HTMLContentElement = HTMLContentElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var wrapHTMLCollection = scope.wrapHTMLCollection;
+ var unwrap = scope.unwrap;
+ var OriginalHTMLFormElement = window.HTMLFormElement;
+ function HTMLFormElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLFormElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLFormElement.prototype, {
+ get elements() {
+ return wrapHTMLCollection(unwrap(this).elements);
+ }
+ });
+ registerWrapper(OriginalHTMLFormElement, HTMLFormElement, document.createElement("form"));
+ scope.wrappers.HTMLFormElement = HTMLFormElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var rewrap = scope.rewrap;
+ var OriginalHTMLImageElement = window.HTMLImageElement;
+ function HTMLImageElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLImageElement.prototype = Object.create(HTMLElement.prototype);
+ registerWrapper(OriginalHTMLImageElement, HTMLImageElement, document.createElement("img"));
+ function Image(width, height) {
+ if (!(this instanceof Image)) {
+ throw new TypeError("DOM object constructor cannot be called as a function.");
+ }
+ var node = unwrap(document.createElement("img"));
+ HTMLElement.call(this, node);
+ rewrap(node, this);
+ if (width !== undefined) node.width = width;
+ if (height !== undefined) node.height = height;
+ }
+ Image.prototype = HTMLImageElement.prototype;
+ scope.wrappers.HTMLImageElement = HTMLImageElement;
+ scope.wrappers.Image = Image;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var NodeList = scope.wrappers.NodeList;
+ var registerWrapper = scope.registerWrapper;
+ var OriginalHTMLShadowElement = window.HTMLShadowElement;
+ function HTMLShadowElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLShadowElement.prototype = Object.create(HTMLElement.prototype);
+ HTMLShadowElement.prototype.constructor = HTMLShadowElement;
+ if (OriginalHTMLShadowElement) registerWrapper(OriginalHTMLShadowElement, HTMLShadowElement);
+ scope.wrappers.HTMLShadowElement = HTMLShadowElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var contentTable = new WeakMap();
+ var templateContentsOwnerTable = new WeakMap();
+ function getTemplateContentsOwner(doc) {
+ if (!doc.defaultView) return doc;
+ var d = templateContentsOwnerTable.get(doc);
+ if (!d) {
+ d = doc.implementation.createHTMLDocument("");
+ while (d.lastChild) {
+ d.removeChild(d.lastChild);
+ }
+ templateContentsOwnerTable.set(doc, d);
+ }
+ return d;
+ }
+ function extractContent(templateElement) {
+ var doc = getTemplateContentsOwner(templateElement.ownerDocument);
+ var df = unwrap(doc.createDocumentFragment());
+ var child;
+ while (child = templateElement.firstChild) {
+ df.appendChild(child);
+ }
+ return df;
+ }
+ var OriginalHTMLTemplateElement = window.HTMLTemplateElement;
+ function HTMLTemplateElement(node) {
+ HTMLElement.call(this, node);
+ if (!OriginalHTMLTemplateElement) {
+ var content = extractContent(node);
+ contentTable.set(this, wrap(content));
+ }
+ }
+ HTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLTemplateElement.prototype, {
+ constructor: HTMLTemplateElement,
+ get content() {
+ if (OriginalHTMLTemplateElement) return wrap(unsafeUnwrap(this).content);
+ return contentTable.get(this);
+ }
+ });
+ if (OriginalHTMLTemplateElement) registerWrapper(OriginalHTMLTemplateElement, HTMLTemplateElement);
+ scope.wrappers.HTMLTemplateElement = HTMLTemplateElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var registerWrapper = scope.registerWrapper;
+ var OriginalHTMLMediaElement = window.HTMLMediaElement;
+ if (!OriginalHTMLMediaElement) return;
+ function HTMLMediaElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLMediaElement.prototype = Object.create(HTMLElement.prototype);
+ registerWrapper(OriginalHTMLMediaElement, HTMLMediaElement, document.createElement("audio"));
+ scope.wrappers.HTMLMediaElement = HTMLMediaElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLMediaElement = scope.wrappers.HTMLMediaElement;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var rewrap = scope.rewrap;
+ var OriginalHTMLAudioElement = window.HTMLAudioElement;
+ if (!OriginalHTMLAudioElement) return;
+ function HTMLAudioElement(node) {
+ HTMLMediaElement.call(this, node);
+ }
+ HTMLAudioElement.prototype = Object.create(HTMLMediaElement.prototype);
+ registerWrapper(OriginalHTMLAudioElement, HTMLAudioElement, document.createElement("audio"));
+ function Audio(src) {
+ if (!(this instanceof Audio)) {
+ throw new TypeError("DOM object constructor cannot be called as a function.");
+ }
+ var node = unwrap(document.createElement("audio"));
+ HTMLMediaElement.call(this, node);
+ rewrap(node, this);
+ node.setAttribute("preload", "auto");
+ if (src !== undefined) node.setAttribute("src", src);
+ }
+ Audio.prototype = HTMLAudioElement.prototype;
+ scope.wrappers.HTMLAudioElement = HTMLAudioElement;
+ scope.wrappers.Audio = Audio;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var rewrap = scope.rewrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLOptionElement = window.HTMLOptionElement;
+ function trimText(s) {
+ return s.replace(/\s+/g, " ").trim();
+ }
+ function HTMLOptionElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLOptionElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLOptionElement.prototype, {
+ get text() {
+ return trimText(this.textContent);
+ },
+ set text(value) {
+ this.textContent = trimText(String(value));
+ },
+ get form() {
+ return wrap(unwrap(this).form);
+ }
+ });
+ registerWrapper(OriginalHTMLOptionElement, HTMLOptionElement, document.createElement("option"));
+ function Option(text, value, defaultSelected, selected) {
+ if (!(this instanceof Option)) {
+ throw new TypeError("DOM object constructor cannot be called as a function.");
+ }
+ var node = unwrap(document.createElement("option"));
+ HTMLElement.call(this, node);
+ rewrap(node, this);
+ if (text !== undefined) node.text = text;
+ if (value !== undefined) node.setAttribute("value", value);
+ if (defaultSelected === true) node.setAttribute("selected", "");
+ node.selected = selected === true;
+ }
+ Option.prototype = HTMLOptionElement.prototype;
+ scope.wrappers.HTMLOptionElement = HTMLOptionElement;
+ scope.wrappers.Option = Option;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLSelectElement = window.HTMLSelectElement;
+ function HTMLSelectElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLSelectElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLSelectElement.prototype, {
+ add: function(element, before) {
+ if (typeof before === "object") before = unwrap(before);
+ unwrap(this).add(unwrap(element), before);
+ },
+ remove: function(indexOrNode) {
+ if (indexOrNode === undefined) {
+ HTMLElement.prototype.remove.call(this);
+ return;
+ }
+ if (typeof indexOrNode === "object") indexOrNode = unwrap(indexOrNode);
+ unwrap(this).remove(indexOrNode);
+ },
+ get form() {
+ return wrap(unwrap(this).form);
+ }
+ });
+ registerWrapper(OriginalHTMLSelectElement, HTMLSelectElement, document.createElement("select"));
+ scope.wrappers.HTMLSelectElement = HTMLSelectElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var wrapHTMLCollection = scope.wrapHTMLCollection;
+ var OriginalHTMLTableElement = window.HTMLTableElement;
+ function HTMLTableElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLTableElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLTableElement.prototype, {
+ get caption() {
+ return wrap(unwrap(this).caption);
+ },
+ createCaption: function() {
+ return wrap(unwrap(this).createCaption());
+ },
+ get tHead() {
+ return wrap(unwrap(this).tHead);
+ },
+ createTHead: function() {
+ return wrap(unwrap(this).createTHead());
+ },
+ createTFoot: function() {
+ return wrap(unwrap(this).createTFoot());
+ },
+ get tFoot() {
+ return wrap(unwrap(this).tFoot);
+ },
+ get tBodies() {
+ return wrapHTMLCollection(unwrap(this).tBodies);
+ },
+ createTBody: function() {
+ return wrap(unwrap(this).createTBody());
+ },
+ get rows() {
+ return wrapHTMLCollection(unwrap(this).rows);
+ },
+ insertRow: function(index) {
+ return wrap(unwrap(this).insertRow(index));
+ }
+ });
+ registerWrapper(OriginalHTMLTableElement, HTMLTableElement, document.createElement("table"));
+ scope.wrappers.HTMLTableElement = HTMLTableElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var wrapHTMLCollection = scope.wrapHTMLCollection;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLTableSectionElement = window.HTMLTableSectionElement;
+ function HTMLTableSectionElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLTableSectionElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLTableSectionElement.prototype, {
+ constructor: HTMLTableSectionElement,
+ get rows() {
+ return wrapHTMLCollection(unwrap(this).rows);
+ },
+ insertRow: function(index) {
+ return wrap(unwrap(this).insertRow(index));
+ }
+ });
+ registerWrapper(OriginalHTMLTableSectionElement, HTMLTableSectionElement, document.createElement("thead"));
+ scope.wrappers.HTMLTableSectionElement = HTMLTableSectionElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var wrapHTMLCollection = scope.wrapHTMLCollection;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalHTMLTableRowElement = window.HTMLTableRowElement;
+ function HTMLTableRowElement(node) {
+ HTMLElement.call(this, node);
+ }
+ HTMLTableRowElement.prototype = Object.create(HTMLElement.prototype);
+ mixin(HTMLTableRowElement.prototype, {
+ get cells() {
+ return wrapHTMLCollection(unwrap(this).cells);
+ },
+ insertCell: function(index) {
+ return wrap(unwrap(this).insertCell(index));
+ }
+ });
+ registerWrapper(OriginalHTMLTableRowElement, HTMLTableRowElement, document.createElement("tr"));
+ scope.wrappers.HTMLTableRowElement = HTMLTableRowElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLContentElement = scope.wrappers.HTMLContentElement;
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var HTMLShadowElement = scope.wrappers.HTMLShadowElement;
+ var HTMLTemplateElement = scope.wrappers.HTMLTemplateElement;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var OriginalHTMLUnknownElement = window.HTMLUnknownElement;
+ function HTMLUnknownElement(node) {
+ switch (node.localName) {
+ case "content":
+ return new HTMLContentElement(node);
+
+ case "shadow":
+ return new HTMLShadowElement(node);
+
+ case "template":
+ return new HTMLTemplateElement(node);
+ }
+ HTMLElement.call(this, node);
+ }
+ HTMLUnknownElement.prototype = Object.create(HTMLElement.prototype);
+ registerWrapper(OriginalHTMLUnknownElement, HTMLUnknownElement);
+ scope.wrappers.HTMLUnknownElement = HTMLUnknownElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var Element = scope.wrappers.Element;
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var registerObject = scope.registerObject;
+ var defineWrapGetter = scope.defineWrapGetter;
+ var SVG_NS = "http://www.w3.org/2000/svg";
+ var svgTitleElement = document.createElementNS(SVG_NS, "title");
+ var SVGTitleElement = registerObject(svgTitleElement);
+ var SVGElement = Object.getPrototypeOf(SVGTitleElement.prototype).constructor;
+ if (!("classList" in svgTitleElement)) {
+ var descr = Object.getOwnPropertyDescriptor(Element.prototype, "classList");
+ Object.defineProperty(HTMLElement.prototype, "classList", descr);
+ delete Element.prototype.classList;
+ }
+ defineWrapGetter(SVGElement, "ownerSVGElement");
+ scope.wrappers.SVGElement = SVGElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var OriginalSVGUseElement = window.SVGUseElement;
+ var SVG_NS = "http://www.w3.org/2000/svg";
+ var gWrapper = wrap(document.createElementNS(SVG_NS, "g"));
+ var useElement = document.createElementNS(SVG_NS, "use");
+ var SVGGElement = gWrapper.constructor;
+ var parentInterfacePrototype = Object.getPrototypeOf(SVGGElement.prototype);
+ var parentInterface = parentInterfacePrototype.constructor;
+ function SVGUseElement(impl) {
+ parentInterface.call(this, impl);
+ }
+ SVGUseElement.prototype = Object.create(parentInterfacePrototype);
+ if ("instanceRoot" in useElement) {
+ mixin(SVGUseElement.prototype, {
+ get instanceRoot() {
+ return wrap(unwrap(this).instanceRoot);
+ },
+ get animatedInstanceRoot() {
+ return wrap(unwrap(this).animatedInstanceRoot);
+ }
+ });
+ }
+ registerWrapper(OriginalSVGUseElement, SVGUseElement, useElement);
+ scope.wrappers.SVGUseElement = SVGUseElement;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var EventTarget = scope.wrappers.EventTarget;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var wrap = scope.wrap;
+ var OriginalSVGElementInstance = window.SVGElementInstance;
+ if (!OriginalSVGElementInstance) return;
+ function SVGElementInstance(impl) {
+ EventTarget.call(this, impl);
+ }
+ SVGElementInstance.prototype = Object.create(EventTarget.prototype);
+ mixin(SVGElementInstance.prototype, {
+ get correspondingElement() {
+ return wrap(unsafeUnwrap(this).correspondingElement);
+ },
+ get correspondingUseElement() {
+ return wrap(unsafeUnwrap(this).correspondingUseElement);
+ },
+ get parentNode() {
+ return wrap(unsafeUnwrap(this).parentNode);
+ },
+ get childNodes() {
+ throw new Error("Not implemented");
+ },
+ get firstChild() {
+ return wrap(unsafeUnwrap(this).firstChild);
+ },
+ get lastChild() {
+ return wrap(unsafeUnwrap(this).lastChild);
+ },
+ get previousSibling() {
+ return wrap(unsafeUnwrap(this).previousSibling);
+ },
+ get nextSibling() {
+ return wrap(unsafeUnwrap(this).nextSibling);
+ }
+ });
+ registerWrapper(OriginalSVGElementInstance, SVGElementInstance);
+ scope.wrappers.SVGElementInstance = SVGElementInstance;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalCanvasRenderingContext2D = window.CanvasRenderingContext2D;
+ function CanvasRenderingContext2D(impl) {
+ setWrapper(impl, this);
+ }
+ mixin(CanvasRenderingContext2D.prototype, {
+ get canvas() {
+ return wrap(unsafeUnwrap(this).canvas);
+ },
+ drawImage: function() {
+ arguments[0] = unwrapIfNeeded(arguments[0]);
+ unsafeUnwrap(this).drawImage.apply(unsafeUnwrap(this), arguments);
+ },
+ createPattern: function() {
+ arguments[0] = unwrap(arguments[0]);
+ return unsafeUnwrap(this).createPattern.apply(unsafeUnwrap(this), arguments);
+ }
+ });
+ registerWrapper(OriginalCanvasRenderingContext2D, CanvasRenderingContext2D, document.createElement("canvas").getContext("2d"));
+ scope.wrappers.CanvasRenderingContext2D = CanvasRenderingContext2D;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalWebGLRenderingContext = window.WebGLRenderingContext;
+ if (!OriginalWebGLRenderingContext) return;
+ function WebGLRenderingContext(impl) {
+ setWrapper(impl, this);
+ }
+ mixin(WebGLRenderingContext.prototype, {
+ get canvas() {
+ return wrap(unsafeUnwrap(this).canvas);
+ },
+ texImage2D: function() {
+ arguments[5] = unwrapIfNeeded(arguments[5]);
+ unsafeUnwrap(this).texImage2D.apply(unsafeUnwrap(this), arguments);
+ },
+ texSubImage2D: function() {
+ arguments[6] = unwrapIfNeeded(arguments[6]);
+ unsafeUnwrap(this).texSubImage2D.apply(unsafeUnwrap(this), arguments);
+ }
+ });
+ var instanceProperties = /WebKit/.test(navigator.userAgent) ? {
+ drawingBufferHeight: null,
+ drawingBufferWidth: null
+ } : {};
+ registerWrapper(OriginalWebGLRenderingContext, WebGLRenderingContext, instanceProperties);
+ scope.wrappers.WebGLRenderingContext = WebGLRenderingContext;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var GetElementsByInterface = scope.GetElementsByInterface;
+ var NonElementParentNodeInterface = scope.NonElementParentNodeInterface;
+ var ParentNodeInterface = scope.ParentNodeInterface;
+ var SelectorsInterface = scope.SelectorsInterface;
+ var mixin = scope.mixin;
+ var registerObject = scope.registerObject;
+ var DocumentFragment = registerObject(document.createDocumentFragment());
+ mixin(DocumentFragment.prototype, ParentNodeInterface);
+ mixin(DocumentFragment.prototype, SelectorsInterface);
+ mixin(DocumentFragment.prototype, GetElementsByInterface);
+ mixin(DocumentFragment.prototype, NonElementParentNodeInterface);
+ var Comment = registerObject(document.createComment(""));
+ scope.wrappers.Comment = Comment;
+ scope.wrappers.DocumentFragment = DocumentFragment;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var DocumentFragment = scope.wrappers.DocumentFragment;
+ var TreeScope = scope.TreeScope;
+ var elementFromPoint = scope.elementFromPoint;
+ var getInnerHTML = scope.getInnerHTML;
+ var getTreeScope = scope.getTreeScope;
+ var mixin = scope.mixin;
+ var rewrap = scope.rewrap;
+ var setInnerHTML = scope.setInnerHTML;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var shadowHostTable = new WeakMap();
+ var nextOlderShadowTreeTable = new WeakMap();
+ function ShadowRoot(hostWrapper) {
+ var node = unwrap(unsafeUnwrap(hostWrapper).ownerDocument.createDocumentFragment());
+ DocumentFragment.call(this, node);
+ rewrap(node, this);
+ var oldShadowRoot = hostWrapper.shadowRoot;
+ nextOlderShadowTreeTable.set(this, oldShadowRoot);
+ this.treeScope_ = new TreeScope(this, getTreeScope(oldShadowRoot || hostWrapper));
+ shadowHostTable.set(this, hostWrapper);
+ }
+ ShadowRoot.prototype = Object.create(DocumentFragment.prototype);
+ mixin(ShadowRoot.prototype, {
+ constructor: ShadowRoot,
+ get innerHTML() {
+ return getInnerHTML(this);
+ },
+ set innerHTML(value) {
+ setInnerHTML(this, value);
+ this.invalidateShadowRenderer();
+ },
+ get olderShadowRoot() {
+ return nextOlderShadowTreeTable.get(this) || null;
+ },
+ get host() {
+ return shadowHostTable.get(this) || null;
+ },
+ invalidateShadowRenderer: function() {
+ return shadowHostTable.get(this).invalidateShadowRenderer();
+ },
+ elementFromPoint: function(x, y) {
+ return elementFromPoint(this, this.ownerDocument, x, y);
+ }
+ });
+ scope.wrappers.ShadowRoot = ShadowRoot;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var getTreeScope = scope.getTreeScope;
+ var OriginalRange = window.Range;
+ var ShadowRoot = scope.wrappers.ShadowRoot;
+ function getHost(node) {
+ var root = getTreeScope(node).root;
+ if (root instanceof ShadowRoot) {
+ return root.host;
+ }
+ return null;
+ }
+ function hostNodeToShadowNode(refNode, offset) {
+ if (refNode.shadowRoot) {
+ offset = Math.min(refNode.childNodes.length - 1, offset);
+ var child = refNode.childNodes[offset];
+ if (child) {
+ var insertionPoint = scope.getDestinationInsertionPoints(child);
+ if (insertionPoint.length > 0) {
+ var parentNode = insertionPoint[0].parentNode;
+ if (parentNode.nodeType == Node.ELEMENT_NODE) {
+ refNode = parentNode;
+ }
+ }
+ }
+ }
+ return refNode;
+ }
+ function shadowNodeToHostNode(node) {
+ node = wrap(node);
+ return getHost(node) || node;
+ }
+ function Range(impl) {
+ setWrapper(impl, this);
+ }
+ Range.prototype = {
+ get startContainer() {
+ return shadowNodeToHostNode(unsafeUnwrap(this).startContainer);
+ },
+ get endContainer() {
+ return shadowNodeToHostNode(unsafeUnwrap(this).endContainer);
+ },
+ get commonAncestorContainer() {
+ return shadowNodeToHostNode(unsafeUnwrap(this).commonAncestorContainer);
+ },
+ setStart: function(refNode, offset) {
+ refNode = hostNodeToShadowNode(refNode, offset);
+ unsafeUnwrap(this).setStart(unwrapIfNeeded(refNode), offset);
+ },
+ setEnd: function(refNode, offset) {
+ refNode = hostNodeToShadowNode(refNode, offset);
+ unsafeUnwrap(this).setEnd(unwrapIfNeeded(refNode), offset);
+ },
+ setStartBefore: function(refNode) {
+ unsafeUnwrap(this).setStartBefore(unwrapIfNeeded(refNode));
+ },
+ setStartAfter: function(refNode) {
+ unsafeUnwrap(this).setStartAfter(unwrapIfNeeded(refNode));
+ },
+ setEndBefore: function(refNode) {
+ unsafeUnwrap(this).setEndBefore(unwrapIfNeeded(refNode));
+ },
+ setEndAfter: function(refNode) {
+ unsafeUnwrap(this).setEndAfter(unwrapIfNeeded(refNode));
+ },
+ selectNode: function(refNode) {
+ unsafeUnwrap(this).selectNode(unwrapIfNeeded(refNode));
+ },
+ selectNodeContents: function(refNode) {
+ unsafeUnwrap(this).selectNodeContents(unwrapIfNeeded(refNode));
+ },
+ compareBoundaryPoints: function(how, sourceRange) {
+ return unsafeUnwrap(this).compareBoundaryPoints(how, unwrap(sourceRange));
+ },
+ extractContents: function() {
+ return wrap(unsafeUnwrap(this).extractContents());
+ },
+ cloneContents: function() {
+ return wrap(unsafeUnwrap(this).cloneContents());
+ },
+ insertNode: function(node) {
+ unsafeUnwrap(this).insertNode(unwrapIfNeeded(node));
+ },
+ surroundContents: function(newParent) {
+ unsafeUnwrap(this).surroundContents(unwrapIfNeeded(newParent));
+ },
+ cloneRange: function() {
+ return wrap(unsafeUnwrap(this).cloneRange());
+ },
+ isPointInRange: function(node, offset) {
+ return unsafeUnwrap(this).isPointInRange(unwrapIfNeeded(node), offset);
+ },
+ comparePoint: function(node, offset) {
+ return unsafeUnwrap(this).comparePoint(unwrapIfNeeded(node), offset);
+ },
+ intersectsNode: function(node) {
+ return unsafeUnwrap(this).intersectsNode(unwrapIfNeeded(node));
+ },
+ toString: function() {
+ return unsafeUnwrap(this).toString();
+ }
+ };
+ if (OriginalRange.prototype.createContextualFragment) {
+ Range.prototype.createContextualFragment = function(html) {
+ return wrap(unsafeUnwrap(this).createContextualFragment(html));
+ };
+ }
+ registerWrapper(window.Range, Range, document.createRange());
+ scope.wrappers.Range = Range;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var Element = scope.wrappers.Element;
+ var HTMLContentElement = scope.wrappers.HTMLContentElement;
+ var HTMLShadowElement = scope.wrappers.HTMLShadowElement;
+ var Node = scope.wrappers.Node;
+ var ShadowRoot = scope.wrappers.ShadowRoot;
+ var assert = scope.assert;
+ var getTreeScope = scope.getTreeScope;
+ var mixin = scope.mixin;
+ var oneOf = scope.oneOf;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var ArraySplice = scope.ArraySplice;
+ function updateWrapperUpAndSideways(wrapper) {
+ wrapper.previousSibling_ = wrapper.previousSibling;
+ wrapper.nextSibling_ = wrapper.nextSibling;
+ wrapper.parentNode_ = wrapper.parentNode;
+ }
+ function updateWrapperDown(wrapper) {
+ wrapper.firstChild_ = wrapper.firstChild;
+ wrapper.lastChild_ = wrapper.lastChild;
+ }
+ function updateAllChildNodes(parentNodeWrapper) {
+ assert(parentNodeWrapper instanceof Node);
+ for (var childWrapper = parentNodeWrapper.firstChild; childWrapper; childWrapper = childWrapper.nextSibling) {
+ updateWrapperUpAndSideways(childWrapper);
+ }
+ updateWrapperDown(parentNodeWrapper);
+ }
+ function insertBefore(parentNodeWrapper, newChildWrapper, refChildWrapper) {
+ var parentNode = unwrap(parentNodeWrapper);
+ var newChild = unwrap(newChildWrapper);
+ var refChild = refChildWrapper ? unwrap(refChildWrapper) : null;
+ remove(newChildWrapper);
+ updateWrapperUpAndSideways(newChildWrapper);
+ if (!refChildWrapper) {
+ parentNodeWrapper.lastChild_ = parentNodeWrapper.lastChild;
+ if (parentNodeWrapper.lastChild === parentNodeWrapper.firstChild) parentNodeWrapper.firstChild_ = parentNodeWrapper.firstChild;
+ var lastChildWrapper = wrap(parentNode.lastChild);
+ if (lastChildWrapper) lastChildWrapper.nextSibling_ = lastChildWrapper.nextSibling;
+ } else {
+ if (parentNodeWrapper.firstChild === refChildWrapper) parentNodeWrapper.firstChild_ = refChildWrapper;
+ refChildWrapper.previousSibling_ = refChildWrapper.previousSibling;
+ }
+ scope.originalInsertBefore.call(parentNode, newChild, refChild);
+ }
+ function remove(nodeWrapper) {
+ var node = unwrap(nodeWrapper);
+ var parentNode = node.parentNode;
+ if (!parentNode) return;
+ var parentNodeWrapper = wrap(parentNode);
+ updateWrapperUpAndSideways(nodeWrapper);
+ if (nodeWrapper.previousSibling) nodeWrapper.previousSibling.nextSibling_ = nodeWrapper;
+ if (nodeWrapper.nextSibling) nodeWrapper.nextSibling.previousSibling_ = nodeWrapper;
+ if (parentNodeWrapper.lastChild === nodeWrapper) parentNodeWrapper.lastChild_ = nodeWrapper;
+ if (parentNodeWrapper.firstChild === nodeWrapper) parentNodeWrapper.firstChild_ = nodeWrapper;
+ scope.originalRemoveChild.call(parentNode, node);
+ }
+ var distributedNodesTable = new WeakMap();
+ var destinationInsertionPointsTable = new WeakMap();
+ var rendererForHostTable = new WeakMap();
+ function resetDistributedNodes(insertionPoint) {
+ distributedNodesTable.set(insertionPoint, []);
+ }
+ function getDistributedNodes(insertionPoint) {
+ var rv = distributedNodesTable.get(insertionPoint);
+ if (!rv) distributedNodesTable.set(insertionPoint, rv = []);
+ return rv;
+ }
+ function getChildNodesSnapshot(node) {
+ var result = [], i = 0;
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ result[i++] = child;
+ }
+ return result;
+ }
+ var request = oneOf(window, [ "requestAnimationFrame", "mozRequestAnimationFrame", "webkitRequestAnimationFrame", "setTimeout" ]);
+ var pendingDirtyRenderers = [];
+ var renderTimer;
+ function renderAllPending() {
+ for (var i = 0; i < pendingDirtyRenderers.length; i++) {
+ var renderer = pendingDirtyRenderers[i];
+ var parentRenderer = renderer.parentRenderer;
+ if (parentRenderer && parentRenderer.dirty) continue;
+ renderer.render();
+ }
+ pendingDirtyRenderers = [];
+ }
+ function handleRequestAnimationFrame() {
+ renderTimer = null;
+ renderAllPending();
+ }
+ function getRendererForHost(host) {
+ var renderer = rendererForHostTable.get(host);
+ if (!renderer) {
+ renderer = new ShadowRenderer(host);
+ rendererForHostTable.set(host, renderer);
+ }
+ return renderer;
+ }
+ function getShadowRootAncestor(node) {
+ var root = getTreeScope(node).root;
+ if (root instanceof ShadowRoot) return root;
+ return null;
+ }
+ function getRendererForShadowRoot(shadowRoot) {
+ return getRendererForHost(shadowRoot.host);
+ }
+ var spliceDiff = new ArraySplice();
+ spliceDiff.equals = function(renderNode, rawNode) {
+ return unwrap(renderNode.node) === rawNode;
+ };
+ function RenderNode(node) {
+ this.skip = false;
+ this.node = node;
+ this.childNodes = [];
+ }
+ RenderNode.prototype = {
+ append: function(node) {
+ var rv = new RenderNode(node);
+ this.childNodes.push(rv);
+ return rv;
+ },
+ sync: function(opt_added) {
+ if (this.skip) return;
+ var nodeWrapper = this.node;
+ var newChildren = this.childNodes;
+ var oldChildren = getChildNodesSnapshot(unwrap(nodeWrapper));
+ var added = opt_added || new WeakMap();
+ var splices = spliceDiff.calculateSplices(newChildren, oldChildren);
+ var newIndex = 0, oldIndex = 0;
+ var lastIndex = 0;
+ for (var i = 0; i < splices.length; i++) {
+ var splice = splices[i];
+ for (;lastIndex < splice.index; lastIndex++) {
+ oldIndex++;
+ newChildren[newIndex++].sync(added);
+ }
+ var removedCount = splice.removed.length;
+ for (var j = 0; j < removedCount; j++) {
+ var wrapper = wrap(oldChildren[oldIndex++]);
+ if (!added.get(wrapper)) remove(wrapper);
+ }
+ var addedCount = splice.addedCount;
+ var refNode = oldChildren[oldIndex] && wrap(oldChildren[oldIndex]);
+ for (var j = 0; j < addedCount; j++) {
+ var newChildRenderNode = newChildren[newIndex++];
+ var newChildWrapper = newChildRenderNode.node;
+ insertBefore(nodeWrapper, newChildWrapper, refNode);
+ added.set(newChildWrapper, true);
+ newChildRenderNode.sync(added);
+ }
+ lastIndex += addedCount;
+ }
+ for (var i = lastIndex; i < newChildren.length; i++) {
+ newChildren[i].sync(added);
+ }
+ }
+ };
+ function ShadowRenderer(host) {
+ this.host = host;
+ this.dirty = false;
+ this.invalidateAttributes();
+ this.associateNode(host);
+ }
+ ShadowRenderer.prototype = {
+ render: function(opt_renderNode) {
+ if (!this.dirty) return;
+ this.invalidateAttributes();
+ var host = this.host;
+ this.distribution(host);
+ var renderNode = opt_renderNode || new RenderNode(host);
+ this.buildRenderTree(renderNode, host);
+ var topMostRenderer = !opt_renderNode;
+ if (topMostRenderer) renderNode.sync();
+ this.dirty = false;
+ },
+ get parentRenderer() {
+ return getTreeScope(this.host).renderer;
+ },
+ invalidate: function() {
+ if (!this.dirty) {
+ this.dirty = true;
+ var parentRenderer = this.parentRenderer;
+ if (parentRenderer) parentRenderer.invalidate();
+ pendingDirtyRenderers.push(this);
+ if (renderTimer) return;
+ renderTimer = window[request](handleRequestAnimationFrame, 0);
+ }
+ },
+ distribution: function(root) {
+ this.resetAllSubtrees(root);
+ this.distributionResolution(root);
+ },
+ resetAll: function(node) {
+ if (isInsertionPoint(node)) resetDistributedNodes(node); else resetDestinationInsertionPoints(node);
+ this.resetAllSubtrees(node);
+ },
+ resetAllSubtrees: function(node) {
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ this.resetAll(child);
+ }
+ if (node.shadowRoot) this.resetAll(node.shadowRoot);
+ if (node.olderShadowRoot) this.resetAll(node.olderShadowRoot);
+ },
+ distributionResolution: function(node) {
+ if (isShadowHost(node)) {
+ var shadowHost = node;
+ var pool = poolPopulation(shadowHost);
+ var shadowTrees = getShadowTrees(shadowHost);
+ for (var i = 0; i < shadowTrees.length; i++) {
+ this.poolDistribution(shadowTrees[i], pool);
+ }
+ for (var i = shadowTrees.length - 1; i >= 0; i--) {
+ var shadowTree = shadowTrees[i];
+ var shadow = getShadowInsertionPoint(shadowTree);
+ if (shadow) {
+ var olderShadowRoot = shadowTree.olderShadowRoot;
+ if (olderShadowRoot) {
+ pool = poolPopulation(olderShadowRoot);
+ }
+ for (var j = 0; j < pool.length; j++) {
+ destributeNodeInto(pool[j], shadow);
+ }
+ }
+ this.distributionResolution(shadowTree);
+ }
+ }
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ this.distributionResolution(child);
+ }
+ },
+ poolDistribution: function(node, pool) {
+ if (node instanceof HTMLShadowElement) return;
+ if (node instanceof HTMLContentElement) {
+ var content = node;
+ this.updateDependentAttributes(content.getAttribute("select"));
+ var anyDistributed = false;
+ for (var i = 0; i < pool.length; i++) {
+ var node = pool[i];
+ if (!node) continue;
+ if (matches(node, content)) {
+ destributeNodeInto(node, content);
+ pool[i] = undefined;
+ anyDistributed = true;
+ }
+ }
+ if (!anyDistributed) {
+ for (var child = content.firstChild; child; child = child.nextSibling) {
+ destributeNodeInto(child, content);
+ }
+ }
+ return;
+ }
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ this.poolDistribution(child, pool);
+ }
+ },
+ buildRenderTree: function(renderNode, node) {
+ var children = this.compose(node);
+ for (var i = 0; i < children.length; i++) {
+ var child = children[i];
+ var childRenderNode = renderNode.append(child);
+ this.buildRenderTree(childRenderNode, child);
+ }
+ if (isShadowHost(node)) {
+ var renderer = getRendererForHost(node);
+ renderer.dirty = false;
+ }
+ },
+ compose: function(node) {
+ var children = [];
+ var p = node.shadowRoot || node;
+ for (var child = p.firstChild; child; child = child.nextSibling) {
+ if (isInsertionPoint(child)) {
+ this.associateNode(p);
+ var distributedNodes = getDistributedNodes(child);
+ for (var j = 0; j < distributedNodes.length; j++) {
+ var distributedNode = distributedNodes[j];
+ if (isFinalDestination(child, distributedNode)) children.push(distributedNode);
+ }
+ } else {
+ children.push(child);
+ }
+ }
+ return children;
+ },
+ invalidateAttributes: function() {
+ this.attributes = Object.create(null);
+ },
+ updateDependentAttributes: function(selector) {
+ if (!selector) return;
+ var attributes = this.attributes;
+ if (/\.\w+/.test(selector)) attributes["class"] = true;
+ if (/#\w+/.test(selector)) attributes["id"] = true;
+ selector.replace(/\[\s*([^\s=\|~\]]+)/g, function(_, name) {
+ attributes[name] = true;
+ });
+ },
+ dependsOnAttribute: function(name) {
+ return this.attributes[name];
+ },
+ associateNode: function(node) {
+ unsafeUnwrap(node).polymerShadowRenderer_ = this;
+ }
+ };
+ function poolPopulation(node) {
+ var pool = [];
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ if (isInsertionPoint(child)) {
+ pool.push.apply(pool, getDistributedNodes(child));
+ } else {
+ pool.push(child);
+ }
+ }
+ return pool;
+ }
+ function getShadowInsertionPoint(node) {
+ if (node instanceof HTMLShadowElement) return node;
+ if (node instanceof HTMLContentElement) return null;
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ var res = getShadowInsertionPoint(child);
+ if (res) return res;
+ }
+ return null;
+ }
+ function destributeNodeInto(child, insertionPoint) {
+ getDistributedNodes(insertionPoint).push(child);
+ var points = destinationInsertionPointsTable.get(child);
+ if (!points) destinationInsertionPointsTable.set(child, [ insertionPoint ]); else points.push(insertionPoint);
+ }
+ function getDestinationInsertionPoints(node) {
+ return destinationInsertionPointsTable.get(node);
+ }
+ function resetDestinationInsertionPoints(node) {
+ destinationInsertionPointsTable.set(node, undefined);
+ }
+ var selectorStartCharRe = /^(:not\()?[*.#[a-zA-Z_|]/;
+ function matches(node, contentElement) {
+ var select = contentElement.getAttribute("select");
+ if (!select) return true;
+ select = select.trim();
+ if (!select) return true;
+ if (!(node instanceof Element)) return false;
+ if (!selectorStartCharRe.test(select)) return false;
+ try {
+ return node.matches(select);
+ } catch (ex) {
+ return false;
+ }
+ }
+ function isFinalDestination(insertionPoint, node) {
+ var points = getDestinationInsertionPoints(node);
+ return points && points[points.length - 1] === insertionPoint;
+ }
+ function isInsertionPoint(node) {
+ return node instanceof HTMLContentElement || node instanceof HTMLShadowElement;
+ }
+ function isShadowHost(shadowHost) {
+ return shadowHost.shadowRoot;
+ }
+ function getShadowTrees(host) {
+ var trees = [];
+ for (var tree = host.shadowRoot; tree; tree = tree.olderShadowRoot) {
+ trees.push(tree);
+ }
+ return trees;
+ }
+ function render(host) {
+ new ShadowRenderer(host).render();
+ }
+ Node.prototype.invalidateShadowRenderer = function(force) {
+ var renderer = unsafeUnwrap(this).polymerShadowRenderer_;
+ if (renderer) {
+ renderer.invalidate();
+ return true;
+ }
+ return false;
+ };
+ HTMLContentElement.prototype.getDistributedNodes = HTMLShadowElement.prototype.getDistributedNodes = function() {
+ renderAllPending();
+ return getDistributedNodes(this);
+ };
+ Element.prototype.getDestinationInsertionPoints = function() {
+ renderAllPending();
+ return getDestinationInsertionPoints(this) || [];
+ };
+ HTMLContentElement.prototype.nodeIsInserted_ = HTMLShadowElement.prototype.nodeIsInserted_ = function() {
+ this.invalidateShadowRenderer();
+ var shadowRoot = getShadowRootAncestor(this);
+ var renderer;
+ if (shadowRoot) renderer = getRendererForShadowRoot(shadowRoot);
+ unsafeUnwrap(this).polymerShadowRenderer_ = renderer;
+ if (renderer) renderer.invalidate();
+ };
+ scope.getRendererForHost = getRendererForHost;
+ scope.getShadowTrees = getShadowTrees;
+ scope.renderAllPending = renderAllPending;
+ scope.getDestinationInsertionPoints = getDestinationInsertionPoints;
+ scope.visual = {
+ insertBefore: insertBefore,
+ remove: remove
+ };
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var HTMLElement = scope.wrappers.HTMLElement;
+ var assert = scope.assert;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var elementsWithFormProperty = [ "HTMLButtonElement", "HTMLFieldSetElement", "HTMLInputElement", "HTMLKeygenElement", "HTMLLabelElement", "HTMLLegendElement", "HTMLObjectElement", "HTMLOutputElement", "HTMLTextAreaElement" ];
+ function createWrapperConstructor(name) {
+ if (!window[name]) return;
+ assert(!scope.wrappers[name]);
+ var GeneratedWrapper = function(node) {
+ HTMLElement.call(this, node);
+ };
+ GeneratedWrapper.prototype = Object.create(HTMLElement.prototype);
+ mixin(GeneratedWrapper.prototype, {
+ get form() {
+ return wrap(unwrap(this).form);
+ }
+ });
+ registerWrapper(window[name], GeneratedWrapper, document.createElement(name.slice(4, -7)));
+ scope.wrappers[name] = GeneratedWrapper;
+ }
+ elementsWithFormProperty.forEach(createWrapperConstructor);
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalSelection = window.Selection;
+ function Selection(impl) {
+ setWrapper(impl, this);
+ }
+ Selection.prototype = {
+ get anchorNode() {
+ return wrap(unsafeUnwrap(this).anchorNode);
+ },
+ get focusNode() {
+ return wrap(unsafeUnwrap(this).focusNode);
+ },
+ addRange: function(range) {
+ unsafeUnwrap(this).addRange(unwrapIfNeeded(range));
+ },
+ collapse: function(node, index) {
+ unsafeUnwrap(this).collapse(unwrapIfNeeded(node), index);
+ },
+ containsNode: function(node, allowPartial) {
+ return unsafeUnwrap(this).containsNode(unwrapIfNeeded(node), allowPartial);
+ },
+ getRangeAt: function(index) {
+ return wrap(unsafeUnwrap(this).getRangeAt(index));
+ },
+ removeRange: function(range) {
+ unsafeUnwrap(this).removeRange(unwrap(range));
+ },
+ selectAllChildren: function(node) {
+ unsafeUnwrap(this).selectAllChildren(unwrapIfNeeded(node));
+ },
+ toString: function() {
+ return unsafeUnwrap(this).toString();
+ }
+ };
+ if (OriginalSelection.prototype.extend) {
+ Selection.prototype.extend = function(node, offset) {
+ unsafeUnwrap(this).extend(unwrapIfNeeded(node), offset);
+ };
+ }
+ registerWrapper(window.Selection, Selection, window.getSelection());
+ scope.wrappers.Selection = Selection;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalTreeWalker = window.TreeWalker;
+ function TreeWalker(impl) {
+ setWrapper(impl, this);
+ }
+ TreeWalker.prototype = {
+ get root() {
+ return wrap(unsafeUnwrap(this).root);
+ },
+ get currentNode() {
+ return wrap(unsafeUnwrap(this).currentNode);
+ },
+ set currentNode(node) {
+ unsafeUnwrap(this).currentNode = unwrapIfNeeded(node);
+ },
+ get filter() {
+ return unsafeUnwrap(this).filter;
+ },
+ parentNode: function() {
+ return wrap(unsafeUnwrap(this).parentNode());
+ },
+ firstChild: function() {
+ return wrap(unsafeUnwrap(this).firstChild());
+ },
+ lastChild: function() {
+ return wrap(unsafeUnwrap(this).lastChild());
+ },
+ previousSibling: function() {
+ return wrap(unsafeUnwrap(this).previousSibling());
+ },
+ previousNode: function() {
+ return wrap(unsafeUnwrap(this).previousNode());
+ },
+ nextNode: function() {
+ return wrap(unsafeUnwrap(this).nextNode());
+ }
+ };
+ registerWrapper(OriginalTreeWalker, TreeWalker);
+ scope.wrappers.TreeWalker = TreeWalker;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var GetElementsByInterface = scope.GetElementsByInterface;
+ var Node = scope.wrappers.Node;
+ var ParentNodeInterface = scope.ParentNodeInterface;
+ var NonElementParentNodeInterface = scope.NonElementParentNodeInterface;
+ var Selection = scope.wrappers.Selection;
+ var SelectorsInterface = scope.SelectorsInterface;
+ var ShadowRoot = scope.wrappers.ShadowRoot;
+ var TreeScope = scope.TreeScope;
+ var cloneNode = scope.cloneNode;
+ var defineWrapGetter = scope.defineWrapGetter;
+ var elementFromPoint = scope.elementFromPoint;
+ var forwardMethodsToWrapper = scope.forwardMethodsToWrapper;
+ var matchesNames = scope.matchesNames;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var renderAllPending = scope.renderAllPending;
+ var rewrap = scope.rewrap;
+ var setWrapper = scope.setWrapper;
+ var unsafeUnwrap = scope.unsafeUnwrap;
+ var unwrap = scope.unwrap;
+ var wrap = scope.wrap;
+ var wrapEventTargetMethods = scope.wrapEventTargetMethods;
+ var wrapNodeList = scope.wrapNodeList;
+ var implementationTable = new WeakMap();
+ function Document(node) {
+ Node.call(this, node);
+ this.treeScope_ = new TreeScope(this, null);
+ }
+ Document.prototype = Object.create(Node.prototype);
+ defineWrapGetter(Document, "documentElement");
+ defineWrapGetter(Document, "body");
+ defineWrapGetter(Document, "head");
+ function wrapMethod(name) {
+ var original = document[name];
+ Document.prototype[name] = function() {
+ return wrap(original.apply(unsafeUnwrap(this), arguments));
+ };
+ }
+ [ "createComment", "createDocumentFragment", "createElement", "createElementNS", "createEvent", "createEventNS", "createRange", "createTextNode" ].forEach(wrapMethod);
+ var originalAdoptNode = document.adoptNode;
+ function adoptNodeNoRemove(node, doc) {
+ originalAdoptNode.call(unsafeUnwrap(doc), unwrap(node));
+ adoptSubtree(node, doc);
+ }
+ function adoptSubtree(node, doc) {
+ if (node.shadowRoot) doc.adoptNode(node.shadowRoot);
+ if (node instanceof ShadowRoot) adoptOlderShadowRoots(node, doc);
+ for (var child = node.firstChild; child; child = child.nextSibling) {
+ adoptSubtree(child, doc);
+ }
+ }
+ function adoptOlderShadowRoots(shadowRoot, doc) {
+ var oldShadowRoot = shadowRoot.olderShadowRoot;
+ if (oldShadowRoot) doc.adoptNode(oldShadowRoot);
+ }
+ var originalGetSelection = document.getSelection;
+ mixin(Document.prototype, {
+ adoptNode: function(node) {
+ if (node.parentNode) node.parentNode.removeChild(node);
+ adoptNodeNoRemove(node, this);
+ return node;
+ },
+ elementFromPoint: function(x, y) {
+ return elementFromPoint(this, this, x, y);
+ },
+ importNode: function(node, deep) {
+ return cloneNode(node, deep, unsafeUnwrap(this));
+ },
+ getSelection: function() {
+ renderAllPending();
+ return new Selection(originalGetSelection.call(unwrap(this)));
+ },
+ getElementsByName: function(name) {
+ return SelectorsInterface.querySelectorAll.call(this, "[name=" + JSON.stringify(String(name)) + "]");
+ }
+ });
+ var originalCreateTreeWalker = document.createTreeWalker;
+ var TreeWalkerWrapper = scope.wrappers.TreeWalker;
+ Document.prototype.createTreeWalker = function(root, whatToShow, filter, expandEntityReferences) {
+ var newFilter = null;
+ if (filter) {
+ if (filter.acceptNode && typeof filter.acceptNode === "function") {
+ newFilter = {
+ acceptNode: function(node) {
+ return filter.acceptNode(wrap(node));
+ }
+ };
+ } else if (typeof filter === "function") {
+ newFilter = function(node) {
+ return filter(wrap(node));
+ };
+ }
+ }
+ return new TreeWalkerWrapper(originalCreateTreeWalker.call(unwrap(this), unwrap(root), whatToShow, newFilter, expandEntityReferences));
+ };
+ if (document.registerElement) {
+ var originalRegisterElement = document.registerElement;
+ Document.prototype.registerElement = function(tagName, object) {
+ var prototype, extendsOption;
+ if (object !== undefined) {
+ prototype = object.prototype;
+ extendsOption = object.extends;
+ }
+ if (!prototype) prototype = Object.create(HTMLElement.prototype);
+ if (scope.nativePrototypeTable.get(prototype)) {
+ throw new Error("NotSupportedError");
+ }
+ var proto = Object.getPrototypeOf(prototype);
+ var nativePrototype;
+ var prototypes = [];
+ while (proto) {
+ nativePrototype = scope.nativePrototypeTable.get(proto);
+ if (nativePrototype) break;
+ prototypes.push(proto);
+ proto = Object.getPrototypeOf(proto);
+ }
+ if (!nativePrototype) {
+ throw new Error("NotSupportedError");
+ }
+ var newPrototype = Object.create(nativePrototype);
+ for (var i = prototypes.length - 1; i >= 0; i--) {
+ newPrototype = Object.create(newPrototype);
+ }
+ [ "createdCallback", "attachedCallback", "detachedCallback", "attributeChangedCallback" ].forEach(function(name) {
+ var f = prototype[name];
+ if (!f) return;
+ newPrototype[name] = function() {
+ if (!(wrap(this) instanceof CustomElementConstructor)) {
+ rewrap(this);
+ }
+ f.apply(wrap(this), arguments);
+ };
+ });
+ var p = {
+ prototype: newPrototype
+ };
+ if (extendsOption) p.extends = extendsOption;
+ function CustomElementConstructor(node) {
+ if (!node) {
+ if (extendsOption) {
+ return document.createElement(extendsOption, tagName);
+ } else {
+ return document.createElement(tagName);
+ }
+ }
+ setWrapper(node, this);
+ }
+ CustomElementConstructor.prototype = prototype;
+ CustomElementConstructor.prototype.constructor = CustomElementConstructor;
+ scope.constructorTable.set(newPrototype, CustomElementConstructor);
+ scope.nativePrototypeTable.set(prototype, newPrototype);
+ var nativeConstructor = originalRegisterElement.call(unwrap(this), tagName, p);
+ return CustomElementConstructor;
+ };
+ forwardMethodsToWrapper([ window.HTMLDocument || window.Document ], [ "registerElement" ]);
+ }
+ forwardMethodsToWrapper([ window.HTMLBodyElement, window.HTMLDocument || window.Document, window.HTMLHeadElement, window.HTMLHtmlElement ], [ "appendChild", "compareDocumentPosition", "contains", "getElementsByClassName", "getElementsByTagName", "getElementsByTagNameNS", "insertBefore", "querySelector", "querySelectorAll", "removeChild", "replaceChild" ]);
+ forwardMethodsToWrapper([ window.HTMLBodyElement, window.HTMLHeadElement, window.HTMLHtmlElement ], matchesNames);
+ forwardMethodsToWrapper([ window.HTMLDocument || window.Document ], [ "adoptNode", "importNode", "contains", "createComment", "createDocumentFragment", "createElement", "createElementNS", "createEvent", "createEventNS", "createRange", "createTextNode", "createTreeWalker", "elementFromPoint", "getElementById", "getElementsByName", "getSelection" ]);
+ mixin(Document.prototype, GetElementsByInterface);
+ mixin(Document.prototype, ParentNodeInterface);
+ mixin(Document.prototype, SelectorsInterface);
+ mixin(Document.prototype, NonElementParentNodeInterface);
+ mixin(Document.prototype, {
+ get implementation() {
+ var implementation = implementationTable.get(this);
+ if (implementation) return implementation;
+ implementation = new DOMImplementation(unwrap(this).implementation);
+ implementationTable.set(this, implementation);
+ return implementation;
+ },
+ get defaultView() {
+ return wrap(unwrap(this).defaultView);
+ }
+ });
+ registerWrapper(window.Document, Document, document.implementation.createHTMLDocument(""));
+ if (window.HTMLDocument) registerWrapper(window.HTMLDocument, Document);
+ wrapEventTargetMethods([ window.HTMLBodyElement, window.HTMLDocument || window.Document, window.HTMLHeadElement ]);
+ function DOMImplementation(impl) {
+ setWrapper(impl, this);
+ }
+ var originalCreateDocument = document.implementation.createDocument;
+ DOMImplementation.prototype.createDocument = function() {
+ arguments[2] = unwrap(arguments[2]);
+ return wrap(originalCreateDocument.apply(unsafeUnwrap(this), arguments));
+ };
+ function wrapImplMethod(constructor, name) {
+ var original = document.implementation[name];
+ constructor.prototype[name] = function() {
+ return wrap(original.apply(unsafeUnwrap(this), arguments));
+ };
+ }
+ function forwardImplMethod(constructor, name) {
+ var original = document.implementation[name];
+ constructor.prototype[name] = function() {
+ return original.apply(unsafeUnwrap(this), arguments);
+ };
+ }
+ wrapImplMethod(DOMImplementation, "createDocumentType");
+ wrapImplMethod(DOMImplementation, "createHTMLDocument");
+ forwardImplMethod(DOMImplementation, "hasFeature");
+ registerWrapper(window.DOMImplementation, DOMImplementation);
+ forwardMethodsToWrapper([ window.DOMImplementation ], [ "createDocument", "createDocumentType", "createHTMLDocument", "hasFeature" ]);
+ scope.adoptNodeNoRemove = adoptNodeNoRemove;
+ scope.wrappers.DOMImplementation = DOMImplementation;
+ scope.wrappers.Document = Document;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var EventTarget = scope.wrappers.EventTarget;
+ var Selection = scope.wrappers.Selection;
+ var mixin = scope.mixin;
+ var registerWrapper = scope.registerWrapper;
+ var renderAllPending = scope.renderAllPending;
+ var unwrap = scope.unwrap;
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var wrap = scope.wrap;
+ var OriginalWindow = window.Window;
+ var originalGetComputedStyle = window.getComputedStyle;
+ var originalGetDefaultComputedStyle = window.getDefaultComputedStyle;
+ var originalGetSelection = window.getSelection;
+ function Window(impl) {
+ EventTarget.call(this, impl);
+ }
+ Window.prototype = Object.create(EventTarget.prototype);
+ OriginalWindow.prototype.getComputedStyle = function(el, pseudo) {
+ return wrap(this || window).getComputedStyle(unwrapIfNeeded(el), pseudo);
+ };
+ if (originalGetDefaultComputedStyle) {
+ OriginalWindow.prototype.getDefaultComputedStyle = function(el, pseudo) {
+ return wrap(this || window).getDefaultComputedStyle(unwrapIfNeeded(el), pseudo);
+ };
+ }
+ OriginalWindow.prototype.getSelection = function() {
+ return wrap(this || window).getSelection();
+ };
+ delete window.getComputedStyle;
+ delete window.getDefaultComputedStyle;
+ delete window.getSelection;
+ [ "addEventListener", "removeEventListener", "dispatchEvent" ].forEach(function(name) {
+ OriginalWindow.prototype[name] = function() {
+ var w = wrap(this || window);
+ return w[name].apply(w, arguments);
+ };
+ delete window[name];
+ });
+ mixin(Window.prototype, {
+ getComputedStyle: function(el, pseudo) {
+ renderAllPending();
+ return originalGetComputedStyle.call(unwrap(this), unwrapIfNeeded(el), pseudo);
+ },
+ getSelection: function() {
+ renderAllPending();
+ return new Selection(originalGetSelection.call(unwrap(this)));
+ },
+ get document() {
+ return wrap(unwrap(this).document);
+ }
+ });
+ if (originalGetDefaultComputedStyle) {
+ Window.prototype.getDefaultComputedStyle = function(el, pseudo) {
+ renderAllPending();
+ return originalGetDefaultComputedStyle.call(unwrap(this), unwrapIfNeeded(el), pseudo);
+ };
+ }
+ registerWrapper(OriginalWindow, Window, window);
+ scope.wrappers.Window = Window;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var unwrap = scope.unwrap;
+ var OriginalDataTransfer = window.DataTransfer || window.Clipboard;
+ var OriginalDataTransferSetDragImage = OriginalDataTransfer.prototype.setDragImage;
+ if (OriginalDataTransferSetDragImage) {
+ OriginalDataTransfer.prototype.setDragImage = function(image, x, y) {
+ OriginalDataTransferSetDragImage.call(this, unwrap(image), x, y);
+ };
+ }
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var registerWrapper = scope.registerWrapper;
+ var setWrapper = scope.setWrapper;
+ var unwrap = scope.unwrap;
+ var OriginalFormData = window.FormData;
+ if (!OriginalFormData) return;
+ function FormData(formElement) {
+ var impl;
+ if (formElement instanceof OriginalFormData) {
+ impl = formElement;
+ } else {
+ impl = new OriginalFormData(formElement && unwrap(formElement));
+ }
+ setWrapper(impl, this);
+ }
+ registerWrapper(OriginalFormData, FormData, new OriginalFormData());
+ scope.wrappers.FormData = FormData;
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var unwrapIfNeeded = scope.unwrapIfNeeded;
+ var originalSend = XMLHttpRequest.prototype.send;
+ XMLHttpRequest.prototype.send = function(obj) {
+ return originalSend.call(this, unwrapIfNeeded(obj));
+ };
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ "use strict";
+ var isWrapperFor = scope.isWrapperFor;
+ var elements = {
+ a: "HTMLAnchorElement",
+ area: "HTMLAreaElement",
+ audio: "HTMLAudioElement",
+ base: "HTMLBaseElement",
+ body: "HTMLBodyElement",
+ br: "HTMLBRElement",
+ button: "HTMLButtonElement",
+ canvas: "HTMLCanvasElement",
+ caption: "HTMLTableCaptionElement",
+ col: "HTMLTableColElement",
+ content: "HTMLContentElement",
+ data: "HTMLDataElement",
+ datalist: "HTMLDataListElement",
+ del: "HTMLModElement",
+ dir: "HTMLDirectoryElement",
+ div: "HTMLDivElement",
+ dl: "HTMLDListElement",
+ embed: "HTMLEmbedElement",
+ fieldset: "HTMLFieldSetElement",
+ font: "HTMLFontElement",
+ form: "HTMLFormElement",
+ frame: "HTMLFrameElement",
+ frameset: "HTMLFrameSetElement",
+ h1: "HTMLHeadingElement",
+ head: "HTMLHeadElement",
+ hr: "HTMLHRElement",
+ html: "HTMLHtmlElement",
+ iframe: "HTMLIFrameElement",
+ img: "HTMLImageElement",
+ input: "HTMLInputElement",
+ keygen: "HTMLKeygenElement",
+ label: "HTMLLabelElement",
+ legend: "HTMLLegendElement",
+ li: "HTMLLIElement",
+ link: "HTMLLinkElement",
+ map: "HTMLMapElement",
+ marquee: "HTMLMarqueeElement",
+ menu: "HTMLMenuElement",
+ menuitem: "HTMLMenuItemElement",
+ meta: "HTMLMetaElement",
+ meter: "HTMLMeterElement",
+ object: "HTMLObjectElement",
+ ol: "HTMLOListElement",
+ optgroup: "HTMLOptGroupElement",
+ option: "HTMLOptionElement",
+ output: "HTMLOutputElement",
+ p: "HTMLParagraphElement",
+ param: "HTMLParamElement",
+ pre: "HTMLPreElement",
+ progress: "HTMLProgressElement",
+ q: "HTMLQuoteElement",
+ script: "HTMLScriptElement",
+ select: "HTMLSelectElement",
+ shadow: "HTMLShadowElement",
+ source: "HTMLSourceElement",
+ span: "HTMLSpanElement",
+ style: "HTMLStyleElement",
+ table: "HTMLTableElement",
+ tbody: "HTMLTableSectionElement",
+ template: "HTMLTemplateElement",
+ textarea: "HTMLTextAreaElement",
+ thead: "HTMLTableSectionElement",
+ time: "HTMLTimeElement",
+ title: "HTMLTitleElement",
+ tr: "HTMLTableRowElement",
+ track: "HTMLTrackElement",
+ ul: "HTMLUListElement",
+ video: "HTMLVideoElement"
+ };
+ function overrideConstructor(tagName) {
+ var nativeConstructorName = elements[tagName];
+ var nativeConstructor = window[nativeConstructorName];
+ if (!nativeConstructor) return;
+ var element = document.createElement(tagName);
+ var wrapperConstructor = element.constructor;
+ window[nativeConstructorName] = wrapperConstructor;
+ }
+ Object.keys(elements).forEach(overrideConstructor);
+ Object.getOwnPropertyNames(scope.wrappers).forEach(function(name) {
+ window[name] = scope.wrappers[name];
+ });
+ })(window.ShadowDOMPolyfill);
+ (function(scope) {
+ var ShadowCSS = {
+ strictStyling: false,
+ registry: {},
+ shimStyling: function(root, name, extendsName) {
+ var scopeStyles = this.prepareRoot(root, name, extendsName);
+ var typeExtension = this.isTypeExtension(extendsName);
+ var scopeSelector = this.makeScopeSelector(name, typeExtension);
+ var cssText = stylesToCssText(scopeStyles, true);
+ cssText = this.scopeCssText(cssText, scopeSelector);
+ if (root) {
+ root.shimmedStyle = cssText;
+ }
+ this.addCssToDocument(cssText, name);
+ },
+ shimStyle: function(style, selector) {
+ return this.shimCssText(style.textContent, selector);
+ },
+ shimCssText: function(cssText, selector) {
+ cssText = this.insertDirectives(cssText);
+ return this.scopeCssText(cssText, selector);
+ },
+ makeScopeSelector: function(name, typeExtension) {
+ if (name) {
+ return typeExtension ? "[is=" + name + "]" : name;
+ }
+ return "";
+ },
+ isTypeExtension: function(extendsName) {
+ return extendsName && extendsName.indexOf("-") < 0;
+ },
+ prepareRoot: function(root, name, extendsName) {
+ var def = this.registerRoot(root, name, extendsName);
+ this.replaceTextInStyles(def.rootStyles, this.insertDirectives);
+ this.removeStyles(root, def.rootStyles);
+ if (this.strictStyling) {
+ this.applyScopeToContent(root, name);
+ }
+ return def.scopeStyles;
+ },
+ removeStyles: function(root, styles) {
+ for (var i = 0, l = styles.length, s; i < l && (s = styles[i]); i++) {
+ s.parentNode.removeChild(s);
+ }
+ },
+ registerRoot: function(root, name, extendsName) {
+ var def = this.registry[name] = {
+ root: root,
+ name: name,
+ extendsName: extendsName
+ };
+ var styles = this.findStyles(root);
+ def.rootStyles = styles;
+ def.scopeStyles = def.rootStyles;
+ var extendee = this.registry[def.extendsName];
+ if (extendee) {
+ def.scopeStyles = extendee.scopeStyles.concat(def.scopeStyles);
+ }
+ return def;
+ },
+ findStyles: function(root) {
+ if (!root) {
+ return [];
+ }
+ var styles = root.querySelectorAll("style");
+ return Array.prototype.filter.call(styles, function(s) {
+ return !s.hasAttribute(NO_SHIM_ATTRIBUTE);
+ });
+ },
+ applyScopeToContent: function(root, name) {
+ if (root) {
+ Array.prototype.forEach.call(root.querySelectorAll("*"), function(node) {
+ node.setAttribute(name, "");
+ });
+ Array.prototype.forEach.call(root.querySelectorAll("template"), function(template) {
+ this.applyScopeToContent(template.content, name);
+ }, this);
+ }
+ },
+ insertDirectives: function(cssText) {
+ cssText = this.insertPolyfillDirectivesInCssText(cssText);
+ return this.insertPolyfillRulesInCssText(cssText);
+ },
+ insertPolyfillDirectivesInCssText: function(cssText) {
+ cssText = cssText.replace(cssCommentNextSelectorRe, function(match, p1) {
+ return p1.slice(0, -2) + "{";
+ });
+ return cssText.replace(cssContentNextSelectorRe, function(match, p1) {
+ return p1 + " {";
+ });
+ },
+ insertPolyfillRulesInCssText: function(cssText) {
+ cssText = cssText.replace(cssCommentRuleRe, function(match, p1) {
+ return p1.slice(0, -1);
+ });
+ return cssText.replace(cssContentRuleRe, function(match, p1, p2, p3) {
+ var rule = match.replace(p1, "").replace(p2, "");
+ return p3 + rule;
+ });
+ },
+ scopeCssText: function(cssText, scopeSelector) {
+ var unscoped = this.extractUnscopedRulesFromCssText(cssText);
+ cssText = this.insertPolyfillHostInCssText(cssText);
+ cssText = this.convertColonHost(cssText);
+ cssText = this.convertColonHostContext(cssText);
+ cssText = this.convertShadowDOMSelectors(cssText);
+ if (scopeSelector) {
+ var self = this, cssText;
+ withCssRules(cssText, function(rules) {
+ cssText = self.scopeRules(rules, scopeSelector);
+ });
+ }
+ cssText = cssText + "\n" + unscoped;
+ return cssText.trim();
+ },
+ extractUnscopedRulesFromCssText: function(cssText) {
+ var r = "", m;
+ while (m = cssCommentUnscopedRuleRe.exec(cssText)) {
+ r += m[1].slice(0, -1) + "\n\n";
+ }
+ while (m = cssContentUnscopedRuleRe.exec(cssText)) {
+ r += m[0].replace(m[2], "").replace(m[1], m[3]) + "\n\n";
+ }
+ return r;
+ },
+ convertColonHost: function(cssText) {
+ return this.convertColonRule(cssText, cssColonHostRe, this.colonHostPartReplacer);
+ },
+ convertColonHostContext: function(cssText) {
+ return this.convertColonRule(cssText, cssColonHostContextRe, this.colonHostContextPartReplacer);
+ },
+ convertColonRule: function(cssText, regExp, partReplacer) {
+ return cssText.replace(regExp, function(m, p1, p2, p3) {
+ p1 = polyfillHostNoCombinator;
+ if (p2) {
+ var parts = p2.split(","), r = [];
+ for (var i = 0, l = parts.length, p; i < l && (p = parts[i]); i++) {
+ p = p.trim();
+ r.push(partReplacer(p1, p, p3));
+ }
+ return r.join(",");
+ } else {
+ return p1 + p3;
+ }
+ });
+ },
+ colonHostContextPartReplacer: function(host, part, suffix) {
+ if (part.match(polyfillHost)) {
+ return this.colonHostPartReplacer(host, part, suffix);
+ } else {
+ return host + part + suffix + ", " + part + " " + host + suffix;
+ }
+ },
+ colonHostPartReplacer: function(host, part, suffix) {
+ return host + part.replace(polyfillHost, "") + suffix;
+ },
+ convertShadowDOMSelectors: function(cssText) {
+ for (var i = 0; i < shadowDOMSelectorsRe.length; i++) {
+ cssText = cssText.replace(shadowDOMSelectorsRe[i], " ");
+ }
+ return cssText;
+ },
+ scopeRules: function(cssRules, scopeSelector) {
+ var cssText = "";
+ if (cssRules) {
+ Array.prototype.forEach.call(cssRules, function(rule) {
+ if (rule.selectorText && (rule.style && rule.style.cssText !== undefined)) {
+ cssText += this.scopeSelector(rule.selectorText, scopeSelector, this.strictStyling) + " {\n ";
+ cssText += this.propertiesFromRule(rule) + "\n}\n\n";
+ } else if (rule.type === CSSRule.MEDIA_RULE) {
+ cssText += "@media " + rule.media.mediaText + " {\n";
+ cssText += this.scopeRules(rule.cssRules, scopeSelector);
+ cssText += "\n}\n\n";
+ } else {
+ try {
+ if (rule.cssText) {
+ cssText += rule.cssText + "\n\n";
+ }
+ } catch (x) {
+ if (rule.type === CSSRule.KEYFRAMES_RULE && rule.cssRules) {
+ cssText += this.ieSafeCssTextFromKeyFrameRule(rule);
+ }
+ }
+ }
+ }, this);
+ }
+ return cssText;
+ },
+ ieSafeCssTextFromKeyFrameRule: function(rule) {
+ var cssText = "@keyframes " + rule.name + " {";
+ Array.prototype.forEach.call(rule.cssRules, function(rule) {
+ cssText += " " + rule.keyText + " {" + rule.style.cssText + "}";
+ });
+ cssText += " }";
+ return cssText;
+ },
+ scopeSelector: function(selector, scopeSelector, strict) {
+ var r = [], parts = selector.split(",");
+ parts.forEach(function(p) {
+ p = p.trim();
+ if (this.selectorNeedsScoping(p, scopeSelector)) {
+ p = strict && !p.match(polyfillHostNoCombinator) ? this.applyStrictSelectorScope(p, scopeSelector) : this.applySelectorScope(p, scopeSelector);
+ }
+ r.push(p);
+ }, this);
+ return r.join(", ");
+ },
+ selectorNeedsScoping: function(selector, scopeSelector) {
+ if (Array.isArray(scopeSelector)) {
+ return true;
+ }
+ var re = this.makeScopeMatcher(scopeSelector);
+ return !selector.match(re);
+ },
+ makeScopeMatcher: function(scopeSelector) {
+ scopeSelector = scopeSelector.replace(/\[/g, "\\[").replace(/\]/g, "\\]");
+ return new RegExp("^(" + scopeSelector + ")" + selectorReSuffix, "m");
+ },
+ applySelectorScope: function(selector, selectorScope) {
+ return Array.isArray(selectorScope) ? this.applySelectorScopeList(selector, selectorScope) : this.applySimpleSelectorScope(selector, selectorScope);
+ },
+ applySelectorScopeList: function(selector, scopeSelectorList) {
+ var r = [];
+ for (var i = 0, s; s = scopeSelectorList[i]; i++) {
+ r.push(this.applySimpleSelectorScope(selector, s));
+ }
+ return r.join(", ");
+ },
+ applySimpleSelectorScope: function(selector, scopeSelector) {
+ if (selector.match(polyfillHostRe)) {
+ selector = selector.replace(polyfillHostNoCombinator, scopeSelector);
+ return selector.replace(polyfillHostRe, scopeSelector + " ");
+ } else {
+ return scopeSelector + " " + selector;
+ }
+ },
+ applyStrictSelectorScope: function(selector, scopeSelector) {
+ scopeSelector = scopeSelector.replace(/\[is=([^\]]*)\]/g, "$1");
+ var splits = [ " ", ">", "+", "~" ], scoped = selector, attrName = "[" + scopeSelector + "]";
+ splits.forEach(function(sep) {
+ var parts = scoped.split(sep);
+ scoped = parts.map(function(p) {
+ var t = p.trim().replace(polyfillHostRe, "");
+ if (t && splits.indexOf(t) < 0 && t.indexOf(attrName) < 0) {
+ p = t.replace(/([^:]*)(:*)(.*)/, "$1" + attrName + "$2$3");
+ }
+ return p;
+ }).join(sep);
+ });
+ return scoped;
+ },
+ insertPolyfillHostInCssText: function(selector) {
+ return selector.replace(colonHostContextRe, polyfillHostContext).replace(colonHostRe, polyfillHost);
+ },
+ propertiesFromRule: function(rule) {
+ var cssText = rule.style.cssText;
+ if (rule.style.content && !rule.style.content.match(/['"]+|attr/)) {
+ cssText = cssText.replace(/content:[^;]*;/g, "content: '" + rule.style.content + "';");
+ }
+ var style = rule.style;
+ for (var i in style) {
+ if (style[i] === "initial") {
+ cssText += i + ": initial; ";
+ }
+ }
+ return cssText;
+ },
+ replaceTextInStyles: function(styles, action) {
+ if (styles && action) {
+ if (!(styles instanceof Array)) {
+ styles = [ styles ];
+ }
+ Array.prototype.forEach.call(styles, function(s) {
+ s.textContent = action.call(this, s.textContent);
+ }, this);
+ }
+ },
+ addCssToDocument: function(cssText, name) {
+ if (cssText.match("@import")) {
+ addOwnSheet(cssText, name);
+ } else {
+ addCssToDocument(cssText);
+ }
+ }
+ };
+ var selectorRe = /([^{]*)({[\s\S]*?})/gim, cssCommentRe = /\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim, cssCommentNextSelectorRe = /\/\*\s*@polyfill ([^*]*\*+([^\/*][^*]*\*+)*\/)([^{]*?){/gim, cssContentNextSelectorRe = /polyfill-next-selector[^}]*content\:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim, cssCommentRuleRe = /\/\*\s@polyfill-rule([^*]*\*+([^\/*][^*]*\*+)*)\//gim, cssContentRuleRe = /(polyfill-rule)[^}]*(content\:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim, cssCommentUnscopedRuleRe = /\/\*\s@polyfill-unscoped-rule([^*]*\*+([^\/*][^*]*\*+)*)\//gim, cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content\:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim, cssPseudoRe = /::(x-[^\s{,(]*)/gim, cssPartRe = /::part\(([^)]*)\)/gim, polyfillHost = "-shadowcsshost", polyfillHostContext = "-shadowcsscontext", parenSuffix = ")(?:\\((" + "(?:\\([^)(]*\\)|[^)(]*)+?" + ")\\))?([^,{]*)";
+ var cssColonHostRe = new RegExp("(" + polyfillHost + parenSuffix, "gim"), cssColonHostContextRe = new RegExp("(" + polyfillHostContext + parenSuffix, "gim"), selectorReSuffix = "([>\\s~+[.,{:][\\s\\S]*)?$", colonHostRe = /\:host/gim, colonHostContextRe = /\:host-context/gim, polyfillHostNoCombinator = polyfillHost + "-no-combinator", polyfillHostRe = new RegExp(polyfillHost, "gim"), polyfillHostContextRe = new RegExp(polyfillHostContext, "gim"), shadowDOMSelectorsRe = [ />>>/g, /::shadow/g, /::content/g, /\/deep\//g, /\/shadow\//g, /\/shadow-deep\//g, /\^\^/g, /\^/g ];
+ function stylesToCssText(styles, preserveComments) {
+ var cssText = "";
+ Array.prototype.forEach.call(styles, function(s) {
+ cssText += s.textContent + "\n\n";
+ });
+ if (!preserveComments) {
+ cssText = cssText.replace(cssCommentRe, "");
+ }
+ return cssText;
+ }
+ function cssTextToStyle(cssText) {
+ var style = document.createElement("style");
+ style.textContent = cssText;
+ return style;
+ }
+ function cssToRules(cssText) {
+ var style = cssTextToStyle(cssText);
+ document.head.appendChild(style);
+ var rules = [];
+ if (style.sheet) {
+ try {
+ rules = style.sheet.cssRules;
+ } catch (e) {}
+ } else {
+ console.warn("sheet not found", style);
+ }
+ style.parentNode.removeChild(style);
+ return rules;
+ }
+ var frame = document.createElement("iframe");
+ frame.style.display = "none";
+ function initFrame() {
+ frame.initialized = true;
+ document.body.appendChild(frame);
+ var doc = frame.contentDocument;
+ var base = doc.createElement("base");
+ base.href = document.baseURI;
+ doc.head.appendChild(base);
+ }
+ function inFrame(fn) {
+ if (!frame.initialized) {
+ initFrame();
+ }
+ document.body.appendChild(frame);
+ fn(frame.contentDocument);
+ document.body.removeChild(frame);
+ }
+ var isChrome = navigator.userAgent.match("Chrome");
+ function withCssRules(cssText, callback) {
+ if (!callback) {
+ return;
+ }
+ var rules;
+ if (cssText.match("@import") && isChrome) {
+ var style = cssTextToStyle(cssText);
+ inFrame(function(doc) {
+ doc.head.appendChild(style.impl);
+ rules = Array.prototype.slice.call(style.sheet.cssRules, 0);
+ callback(rules);
+ });
+ } else {
+ rules = cssToRules(cssText);
+ callback(rules);
+ }
+ }
+ function rulesToCss(cssRules) {
+ for (var i = 0, css = []; i < cssRules.length; i++) {
+ css.push(cssRules[i].cssText);
+ }
+ return css.join("\n\n");
+ }
+ function addCssToDocument(cssText) {
+ if (cssText) {
+ getSheet().appendChild(document.createTextNode(cssText));
+ }
+ }
+ function addOwnSheet(cssText, name) {
+ var style = cssTextToStyle(cssText);
+ style.setAttribute(name, "");
+ style.setAttribute(SHIMMED_ATTRIBUTE, "");
+ document.head.appendChild(style);
+ }
+ var SHIM_ATTRIBUTE = "shim-shadowdom";
+ var SHIMMED_ATTRIBUTE = "shim-shadowdom-css";
+ var NO_SHIM_ATTRIBUTE = "no-shim";
+ var sheet;
+ function getSheet() {
+ if (!sheet) {
+ sheet = document.createElement("style");
+ sheet.setAttribute(SHIMMED_ATTRIBUTE, "");
+ sheet[SHIMMED_ATTRIBUTE] = true;
+ }
+ return sheet;
+ }
+ if (window.ShadowDOMPolyfill) {
+ addCssToDocument("style { display: none !important; }\n");
+ var doc = ShadowDOMPolyfill.wrap(document);
+ var head = doc.querySelector("head");
+ head.insertBefore(getSheet(), head.childNodes[0]);
+ document.addEventListener("DOMContentLoaded", function() {
+ var urlResolver = scope.urlResolver;
+ if (window.HTMLImports && !HTMLImports.useNative) {
+ var SHIM_SHEET_SELECTOR = "link[rel=stylesheet]" + "[" + SHIM_ATTRIBUTE + "]";
+ var SHIM_STYLE_SELECTOR = "style[" + SHIM_ATTRIBUTE + "]";
+ HTMLImports.importer.documentPreloadSelectors += "," + SHIM_SHEET_SELECTOR;
+ HTMLImports.importer.importsPreloadSelectors += "," + SHIM_SHEET_SELECTOR;
+ HTMLImports.parser.documentSelectors = [ HTMLImports.parser.documentSelectors, SHIM_SHEET_SELECTOR, SHIM_STYLE_SELECTOR ].join(",");
+ var originalParseGeneric = HTMLImports.parser.parseGeneric;
+ HTMLImports.parser.parseGeneric = function(elt) {
+ if (elt[SHIMMED_ATTRIBUTE]) {
+ return;
+ }
+ var style = elt.__importElement || elt;
+ if (!style.hasAttribute(SHIM_ATTRIBUTE)) {
+ originalParseGeneric.call(this, elt);
+ return;
+ }
+ if (elt.__resource) {
+ style = elt.ownerDocument.createElement("style");
+ style.textContent = elt.__resource;
+ }
+ HTMLImports.path.resolveUrlsInStyle(style, elt.href);
+ style.textContent = ShadowCSS.shimStyle(style);
+ style.removeAttribute(SHIM_ATTRIBUTE, "");
+ style.setAttribute(SHIMMED_ATTRIBUTE, "");
+ style[SHIMMED_ATTRIBUTE] = true;
+ if (style.parentNode !== head) {
+ if (elt.parentNode === head) {
+ head.replaceChild(style, elt);
+ } else {
+ this.addElementToDocument(style);
+ }
+ }
+ style.__importParsed = true;
+ this.markParsingComplete(elt);
+ this.parseNext();
+ };
+ var hasResource = HTMLImports.parser.hasResource;
+ HTMLImports.parser.hasResource = function(node) {
+ if (node.localName === "link" && node.rel === "stylesheet" && node.hasAttribute(SHIM_ATTRIBUTE)) {
+ return node.__resource;
+ } else {
+ return hasResource.call(this, node);
+ }
+ };
+ }
+ });
+ }
+ scope.ShadowCSS = ShadowCSS;
+ })(window.WebComponents);
+}
+
+(function(scope) {
+ if (window.ShadowDOMPolyfill) {
+ window.wrap = ShadowDOMPolyfill.wrapIfNeeded;
+ window.unwrap = ShadowDOMPolyfill.unwrapIfNeeded;
+ } else {
+ window.wrap = window.unwrap = function(n) {
+ return n;
+ };
+ }
+})(window.WebComponents);
+
+(function(scope) {
+ "use strict";
+ var hasWorkingUrl = false;
+ if (!scope.forceJURL) {
+ try {
+ var u = new URL("b", "http://a");
+ u.pathname = "c%20d";
+ hasWorkingUrl = u.href === "http://a/c%20d";
+ } catch (e) {}
+ }
+ if (hasWorkingUrl) return;
+ var relative = Object.create(null);
+ relative["ftp"] = 21;
+ relative["file"] = 0;
+ relative["gopher"] = 70;
+ relative["http"] = 80;
+ relative["https"] = 443;
+ relative["ws"] = 80;
+ relative["wss"] = 443;
+ var relativePathDotMapping = Object.create(null);
+ relativePathDotMapping["%2e"] = ".";
+ relativePathDotMapping[".%2e"] = "..";
+ relativePathDotMapping["%2e."] = "..";
+ relativePathDotMapping["%2e%2e"] = "..";
+ function isRelativeScheme(scheme) {
+ return relative[scheme] !== undefined;
+ }
+ function invalid() {
+ clear.call(this);
+ this._isInvalid = true;
+ }
+ function IDNAToASCII(h) {
+ if ("" == h) {
+ invalid.call(this);
+ }
+ return h.toLowerCase();
+ }
+ function percentEscape(c) {
+ var unicode = c.charCodeAt(0);
+ if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 63, 96 ].indexOf(unicode) == -1) {
+ return c;
+ }
+ return encodeURIComponent(c);
+ }
+ function percentEscapeQuery(c) {
+ var unicode = c.charCodeAt(0);
+ if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 96 ].indexOf(unicode) == -1) {
+ return c;
+ }
+ return encodeURIComponent(c);
+ }
+ var EOF = undefined, ALPHA = /[a-zA-Z]/, ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/;
+ function parse(input, stateOverride, base) {
+ function err(message) {
+ errors.push(message);
+ }
+ var state = stateOverride || "scheme start", cursor = 0, buffer = "", seenAt = false, seenBracket = false, errors = [];
+ loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {
+ var c = input[cursor];
+ switch (state) {
+ case "scheme start":
+ if (c && ALPHA.test(c)) {
+ buffer += c.toLowerCase();
+ state = "scheme";
+ } else if (!stateOverride) {
+ buffer = "";
+ state = "no scheme";
+ continue;
+ } else {
+ err("Invalid scheme.");
+ break loop;
+ }
+ break;
+
+ case "scheme":
+ if (c && ALPHANUMERIC.test(c)) {
+ buffer += c.toLowerCase();
+ } else if (":" == c) {
+ this._scheme = buffer;
+ buffer = "";
+ if (stateOverride) {
+ break loop;
+ }
+ if (isRelativeScheme(this._scheme)) {
+ this._isRelative = true;
+ }
+ if ("file" == this._scheme) {
+ state = "relative";
+ } else if (this._isRelative && base && base._scheme == this._scheme) {
+ state = "relative or authority";
+ } else if (this._isRelative) {
+ state = "authority first slash";
+ } else {
+ state = "scheme data";
+ }
+ } else if (!stateOverride) {
+ buffer = "";
+ cursor = 0;
+ state = "no scheme";
+ continue;
+ } else if (EOF == c) {
+ break loop;
+ } else {
+ err("Code point not allowed in scheme: " + c);
+ break loop;
+ }
+ break;
+
+ case "scheme data":
+ if ("?" == c) {
+ this._query = "?";
+ state = "query";
+ } else if ("#" == c) {
+ this._fragment = "#";
+ state = "fragment";
+ } else {
+ if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ this._schemeData += percentEscape(c);
+ }
+ }
+ break;
+
+ case "no scheme":
+ if (!base || !isRelativeScheme(base._scheme)) {
+ err("Missing scheme.");
+ invalid.call(this);
+ } else {
+ state = "relative";
+ continue;
+ }
+ break;
+
+ case "relative or authority":
+ if ("/" == c && "/" == input[cursor + 1]) {
+ state = "authority ignore slashes";
+ } else {
+ err("Expected /, got: " + c);
+ state = "relative";
+ continue;
+ }
+ break;
+
+ case "relative":
+ this._isRelative = true;
+ if ("file" != this._scheme) this._scheme = base._scheme;
+ if (EOF == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = base._query;
+ this._username = base._username;
+ this._password = base._password;
+ break loop;
+ } else if ("/" == c || "\\" == c) {
+ if ("\\" == c) err("\\ is an invalid code point.");
+ state = "relative slash";
+ } else if ("?" == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = "?";
+ this._username = base._username;
+ this._password = base._password;
+ state = "query";
+ } else if ("#" == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = base._query;
+ this._fragment = "#";
+ this._username = base._username;
+ this._password = base._password;
+ state = "fragment";
+ } else {
+ var nextC = input[cursor + 1];
+ var nextNextC = input[cursor + 2];
+ if ("file" != this._scheme || !ALPHA.test(c) || nextC != ":" && nextC != "|" || EOF != nextNextC && "/" != nextNextC && "\\" != nextNextC && "?" != nextNextC && "#" != nextNextC) {
+ this._host = base._host;
+ this._port = base._port;
+ this._username = base._username;
+ this._password = base._password;
+ this._path = base._path.slice();
+ this._path.pop();
+ }
+ state = "relative path";
+ continue;
+ }
+ break;
+
+ case "relative slash":
+ if ("/" == c || "\\" == c) {
+ if ("\\" == c) {
+ err("\\ is an invalid code point.");
+ }
+ if ("file" == this._scheme) {
+ state = "file host";
+ } else {
+ state = "authority ignore slashes";
+ }
+ } else {
+ if ("file" != this._scheme) {
+ this._host = base._host;
+ this._port = base._port;
+ this._username = base._username;
+ this._password = base._password;
+ }
+ state = "relative path";
+ continue;
+ }
+ break;
+
+ case "authority first slash":
+ if ("/" == c) {
+ state = "authority second slash";
+ } else {
+ err("Expected '/', got: " + c);
+ state = "authority ignore slashes";
+ continue;
+ }
+ break;
+
+ case "authority second slash":
+ state = "authority ignore slashes";
+ if ("/" != c) {
+ err("Expected '/', got: " + c);
+ continue;
+ }
+ break;
+
+ case "authority ignore slashes":
+ if ("/" != c && "\\" != c) {
+ state = "authority";
+ continue;
+ } else {
+ err("Expected authority, got: " + c);
+ }
+ break;
+
+ case "authority":
+ if ("@" == c) {
+ if (seenAt) {
+ err("@ already seen.");
+ buffer += "%40";
+ }
+ seenAt = true;
+ for (var i = 0; i < buffer.length; i++) {
+ var cp = buffer[i];
+ if (" " == cp || "\n" == cp || "\r" == cp) {
+ err("Invalid whitespace in authority.");
+ continue;
+ }
+ if (":" == cp && null === this._password) {
+ this._password = "";
+ continue;
+ }
+ var tempC = percentEscape(cp);
+ null !== this._password ? this._password += tempC : this._username += tempC;
+ }
+ buffer = "";
+ } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
+ cursor -= buffer.length;
+ buffer = "";
+ state = "host";
+ continue;
+ } else {
+ buffer += c;
+ }
+ break;
+
+ case "file host":
+ if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
+ if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ":" || buffer[1] == "|")) {
+ state = "relative path";
+ } else if (buffer.length == 0) {
+ state = "relative path start";
+ } else {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = "";
+ state = "relative path start";
+ }
+ continue;
+ } else if (" " == c || "\n" == c || "\r" == c) {
+ err("Invalid whitespace in file host.");
+ } else {
+ buffer += c;
+ }
+ break;
+
+ case "host":
+ case "hostname":
+ if (":" == c && !seenBracket) {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = "";
+ state = "port";
+ if ("hostname" == stateOverride) {
+ break loop;
+ }
+ } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c) {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = "";
+ state = "relative path start";
+ if (stateOverride) {
+ break loop;
+ }
+ continue;
+ } else if (" " != c && "\n" != c && "\r" != c) {
+ if ("[" == c) {
+ seenBracket = true;
+ } else if ("]" == c) {
+ seenBracket = false;
+ }
+ buffer += c;
+ } else {
+ err("Invalid code point in host/hostname: " + c);
+ }
+ break;
+
+ case "port":
+ if (/[0-9]/.test(c)) {
+ buffer += c;
+ } else if (EOF == c || "/" == c || "\\" == c || "?" == c || "#" == c || stateOverride) {
+ if ("" != buffer) {
+ var temp = parseInt(buffer, 10);
+ if (temp != relative[this._scheme]) {
+ this._port = temp + "";
+ }
+ buffer = "";
+ }
+ if (stateOverride) {
+ break loop;
+ }
+ state = "relative path start";
+ continue;
+ } else if (" " == c || "\n" == c || "\r" == c) {
+ err("Invalid code point in port: " + c);
+ } else {
+ invalid.call(this);
+ }
+ break;
+
+ case "relative path start":
+ if ("\\" == c) err("'\\' not allowed in path.");
+ state = "relative path";
+ if ("/" != c && "\\" != c) {
+ continue;
+ }
+ break;
+
+ case "relative path":
+ if (EOF == c || "/" == c || "\\" == c || !stateOverride && ("?" == c || "#" == c)) {
+ if ("\\" == c) {
+ err("\\ not allowed in relative path.");
+ }
+ var tmp;
+ if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {
+ buffer = tmp;
+ }
+ if (".." == buffer) {
+ this._path.pop();
+ if ("/" != c && "\\" != c) {
+ this._path.push("");
+ }
+ } else if ("." == buffer && "/" != c && "\\" != c) {
+ this._path.push("");
+ } else if ("." != buffer) {
+ if ("file" == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == "|") {
+ buffer = buffer[0] + ":";
+ }
+ this._path.push(buffer);
+ }
+ buffer = "";
+ if ("?" == c) {
+ this._query = "?";
+ state = "query";
+ } else if ("#" == c) {
+ this._fragment = "#";
+ state = "fragment";
+ }
+ } else if (" " != c && "\n" != c && "\r" != c) {
+ buffer += percentEscape(c);
+ }
+ break;
+
+ case "query":
+ if (!stateOverride && "#" == c) {
+ this._fragment = "#";
+ state = "fragment";
+ } else if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ this._query += percentEscapeQuery(c);
+ }
+ break;
+
+ case "fragment":
+ if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ this._fragment += c;
+ }
+ break;
+ }
+ cursor++;
+ }
+ }
+ function clear() {
+ this._scheme = "";
+ this._schemeData = "";
+ this._username = "";
+ this._password = null;
+ this._host = "";
+ this._port = "";
+ this._path = [];
+ this._query = "";
+ this._fragment = "";
+ this._isInvalid = false;
+ this._isRelative = false;
+ }
+ function jURL(url, base) {
+ if (base !== undefined && !(base instanceof jURL)) base = new jURL(String(base));
+ this._url = url;
+ clear.call(this);
+ var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, "");
+ parse.call(this, input, null, base);
+ }
+ jURL.prototype = {
+ toString: function() {
+ return this.href;
+ },
+ get href() {
+ if (this._isInvalid) return this._url;
+ var authority = "";
+ if ("" != this._username || null != this._password) {
+ authority = this._username + (null != this._password ? ":" + this._password : "") + "@";
+ }
+ return this.protocol + (this._isRelative ? "//" + authority + this.host : "") + this.pathname + this._query + this._fragment;
+ },
+ set href(href) {
+ clear.call(this);
+ parse.call(this, href);
+ },
+ get protocol() {
+ return this._scheme + ":";
+ },
+ set protocol(protocol) {
+ if (this._isInvalid) return;
+ parse.call(this, protocol + ":", "scheme start");
+ },
+ get host() {
+ return this._isInvalid ? "" : this._port ? this._host + ":" + this._port : this._host;
+ },
+ set host(host) {
+ if (this._isInvalid || !this._isRelative) return;
+ parse.call(this, host, "host");
+ },
+ get hostname() {
+ return this._host;
+ },
+ set hostname(hostname) {
+ if (this._isInvalid || !this._isRelative) return;
+ parse.call(this, hostname, "hostname");
+ },
+ get port() {
+ return this._port;
+ },
+ set port(port) {
+ if (this._isInvalid || !this._isRelative) return;
+ parse.call(this, port, "port");
+ },
+ get pathname() {
+ return this._isInvalid ? "" : this._isRelative ? "/" + this._path.join("/") : this._schemeData;
+ },
+ set pathname(pathname) {
+ if (this._isInvalid || !this._isRelative) return;
+ this._path = [];
+ parse.call(this, pathname, "relative path start");
+ },
+ get search() {
+ return this._isInvalid || !this._query || "?" == this._query ? "" : this._query;
+ },
+ set search(search) {
+ if (this._isInvalid || !this._isRelative) return;
+ this._query = "?";
+ if ("?" == search[0]) search = search.slice(1);
+ parse.call(this, search, "query");
+ },
+ get hash() {
+ return this._isInvalid || !this._fragment || "#" == this._fragment ? "" : this._fragment;
+ },
+ set hash(hash) {
+ if (this._isInvalid) return;
+ this._fragment = "#";
+ if ("#" == hash[0]) hash = hash.slice(1);
+ parse.call(this, hash, "fragment");
+ },
+ get origin() {
+ var host;
+ if (this._isInvalid || !this._scheme) {
+ return "";
+ }
+ switch (this._scheme) {
+ case "data":
+ case "file":
+ case "javascript":
+ case "mailto":
+ return "null";
+ }
+ host = this.host;
+ if (!host) {
+ return "";
+ }
+ return this._scheme + "://" + host;
+ }
+ };
+ var OriginalURL = scope.URL;
+ if (OriginalURL) {
+ jURL.createObjectURL = function(blob) {
+ return OriginalURL.createObjectURL.apply(OriginalURL, arguments);
+ };
+ jURL.revokeObjectURL = function(url) {
+ OriginalURL.revokeObjectURL(url);
+ };
+ }
+ scope.URL = jURL;
+})(this);
+
+(function(global) {
+ var registrationsTable = new WeakMap();
+ var setImmediate;
+ if (/Trident|Edge/.test(navigator.userAgent)) {
+ setImmediate = setTimeout;
+ } else if (window.setImmediate) {
+ setImmediate = window.setImmediate;
+ } else {
+ var setImmediateQueue = [];
+ var sentinel = String(Math.random());
+ window.addEventListener("message", function(e) {
+ if (e.data === sentinel) {
+ var queue = setImmediateQueue;
+ setImmediateQueue = [];
+ queue.forEach(function(func) {
+ func();
+ });
+ }
+ });
+ setImmediate = function(func) {
+ setImmediateQueue.push(func);
+ window.postMessage(sentinel, "*");
+ };
+ }
+ var isScheduled = false;
+ var scheduledObservers = [];
+ function scheduleCallback(observer) {
+ scheduledObservers.push(observer);
+ if (!isScheduled) {
+ isScheduled = true;
+ setImmediate(dispatchCallbacks);
+ }
+ }
+ function wrapIfNeeded(node) {
+ return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
+ }
+ function dispatchCallbacks() {
+ isScheduled = false;
+ var observers = scheduledObservers;
+ scheduledObservers = [];
+ observers.sort(function(o1, o2) {
+ return o1.uid_ - o2.uid_;
+ });
+ var anyNonEmpty = false;
+ observers.forEach(function(observer) {
+ var queue = observer.takeRecords();
+ removeTransientObserversFor(observer);
+ if (queue.length) {
+ observer.callback_(queue, observer);
+ anyNonEmpty = true;
+ }
+ });
+ if (anyNonEmpty) dispatchCallbacks();
+ }
+ function removeTransientObserversFor(observer) {
+ observer.nodes_.forEach(function(node) {
+ var registrations = registrationsTable.get(node);
+ if (!registrations) return;
+ registrations.forEach(function(registration) {
+ if (registration.observer === observer) registration.removeTransientObservers();
+ });
+ });
+ }
+ function forEachAncestorAndObserverEnqueueRecord(target, callback) {
+ for (var node = target; node; node = node.parentNode) {
+ var registrations = registrationsTable.get(node);
+ if (registrations) {
+ for (var j = 0; j < registrations.length; j++) {
+ var registration = registrations[j];
+ var options = registration.options;
+ if (node !== target && !options.subtree) continue;
+ var record = callback(options);
+ if (record) registration.enqueue(record);
+ }
+ }
+ }
+ }
+ var uidCounter = 0;
+ function JsMutationObserver(callback) {
+ this.callback_ = callback;
+ this.nodes_ = [];
+ this.records_ = [];
+ this.uid_ = ++uidCounter;
+ }
+ JsMutationObserver.prototype = {
+ observe: function(target, options) {
+ target = wrapIfNeeded(target);
+ if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
+ throw new SyntaxError();
+ }
+ var registrations = registrationsTable.get(target);
+ if (!registrations) registrationsTable.set(target, registrations = []);
+ var registration;
+ for (var i = 0; i < registrations.length; i++) {
+ if (registrations[i].observer === this) {
+ registration = registrations[i];
+ registration.removeListeners();
+ registration.options = options;
+ break;
+ }
+ }
+ if (!registration) {
+ registration = new Registration(this, target, options);
+ registrations.push(registration);
+ this.nodes_.push(target);
+ }
+ registration.addListeners();
+ },
+ disconnect: function() {
+ this.nodes_.forEach(function(node) {
+ var registrations = registrationsTable.get(node);
+ for (var i = 0; i < registrations.length; i++) {
+ var registration = registrations[i];
+ if (registration.observer === this) {
+ registration.removeListeners();
+ registrations.splice(i, 1);
+ break;
+ }
+ }
+ }, this);
+ this.records_ = [];
+ },
+ takeRecords: function() {
+ var copyOfRecords = this.records_;
+ this.records_ = [];
+ return copyOfRecords;
+ }
+ };
+ function MutationRecord(type, target) {
+ this.type = type;
+ this.target = target;
+ this.addedNodes = [];
+ this.removedNodes = [];
+ this.previousSibling = null;
+ this.nextSibling = null;
+ this.attributeName = null;
+ this.attributeNamespace = null;
+ this.oldValue = null;
+ }
+ function copyMutationRecord(original) {
+ var record = new MutationRecord(original.type, original.target);
+ record.addedNodes = original.addedNodes.slice();
+ record.removedNodes = original.removedNodes.slice();
+ record.previousSibling = original.previousSibling;
+ record.nextSibling = original.nextSibling;
+ record.attributeName = original.attributeName;
+ record.attributeNamespace = original.attributeNamespace;
+ record.oldValue = original.oldValue;
+ return record;
+ }
+ var currentRecord, recordWithOldValue;
+ function getRecord(type, target) {
+ return currentRecord = new MutationRecord(type, target);
+ }
+ function getRecordWithOldValue(oldValue) {
+ if (recordWithOldValue) return recordWithOldValue;
+ recordWithOldValue = copyMutationRecord(currentRecord);
+ recordWithOldValue.oldValue = oldValue;
+ return recordWithOldValue;
+ }
+ function clearRecords() {
+ currentRecord = recordWithOldValue = undefined;
+ }
+ function recordRepresentsCurrentMutation(record) {
+ return record === recordWithOldValue || record === currentRecord;
+ }
+ function selectRecord(lastRecord, newRecord) {
+ if (lastRecord === newRecord) return lastRecord;
+ if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
+ return null;
+ }
+ function Registration(observer, target, options) {
+ this.observer = observer;
+ this.target = target;
+ this.options = options;
+ this.transientObservedNodes = [];
+ }
+ Registration.prototype = {
+ enqueue: function(record) {
+ var records = this.observer.records_;
+ var length = records.length;
+ if (records.length > 0) {
+ var lastRecord = records[length - 1];
+ var recordToReplaceLast = selectRecord(lastRecord, record);
+ if (recordToReplaceLast) {
+ records[length - 1] = recordToReplaceLast;
+ return;
+ }
+ } else {
+ scheduleCallback(this.observer);
+ }
+ records[length] = record;
+ },
+ addListeners: function() {
+ this.addListeners_(this.target);
+ },
+ addListeners_: function(node) {
+ var options = this.options;
+ if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
+ if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
+ if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
+ if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
+ },
+ removeListeners: function() {
+ this.removeListeners_(this.target);
+ },
+ removeListeners_: function(node) {
+ var options = this.options;
+ if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
+ if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
+ if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
+ if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
+ },
+ addTransientObserver: function(node) {
+ if (node === this.target) return;
+ this.addListeners_(node);
+ this.transientObservedNodes.push(node);
+ var registrations = registrationsTable.get(node);
+ if (!registrations) registrationsTable.set(node, registrations = []);
+ registrations.push(this);
+ },
+ removeTransientObservers: function() {
+ var transientObservedNodes = this.transientObservedNodes;
+ this.transientObservedNodes = [];
+ transientObservedNodes.forEach(function(node) {
+ this.removeListeners_(node);
+ var registrations = registrationsTable.get(node);
+ for (var i = 0; i < registrations.length; i++) {
+ if (registrations[i] === this) {
+ registrations.splice(i, 1);
+ break;
+ }
+ }
+ }, this);
+ },
+ handleEvent: function(e) {
+ e.stopImmediatePropagation();
+ switch (e.type) {
+ case "DOMAttrModified":
+ var name = e.attrName;
+ var namespace = e.relatedNode.namespaceURI;
+ var target = e.target;
+ var record = new getRecord("attributes", target);
+ record.attributeName = name;
+ record.attributeNamespace = namespace;
+ var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
+ forEachAncestorAndObserverEnqueueRecord(target, function(options) {
+ if (!options.attributes) return;
+ if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
+ return;
+ }
+ if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
+ return record;
+ });
+ break;
+
+ case "DOMCharacterDataModified":
+ var target = e.target;
+ var record = getRecord("characterData", target);
+ var oldValue = e.prevValue;
+ forEachAncestorAndObserverEnqueueRecord(target, function(options) {
+ if (!options.characterData) return;
+ if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
+ return record;
+ });
+ break;
+
+ case "DOMNodeRemoved":
+ this.addTransientObserver(e.target);
+
+ case "DOMNodeInserted":
+ var changedNode = e.target;
+ var addedNodes, removedNodes;
+ if (e.type === "DOMNodeInserted") {
+ addedNodes = [ changedNode ];
+ removedNodes = [];
+ } else {
+ addedNodes = [];
+ removedNodes = [ changedNode ];
+ }
+ var previousSibling = changedNode.previousSibling;
+ var nextSibling = changedNode.nextSibling;
+ var record = getRecord("childList", e.target.parentNode);
+ record.addedNodes = addedNodes;
+ record.removedNodes = removedNodes;
+ record.previousSibling = previousSibling;
+ record.nextSibling = nextSibling;
+ forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
+ if (!options.childList) return;
+ return record;
+ });
+ }
+ clearRecords();
+ }
+ };
+ global.JsMutationObserver = JsMutationObserver;
+ if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
+})(this);
+
+window.HTMLImports = window.HTMLImports || {
+ flags: {}
+};
+
+(function(scope) {
+ var IMPORT_LINK_TYPE = "import";
+ var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement("link"));
+ var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill);
+ var wrap = function(node) {
+ return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node;
+ };
+ var rootDocument = wrap(document);
+ var currentScriptDescriptor = {
+ get: function() {
+ var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null);
+ return wrap(script);
+ },
+ configurable: true
+ };
+ Object.defineProperty(document, "_currentScript", currentScriptDescriptor);
+ Object.defineProperty(rootDocument, "_currentScript", currentScriptDescriptor);
+ var isIE = /Trident/.test(navigator.userAgent);
+ function whenReady(callback, doc) {
+ doc = doc || rootDocument;
+ whenDocumentReady(function() {
+ watchImportsLoad(callback, doc);
+ }, doc);
+ }
+ var requiredReadyState = isIE ? "complete" : "interactive";
+ var READY_EVENT = "readystatechange";
+ function isDocumentReady(doc) {
+ return doc.readyState === "complete" || doc.readyState === requiredReadyState;
+ }
+ function whenDocumentReady(callback, doc) {
+ if (!isDocumentReady(doc)) {
+ var checkReady = function() {
+ if (doc.readyState === "complete" || doc.readyState === requiredReadyState) {
+ doc.removeEventListener(READY_EVENT, checkReady);
+ whenDocumentReady(callback, doc);
+ }
+ };
+ doc.addEventListener(READY_EVENT, checkReady);
+ } else if (callback) {
+ callback();
+ }
+ }
+ function markTargetLoaded(event) {
+ event.target.__loaded = true;
+ }
+ function watchImportsLoad(callback, doc) {
+ var imports = doc.querySelectorAll("link[rel=import]");
+ var parsedCount = 0, importCount = imports.length, newImports = [], errorImports = [];
+ function checkDone() {
+ if (parsedCount == importCount && callback) {
+ callback({
+ allImports: imports,
+ loadedImports: newImports,
+ errorImports: errorImports
+ });
+ }
+ }
+ function loadedImport(e) {
+ markTargetLoaded(e);
+ newImports.push(this);
+ parsedCount++;
+ checkDone();
+ }
+ function errorLoadingImport(e) {
+ errorImports.push(this);
+ parsedCount++;
+ checkDone();
+ }
+ if (importCount) {
+ for (var i = 0, imp; i < importCount && (imp = imports[i]); i++) {
+ if (isImportLoaded(imp)) {
+ parsedCount++;
+ checkDone();
+ } else {
+ imp.addEventListener("load", loadedImport);
+ imp.addEventListener("error", errorLoadingImport);
+ }
+ }
+ } else {
+ checkDone();
+ }
+ }
+ function isImportLoaded(link) {
+ return useNative ? link.__loaded || link.import && link.import.readyState !== "loading" : link.__importParsed;
+ }
+ if (useNative) {
+ new MutationObserver(function(mxns) {
+ for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) {
+ if (m.addedNodes) {
+ handleImports(m.addedNodes);
+ }
+ }
+ }).observe(document.head, {
+ childList: true
+ });
+ function handleImports(nodes) {
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
+ if (isImport(n)) {
+ handleImport(n);
+ }
+ }
+ }
+ function isImport(element) {
+ return element.localName === "link" && element.rel === "import";
+ }
+ function handleImport(element) {
+ var loaded = element.import;
+ if (loaded) {
+ markTargetLoaded({
+ target: element
+ });
+ } else {
+ element.addEventListener("load", markTargetLoaded);
+ element.addEventListener("error", markTargetLoaded);
+ }
+ }
+ (function() {
+ if (document.readyState === "loading") {
+ var imports = document.querySelectorAll("link[rel=import]");
+ for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) {
+ handleImport(imp);
+ }
+ }
+ })();
+ }
+ whenReady(function(detail) {
+ window.HTMLImports.ready = true;
+ window.HTMLImports.readyTime = new Date().getTime();
+ var evt = rootDocument.createEvent("CustomEvent");
+ evt.initCustomEvent("HTMLImportsLoaded", true, true, detail);
+ rootDocument.dispatchEvent(evt);
+ });
+ scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;
+ scope.useNative = useNative;
+ scope.rootDocument = rootDocument;
+ scope.whenReady = whenReady;
+ scope.isIE = isIE;
+})(window.HTMLImports);
+
+(function(scope) {
+ var modules = [];
+ var addModule = function(module) {
+ modules.push(module);
+ };
+ var initializeModules = function() {
+ modules.forEach(function(module) {
+ module(scope);
+ });
+ };
+ scope.addModule = addModule;
+ scope.initializeModules = initializeModules;
+})(window.HTMLImports);
+
+window.HTMLImports.addModule(function(scope) {
+ var CSS_URL_REGEXP = /(url\()([^)]*)(\))/g;
+ var CSS_IMPORT_REGEXP = /(@import[\s]+(?!url\())([^;]*)(;)/g;
+ var path = {
+ resolveUrlsInStyle: function(style, linkUrl) {
+ var doc = style.ownerDocument;
+ var resolver = doc.createElement("a");
+ style.textContent = this.resolveUrlsInCssText(style.textContent, linkUrl, resolver);
+ return style;
+ },
+ resolveUrlsInCssText: function(cssText, linkUrl, urlObj) {
+ var r = this.replaceUrls(cssText, urlObj, linkUrl, CSS_URL_REGEXP);
+ r = this.replaceUrls(r, urlObj, linkUrl, CSS_IMPORT_REGEXP);
+ return r;
+ },
+ replaceUrls: function(text, urlObj, linkUrl, regexp) {
+ return text.replace(regexp, function(m, pre, url, post) {
+ var urlPath = url.replace(/["']/g, "");
+ if (linkUrl) {
+ urlPath = new URL(urlPath, linkUrl).href;
+ }
+ urlObj.href = urlPath;
+ urlPath = urlObj.href;
+ return pre + "'" + urlPath + "'" + post;
+ });
+ }
+ };
+ scope.path = path;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var xhr = {
+ async: true,
+ ok: function(request) {
+ return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0;
+ },
+ load: function(url, next, nextContext) {
+ var request = new XMLHttpRequest();
+ if (scope.flags.debug || scope.flags.bust) {
+ url += "?" + Math.random();
+ }
+ request.open("GET", url, xhr.async);
+ request.addEventListener("readystatechange", function(e) {
+ if (request.readyState === 4) {
+ var locationHeader = request.getResponseHeader("Location");
+ var redirectedUrl = null;
+ if (locationHeader) {
+ var redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader;
+ }
+ next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);
+ }
+ });
+ request.send();
+ return request;
+ },
+ loadDocument: function(url, next, nextContext) {
+ this.load(url, next, nextContext).responseType = "document";
+ }
+ };
+ scope.xhr = xhr;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var xhr = scope.xhr;
+ var flags = scope.flags;
+ var Loader = function(onLoad, onComplete) {
+ this.cache = {};
+ this.onload = onLoad;
+ this.oncomplete = onComplete;
+ this.inflight = 0;
+ this.pending = {};
+ };
+ Loader.prototype = {
+ addNodes: function(nodes) {
+ this.inflight += nodes.length;
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
+ this.require(n);
+ }
+ this.checkDone();
+ },
+ addNode: function(node) {
+ this.inflight++;
+ this.require(node);
+ this.checkDone();
+ },
+ require: function(elt) {
+ var url = elt.src || elt.href;
+ elt.__nodeUrl = url;
+ if (!this.dedupe(url, elt)) {
+ this.fetch(url, elt);
+ }
+ },
+ dedupe: function(url, elt) {
+ if (this.pending[url]) {
+ this.pending[url].push(elt);
+ return true;
+ }
+ var resource;
+ if (this.cache[url]) {
+ this.onload(url, elt, this.cache[url]);
+ this.tail();
+ return true;
+ }
+ this.pending[url] = [ elt ];
+ return false;
+ },
+ fetch: function(url, elt) {
+ flags.load && console.log("fetch", url, elt);
+ if (!url) {
+ setTimeout(function() {
+ this.receive(url, elt, {
+ error: "href must be specified"
+ }, null);
+ }.bind(this), 0);
+ } else if (url.match(/^data:/)) {
+ var pieces = url.split(",");
+ var header = pieces[0];
+ var body = pieces[1];
+ if (header.indexOf(";base64") > -1) {
+ body = atob(body);
+ } else {
+ body = decodeURIComponent(body);
+ }
+ setTimeout(function() {
+ this.receive(url, elt, null, body);
+ }.bind(this), 0);
+ } else {
+ var receiveXhr = function(err, resource, redirectedUrl) {
+ this.receive(url, elt, err, resource, redirectedUrl);
+ }.bind(this);
+ xhr.load(url, receiveXhr);
+ }
+ },
+ receive: function(url, elt, err, resource, redirectedUrl) {
+ this.cache[url] = resource;
+ var $p = this.pending[url];
+ for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
+ this.onload(url, p, resource, err, redirectedUrl);
+ this.tail();
+ }
+ this.pending[url] = null;
+ },
+ tail: function() {
+ --this.inflight;
+ this.checkDone();
+ },
+ checkDone: function() {
+ if (!this.inflight) {
+ this.oncomplete();
+ }
+ }
+ };
+ scope.Loader = Loader;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var Observer = function(addCallback) {
+ this.addCallback = addCallback;
+ this.mo = new MutationObserver(this.handler.bind(this));
+ };
+ Observer.prototype = {
+ handler: function(mutations) {
+ for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) {
+ if (m.type === "childList" && m.addedNodes.length) {
+ this.addedNodes(m.addedNodes);
+ }
+ }
+ },
+ addedNodes: function(nodes) {
+ if (this.addCallback) {
+ this.addCallback(nodes);
+ }
+ for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) {
+ if (n.children && n.children.length) {
+ this.addedNodes(n.children);
+ }
+ }
+ },
+ observe: function(root) {
+ this.mo.observe(root, {
+ childList: true,
+ subtree: true
+ });
+ }
+ };
+ scope.Observer = Observer;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var path = scope.path;
+ var rootDocument = scope.rootDocument;
+ var flags = scope.flags;
+ var isIE = scope.isIE;
+ var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;
+ var IMPORT_SELECTOR = "link[rel=" + IMPORT_LINK_TYPE + "]";
+ var importParser = {
+ documentSelectors: IMPORT_SELECTOR,
+ importsSelectors: [ IMPORT_SELECTOR, "link[rel=stylesheet]", "style", "script:not([type])", 'script[type="application/javascript"]', 'script[type="text/javascript"]' ].join(","),
+ map: {
+ link: "parseLink",
+ script: "parseScript",
+ style: "parseStyle"
+ },
+ dynamicElements: [],
+ parseNext: function() {
+ var next = this.nextToParse();
+ if (next) {
+ this.parse(next);
+ }
+ },
+ parse: function(elt) {
+ if (this.isParsed(elt)) {
+ flags.parse && console.log("[%s] is already parsed", elt.localName);
+ return;
+ }
+ var fn = this[this.map[elt.localName]];
+ if (fn) {
+ this.markParsing(elt);
+ fn.call(this, elt);
+ }
+ },
+ parseDynamic: function(elt, quiet) {
+ this.dynamicElements.push(elt);
+ if (!quiet) {
+ this.parseNext();
+ }
+ },
+ markParsing: function(elt) {
+ flags.parse && console.log("parsing", elt);
+ this.parsingElement = elt;
+ },
+ markParsingComplete: function(elt) {
+ elt.__importParsed = true;
+ this.markDynamicParsingComplete(elt);
+ if (elt.__importElement) {
+ elt.__importElement.__importParsed = true;
+ this.markDynamicParsingComplete(elt.__importElement);
+ }
+ this.parsingElement = null;
+ flags.parse && console.log("completed", elt);
+ },
+ markDynamicParsingComplete: function(elt) {
+ var i = this.dynamicElements.indexOf(elt);
+ if (i >= 0) {
+ this.dynamicElements.splice(i, 1);
+ }
+ },
+ parseImport: function(elt) {
+ if (window.HTMLImports.__importsParsingHook) {
+ window.HTMLImports.__importsParsingHook(elt);
+ }
+ if (elt.import) {
+ elt.import.__importParsed = true;
+ }
+ this.markParsingComplete(elt);
+ if (elt.__resource && !elt.__error) {
+ elt.dispatchEvent(new CustomEvent("load", {
+ bubbles: false
+ }));
+ } else {
+ elt.dispatchEvent(new CustomEvent("error", {
+ bubbles: false
+ }));
+ }
+ if (elt.__pending) {
+ var fn;
+ while (elt.__pending.length) {
+ fn = elt.__pending.shift();
+ if (fn) {
+ fn({
+ target: elt
+ });
+ }
+ }
+ }
+ this.parseNext();
+ },
+ parseLink: function(linkElt) {
+ if (nodeIsImport(linkElt)) {
+ this.parseImport(linkElt);
+ } else {
+ linkElt.href = linkElt.href;
+ this.parseGeneric(linkElt);
+ }
+ },
+ parseStyle: function(elt) {
+ var src = elt;
+ elt = cloneStyle(elt);
+ src.__appliedElement = elt;
+ elt.__importElement = src;
+ this.parseGeneric(elt);
+ },
+ parseGeneric: function(elt) {
+ this.trackElement(elt);
+ this.addElementToDocument(elt);
+ },
+ rootImportForElement: function(elt) {
+ var n = elt;
+ while (n.ownerDocument.__importLink) {
+ n = n.ownerDocument.__importLink;
+ }
+ return n;
+ },
+ addElementToDocument: function(elt) {
+ var port = this.rootImportForElement(elt.__importElement || elt);
+ port.parentNode.insertBefore(elt, port);
+ },
+ trackElement: function(elt, callback) {
+ var self = this;
+ var done = function(e) {
+ if (callback) {
+ callback(e);
+ }
+ self.markParsingComplete(elt);
+ self.parseNext();
+ };
+ elt.addEventListener("load", done);
+ elt.addEventListener("error", done);
+ if (isIE && elt.localName === "style") {
+ var fakeLoad = false;
+ if (elt.textContent.indexOf("@import") == -1) {
+ fakeLoad = true;
+ } else if (elt.sheet) {
+ fakeLoad = true;
+ var csr = elt.sheet.cssRules;
+ var len = csr ? csr.length : 0;
+ for (var i = 0, r; i < len && (r = csr[i]); i++) {
+ if (r.type === CSSRule.IMPORT_RULE) {
+ fakeLoad = fakeLoad && Boolean(r.styleSheet);
+ }
+ }
+ }
+ if (fakeLoad) {
+ setTimeout(function() {
+ elt.dispatchEvent(new CustomEvent("load", {
+ bubbles: false
+ }));
+ });
+ }
+ }
+ },
+ parseScript: function(scriptElt) {
+ var script = document.createElement("script");
+ script.__importElement = scriptElt;
+ script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);
+ scope.currentScript = scriptElt;
+ this.trackElement(script, function(e) {
+ script.parentNode.removeChild(script);
+ scope.currentScript = null;
+ });
+ this.addElementToDocument(script);
+ },
+ nextToParse: function() {
+ this._mayParse = [];
+ return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic());
+ },
+ nextToParseInDoc: function(doc, link) {
+ if (doc && this._mayParse.indexOf(doc) < 0) {
+ this._mayParse.push(doc);
+ var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));
+ for (var i = 0, l = nodes.length, p = 0, n; i < l && (n = nodes[i]); i++) {
+ if (!this.isParsed(n)) {
+ if (this.hasResource(n)) {
+ return nodeIsImport(n) ? this.nextToParseInDoc(n.import, n) : n;
+ } else {
+ return;
+ }
+ }
+ }
+ }
+ return link;
+ },
+ nextToParseDynamic: function() {
+ return this.dynamicElements[0];
+ },
+ parseSelectorsForNode: function(node) {
+ var doc = node.ownerDocument || node;
+ return doc === rootDocument ? this.documentSelectors : this.importsSelectors;
+ },
+ isParsed: function(node) {
+ return node.__importParsed;
+ },
+ needsDynamicParsing: function(elt) {
+ return this.dynamicElements.indexOf(elt) >= 0;
+ },
+ hasResource: function(node) {
+ if (nodeIsImport(node) && node.import === undefined) {
+ return false;
+ }
+ return true;
+ }
+ };
+ function nodeIsImport(elt) {
+ return elt.localName === "link" && elt.rel === IMPORT_LINK_TYPE;
+ }
+ function generateScriptDataUrl(script) {
+ var scriptContent = generateScriptContent(script);
+ return "data:text/javascript;charset=utf-8," + encodeURIComponent(scriptContent);
+ }
+ function generateScriptContent(script) {
+ return script.textContent + generateSourceMapHint(script);
+ }
+ function generateSourceMapHint(script) {
+ var owner = script.ownerDocument;
+ owner.__importedScripts = owner.__importedScripts || 0;
+ var moniker = script.ownerDocument.baseURI;
+ var num = owner.__importedScripts ? "-" + owner.__importedScripts : "";
+ owner.__importedScripts++;
+ return "\n//# sourceURL=" + moniker + num + ".js\n";
+ }
+ function cloneStyle(style) {
+ var clone = style.ownerDocument.createElement("style");
+ clone.textContent = style.textContent;
+ path.resolveUrlsInStyle(clone);
+ return clone;
+ }
+ scope.parser = importParser;
+ scope.IMPORT_SELECTOR = IMPORT_SELECTOR;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var flags = scope.flags;
+ var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;
+ var IMPORT_SELECTOR = scope.IMPORT_SELECTOR;
+ var rootDocument = scope.rootDocument;
+ var Loader = scope.Loader;
+ var Observer = scope.Observer;
+ var parser = scope.parser;
+ var importer = {
+ documents: {},
+ documentPreloadSelectors: IMPORT_SELECTOR,
+ importsPreloadSelectors: [ IMPORT_SELECTOR ].join(","),
+ loadNode: function(node) {
+ importLoader.addNode(node);
+ },
+ loadSubtree: function(parent) {
+ var nodes = this.marshalNodes(parent);
+ importLoader.addNodes(nodes);
+ },
+ marshalNodes: function(parent) {
+ return parent.querySelectorAll(this.loadSelectorsForNode(parent));
+ },
+ loadSelectorsForNode: function(node) {
+ var doc = node.ownerDocument || node;
+ return doc === rootDocument ? this.documentPreloadSelectors : this.importsPreloadSelectors;
+ },
+ loaded: function(url, elt, resource, err, redirectedUrl) {
+ flags.load && console.log("loaded", url, elt);
+ elt.__resource = resource;
+ elt.__error = err;
+ if (isImportLink(elt)) {
+ var doc = this.documents[url];
+ if (doc === undefined) {
+ doc = err ? null : makeDocument(resource, redirectedUrl || url);
+ if (doc) {
+ doc.__importLink = elt;
+ this.bootDocument(doc);
+ }
+ this.documents[url] = doc;
+ }
+ elt.import = doc;
+ }
+ parser.parseNext();
+ },
+ bootDocument: function(doc) {
+ this.loadSubtree(doc);
+ this.observer.observe(doc);
+ parser.parseNext();
+ },
+ loadedAll: function() {
+ parser.parseNext();
+ }
+ };
+ var importLoader = new Loader(importer.loaded.bind(importer), importer.loadedAll.bind(importer));
+ importer.observer = new Observer();
+ function isImportLink(elt) {
+ return isLinkRel(elt, IMPORT_LINK_TYPE);
+ }
+ function isLinkRel(elt, rel) {
+ return elt.localName === "link" && elt.getAttribute("rel") === rel;
+ }
+ function hasBaseURIAccessor(doc) {
+ return !!Object.getOwnPropertyDescriptor(doc, "baseURI");
+ }
+ function makeDocument(resource, url) {
+ var doc = document.implementation.createHTMLDocument(IMPORT_LINK_TYPE);
+ doc._URL = url;
+ var base = doc.createElement("base");
+ base.setAttribute("href", url);
+ if (!doc.baseURI && !hasBaseURIAccessor(doc)) {
+ Object.defineProperty(doc, "baseURI", {
+ value: url
+ });
+ }
+ var meta = doc.createElement("meta");
+ meta.setAttribute("charset", "utf-8");
+ doc.head.appendChild(meta);
+ doc.head.appendChild(base);
+ doc.body.innerHTML = resource;
+ if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {
+ HTMLTemplateElement.bootstrap(doc);
+ }
+ return doc;
+ }
+ if (!document.baseURI) {
+ var baseURIDescriptor = {
+ get: function() {
+ var base = document.querySelector("base");
+ return base ? base.href : window.location.href;
+ },
+ configurable: true
+ };
+ Object.defineProperty(document, "baseURI", baseURIDescriptor);
+ Object.defineProperty(rootDocument, "baseURI", baseURIDescriptor);
+ }
+ scope.importer = importer;
+ scope.importLoader = importLoader;
+});
+
+window.HTMLImports.addModule(function(scope) {
+ var parser = scope.parser;
+ var importer = scope.importer;
+ var dynamic = {
+ added: function(nodes) {
+ var owner, parsed, loading;
+ for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {
+ if (!owner) {
+ owner = n.ownerDocument;
+ parsed = parser.isParsed(owner);
+ }
+ loading = this.shouldLoadNode(n);
+ if (loading) {
+ importer.loadNode(n);
+ }
+ if (this.shouldParseNode(n) && parsed) {
+ parser.parseDynamic(n, loading);
+ }
+ }
+ },
+ shouldLoadNode: function(node) {
+ return node.nodeType === 1 && matches.call(node, importer.loadSelectorsForNode(node));
+ },
+ shouldParseNode: function(node) {
+ return node.nodeType === 1 && matches.call(node, parser.parseSelectorsForNode(node));
+ }
+ };
+ importer.observer.addCallback = dynamic.added.bind(dynamic);
+ var matches = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector;
+});
+
+(function(scope) {
+ var initializeModules = scope.initializeModules;
+ var isIE = scope.isIE;
+ if (scope.useNative) {
+ return;
+ }
+ if (isIE && typeof window.CustomEvent !== "function") {
+ window.CustomEvent = function(inType, params) {
+ params = params || {};
+ var e = document.createEvent("CustomEvent");
+ e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
+ e.preventDefault = function() {
+ Object.defineProperty(this, "defaultPrevented", {
+ get: function() {
+ return true;
+ }
+ });
+ };
+ return e;
+ };
+ window.CustomEvent.prototype = window.Event.prototype;
+ }
+ initializeModules();
+ var rootDocument = scope.rootDocument;
+ function bootstrap() {
+ window.HTMLImports.importer.bootDocument(rootDocument);
+ }
+ if (document.readyState === "complete" || document.readyState === "interactive" && !window.attachEvent) {
+ bootstrap();
+ } else {
+ document.addEventListener("DOMContentLoaded", bootstrap);
+ }
+})(window.HTMLImports);
+
+window.CustomElements = window.CustomElements || {
+ flags: {}
+};
+
+(function(scope) {
+ var flags = scope.flags;
+ var modules = [];
+ var addModule = function(module) {
+ modules.push(module);
+ };
+ var initializeModules = function() {
+ modules.forEach(function(module) {
+ module(scope);
+ });
+ };
+ scope.addModule = addModule;
+ scope.initializeModules = initializeModules;
+ scope.hasNative = Boolean(document.registerElement);
+ scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
+})(window.CustomElements);
+
+window.CustomElements.addModule(function(scope) {
+ var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none";
+ function forSubtree(node, cb) {
+ findAllElements(node, function(e) {
+ if (cb(e)) {
+ return true;
+ }
+ forRoots(e, cb);
+ });
+ forRoots(node, cb);
+ }
+ function findAllElements(node, find, data) {
+ var e = node.firstElementChild;
+ if (!e) {
+ e = node.firstChild;
+ while (e && e.nodeType !== Node.ELEMENT_NODE) {
+ e = e.nextSibling;
+ }
+ }
+ while (e) {
+ if (find(e, data) !== true) {
+ findAllElements(e, find, data);
+ }
+ e = e.nextElementSibling;
+ }
+ return null;
+ }
+ function forRoots(node, cb) {
+ var root = node.shadowRoot;
+ while (root) {
+ forSubtree(root, cb);
+ root = root.olderShadowRoot;
+ }
+ }
+ function forDocumentTree(doc, cb) {
+ _forDocumentTree(doc, cb, []);
+ }
+ function _forDocumentTree(doc, cb, processingDocuments) {
+ doc = window.wrap(doc);
+ if (processingDocuments.indexOf(doc) >= 0) {
+ return;
+ }
+ processingDocuments.push(doc);
+ var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]");
+ for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {
+ if (n.import) {
+ _forDocumentTree(n.import, cb, processingDocuments);
+ }
+ }
+ cb(doc);
+ }
+ scope.forDocumentTree = forDocumentTree;
+ scope.forSubtree = forSubtree;
+});
+
+window.CustomElements.addModule(function(scope) {
+ var flags = scope.flags;
+ var forSubtree = scope.forSubtree;
+ var forDocumentTree = scope.forDocumentTree;
+ function addedNode(node) {
+ return added(node) || addedSubtree(node);
+ }
+ function added(node) {
+ if (scope.upgrade(node)) {
+ return true;
+ }
+ attached(node);
+ }
+ function addedSubtree(node) {
+ forSubtree(node, function(e) {
+ if (added(e)) {
+ return true;
+ }
+ });
+ }
+ function attachedNode(node) {
+ attached(node);
+ if (inDocument(node)) {
+ forSubtree(node, function(e) {
+ attached(e);
+ });
+ }
+ }
+ var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
+ scope.hasPolyfillMutations = hasPolyfillMutations;
+ var isPendingMutations = false;
+ var pendingMutations = [];
+ function deferMutation(fn) {
+ pendingMutations.push(fn);
+ if (!isPendingMutations) {
+ isPendingMutations = true;
+ setTimeout(takeMutations);
+ }
+ }
+ function takeMutations() {
+ isPendingMutations = false;
+ var $p = pendingMutations;
+ for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
+ p();
+ }
+ pendingMutations = [];
+ }
+ function attached(element) {
+ if (hasPolyfillMutations) {
+ deferMutation(function() {
+ _attached(element);
+ });
+ } else {
+ _attached(element);
+ }
+ }
+ function _attached(element) {
+ if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
+ if (!element.__attached && inDocument(element)) {
+ element.__attached = true;
+ if (element.attachedCallback) {
+ element.attachedCallback();
+ }
+ }
+ }
+ }
+ function detachedNode(node) {
+ detached(node);
+ forSubtree(node, function(e) {
+ detached(e);
+ });
+ }
+ function detached(element) {
+ if (hasPolyfillMutations) {
+ deferMutation(function() {
+ _detached(element);
+ });
+ } else {
+ _detached(element);
+ }
+ }
+ function _detached(element) {
+ if (element.__upgraded__ && (element.attachedCallback || element.detachedCallback)) {
+ if (element.__attached && !inDocument(element)) {
+ element.__attached = false;
+ if (element.detachedCallback) {
+ element.detachedCallback();
+ }
+ }
+ }
+ }
+ function inDocument(element) {
+ var p = element;
+ var doc = wrap(document);
+ while (p) {
+ if (p == doc) {
+ return true;
+ }
+ p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;
+ }
+ }
+ function watchShadow(node) {
+ if (node.shadowRoot && !node.shadowRoot.__watched) {
+ flags.dom && console.log("watching shadow-root for: ", node.localName);
+ var root = node.shadowRoot;
+ while (root) {
+ observe(root);
+ root = root.olderShadowRoot;
+ }
+ }
+ }
+ function handler(mutations) {
+ if (flags.dom) {
+ var mx = mutations[0];
+ if (mx && mx.type === "childList" && mx.addedNodes) {
+ if (mx.addedNodes) {
+ var d = mx.addedNodes[0];
+ while (d && d !== document && !d.host) {
+ d = d.parentNode;
+ }
+ var u = d && (d.URL || d._URL || d.host && d.host.localName) || "";
+ u = u.split("/?").shift().split("/").pop();
+ }
+ }
+ console.group("mutations (%d) [%s]", mutations.length, u || "");
+ }
+ mutations.forEach(function(mx) {
+ if (mx.type === "childList") {
+ forEach(mx.addedNodes, function(n) {
+ if (!n.localName) {
+ return;
+ }
+ addedNode(n);
+ });
+ forEach(mx.removedNodes, function(n) {
+ if (!n.localName) {
+ return;
+ }
+ detachedNode(n);
+ });
+ }
+ });
+ flags.dom && console.groupEnd();
+ }
+ function takeRecords(node) {
+ node = window.wrap(node);
+ if (!node) {
+ node = window.wrap(document);
+ }
+ while (node.parentNode) {
+ node = node.parentNode;
+ }
+ var observer = node.__observer;
+ if (observer) {
+ handler(observer.takeRecords());
+ takeMutations();
+ }
+ }
+ var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
+ function observe(inRoot) {
+ if (inRoot.__observer) {
+ return;
+ }
+ var observer = new MutationObserver(handler);
+ observer.observe(inRoot, {
+ childList: true,
+ subtree: true
+ });
+ inRoot.__observer = observer;
+ }
+ function upgradeDocument(doc) {
+ doc = window.wrap(doc);
+ flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
+ addedNode(doc);
+ observe(doc);
+ flags.dom && console.groupEnd();
+ }
+ function upgradeDocumentTree(doc) {
+ forDocumentTree(doc, upgradeDocument);
+ }
+ var originalCreateShadowRoot = Element.prototype.createShadowRoot;
+ if (originalCreateShadowRoot) {
+ Element.prototype.createShadowRoot = function() {
+ var root = originalCreateShadowRoot.call(this);
+ window.CustomElements.watchShadow(this);
+ return root;
+ };
+ }
+ scope.watchShadow = watchShadow;
+ scope.upgradeDocumentTree = upgradeDocumentTree;
+ scope.upgradeSubtree = addedSubtree;
+ scope.upgradeAll = addedNode;
+ scope.attachedNode = attachedNode;
+ scope.takeRecords = takeRecords;
+});
+
+window.CustomElements.addModule(function(scope) {
+ var flags = scope.flags;
+ function upgrade(node) {
+ if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
+ var is = node.getAttribute("is");
+ var definition = scope.getRegisteredDefinition(is || node.localName);
+ if (definition) {
+ if (is && definition.tag == node.localName) {
+ return upgradeWithDefinition(node, definition);
+ } else if (!is && !definition.extends) {
+ return upgradeWithDefinition(node, definition);
+ }
+ }
+ }
+ }
+ function upgradeWithDefinition(element, definition) {
+ flags.upgrade && console.group("upgrade:", element.localName);
+ if (definition.is) {
+ element.setAttribute("is", definition.is);
+ }
+ implementPrototype(element, definition);
+ element.__upgraded__ = true;
+ created(element);
+ scope.attachedNode(element);
+ scope.upgradeSubtree(element);
+ flags.upgrade && console.groupEnd();
+ return element;
+ }
+ function implementPrototype(element, definition) {
+ if (Object.__proto__) {
+ element.__proto__ = definition.prototype;
+ } else {
+ customMixin(element, definition.prototype, definition.native);
+ element.__proto__ = definition.prototype;
+ }
+ }
+ function customMixin(inTarget, inSrc, inNative) {
+ var used = {};
+ var p = inSrc;
+ while (p !== inNative && p !== HTMLElement.prototype) {
+ var keys = Object.getOwnPropertyNames(p);
+ for (var i = 0, k; k = keys[i]; i++) {
+ if (!used[k]) {
+ Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));
+ used[k] = 1;
+ }
+ }
+ p = Object.getPrototypeOf(p);
+ }
+ }
+ function created(element) {
+ if (element.createdCallback) {
+ element.createdCallback();
+ }
+ }
+ scope.upgrade = upgrade;
+ scope.upgradeWithDefinition = upgradeWithDefinition;
+ scope.implementPrototype = implementPrototype;
+});
+
+window.CustomElements.addModule(function(scope) {
+ var isIE11OrOlder = scope.isIE11OrOlder;
+ var upgradeDocumentTree = scope.upgradeDocumentTree;
+ var upgradeAll = scope.upgradeAll;
+ var upgradeWithDefinition = scope.upgradeWithDefinition;
+ var implementPrototype = scope.implementPrototype;
+ var useNative = scope.useNative;
+ function register(name, options) {
+ var definition = options || {};
+ if (!name) {
+ throw new Error("document.registerElement: first argument `name` must not be empty");
+ }
+ if (name.indexOf("-") < 0) {
+ throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'.");
+ }
+ if (isReservedTag(name)) {
+ throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid.");
+ }
+ if (getRegisteredDefinition(name)) {
+ throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered");
+ }
+ if (!definition.prototype) {
+ definition.prototype = Object.create(HTMLElement.prototype);
+ }
+ definition.__name = name.toLowerCase();
+ definition.lifecycle = definition.lifecycle || {};
+ definition.ancestry = ancestry(definition.extends);
+ resolveTagName(definition);
+ resolvePrototypeChain(definition);
+ overrideAttributeApi(definition.prototype);
+ registerDefinition(definition.__name, definition);
+ definition.ctor = generateConstructor(definition);
+ definition.ctor.prototype = definition.prototype;
+ definition.prototype.constructor = definition.ctor;
+ if (scope.ready) {
+ upgradeDocumentTree(document);
+ }
+ return definition.ctor;
+ }
+ function overrideAttributeApi(prototype) {
+ if (prototype.setAttribute._polyfilled) {
+ return;
+ }
+ var setAttribute = prototype.setAttribute;
+ prototype.setAttribute = function(name, value) {
+ changeAttribute.call(this, name, value, setAttribute);
+ };
+ var removeAttribute = prototype.removeAttribute;
+ prototype.removeAttribute = function(name) {
+ changeAttribute.call(this, name, null, removeAttribute);
+ };
+ prototype.setAttribute._polyfilled = true;
+ }
+ function changeAttribute(name, value, operation) {
+ name = name.toLowerCase();
+ var oldValue = this.getAttribute(name);
+ operation.apply(this, arguments);
+ var newValue = this.getAttribute(name);
+ if (this.attributeChangedCallback && newValue !== oldValue) {
+ this.attributeChangedCallback(name, oldValue, newValue);
+ }
+ }
+ function isReservedTag(name) {
+ for (var i = 0; i < reservedTagList.length; i++) {
+ if (name === reservedTagList[i]) {
+ return true;
+ }
+ }
+ }
+ var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ];
+ function ancestry(extnds) {
+ var extendee = getRegisteredDefinition(extnds);
+ if (extendee) {
+ return ancestry(extendee.extends).concat([ extendee ]);
+ }
+ return [];
+ }
+ function resolveTagName(definition) {
+ var baseTag = definition.extends;
+ for (var i = 0, a; a = definition.ancestry[i]; i++) {
+ baseTag = a.is && a.tag;
+ }
+ definition.tag = baseTag || definition.__name;
+ if (baseTag) {
+ definition.is = definition.__name;
+ }
+ }
+ function resolvePrototypeChain(definition) {
+ if (!Object.__proto__) {
+ var nativePrototype = HTMLElement.prototype;
+ if (definition.is) {
+ var inst = document.createElement(definition.tag);
+ var expectedPrototype = Object.getPrototypeOf(inst);
+ if (expectedPrototype === definition.prototype) {
+ nativePrototype = expectedPrototype;
+ }
+ }
+ var proto = definition.prototype, ancestor;
+ while (proto && proto !== nativePrototype) {
+ ancestor = Object.getPrototypeOf(proto);
+ proto.__proto__ = ancestor;
+ proto = ancestor;
+ }
+ definition.native = nativePrototype;
+ }
+ }
+ function instantiate(definition) {
+ return upgradeWithDefinition(domCreateElement(definition.tag), definition);
+ }
+ var registry = {};
+ function getRegisteredDefinition(name) {
+ if (name) {
+ return registry[name.toLowerCase()];
+ }
+ }
+ function registerDefinition(name, definition) {
+ registry[name] = definition;
+ }
+ function generateConstructor(definition) {
+ return function() {
+ return instantiate(definition);
+ };
+ }
+ var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
+ function createElementNS(namespace, tag, typeExtension) {
+ if (namespace === HTML_NAMESPACE) {
+ return createElement(tag, typeExtension);
+ } else {
+ return domCreateElementNS(namespace, tag);
+ }
+ }
+ function createElement(tag, typeExtension) {
+ if (tag) {
+ tag = tag.toLowerCase();
+ }
+ if (typeExtension) {
+ typeExtension = typeExtension.toLowerCase();
+ }
+ var definition = getRegisteredDefinition(typeExtension || tag);
+ if (definition) {
+ if (tag == definition.tag && typeExtension == definition.is) {
+ return new definition.ctor();
+ }
+ if (!typeExtension && !definition.is) {
+ return new definition.ctor();
+ }
+ }
+ var element;
+ if (typeExtension) {
+ element = createElement(tag);
+ element.setAttribute("is", typeExtension);
+ return element;
+ }
+ element = domCreateElement(tag);
+ if (tag.indexOf("-") >= 0) {
+ implementPrototype(element, HTMLElement);
+ }
+ return element;
+ }
+ var domCreateElement = document.createElement.bind(document);
+ var domCreateElementNS = document.createElementNS.bind(document);
+ var isInstance;
+ if (!Object.__proto__ && !useNative) {
+ isInstance = function(obj, ctor) {
+ var p = obj;
+ while (p) {
+ if (p === ctor.prototype) {
+ return true;
+ }
+ p = p.__proto__;
+ }
+ return false;
+ };
+ } else {
+ isInstance = function(obj, base) {
+ return obj instanceof base;
+ };
+ }
+ function wrapDomMethodToForceUpgrade(obj, methodName) {
+ var orig = obj[methodName];
+ obj[methodName] = function() {
+ var n = orig.apply(this, arguments);
+ upgradeAll(n);
+ return n;
+ };
+ }
+ wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
+ wrapDomMethodToForceUpgrade(document, "importNode");
+ if (isIE11OrOlder) {
+ (function() {
+ var importNode = document.importNode;
+ document.importNode = function() {
+ var n = importNode.apply(document, arguments);
+ if (n.nodeType == n.DOCUMENT_FRAGMENT_NODE) {
+ var f = document.createDocumentFragment();
+ f.appendChild(n);
+ return f;
+ } else {
+ return n;
+ }
+ };
+ })();
+ }
+ document.registerElement = register;
+ document.createElement = createElement;
+ document.createElementNS = createElementNS;
+ scope.registry = registry;
+ scope.instanceof = isInstance;
+ scope.reservedTagList = reservedTagList;
+ scope.getRegisteredDefinition = getRegisteredDefinition;
+ document.register = document.registerElement;
+});
+
+(function(scope) {
+ var useNative = scope.useNative;
+ var initializeModules = scope.initializeModules;
+ var isIE11OrOlder = /Trident/.test(navigator.userAgent);
+ if (useNative) {
+ var nop = function() {};
+ scope.watchShadow = nop;
+ scope.upgrade = nop;
+ scope.upgradeAll = nop;
+ scope.upgradeDocumentTree = nop;
+ scope.upgradeSubtree = nop;
+ scope.takeRecords = nop;
+ scope.instanceof = function(obj, base) {
+ return obj instanceof base;
+ };
+ } else {
+ initializeModules();
+ }
+ var upgradeDocumentTree = scope.upgradeDocumentTree;
+ if (!window.wrap) {
+ if (window.ShadowDOMPolyfill) {
+ window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;
+ window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;
+ } else {
+ window.wrap = window.unwrap = function(node) {
+ return node;
+ };
+ }
+ }
+ function bootstrap() {
+ upgradeDocumentTree(window.wrap(document));
+ if (window.HTMLImports) {
+ window.HTMLImports.__importsParsingHook = function(elt) {
+ upgradeDocumentTree(wrap(elt.import));
+ };
+ }
+ window.CustomElements.ready = true;
+ setTimeout(function() {
+ window.CustomElements.readyTime = Date.now();
+ if (window.HTMLImports) {
+ window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;
+ }
+ document.dispatchEvent(new CustomEvent("WebComponentsReady", {
+ bubbles: true
+ }));
+ });
+ }
+ if (isIE11OrOlder && typeof window.CustomEvent !== "function") {
+ window.CustomEvent = function(inType, params) {
+ params = params || {};
+ var e = document.createEvent("CustomEvent");
+ e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
+ e.preventDefault = function() {
+ Object.defineProperty(this, "defaultPrevented", {
+ get: function() {
+ return true;
+ }
+ });
+ };
+ return e;
+ };
+ window.CustomEvent.prototype = window.Event.prototype;
+ }
+ if (document.readyState === "complete" || scope.flags.eager) {
+ bootstrap();
+ } else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
+ bootstrap();
+ } else {
+ var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
+ window.addEventListener(loadEvent, bootstrap);
+ }
+ scope.isIE11OrOlder = isIE11OrOlder;
+})(window.CustomElements);
+
+(function(scope) {
+ if (!Function.prototype.bind) {
+ Function.prototype.bind = function(scope) {
+ var self = this;
+ var args = Array.prototype.slice.call(arguments, 1);
+ return function() {
+ var args2 = args.slice();
+ args2.push.apply(args2, arguments);
+ return self.apply(scope, args2);
+ };
+ };
+ }
+})(window.WebComponents);
+
+(function(scope) {
+ "use strict";
+ if (!window.performance) {
+ var start = Date.now();
+ window.performance = {
+ now: function() {
+ return Date.now() - start;
+ }
+ };
+ }
+ if (!window.requestAnimationFrame) {
+ window.requestAnimationFrame = function() {
+ var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
+ return nativeRaf ? function(callback) {
+ return nativeRaf(function() {
+ callback(performance.now());
+ });
+ } : function(callback) {
+ return window.setTimeout(callback, 1e3 / 60);
+ };
+ }();
+ }
+ if (!window.cancelAnimationFrame) {
+ window.cancelAnimationFrame = function() {
+ return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {
+ clearTimeout(id);
+ };
+ }();
+ }
+ var elementDeclarations = [];
+ var polymerStub = function(name, dictionary) {
+ if (typeof name !== "string" && arguments.length === 1) {
+ Array.prototype.push.call(arguments, document._currentScript);
+ }
+ elementDeclarations.push(arguments);
+ };
+ window.Polymer = polymerStub;
+ scope.consumeDeclarations = function(callback) {
+ scope.consumeDeclarations = function() {
+ throw "Possible attempt to load Polymer twice";
+ };
+ if (callback) {
+ callback(elementDeclarations);
+ }
+ elementDeclarations = null;
+ };
+ function installPolymerWarning() {
+ if (window.Polymer === polymerStub) {
+ window.Polymer = function() {
+ throw new Error("You tried to use polymer without loading it first. To " + 'load polymer, ');
+ };
+ }
+ }
+ if (HTMLImports.useNative) {
+ installPolymerWarning();
+ } else {
+ window.addEventListener("DOMContentLoaded", installPolymerWarning);
+ }
+})(window.WebComponents);
+
+(function(scope) {
+ var style = document.createElement("style");
+ style.textContent = "" + "body {" + "transition: opacity ease-in 0.2s;" + " } \n" + "body[unresolved] {" + "opacity: 0; display: block; overflow: hidden; position: relative;" + " } \n";
+ var head = document.querySelector("head");
+ head.insertBefore(style, head.firstChild);
+})(window.WebComponents);
+
+(function(scope) {
+ window.Platform = scope;
+})(window.WebComponents);
\ No newline at end of file
diff --git a/dashboard-ui/thirdparty/webcomponentsjs/webcomponents.min.js b/dashboard-ui/bower_components/webcomponentsjs/webcomponents.min.js
similarity index 80%
rename from dashboard-ui/thirdparty/webcomponentsjs/webcomponents.min.js
rename to dashboard-ui/bower_components/webcomponentsjs/webcomponents.min.js
index fa958412e9..4870c727e4 100644
--- a/dashboard-ui/thirdparty/webcomponentsjs/webcomponents.min.js
+++ b/dashboard-ui/bower_components/webcomponentsjs/webcomponents.min.js
@@ -7,9 +7,9 @@
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
-// @version 0.7.3
+// @version 0.7.5
window.WebComponents=window.WebComponents||{},function(e){var t=e.flags||{},n="webcomponents.js",r=document.querySelector('script[src*="'+n+'"]');if(!t.noOpts){if(location.search.slice(1).split("&").forEach(function(e){var n,r=e.split("=");r[0]&&(n=r[0].match(/wc-(.+)/))&&(t[n[1]]=r[1]||!0)}),r)for(var o,i=0;o=r.attributes[i];i++)"src"!==o.name&&(t[o.name]=o.value||!0);if(t.log&&t.log.split){var a=t.log.split(",");t.log={},a.forEach(function(e){t.log[e]=!0})}else t.log={}}t.shadow=t.shadow||t.shadowdom||t.polyfill,t.shadow="native"===t.shadow?!1:t.shadow||!HTMLElement.prototype.createShadowRoot,t.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=t.register),e.flags=t}(WebComponents),WebComponents.flags.shadow&&("undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],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,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),window.ShadowDOMPolyfill={},function(e){"use strict";function t(){if("undefined"!=typeof chrome&&chrome.app&&chrome.app.runtime)return!1;if(navigator.getDeviceStorage)return!1;try{var e=new Function("return true;");return e()}catch(t){return!1}}function n(e){if(!e)throw new Error("Assertion failed")}function r(e,t){for(var n=W(t),r=0;rl;l++)c[l]=new Array(s),c[l][0]=l;for(var u=0;s>u;u++)c[0][u]=u;for(var l=1;a>l;l++)for(var u=1;s>u;u++)if(this.equals(e[t+u-1],r[o+l-1]))c[l][u]=c[l-1][u-1];else{var d=c[l-1][u]+1,p=c[l][u-1]+1;c[l][u]=p>d?d:p}return c},spliceOperationsFromEditDistances:function(e){for(var t=e.length-1,n=e[0].length-1,s=e[t][n],c=[];t>0||n>0;)if(0!=t)if(0!=n){var l,u=e[t-1][n-1],d=e[t-1][n],p=e[t][n-1];l=p>d?u>d?d:u:u>p?p:u,l==u?(u==s?c.push(r):(c.push(o),s=u),t--,n--):l==d?(c.push(a),t--,s=d):(c.push(i),n--,s=p)}else c.push(a),t--;else c.push(i),n--;return c.reverse(),c},calcSplices:function(e,n,s,c,l,u){var d=0,p=0,h=Math.min(s-n,u-l);if(0==n&&0==l&&(d=this.sharedPrefix(e,c,h)),s==e.length&&u==c.length&&(p=this.sharedSuffix(e,c,h-d)),n+=d,l+=d,s-=p,u-=p,s-n==0&&u-l==0)return[];if(n==s){for(var f=t(n,[],0);u>l;)f.removed.push(c[l++]);return[f]}if(l==u)return[t(n,[],s-n)];for(var m=this.spliceOperationsFromEditDistances(this.calcEditDistances(e,n,s,c,l,u)),f=void 0,w=[],v=n,g=l,b=0;br;r++)if(!this.equals(e[r],t[r]))return r;return n},sharedSuffix:function(e,t,n){for(var r=e.length,o=t.length,i=0;n>i&&this.equals(e[--r],t[--o]);)i++;return i},calculateSplices:function(e,t){return this.calcSplices(e,0,e.length,t,0,t.length)},equals:function(e,t){return e===t}},e.ArraySplice=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(){a=!1;var e=i.slice(0);i=[];for(var t=0;t0){for(var u=0;u0&&r.length>0;){var i=n.pop(),a=r.pop();if(i!==a)break;o=i}return o}function u(e,t,n){t instanceof G.Window&&(t=t.document);var o,i=A(t),a=A(n),s=r(n,e),o=l(i,a);o||(o=a.root);for(var c=o;c;c=c.parent)for(var u=0;u0;i--)if(!g(t[i],e,o,t,r))return!1;return!0}function w(e,t,n,r){var o=ie,i=t[0]||n;return g(i,e,o,t,r)}function v(e,t,n,r){for(var o=ae,i=1;i0&&g(n,e,o,t,r)}function g(e,t,n,r,o){var i=z.get(e);if(!i)return!0;var a=o||s(r,e);if(a===e){if(n===oe)return!0;n===ae&&(n=ie)}else if(n===ae&&!t.bubbles)return!0;if("relatedTarget"in t){var c=B(t),l=c.relatedTarget;if(l){if(l instanceof Object&&l.addEventListener){var d=V(l),p=u(t,e,d);if(p===a)return!0}else p=null;Z.set(t,p)}}J.set(t,n);var h=t.type,f=!1;$.set(t,a),X.set(t,e),i.depth++;for(var m=0,w=i.length;w>m;m++){var v=i[m];if(v.removed)f=!0;else if(!(v.type!==h||!v.capture&&n===oe||v.capture&&n===ae))try{if("function"==typeof v.handler?v.handler.call(e,t):v.handler.handleEvent(t),ee.get(t))return!1}catch(g){P||(P=g)}}if(i.depth--,f&&0===i.depth){var b=i.slice();i.length=0;for(var m=0;mr;r++)t[r]=a(e[r]);return t.length=o,t}function o(e,t){e.prototype[t]=function(){return r(i(this)[t].apply(i(this),arguments))}}var i=e.unsafeUnwrap,a=e.wrap,s={enumerable:!1};n.prototype={item:function(e){return this[e]}},t(n.prototype,"item"),e.wrappers.NodeList=n,e.addWrapNodeListMethod=o,e.wrapNodeList=r}(window.ShadowDOMPolyfill),function(e){"use strict";e.wrapHTMLCollection=e.wrapNodeList,e.wrappers.HTMLCollection=e.wrappers.NodeList}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){O(e instanceof _)}function n(e){var t=new T;return t[0]=e,t.length=1,t}function r(e,t,n){N(t,"childList",{removedNodes:n,previousSibling:e.previousSibling,nextSibling:e.nextSibling})}function o(e,t){N(e,"childList",{removedNodes:t})}function i(e,t,r,o){if(e instanceof DocumentFragment){var i=s(e);U=!0;for(var a=i.length-1;a>=0;a--)e.removeChild(i[a]),i[a].parentNode_=t;U=!1;for(var a=0;ao;o++)r.appendChild(P(t[o]));return r}function w(e){if(void 0!==e.firstChild_)for(var t=e.firstChild_;t;){var n=t;t=t.nextSibling_,n.parentNode_=n.previousSibling_=n.nextSibling_=void 0}e.firstChild_=e.lastChild_=void 0}function v(e){if(e.invalidateShadowRenderer()){for(var t=e.firstChild;t;){O(t.parentNode===e);var n=t.nextSibling,r=P(t),o=r.parentNode;o&&$.call(o,r),t.previousSibling_=t.nextSibling_=t.parentNode_=null,t=n}e.firstChild_=e.lastChild_=null}else for(var n,i=P(e),a=i.firstChild;a;)n=a.nextSibling,$.call(i,a),a=n}function g(e){var t=e.parentNode;return t&&t.invalidateShadowRenderer()}function b(e){for(var t,n=0;ns;s++)i=b(t[s]),!o&&(a=v(i).root)&&a instanceof e.wrappers.ShadowRoot||(r[n++]=i);return n}function n(e){return String(e).replace(/\/deep\/|::shadow|>>>/g," ")}function r(e){return String(e).replace(/:host\(([^\s]+)\)/g,"$1").replace(/([^\s]):host/g,"$1").replace(":host","*").replace(/\^|\/shadow\/|\/shadow-deep\/|::shadow|\/deep\/|::content|>>>/g," ")}function o(e,t){for(var n,r=e.firstElementChild;r;){if(r.matches(t))return r;if(n=o(r,t))return n;r=r.nextElementSibling}return null}function i(e,t){return e.matches(t)}function a(e,t,n){var r=e.localName;return r===t||r===n&&e.namespaceURI===j}function s(){return!0}function c(e,t,n){return e.localName===n}function l(e,t){return e.namespaceURI===t}function u(e,t,n){return e.namespaceURI===t&&e.localName===n}function d(e,t,n,r,o,i){for(var a=e.firstElementChild;a;)r(a,o,i)&&(n[t++]=a),t=d(a,t,n,r,o,i),a=a.nextElementSibling;return t}function p(n,r,o,i,a){var s,c=g(this),l=v(this).root;if(l instanceof e.wrappers.ShadowRoot)return d(this,r,o,n,i,null);if(c instanceof N)s=S.call(c,i);else{if(!(c instanceof C))return d(this,r,o,n,i,null);s=_.call(c,i)}return t(s,r,o,a)}function h(n,r,o,i,a){var s,c=g(this),l=v(this).root;if(l instanceof e.wrappers.ShadowRoot)return d(this,r,o,n,i,a);if(c instanceof N)s=M.call(c,i,a);else{if(!(c instanceof C))return d(this,r,o,n,i,a);s=T.call(c,i,a)}return t(s,r,o,!1)}function f(n,r,o,i,a){var s,c=g(this),l=v(this).root;if(l instanceof e.wrappers.ShadowRoot)return d(this,r,o,n,i,a);if(c instanceof N)s=L.call(c,i,a);else{if(!(c instanceof C))return d(this,r,o,n,i,a);s=O.call(c,i,a)}return t(s,r,o,!1)}var m=e.wrappers.HTMLCollection,w=e.wrappers.NodeList,v=e.getTreeScope,g=e.unsafeUnwrap,b=e.wrap,y=document.querySelector,E=document.documentElement.querySelector,_=document.querySelectorAll,S=document.documentElement.querySelectorAll,T=document.getElementsByTagName,M=document.documentElement.getElementsByTagName,O=document.getElementsByTagNameNS,L=document.documentElement.getElementsByTagNameNS,N=window.Element,C=window.HTMLDocument||window.Document,j="http://www.w3.org/1999/xhtml",D={querySelector:function(t){var r=n(t),i=r!==t;t=r;var a,s=g(this),c=v(this).root;if(c instanceof e.wrappers.ShadowRoot)return o(this,t);if(s instanceof N)a=b(E.call(s,t));else{if(!(s instanceof C))return o(this,t);
a=b(y.call(s,t))}return a&&!i&&(c=v(a).root)&&c instanceof e.wrappers.ShadowRoot?o(this,t):a},querySelectorAll:function(e){var t=n(e),r=t!==e;e=t;var o=new w;return o.length=p.call(this,i,0,o,e,r),o}},H={matches:function(t){return t=r(t),e.originalMatches.call(g(this),t)}},x={getElementsByTagName:function(e){var t=new m,n="*"===e?s:a;return t.length=h.call(this,n,0,t,e,e.toLowerCase()),t},getElementsByClassName:function(e){return this.querySelectorAll("."+e)},getElementsByTagNameNS:function(e,t){var n=new m,r=null;return r="*"===e?"*"===t?s:c:"*"===t?l:u,n.length=f.call(this,r,0,n,e||null,t),n}};e.GetElementsByInterface=x,e.SelectorsInterface=D,e.MatchesInterface=H}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.nextSibling;return e}function n(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.previousSibling;return e}var r=e.wrappers.NodeList,o={get firstElementChild(){return t(this.firstChild)},get lastElementChild(){return n(this.lastChild)},get childElementCount(){for(var e=0,t=this.firstElementChild;t;t=t.nextElementSibling)e++;return e},get children(){for(var e=new r,t=0,n=this.firstElementChild;n;n=n.nextElementSibling)e[t++]=n;return e.length=t,e},remove:function(){var e=this.parentNode;e&&e.removeChild(this)}},i={get nextElementSibling(){return t(this.nextSibling)},get previousElementSibling(){return n(this.previousSibling)}},a={getElementById:function(e){return/[ \t\n\r\f]/.test(e)?null:this.querySelector('[id="'+e+'"]')}};e.ChildNodeInterface=i,e.NonElementParentNodeInterface=a,e.ParentNodeInterface=o}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}var n=e.ChildNodeInterface,r=e.wrappers.Node,o=e.enqueueMutation,i=e.mixin,a=e.registerWrapper,s=e.unsafeUnwrap,c=window.CharacterData;t.prototype=Object.create(r.prototype),i(t.prototype,{get nodeValue(){return this.data},set nodeValue(e){this.data=e},get textContent(){return this.data},set textContent(e){this.data=e},get data(){return s(this).data},set data(e){var t=s(this).data;o(this,"characterData",{oldValue:t}),s(this).data=e}}),i(t.prototype,n),a(c,t,document.createTextNode("")),e.wrappers.CharacterData=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e>>>0}function n(e){r.call(this,e)}var r=e.wrappers.CharacterData,o=(e.enqueueMutation,e.mixin),i=e.registerWrapper,a=window.Text;n.prototype=Object.create(r.prototype),o(n.prototype,{splitText:function(e){e=t(e);var n=this.data;if(e>n.length)throw new Error("IndexSizeError");var r=n.slice(0,e),o=n.slice(e);this.data=r;var i=this.ownerDocument.createTextNode(o);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}}),i(a,n,document.createTextNode("")),e.wrappers.Text=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return i(e).getAttribute("class")}function n(e,t){a(e,"attributes",{name:"class",namespace:null,oldValue:t})}function r(t){e.invalidateRendererBasedOnAttribute(t,"class")}function o(e,o,i){var a=e.ownerElement_;if(null==a)return o.apply(e,i);var s=t(a),c=o.apply(e,i);return t(a)!==s&&(n(a,s),r(a)),c}if(!window.DOMTokenList)return void console.warn("Missing DOMTokenList prototype, please include a compatible classList polyfill such as http://goo.gl/uTcepH.");var i=e.unsafeUnwrap,a=e.enqueueMutation,s=DOMTokenList.prototype.add;DOMTokenList.prototype.add=function(){o(this,s,arguments)};var c=DOMTokenList.prototype.remove;DOMTokenList.prototype.remove=function(){o(this,c,arguments)};var l=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(){return o(this,l,arguments)}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(t,n){var r=t.parentNode;if(r&&r.shadowRoot){var o=e.getRendererForHost(r);o.dependsOnAttribute(n)&&o.invalidate()}}function n(e,t,n){u(e,"attributes",{name:t,namespace:null,oldValue:n})}function r(e){a.call(this,e)}var o=e.ChildNodeInterface,i=e.GetElementsByInterface,a=e.wrappers.Node,s=e.ParentNodeInterface,c=e.SelectorsInterface,l=e.MatchesInterface,u=(e.addWrapNodeListMethod,e.enqueueMutation),d=e.mixin,p=(e.oneOf,e.registerWrapper),h=e.unsafeUnwrap,f=e.wrappers,m=window.Element,w=["matches","mozMatchesSelector","msMatchesSelector","webkitMatchesSelector"].filter(function(e){return m.prototype[e]}),v=w[0],g=m.prototype[v],b=new WeakMap;r.prototype=Object.create(a.prototype),d(r.prototype,{createShadowRoot:function(){var t=new f.ShadowRoot(this);h(this).polymerShadowRoot_=t;var n=e.getRendererForHost(this);return n.invalidate(),t},get shadowRoot(){return h(this).polymerShadowRoot_||null},setAttribute:function(e,r){var o=h(this).getAttribute(e);h(this).setAttribute(e,r),n(this,e,o),t(this,e)},removeAttribute:function(e){var r=h(this).getAttribute(e);h(this).removeAttribute(e),n(this,e,r),t(this,e)},get classList(){var e=b.get(this);if(!e){if(e=h(this).classList,!e)return;e.ownerElement_=this,b.set(this,e)}return e},get className(){return h(this).className},set className(e){this.setAttribute("class",e)},get id(){return h(this).id},set id(e){this.setAttribute("id",e)}}),w.forEach(function(e){"matches"!==e&&(r.prototype[e]=function(e){return this.matches(e)})}),m.prototype.webkitCreateShadowRoot&&(r.prototype.webkitCreateShadowRoot=r.prototype.createShadowRoot),d(r.prototype,o),d(r.prototype,i),d(r.prototype,s),d(r.prototype,c),d(r.prototype,l),p(m,r,document.createElementNS(null,"x")),e.invalidateRendererBasedOnAttribute=t,e.matchesNames=w,e.originalMatches=g,e.wrappers.Element=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case" ":return" "}}function n(e){return e.replace(L,t)}function r(e){return e.replace(N,t)}function o(e){for(var t={},n=0;n"):c+">"+s(e)+""+a+">";case Node.TEXT_NODE:var d=e.data;return t&&j[t.localName]?d:r(d);case Node.COMMENT_NODE:return"";default:throw console.error(e),new Error("not implemented")}}function s(e){e instanceof O.HTMLTemplateElement&&(e=e.content);for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=a(n,e);return t}function c(e,t,n){var r=n||"div";e.textContent="";var o=T(e.ownerDocument.createElement(r));o.innerHTML=t;for(var i;i=o.firstChild;)e.appendChild(M(i))}function l(e){m.call(this,e)}function u(e,t){var n=T(e.cloneNode(!1));n.innerHTML=t;for(var r,o=T(document.createDocumentFragment());r=n.firstChild;)o.appendChild(r);return M(o)}function d(t){return function(){return e.renderAllPending(),S(this)[t]}}function p(e){w(l,e,d(e))}function h(t){Object.defineProperty(l.prototype,t,{get:d(t),set:function(n){e.renderAllPending(),S(this)[t]=n},configurable:!0,enumerable:!0})}function f(t){Object.defineProperty(l.prototype,t,{value:function(){return e.renderAllPending(),S(this)[t].apply(S(this),arguments)},configurable:!0,enumerable:!0})}var m=e.wrappers.Element,w=e.defineGetter,v=e.enqueueMutation,g=e.mixin,b=e.nodesWereAdded,y=e.nodesWereRemoved,E=e.registerWrapper,_=e.snapshotNodeList,S=e.unsafeUnwrap,T=e.unwrap,M=e.wrap,O=e.wrappers,L=/[&\u00A0"]/g,N=/[&\u00A0<>]/g,C=o(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),j=o(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]),D="http://www.w3.org/1999/xhtml",H=/MSIE/.test(navigator.userAgent),x=window.HTMLElement,R=window.HTMLTemplateElement;l.prototype=Object.create(m.prototype),g(l.prototype,{get innerHTML(){return s(this)},set innerHTML(e){if(H&&j[this.localName])return void(this.textContent=e);var t=_(this.childNodes);this.invalidateShadowRenderer()?this instanceof O.HTMLTemplateElement?c(this.content,e):c(this,e,this.tagName):!R&&this instanceof O.HTMLTemplateElement?c(this.content,e):S(this).innerHTML=e;var n=_(this.childNodes);v(this,"childList",{addedNodes:n,removedNodes:t}),y(t),b(n,this)},get outerHTML(){return a(this,this.parentNode)},set outerHTML(e){var t=this.parentNode;if(t){t.invalidateShadowRenderer();var n=u(t,e);t.replaceChild(n,this)}},insertAdjacentHTML:function(e,t){var n,r;switch(String(e).toLowerCase()){case"beforebegin":n=this.parentNode,r=this;break;case"afterend":n=this.parentNode,r=this.nextSibling;break;case"afterbegin":n=this,r=this.firstChild;break;case"beforeend":n=this,r=null;break;default:return}var o=u(n,t);n.insertBefore(o,r)},get hidden(){return this.hasAttribute("hidden")},set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollWidth"].forEach(p),["scrollLeft","scrollTop"].forEach(h),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(f),E(x,l,document.createElement("b")),e.wrappers.HTMLElement=l,e.getInnerHTML=s,e.setInnerHTML=c}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unsafeUnwrap,a=e.wrap,s=window.HTMLCanvasElement;t.prototype=Object.create(n.prototype),r(t.prototype,{getContext:function(){var e=i(this).getContext.apply(i(this),arguments);return e&&a(e)}}),o(s,t,document.createElement("canvas")),e.wrappers.HTMLCanvasElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=window.HTMLContentElement;t.prototype=Object.create(n.prototype),r(t.prototype,{constructor:t,get select(){return this.getAttribute("select")},set select(e){this.setAttribute("select",e)},setAttribute:function(e,t){n.prototype.setAttribute.call(this,e,t),"select"===String(e).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),i&&o(i,t),e.wrappers.HTMLContentElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=window.HTMLFormElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get elements(){return i(a(this).elements)}}),o(s,t,document.createElement("form")),e.wrappers.HTMLFormElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}function n(e,t){if(!(this instanceof n))throw new TypeError("DOM object constructor cannot be called as a function.");var o=i(document.createElement("img"));r.call(this,o),a(o,this),void 0!==e&&(o.width=e),void 0!==t&&(o.height=t)}var r=e.wrappers.HTMLElement,o=e.registerWrapper,i=e.unwrap,a=e.rewrap,s=window.HTMLImageElement;t.prototype=Object.create(r.prototype),o(s,t,document.createElement("img")),n.prototype=t.prototype,e.wrappers.HTMLImageElement=t,e.wrappers.Image=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=(e.mixin,e.wrappers.NodeList,e.registerWrapper),o=window.HTMLShadowElement;t.prototype=Object.create(n.prototype),t.prototype.constructor=t,o&&r(o,t),e.wrappers.HTMLShadowElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){if(!e.defaultView)return e;var t=d.get(e);if(!t){for(t=e.implementation.createHTMLDocument("");t.lastChild;)t.removeChild(t.lastChild);d.set(e,t)}return t}function n(e){for(var n,r=t(e.ownerDocument),o=c(r.createDocumentFragment());n=e.firstChild;)o.appendChild(n);return o}function r(e){if(o.call(this,e),!p){var t=n(e);u.set(this,l(t))}}var o=e.wrappers.HTMLElement,i=e.mixin,a=e.registerWrapper,s=e.unsafeUnwrap,c=e.unwrap,l=e.wrap,u=new WeakMap,d=new WeakMap,p=window.HTMLTemplateElement;r.prototype=Object.create(o.prototype),i(r.prototype,{constructor:r,get content(){return p?l(s(this).content):u.get(this)}}),p&&a(p,r),e.wrappers.HTMLTemplateElement=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.registerWrapper,o=window.HTMLMediaElement;o&&(t.prototype=Object.create(n.prototype),r(o,t,document.createElement("audio")),e.wrappers.HTMLMediaElement=t)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this,e)}function n(e){if(!(this instanceof n))throw new TypeError("DOM object constructor cannot be called as a function.");var t=i(document.createElement("audio"));r.call(this,t),a(t,this),t.setAttribute("preload","auto"),void 0!==e&&t.setAttribute("src",e)}var r=e.wrappers.HTMLMediaElement,o=e.registerWrapper,i=e.unwrap,a=e.rewrap,s=window.HTMLAudioElement;s&&(t.prototype=Object.create(r.prototype),o(s,t,document.createElement("audio")),n.prototype=t.prototype,e.wrappers.HTMLAudioElement=t,e.wrappers.Audio=n)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e.replace(/\s+/g," ").trim()}function n(e){o.call(this,e)}function r(e,t,n,i){if(!(this instanceof r))throw new TypeError("DOM object constructor cannot be called as a function.");var a=c(document.createElement("option"));o.call(this,a),s(a,this),void 0!==e&&(a.text=e),void 0!==t&&a.setAttribute("value",t),n===!0&&a.setAttribute("selected",""),a.selected=i===!0}var o=e.wrappers.HTMLElement,i=e.mixin,a=e.registerWrapper,s=e.rewrap,c=e.unwrap,l=e.wrap,u=window.HTMLOptionElement;n.prototype=Object.create(o.prototype),i(n.prototype,{get text(){return t(this.textContent)},set text(e){this.textContent=t(String(e))},get form(){return l(c(this).form)}}),a(u,n,document.createElement("option")),r.prototype=n.prototype,e.wrappers.HTMLOptionElement=n,e.wrappers.Option=r}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unwrap,a=e.wrap,s=window.HTMLSelectElement;t.prototype=Object.create(n.prototype),r(t.prototype,{add:function(e,t){"object"==typeof t&&(t=i(t)),i(this).add(i(e),t)},remove:function(e){return void 0===e?void n.prototype.remove.call(this):("object"==typeof e&&(e=i(e)),void i(this).remove(e))},get form(){return a(i(this).form)}}),o(s,t,document.createElement("select")),e.wrappers.HTMLSelectElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unwrap,a=e.wrap,s=e.wrapHTMLCollection,c=window.HTMLTableElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get caption(){return a(i(this).caption)},createCaption:function(){return a(i(this).createCaption())},get tHead(){return a(i(this).tHead)},createTHead:function(){return a(i(this).createTHead())},createTFoot:function(){return a(i(this).createTFoot())},get tFoot(){return a(i(this).tFoot)},get tBodies(){return s(i(this).tBodies)},createTBody:function(){return a(i(this).createTBody())},get rows(){return s(i(this).rows)},insertRow:function(e){return a(i(this).insertRow(e))}}),o(c,t,document.createElement("table")),e.wrappers.HTMLTableElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=e.wrap,c=window.HTMLTableSectionElement;t.prototype=Object.create(n.prototype),r(t.prototype,{constructor:t,get rows(){return i(a(this).rows)},insertRow:function(e){return s(a(this).insertRow(e))}}),o(c,t,document.createElement("thead")),e.wrappers.HTMLTableSectionElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=e.wrap,c=window.HTMLTableRowElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get cells(){return i(a(this).cells)},insertCell:function(e){return s(a(this).insertCell(e))}}),o(c,t,document.createElement("tr")),e.wrappers.HTMLTableRowElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e.localName){case"content":return new n(e);case"shadow":return new o(e);case"template":return new i(e)}r.call(this,e)}var n=e.wrappers.HTMLContentElement,r=e.wrappers.HTMLElement,o=e.wrappers.HTMLShadowElement,i=e.wrappers.HTMLTemplateElement,a=(e.mixin,e.registerWrapper),s=window.HTMLUnknownElement;t.prototype=Object.create(r.prototype),a(s,t),e.wrappers.HTMLUnknownElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.wrappers.Element,n=e.wrappers.HTMLElement,r=e.registerObject,o=e.defineWrapGetter,i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"title"),s=r(a),c=Object.getPrototypeOf(s.prototype).constructor;if(!("classList"in a)){var l=Object.getOwnPropertyDescriptor(t.prototype,"classList");Object.defineProperty(n.prototype,"classList",l),delete t.prototype.classList}o(c,"ownerSVGElement"),e.wrappers.SVGElement=c}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){p.call(this,e)}var n=e.mixin,r=e.registerWrapper,o=e.unwrap,i=e.wrap,a=window.SVGUseElement,s="http://www.w3.org/2000/svg",c=i(document.createElementNS(s,"g")),l=document.createElementNS(s,"use"),u=c.constructor,d=Object.getPrototypeOf(u.prototype),p=d.constructor;t.prototype=Object.create(d),"instanceRoot"in l&&n(t.prototype,{get instanceRoot(){return i(o(this).instanceRoot)},get animatedInstanceRoot(){return i(o(this).animatedInstanceRoot)}}),r(a,t,l),e.wrappers.SVGUseElement=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.EventTarget,r=e.mixin,o=e.registerWrapper,i=e.unsafeUnwrap,a=e.wrap,s=window.SVGElementInstance;s&&(t.prototype=Object.create(n.prototype),r(t.prototype,{get correspondingElement(){return a(i(this).correspondingElement)},get correspondingUseElement(){return a(i(this).correspondingUseElement)},get parentNode(){return a(i(this).parentNode)},get childNodes(){throw new Error("Not implemented")},get firstChild(){return a(i(this).firstChild)},get lastChild(){return a(i(this).lastChild)},get previousSibling(){return a(i(this).previousSibling)},get nextSibling(){return a(i(this).nextSibling)}}),o(s,t),e.wrappers.SVGElementInstance=t)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){o(e,this)}var n=e.mixin,r=e.registerWrapper,o=e.setWrapper,i=e.unsafeUnwrap,a=e.unwrap,s=e.unwrapIfNeeded,c=e.wrap,l=window.CanvasRenderingContext2D;n(t.prototype,{get canvas(){return c(i(this).canvas)},drawImage:function(){arguments[0]=s(arguments[0]),i(this).drawImage.apply(i(this),arguments)},createPattern:function(){return arguments[0]=a(arguments[0]),i(this).createPattern.apply(i(this),arguments)}}),r(l,t,document.createElement("canvas").getContext("2d")),e.wrappers.CanvasRenderingContext2D=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){o(e,this)}var n=e.mixin,r=e.registerWrapper,o=e.setWrapper,i=e.unsafeUnwrap,a=e.unwrapIfNeeded,s=e.wrap,c=window.WebGLRenderingContext;if(c){n(t.prototype,{get canvas(){return s(i(this).canvas)},texImage2D:function(){arguments[5]=a(arguments[5]),i(this).texImage2D.apply(i(this),arguments)},texSubImage2D:function(){arguments[6]=a(arguments[6]),i(this).texSubImage2D.apply(i(this),arguments)}});var l=/WebKit/.test(navigator.userAgent)?{drawingBufferHeight:null,drawingBufferWidth:null}:{};r(c,t,l),e.wrappers.WebGLRenderingContext=t}}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.GetElementsByInterface,n=e.NonElementParentNodeInterface,r=e.ParentNodeInterface,o=e.SelectorsInterface,i=e.mixin,a=e.registerObject,s=a(document.createDocumentFragment());i(s.prototype,r),i(s.prototype,o),i(s.prototype,t),i(s.prototype,n);var c=a(document.createComment(""));e.wrappers.Comment=c,e.wrappers.DocumentFragment=s}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=d(u(e).ownerDocument.createDocumentFragment());n.call(this,t),c(t,this);var o=e.shadowRoot;h.set(this,o),this.treeScope_=new r(this,a(o||e)),p.set(this,e)}var n=e.wrappers.DocumentFragment,r=e.TreeScope,o=e.elementFromPoint,i=e.getInnerHTML,a=e.getTreeScope,s=e.mixin,c=e.rewrap,l=e.setInnerHTML,u=e.unsafeUnwrap,d=e.unwrap,p=new WeakMap,h=new WeakMap;t.prototype=Object.create(n.prototype),s(t.prototype,{constructor:t,get innerHTML(){return i(this)},set innerHTML(e){l(this,e),this.invalidateShadowRenderer()},get olderShadowRoot(){return h.get(this)||null},get host(){return p.get(this)||null},invalidateShadowRenderer:function(){return p.get(this).invalidateShadowRenderer()},elementFromPoint:function(e,t){return o(this,this.ownerDocument,e,t)}}),e.wrappers.ShadowRoot=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=d(e).root;return t instanceof h?t.host:null}function n(t,n){if(t.shadowRoot){n=Math.min(t.childNodes.length-1,n);var r=t.childNodes[n];if(r){var o=e.getDestinationInsertionPoints(r);if(o.length>0){var i=o[0].parentNode;i.nodeType==Node.ELEMENT_NODE&&(t=i)}}}return t}function r(e){return e=u(e),t(e)||e}function o(e){a(e,this)}var i=e.registerWrapper,a=e.setWrapper,s=e.unsafeUnwrap,c=e.unwrap,l=e.unwrapIfNeeded,u=e.wrap,d=e.getTreeScope,p=window.Range,h=e.wrappers.ShadowRoot;o.prototype={get startContainer(){return r(s(this).startContainer)},get endContainer(){return r(s(this).endContainer)},get commonAncestorContainer(){return r(s(this).commonAncestorContainer)},setStart:function(e,t){e=n(e,t),s(this).setStart(l(e),t)},setEnd:function(e,t){e=n(e,t),s(this).setEnd(l(e),t)},setStartBefore:function(e){s(this).setStartBefore(l(e))},setStartAfter:function(e){s(this).setStartAfter(l(e))},setEndBefore:function(e){s(this).setEndBefore(l(e))},setEndAfter:function(e){s(this).setEndAfter(l(e))},selectNode:function(e){s(this).selectNode(l(e))},selectNodeContents:function(e){s(this).selectNodeContents(l(e))},compareBoundaryPoints:function(e,t){return s(this).compareBoundaryPoints(e,c(t))},extractContents:function(){return u(s(this).extractContents())},cloneContents:function(){return u(s(this).cloneContents())},insertNode:function(e){s(this).insertNode(l(e))},surroundContents:function(e){s(this).surroundContents(l(e))},cloneRange:function(){return u(s(this).cloneRange())},isPointInRange:function(e,t){return s(this).isPointInRange(l(e),t)},comparePoint:function(e,t){return s(this).comparePoint(l(e),t)},intersectsNode:function(e){return s(this).intersectsNode(l(e))},toString:function(){return s(this).toString()}},p.prototype.createContextualFragment&&(o.prototype.createContextualFragment=function(e){return u(s(this).createContextualFragment(e))}),i(window.Range,o,document.createRange()),e.wrappers.Range=o}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){e.previousSibling_=e.previousSibling,e.nextSibling_=e.nextSibling,e.parentNode_=e.parentNode}function n(n,o,i){var a=x(n),s=x(o),c=i?x(i):null;if(r(o),t(o),i)n.firstChild===i&&(n.firstChild_=i),i.previousSibling_=i.previousSibling;else{n.lastChild_=n.lastChild,n.lastChild===n.firstChild&&(n.firstChild_=n.firstChild);var l=R(a.lastChild);l&&(l.nextSibling_=l.nextSibling)}e.originalInsertBefore.call(a,s,c)}function r(n){var r=x(n),o=r.parentNode;if(o){var i=R(o);t(n),n.previousSibling&&(n.previousSibling.nextSibling_=n),n.nextSibling&&(n.nextSibling.previousSibling_=n),i.lastChild===n&&(i.lastChild_=n),i.firstChild===n&&(i.firstChild_=n),e.originalRemoveChild.call(o,r)}}function o(e){P.set(e,[])}function i(e){var t=P.get(e);return t||P.set(e,t=[]),t}function a(e){for(var t=[],n=0,r=e.firstChild;r;r=r.nextSibling)t[n++]=r;return t}function s(){for(var e=0;em;m++){var w=R(i[u++]);s.get(w)||r(w)}for(var v=h.addedCount,g=i[u]&&R(i[u]),m=0;v>m;m++){var b=o[l++],y=b.node;n(t,y,g),s.set(y,!0),b.sync(s)}d+=v}for(var p=d;p=0;o--){var i=r[o],a=m(i);if(a){var s=i.olderShadowRoot;s&&(n=f(s));for(var c=0;c=0;u--)l=Object.create(l);["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"].forEach(function(e){var t=o[e];t&&(l[e]=function(){C(this)instanceof r||M(this),t.apply(C(this),arguments)})});var d={prototype:l};i&&(d["extends"]=i),r.prototype=o,r.prototype.constructor=r,e.constructorTable.set(l,r),e.nativePrototypeTable.set(o,l);P.call(N(this),t,d);return r},y([window.HTMLDocument||window.Document],["registerElement"])}y([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement,window.HTMLHtmlElement],["appendChild","compareDocumentPosition","contains","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS","insertBefore","querySelector","querySelectorAll","removeChild","replaceChild"]),y([window.HTMLBodyElement,window.HTMLHeadElement,window.HTMLHtmlElement],E),y([window.HTMLDocument||window.Document],["adoptNode","importNode","contains","createComment","createDocumentFragment","createElement","createElementNS","createEvent","createEventNS","createRange","createTextNode","createTreeWalker","elementFromPoint","getElementById","getElementsByName","getSelection"]),_(t.prototype,l),_(t.prototype,d),_(t.prototype,f),_(t.prototype,p),_(t.prototype,{get implementation(){var e=D.get(this);return e?e:(e=new a(N(this).implementation),D.set(this,e),e)},get defaultView(){return C(N(this).defaultView)}}),S(window.Document,t,document.implementation.createHTMLDocument("")),window.HTMLDocument&&S(window.HTMLDocument,t),j([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement]);var k=document.implementation.createDocument;a.prototype.createDocument=function(){return arguments[2]=N(arguments[2]),C(k.apply(L(this),arguments))},s(a,"createDocumentType"),s(a,"createHTMLDocument"),c(a,"hasFeature"),S(window.DOMImplementation,a),y([window.DOMImplementation],["createDocument","createDocumentType","createHTMLDocument","hasFeature"]),e.adoptNodeNoRemove=r,e.wrappers.DOMImplementation=a,e.wrappers.Document=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.EventTarget,r=e.wrappers.Selection,o=e.mixin,i=e.registerWrapper,a=e.renderAllPending,s=e.unwrap,c=e.unwrapIfNeeded,l=e.wrap,u=window.Window,d=window.getComputedStyle,p=window.getDefaultComputedStyle,h=window.getSelection;t.prototype=Object.create(n.prototype),u.prototype.getComputedStyle=function(e,t){return l(this||window).getComputedStyle(c(e),t)},p&&(u.prototype.getDefaultComputedStyle=function(e,t){return l(this||window).getDefaultComputedStyle(c(e),t)}),u.prototype.getSelection=function(){return l(this||window).getSelection()},delete window.getComputedStyle,delete window.getDefaultComputedStyle,delete window.getSelection,["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){u.prototype[e]=function(){var t=l(this||window);return t[e].apply(t,arguments)},delete window[e]}),o(t.prototype,{getComputedStyle:function(e,t){return a(),d.call(s(this),c(e),t)},getSelection:function(){return a(),new r(h.call(s(this)))},get document(){return l(s(this).document)}}),p&&(t.prototype.getDefaultComputedStyle=function(e,t){return a(),p.call(s(this),c(e),t)}),i(u,t,window),e.wrappers.Window=t}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.unwrap,n=window.DataTransfer||window.Clipboard,r=n.prototype.setDragImage;r&&(n.prototype.setDragImage=function(e,n,o){r.call(this,t(e),n,o)})}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t;t=e instanceof i?e:new i(e&&o(e)),r(t,this)}var n=e.registerWrapper,r=e.setWrapper,o=e.unwrap,i=window.FormData;i&&(n(i,t,new i),e.wrappers.FormData=t)}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.unwrapIfNeeded,n=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){return n.call(this,t(e))}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=n[e],r=window[t];if(r){var o=document.createElement(e),i=o.constructor;window[t]=i}}var n=(e.isWrapperFor,{a:"HTMLAnchorElement",area:"HTMLAreaElement",audio:"HTMLAudioElement",base:"HTMLBaseElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",col:"HTMLTableColElement",content:"HTMLContentElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",del:"HTMLModElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",font:"HTMLFontElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",head:"HTMLHeadElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",menuitem:"HTMLMenuItemElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",script:"HTMLScriptElement",select:"HTMLSelectElement",shadow:"HTMLShadowElement",source:"HTMLSourceElement",span:"HTMLSpanElement",style:"HTMLStyleElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",ul:"HTMLUListElement",video:"HTMLVideoElement"});Object.keys(n).forEach(t),Object.getOwnPropertyNames(e.wrappers).forEach(function(t){window[t]=e.wrappers[t]})}(window.ShadowDOMPolyfill),function(e){function t(e,t){var n="";return Array.prototype.forEach.call(e,function(e){n+=e.textContent+"\n\n"}),t||(n=n.replace(d,"")),n}function n(e){var t=document.createElement("style");return t.textContent=e,t}function r(e){var t=n(e);document.head.appendChild(t);var r=[];if(t.sheet)try{r=t.sheet.cssRules}catch(o){}else console.warn("sheet not found",t);return t.parentNode.removeChild(t),r}function o(){C.initialized=!0,document.body.appendChild(C);var e=C.contentDocument,t=e.createElement("base");t.href=document.baseURI,e.head.appendChild(t)}function i(e){C.initialized||o(),document.body.appendChild(C),e(C.contentDocument),document.body.removeChild(C)}function a(e,t){if(t){var o;if(e.match("@import")&&D){var a=n(e);i(function(e){e.head.appendChild(a.impl),o=Array.prototype.slice.call(a.sheet.cssRules,0),t(o)})}else o=r(e),t(o)}}function s(e){e&&l().appendChild(document.createTextNode(e))}function c(e,t){var r=n(e);r.setAttribute(t,""),r.setAttribute(x,""),document.head.appendChild(r)}function l(){return j||(j=document.createElement("style"),j.setAttribute(x,""),j[x]=!0),j}var u={strictStyling:!1,registry:{},shimStyling:function(e,n,r){var o=this.prepareRoot(e,n,r),i=this.isTypeExtension(r),a=this.makeScopeSelector(n,i),s=t(o,!0);s=this.scopeCssText(s,a),e&&(e.shimmedStyle=s),this.addCssToDocument(s,n)},shimStyle:function(e,t){return this.shimCssText(e.textContent,t)},shimCssText:function(e,t){return e=this.insertDirectives(e),this.scopeCssText(e,t)},makeScopeSelector:function(e,t){return e?t?"[is="+e+"]":e:""},isTypeExtension:function(e){return e&&e.indexOf("-")<0},prepareRoot:function(e,t,n){var r=this.registerRoot(e,t,n);return this.replaceTextInStyles(r.rootStyles,this.insertDirectives),this.removeStyles(e,r.rootStyles),this.strictStyling&&this.applyScopeToContent(e,t),r.scopeStyles},removeStyles:function(e,t){for(var n,r=0,o=t.length;o>r&&(n=t[r]);r++)n.parentNode.removeChild(n)},registerRoot:function(e,t,n){var r=this.registry[t]={root:e,name:t,extendsName:n},o=this.findStyles(e);r.rootStyles=o,r.scopeStyles=r.rootStyles;var i=this.registry[r.extendsName];return i&&(r.scopeStyles=i.scopeStyles.concat(r.scopeStyles)),r},findStyles:function(e){if(!e)return[];var t=e.querySelectorAll("style");return Array.prototype.filter.call(t,function(e){return!e.hasAttribute(R)})},applyScopeToContent:function(e,t){e&&(Array.prototype.forEach.call(e.querySelectorAll("*"),function(e){e.setAttribute(t,"")}),Array.prototype.forEach.call(e.querySelectorAll("template"),function(e){this.applyScopeToContent(e.content,t)},this))},insertDirectives:function(e){return e=this.insertPolyfillDirectivesInCssText(e),this.insertPolyfillRulesInCssText(e)},insertPolyfillDirectivesInCssText:function(e){return e=e.replace(p,function(e,t){return t.slice(0,-2)+"{"}),e.replace(h,function(e,t){return t+" {"})},insertPolyfillRulesInCssText:function(e){return e=e.replace(f,function(e,t){return t.slice(0,-1)}),e.replace(m,function(e,t,n,r){var o=e.replace(t,"").replace(n,"");return r+o})},scopeCssText:function(e,t){var n=this.extractUnscopedRulesFromCssText(e);if(e=this.insertPolyfillHostInCssText(e),e=this.convertColonHost(e),e=this.convertColonHostContext(e),e=this.convertShadowDOMSelectors(e),t){var e,r=this;a(e,function(n){e=r.scopeRules(n,t)})}return e=e+"\n"+n,e.trim()},extractUnscopedRulesFromCssText:function(e){for(var t,n="";t=w.exec(e);)n+=t[1].slice(0,-1)+"\n\n";for(;t=v.exec(e);)n+=t[0].replace(t[2],"").replace(t[1],t[3])+"\n\n";return n},convertColonHost:function(e){return this.convertColonRule(e,E,this.colonHostPartReplacer)},convertColonHostContext:function(e){return this.convertColonRule(e,_,this.colonHostContextPartReplacer)},convertColonRule:function(e,t,n){return e.replace(t,function(e,t,r,o){if(t=O,r){for(var i,a=r.split(","),s=[],c=0,l=a.length;l>c&&(i=a[c]);c++)i=i.trim(),s.push(n(t,i,o));return s.join(",")}return t+o})},colonHostContextPartReplacer:function(e,t,n){return t.match(g)?this.colonHostPartReplacer(e,t,n):e+t+n+", "+t+" "+e+n},colonHostPartReplacer:function(e,t,n){return e+t.replace(g,"")+n},convertShadowDOMSelectors:function(e){for(var t=0;t","+","~"],r=e,o="["+t+"]";return n.forEach(function(e){var t=r.split(e);r=t.map(function(e){var t=e.trim().replace(L,"");return t&&n.indexOf(t)<0&&t.indexOf(o)<0&&(e=t.replace(/([^:]*)(:*)(.*)/,"$1"+o+"$2$3")),e}).join(e)}),r},insertPolyfillHostInCssText:function(e){return e.replace(M,b).replace(T,g)},propertiesFromRule:function(e){var t=e.style.cssText;e.style.content&&!e.style.content.match(/['"]+|attr/)&&(t=t.replace(/content:[^;]*;/g,"content: '"+e.style.content+"';"));var n=e.style;for(var r in n)"initial"===n[r]&&(t+=r+": initial; ");return t},replaceTextInStyles:function(e,t){e&&t&&(e instanceof Array||(e=[e]),Array.prototype.forEach.call(e,function(e){e.textContent=t.call(this,e.textContent)},this))},addCssToDocument:function(e,t){e.match("@import")?c(e,t):s(e)}},d=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim,p=/\/\*\s*@polyfill ([^*]*\*+([^\/*][^*]*\*+)*\/)([^{]*?){/gim,h=/polyfill-next-selector[^}]*content\:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim,f=/\/\*\s@polyfill-rule([^*]*\*+([^\/*][^*]*\*+)*)\//gim,m=/(polyfill-rule)[^}]*(content\:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,w=/\/\*\s@polyfill-unscoped-rule([^*]*\*+([^\/*][^*]*\*+)*)\//gim,v=/(polyfill-unscoped-rule)[^}]*(content\:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,g="-shadowcsshost",b="-shadowcsscontext",y=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",E=new RegExp("("+g+y,"gim"),_=new RegExp("("+b+y,"gim"),S="([>\\s~+[.,{:][\\s\\S]*)?$",T=/\:host/gim,M=/\:host-context/gim,O=g+"-no-combinator",L=new RegExp(g,"gim"),N=(new RegExp(b,"gim"),[/>>>/g,/::shadow/g,/::content/g,/\/deep\//g,/\/shadow\//g,/\/shadow-deep\//g,/\^\^/g,/\^/g]),C=document.createElement("iframe");C.style.display="none";var j,D=navigator.userAgent.match("Chrome"),H="shim-shadowdom",x="shim-shadowdom-css",R="no-shim";if(window.ShadowDOMPolyfill){s("style { display: none !important; }\n");var I=ShadowDOMPolyfill.wrap(document),P=I.querySelector("head");P.insertBefore(l(),P.childNodes[0]),document.addEventListener("DOMContentLoaded",function(){e.urlResolver;if(window.HTMLImports&&!HTMLImports.useNative){var t="link[rel=stylesheet]["+H+"]",n="style["+H+"]";HTMLImports.importer.documentPreloadSelectors+=","+t,HTMLImports.importer.importsPreloadSelectors+=","+t,HTMLImports.parser.documentSelectors=[HTMLImports.parser.documentSelectors,t,n].join(",");var r=HTMLImports.parser.parseGeneric;HTMLImports.parser.parseGeneric=function(e){if(!e[x]){var t=e.__importElement||e;if(!t.hasAttribute(H))return void r.call(this,e);e.__resource&&(t=e.ownerDocument.createElement("style"),t.textContent=e.__resource),HTMLImports.path.resolveUrlsInStyle(t,e.href),t.textContent=u.shimStyle(t),t.removeAttribute(H,""),t.setAttribute(x,""),t[x]=!0,t.parentNode!==P&&(e.parentNode===P?P.replaceChild(t,e):this.addElementToDocument(t)),t.__importParsed=!0,this.markParsingComplete(e),this.parseNext()}};var o=HTMLImports.parser.hasResource;HTMLImports.parser.hasResource=function(e){return"link"===e.localName&&"stylesheet"===e.rel&&e.hasAttribute(H)?e.__resource:o.call(this,e)}}})}e.ShadowCSS=u}(window.WebComponents)),function(e){window.ShadowDOMPolyfill?(window.wrap=ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}}(window.WebComponents),function(e){"use strict";function t(e){return void 0!==p[e]}function n(){s.call(this),this._isInvalid=!0}function r(e){return""==e&&n.call(this),e.toLowerCase()}function o(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function i(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,96].indexOf(t)?e:encodeURIComponent(e)}function a(e,a,s){function c(e){b.push(e)}var l=a||"scheme start",u=0,d="",v=!1,g=!1,b=[];e:for(;(e[u-1]!=f||0==u)&&!this._isInvalid;){var y=e[u];switch(l){case"scheme start":if(!y||!m.test(y)){if(a){c("Invalid scheme.");break e}d="",l="no scheme";continue}d+=y.toLowerCase(),l="scheme";break;case"scheme":if(y&&w.test(y))d+=y.toLowerCase();else{if(":"!=y){if(a){if(f==y)break e;c("Code point not allowed in scheme: "+y);break e}d="",u=0,l="no scheme";continue}if(this._scheme=d,d="",a)break e;t(this._scheme)&&(this._isRelative=!0),l="file"==this._scheme?"relative":this._isRelative&&s&&s._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==y?(this._query="?",l="query"):"#"==y?(this._fragment="#",l="fragment"):f!=y&&" "!=y&&"\n"!=y&&"\r"!=y&&(this._schemeData+=o(y));break;case"no scheme":if(s&&t(s._scheme)){l="relative";continue}c("Missing scheme."),n.call(this);break;case"relative or authority":if("/"!=y||"/"!=e[u+1]){c("Expected /, got: "+y),l="relative";continue}l="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=s._scheme),f==y){this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._username=s._username,this._password=s._password;break e}if("/"==y||"\\"==y)"\\"==y&&c("\\ is an invalid code point."),l="relative slash";else if("?"==y)this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query="?",this._username=s._username,this._password=s._password,l="query";else{if("#"!=y){var E=e[u+1],_=e[u+2];("file"!=this._scheme||!m.test(y)||":"!=E&&"|"!=E||f!=_&&"/"!=_&&"\\"!=_&&"?"!=_&&"#"!=_)&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password,this._path=s._path.slice(),this._path.pop()),l="relative path";continue}this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._fragment="#",this._username=s._username,this._password=s._password,l="fragment"}break;case"relative slash":if("/"!=y&&"\\"!=y){"file"!=this._scheme&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password),l="relative path";continue}"\\"==y&&c("\\ is an invalid code point."),l="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=y){c("Expected '/', got: "+y),l="authority ignore slashes";continue}l="authority second slash";break;case"authority second slash":if(l="authority ignore slashes","/"!=y){c("Expected '/', got: "+y);continue}break;case"authority ignore slashes":if("/"!=y&&"\\"!=y){l="authority";continue}c("Expected authority, got: "+y);break;case"authority":if("@"==y){v&&(c("@ already seen."),d+="%40"),v=!0;for(var S=0;S0){var o=n[r-1],i=h(o,e);if(i)return void(n[r-1]=i)}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=w.get(e);t||w.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=w.get(e),n=0;nh&&(p=s[h]);h++)a(p)?(c++,n()):(p.addEventListener("load",r),p.addEventListener("error",i));else n()}function a(e){return d?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)c(t)&&l(t)}function c(e){return"link"===e.localName&&"import"===e.rel}function l(e){var t=e["import"];t?o({target:e}):(e.addEventListener("load",o),e.addEventListener("error",o))}var u="import",d=Boolean(u in document.createElement("link")),p=Boolean(window.ShadowDOMPolyfill),h=function(e){return p?ShadowDOMPolyfill.wrapIfNeeded(e):e},f=h(document),m={get:function(){var e=HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return h(e)},configurable:!0};Object.defineProperty(document,"_currentScript",m),Object.defineProperty(f,"_currentScript",m);var w=/Trident|Edge/.test(navigator.userAgent),v=w?"complete":"interactive",g="readystatechange";d&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,r=t.length;r>n&&(e=t[n]);n++)l(e)}()),t(function(e){HTMLImports.ready=!0,HTMLImports.readyTime=(new Date).getTime();var t=f.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),f.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=u,e.useNative=d,e.rootDocument=f,e.whenReady=t,e.isIE=w}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},r=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=r}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,r={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,r=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,r),e},resolveUrlsInCssText:function(e,r,o){var i=this.replaceUrls(e,o,r,t);return i=this.replaceUrls(i,o,r,n)},replaceUrls:function(e,t,n,r){return e.replace(r,function(e,r,o,i){var a=o.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,r+"'"+a+"'"+i})}};e.path=r}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,r,o){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){
-var n=i.getResponseHeader("Location"),a=null;if(n)var a="/"===n.substr(0,1)?location.origin+n:n;r.call(o,!t.ok(i)&&i,i.response||i.responseText,a)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,r=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};r.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;r>n&&(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){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,r){if(n.load&&console.log("fetch",e,r),e)if(e.match(/^data:/)){var o=e.split(","),i=o[0],a=o[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,r,null,a)}.bind(this),0)}else{var s=function(t,n,o){this.receive(e,r,t,n,o)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,r,{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;c>s&&(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=r}),window.HTMLImports.addModule(function(e){var t=function(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;r>n&&(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;r>n&&(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(e){function t(e){return"link"===e.localName&&e.rel===u}function n(e){var t=r(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function r(e){return e.textContent+o(e)}function o(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,r=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+r+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,c=e.flags,l=e.isIE,u=e.IMPORT_LINK_TYPE,d="link[rel="+u+"]",p={documentSelectors:d,importsSelectors:[d,"link[rel=stylesheet]","style","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){if(this.isParsed(e))return void(c.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){c.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,c.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(HTMLImports.__importsParsingHook&&HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.dispatchEvent(e.__resource&&!e.__error?new CustomEvent("load",{bubbles:!1}):new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,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(e,t){var n=this,r=function(r){t&&t(r),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",r),e.addEventListener("error",r),l&&"style"===e.localName){var o=!1;if(-1==e.textContent.indexOf("@import"))o=!0;else if(e.sheet){o=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,c=0;s>c&&(i=a[c]);c++)i.type===CSSRule.IMPORT_RULE&&(o=o&&Boolean(i.styleSheet))}o&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var r=document.createElement("script");r.__importElement=t,r.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(r,function(t){r.parentNode.removeChild(r),e.currentScript=null}),this.addElementToDocument(r)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var r,o=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=o.length;a>i&&(r=o[i]);i++)if(!this.isParsed(r))return this.hasResource(r)?t(r)?this.nextToParseInDoc(r["import"],r):r:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return t(e)&&void 0===e["import"]?!1:!0}};e.parser=p,e.IMPORT_SELECTOR=d}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function o(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var o=n.createElement("base");o.setAttribute("href",t),n.baseURI||r(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(o),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,c=e.rootDocument,l=e.Loader,u=e.Observer,d=e.parser,p={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){h.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);h.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===c?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,r,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=r,n.__error=a,t(n)){var c=this.documents[e];void 0===c&&(c=a?null:o(r,s||e),c&&(c.__importLink=n,this.bootDocument(c)),this.documents[e]=c),n["import"]=c}d.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),d.parseNext()},loadedAll:function(){d.parseNext()}},h=new l(p.loaded.bind(p),p.loadedAll.bind(p));if(p.observer=new u,!document.baseURI){var f={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",f),Object.defineProperty(c,"baseURI",f)}e.importer=p,e.importLoader=h}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,r={added:function(e){for(var r,o,i,a,s=0,c=e.length;c>s&&(a=e[s]);s++)r||(r=a.ownerDocument,o=t.isParsed(r)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&o&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&o.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&o.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=r.added.bind(r);var o=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){HTMLImports.importer.bootDocument(o)}var n=e.initializeModules,r=e.isIE;if(!e.useNative){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),n();var o=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[],r=function(e){n.push(e)},o=function(){n.forEach(function(t){t(e)})};e.addModule=r,e.initializeModules=o,e.hasNative=Boolean(document.registerElement),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function t(e,t){n(e,function(e){return t(e)?!0:void r(e,t)}),r(e,t)}function n(e,t,r){var o=e.firstElementChild;if(!o)for(o=e.firstChild;o&&o.nodeType!==Node.ELEMENT_NODE;)o=o.nextSibling;for(;o;)t(o,r)!==!0&&n(o,t,r),o=o.nextElementSibling;return null}function r(e,n){for(var r=e.shadowRoot;r;)t(r,n),r=r.olderShadowRoot}function o(e,t){i(e,t,[])}function i(e,t,n){if(e=wrap(e),!(n.indexOf(e)>=0)){n.push(e);for(var r,o=e.querySelectorAll("link[rel="+a+"]"),s=0,c=o.length;c>s&&(r=o[s]);s++)r["import"]&&i(r["import"],t,n);t(e)}}var a=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=o,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e){return n(e)||r(e)}function n(t){return e.upgrade(t)?!0:void s(t)}function r(e){y(e,function(e){return n(e)?!0:void 0})}function o(e){s(e),p(e)&&y(e,function(e){s(e)})}function i(e){T.push(e),S||(S=!0,setTimeout(a))}function a(){S=!1;for(var e,t=T,n=0,r=t.length;r>n&&(e=t[n]);n++)e();T=[]}function s(e){_?i(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&!e.__attached&&p(e)&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function l(e){u(e),y(e,function(e){u(e)})}function u(e){_?i(function(){d(e)}):d(e)}function d(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&e.__attached&&!p(e)&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function p(e){for(var t=e,n=wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function h(e){if(e.shadowRoot&&!e.shadowRoot.__watched){b.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)w(t),t=t.olderShadowRoot}}function f(e){if(b.dom){var n=e[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=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";o=o.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,o||"")}e.forEach(function(e){"childList"===e.type&&(M(e.addedNodes,function(e){e.localName&&t(e)}),M(e.removedNodes,function(e){e.localName&&l(e)}))}),b.dom&&console.groupEnd()}function m(e){for(e=wrap(e),e||(e=wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(f(t.takeRecords()),a())}function w(e){if(!e.__observer){var t=new MutationObserver(f);t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function v(e){e=wrap(e),b.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop()),t(e),w(e),b.dom&&console.groupEnd()}function g(e){E(e,v)}var b=e.flags,y=e.forSubtree,E=e.forDocumentTree,_=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;e.hasPolyfillMutations=_;var S=!1,T=[],M=Array.prototype.forEach.call.bind(Array.prototype.forEach),O=Element.prototype.createShadowRoot;O&&(Element.prototype.createShadowRoot=function(){var e=O.call(this);return CustomElements.watchShadow(this),e}),e.watchShadow=h,e.upgradeDocumentTree=g,e.upgradeSubtree=r,e.upgradeAll=t,e.attachedNode=o,e.takeRecords=m}),window.CustomElements.addModule(function(e){function t(t){if(!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var r=t.getAttribute("is"),o=e.getRegisteredDefinition(r||t.localName);if(o){if(r&&o.tag==t.localName)return n(t,o);if(!r&&!o["extends"])return n(t,o)}}}function n(t,n){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),r(t,n),t.__upgraded__=!0,i(t),e.attachedNode(t),e.upgradeSubtree(t),a.upgrade&&console.groupEnd(),t}function r(e,t){Object.__proto__?e.__proto__=t.prototype:(o(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function o(e,t,n){for(var r={},o=t;o!==n&&o!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(o),s=0;i=a[s];s++)r[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(o,i)),r[i]=1);o=Object.getPrototypeOf(o)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=r}),window.CustomElements.addModule(function(e){function t(t,r){var c=r||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(o(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(l(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return c.prototype||(c.prototype=Object.create(HTMLElement.prototype)),c.__name=t.toLowerCase(),c.lifecycle=c.lifecycle||{},c.ancestry=i(c["extends"]),a(c),s(c),n(c.prototype),u(c.__name,c),c.ctor=d(c),c.ctor.prototype=c.prototype,c.prototype.constructor=c.ctor,e.ready&&v(document),c.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){r.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){r.call(this,e,null,n)},e.setAttribute._polyfilled=!0}}function r(e,t,n){e=e.toLowerCase();var r=this.getAttribute(e);n.apply(this,arguments);var o=this.getAttribute(e);this.attributeChangedCallback&&o!==r&&this.attributeChangedCallback(e,r,o)}function o(e){for(var t=0;t<_.length;t++)if(e===_[t])return!0}function i(e){var t=l(e);return t?i(t["extends"]).concat([t]):[]}function a(e){for(var t,n=e["extends"],r=0;t=e.ancestry[r];r++)n=t.is&&t.tag;e.tag=n||e.__name,n&&(e.is=e.__name)}function s(e){if(!Object.__proto__){var t=HTMLElement.prototype;if(e.is){var n=document.createElement(e.tag),r=Object.getPrototypeOf(n);r===e.prototype&&(t=r)}for(var o,i=e.prototype;i&&i!==t;)o=Object.getPrototypeOf(i),i.__proto__=o,i=o;e["native"]=t}}function c(e){return b(M(e.tag),e)}function l(e){return e?S[e.toLowerCase()]:void 0}function u(e,t){S[e]=t}function d(e){return function(){return c(e)}}function p(e,t,n){return e===T?h(t,n):O(e,t)}function h(e,t){e&&(e=e.toLowerCase()),t&&(t=t.toLowerCase());var n=l(t||e);if(n){if(e==n.tag&&t==n.is)return new n.ctor;if(!t&&!n.is)return new n.ctor}var r;return t?(r=h(e),r.setAttribute("is",t),r):(r=M(e),e.indexOf("-")>=0&&y(r,HTMLElement),r)}function f(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return g(e),e}}var m,w=e.isIE11OrOlder,v=e.upgradeDocumentTree,g=e.upgradeAll,b=e.upgradeWithDefinition,y=e.implementPrototype,E=e.useNative,_=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],S={},T="http://www.w3.org/1999/xhtml",M=document.createElement.bind(document),O=document.createElementNS.bind(document);m=Object.__proto__||E?function(e,t){return e instanceof t}:function(e,t){for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},f(Node.prototype,"cloneNode"),f(document,"importNode"),w&&!function(){var e=document.importNode;document.importNode=function(){var t=e.apply(document,arguments);if(t.nodeType==t.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(t),n}return t}}(),document.registerElement=t,document.createElement=h,document.createElementNS=p,e.registry=S,e["instanceof"]=m,e.reservedTagList=_,e.getRegisteredDefinition=l,document.register=document.registerElement}),function(e){function t(){a(wrap(document)),window.HTMLImports&&(HTMLImports.__importsParsingHook=function(e){a(wrap(e["import"]))}),CustomElements.ready=!0,setTimeout(function(){CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}var n=e.useNative,r=e.initializeModules,o=/Trident/.test(navigator.userAgent);if(n){var i=function(){};e.watchShadow=i,e.upgrade=i,e.upgradeAll=i,e.upgradeDocumentTree=i,e.upgradeSubtree=i,e.takeRecords=i,e["instanceof"]=function(e,t){return e instanceof t}}else r();var a=e.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),o&&"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),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var s=window.HTMLImports&&!HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(s,t)}else t();e.isIE11OrOlder=o}(window.CustomElements),function(e){Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,n=Array.prototype.slice.call(arguments,1);return function(){var r=n.slice();return r.push.apply(r,arguments),t.apply(e,r)}})}(window.WebComponents),function(e){"use strict";function t(){window.Polymer===o&&(window.Polymer=function(){throw new Error('You tried to use polymer without loading it first. To load polymer, ')})}if(!window.performance){var n=Date.now();window.performance={now:function(){return Date.now()-n}}}window.requestAnimationFrame||(window.requestAnimationFrame=function(){var e=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return e?function(t){return e(function(){t(performance.now())})}:function(e){return window.setTimeout(e,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(){return window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}}());var r=[],o=function(e,t){"string"!=typeof e&&1===arguments.length&&Array.prototype.push.call(arguments,document._currentScript),r.push(arguments)};window.Polymer=o,e.consumeDeclarations=function(t){e.consumeDeclarations=function(){throw"Possible attempt to load Polymer twice"},t&&t(r),r=null},HTMLImports.useNative?t():addEventListener("DOMContentLoaded",t)}(window.WebComponents),function(e){var t=document.createElement("style");t.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var n=document.querySelector("head");n.insertBefore(t,n.firstChild)}(window.WebComponents),function(e){window.Platform=e}(window.WebComponents);
\ No newline at end of file
+adoptNode:function(e){return e.parentNode&&e.parentNode.removeChild(e),r(e,this),e},elementFromPoint:function(e,t){return b(this,this,e,t)},importNode:function(e,t){return v(e,t,L(this))},getSelection:function(){return T(),new h(x.call(N(this)))},getElementsByName:function(e){return f.querySelectorAll.call(this,"[name="+JSON.stringify(String(e))+"]")}});var R=document.createTreeWalker,I=e.wrappers.TreeWalker;if(t.prototype.createTreeWalker=function(e,t,n,r){var o=null;return n&&(n.acceptNode&&"function"==typeof n.acceptNode?o={acceptNode:function(e){return n.acceptNode(C(e))}}:"function"==typeof n&&(o=function(e){return n(C(e))})),new I(R.call(N(this),N(e),t,o,r))},document.registerElement){var P=document.registerElement;t.prototype.registerElement=function(t,n){function r(e){return e?void O(e,this):i?document.createElement(i,t):document.createElement(t)}var o,i;if(void 0!==n&&(o=n.prototype,i=n["extends"]),o||(o=Object.create(HTMLElement.prototype)),e.nativePrototypeTable.get(o))throw new Error("NotSupportedError");for(var a,s=Object.getPrototypeOf(o),c=[];s&&!(a=e.nativePrototypeTable.get(s));)c.push(s),s=Object.getPrototypeOf(s);if(!a)throw new Error("NotSupportedError");for(var l=Object.create(a),u=c.length-1;u>=0;u--)l=Object.create(l);["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"].forEach(function(e){var t=o[e];t&&(l[e]=function(){C(this)instanceof r||M(this),t.apply(C(this),arguments)})});var d={prototype:l};i&&(d["extends"]=i),r.prototype=o,r.prototype.constructor=r,e.constructorTable.set(l,r),e.nativePrototypeTable.set(o,l);P.call(N(this),t,d);return r},y([window.HTMLDocument||window.Document],["registerElement"])}y([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement,window.HTMLHtmlElement],["appendChild","compareDocumentPosition","contains","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS","insertBefore","querySelector","querySelectorAll","removeChild","replaceChild"]),y([window.HTMLBodyElement,window.HTMLHeadElement,window.HTMLHtmlElement],E),y([window.HTMLDocument||window.Document],["adoptNode","importNode","contains","createComment","createDocumentFragment","createElement","createElementNS","createEvent","createEventNS","createRange","createTextNode","createTreeWalker","elementFromPoint","getElementById","getElementsByName","getSelection"]),_(t.prototype,l),_(t.prototype,d),_(t.prototype,f),_(t.prototype,p),_(t.prototype,{get implementation(){var e=D.get(this);return e?e:(e=new a(N(this).implementation),D.set(this,e),e)},get defaultView(){return C(N(this).defaultView)}}),S(window.Document,t,document.implementation.createHTMLDocument("")),window.HTMLDocument&&S(window.HTMLDocument,t),j([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement]);var k=document.implementation.createDocument;a.prototype.createDocument=function(){return arguments[2]=N(arguments[2]),C(k.apply(L(this),arguments))},s(a,"createDocumentType"),s(a,"createHTMLDocument"),c(a,"hasFeature"),S(window.DOMImplementation,a),y([window.DOMImplementation],["createDocument","createDocumentType","createHTMLDocument","hasFeature"]),e.adoptNodeNoRemove=r,e.wrappers.DOMImplementation=a,e.wrappers.Document=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.EventTarget,r=e.wrappers.Selection,o=e.mixin,i=e.registerWrapper,a=e.renderAllPending,s=e.unwrap,c=e.unwrapIfNeeded,l=e.wrap,u=window.Window,d=window.getComputedStyle,p=window.getDefaultComputedStyle,h=window.getSelection;t.prototype=Object.create(n.prototype),u.prototype.getComputedStyle=function(e,t){return l(this||window).getComputedStyle(c(e),t)},p&&(u.prototype.getDefaultComputedStyle=function(e,t){return l(this||window).getDefaultComputedStyle(c(e),t)}),u.prototype.getSelection=function(){return l(this||window).getSelection()},delete window.getComputedStyle,delete window.getDefaultComputedStyle,delete window.getSelection,["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){u.prototype[e]=function(){var t=l(this||window);return t[e].apply(t,arguments)},delete window[e]}),o(t.prototype,{getComputedStyle:function(e,t){return a(),d.call(s(this),c(e),t)},getSelection:function(){return a(),new r(h.call(s(this)))},get document(){return l(s(this).document)}}),p&&(t.prototype.getDefaultComputedStyle=function(e,t){return a(),p.call(s(this),c(e),t)}),i(u,t,window),e.wrappers.Window=t}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.unwrap,n=window.DataTransfer||window.Clipboard,r=n.prototype.setDragImage;r&&(n.prototype.setDragImage=function(e,n,o){r.call(this,t(e),n,o)})}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t;t=e instanceof i?e:new i(e&&o(e)),r(t,this)}var n=e.registerWrapper,r=e.setWrapper,o=e.unwrap,i=window.FormData;i&&(n(i,t,new i),e.wrappers.FormData=t)}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e.unwrapIfNeeded,n=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){return n.call(this,t(e))}}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=n[e],r=window[t];if(r){var o=document.createElement(e),i=o.constructor;window[t]=i}}var n=(e.isWrapperFor,{a:"HTMLAnchorElement",area:"HTMLAreaElement",audio:"HTMLAudioElement",base:"HTMLBaseElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",col:"HTMLTableColElement",content:"HTMLContentElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",del:"HTMLModElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",font:"HTMLFontElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",head:"HTMLHeadElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",menuitem:"HTMLMenuItemElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",script:"HTMLScriptElement",select:"HTMLSelectElement",shadow:"HTMLShadowElement",source:"HTMLSourceElement",span:"HTMLSpanElement",style:"HTMLStyleElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",ul:"HTMLUListElement",video:"HTMLVideoElement"});Object.keys(n).forEach(t),Object.getOwnPropertyNames(e.wrappers).forEach(function(t){window[t]=e.wrappers[t]})}(window.ShadowDOMPolyfill),function(e){function t(e,t){var n="";return Array.prototype.forEach.call(e,function(e){n+=e.textContent+"\n\n"}),t||(n=n.replace(d,"")),n}function n(e){var t=document.createElement("style");return t.textContent=e,t}function r(e){var t=n(e);document.head.appendChild(t);var r=[];if(t.sheet)try{r=t.sheet.cssRules}catch(o){}else console.warn("sheet not found",t);return t.parentNode.removeChild(t),r}function o(){C.initialized=!0,document.body.appendChild(C);var e=C.contentDocument,t=e.createElement("base");t.href=document.baseURI,e.head.appendChild(t)}function i(e){C.initialized||o(),document.body.appendChild(C),e(C.contentDocument),document.body.removeChild(C)}function a(e,t){if(t){var o;if(e.match("@import")&&D){var a=n(e);i(function(e){e.head.appendChild(a.impl),o=Array.prototype.slice.call(a.sheet.cssRules,0),t(o)})}else o=r(e),t(o)}}function s(e){e&&l().appendChild(document.createTextNode(e))}function c(e,t){var r=n(e);r.setAttribute(t,""),r.setAttribute(x,""),document.head.appendChild(r)}function l(){return j||(j=document.createElement("style"),j.setAttribute(x,""),j[x]=!0),j}var u={strictStyling:!1,registry:{},shimStyling:function(e,n,r){var o=this.prepareRoot(e,n,r),i=this.isTypeExtension(r),a=this.makeScopeSelector(n,i),s=t(o,!0);s=this.scopeCssText(s,a),e&&(e.shimmedStyle=s),this.addCssToDocument(s,n)},shimStyle:function(e,t){return this.shimCssText(e.textContent,t)},shimCssText:function(e,t){return e=this.insertDirectives(e),this.scopeCssText(e,t)},makeScopeSelector:function(e,t){return e?t?"[is="+e+"]":e:""},isTypeExtension:function(e){return e&&e.indexOf("-")<0},prepareRoot:function(e,t,n){var r=this.registerRoot(e,t,n);return this.replaceTextInStyles(r.rootStyles,this.insertDirectives),this.removeStyles(e,r.rootStyles),this.strictStyling&&this.applyScopeToContent(e,t),r.scopeStyles},removeStyles:function(e,t){for(var n,r=0,o=t.length;o>r&&(n=t[r]);r++)n.parentNode.removeChild(n)},registerRoot:function(e,t,n){var r=this.registry[t]={root:e,name:t,extendsName:n},o=this.findStyles(e);r.rootStyles=o,r.scopeStyles=r.rootStyles;var i=this.registry[r.extendsName];return i&&(r.scopeStyles=i.scopeStyles.concat(r.scopeStyles)),r},findStyles:function(e){if(!e)return[];var t=e.querySelectorAll("style");return Array.prototype.filter.call(t,function(e){return!e.hasAttribute(R)})},applyScopeToContent:function(e,t){e&&(Array.prototype.forEach.call(e.querySelectorAll("*"),function(e){e.setAttribute(t,"")}),Array.prototype.forEach.call(e.querySelectorAll("template"),function(e){this.applyScopeToContent(e.content,t)},this))},insertDirectives:function(e){return e=this.insertPolyfillDirectivesInCssText(e),this.insertPolyfillRulesInCssText(e)},insertPolyfillDirectivesInCssText:function(e){return e=e.replace(p,function(e,t){return t.slice(0,-2)+"{"}),e.replace(h,function(e,t){return t+" {"})},insertPolyfillRulesInCssText:function(e){return e=e.replace(f,function(e,t){return t.slice(0,-1)}),e.replace(m,function(e,t,n,r){var o=e.replace(t,"").replace(n,"");return r+o})},scopeCssText:function(e,t){var n=this.extractUnscopedRulesFromCssText(e);if(e=this.insertPolyfillHostInCssText(e),e=this.convertColonHost(e),e=this.convertColonHostContext(e),e=this.convertShadowDOMSelectors(e),t){var e,r=this;a(e,function(n){e=r.scopeRules(n,t)})}return e=e+"\n"+n,e.trim()},extractUnscopedRulesFromCssText:function(e){for(var t,n="";t=w.exec(e);)n+=t[1].slice(0,-1)+"\n\n";for(;t=v.exec(e);)n+=t[0].replace(t[2],"").replace(t[1],t[3])+"\n\n";return n},convertColonHost:function(e){return this.convertColonRule(e,E,this.colonHostPartReplacer)},convertColonHostContext:function(e){return this.convertColonRule(e,_,this.colonHostContextPartReplacer)},convertColonRule:function(e,t,n){return e.replace(t,function(e,t,r,o){if(t=O,r){for(var i,a=r.split(","),s=[],c=0,l=a.length;l>c&&(i=a[c]);c++)i=i.trim(),s.push(n(t,i,o));return s.join(",")}return t+o})},colonHostContextPartReplacer:function(e,t,n){return t.match(g)?this.colonHostPartReplacer(e,t,n):e+t+n+", "+t+" "+e+n},colonHostPartReplacer:function(e,t,n){return e+t.replace(g,"")+n},convertShadowDOMSelectors:function(e){for(var t=0;t","+","~"],r=e,o="["+t+"]";return n.forEach(function(e){var t=r.split(e);r=t.map(function(e){var t=e.trim().replace(L,"");return t&&n.indexOf(t)<0&&t.indexOf(o)<0&&(e=t.replace(/([^:]*)(:*)(.*)/,"$1"+o+"$2$3")),e}).join(e)}),r},insertPolyfillHostInCssText:function(e){return e.replace(M,b).replace(T,g)},propertiesFromRule:function(e){var t=e.style.cssText;e.style.content&&!e.style.content.match(/['"]+|attr/)&&(t=t.replace(/content:[^;]*;/g,"content: '"+e.style.content+"';"));var n=e.style;for(var r in n)"initial"===n[r]&&(t+=r+": initial; ");return t},replaceTextInStyles:function(e,t){e&&t&&(e instanceof Array||(e=[e]),Array.prototype.forEach.call(e,function(e){e.textContent=t.call(this,e.textContent)},this))},addCssToDocument:function(e,t){e.match("@import")?c(e,t):s(e)}},d=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim,p=/\/\*\s*@polyfill ([^*]*\*+([^\/*][^*]*\*+)*\/)([^{]*?){/gim,h=/polyfill-next-selector[^}]*content\:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim,f=/\/\*\s@polyfill-rule([^*]*\*+([^\/*][^*]*\*+)*)\//gim,m=/(polyfill-rule)[^}]*(content\:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,w=/\/\*\s@polyfill-unscoped-rule([^*]*\*+([^\/*][^*]*\*+)*)\//gim,v=/(polyfill-unscoped-rule)[^}]*(content\:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,g="-shadowcsshost",b="-shadowcsscontext",y=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",E=new RegExp("("+g+y,"gim"),_=new RegExp("("+b+y,"gim"),S="([>\\s~+[.,{:][\\s\\S]*)?$",T=/\:host/gim,M=/\:host-context/gim,O=g+"-no-combinator",L=new RegExp(g,"gim"),N=(new RegExp(b,"gim"),[/>>>/g,/::shadow/g,/::content/g,/\/deep\//g,/\/shadow\//g,/\/shadow-deep\//g,/\^\^/g,/\^/g]),C=document.createElement("iframe");C.style.display="none";var j,D=navigator.userAgent.match("Chrome"),H="shim-shadowdom",x="shim-shadowdom-css",R="no-shim";if(window.ShadowDOMPolyfill){s("style { display: none !important; }\n");var I=ShadowDOMPolyfill.wrap(document),P=I.querySelector("head");P.insertBefore(l(),P.childNodes[0]),document.addEventListener("DOMContentLoaded",function(){e.urlResolver;if(window.HTMLImports&&!HTMLImports.useNative){var t="link[rel=stylesheet]["+H+"]",n="style["+H+"]";HTMLImports.importer.documentPreloadSelectors+=","+t,HTMLImports.importer.importsPreloadSelectors+=","+t,HTMLImports.parser.documentSelectors=[HTMLImports.parser.documentSelectors,t,n].join(",");var r=HTMLImports.parser.parseGeneric;HTMLImports.parser.parseGeneric=function(e){if(!e[x]){var t=e.__importElement||e;if(!t.hasAttribute(H))return void r.call(this,e);e.__resource&&(t=e.ownerDocument.createElement("style"),t.textContent=e.__resource),HTMLImports.path.resolveUrlsInStyle(t,e.href),t.textContent=u.shimStyle(t),t.removeAttribute(H,""),t.setAttribute(x,""),t[x]=!0,t.parentNode!==P&&(e.parentNode===P?P.replaceChild(t,e):this.addElementToDocument(t)),t.__importParsed=!0,this.markParsingComplete(e),this.parseNext()}};var o=HTMLImports.parser.hasResource;HTMLImports.parser.hasResource=function(e){return"link"===e.localName&&"stylesheet"===e.rel&&e.hasAttribute(H)?e.__resource:o.call(this,e)}}})}e.ShadowCSS=u}(window.WebComponents)),function(e){window.ShadowDOMPolyfill?(window.wrap=ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}}(window.WebComponents),function(e){"use strict";function t(e){return void 0!==p[e]}function n(){s.call(this),this._isInvalid=!0}function r(e){return""==e&&n.call(this),e.toLowerCase()}function o(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function i(e){var t=e.charCodeAt(0);return t>32&&127>t&&-1==[34,35,60,62,96].indexOf(t)?e:encodeURIComponent(e)}function a(e,a,s){function c(e){b.push(e)}var l=a||"scheme start",u=0,d="",v=!1,g=!1,b=[];e:for(;(e[u-1]!=f||0==u)&&!this._isInvalid;){var y=e[u];switch(l){case"scheme start":if(!y||!m.test(y)){if(a){c("Invalid scheme.");break e}d="",l="no scheme";continue}d+=y.toLowerCase(),l="scheme";break;case"scheme":if(y&&w.test(y))d+=y.toLowerCase();else{if(":"!=y){if(a){if(f==y)break e;c("Code point not allowed in scheme: "+y);break e}d="",u=0,l="no scheme";continue}if(this._scheme=d,d="",a)break e;t(this._scheme)&&(this._isRelative=!0),l="file"==this._scheme?"relative":this._isRelative&&s&&s._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==y?(this._query="?",l="query"):"#"==y?(this._fragment="#",l="fragment"):f!=y&&" "!=y&&"\n"!=y&&"\r"!=y&&(this._schemeData+=o(y));break;case"no scheme":if(s&&t(s._scheme)){l="relative";continue}c("Missing scheme."),n.call(this);break;case"relative or authority":if("/"!=y||"/"!=e[u+1]){c("Expected /, got: "+y),l="relative";continue}l="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=s._scheme),f==y){this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._username=s._username,this._password=s._password;break e}if("/"==y||"\\"==y)"\\"==y&&c("\\ is an invalid code point."),l="relative slash";else if("?"==y)this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query="?",this._username=s._username,this._password=s._password,l="query";else{if("#"!=y){var E=e[u+1],_=e[u+2];("file"!=this._scheme||!m.test(y)||":"!=E&&"|"!=E||f!=_&&"/"!=_&&"\\"!=_&&"?"!=_&&"#"!=_)&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password,this._path=s._path.slice(),this._path.pop()),l="relative path";continue}this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._fragment="#",this._username=s._username,this._password=s._password,l="fragment"}break;case"relative slash":if("/"!=y&&"\\"!=y){"file"!=this._scheme&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password),l="relative path";continue}"\\"==y&&c("\\ is an invalid code point."),l="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=y){c("Expected '/', got: "+y),l="authority ignore slashes";continue}l="authority second slash";break;case"authority second slash":if(l="authority ignore slashes","/"!=y){c("Expected '/', got: "+y);continue}break;case"authority ignore slashes":if("/"!=y&&"\\"!=y){l="authority";continue}c("Expected authority, got: "+y);break;case"authority":if("@"==y){v&&(c("@ already seen."),d+="%40"),v=!0;for(var S=0;S0){var o=n[r-1],i=h(o,e);if(i)return void(n[r-1]=i)}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=w.get(e);t||w.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=w.get(e),n=0;nh&&(p=s[h]);h++)a(p)?(c++,n()):(p.addEventListener("load",r),p.addEventListener("error",i));else n()}function a(e){return d?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)c(t)&&l(t)}function c(e){return"link"===e.localName&&"import"===e.rel}function l(e){var t=e["import"];t?o({target:e}):(e.addEventListener("load",o),e.addEventListener("error",o))}var u="import",d=Boolean(u in document.createElement("link")),p=Boolean(window.ShadowDOMPolyfill),h=function(e){return p?window.ShadowDOMPolyfill.wrapIfNeeded(e):e},f=h(document),m={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return h(e)},configurable:!0};Object.defineProperty(document,"_currentScript",m),Object.defineProperty(f,"_currentScript",m);var w=/Trident/.test(navigator.userAgent),v=w?"complete":"interactive",g="readystatechange";d&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,r=t.length;r>n&&(e=t[n]);n++)l(e)}()),t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=f.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),f.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=u,e.useNative=d,e.rootDocument=f,e.whenReady=t,e.isIE=w}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},r=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=r}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,r={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,r=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,r),e},resolveUrlsInCssText:function(e,r,o){var i=this.replaceUrls(e,o,r,t);return i=this.replaceUrls(i,o,r,n)},replaceUrls:function(e,t,n,r){return e.replace(r,function(e,r,o,i){var a=o.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,r+"'"+a+"'"+i})}};e.path=r}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,r,o){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){
+if(4===i.readyState){var n=i.getResponseHeader("Location"),a=null;if(n)var a="/"===n.substr(0,1)?location.origin+n:n;r.call(o,!t.ok(i)&&i,i.response||i.responseText,a)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,r=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};r.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;r>n&&(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){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,r){if(n.load&&console.log("fetch",e,r),e)if(e.match(/^data:/)){var o=e.split(","),i=o[0],a=o[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,r,null,a)}.bind(this),0)}else{var s=function(t,n,o){this.receive(e,r,t,n,o)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,r,{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;c>s&&(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=r}),window.HTMLImports.addModule(function(e){var t=function(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;r>n&&(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;r>n&&(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(e){function t(e){return"link"===e.localName&&e.rel===u}function n(e){var t=r(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function r(e){return e.textContent+o(e)}function o(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,r=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+r+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,c=e.flags,l=e.isIE,u=e.IMPORT_LINK_TYPE,d="link[rel="+u+"]",p={documentSelectors:d,importsSelectors:[d,"link[rel=stylesheet]","style","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){if(this.isParsed(e))return void(c.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){c.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,c.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.dispatchEvent(e.__resource&&!e.__error?new CustomEvent("load",{bubbles:!1}):new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,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(e,t){var n=this,r=function(r){t&&t(r),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",r),e.addEventListener("error",r),l&&"style"===e.localName){var o=!1;if(-1==e.textContent.indexOf("@import"))o=!0;else if(e.sheet){o=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,c=0;s>c&&(i=a[c]);c++)i.type===CSSRule.IMPORT_RULE&&(o=o&&Boolean(i.styleSheet))}o&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var r=document.createElement("script");r.__importElement=t,r.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(r,function(t){r.parentNode.removeChild(r),e.currentScript=null}),this.addElementToDocument(r)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var r,o=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=o.length;a>i&&(r=o[i]);i++)if(!this.isParsed(r))return this.hasResource(r)?t(r)?this.nextToParseInDoc(r["import"],r):r:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return t(e)&&void 0===e["import"]?!1:!0}};e.parser=p,e.IMPORT_SELECTOR=d}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function o(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var o=n.createElement("base");o.setAttribute("href",t),n.baseURI||r(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(o),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,c=e.rootDocument,l=e.Loader,u=e.Observer,d=e.parser,p={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){h.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);h.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===c?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,r,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=r,n.__error=a,t(n)){var c=this.documents[e];void 0===c&&(c=a?null:o(r,s||e),c&&(c.__importLink=n,this.bootDocument(c)),this.documents[e]=c),n["import"]=c}d.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),d.parseNext()},loadedAll:function(){d.parseNext()}},h=new l(p.loaded.bind(p),p.loadedAll.bind(p));if(p.observer=new u,!document.baseURI){var f={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",f),Object.defineProperty(c,"baseURI",f)}e.importer=p,e.importLoader=h}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,r={added:function(e){for(var r,o,i,a,s=0,c=e.length;c>s&&(a=e[s]);s++)r||(r=a.ownerDocument,o=t.isParsed(r)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&o&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&o.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&o.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=r.added.bind(r);var o=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){window.HTMLImports.importer.bootDocument(o)}var n=e.initializeModules,r=e.isIE;if(!e.useNative){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.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),n();var o=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[],r=function(e){n.push(e)},o=function(){n.forEach(function(t){t(e)})};e.addModule=r,e.initializeModules=o,e.hasNative=Boolean(document.registerElement),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(e){function t(e,t){n(e,function(e){return t(e)?!0:void r(e,t)}),r(e,t)}function n(e,t,r){var o=e.firstElementChild;if(!o)for(o=e.firstChild;o&&o.nodeType!==Node.ELEMENT_NODE;)o=o.nextSibling;for(;o;)t(o,r)!==!0&&n(o,t,r),o=o.nextElementSibling;return null}function r(e,n){for(var r=e.shadowRoot;r;)t(r,n),r=r.olderShadowRoot}function o(e,t){i(e,t,[])}function i(e,t,n){if(e=window.wrap(e),!(n.indexOf(e)>=0)){n.push(e);for(var r,o=e.querySelectorAll("link[rel="+a+"]"),s=0,c=o.length;c>s&&(r=o[s]);s++)r["import"]&&i(r["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=o,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e){return n(e)||r(e)}function n(t){return e.upgrade(t)?!0:void s(t)}function r(e){y(e,function(e){return n(e)?!0:void 0})}function o(e){s(e),p(e)&&y(e,function(e){s(e)})}function i(e){T.push(e),S||(S=!0,setTimeout(a))}function a(){S=!1;for(var e,t=T,n=0,r=t.length;r>n&&(e=t[n]);n++)e();T=[]}function s(e){_?i(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&!e.__attached&&p(e)&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function l(e){u(e),y(e,function(e){u(e)})}function u(e){_?i(function(){d(e)}):d(e)}function d(e){e.__upgraded__&&(e.attachedCallback||e.detachedCallback)&&e.__attached&&!p(e)&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function p(e){for(var t=e,n=wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function h(e){if(e.shadowRoot&&!e.shadowRoot.__watched){b.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)w(t),t=t.olderShadowRoot}}function f(e){if(b.dom){var n=e[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=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";o=o.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,o||"")}e.forEach(function(e){"childList"===e.type&&(M(e.addedNodes,function(e){e.localName&&t(e)}),M(e.removedNodes,function(e){e.localName&&l(e)}))}),b.dom&&console.groupEnd()}function m(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(f(t.takeRecords()),a())}function w(e){if(!e.__observer){var t=new MutationObserver(f);t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function v(e){e=window.wrap(e),b.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop()),t(e),w(e),b.dom&&console.groupEnd()}function g(e){E(e,v)}var b=e.flags,y=e.forSubtree,E=e.forDocumentTree,_=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;e.hasPolyfillMutations=_;var S=!1,T=[],M=Array.prototype.forEach.call.bind(Array.prototype.forEach),O=Element.prototype.createShadowRoot;O&&(Element.prototype.createShadowRoot=function(){var e=O.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=h,e.upgradeDocumentTree=g,e.upgradeSubtree=r,e.upgradeAll=t,e.attachedNode=o,e.takeRecords=m}),window.CustomElements.addModule(function(e){function t(t){if(!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var r=t.getAttribute("is"),o=e.getRegisteredDefinition(r||t.localName);if(o){if(r&&o.tag==t.localName)return n(t,o);if(!r&&!o["extends"])return n(t,o)}}}function n(t,n){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),r(t,n),t.__upgraded__=!0,i(t),e.attachedNode(t),e.upgradeSubtree(t),a.upgrade&&console.groupEnd(),t}function r(e,t){Object.__proto__?e.__proto__=t.prototype:(o(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function o(e,t,n){for(var r={},o=t;o!==n&&o!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(o),s=0;i=a[s];s++)r[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(o,i)),r[i]=1);o=Object.getPrototypeOf(o)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=r}),window.CustomElements.addModule(function(e){function t(t,r){var c=r||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(o(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(l(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return c.prototype||(c.prototype=Object.create(HTMLElement.prototype)),c.__name=t.toLowerCase(),c.lifecycle=c.lifecycle||{},c.ancestry=i(c["extends"]),a(c),s(c),n(c.prototype),u(c.__name,c),c.ctor=d(c),c.ctor.prototype=c.prototype,c.prototype.constructor=c.ctor,e.ready&&v(document),c.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){r.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){r.call(this,e,null,n)},e.setAttribute._polyfilled=!0}}function r(e,t,n){e=e.toLowerCase();var r=this.getAttribute(e);n.apply(this,arguments);var o=this.getAttribute(e);this.attributeChangedCallback&&o!==r&&this.attributeChangedCallback(e,r,o)}function o(e){for(var t=0;t<_.length;t++)if(e===_[t])return!0}function i(e){var t=l(e);return t?i(t["extends"]).concat([t]):[]}function a(e){for(var t,n=e["extends"],r=0;t=e.ancestry[r];r++)n=t.is&&t.tag;e.tag=n||e.__name,n&&(e.is=e.__name)}function s(e){if(!Object.__proto__){var t=HTMLElement.prototype;if(e.is){var n=document.createElement(e.tag),r=Object.getPrototypeOf(n);r===e.prototype&&(t=r)}for(var o,i=e.prototype;i&&i!==t;)o=Object.getPrototypeOf(i),i.__proto__=o,i=o;e["native"]=t}}function c(e){return b(M(e.tag),e)}function l(e){return e?S[e.toLowerCase()]:void 0}function u(e,t){S[e]=t}function d(e){return function(){return c(e)}}function p(e,t,n){return e===T?h(t,n):O(e,t)}function h(e,t){e&&(e=e.toLowerCase()),t&&(t=t.toLowerCase());var n=l(t||e);if(n){if(e==n.tag&&t==n.is)return new n.ctor;if(!t&&!n.is)return new n.ctor}var r;return t?(r=h(e),r.setAttribute("is",t),r):(r=M(e),e.indexOf("-")>=0&&y(r,HTMLElement),r)}function f(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return g(e),e}}var m,w=e.isIE11OrOlder,v=e.upgradeDocumentTree,g=e.upgradeAll,b=e.upgradeWithDefinition,y=e.implementPrototype,E=e.useNative,_=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],S={},T="http://www.w3.org/1999/xhtml",M=document.createElement.bind(document),O=document.createElementNS.bind(document);m=Object.__proto__||E?function(e,t){return e instanceof t}:function(e,t){for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},f(Node.prototype,"cloneNode"),f(document,"importNode"),w&&!function(){var e=document.importNode;document.importNode=function(){var t=e.apply(document,arguments);if(t.nodeType==t.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(t),n}return t}}(),document.registerElement=t,document.createElement=h,document.createElementNS=p,e.registry=S,e["instanceof"]=m,e.reservedTagList=_,e.getRegisteredDefinition=l,document.register=document.registerElement}),function(e){function t(){a(window.wrap(document)),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){a(wrap(e["import"]))}),window.CustomElements.ready=!0,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=/Trident/.test(navigator.userAgent);if(n){var i=function(){};e.watchShadow=i,e.upgrade=i,e.upgradeAll=i,e.upgradeDocumentTree=i,e.upgradeSubtree=i,e.takeRecords=i,e["instanceof"]=function(e,t){return e instanceof t}}else r();var a=e.upgradeDocumentTree;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),o&&"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.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var s=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(s,t)}else t();e.isIE11OrOlder=o}(window.CustomElements),function(e){Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,n=Array.prototype.slice.call(arguments,1);return function(){var r=n.slice();return r.push.apply(r,arguments),t.apply(e,r)}})}(window.WebComponents),function(e){"use strict";function t(){window.Polymer===o&&(window.Polymer=function(){throw new Error('You tried to use polymer without loading it first. To load polymer, ')})}if(!window.performance){var n=Date.now();window.performance={now:function(){return Date.now()-n}}}window.requestAnimationFrame||(window.requestAnimationFrame=function(){var e=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return e?function(t){return e(function(){t(performance.now())})}:function(e){return window.setTimeout(e,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(){return window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}}());var r=[],o=function(e,t){"string"!=typeof e&&1===arguments.length&&Array.prototype.push.call(arguments,document._currentScript),r.push(arguments)};window.Polymer=o,e.consumeDeclarations=function(t){e.consumeDeclarations=function(){throw"Possible attempt to load Polymer twice"},t&&t(r),r=null},HTMLImports.useNative?t():window.addEventListener("DOMContentLoaded",t)}(window.WebComponents),function(e){var t=document.createElement("style");t.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var n=document.querySelector("head");n.insertBefore(t,n.firstChild)}(window.WebComponents),function(e){window.Platform=e}(window.WebComponents);
\ No newline at end of file
diff --git a/dashboard-ui/channelitems.html b/dashboard-ui/channelitems.html
index f604b0f24f..d803c37847 100644
--- a/dashboard-ui/channelitems.html
+++ b/dashboard-ui/channelitems.html
@@ -7,8 +7,8 @@
diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html
index bb37cd8415..4cedc30932 100644
--- a/dashboard-ui/itemdetails.html
+++ b/dashboard-ui/itemdetails.html
@@ -4,15 +4,14 @@
-
+
@@ -31,65 +30,65 @@
@@ -112,8 +111,8 @@
@@ -141,19 +140,18 @@
${LabelOffline}
-
${ButtonPlay}
-
${ButtonPlayTrailer}
-
${ButtonPlayTrailer}
-
${ButtonPlay}
-
${ButtonSync}
-
${ButtonMore}
+
${ButtonPlay}
+
${ButtonPlayTrailer}
+
${ButtonPlayTrailer}
+
${ButtonSync}
+
- ${ButtonPrevious}
- ${ButtonNext}
+
+
-
+
+
diff --git a/dashboard-ui/librarysettings.html b/dashboard-ui/librarysettings.html
index e85753daf9..258045a69f 100644
--- a/dashboard-ui/librarysettings.html
+++ b/dashboard-ui/librarysettings.html
@@ -67,19 +67,22 @@
diff --git a/dashboard-ui/livetvchannel.html b/dashboard-ui/livetvchannel.html
index 4ab92ff6a8..61dd36bbbf 100644
--- a/dashboard-ui/livetvchannel.html
+++ b/dashboard-ui/livetvchannel.html
@@ -4,14 +4,14 @@
Emby
-
+
diff --git a/dashboard-ui/livetvchannels.html b/dashboard-ui/livetvchannels.html
index 2922b0f378..8665852bfa 100644
--- a/dashboard-ui/livetvchannels.html
+++ b/dashboard-ui/livetvchannels.html
@@ -4,14 +4,14 @@
Emby
-
+
@@ -22,12 +22,6 @@
-
-
diff --git a/dashboard-ui/livetvguide.html b/dashboard-ui/livetvguide.html
index a5e968ff40..f6f897193a 100644
--- a/dashboard-ui/livetvguide.html
+++ b/dashboard-ui/livetvguide.html
@@ -4,14 +4,14 @@
Emby
-
+
@@ -19,7 +19,7 @@
-
-
- ${ButtonUnlockGuide}
-
-
-
-
-
-
diff --git a/dashboard-ui/livetvitems.html b/dashboard-ui/livetvitems.html
index 46d499b131..4f59d59026 100644
--- a/dashboard-ui/livetvitems.html
+++ b/dashboard-ui/livetvitems.html
@@ -4,14 +4,14 @@
Emby
-
+
diff --git a/dashboard-ui/livetvnewrecording.html b/dashboard-ui/livetvnewrecording.html
index 7a38589dca..5721965ede 100644
--- a/dashboard-ui/livetvnewrecording.html
+++ b/dashboard-ui/livetvnewrecording.html
@@ -4,14 +4,14 @@
Emby
-
+
diff --git a/dashboard-ui/livetvprogram.html b/dashboard-ui/livetvprogram.html
index f491442e33..c519ac0edf 100644
--- a/dashboard-ui/livetvprogram.html
+++ b/dashboard-ui/livetvprogram.html
@@ -4,14 +4,14 @@
Emby
-
+
@@ -39,13 +39,13 @@
diff --git a/dashboard-ui/livetvrecording.html b/dashboard-ui/livetvrecording.html
index efbceeeab2..e86e90a65d 100644
--- a/dashboard-ui/livetvrecording.html
+++ b/dashboard-ui/livetvrecording.html
@@ -4,14 +4,14 @@
Emby
-
+
@@ -39,11 +39,11 @@
diff --git a/dashboard-ui/livetvrecordinglist.html b/dashboard-ui/livetvrecordinglist.html
index 6c8a21854f..24ba446b4d 100644
--- a/dashboard-ui/livetvrecordinglist.html
+++ b/dashboard-ui/livetvrecordinglist.html
@@ -4,14 +4,14 @@
Emby
-
+
diff --git a/dashboard-ui/livetvrecordings.html b/dashboard-ui/livetvrecordings.html
index bbaeff0675..e65b502a9b 100644
--- a/dashboard-ui/livetvrecordings.html
+++ b/dashboard-ui/livetvrecordings.html
@@ -4,14 +4,15 @@
Emby
-
+
+
@@ -23,7 +24,7 @@
diff --git a/dashboard-ui/livetvseriestimer.html b/dashboard-ui/livetvseriestimer.html
index c5e78e4381..4c76736f63 100644
--- a/dashboard-ui/livetvseriestimer.html
+++ b/dashboard-ui/livetvseriestimer.html
@@ -4,14 +4,14 @@
Emby
-
+
diff --git a/dashboard-ui/livetvseriestimers.html b/dashboard-ui/livetvseriestimers.html
index e35202d249..19cf7b3cae 100644
--- a/dashboard-ui/livetvseriestimers.html
+++ b/dashboard-ui/livetvseriestimers.html
@@ -4,20 +4,20 @@
Emby
-
+
- ${ButtonSort}
+ ${ButtonSort}
diff --git a/dashboard-ui/livetvsettings.html b/dashboard-ui/livetvsettings.html
index 6e09abc416..f02d9eb674 100644
--- a/dashboard-ui/livetvsettings.html
+++ b/dashboard-ui/livetvsettings.html
@@ -51,12 +51,11 @@
diff --git a/dashboard-ui/livetvstatus.html b/dashboard-ui/livetvstatus.html
index 1a4c8472b1..08d97ed96e 100644
--- a/dashboard-ui/livetvstatus.html
+++ b/dashboard-ui/livetvstatus.html
@@ -4,7 +4,7 @@
${TitleLiveTV}
-
+
diff --git a/dashboard-ui/livetvsuggested.html b/dashboard-ui/livetvsuggested.html
index dca8b1bb86..3c674895c7 100644
--- a/dashboard-ui/livetvsuggested.html
+++ b/dashboard-ui/livetvsuggested.html
@@ -4,41 +4,42 @@
Emby
-
+
+
-
+
-
+
-
-
-
+
-
diff --git a/dashboard-ui/livetvtimer.html b/dashboard-ui/livetvtimer.html
index a195e1f9fc..bd17992b64 100644
--- a/dashboard-ui/livetvtimer.html
+++ b/dashboard-ui/livetvtimer.html
@@ -4,14 +4,14 @@
Emby
-
+
diff --git a/dashboard-ui/livetvtimers.html b/dashboard-ui/livetvtimers.html
index 3f56f8925a..44051f32c4 100644
--- a/dashboard-ui/livetvtimers.html
+++ b/dashboard-ui/livetvtimers.html
@@ -4,14 +4,14 @@
Emby
-
+
diff --git a/dashboard-ui/login.html b/dashboard-ui/login.html
index 9e1c4640c5..5a53006427 100644
--- a/dashboard-ui/login.html
+++ b/dashboard-ui/login.html
@@ -4,7 +4,7 @@
${TitleSignIn}
-
+
@@ -17,17 +17,11 @@
${LabelPassword}
-
-
- ${ButtonSignIn}
-
-
+
+ ${ButtonSignIn}
+
-
-
- ${ButtonCancel}
-
-
+
${ButtonCancel}
@@ -39,23 +33,20 @@
-
${ButtonManualLogin}
+
${ButtonManualLogin}
-
- ${ButtonForgotPassword}
-
-
-
+
${ButtonForgotPassword}
+
+
diff --git a/dashboard-ui/metadata.html b/dashboard-ui/metadata.html
index 1b68904b39..3141f3f3e6 100644
--- a/dashboard-ui/metadata.html
+++ b/dashboard-ui/metadata.html
@@ -4,7 +4,7 @@
${TitleMetadata}
-
+
@@ -46,12 +46,11 @@
-
- ${ButtonSave}
-
-
- ${ButtonCancel}
+
+ ${ButtonSave}
+
+ ${ButtonCancel}
diff --git a/dashboard-ui/metadataadvanced.html b/dashboard-ui/metadataadvanced.html
index 3091b5bc00..f832f2a7cf 100644
--- a/dashboard-ui/metadataadvanced.html
+++ b/dashboard-ui/metadataadvanced.html
@@ -4,7 +4,7 @@
${TitleMetadata}
-
+
@@ -171,12 +171,11 @@
diff --git a/dashboard-ui/metadataimages.html b/dashboard-ui/metadataimages.html
index b39e7a5869..abee0409f4 100644
--- a/dashboard-ui/metadataimages.html
+++ b/dashboard-ui/metadataimages.html
@@ -4,7 +4,7 @@
${TitleMetadata}
-
+
@@ -118,12 +118,11 @@
diff --git a/dashboard-ui/metadatanfo.html b/dashboard-ui/metadatanfo.html
index 26b3dd59bd..dc85860d20 100644
--- a/dashboard-ui/metadatanfo.html
+++ b/dashboard-ui/metadatanfo.html
@@ -4,7 +4,7 @@
${TitleMetadata}
-
+
@@ -58,12 +58,11 @@
diff --git a/dashboard-ui/metadatasubtitles.html b/dashboard-ui/metadatasubtitles.html
index fa75ad897c..7f1e436416 100644
--- a/dashboard-ui/metadatasubtitles.html
+++ b/dashboard-ui/metadatasubtitles.html
@@ -4,7 +4,7 @@
${TitleMetadata}
-
+
@@ -58,12 +58,11 @@
diff --git a/dashboard-ui/moviegenres.html b/dashboard-ui/moviegenres.html
index b99eebfdcb..30e98dca06 100644
--- a/dashboard-ui/moviegenres.html
+++ b/dashboard-ui/moviegenres.html
@@ -7,13 +7,13 @@
diff --git a/dashboard-ui/moviepeople.html b/dashboard-ui/moviepeople.html
index 08f6c35079..6590315733 100644
--- a/dashboard-ui/moviepeople.html
+++ b/dashboard-ui/moviepeople.html
@@ -7,13 +7,13 @@
diff --git a/dashboard-ui/movies.html b/dashboard-ui/movies.html
index 38baa0601f..014584a0aa 100644
--- a/dashboard-ui/movies.html
+++ b/dashboard-ui/movies.html
@@ -7,13 +7,13 @@
diff --git a/dashboard-ui/moviesrecommended.html b/dashboard-ui/moviesrecommended.html
index da2ed9d50b..24ba337177 100644
--- a/dashboard-ui/moviesrecommended.html
+++ b/dashboard-ui/moviesrecommended.html
@@ -4,16 +4,16 @@
Emby
-
+
@@ -21,7 +21,7 @@
@@ -31,7 +31,7 @@
diff --git a/dashboard-ui/moviestudios.html b/dashboard-ui/moviestudios.html
index 8a70c3070a..5648a07267 100644
--- a/dashboard-ui/moviestudios.html
+++ b/dashboard-ui/moviestudios.html
@@ -7,13 +7,13 @@
diff --git a/dashboard-ui/movietrailers.html b/dashboard-ui/movietrailers.html
index 637a7951cf..7c6f137fca 100644
--- a/dashboard-ui/movietrailers.html
+++ b/dashboard-ui/movietrailers.html
@@ -7,13 +7,13 @@
@@ -25,7 +25,7 @@
${ButtonTrailerReel}
-
${MessageNoTrailersFound}
+
${MessageNoTrailersFound}
diff --git a/dashboard-ui/musicalbumartists.html b/dashboard-ui/musicalbumartists.html
index 86c258d951..d7d0d456cc 100644
--- a/dashboard-ui/musicalbumartists.html
+++ b/dashboard-ui/musicalbumartists.html
@@ -6,13 +6,13 @@
diff --git a/dashboard-ui/musicalbums.html b/dashboard-ui/musicalbums.html
index ca445c31b4..c2ce09d516 100644
--- a/dashboard-ui/musicalbums.html
+++ b/dashboard-ui/musicalbums.html
@@ -6,13 +6,13 @@
diff --git a/dashboard-ui/musicartists.html b/dashboard-ui/musicartists.html
index 0c3e6e05bc..2d5bb7e2b2 100644
--- a/dashboard-ui/musicartists.html
+++ b/dashboard-ui/musicartists.html
@@ -6,13 +6,13 @@
diff --git a/dashboard-ui/musicgenres.html b/dashboard-ui/musicgenres.html
index c4e219433d..752ca07d76 100644
--- a/dashboard-ui/musicgenres.html
+++ b/dashboard-ui/musicgenres.html
@@ -6,13 +6,13 @@
diff --git a/dashboard-ui/musicrecommended.html b/dashboard-ui/musicrecommended.html
index 17ddb0d0b7..4c150d6376 100644
--- a/dashboard-ui/musicrecommended.html
+++ b/dashboard-ui/musicrecommended.html
@@ -6,13 +6,13 @@
diff --git a/dashboard-ui/musicvideos.html b/dashboard-ui/musicvideos.html
index 6f74437e5d..e5805c55de 100644
--- a/dashboard-ui/musicvideos.html
+++ b/dashboard-ui/musicvideos.html
@@ -7,13 +7,13 @@
diff --git a/dashboard-ui/mypreferencesdisplay.html b/dashboard-ui/mypreferencesdisplay.html
index 738b300bd4..342d789b32 100644
--- a/dashboard-ui/mypreferencesdisplay.html
+++ b/dashboard-ui/mypreferencesdisplay.html
@@ -5,7 +5,8 @@
Emby
-
+
+
-
+
+
+ ${ButtonSave}
+
+
+
${ButtonCancel}
+
diff --git a/dashboard-ui/mypreferenceslanguages.html b/dashboard-ui/mypreferenceslanguages.html
index 3f6c176a16..760e3f27b2 100644
--- a/dashboard-ui/mypreferenceslanguages.html
+++ b/dashboard-ui/mypreferenceslanguages.html
@@ -5,7 +5,8 @@
Emby
-
+
+
-
+
+
+ ${ButtonSave}
+
+
+
${ButtonCancel}
+
diff --git a/dashboard-ui/mypreferenceswebclient.html b/dashboard-ui/mypreferenceswebclient.html
index 69e1cfb406..f4222458a6 100644
--- a/dashboard-ui/mypreferenceswebclient.html
+++ b/dashboard-ui/mypreferenceswebclient.html
@@ -5,7 +5,8 @@
Emby
-
+
-
+
+
+ ${ButtonSave}
+
+
+
${ButtonCancel}
+
diff --git a/dashboard-ui/myprofile.html b/dashboard-ui/myprofile.html
index 59f1804f40..412e4bf5a6 100644
--- a/dashboard-ui/myprofile.html
+++ b/dashboard-ui/myprofile.html
@@ -4,7 +4,7 @@
Emby
-
+
-
- ${ButtonSave}
+
+ ${ButtonSave}
-
- ${ButtonResetPassword}
-
+
${ButtonResetPassword}
@@ -113,12 +111,10 @@
-
- ${ButtonSave}
-
-
- ${ButtonResetEasyPassword}
+
+ ${ButtonSave}
+ ${ButtonResetEasyPassword}
diff --git a/dashboard-ui/mysync.html b/dashboard-ui/mysync.html
index 186879e688..6a39433cb7 100644
--- a/dashboard-ui/mysync.html
+++ b/dashboard-ui/mysync.html
@@ -7,7 +7,7 @@
diff --git a/dashboard-ui/mysyncjob.html b/dashboard-ui/mysyncjob.html
index e29162a7c0..fc7bc780bb 100644
--- a/dashboard-ui/mysyncjob.html
+++ b/dashboard-ui/mysyncjob.html
@@ -7,7 +7,7 @@
diff --git a/dashboard-ui/notificationlist.html b/dashboard-ui/notificationlist.html
index b42dee4f40..6125ed6c1a 100644
--- a/dashboard-ui/notificationlist.html
+++ b/dashboard-ui/notificationlist.html
@@ -4,7 +4,7 @@
${TitleNotifications}
-
+
diff --git a/dashboard-ui/notificationsetting.html b/dashboard-ui/notificationsetting.html
index fe209d524c..d1352aea32 100644
--- a/dashboard-ui/notificationsetting.html
+++ b/dashboard-ui/notificationsetting.html
@@ -72,12 +72,11 @@
-
- ${ButtonSave}
-
-
- ${ButtonCancel}
+
+ ${ButtonSave}
+
+ ${ButtonCancel}
diff --git a/dashboard-ui/nowplaying.html b/dashboard-ui/nowplaying.html
index 2b68f0dacb..9c20226f6e 100644
--- a/dashboard-ui/nowplaying.html
+++ b/dashboard-ui/nowplaying.html
@@ -4,85 +4,97 @@
Emby
-
+
-
+
-
+
+
-
-
-
-
-
-
-
-
+
+
+
-
- ${ButtonPreviousTrack}
- ${ButtonPause}
- ${ButtonPlay}
- ${ButtonStop}
- ${ButtonNextTrack}
-
-
- ${ButtonVolumeUp}
- ${ButtonMute}
- ${ButtonOsd}
- ${ButtonFullscreen}
-
-
- ${ButtonVolumeDown}
- ${ButtonAudioTracks}
- ${ButtonSubtitles}
- ${ButtonScenes}
-
+
+
+
-
+
-
- ${ButtonArrowLeft}
- ${ButtonOk}
- ${ButtonArrowRight}
-
-
- ${ButtonArrowDown}
-
-
- ${ButtonBack}
- ${ButtonInfo}
-
-
-
- ${ButtonHome}
- ${PageButtonAbbreviation}
- ${LetterButtonAbbreviation}
- ${ButtonSearch}
-
-
- ${ButtonSettings}
- ${PageButtonAbbreviation}
- ${LetterButtonAbbreviation}
- ${ButtonTakeScreenshot}
-
-
-
+
+
+
+
+
+
${HeaderSendMessage}
@@ -124,23 +136,21 @@
-
-
-
-
+
-
+ ${TabNowPlaying}
+ ${TabControls}
+ ${TabPlaylist}
+
+
-
diff --git a/dashboard-ui/photos.html b/dashboard-ui/photos.html
index d6ef8e6acc..48d2432ea8 100644
--- a/dashboard-ui/photos.html
+++ b/dashboard-ui/photos.html
@@ -7,9 +7,9 @@
diff --git a/dashboard-ui/playbackconfiguration.html b/dashboard-ui/playbackconfiguration.html
index bf3312e8bc..a437409229 100644
--- a/dashboard-ui/playbackconfiguration.html
+++ b/dashboard-ui/playbackconfiguration.html
@@ -49,12 +49,11 @@
diff --git a/dashboard-ui/playlistedit.html b/dashboard-ui/playlistedit.html
index 549467eeb0..06b0b4df1e 100644
--- a/dashboard-ui/playlistedit.html
+++ b/dashboard-ui/playlistedit.html
@@ -7,40 +7,20 @@
-
-
-
-
${ButtonPlay}
+
+
${ButtonPlay}
-
+
${MessageNoPlaylistItemsAvailable}
-
-
-
-
-
-
-
-
-
- ${LabelPageSize}
-
-
-
-
-
-
diff --git a/dashboard-ui/playlists.html b/dashboard-ui/playlists.html
index 907b3d7e40..b9e539863c 100644
--- a/dashboard-ui/playlists.html
+++ b/dashboard-ui/playlists.html
@@ -7,7 +7,7 @@
-
-
diff --git a/dashboard-ui/reports.html b/dashboard-ui/reports.html
index 0f060696df..f233e8ed0b 100644
--- a/dashboard-ui/reports.html
+++ b/dashboard-ui/reports.html
@@ -4,7 +4,7 @@
Emby
-
+
diff --git a/dashboard-ui/scheduledtasks.html b/dashboard-ui/scheduledtasks.html
index 1114f5e852..c8224d5f29 100644
--- a/dashboard-ui/scheduledtasks.html
+++ b/dashboard-ui/scheduledtasks.html
@@ -10,7 +10,7 @@
${ScheduledTasksHelp}
-
+
diff --git a/dashboard-ui/scripts/actionsheet.js b/dashboard-ui/scripts/actionsheet.js
new file mode 100644
index 0000000000..94a858daf8
--- /dev/null
+++ b/dashboard-ui/scripts/actionsheet.js
@@ -0,0 +1,133 @@
+(function () {
+
+ function show(options) {
+
+ require(['paperbuttonstyle'], function () {
+ // items
+ // positionTo
+ // showCancel
+ // title
+ var id = 'dlg' + new Date().getTime();
+ var html = '';
+
+ var style = "";
+
+ var windowHeight = $(window).height();
+
+ // If the window height is under a certain amount, don't bother trying to position
+ // based on an element.
+ if (options.positionTo && windowHeight >= 540) {
+
+ var pos = $(options.positionTo).offset();
+
+ pos.top += $(options.positionTo).innerHeight() / 2;
+ pos.left += $(options.positionTo).innerWidth() / 2;
+
+ // Account for margins
+ pos.top -= 24;
+ pos.left -= 24;
+
+ // Account for popup size - we can't predict this yet so just estimate
+ pos.top -= (55 * options.items.length) / 2;
+ pos.left -= 80;
+
+ // Account for scroll position
+ pos.top -= $(window).scrollTop();
+ pos.left -= $(window).scrollLeft();
+
+ // Avoid showing too close to the bottom
+ pos.top = Math.min(pos.top, $(window).height() - 300);
+ pos.left = Math.min(pos.left, $(window).width() - 300);
+
+ // Do some boundary checking
+ pos.top = Math.max(pos.top, 0);
+ pos.left = Math.max(pos.left, 0);
+
+ style += 'position:fixed;top:' + pos.top + 'px;left:' + pos.left + 'px';
+ }
+
+ html += '
';
+
+ if (options.title) {
+ html += '';
+ html += options.title;
+ html += ' ';
+ }
+
+ // There seems to be a bug with this in safari causing it to immediately roll up to 0 height
+ var isScrollable = !$.browser.safari;
+
+ if (isScrollable) {
+ html += '';
+ }
+
+ // If any items have an icon, give them all an icon just to make sure they're all lined up evenly
+ var renderIcon = options.items.filter(function (o) {
+ return o.ironIcon;
+ }).length;
+
+ html += '';
+ for (var i = 0, length = options.items.length; i < length; i++) {
+
+ var option = options.items[i];
+
+ html += '';
+ }
+ html += ' ';
+
+ if (isScrollable) {
+ html += ' ';
+ }
+
+ if (options.showCancel) {
+ html += '';
+ }
+
+ html += ' ';
+
+ $(document.body).append(html);
+
+ setTimeout(function () {
+ var dlg = document.getElementById(id);
+
+ dlg.open();
+
+ // Has to be assigned a z-index after the call to .open()
+ $(dlg).on('iron-overlay-closed', function () {
+ $(this).remove();
+ });
+
+ $('.actionSheetMenuItem', dlg).on('click', function () {
+
+ var selectedId = this.getAttribute('data-id');
+
+ // Add a delay here to allow the click animation to finish, for nice effect
+ setTimeout(function () {
+
+ dlg.close();
+
+ if (options.callback) {
+ options.callback(selectedId);
+ }
+
+ }, 100);
+ });
+ }, 100);
+ });
+ }
+
+ window.ActionSheetElement = {
+ show: show
+ };
+})();
\ No newline at end of file
diff --git a/dashboard-ui/scripts/addpluginpage.js b/dashboard-ui/scripts/addpluginpage.js
index 6c6e090517..3307ecdd2e 100644
--- a/dashboard-ui/scripts/addpluginpage.js
+++ b/dashboard-ui/scripts/addpluginpage.js
@@ -17,6 +17,7 @@
}
function populateVersions(packageInfo, page, installedPlugin) {
+
var html = '';
for (var i = 0, length = packageInfo.versions.length; i < length; i++) {
@@ -92,7 +93,7 @@
html += "
";
}
- $('#latestReviews', page).html(html).trigger('create');
+ Events.trigger($('#latestReviews', page).html(html)[0], 'create');
});
}
@@ -109,12 +110,12 @@
$('.pluginName', page).html(pkg.name);
if (pkg.targetSystem == 'Server') {
- $("#btnInstallDiv", page).show();
+ $("#btnInstallDiv", page).visible(true);
$("#nonServerMsg", page).hide();
- $("#pSelectVersion", page).show();
+ $("#pSelectVersion", page).visible(true);
} else {
- $("#btnInstallDiv", page).hide();
- $("#pSelectVersion", page).hide();
+ $("#btnInstallDiv", page).visible(false);
+ $("#pSelectVersion", page).visible(false);
var msg = Globalize.translate('MessageInstallPluginFromApp');
$("#nonServerMsg", page).html(msg).show();
diff --git a/dashboard-ui/scripts/alphapicker.js b/dashboard-ui/scripts/alphapicker.js
index c05f7f0b49..a88ce4dc99 100644
--- a/dashboard-ui/scripts/alphapicker.js
+++ b/dashboard-ui/scripts/alphapicker.js
@@ -39,28 +39,30 @@
var page = this;
- var picker = $('.alphabetPicker', page);
+ var picker = page.querySelector('.alphabetPicker');
- if (!picker.length) {
+ if (!picker) {
return;
}
$('.itemsContainer', page).addClass('itemsContainerWithAlphaPicker');
- picker.html(getPickerHtml()).trigger('create').on('click', 'a', function () {
+ picker.innerHTML = getPickerHtml();
- var elem = $(this);
+ Events.on(picker, 'click', 'a', function () {
- var isSelected = elem.hasClass('selectedCharacter');
+ var elem = this;
+
+ var isSelected = elem.classList.contains('selectedCharacter');
$('.selectedCharacter', picker).removeClass('selectedCharacter');
if (!isSelected) {
- elem.addClass('selectedCharacter');
- picker.trigger('alphaselect', [this.innerHTML]);
+ elem.classList.add('selectedCharacter');
+ Events.trigger(picker, 'alphaselect', [this.innerHTML]);
} else {
- picker.trigger('alphaclear');
+ Events.trigger(picker, 'alphaclear');
}
});
});
@@ -79,10 +81,10 @@
if (this.innerHTML.toLowerCase() == val) {
- $(this).addClass('selectedCharacter');
+ this.classList.add('selectedCharacter');
} else {
- $(this).removeClass('selectedCharacter');
+ this.classList.remove('selectedCharacter');
}
});
diff --git a/dashboard-ui/scripts/appsettings.js b/dashboard-ui/scripts/appsettings.js
index 340705567e..ce8b2b9425 100644
--- a/dashboard-ui/scripts/appsettings.js
+++ b/dashboard-ui/scripts/appsettings.js
@@ -1,7 +1,7 @@
-(function (window, store) {
+(function (window) {
function update(key, val) {
- store.setItem(key, val);
+ appStorage.setItem(key, val);
Events.trigger(AppSettings, 'settingupdated', [key]);
}
@@ -14,7 +14,7 @@
update('preferredVideoBitrate', val);
}
- return parseInt(store.getItem('preferredVideoBitrate') || '') || 1500000;
+ return parseInt(appStorage.getItem('preferredVideoBitrate') || '') || 1500000;
},
maxChromecastBitrate: function (val) {
@@ -22,7 +22,7 @@
update('chromecastBitrate', val);
}
- return parseInt(store.getItem('chromecastBitrate') || '') || 3000000;
+ return parseInt(appStorage.getItem('chromecastBitrate') || '') || 3000000;
},
enableChromecastAc3: function (val) {
@@ -30,7 +30,7 @@
update('enablechromecastac3', val.toString());
}
- return store.getItem('enablechromecastac3') == 'true';
+ return appStorage.getItem('enablechromecastac3') == 'true';
},
enableExternalPlayers: function (val) {
@@ -38,7 +38,7 @@
update('externalplayers', val.toString());
}
- return store.getItem('externalplayers') == 'true';
+ return appStorage.getItem('externalplayers') == 'true';
},
enableItemPreviews: function (val) {
@@ -46,7 +46,7 @@
update('enableItemPreviews', val.toString());
}
- return store.getItem('enableItemPreviews') == 'true';
+ return appStorage.getItem('enableItemPreviews') == 'true';
},
enableFullScreen: function (val) {
@@ -54,7 +54,7 @@
update('enableFullScreen', val.toString());
}
- return store.getItem('enableFullScreen') == 'true';
+ return appStorage.getItem('enableFullScreen') == 'true';
},
syncPath: function (val) {
@@ -62,10 +62,10 @@
update('syncPath', val.toString());
}
- return store.getItem('syncPath');
+ return appStorage.getItem('syncPath');
}
};
-})(window, window.appStorage);
\ No newline at end of file
+})(window);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/autoorganizelog.js b/dashboard-ui/scripts/autoorganizelog.js
index 3106027fea..e4f79f2b06 100644
--- a/dashboard-ui/scripts/autoorganizelog.js
+++ b/dashboard-ui/scripts/autoorganizelog.js
@@ -285,8 +285,15 @@
deleteOriginalFile(page, id);
});
- var pagingHtml = LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, false, [], false);
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ var pagingHtml = LibraryBrowser.getQueryPagingHtml({
+ startIndex: query.StartIndex,
+ limit: query.Limit,
+ totalRecordCount: result.TotalRecordCount,
+ showLimit: false,
+ updatePageSizeSetting: false
+ });
+
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
if (result.TotalRecordCount > query.Limit && result.TotalRecordCount > 50) {
$('.listBottomPaging', page).html(pagingHtml).trigger('create');
@@ -361,7 +368,7 @@
$(ApiClient).on("websocketmessage.autoorganizelog", onWebSocketMessage);
- }).on('pagehide', "#libraryFileOrganizerLogPage", function () {
+ }).on('pagebeforehide', "#libraryFileOrganizerLogPage", function () {
var page = this;
@@ -372,7 +379,7 @@
mode: 'off'
});
- $(ApiClient).off(".autoorganizelog");
+ $(ApiClient).off("websocketmessage.autoorganizelog", onWebSocketMessage);
});
})(jQuery, document, window);
diff --git a/dashboard-ui/scripts/backdrops.js b/dashboard-ui/scripts/backdrops.js
index 5f2e81588c..9b835f0e0f 100644
--- a/dashboard-ui/scripts/backdrops.js
+++ b/dashboard-ui/scripts/backdrops.js
@@ -2,16 +2,26 @@
function getElement() {
- var elem = $('.backdropContainer');
+ //var elem = $('.backdropContainer');
- if (!elem.length) {
+ //if (!elem.length) {
- elem = $('
').prependTo(document.body);
- }
+ // elem = $('
').prependTo(document.body);
+ //}
+ var elem = document.documentElement;
+
+ elem.classList.add('backdropContainer');
return elem;
}
+ function clearBackdrop() {
+
+ var elem = document.documentElement;
+ elem.classList.remove('backdropContainer');
+ elem.style.backgroundImage = '';
+ }
+
function getRandom(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
@@ -26,7 +36,7 @@
if (data) {
- console.log('Found backdrop id list in cache. Key: ' + key)
+ Logger.log('Found backdrop id list in cache. Key: ' + key)
data = JSON.parse(data);
deferred.resolveWith(null, [data]);
} else {
@@ -61,7 +71,7 @@
function setBackdropImage(elem, url) {
- elem.lazyImage(url);
+ ImageLoader.lazyImage(elem, url);
}
function showBackdrop(type, parentId) {
@@ -99,20 +109,10 @@
function setDefault(page) {
- var backdropContainer = $('.backdropContainer');
+ getElement().style.backgroundImage = "url(css/images/splash.jpg)";
- if (backdropContainer.length) {
- backdropContainer.css('backgroundImage', 'url(css/images/splash.jpg)');
- } else {
- $(document.body).prepend('
');
- }
-
- $(page).addClass('backdropPage staticBackdropPage');
- }
-
- function clearBackdrop() {
-
- $('.backdropContainer').css('backgroundImage', '');
+ page.classList.add('backdropPage');
+ page.classList.add('staticBackdropPage');
}
function isEnabledByDefault() {
@@ -122,16 +122,6 @@
return false;
}
- // It flickers too much in IE
- if ($.browser.msie) {
-
- return false;
- }
-
- if ($.browser.android && AppInfo.isNativeApp) {
- return true;
- }
-
if ($.browser.mobile) {
return false;
}
@@ -163,7 +153,7 @@
});
if (images.length) {
- $(page).addClass('backdropPage');
+ page.classList.add('backdropPage');
var index = getRandom(0, images.length - 1);
var item = images[index];
@@ -180,42 +170,40 @@
setBackdropImage(getElement(), imgUrl);
} else {
- $(page).removeClass('backdropPage');
+ page.classList.remove('backdropPage');
}
}
function setBackdropUrl(page, url) {
if (url) {
- $(page).addClass('backdropPage');
+ page.classList.add('backdropPage');
setBackdropImage(getElement(), url);
} else {
- $(page).removeClass('backdropPage');
+ page.classList.remove('backdropPage');
clearBackdrop();
}
}
- $(document).on('pagebeforeshowready', ".page", function () {
+ Events.on(document, 'pagebeforeshowready', ".page", function () {
var page = this;
- var $page = $(page);
+ if (!page.classList.contains('staticBackdropPage')) {
- if (!$page.hasClass('staticBackdropPage')) {
-
- if ($page.hasClass('backdropPage')) {
+ if (page.classList.contains('backdropPage')) {
if (enabled()) {
var type = page.getAttribute('data-backdroptype');
- var parentId = $page.hasClass('globalBackdropPage') ? '' : LibraryMenu.getTopParentId();
+ var parentId = page.classList.contains('globalBackdropPage') ? '' : LibraryMenu.getTopParentId();
showBackdrop(type, parentId);
} else {
- $page.removeClass('backdropPage');
+ page.classList.remove('backdropPage');
clearBackdrop();
}
} else {
diff --git a/dashboard-ui/scripts/channelitems.js b/dashboard-ui/scripts/channelitems.js
index 9a37b1e93a..0eee03b3dd 100644
--- a/dashboard-ui/scripts/channelitems.js
+++ b/dashboard-ui/scripts/channelitems.js
@@ -31,11 +31,11 @@
function showLoadingMessage(page) {
- $('#popupDialog', page).popup('open');
+ Dashboard.showModalLoadingMsg();
}
function hideLoadingMessage(page) {
- $('#popupDialog', page).popup('close');
+ Dashboard.hideModalLoadingMsg();
}
function reloadFeatures(page) {
@@ -124,7 +124,7 @@
ApiClient.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Items", query)).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -136,7 +136,7 @@
updatePageSizeSetting: false
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
@@ -152,9 +152,9 @@
centerText: true
});
- var elem = $('#items', page).html(html).lazyChildren();
-
- $(pagingHtml).appendTo(elem).trigger('create');
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -256,7 +256,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#channelItemsPage", function () {
+ }).on('pagebeforeshowready', "#channelItemsPage", function () {
var page = this;
var limit = LibraryBrowser.getDefaultPageSize();
diff --git a/dashboard-ui/scripts/channels.js b/dashboard-ui/scripts/channels.js
index 6f615ae7b8..aee1be30bd 100644
--- a/dashboard-ui/scripts/channels.js
+++ b/dashboard-ui/scripts/channels.js
@@ -15,7 +15,7 @@
ApiClient.getJSON(ApiClient.getUrl("Channels", query)).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -49,7 +49,9 @@
});
}
- $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
LibraryBrowser.saveQueryValues('channels', query);
@@ -61,7 +63,7 @@
}
- $(document).on('pageshowready', "#channelsPage", function () {
+ $(document).on('pagebeforeshowready', "#channelsPage", function () {
LibraryBrowser.loadSavedQueryValues('channels', query);
diff --git a/dashboard-ui/scripts/channelslatest.js b/dashboard-ui/scripts/channelslatest.js
index 63eca5776f..af00880b78 100644
--- a/dashboard-ui/scripts/channelslatest.js
+++ b/dashboard-ui/scripts/channelslatest.js
@@ -2,10 +2,10 @@
function reloadItems(page) {
- Sections.loadLatestChannelItems($(".items", page), Dashboard.getCurrentUserId());
+ Sections.loadLatestChannelItems(page.querySelector('.items'), Dashboard.getCurrentUserId());
}
- $(document).on('pageshowready', "#channelsLatestPage", function () {
+ $(document).on('pagebeforeshowready', "#channelsLatestPage", function () {
reloadItems(this);
diff --git a/dashboard-ui/scripts/chromecast.js b/dashboard-ui/scripts/chromecast.js
index 9fb95de4a3..99074b1e7d 100644
--- a/dashboard-ui/scripts/chromecast.js
+++ b/dashboard-ui/scripts/chromecast.js
@@ -82,7 +82,7 @@
this.sessionListener.bind(this),
this.receiverListener.bind(this));
- console.log('chromecast.initialize');
+ Logger.log('chromecast.initialize');
chrome.cast.initialize(apiConfig, this.onInitSuccess.bind(this), this.errorHandler);
@@ -93,14 +93,14 @@
*/
CastPlayer.prototype.onInitSuccess = function () {
this.isInitialized = true;
- console.log("chromecast init success");
+ Logger.log("chromecast init success");
};
/**
* Generic error callback function
*/
CastPlayer.prototype.onError = function () {
- console.log("chromecast error");
+ Logger.log("chromecast error");
};
/**
@@ -115,7 +115,7 @@
this.session = e;
if (this.session) {
- console.log('sessionListener ' + JSON.stringify(e));
+ Logger.log('sessionListener ' + JSON.stringify(e));
if (this.session.media[0]) {
this.onMediaDiscovered('activeSession', this.session.media[0]);
@@ -152,7 +152,7 @@
}
else if (message.type && message.type.indexOf('playback') == 0) {
- $(this).trigger(message.type, [message.data]);
+ Events.trigger(this, message.type, [message.data]);
}
};
@@ -165,11 +165,11 @@
CastPlayer.prototype.receiverListener = function (e) {
if (e === 'available') {
- console.log("chromecast receiver found");
+ Logger.log("chromecast receiver found");
this.hasReceivers = true;
}
else {
- console.log("chromecast receiver list empty");
+ Logger.log("chromecast receiver list empty");
this.hasReceivers = false;
}
};
@@ -179,7 +179,7 @@
*/
CastPlayer.prototype.sessionUpdateListener = function (isAlive) {
- console.log('sessionUpdateListener alive: ' + isAlive);
+ Logger.log('sessionUpdateListener alive: ' + isAlive);
if (isAlive) {
}
@@ -188,7 +188,7 @@
this.deviceState = DEVICE_STATE.IDLE;
this.castPlayerState = PLAYER_STATE.IDLE;
- console.log('sessionUpdateListener: setting currentMediaSession to null');
+ Logger.log('sessionUpdateListener: setting currentMediaSession to null');
this.currentMediaSession = null;
MediaController.removeActivePlayer(PlayerName);
@@ -201,7 +201,7 @@
* session request in opt_sessionRequest.
*/
CastPlayer.prototype.launchApp = function () {
- console.log("chromecast launching app...");
+ Logger.log("chromecast launching app...");
chrome.cast.requestSession(this.onRequestSessionSuccess.bind(this), this.onLaunchError.bind(this));
};
@@ -211,7 +211,7 @@
*/
CastPlayer.prototype.onRequestSessionSuccess = function (e) {
- console.log("chromecast session success: " + e.sessionId);
+ Logger.log("chromecast session success: " + e.sessionId);
this.onSessionConnected(e);
};
@@ -225,7 +225,7 @@
this.session.addMediaListener(this.sessionMediaListener.bind(this));
this.session.addUpdateListener(this.sessionUpdateListener.bind(this));
- $(this).trigger('connect');
+ Events.trigger(this, 'connect');
this.sendMessage({
options: {},
@@ -238,7 +238,7 @@
*/
CastPlayer.prototype.sessionMediaListener = function (e) {
- console.log('sessionMediaListener');
+ Logger.log('sessionMediaListener');
this.currentMediaSession = e;
this.currentMediaSession.addUpdateListener(this.mediaStatusUpdateHandler);
};
@@ -247,7 +247,7 @@
* Callback function for launch error
*/
CastPlayer.prototype.onLaunchError = function () {
- console.log("chromecast launch error");
+ Logger.log("chromecast launch error");
this.deviceState = DEVICE_STATE.ERROR;
//Dashboard.alert({
@@ -273,11 +273,11 @@
* Callback function for stop app success
*/
CastPlayer.prototype.onStopAppSuccess = function (message) {
- console.log(message);
+ Logger.log(message);
this.deviceState = DEVICE_STATE.IDLE;
this.castPlayerState = PLAYER_STATE.IDLE;
- console.log('onStopAppSuccess: setting currentMediaSession to null');
+ Logger.log('onStopAppSuccess: setting currentMediaSession to null');
this.currentMediaSession = null;
};
@@ -288,7 +288,7 @@
CastPlayer.prototype.loadMedia = function (options, command) {
if (!this.session) {
- console.log("no session");
+ Logger.log("no session");
return;
}
@@ -365,13 +365,13 @@
CastPlayer.prototype.sendMessageInternal = function (message) {
message = JSON.stringify(message);
- //console.log(message);
+ //Logger.log(message);
this.session.sendMessage(messageNamespace, message, this.onPlayCommandSuccess.bind(this), this.errorHandler);
};
CastPlayer.prototype.onPlayCommandSuccess = function () {
- console.log('Message was sent to receiver ok.');
+ Logger.log('Message was sent to receiver ok.');
};
/**
@@ -380,7 +380,7 @@
*/
CastPlayer.prototype.onMediaDiscovered = function (how, mediaSession) {
- console.log("chromecast new media session ID:" + mediaSession.mediaSessionId + ' (' + how + ')');
+ Logger.log("chromecast new media session ID:" + mediaSession.mediaSessionId + ' (' + how + ')');
this.currentMediaSession = mediaSession;
if (how == 'loadMedia') {
@@ -403,7 +403,7 @@
if (e == false) {
this.castPlayerState = PLAYER_STATE.IDLE;
}
- console.log("chromecast updating media: " + e);
+ Logger.log("chromecast updating media: " + e);
};
/**
@@ -413,7 +413,7 @@
CastPlayer.prototype.setReceiverVolume = function (mute, vol) {
if (!this.currentMediaSession) {
- console.log('this.currentMediaSession is null');
+ Logger.log('this.currentMediaSession is null');
return;
}
@@ -441,7 +441,7 @@
* Callback function for media command success
*/
CastPlayer.prototype.mediaCommandSuccessCallback = function (info, e) {
- console.log(info);
+ Logger.log(info);
};
// Create Cast Player
@@ -468,27 +468,27 @@
MediaController.setActivePlayer(PlayerName, self.getCurrentTargetInfo());
- console.log('cc: connect');
+ Logger.log('cc: connect');
// Reset this so the next query doesn't make it appear like content is playing.
self.lastPlayerData = {};
});
$(castPlayer).on("playbackstart", function (e, data) {
- console.log('cc: playbackstart');
+ Logger.log('cc: playbackstart');
castPlayer.initializeCastPlayer();
var state = self.getPlayerStateInternal(data);
- $(self).trigger("playbackstart", [state]);
+ Events.trigger(self, "playbackstart", [state]);
});
$(castPlayer).on("playbackstop", function (e, data) {
- console.log('cc: playbackstop');
+ Logger.log('cc: playbackstop');
var state = self.getPlayerStateInternal(data);
- $(self).trigger("playbackstop", [state]);
+ Events.trigger(self, "playbackstop", [state]);
// Reset this so the next query doesn't make it appear like content is playing.
self.lastPlayerData = {};
@@ -496,10 +496,10 @@
$(castPlayer).on("playbackprogress", function (e, data) {
- console.log('cc: positionchange');
+ Logger.log('cc: positionchange');
var state = self.getPlayerStateInternal(data);
- $(self).trigger("positionchange", [state]);
+ Events.trigger(self, "positionchange", [state]);
});
self.play = function (options) {
@@ -789,7 +789,7 @@
data = data || self.lastPlayerData;
self.lastPlayerData = data;
- console.log(JSON.stringify(data));
+ Logger.log(JSON.stringify(data));
return data;
};
diff --git a/dashboard-ui/scripts/connectlogin.js b/dashboard-ui/scripts/connectlogin.js
index c9066182ce..6683333046 100644
--- a/dashboard-ui/scripts/connectlogin.js
+++ b/dashboard-ui/scripts/connectlogin.js
@@ -100,16 +100,26 @@
$('.connectLoginForm', page).hide();
$('.welcomeContainer', page).show();
$('.manualServerForm', page).hide();
+ $('.signupForm', page).hide();
}
else if (mode == 'connect') {
$('.connectLoginForm', page).show();
$('.welcomeContainer', page).hide();
$('.manualServerForm', page).hide();
+ $('.signupForm', page).hide();
}
else if (mode == 'manualserver') {
$('.manualServerForm', page).show();
$('.connectLoginForm', page).hide();
$('.welcomeContainer', page).hide();
+ $('.signupForm', page).hide();
+ }
+ else if (mode == 'signup') {
+ $('.manualServerForm', page).hide();
+ $('.connectLoginForm', page).hide();
+ $('.welcomeContainer', page).hide();
+ $('.signupForm', page).show();
+ initSignup(page);
}
}
@@ -134,6 +144,74 @@
return false;
}
+ function onSignupFormSubmit() {
+
+ if (!supportInAppSignup()) {
+ return false;
+ }
+
+ var page = $(this).parents('.page');
+
+ ConnectionManager.signupForConnect($('#txtSignupEmail', page).val(), $('#txtSignupUsername', page).val(), $('#txtSignupPassword', page).val(), $('#txtSignupPasswordConfirm', page).val()).done(function () {
+
+ Dashboard.alert({
+ message: Globalize.translate('MessageThankYouForConnectSignUp'),
+ callback: function () {
+ Dashboard.navigate('connectlogin.html?mode=welcome');
+ }
+ });
+
+ }).fail(function (result) {
+
+ if (result.errorCode == 'passwordmatch') {
+ Dashboard.alert({
+ message: Globalize.translate('ErrorMessagePasswordNotMatchConfirm')
+ });
+ }
+ else if (result.errorCode == 'USERNAME_IN_USE') {
+ Dashboard.alert({
+ message: Globalize.translate('ErrorMessageUsernameInUse')
+ });
+ }
+ else if (result.errorCode == 'EMAIL_IN_USE') {
+ Dashboard.alert({
+ message: Globalize.translate('ErrorMessageEmailInUse')
+ });
+ } else {
+ Dashboard.alert({
+ message: Globalize.translate('DefaultErrorMessage')
+ });
+ }
+
+ });
+
+ return false;
+ }
+
+ function requireCaptcha() {
+ return !AppInfo.isNativeApp && getWindowUrl().toLowerCase().indexOf('https') == 0;
+ }
+
+ function supportInAppSignup() {
+ return AppInfo.isNativeApp;
+ return AppInfo.isNativeApp || getWindowUrl().toLowerCase().indexOf('https') == 0;
+ }
+
+ function initSignup(page) {
+
+ if (!supportInAppSignup()) {
+ return;
+ }
+
+ if (!requireCaptcha()) {
+ return;
+ }
+
+ require(['https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit'], function () {
+
+ });
+ }
+
$(document).on('pageinitdepends', "#connectLoginPage", function () {
var page = this;
@@ -144,21 +222,52 @@
$('.connectLoginForm').off('submit', onSubmit).on('submit', onSubmit);
$('.manualServerForm').off('submit', onManualServerSubmit).on('submit', onManualServerSubmit);
+ $('.signupForm').off('submit', onSignupFormSubmit).on('submit', onSignupFormSubmit);
- }).on('pageshowready', "#connectLoginPage", function () {
+ $('.btnSignupForConnect', page).on('click', function () {
+
+ if (supportInAppSignup()) {
+ Dashboard.navigate('connectlogin.html?mode=signup');
+ return false;
+ }
+ });
+
+ $('.btnCancelSignup', page).on('click', function () {
+
+ history.back();
+ });
+
+ $('.btnCancelManualServer', page).on('click', function () {
+
+ history.back();
+ });
+
+ $('.btnWelcomeNext', page).on('click', function () {
+ Dashboard.navigate('connectlogin.html?mode=connect');
+ });
+
+ }).on('pagebeforeshowready', "#connectLoginPage", function () {
var page = this;
- loadPage(page);
-
- var link = '
http://emby.media ';
- $('.embyIntroDownloadMessage', page).html(Globalize.translate('EmbyIntroDownloadMessage', link));
+ $('#txtSignupEmail', page).val('');
+ $('#txtSignupUsername', page).val('');
+ $('#txtSignupPassword', page).val('');
+ $('#txtSignupPasswordConfirm', page).val('');
if (AppInfo.isNativeApp) {
$('.skip', page).show();
} else {
$('.skip', page).hide();
}
+
+ var link = '
http://emby.media ';
+ $('.embyIntroDownloadMessage', page).html(Globalize.translate('EmbyIntroDownloadMessage', link));
+
+ }).on('pageshowready', "#connectLoginPage", function () {
+
+ var page = this;
+ loadPage(page);
});
function submitManualServer(page) {
@@ -177,7 +286,6 @@
handleConnectionResult(page, result);
}).fail(function () {
-
handleConnectionResult(page, {
State: MediaBrowser.ConnectionState.Unavailable
});
diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js
index 54cdd323c7..826d110ff8 100644
--- a/dashboard-ui/scripts/dashboardpage.js
+++ b/dashboard-ui/scripts/dashboardpage.js
@@ -73,7 +73,7 @@
var list = DashboardPage.sessionsList;
if (list) {
- console.log('refreshSessionsLocally');
+ Logger.log('refreshSessionsLocally');
DashboardPage.renderActiveConnections($.mobile.activePage, list);
}
},
@@ -93,11 +93,7 @@
$('#ports', page).html(Globalize.translate('LabelRunningOnPort', '
' + systemInfo.HttpServerPortNumber + ' '));
}
- if (systemInfo.CanSelfRestart) {
- $('.btnRestartContainer', page).removeClass('hide');
- } else {
- $('.btnRestartContainer', page).addClass('hide');
- }
+ $('.btnRestartContainer', page).visible(systemInfo.CanSelfRestart);
DashboardPage.renderUrls(page, systemInfo);
DashboardPage.renderPendingInstallations(page, systemInfo);
@@ -142,7 +138,13 @@
var pagingHtml = '';
pagingHtml += '
';
- pagingHtml += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, false, [], false);
+ pagingHtml += LibraryBrowser.getQueryPagingHtml({
+ startIndex: query.StartIndex,
+ limit: query.Limit,
+ totalRecordCount: result.TotalRecordCount,
+ showLimit: false,
+ updatePageSizeSetting: false
+ });
pagingHtml += '
';
html = html.join('') + pagingHtml;
@@ -682,10 +684,6 @@
return "
";
}
- if (clientLowered == "mbkinect") {
-
- return "
";
- }
if (clientLowered == "kodi" || clientLowered == "xbmc") {
return "
";
}
@@ -777,7 +775,7 @@
html += "
" + progress + "% ";
- html += '
' + Globalize.translate('ButtonStop') + ' ';
+ html += '
' + Globalize.translate('ButtonStop') + ' ';
}
else if (task.State == "Cancelling") {
html += '
' + Globalize.translate('LabelStopping') + ' ';
@@ -1011,7 +1009,7 @@
}
};
-$(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('pagehide', "#dashboardPage", DashboardPage.onPageHide);
+$(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('pagebeforehide', "#dashboardPage", DashboardPage.onPageHide);
(function ($, document, window) {
@@ -1024,23 +1022,19 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
showOverlayTimeout = null;
}
- $('.cardOverlayTarget:visible', this).each(function () {
+ var elem = this.querySelector('.cardOverlayTarget');
- var elem = this;
-
- $(this).animate({ "height": "0" }, "fast", function () {
-
- $(elem).hide();
+ if ($(elem).is(':visible')) {
+ require(["jquery", "velocity"], function ($, Velocity) {
+ Velocity.animate(elem, { "height": "0" },
+ {
+ complete: function () {
+ $(elem).hide();
+ }
+ });
});
-
- });
-
- $('.cardOverlayTarget:visible', this).stop().animate({ "height": "0" }, function () {
-
- $(this).hide();
-
- });
+ }
}
$.fn.createSessionItemMenus = function () {
@@ -1084,8 +1078,7 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
return this;
}
- return this.off('.sessionItemMenu').on('mouseenter.sessionItemMenu', '.playingSession', onHoverIn)
- .on('mouseleave.sessionItemMenu', '.playingSession', onHoverOut);
+ return this.off('mouseenter', '.playingSession', onHoverIn).off('mouseleave', '.playingSession', onHoverOut).on('mouseenter', '.playingSession', onHoverIn).on('mouseleave', '.playingSession', onHoverOut);
};
})(jQuery, document, window);
@@ -1163,7 +1156,13 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
var query = { StartIndex: startIndex, Limit: limit };
- html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, false, limit, false);
+ html += LibraryBrowser.getQueryPagingHtml({
+ startIndex: query.StartIndex,
+ limit: query.Limit,
+ totalRecordCount: result.TotalRecordCount,
+ showLimit: false,
+ updatePageSizeSetting: false
+ });
}
$(elem).html(html).trigger('create');
@@ -1221,7 +1220,8 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
elem.each(function () {
reloadData(this);
- });
+
+ }).addClass('activityLogListWidget');
var apiClient = ApiClient;
@@ -1229,21 +1229,7 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
return;
}
- $(apiClient).on('websocketmessage.activityloglistener', function (e, data) {
-
- var msg = data;
-
- if (msg.MessageType === "ActivityLogEntry") {
- elem.each(function () {
-
- reloadData(this);
- });
- }
-
- }).on('websocketopen.activityloglistener', function (e, data) {
-
- startListening(apiClient);
- });
+ $(apiClient).on('websocketmessage', onSocketMessage).on('websocketopen', onSocketOpen);
}
function startListening(apiClient) {
@@ -1262,22 +1248,41 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
}
+ function onSocketOpen() {
+
+ var apiClient = ApiClient;
+ if (apiClient) {
+ startListening(apiClient);
+ }
+ }
+
+ function onSocketMessage(e, data) {
+
+ var msg = data;
+
+ if (msg.MessageType === "ActivityLogEntry") {
+ $('.activityLogListWidget').each(function () {
+
+ reloadData(this);
+ });
+ }
+ }
+
function destroyList(elem) {
var apiClient = ApiClient;
if (apiClient) {
- $(apiClient).off('websocketopen.activityloglistener').off('websocketmessage.activityloglistener');
+ $(apiClient).off('websocketopen', onSocketOpen).off('websocketmessage', onSocketOpen);
stopListening(apiClient);
}
-
- return this;
}
$.fn.activityLogList = function (action) {
if (action == 'destroy') {
+ this.removeClass('activityLogListWidget');
destroyList(this);
} else {
createList(this);
@@ -1306,7 +1311,7 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
result.CustomPrefs[welcomeTourKey] = welcomeDismissValue;
ApiClient.updateDisplayPreferences('dashboard', result, userId, 'dashboard');
- $(page).off('.checktour');
+ $(page).off('pageshowready', onPageShowReadyCheckTour);
});
}
@@ -1363,6 +1368,16 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
});
}
+ function onPageShowReadyCheckTour() {
+ var page = this;
+
+ var apiClient = ApiClient;
+
+ if (apiClient && !AppInfo.isNativeApp) {
+ showWelcomeIfNeeded(page, apiClient);
+ }
+ }
+
$(document).on('pageinitdepends', "#dashboardPage", function () {
var page = this;
@@ -1371,17 +1386,7 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
takeTour(page, Dashboard.getCurrentUserId());
});
- }).on('pageshowready.checktour', "#dashboardPage", function () {
-
- var page = this;
-
- var apiClient = ApiClient;
-
- if (apiClient && !AppInfo.isNativeApp) {
- showWelcomeIfNeeded(page, apiClient);
- }
-
- });
+ }).on('pageshowready', "#dashboardPage", onPageShowReadyCheckTour);
})(jQuery, document, window);
diff --git a/dashboard-ui/scripts/dlnaserversettings.js b/dashboard-ui/scripts/dlnaserversettings.js
index bd666c6504..5bd47993d6 100644
--- a/dashboard-ui/scripts/dlnaserversettings.js
+++ b/dashboard-ui/scripts/dlnaserversettings.js
@@ -39,7 +39,7 @@
return false;
}
- $(document).on('pageinitpdepends', "#dlnaServerSettingsPage", function () {
+ $(document).on('pageinitdepends', "#dlnaServerSettingsPage", function () {
$('.dlnaServerSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
diff --git a/dashboard-ui/scripts/editcollectionitems.js b/dashboard-ui/scripts/editcollectionitems.js
index 567e0eb23f..5ec7b5c38e 100644
--- a/dashboard-ui/scripts/editcollectionitems.js
+++ b/dashboard-ui/scripts/editcollectionitems.js
@@ -96,7 +96,7 @@
}).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = result.Items.map(getTitleHtml).join('');
@@ -285,17 +285,11 @@
reload(page);
- $("body").on("popupafteropen.collections", ".popupIdentify", function (e) {
- $("#txtLookupName").focus().select();
- });
-
- }).on('pagehide', "#editCollectionTitlesPage", function () {
+ }).on('pagebeforehide', "#editCollectionTitlesPage", function () {
var page = this;
currentItem = null;
-
- $("body").off("popupafteropen.collections");
});
})(jQuery, document, window, window.FileReader, escape);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/edititemimages.js b/dashboard-ui/scripts/edititemimages.js
index 561fe709f8..abefc39567 100644
--- a/dashboard-ui/scripts/edititemimages.js
+++ b/dashboard-ui/scripts/edititemimages.js
@@ -416,7 +416,7 @@
};
reader.onabort = function () {
Dashboard.hideLoadingMsg();
- console.log('File read cancelled');
+ Logger.log('File read cancelled');
};
// Closure to capture the file information.
@@ -596,7 +596,7 @@
return false;
});
- }).on('pagehide', "#editItemImagesPage", function () {
+ }).on('pagebeforehide', "#editItemImagesPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/edititemmetadata.js b/dashboard-ui/scripts/edititemmetadata.js
index 0b77479c0e..54d954f7e1 100644
--- a/dashboard-ui/scripts/edititemmetadata.js
+++ b/dashboard-ui/scripts/edititemmetadata.js
@@ -32,6 +32,7 @@
if (item.Type == "UserRootFolder") {
$('.editPageInnerContent', page).hide();
+ Dashboard.hideLoadingMsg();
return;
} else {
$('.editPageInnerContent', page).show();
@@ -808,9 +809,9 @@
function getAlbumArtists(form) {
- return $('#txtAlbumArtist', form).val().trim().split(';').filter(function(s){
+ return $('#txtAlbumArtist', form).val().trim().split(';').filter(function (s) {
- return s.length > 0;
+ return s.length > 0;
}).map(function (a) {
@@ -822,9 +823,9 @@
function getArtists(form) {
- return $('#txtArtist', form).val().trim().split(';').filter(function(s){
+ return $('#txtArtist', form).val().trim().split(';').filter(function (s) {
- return s.length > 0;
+ return s.length > 0;
}).map(function (a) {
@@ -1361,7 +1362,7 @@
var page = $.mobile.activePage;
- console.log('Item updated - reloading metadata');
+ Logger.log('Item updated - reloading metadata');
reload(page);
$('#refreshLoading', page).hide();
}
@@ -1378,7 +1379,19 @@
$(ApiClient).off("websocketmessage", onWebSocketMessageReceived);
}
- $(document).on('pageinit', "#editItemMetadataPage", function () {
+ function onItemDeleted(e, itemId) {
+
+ if (currentItem && currentItem.Id == itemId) {
+
+ if (currentItem.ParentId) {
+ Dashboard.navigate('edititemmetadata.html?id=' + currentItem.ParentId);
+ } else {
+ Dashboard.navigate('edititemmetadata.html');
+ }
+ }
+ }
+
+ $(document).on('pageinitdepends', "#editItemMetadataPage", function () {
var page = this;
@@ -1427,7 +1440,7 @@
//$.mobile.urlHistory.ignoreNextHashChange = true;
window.location.hash = 'editItemMetadataPage?id=' + data.id;
-
+ alert(window.location.href);
reload(page);
}
});
@@ -1437,28 +1450,24 @@
editPerson(page, {});
});
- }).on('pagebeforeshow', "#editItemMetadataPage", function () {
+ $('.editItemMetadataForm').off('submit', EditItemMetadataPage.onSubmit).on('submit', EditItemMetadataPage.onSubmit);
+ $('.popupIdentifyForm').off('submit', EditItemMetadataPage.onIdentificationFormSubmitted).on('submit', EditItemMetadataPage.onIdentificationFormSubmitted);
+ $('.popupEditPersonForm').off('submit', EditItemMetadataPage.onPersonInfoFormSubmit).on('submit', EditItemMetadataPage.onPersonInfoFormSubmit);
+ $('.popupAdvancedRefreshForm').off('submit', EditItemMetadataPage.onRefreshFormSubmit).on('submit', EditItemMetadataPage.onRefreshFormSubmit);
+ $('.identifyOptionsForm').off('submit', EditItemMetadataPage.onIdentificationOptionsSubmit).on('submit', EditItemMetadataPage.onIdentificationOptionsSubmit);
+
+ }).on('pageshowready', "#editItemMetadataPage", function () {
var page = this;
reload(page);
- $(LibraryBrowser).on('itemdeleting.editor', function (e, itemId) {
+ $(LibraryBrowser).on('itemdeleting', onItemDeleted);
- if (currentItem && currentItem.Id == itemId) {
-
- if (currentItem.ParentId) {
- Dashboard.navigate('edititemmetadata.html?id=' + currentItem.ParentId);
- } else {
- Dashboard.navigate('edititemmetadata.html');
- }
- }
- });
-
- }).on('pagehide', "#editItemMetadataPage", function () {
+ }).on('pagebeforehide', "#editItemMetadataPage", function () {
var page = this;
- $(LibraryBrowser).off('itemdeleting.editor');
+ $(LibraryBrowser).off('itemdeleting', onItemDeleted);
unbindItemChanged(page);
diff --git a/dashboard-ui/scripts/edititemsubtitles.js b/dashboard-ui/scripts/edititemsubtitles.js
index 6ecdcd2a06..2877f4a3ff 100644
--- a/dashboard-ui/scripts/edititemsubtitles.js
+++ b/dashboard-ui/scripts/edititemsubtitles.js
@@ -289,7 +289,7 @@
if (msg.Data.ItemsUpdated.indexOf(currentItem.Id) != -1) {
- console.log('Item updated - reloading subtitles');
+ Logger.log('Item updated - reloading subtitles');
reload($.mobile.activePage);
}
}
@@ -326,7 +326,7 @@
$('.subtitleSearchForm').off('submit', onSearchSubmit).on('submit', onSearchSubmit);
- }).on('pagebeforeshowready', "#editItemSubtitlesPage", function () {
+ }).on('pageshowready', "#editItemSubtitlesPage", function () {
var page = this;
@@ -343,7 +343,7 @@
$(ApiClient).on("websocketmessage", onWebSocketMessageReceived);
- }).on('pagehide', "#editItemSubtitlesPage", function () {
+ }).on('pagebeforehide', "#editItemSubtitlesPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/editorsidebar.js b/dashboard-ui/scripts/editorsidebar.js
index 0c7eb6855f..860b596e7b 100644
--- a/dashboard-ui/scripts/editorsidebar.js
+++ b/dashboard-ui/scripts/editorsidebar.js
@@ -269,6 +269,53 @@
});
}
+ function onNodeSelect(event, data) {
+ var node = data.node;
+
+ var eventData = {
+ id: node.id,
+ itemType: node.li_attr.itemtype
+ };
+
+ if (eventData.itemType != 'livetv' && eventData.itemType != 'mediafolders') {
+ $(this).trigger('itemclicked', [eventData]);
+ }
+ }
+
+ function onNodeOpen(event, data) {
+
+ var page = $(this).parents('.page')[0];
+ var node = data.node;
+
+ if (node.children && node.children) {
+ loadNodesToLoad(page, node);
+ }
+
+ if (node.li_attr && node.id != '#' && !node.li_attr.loadedFromServer) {
+
+ node.li_attr.loadedFromServer = true;
+
+ $.jstree.reference(".libraryTree", page).load_node(node.id, loadNodeCallback);
+ }
+ }
+
+ function onNodeLoad(event, data) {
+
+ var page = $(this).parents('.page')[0];
+ var node = data.node;
+
+ if (node.children && node.children) {
+ loadNodesToLoad(page, node);
+ }
+
+ if (node.li_attr && node.id != '#' && !node.li_attr.loadedFromServer) {
+
+ node.li_attr.loadedFromServer = true;
+
+ $.jstree.reference(".libraryTree", page).load_node(node.id, loadNodeCallback);
+ }
+ }
+
function initializeTreeInternal(page, currentUser, openItems, selectedId) {
nodesToLoad = [];
@@ -293,50 +340,7 @@
}
}
- }).off('select_node.jstree').on('select_node.jstree', function (event, data) {
-
- var node = data.node;
-
- var eventData = {
- id: node.id,
- itemType: node.li_attr.itemtype
- };
-
- if (eventData.itemType != 'livetv' && eventData.itemType != 'mediafolders') {
- $(this).trigger('itemclicked', [eventData]);
- }
-
- }).off('open_node.jstree').on('open_node.jstree', function (event, data) {
-
- var node = data.node;
-
- if (node.children && node.children) {
- loadNodesToLoad(page, node);
- }
-
- if (node.li_attr && node.id != '#' && !node.li_attr.loadedFromServer) {
-
- node.li_attr.loadedFromServer = true;
-
- $.jstree.reference(".libraryTree", page).load_node(node.id, loadNodeCallback);
- }
-
- }).off('load_node.jstree').on('load_node.jstree', function (event, data) {
-
- var node = data.node;
-
- if (node.children && node.children) {
- loadNodesToLoad(page, node);
- }
-
- if (node.li_attr && node.id != '#' && !node.li_attr.loadedFromServer) {
-
- node.li_attr.loadedFromServer = true;
-
- $.jstree.reference(".libraryTree", page).load_node(node.id, loadNodeCallback);
- }
-
- });
+ }).off('select_node.jstree', onNodeSelect).on('select_node.jstree', onNodeSelect).off('open_node.jstree', onNodeOpen).on('open_node.jstree', onNodeOpen).off('load_node.jstree', onNodeLoad).on('load_node.jstree', onNodeLoad);
}
function loadNodesToLoad(page, node) {
@@ -423,11 +427,15 @@
});
+ }).on('pageinitdepends', ".metadataEditorPage", function () {
+
+ Dashboard.importCss('css/metadataeditor.css');
+
}).on('pagebeforehide', ".metadataEditorPage", function () {
var page = this;
- $('.libraryTree', page).off('select_node.jstree');
+ $('.libraryTree', page).off('select_node.jstree', onNodeSelect).off('open_node.jstree', onNodeOpen).off('load_node.jstree', onNodeLoad);
});
@@ -486,10 +494,10 @@
var deferred = DeferredBuilder.Deferred();
require([
- 'thirdparty/jstree3.0.8/jstree.min',
- 'css!thirdparty/jstree3.0.8/themes/default/style.min'
+ 'thirdparty/jstree3.0.8/jstree.min'
], function () {
+ Dashboard.importCss('thirdparty/jstree3.0.8/themes/default/style.min.css');
deferred.resolve();
});
return deferred.promise();
diff --git a/dashboard-ui/scripts/episodes.js b/dashboard-ui/scripts/episodes.js
index 7b40ed76a1..cf41cff6ea 100644
--- a/dashboard-ui/scripts/episodes.js
+++ b/dashboard-ui/scripts/episodes.js
@@ -29,7 +29,7 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -41,7 +41,7 @@
addSelectionButton: true
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls();
var trigger = false;
@@ -80,14 +80,14 @@
});
}
- var elem = $('.itemsContainer', page).html(html).lazyChildren();
+ var elem = page.querySelector('.itemsContainer');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- elem.trigger('create');
+ Events.trigger(elem, 'create');
}
- $(pagingHtml).appendTo(elem).trigger('create');
-
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
@@ -321,7 +321,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#episodesPage", function () {
+ }).on('pagebeforeshowready', "#episodesPage", function () {
var page = this;
query.ParentId = LibraryMenu.getTopParentId();
@@ -356,7 +356,7 @@
LibraryBrowser.getSavedViewSetting(viewkey).done(function (val) {
if (val) {
- $('#selectView', page).val(val).selectmenu('refresh').trigger('change');
+ Events.trigger($('#selectView', page).val(val).selectmenu('refresh')[0], 'change');
} else {
reloadItems(page);
}
diff --git a/dashboard-ui/scripts/extensions.js b/dashboard-ui/scripts/extensions.js
index 7de905c2f3..06d8b1ae3e 100644
--- a/dashboard-ui/scripts/extensions.js
+++ b/dashboard-ui/scripts/extensions.js
@@ -312,7 +312,7 @@ function replaceQueryString(url, param, value) {
var re = new RegExp("([?|&])" + param + "=.*?(&|$)", "i");
if (url.match(re))
return url.replace(re, '$1' + param + "=" + value + '$2');
- else {
+ else if (value) {
if (url.indexOf('?') == -1) {
return url + '?' + param + "=" + value;
@@ -320,6 +320,8 @@ function replaceQueryString(url, param, value) {
return url + '&' + param + "=" + value;
}
+
+ return url;
}
function parseISO8601Date(s, options) {
@@ -567,7 +569,7 @@ function ticks_to_human(str) {
$this.unbind(touchMoveEvent, moveHandler);
if (start && stop) {
if (stop.time - start.time < 1000 &&
- Math.abs(start.coords[1] - stop.coords[1]) > 30 &&
+ Math.abs(start.coords[1] - stop.coords[1]) > 100 &&
Math.abs(start.coords[0] - stop.coords[0]) < 75) {
start.origin
.trigger("swipeupdown")
@@ -590,4 +592,13 @@ function ticks_to_human(str) {
};
});
-})();
\ No newline at end of file
+})();
+
+// This only exists because the polymer elements get distorted when using regular jquery show/hide
+$.fn.visible = function(visible) {
+
+ if (visible) {
+ return this.removeClass('hide');
+ }
+ return this.addClass('hide');
+};
\ No newline at end of file
diff --git a/dashboard-ui/scripts/externalplayer.js b/dashboard-ui/scripts/externalplayer.js
index 4c2c2a8239..94c231e034 100644
--- a/dashboard-ui/scripts/externalplayer.js
+++ b/dashboard-ui/scripts/externalplayer.js
@@ -1,4 +1,4 @@
-(function (window, store) {
+(function (window) {
function getDeviceProfile(serverAddress, deviceId, item, startPositionTicks, maxBitrate, mediaSourceId, audioStreamIndex, subtitleStreamIndex) {
@@ -397,7 +397,7 @@
$('.sliderValue', elem).html(tooltext);
- console.log("slidin", pct, self.currentDurationTicks, time);
+ Logger.log("slidin", pct, self.currentDurationTicks, time);
});
}
@@ -484,4 +484,4 @@
showPlayerSelectionMenu: showPlayerSelectionMenu
};
-})(window, window.appStorage);
\ No newline at end of file
+})(window);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/favorites.js b/dashboard-ui/scripts/favorites.js
index 4ed039799a..8e73c8aad8 100644
--- a/dashboard-ui/scripts/favorites.js
+++ b/dashboard-ui/scripts/favorites.js
@@ -9,7 +9,6 @@
{ name: Globalize.translate('HeaderFavoriteGames'), types: "Game", id: "favoriteGames", shape: 'autohome', preferThumb: false, showTitle: true },
{ name: Globalize.translate('HeaderFavoriteAlbums'), types: "MusicAlbum", id: "favoriteAlbums", shape: 'square', preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true }
];
-
}
function loadSection(elem, userId, section, isSingleSection) {
@@ -33,7 +32,7 @@
options.Limit = null;
}
- ApiClient.getItems(userId, options).done(function (result) {
+ return ApiClient.getItems(userId, options).done(function (result) {
var html = '';
@@ -52,24 +51,25 @@
showDetailsMenu: true
});
- if (result.TotalRecordCount > result.Items.length) {
- html += '
';
- }
html += '
';
+
+ if (result.TotalRecordCount > result.Items.length) {
+ var href = "homefavorites.html?sectionid=" + section.id;
+
+ html += '
' + Globalize.translate('ButtonMoreItems') + ' ';
+ }
}
- elem = $(elem).html(html).trigger('create').lazyChildren();
- elem.createCardMenus();
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
+ $(elem).createCardMenus();
});
}
function loadSections(page, userId) {
+ Dashboard.showLoadingMsg();
+
var sections = getSections();
var sectionid = getParameterByName('sectionid');
@@ -95,23 +95,33 @@
elem.html(html);
}
+ var promises = [];
+
for (i = 0, length = sections.length; i < length; i++) {
var section = sections[i];
- elem = $('.section' + section.id, page);
+ elem = page.querySelector('.section' + section.id);
- loadSection(elem, userId, section, sections.length == 1);
+ promises.push(loadSection(elem, userId, section, sections.length == 1));
}
+
+ $.when(promises).done(function () {
+ Dashboard.hideLoadingMsg();
+
+ LibraryBrowser.setLastRefreshed(page);
+ });
}
- $(document).on('pageshowready', "#favoritesPage", function () {
+ $(document).on('pagebeforeshowready', "#favoritesPage", function () {
var page = this;
var userId = Dashboard.getCurrentUserId();
- loadSections(page, userId);
+ if (LibraryBrowser.needsRefresh(page)) {
+ loadSections(page, userId);
+ }
});
})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/gamegenrepage.js b/dashboard-ui/scripts/gamegenrepage.js
index 802683800d..3129311e33 100644
--- a/dashboard-ui/scripts/gamegenrepage.js
+++ b/dashboard-ui/scripts/gamegenrepage.js
@@ -22,7 +22,7 @@
ApiClient.getGameGenres(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -46,7 +46,9 @@
lazy: true
});
- $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -96,7 +98,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#gameGenresPage", function () {
+ }).on('pagebeforeshowready', "#gameGenresPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/gamespage.js b/dashboard-ui/scripts/gamespage.js
index d082261e4d..cbfa0ba8c3 100644
--- a/dashboard-ui/scripts/gamespage.js
+++ b/dashboard-ui/scripts/gamespage.js
@@ -28,7 +28,7 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -73,10 +73,12 @@
});
}
- $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- $('#items', page).trigger('create');
+ $(elem).trigger('create');
}
$('.btnNextPage', page).on('click', function () {
@@ -239,7 +241,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#gamesPage", function () {
+ }).on('pagebeforeshowready', "#gamesPage", function () {
var page = this;
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/gamesrecommendedpage.js b/dashboard-ui/scripts/gamesrecommendedpage.js
index d8f4655996..6d82262f20 100644
--- a/dashboard-ui/scripts/gamesrecommendedpage.js
+++ b/dashboard-ui/scripts/gamesrecommendedpage.js
@@ -1,6 +1,6 @@
(function ($, document) {
- $(document).on('pageshowready', "#gamesRecommendedPage", function () {
+ $(document).on('pagebeforeshowready', "#gamesRecommendedPage", function () {
var parentId = LibraryMenu.getTopParentId();
var userId = Dashboard.getCurrentUserId();
diff --git a/dashboard-ui/scripts/gamestudiospage.js b/dashboard-ui/scripts/gamestudiospage.js
index f85bf82aac..7d1e88b1c1 100644
--- a/dashboard-ui/scripts/gamestudiospage.js
+++ b/dashboard-ui/scripts/gamestudiospage.js
@@ -23,7 +23,7 @@
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -33,7 +33,7 @@
totalRecordCount: result.TotalRecordCount,
viewButton: true,
showLimit: false
- })).trigger('create');
+ }));
updateFilterControls(page);
@@ -48,7 +48,9 @@
});
- $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -98,7 +100,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#gameStudiosPage", function () {
+ }).on('pagebeforeshowready', "#gameStudiosPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/gamesystemspage.js b/dashboard-ui/scripts/gamesystemspage.js
index 1b7cba7f7b..03e461cd1c 100644
--- a/dashboard-ui/scripts/gamesystemspage.js
+++ b/dashboard-ui/scripts/gamesystemspage.js
@@ -25,7 +25,7 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
updateFilterControls(page);
@@ -39,7 +39,9 @@
});
- $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
@@ -52,7 +54,7 @@
// Reset form values using the last used query
}
- $(document).on('pageshowready', "#gamesystemsPage", function () {
+ $(document).on('pagebeforeshowready', "#gamesystemsPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/homelatest.js b/dashboard-ui/scripts/homelatest.js
deleted file mode 100644
index d9f3e2cb66..0000000000
--- a/dashboard-ui/scripts/homelatest.js
+++ /dev/null
@@ -1,44 +0,0 @@
-(function ($, document) {
-
- function loadSections(page, user) {
-
- var userId = user.Id;
-
- var i, length;
- var sectionCount = 3;
-
- var elem = $('.sections', page);
-
- if (!elem.html().length) {
- var html = '';
- for (i = 0, length = sectionCount; i < length; i++) {
-
- html += '
';
- }
-
- elem.html(html);
- }
-
- var context = 'home-latest';
-
- var latestMediElem = $('.section0', page);
-
- Sections.loadRecentlyAdded(latestMediElem, user, context).done(function () {
-
- $('h1', latestMediElem).addClass('firstListHeader');
- });
- Sections.loadLatestLiveTvRecordings($(".section1", page), userId);
- Sections.loadLatestChannelItems($(".section2", page), userId);
- }
-
- $(document).on('pageshowready', "#homeLatestPage", function () {
-
- var page = this;
-
- Dashboard.getCurrentUser().done(function (user) {
- loadSections(page, user);
- });
-
- });
-
-})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/homenextup.js b/dashboard-ui/scripts/homenextup.js
new file mode 100644
index 0000000000..90540f2d43
--- /dev/null
+++ b/dashboard-ui/scripts/homenextup.js
@@ -0,0 +1,195 @@
+(function ($, document) {
+
+ function getView() {
+
+ return 'Thumb';
+ }
+
+ function getResumeView() {
+
+ return 'Poster';
+ }
+
+ function reload(page) {
+
+ Dashboard.showLoadingMsg();
+
+ var context = '';
+
+ if (LibraryMenu.getTopParentId()) {
+
+ $('.scopedLibraryViewNav', page).show();
+ $('.globalNav', page).hide();
+ $('.scopedContent', page).show();
+ context = 'tv';
+
+ loadResume(page);
+
+ } else {
+ $('.scopedLibraryViewNav', page).hide();
+ $('.globalNav', page).show();
+ $('.scopedContent', page).hide();
+ }
+
+ loadNextUp(page, context || 'home-nextup');
+ }
+
+ function loadNextUp(page, context) {
+
+ var limit = AppInfo.hasLowImageBandwidth ?
+ 16 :
+ 24;
+
+ var query = {
+
+ Limit: limit,
+ Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,SyncInfo",
+ UserId: Dashboard.getCurrentUserId(),
+ ExcludeLocationTypes: "Virtual",
+ ImageTypeLimit: 1,
+ EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
+ };
+
+ query.ParentId = LibraryMenu.getTopParentId();
+
+ ApiClient.getNextUpEpisodes(query).done(function (result) {
+
+ if (result.Items.length) {
+ $('.noNextUpItems', page).hide();
+ } else {
+ $('.noNextUpItems', page).show();
+ }
+
+ var view = getView();
+ var html = '';
+
+ if (view == 'ThumbCard') {
+
+ html += LibraryBrowser.getPosterViewHtml({
+ items: result.Items,
+ shape: "backdrop",
+ showTitle: true,
+ preferThumb: true,
+ showParentTitle: true,
+ lazy: true,
+ cardLayout: true,
+ context: 'tv',
+ showDetailsMenu: true
+ });
+
+ } else if (view == 'Thumb') {
+
+ html += LibraryBrowser.getPosterViewHtml({
+ items: result.Items,
+ shape: "backdrop",
+ showTitle: true,
+ showParentTitle: true,
+ overlayText: false,
+ context: context,
+ lazy: true,
+ preferThumb: true,
+ showDetailsMenu: true
+ });
+ }
+
+ var elem = page.querySelector('#nextUpItems');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
+ Dashboard.hideLoadingMsg();
+
+ LibraryBrowser.setLastRefreshed(page);
+ });
+ }
+
+ function enableScrollX() {
+ return $.browser.mobile && AppInfo.enableAppLayouts;
+ }
+
+ function getThumbShape() {
+ return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
+ }
+
+ function loadResume(page) {
+
+ var parentId = LibraryMenu.getTopParentId();
+
+ var screenWidth = $(window).width();
+
+ var limit = 6;
+
+ var options = {
+
+ SortBy: "DatePlayed",
+ SortOrder: "Descending",
+ IncludeItemTypes: "Episode",
+ Filters: "IsResumable",
+ Limit: limit,
+ Recursive: true,
+ Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData,SyncInfo",
+ ExcludeLocationTypes: "Virtual",
+ ParentId: parentId,
+ ImageTypeLimit: 1,
+ EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
+ };
+
+ ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
+
+ if (result.Items.length) {
+ $('#resumableSection', page).show();
+ } else {
+ $('#resumableSection', page).hide();
+ }
+
+ var view = getResumeView();
+ var html = '';
+
+ if (view == 'PosterCard') {
+
+ html += LibraryBrowser.getPosterViewHtml({
+ items: result.Items,
+ shape: getThumbShape(),
+ showTitle: true,
+ showParentTitle: true,
+ lazy: true,
+ cardLayout: true,
+ context: 'tv',
+ showDetailsMenu: true
+ });
+
+ } else if (view == 'Poster') {
+
+ html += LibraryBrowser.getPosterViewHtml({
+ items: result.Items,
+ shape: getThumbShape(),
+ showTitle: true,
+ showParentTitle: true,
+ overlayText: screenWidth >= 800 && !AppInfo.hasLowImageBandwidth,
+ lazy: true,
+ context: 'tv',
+ showDetailsMenu: true
+ });
+ }
+
+ var elem = page.querySelector('#resumableItems');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
+ });
+ }
+
+ $(document).on('pagebeforeshowready', "#homeNextUpPage", function () {
+
+ var page = this;
+
+ if (enableScrollX()) {
+ page.querySelector('#resumableItems').classList.add('hiddenScrollX');
+ } else {
+ page.querySelector('#resumableItems').classList.remove('hiddenScrollX');
+ }
+
+ if (LibraryBrowser.needsRefresh(page)) {
+ reload(page);
+ }
+ });
+
+
+})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/homeupcoming.js b/dashboard-ui/scripts/homeupcoming.js
new file mode 100644
index 0000000000..9b9bc1e444
--- /dev/null
+++ b/dashboard-ui/scripts/homeupcoming.js
@@ -0,0 +1,72 @@
+(function ($, document) {
+
+ function loadUpcoming(page) {
+ Dashboard.showLoadingMsg();
+
+ var limit = AppInfo.hasLowImageBandwidth ?
+ 24 :
+ 40;
+
+ var query = {
+
+ Limit: limit,
+ Fields: "AirTime,UserData,SeriesStudio,SyncInfo",
+ UserId: Dashboard.getCurrentUserId(),
+ ImageTypeLimit: 1,
+ EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
+ };
+
+ query.ParentId = LibraryMenu.getTopParentId();
+
+ var context = '';
+
+ if (query.ParentId) {
+
+ context = 'tv';
+
+ }
+
+ ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).done(function (result) {
+
+ var items = result.Items;
+
+ if (items.length) {
+ page.querySelector('.noItemsMessage').style.display = 'none';
+ } else {
+ page.querySelector('.noItemsMessage').style.display = 'block';
+ }
+
+ var elem = page.querySelector('#upcomingItems');
+ elem.innerHTML = LibraryBrowser.getPosterViewHtml({
+ items: items,
+ showLocationTypeIndicator: false,
+ shape: "backdrop",
+ showTitle: true,
+ showPremiereDate: true,
+ showPremiereDateIndex: true,
+ preferThumb: true,
+ context: context || 'home-upcoming',
+ lazy: true,
+ showDetailsMenu: true
+
+ });
+
+ ImageLoader.lazyChildren(elem);
+
+ Dashboard.hideLoadingMsg();
+
+ LibraryBrowser.setLastRefreshed(page);
+ });
+ }
+
+ $(document).on('pagebeforeshowready', "#homeUpcomingPage", function () {
+
+ var page = this;
+
+ if (LibraryBrowser.needsRefresh(page)) {
+ loadUpcoming(page);
+ }
+ });
+
+
+})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/htmlmediarenderer.js b/dashboard-ui/scripts/htmlmediarenderer.js
index 8c516fbed8..84ba1e96f6 100644
--- a/dashboard-ui/scripts/htmlmediarenderer.js
+++ b/dashboard-ui/scripts/htmlmediarenderer.js
@@ -1,5 +1,7 @@
(function () {
+ var supportsTextTracks;
+
function htmlMediaRenderer(type) {
var mediaElement;
@@ -44,7 +46,7 @@
function onError() {
var errorCode = this.error ? this.error.code : '';
- console.log('Media element error code: ' + errorCode);
+ Logger.log('Media element error code: ' + errorCode);
$(self).trigger('error');
}
@@ -126,8 +128,8 @@
var elem = $('.itemVideo');
- return $(elem)
- .one('.loadedmetadata')
+ return elem
+ .one('.loadedmetadata', onLoadedMetadata)
.one('playing', onOneVideoPlaying)
.on('timeupdate', onTimeUpdate)
.on('ended', onEnded)
@@ -135,6 +137,8 @@
.on('play', onPlay)
.on('pause', onPause)
.on('playing', onPlaying)
+ .on('click', onClick)
+ .on('dblclick', onDblClick)
.on('error', onError)[0];
}
@@ -142,11 +146,11 @@
if (mediaElement) {
if (val != null) {
- mediaElement.currentTime = val;
+ mediaElement.currentTime = val / 1000;
return;
}
- return mediaElement.currentTime;
+ return (mediaElement.currentTime || 0) * 1000;
}
};
@@ -216,7 +220,7 @@
}
else {
- $(elem).one("loadedmetadata.mediaplayerevent", onLoadedMetadata);
+ $(elem).one("loadedmetadata", onLoadedMetadata);
}
};
@@ -235,7 +239,7 @@
return false;
};
- self.destroy = function () {
+ self.cleanup = function (destroyRenderer) {
self.setCurrentSrc(null);
@@ -243,7 +247,31 @@
if (elem) {
- $(elem).off();
+ if (elem.tagName == 'AUDIO') {
+
+ Events.off(elem, 'timeupdate', onTimeUpdate);
+ Events.off(elem, 'ended', onEnded);
+ Events.off(elem, 'volumechange', onVolumeChange);
+ Events.off(elem, 'playing', onOneAudioPlaying);
+ Events.off(elem, 'play', onPlay);
+ Events.off(elem, 'pause', onPause);
+ Events.off(elem, 'playing', onPlaying);
+ Events.off(elem, 'error', onError);
+
+ } else {
+
+ Events.off(elem, 'loadedmetadata', onLoadedMetadata);
+ Events.off(elem, 'playing', onOneVideoPlaying);
+ Events.off(elem, 'timeupdate', onTimeUpdate);
+ Events.off(elem, 'ended', onEnded);
+ Events.off(elem, 'volumechange', onVolumeChange);
+ Events.off(elem, 'play', onPlay);
+ Events.off(elem, 'pause', onPause);
+ Events.off(elem, 'playing', onPlaying);
+ Events.off(elem, 'click', onClick);
+ Events.off(elem, 'dblclick', onDblClick);
+ Events.off(elem, 'error', onError);
+ }
if (elem.tagName.toLowerCase() != 'audio') {
$(elem).remove();
@@ -259,6 +287,86 @@
}
};
+ self.supportsTextTracks = function () {
+
+ if (supportsTextTracks == null) {
+ supportsTextTracks = document.createElement('video').textTracks != null;
+ }
+
+ // For now, until ready
+ return supportsTextTracks;
+ };
+
+ self.setCurrentTrackElement = function (trackIndex) {
+
+ Logger.log('Setting new text track index to: ' + trackIndex);
+
+ var allTracks = mediaElement.textTracks; // get list of tracks
+
+ var modes = ['disabled', 'showing', 'hidden'];
+
+ for (var i = 0; i < allTracks.length; i++) {
+
+ var mode;
+
+ if (trackIndex == i) {
+ mode = 1; // show this track
+ } else {
+ mode = 0; // hide all other tracks
+ }
+
+ Logger.log('Setting track ' + i + ' mode to: ' + mode);
+
+ // Safari uses integers for the mode property
+ // http://www.jwplayer.com/html5/scripting/
+ var useNumericMode = false;
+
+ if (!isNaN(allTracks[i].mode)) {
+ useNumericMode = true;
+ }
+
+ if (useNumericMode) {
+ allTracks[i].mode = mode;
+ } else {
+ allTracks[i].mode = modes[mode];
+ }
+ }
+ };
+
+ self.updateTextStreamUrls = function (startPositionTicks) {
+
+ if (!self.supportsTextTracks()) {
+ return;
+ }
+
+ var allTracks = mediaElement.textTracks; // get list of tracks
+
+ for (var i = 0; i < allTracks.length; i++) {
+
+ var track = allTracks[i];
+
+ // This throws an error in IE, but is fine in chrome
+ // In IE it's not necessary anyway because changing the src seems to be enough
+ try {
+ while (track.cues.length) {
+ track.removeCue(track.cues[0]);
+ }
+ } catch (e) {
+ Logger.log('Error removing cue from textTrack');
+ }
+ }
+
+ $('track', mediaElement).each(function () {
+
+ var currentSrc = this.src;
+
+ currentSrc = replaceQueryString(currentSrc, 'startPositionTicks', startPositionTicks);
+
+ this.src = currentSrc;
+
+ });
+ };
+
if (type == 'audio') {
mediaElement = createAudioElement();
}
diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js
index bc775f4025..c0892fe9a3 100644
--- a/dashboard-ui/scripts/indexpage.js
+++ b/dashboard-ui/scripts/indexpage.js
@@ -1,466 +1,5 @@
(function ($, document) {
- function getUserViews(userId) {
-
- var deferred = $.Deferred();
-
- ApiClient.getUserViews(userId).done(function (result) {
-
- var items = result.Items;
-
- deferred.resolveWith(null, [items]);
- });
-
- return deferred.promise();
- }
-
- function enableScrollX() {
- return $.browser.mobile && AppInfo.enableAppLayouts;
- }
-
- function getThumbShape() {
- return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
- }
-
- function getLibraryButtonsHtml(items) {
-
- var html = "";
-
- // "My Library" backgrounds
- for (var i = 0, length = items.length; i < length; i++) {
-
- var item = items[i];
-
- var icon;
- var backgroundColor = 'rgba(82, 181, 75, 0.9)';
-
- switch (item.CollectionType) {
- case "movies":
- icon = "fa-film";
- backgroundColor = 'rgba(176, 94, 81, 0.9)';
- break;
- case "music":
- icon = "fa-music";
- backgroundColor = 'rgba(217, 145, 67, 0.9)';
- break;
- case "photos":
- icon = "fa-photo";
- backgroundColor = 'rgba(127, 0, 0, 0.9)';
- break;
- case "livetv":
- icon = "fa-video-camera";
- backgroundColor = 'rgba(217, 145, 67, 0.9)';
- break;
- case "tvshows":
- icon = "fa-video-camera";
- backgroundColor = 'rgba(77, 88, 164, 0.9)';
- break;
- case "games":
- icon = "fa-gamepad";
- backgroundColor = 'rgba(183, 202, 72, 0.9)';
- break;
- case "trailers":
- icon = "fa-film";
- backgroundColor = 'rgba(176, 94, 81, 0.9)';
- break;
- case "homevideos":
- icon = "fa-video-camera";
- backgroundColor = 'rgba(110, 52, 32, 0.9)';
- break;
- case "musicvideos":
- icon = "fa-video-camera";
- backgroundColor = 'rgba(143, 54, 168, 0.9)';
- break;
- case "books":
- icon = "fa-book";
- break;
- case "channels":
- icon = "fa-globe";
- backgroundColor = 'rgba(51, 136, 204, 0.9)';
- break;
- case "playlists":
- icon = "fa-list";
- break;
- default:
- icon = "fa-folder-o";
- break;
- }
-
- var cssClass = 'card smallBackdropCard buttonCard';
-
- if (item.CollectionType) {
- cssClass += ' ' + item.CollectionType + 'buttonCard';
- }
-
- var href = item.url || LibraryBrowser.getHref(item);
-
- html += '
';
- html += '';
-
- html += "
";
- html += ' ';
- html += '' + item.Name + ' ';
- html += "
";
-
- html += "
";
-
- html += " ";
- }
-
- return html;
- }
-
- function loadlibraryButtons(elem, userId, index) {
-
- return getUserViews(userId).done(function (items) {
-
- var html = '
';
-
- if (index) {
- html += '';
- }
- html += '
';
- html += getLibraryButtonsHtml(items);
- html += '
';
-
- $(elem).html(html);
-
- handleLibraryLinkNavigations(elem);
- });
- }
-
- function loadRecentlyAdded(elem, user, context) {
-
- var limit = AppInfo.hasLowImageBandwidth ?
- 16 :
- 24;
-
- var options = {
-
- Limit: limit,
- Fields: "PrimaryImageAspectRatio,SyncInfo",
- ImageTypeLimit: 1,
- EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
- };
-
- return ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).done(function (items) {
-
- var html = '';
-
- var cardLayout = false;
-
- if (items.length) {
- html += '
';
-
- html += '
';
-
- html += LibraryBrowser.getPosterViewHtml({
- items: items,
- preferThumb: true,
- shape: 'backdrop',
- context: context || 'home',
- showUnplayedIndicator: false,
- showChildCountIndicator: true,
- lazy: true,
- cardLayout: cardLayout,
- showTitle: cardLayout,
- showYear: cardLayout,
- showDetailsMenu: true
- });
- html += '
';
- }
-
- $(elem).html(html).lazyChildren().createCardMenus();
- });
- }
-
- function loadLatestChannelMedia(elem, userId) {
-
- var screenWidth = $(window).width();
-
- var options = {
-
- Limit: screenWidth >= 2400 ? 10 : (screenWidth >= 1600 ? 10 : (screenWidth >= 1440 ? 8 : (screenWidth >= 800 ? 7 : 6))),
- Fields: "PrimaryImageAspectRatio,SyncInfo",
- Filters: "IsUnplayed",
- UserId: userId
- };
-
- return ApiClient.getJSON(ApiClient.getUrl("Channels/Items/Latest", options)).done(function (result) {
-
- var html = '';
-
- if (result.Items.length) {
- html += '';
- html += '
';
- html += LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- preferThumb: true,
- shape: 'auto',
- showTitle: true,
- centerText: true,
- lazy: true,
- showDetailsMenu: true
- });
- html += '
';
- }
-
- $(elem).html(html).lazyChildren().createCardMenus();
- });
- }
-
- function loadLibraryTiles(elem, user, shape, index, autoHideOnMobile, showTitles) {
-
- return getUserViews(user.Id).done(function (items) {
-
- var html = '';
-
- if (autoHideOnMobile) {
- html += '
';
- } else {
- html += '
';
- }
-
- if (items.length) {
-
- var cssClass = index !== 0 ? 'listHeader' : 'listHeader firstListHeader';
-
- html += '
';
- html += '
' + Globalize.translate('HeaderMyMedia') + ' ';
-
- if (user.Policy.EnableUserPreferenceAccess && !AppInfo.isNativeApp) {
- html += '
' + Globalize.translate('ButtonEdit') + '';
- }
-
- html += '
';
-
- html += '
';
- html += LibraryBrowser.getPosterViewHtml({
- items: items,
- shape: shape,
- showTitle: showTitles,
- centerText: true,
- lazy: true,
- autoThumb: true
- });
- html += '
';
- }
-
- html += '
';
-
- if (autoHideOnMobile) {
- html += '
';
- html += getLibraryButtonsHtml(items);
- html += '
';
- }
-
- $(elem).html(html).lazyChildren().createCardMenus({ showDetailsMenu: false });
-
- handleLibraryLinkNavigations(elem);
- });
- }
-
- function loadResume(elem, userId) {
-
- var screenWidth = $(window).width();
-
- var options = {
-
- SortBy: "DatePlayed",
- SortOrder: "Descending",
- MediaTypes: "Video",
- Filters: "IsResumable",
- Limit: screenWidth >= 1920 ? 10 : (screenWidth >= 1600 ? 8 : (screenWidth >= 1200 ? 9 : 6)),
- Recursive: true,
- Fields: "PrimaryImageAspectRatio,SyncInfo",
- CollapseBoxSetItems: false,
- ExcludeLocationTypes: "Virtual",
- ImageTypeLimit: 1,
- EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
- };
-
- return ApiClient.getItems(userId, options).done(function (result) {
-
- var html = '';
-
- var cardLayout = AppInfo.hasLowImageBandwidth;
-
- if (result.Items.length) {
- html += '';
- if (enableScrollX()) {
- html += '
';
- } else {
- html += '
';
- }
- html += LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- preferThumb: true,
- shape: getThumbShape(),
- overlayText: screenWidth >= 800 && !cardLayout,
- showTitle: true,
- showParentTitle: true,
- context: 'home',
- lazy: true,
- cardLayout: cardLayout,
- showDetailsMenu: true
- });
- html += '
';
- }
-
- $(elem).html(html).lazyChildren().createCardMenus();
- });
- }
-
- function handleLibraryLinkNavigations(elem) {
-
- $('a.posterItem', elem).on('click', function () {
-
- var textElem = $('.posterItemText span', this);
-
- if (!textElem.length) {
- textElem = $('.posterItemText', this);
- }
- var text = textElem.html();
-
- LibraryMenu.setText(text);
- });
- }
-
- function loadLatestChannelItems(elem, userId, options) {
-
- options = $.extend(options || {}, {
-
- UserId: userId,
- SupportsLatestItems: true
- });
-
- return ApiClient.getJSON(ApiClient.getUrl("Channels", options)).done(function (result) {
-
- var channels = result.Items;
-
- var channelsHtml = channels.map(function (c) {
-
- return '
';
-
- }).join('');
-
- $(elem).html(channelsHtml);
-
- for (var i = 0, length = channels.length; i < length; i++) {
-
- var channel = channels[i];
-
- loadLatestChannelItemsFromChannel(elem, channel, i);
- }
-
- });
- }
-
- function loadLatestChannelItemsFromChannel(page, channel, index) {
-
- var screenWidth = $(window).width();
-
- var options = {
-
- Limit: screenWidth >= 1600 ? 10 : (screenWidth >= 1440 ? 5 : (screenWidth >= 800 ? 6 : 6)),
- Fields: "PrimaryImageAspectRatio,SyncInfo",
- Filters: "IsUnplayed",
- UserId: Dashboard.getCurrentUserId(),
- ChannelIds: channel.Id
- };
-
- ApiClient.getJSON(ApiClient.getUrl("Channels/Items/Latest", options)).done(function (result) {
-
- var html = '';
-
- if (result.Items.length) {
-
- var cssClass = index !== 0 ? 'listHeader' : 'listHeader firstListHeader';
-
- html += '
';
- var text = Globalize.translate('HeaderLatestFromChannel').replace('{0}', channel.Name);
- html += '
' + text + ' ';
- html += '';
- html += '';
- }
- html += '
';
- html += LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- shape: 'autohome',
- defaultShape: 'square',
- showTitle: true,
- centerText: true,
- context: 'channels',
- lazy: true,
- showDetailsMenu: true
- });
- html += '
';
-
- $('#channel' + channel.Id + '', page).html(html).lazyChildren().trigger('create').createCardMenus();
- });
- }
-
- function loadLatestLiveTvRecordings(elem, userId, index) {
-
- return ApiClient.getLiveTvRecordings({
-
- userId: userId,
- limit: 5,
- IsInProgress: false
-
- }).done(function (result) {
-
- var html = '';
-
- if (result.Items.length) {
-
- var cssClass = index !== 0 ? 'listHeader' : 'listHeader firstListHeader';
-
- html += '
';
- html += '
' + Globalize.translate('HeaderLatestTvRecordings') + ' ';
- html += '';
- html += '';
- }
-
- var screenWidth = $(window).width();
-
- html += LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- shape: "autohome",
- showTitle: true,
- showParentTitle: true,
- overlayText: screenWidth >= 600,
- coverImage: true,
- lazy: true,
- showDetailsMenu: true
- });
-
- elem.html(html).lazyChildren().trigger('create');
-
- });
- }
-
- window.Sections = {
- loadRecentlyAdded: loadRecentlyAdded,
- loadLatestChannelMedia: loadLatestChannelMedia,
- loadLibraryTiles: loadLibraryTiles,
- loadResume: loadResume,
- loadLatestChannelItems: loadLatestChannelItems,
- loadLatestLiveTvRecordings: loadLatestLiveTvRecordings,
- loadlibraryButtons: loadlibraryButtons
- };
-
-})(jQuery, document);
-
-(function ($, document) {
-
var defaultFirstSection = 'smalllibrarytiles';
function getDefaultSection(index) {
@@ -474,7 +13,7 @@
case 2:
return 'latestmedia';
case 3:
- return '';
+ return 'latesttvrecordings';
default:
return '';
}
@@ -493,7 +32,7 @@
var showLibraryTileNames = displayPreferences.CustomPrefs.enableLibraryTileNames != '0';
- var elem = $('.section' + index, page);
+ var elem = page.querySelector('.section' + index);
if (section == 'latestmedia') {
return Sections.loadRecentlyAdded(elem, user);
@@ -538,16 +77,16 @@
var i, length;
var sectionCount = 4;
- var elem = $('.sections', page);
+ var elem = page.querySelector('.sections');
- if (!elem.html().length) {
+ if (!elem.innerHTML.length) {
var html = '';
for (i = 0, length = sectionCount; i < length; i++) {
html += '
';
}
- elem.html(html);
+ elem.innerHTML = html;
}
var promises = [];
@@ -578,6 +117,8 @@
$('.welcomeMessage', page).hide();
} else {
+ Dashboard.hideLoadingMsg();
+
var elem = $('.welcomeMessage', page).show();
if (displayPreferences.CustomPrefs[homePageTourKey]) {
@@ -627,32 +168,38 @@
var page = this;
- $('.btnTakeTour', page).on('click', function () {
+ Events.on(page.querySelector('.btnTakeTour'), 'click', function () {
takeTour(page, Dashboard.getCurrentUserId());
});
- }).on('pageshowready', "#indexPage", function () {
+ }).on('pagebeforeshowready', "#indexPage", function () {
var page = this;
- if (window.ApiClient) {
- var userId = Dashboard.getCurrentUserId();
+ if (LibraryBrowser.needsRefresh(page)) {
+ if (window.ApiClient) {
+ var userId = Dashboard.getCurrentUserId();
- getDisplayPreferences('home', userId).done(function (result) {
+ Dashboard.showLoadingMsg();
- Dashboard.getCurrentUser().done(function (user) {
+ getDisplayPreferences('home', userId).done(function (result) {
- loadSections(page, user, result).done(function () {
+ Dashboard.getCurrentUser().done(function (user) {
+
+ loadSections(page, user, result).done(function () {
+
+ if (!AppInfo.isNativeApp) {
+ showWelcomeIfNeeded(page, result);
+ }
+ Dashboard.hideLoadingMsg();
+
+ LibraryBrowser.setLastRefreshed(page);
+ });
- if (!AppInfo.isNativeApp) {
- showWelcomeIfNeeded(page, result);
- }
});
-
});
- });
+ }
}
-
});
function getDisplayPreferencesAppName() {
diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js
index a92b93b733..c982c808c5 100644
--- a/dashboard-ui/scripts/itembynamedetailpage.js
+++ b/dashboard-ui/scripts/itembynamedetailpage.js
@@ -77,9 +77,9 @@
Dashboard.getCurrentUser().done(function (user) {
if (MediaController.canPlay(item)) {
- $('.btnPlay', page).show();
+ $('.btnPlay', page).visible(true);
} else {
- $('.btnPlay', page).hide();
+ $('.btnPlay', page).visible(false);
}
if (SyncManager.isAvailable(item, user)) {
@@ -93,9 +93,9 @@
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, editImagesHref, true));
if (LibraryBrowser.getMoreCommands(item, user).length) {
- $('.btnMoreCommands', page).show();
+ $('.btnMoreCommands', page).visible(true);
} else {
- $('.btnMoreCommands', page).show();
+ $('.btnMoreCommands', page).visible(false);
}
});
@@ -315,10 +315,10 @@
function renderDetails(page, item, context) {
//LibraryBrowser.renderDetailPageBackdrop(page, item);
- LibraryBrowser.renderOverview($('.itemOverview', page), item);
+ LibraryBrowser.renderOverview(page.querySelector('.itemOverview'), item);
renderUserDataIcons(page, item);
- LibraryBrowser.renderLinks($('#itemLinks', page), item);
+ LibraryBrowser.renderLinks(page.querySelector('#itemLinks'), item);
LibraryBrowser.renderGenres($('.itemGenres', page), item, context);
@@ -439,7 +439,17 @@
var html = '';
if (result.TotalRecordCount > query.Limit) {
- $('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
+
+ var pagingHtml = LibraryBrowser.getQueryPagingHtml({
+ startIndex: query.StartIndex,
+ limit: query.Limit,
+ totalRecordCount: result.TotalRecordCount,
+ showLimit: false,
+ updatePageSizeSetting: false
+ });
+
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
+
$('.viewSettings', page).show();
} else {
$('.listTopPaging', page).html('');
@@ -509,9 +519,20 @@
});
}
- html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
+ html += LibraryBrowser.getQueryPagingHtml({
+ startIndex: query.StartIndex,
+ limit: query.Limit,
+ totalRecordCount: result.TotalRecordCount,
+ showLimit: false,
+ updatePageSizeSetting: false
+ });
- $('#items', page).html(html).trigger('create').lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
+
+ // Do we still need this?
+ $(elem).trigger('create');
$('.btnNextPage', page).on('click', function () {
@@ -571,13 +592,13 @@
});
});
- }).on('pageshowready', "#itemByNameDetailPage", function () {
+ }).on('pagebeforeshowready', "#itemByNameDetailPage", function () {
var page = this;
reload(page);
- }).on('pagehide', "#itemByNameDetailPage", function () {
+ }).on('pagebeforehide', "#itemByNameDetailPage", function () {
currentItem = null;
});
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js
index 7e75445162..9845059a47 100644
--- a/dashboard-ui/scripts/itemdetailpage.js
+++ b/dashboard-ui/scripts/itemdetailpage.js
@@ -2,22 +2,6 @@
var currentItem;
- function getExternalPlayUrl(item) {
-
- var providerIds = item.ProviderIds || {};
- if (item.GameSystem == "Nintendo" && item.MediaType == "Game" && providerIds.NesBox && providerIds.NesBoxRom) {
-
- return "http://nesbox.com/game/" + providerIds.NesBox + '/rom/' + providerIds.NesBoxRom;
- }
-
- if (item.GameSystem == "Super Nintendo" && item.MediaType == "Game" && providerIds.NesBox && providerIds.NesBoxRom) {
-
- return "http://snesbox.com/game/" + providerIds.NesBox + '/rom/' + providerIds.NesBoxRom;
- }
-
- return null;
- }
-
function reload(page) {
var id = getParameterByName('id');
@@ -49,20 +33,11 @@
renderDetails(page, item, context);
LibraryBrowser.renderDetailPageBackdrop(page, item);
- var externalPlayUrl = getExternalPlayUrl(item);
- $('.btnPlayExternal', page).attr('href', externalPlayUrl || '#');
-
- if (externalPlayUrl) {
- $('.btnPlayExternal', page).removeClass('hide');
- $('.btnPlay', page).addClass('hide');
- }
- else if (MediaController.canPlay(item)) {
+ if (MediaController.canPlay(item)) {
$('.btnPlay', page).removeClass('hide');
- $('.btnPlayExternal', page).addClass('hide');
}
else {
$('.btnPlay', page).addClass('hide');
- $('.btnPlayExternal', page).addClass('hide');
}
if (item.LocalTrailerCount && item.PlayAccess == 'Full') {
@@ -96,11 +71,7 @@
$('.splitVersionContainer', page).hide();
}
- if (LibraryBrowser.getMoreCommands(item, user).length) {
- $('.btnMoreCommands', page).show();
- } else {
- $('.btnMoreCommands', page).show();
- }
+ $('.btnMoreCommands', page).visible(LibraryBrowser.getMoreCommands(item, user).length > 0);
if (user.Policy.IsAdministrator) {
$('.chapterSettingsButton', page).show();
@@ -152,13 +123,13 @@
var imageHref = user.Policy.IsAdministrator && item.MediaType != 'Photo' ? "edititemimages.html?id=" + item.Id : "";
- LibraryBrowser.renderDetailImage($('.detailImageContainer', page), item, imageHref);
+ LibraryBrowser.renderDetailImage(page.querySelector('.detailImageContainer'), item, imageHref);
}
function onWebSocketMessage(e, data) {
var msg = data;
- var page = $.mobile.activePage;
+ var page = $($.mobile.activePage)[0];
if (msg.MessageType === "UserDataChanged") {
@@ -252,12 +223,10 @@
else if (context == 'home-latest') {
elem = $('.homeTabs', page).show();
$('a', elem).removeClass('ui-btn-active');
- $('.lnkHomeLatest', page).addClass('ui-btn-active');
}
else if (context == 'photos' || context == 'photos-photos') {
elem = $('.photoTabs', page).show();
$('a', elem).removeClass('ui-btn-active');
- $('.lnkHomeLatest', page).addClass('ui-btn-active');
if (context == 'photos-photos') {
$('.lnkPhotos', page).addClass('ui-btn-active');
@@ -393,7 +362,7 @@
$('#itemTagline', page).hide();
}
- LibraryBrowser.renderOverview($('.itemOverview', page), item);
+ LibraryBrowser.renderOverview(page.querySelector('.itemOverview'), item);
$('.itemCommunityRating', page).html(LibraryBrowser.getRatingHtml(item));
@@ -406,7 +375,7 @@
LibraryBrowser.renderGenres($('.itemGenres', page), item, context);
LibraryBrowser.renderStudios($('.itemStudios', page), item, context);
renderUserDataIcons(page, item);
- LibraryBrowser.renderLinks($('.itemExternalLinks', page), item);
+ LibraryBrowser.renderLinks(page.querySelector('.itemExternalLinks'), item);
$('.criticRatingScore', page).html((item.CriticRating || '0') + '%');
@@ -883,10 +852,12 @@
});
}
- var elem = $('.childrenItemsContainer', page).html(html).lazyChildren();
+ var elem = page.querySelector('.childrenItemsContainer');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- elem.trigger('create');
+ $(elem).trigger('create');
}
if (item.Type == "BoxSet") {
@@ -904,19 +875,19 @@
});
if (item.Type == "Season") {
- $('#childrenTitle', page).html(Globalize.translate('HeaderEpisodes'));
+ page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderEpisodes');
}
else if (item.Type == "Series") {
- $('#childrenTitle', page).html(Globalize.translate('HeaderSeasons'));
+ page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderSeasons');
}
else if (item.Type == "MusicAlbum") {
- $('#childrenTitle', page).html(Globalize.translate('HeaderTracks'));
+ page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderTracks');
}
else if (item.Type == "GameSystem") {
- $('#childrenTitle', page).html(Globalize.translate('HeaderGames'));
+ page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderGames');
}
else {
- $('#childrenTitle', page).html(Globalize.translate('HeaderItems'));
+ page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderItems');
}
}
@@ -992,7 +963,9 @@
html += '
';
- $('.collectionItems', page).append(html).lazyChildren();
+ var collectionItems = page.querySelector('.collectionItems');
+ $(collectionItems).append(html);
+ ImageLoader.lazyChildren(collectionItems);
}
function renderUserDataIcons(page, item) {
@@ -1090,10 +1063,11 @@
}
if (limit && result.TotalRecordCount > limit) {
- html += '
' + Globalize.translate('ButtonMoreItems') + '
';
+ html += '
' + Globalize.translate('ButtonMoreItems') + '
';
}
- $('#criticReviewsContent', page).html(html).trigger('create');
+ var criticReviewsContent = page.querySelector('#criticReviewsContent');
+ criticReviewsContent.innerHTML = html;
}
function renderThemeMedia(page, item) {
@@ -1248,10 +1222,12 @@
}
if (limit && chapters.length > limit) {
- html += '
' + Globalize.translate('ButtonMoreItems') + '
';
+ html += '
' + Globalize.translate('ButtonMoreItems') + '
';
}
- $('#scenesContent', page).html(html).trigger('create').lazyChildren();
+ var scenesContent = page.querySelector('#scenesContent');
+ scenesContent.innerHTML = html;
+ ImageLoader.lazyChildren(scenesContent);
}
function renderMediaSources(page, item) {
@@ -1266,7 +1242,8 @@
html = '
' + html;
}
- $('#mediaInfoContent', page).html(html).trigger('create');
+ var mediaInfoContent = page.querySelector('#mediaInfoContent');
+ mediaInfoContent.innerHTML = html;
}
function getMediaSourceHtml(item, version) {
@@ -1480,7 +1457,7 @@
}
if (limit && items.length > limit) {
- html += '
' + Globalize.translate('ButtonMoreItems') + '
';
+ html += '
' + Globalize.translate('ButtonMoreItems') + '
';
}
return html;
@@ -1490,7 +1467,9 @@
ApiClient.getSpecialFeatures(user.Id, item.Id).done(function (specials) {
- $('#specialsContent', page).html(getVideosHtml(specials, user, limit, "moreSpecials")).lazyChildren().trigger('create');
+ var specialsContent = page.querySelector('#specialsContent');
+ specialsContent.innerHTML = getVideosHtml(specials, user, limit, "moreSpecials");
+ ImageLoader.lazyChildren(specialsContent);
});
}
@@ -1557,10 +1536,12 @@
}
if (limit && casts.length > limit) {
- html += '
' + Globalize.translate('ButtonMoreItems') + '
';
+ html += '
' + Globalize.translate('ButtonMoreItems') + '
';
}
- $('#castContent', page).html(html).lazyChildren().trigger('create');
+ var castContent = page.querySelector('#castContent');
+ castContent.innerHTML = html;
+ ImageLoader.lazyChildren(castContent);
}
function play(startPosition) {
@@ -1604,7 +1585,13 @@
});
}
- $(document).on('pageinit', "#itemDetailPage", function () {
+ function onItemDeleted(e, itemId) {
+ if (currentItem && currentItem.Id == itemId) {
+ Dashboard.navigate('index.html');
+ }
+ }
+
+ $(document).on('pageinitdepends', "#itemDetailPage", function () {
var page = this;
@@ -1624,11 +1611,6 @@
playTrailer(page);
});
- $('.btnPlayExternal', page).on('click', function () {
-
- ApiClient.markPlayed(Dashboard.getCurrentUserId(), currentItem.Id, new Date());
- });
-
$('.btnSplitVersions', page).on('click', function () {
splitVersions(page);
@@ -1661,54 +1643,47 @@
});
- }).on('pageshow', "#itemDetailPage", function () {
-
- var page = this;
-
- $(page).on("click.moreScenes", ".moreScenes", function () {
+ $(page).on("click", ".moreScenes", function () {
Dashboard.getCurrentUser().done(function (user) {
renderScenes(page, currentItem, user);
});
- }).on("click.morePeople", ".morePeople", function () {
+ }).on("click", ".morePeople", function () {
renderCast(page, currentItem, getContext(currentItem));
- }).on("click.moreSpecials", ".moreSpecials", function () {
+ }).on("click", ".moreSpecials", function () {
Dashboard.getCurrentUser().done(function (user) {
renderSpecials(page, currentItem, user);
});
- }).on("click.moreCriticReviews", ".moreCriticReviews", function () {
+ }).on("click", ".moreCriticReviews", function () {
renderCriticReviews(page, currentItem);
});
+ }).on('pagebeforeshowready', "#itemDetailPage", function () {
+
+ var page = this;
+
reload(page);
- $(ApiClient).on('websocketmessage', onWebSocketMessage);
+ Events.on(ApiClient, 'websocketmessage', onWebSocketMessage);
- $(LibraryBrowser).on('itemdeleting.detailpage', function (e, itemId) {
+ Events.on(LibraryBrowser, 'itemdeleting', onItemDeleted);
- if (currentItem && currentItem.Id == itemId) {
- Dashboard.navigate('index.html');
- }
- });
+ }).on('pagebeforehide', "#itemDetailPage", function () {
- }).on('pagehide', "#itemDetailPage", function () {
-
- $(LibraryBrowser).off('itemdeleting.detailpage');
+ Events.off(LibraryBrowser, 'itemdeleting', onItemDeleted);
currentItem = null;
var page = this;
- $(page).off("click.moreScenes").off("click.morePeople").off("click.moreSpecials").off("click.moreCriticReviews");
-
- $(ApiClient).off('websocketmessage', onWebSocketMessage);
+ Events.off(ApiClient, 'websocketmessage', onWebSocketMessage);
});
function itemDetailPage() {
@@ -1720,5 +1695,4 @@
window.ItemDetailPage = new itemDetailPage();
-
})(jQuery, document, LibraryBrowser, window);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/itemlistpage.js b/dashboard-ui/scripts/itemlistpage.js
index a0dcc0dbe6..e9a9b5b7f7 100644
--- a/dashboard-ui/scripts/itemlistpage.js
+++ b/dashboard-ui/scripts/itemlistpage.js
@@ -34,7 +34,7 @@
var result = r2[0];
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -45,7 +45,7 @@
showLimit: false
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
@@ -86,9 +86,9 @@
});
}
- var elem = $('#items', page).html(html).lazyChildren();
-
- $(pagingHtml).appendTo(elem).trigger('create');
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -244,7 +244,7 @@
$(page).on('click', '.mediaItem', onListItemClick);
- }).on('pageshowready', "#itemListPage", function () {
+ }).on('pagebeforeshowready', "#itemListPage", function () {
var page = this;
@@ -270,7 +270,7 @@
updateFilterControls(page);
- }).on('pagehide', "#itemListPage", function () {
+ }).on('pagebeforehide', "#itemListPage", function () {
currentItem = null;
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index 2fe1362e72..3402e0c682 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -1,13 +1,11 @@
-var LibraryBrowser = (function (window, document, $, screen, store) {
+var LibraryBrowser = (function (window, document, $, screen) {
var pageSizeKey = 'pagesize_v4';
- var defaultBackground = "#333";
-
return {
getDefaultPageSize: function (key, defaultValue) {
- var saved = store.getItem(key || pageSizeKey);
+ var saved = appStorage.getItem(key || pageSizeKey);
if (saved) {
return parseInt(saved);
@@ -31,7 +29,7 @@
loadSavedQueryValues: function (key, query) {
- var values = store.getItem(key + '_' + Dashboard.getCurrentUserId());
+ var values = appStorage.getItem(key + '_' + Dashboard.getCurrentUserId());
if (values) {
@@ -55,7 +53,7 @@
}
try {
- store.setItem(key + '_' + Dashboard.getCurrentUserId(), JSON.stringify(values));
+ appStorage.setItem(key + '_' + Dashboard.getCurrentUserId(), JSON.stringify(values));
} catch (e) {
}
@@ -64,7 +62,7 @@
saveViewSetting: function (key, value) {
try {
- store.setItem(key + '_' + Dashboard.getCurrentUserId() + '_view', value);
+ appStorage.setItem(key + '_' + Dashboard.getCurrentUserId() + '_view', value);
} catch (e) {
}
@@ -73,12 +71,47 @@
getSavedViewSetting: function (key) {
var deferred = $.Deferred();
- var val = store.getItem(key + '_' + Dashboard.getCurrentUserId() + '_view');
+ var val = appStorage.getItem(key + '_' + Dashboard.getCurrentUserId() + '_view');
deferred.resolveWith(null, [val]);
return deferred.promise();
},
+ needsRefresh: function (elem) {
+
+ var last = parseInt(elem.getAttribute('data-lastrefresh') || '0');
+
+ if (!last) {
+ return true;
+ }
+
+ if (NavHelper.isBack()) {
+ return false;
+ }
+
+ var now = new Date().getTime();
+ var cacheDuration = 300000;
+ if (!AppInfo.isNativeApp && ($.browser.ipad || $.browser.iphone || $.browser.android)) {
+ cacheDuration = 10000;
+ }
+
+ else if (!$.browser.mobile) {
+ cacheDuration = 60000;
+ }
+
+ if ((now - last) < cacheDuration) {
+ return false;
+ }
+
+ return true;
+ },
+
+ setLastRefreshed: function (elem) {
+
+ elem.setAttribute('data-lastrefresh', new Date().getTime());
+ elem.classList.add('hasrefreshtime');
+ },
+
getDateParamValue: function (date) {
function formatDigit(i) {
@@ -239,7 +272,7 @@
});
},
- showPlayMenu: function (positionTo, itemId, itemType, isFolder, mediaType, resumePositionTicks, showAddToPlaylist) {
+ showPlayMenu: function (positionTo, itemId, itemType, isFolder, mediaType, resumePositionTicks) {
var externalPlayers = AppSettings.enableExternalPlayers();
@@ -251,53 +284,91 @@
}
}
- $('.playFlyout').popup("close").remove();
-
- var html = '
';
-
- html += '
';
-
- html += '' + Globalize.translate('ButtonPlay') + ' ';
-
- if (!isFolder && externalPlayers) {
- html += '' + Globalize.translate('ButtonPlayExternalPlayer') + ' ';
- }
+ var menuItems = [];
if (resumePositionTicks) {
- html += '' + Globalize.translate('ButtonResume') + ' ';
+ menuItems.push({
+ name: Globalize.translate('ButtonResume'),
+ id: 'resume',
+ ironIcon: 'play-arrow'
+ });
+ }
+
+ menuItems.push({
+ name: Globalize.translate('ButtonPlay'),
+ id: 'play',
+ ironIcon: 'play-arrow'
+ });
+
+ if (!isFolder && externalPlayers && mediaType != "Audio") {
+ menuItems.push({
+ name: Globalize.translate('ButtonPlayExternalPlayer'),
+ id: 'externalplayer',
+ ironIcon: 'airplay'
+ });
}
if (MediaController.canQueueMediaType(mediaType, itemType)) {
- html += '' + Globalize.translate('ButtonQueue') + ' ';
+ menuItems.push({
+ name: Globalize.translate('ButtonQueue'),
+ id: 'queue',
+ ironIcon: 'playlist-add'
+ });
}
if (itemType == "Audio" || itemType == "MusicAlbum" || itemType == "MusicArtist" || itemType == "MusicGenre") {
- html += '' + Globalize.translate('ButtonInstantMix') + ' ';
+ menuItems.push({
+ name: Globalize.translate('ButtonInstantMix'),
+ id: 'instantmix',
+ ironIcon: 'shuffle'
+ });
}
if (isFolder || itemType == "MusicArtist" || itemType == "MusicGenre") {
- html += '' + Globalize.translate('ButtonShuffle') + ' ';
+ menuItems.push({
+ name: Globalize.translate('ButtonShuffle'),
+ id: 'shuffle',
+ ironIcon: 'shuffle'
+ });
}
- if (showAddToPlaylist) {
- html += '' + Globalize.translate('ButtonAddToPlaylist') + ' ';
- }
+ require(['actionsheet'], function () {
- html += ' ';
+ ActionSheetElement.show({
+ items: menuItems,
+ positionTo: positionTo,
+ callback: function (id) {
- html += '
';
+ switch (id) {
- $($.mobile.activePage).append(html);
+ case 'play':
+ MediaController.play(itemId);
+ break;
+ case 'externalplayer':
+ LibraryBrowser.playInExternalPlayer(itemId);
+ break;
+ case 'resume':
+ MediaController.play({
+ ids: [itemId],
+ startPositionTicks: resumePositionTicks
+ });
+ break;
+ case 'queue':
+ MediaController.queue(itemId);
+ break;
+ case 'instantmix':
+ MediaController.instantMix(itemId);
+ break;
+ case 'shuffle':
+ MediaController.shuffle(itemId);
+ break;
+ default:
+ break;
+ }
+ }
+ });
- $('.playFlyout').popup({ positionTo: positionTo || "window" }).trigger('create').popup("open").on("popupafterclose", function () {
-
- $(this).off("popupafterclose").remove();
-
- }).parents(".ui-popup-container");
- },
-
- closePlayMenu: function () {
- $('.playFlyout').popup("close").remove();
+ });
},
getMoreCommands: function (item, user) {
@@ -359,14 +430,14 @@
// The timeout allows the flyout to close
setTimeout(function () {
- var msg = "
" + Globalize.translate('ConfirmDeleteItem') + "
";
+ var msg = Globalize.translate('ConfirmDeleteItem');
Dashboard.confirm(msg, Globalize.translate('HeaderDeleteItem'), function (result) {
if (result) {
ApiClient.deleteItem(itemId);
- $(LibraryBrowser).trigger('itemdeleting', [itemId]);
+ Events.trigger(LibraryBrowser, 'itemdeleting', [itemId]);
}
});
@@ -375,66 +446,102 @@
showMoreCommands: function (positionTo, itemId, commands) {
- $('.playFlyout').popup("close").remove();
-
- var html = '
';
-
- html += '
';
+ var items = [];
if (commands.indexOf('addtocollection') != -1) {
- html += '' + Globalize.translate('ButtonAddToCollection') + ' ';
+ items.push({
+ name: Globalize.translate('ButtonAddToCollection'),
+ id: 'addtocollection',
+ ironIcon: 'add'
+ });
}
if (commands.indexOf('playlist') != -1) {
- html += '' + Globalize.translate('ButtonAddToPlaylist') + ' ';
+ items.push({
+ name: Globalize.translate('ButtonAddToPlaylist'),
+ id: 'playlist',
+ ironIcon: 'playlist-add'
+ });
}
if (commands.indexOf('delete') != -1) {
- html += ' ';
+ items.push({
+ name: Globalize.translate('ButtonDelete'),
+ id: 'delete',
+ ironIcon: 'delete'
+ });
}
if (commands.indexOf('download') != -1) {
- var downloadHref = ApiClient.getUrl("Items/" + itemId + "/Download", {
- api_key: ApiClient.accessToken()
+ items.push({
+ name: Globalize.translate('ButtonDownload'),
+ id: 'download',
+ ironIcon: 'file-download'
});
-
- html += ' ';
}
if (commands.indexOf('edit') != -1) {
- html += '' + Globalize.translate('ButtonEdit') + ' ';
+ items.push({
+ name: Globalize.translate('ButtonEdit'),
+ id: 'edit',
+ ironIcon: 'mode-edit'
+ });
}
if (commands.indexOf('refresh') != -1) {
- html += ' ';
+ items.push({
+ name: Globalize.translate('ButtonRefresh'),
+ id: 'refresh',
+ ironIcon: 'refresh'
+ });
}
- html += ' ';
+ require(['actionsheet'], function () {
- html += '
';
+ ActionSheetElement.show({
+ items: items,
+ positionTo: positionTo,
+ callback: function (id) {
- $($.mobile.activePage).append(html);
+ switch (id) {
- var elem = $('.playFlyout').popup({ positionTo: positionTo || "window" }).trigger('create').popup("open").on("popupafterclose", function () {
+ case 'addtocollection':
+ BoxSetEditor.showPanel([itemId]);
+ break;
+ case 'playlist':
+ PlaylistManager.showPanel([itemId]);
+ break;
+ case 'delete':
+ LibraryBrowser.deleteItem(itemId);
+ break;
+ case 'download':
+ {
+ var downloadHref = ApiClient.getUrl("Items/" + itemId + "/Download", {
+ api_key: ApiClient.accessToken()
+ });
+ window.location.href = downloadHref;
- $(this).off("popupafterclose").remove();
-
- });
-
- $('.btnMoreMenuRefresh', elem).on('click', function () {
-
- $('.playFlyout').popup('close');
-
- ApiClient.refreshItem(itemId, {
-
- Recursive: true,
- ImageRefreshMode: 'FullRefresh',
- MetadataRefreshMode: 'FullRefresh',
- ReplaceAllImages: false,
- ReplaceAllMetadata: true
- }).done(function () {
+ break;
+ }
+ case 'edit':
+ Dashboard.navigate('edititemmetadata.html?id=' + itemId);
+ break;
+ case 'refresh':
+ ApiClient.refreshItem(itemId, {
+ Recursive: true,
+ ImageRefreshMode: 'FullRefresh',
+ MetadataRefreshMode: 'FullRefresh',
+ ReplaceAllImages: false,
+ ReplaceAllMetadata: true
+ });
+ break;
+ default:
+ break;
+ }
+ }
});
+
});
},
@@ -442,18 +549,15 @@
var href = LibraryBrowser.getHrefInternal(item, context);
- if (context) {
- href += href.indexOf('?') == -1 ? "?context=" : "&context=";
- href += context;
- }
+ if (context != 'livetv') {
+ if (topParentId == null && context != 'playlists') {
+ topParentId = LibraryMenu.getTopParentId();
+ }
- if (topParentId == null && context != 'playlists') {
- topParentId = LibraryMenu.getTopParentId();
- }
-
- if (topParentId) {
- href += href.indexOf('?') == -1 ? "?topParentId=" : "&topParentId=";
- href += topParentId;
+ if (topParentId) {
+ href += href.indexOf('?') == -1 ? "?topParentId=" : "&topParentId=";
+ href += topParentId;
+ }
}
return href;
@@ -469,6 +573,8 @@
return item.url;
}
+ var contextSuffix = context ? ('&context=' + context) : '';
+
// Handle search hints
var id = item.Id || item.ItemId;
@@ -535,48 +641,48 @@
return "livetvprogram.html?id=" + id;
}
if (item.Type == "Series") {
- return "itemdetails.html?id=" + id;
+ return "itemdetails.html?id=" + id + contextSuffix;
}
if (item.Type == "Season") {
- return "itemdetails.html?id=" + id;
+ return "itemdetails.html?id=" + id + contextSuffix;
}
if (item.Type == "BoxSet") {
- return "itemdetails.html?id=" + id;
+ return "itemdetails.html?id=" + id + contextSuffix;
}
if (item.Type == "MusicAlbum") {
- return "itemdetails.html?id=" + id;
+ return "itemdetails.html?id=" + id + contextSuffix;
}
if (item.Type == "GameSystem") {
- return "itemdetails.html?id=" + id;
+ return "itemdetails.html?id=" + id + contextSuffix;
}
if (item.Type == "Genre") {
- return "itembynamedetails.html?id=" + id;
+ return "itembynamedetails.html?id=" + id + contextSuffix;
}
if (item.Type == "MusicGenre") {
- return "itembynamedetails.html?id=" + id;
+ return "itembynamedetails.html?id=" + id + contextSuffix;
}
if (item.Type == "GameGenre") {
- return "itembynamedetails.html?id=" + id;
+ return "itembynamedetails.html?id=" + id + contextSuffix;
}
if (item.Type == "Studio") {
- return "itembynamedetails.html?id=" + id;
+ return "itembynamedetails.html?id=" + id + contextSuffix;
}
if (item.Type == "Person") {
- return "itembynamedetails.html?id=" + id;
+ return "itembynamedetails.html?id=" + id + contextSuffix;
}
if (item.Type == "Recording") {
- return "livetvrecording.html?id=" + id;
+ return "livetvrecording.html?id=" + id + contextSuffix;
}
if (item.Type == "MusicArtist") {
- return "itembynamedetails.html?id=" + id;
+ return "itembynamedetails.html?id=" + id + contextSuffix;
}
if (item.IsFolder) {
return id ? "itemlist.html?parentId=" + id : "#";
}
- return "itemdetails.html?id=" + id;
+ return "itemdetails.html?id=" + id + contextSuffix;
},
getImageUrl: function (item, type, index, options) {
@@ -854,7 +960,7 @@
if (item.UserData.UnplayedItemCount) {
//html += '
' + item.UserData.UnplayedItemCount + ' ';
} else if (item.UserData.Played && item.Type != 'TvChannel') {
- html += '
';
+ html += '
';
}
}
html += '';
@@ -863,9 +969,9 @@
html += '
';
html += textlines[verticalTextLines] || LibraryBrowser.getRatingHtml(item, false);
html += ' ';
- html += '';
+ //html += '';
+ html += '';
html += '
';
html += LibraryBrowser.getUserDataIconsHtml(item);
html += ' ';
@@ -992,10 +1098,17 @@
getPostersPerRow: function (screenWidth) {
+ var cache = true;
function getValue(shape) {
-
var div = $('
').appendTo(document.body);
- var width = screenWidth / $('.cardImage', div).innerWidth();
+ var innerWidth = $('.cardImage', div).innerWidth();
+
+ if (!innerWidth || isNaN(innerWidth)) {
+ cache = false;
+ innerWidth = Math.min(400, screenWidth / 2);
+ }
+
+ var width = screenWidth / innerWidth;
div.remove();
return Math.floor(width);
}
@@ -1006,6 +1119,7 @@
var currentShape = LibraryBrowser.shapes[i];
info[currentShape] = getValue(currentShape);
}
+ info.cache = cache;
return info;
},
@@ -1025,8 +1139,11 @@
}
var result = LibraryBrowser.getPosterViewInfoInternal(screenWidth);
+ result.screenWidth = screenWidth;
- cachedResults.push(result);
+ if (result.cache) {
+ cachedResults.push(result);
+ }
return result;
},
@@ -1039,7 +1156,7 @@
result.screenWidth = screenWidth;
if (!AppInfo.hasLowImageBandwidth) {
- screenWidth *= 1.25;
+ screenWidth *= 1.2;
}
var roundTo = 100;
@@ -1057,6 +1174,8 @@
result[currentShape + 'Width'] = Math.round(shapeWidth);
}
+ result.cache = imagesPerRow.cache;
+
return result;
},
@@ -1201,7 +1320,6 @@
var html = '';
var imgUrl = null;
var icon;
- var background = null;
var width = null;
var height = null;
@@ -1209,6 +1327,8 @@
var enableImageEnhancers = options.enableImageEnhancers !== false;
+ var cssClass = "card";
+
if (options.autoThumb && item.ImageTags && item.ImageTags.Primary && item.PrimaryImageAspectRatio && item.PrimaryImageAspectRatio >= 1.5) {
width = posterWidth;
@@ -1373,7 +1493,7 @@
if (item.Name && options.showTitle) {
icon = 'fa-music';
}
- background = defaultBackground;
+ cssClass += " defaultBackground";
} else if (item.Type == "Recording" || item.Type == "Program" || item.Type == "TvChannel") {
@@ -1381,28 +1501,26 @@
icon = 'fa-folder-open';
}
- background = defaultBackground;
+ cssClass += " defaultBackground";
} else if (item.MediaType == "Video" || item.Type == "Season" || item.Type == "Series") {
if (item.Name && options.showTitle) {
icon = 'fa-video-camera';
}
- background = defaultBackground;
+ cssClass += " defaultBackground";
} else if (item.Type == "Person") {
if (item.Name && options.showTitle) {
icon = 'fa-user';
}
- background = defaultBackground;
+ cssClass += " defaultBackground";
} else {
if (item.Name && options.showTitle) {
icon = 'fa-folder-open';
}
- background = defaultBackground;
+ cssClass += " defaultBackground";
}
- var cssClass = "card";
-
cssClass += ' ' + options.shape + 'Card';
var mediaSourceCount = item.MediaSourceCount || 1;
@@ -1440,10 +1558,6 @@
style += 'background-image:url(\'' + imgUrl + '\');';
}
- if (background) {
- style += "background-color:" + background + ";";
- }
-
var imageCssClass = 'cardImage';
if (icon) {
@@ -1481,7 +1595,8 @@
anchorCssClass += ' itemWithAction';
}
- html += '
';
+ var transition = options.transition === false || !AppInfo.enableSectionTransitions ? '' : ' data-transition="slide"';
+ html += ' ';
html += '';
if (icon) {
html += '
';
@@ -1506,7 +1621,7 @@
html += '
' + mediaSourceCount + '
';
}
if (item.IsUnidentified) {
- html += '
';
+ html += '
';
}
var progressHtml = options.showProgress === false || item.IsFolder ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData));
@@ -1558,7 +1673,7 @@
if (options.cardLayout) {
html += '
';
- html += '';
+ html += '';
html += "
";
}
@@ -1785,7 +1900,7 @@
throw new Error("null item passed into getPosterViewDisplayName");
}
- var name = item.EpisodeTitle || item.Name;
+ var name = item.EpisodeTitle || item.Name || '';
if (item.Type == "TvChannel") {
@@ -1849,12 +1964,12 @@
if (item.Type == "Series" || item.Type == "Season" || item.Type == "BoxSet" || item.MediaType == "Video" || item.MediaType == "Game" || item.MediaType == "Book") {
if (item.UserData.UnplayedItemCount) {
- return '
' + item.UserData.UnplayedItemCount + '
';
+ return '
' + item.UserData.UnplayedItemCount + '
';
}
if (item.Type != 'TvChannel') {
if (item.UserData.PlayedPercentage && item.UserData.PlayedPercentage >= 100 || (item.UserData && item.UserData.Played)) {
- return '
';
+ return '
';
}
}
}
@@ -1865,7 +1980,7 @@
getGroupCountIndicator: function (item) {
if (item.ChildCount) {
- return '
' + item.ChildCount + '
';
+ return '
' + item.ChildCount + '
';
}
return '';
@@ -2055,7 +2170,9 @@
html = Globalize.translate('ValueLinks', html);
- $(linksElem).html(html).trigger('create');
+ linksElem.innerHTML = html;
+ $(linksElem).trigger('create');
+ $(linksElem).show();
} else {
$(linksElem).hide();
@@ -2075,7 +2192,7 @@
if (limit && options.updatePageSizeSetting !== false) {
try {
- store.setItem(options.pageSizeKey || pageSizeKey, limit);
+ appStorage.setItem(options.pageSizeKey || pageSizeKey, limit);
} catch (e) {
}
@@ -2103,25 +2220,27 @@
if (showControls) {
- html += '
' + Globalize.translate('ButtonPreviousPage') + ' ';
-
- html += '
= totalRecordCount ? 'disabled' : '') + '>' + Globalize.translate('ButtonNextPage') + ' ';
+ html += '
';
+ html += '
= totalRecordCount ? 'disabled' : '') + '> ';
}
html += (options.additionalButtonsHtml || '');
if (options.addSelectionButton) {
- html += '
' + Globalize.translate('ButtonSelect') + ' ';
+ html += '
';
}
if (options.viewButton) {
- html += '
' + Globalize.translate('ButtonView') + ' ';
+ //html += '
';
+ html += '
';
}
html += '
';
- if (showControls && options.showLimit !== false) {
+ if (showControls && options.showLimit) {
+
+ require(['jqmicons']);
var id = "selectPageSize";
var pageSizes = options.pageSizes || LibraryBrowser.getDefaultPageSizeSelections();
@@ -2147,72 +2266,6 @@
return html;
},
- getPagingHtml: function (query, totalRecordCount, updatePageSizeSetting, pageSizes, showLimit) {
-
- if (query.Limit && updatePageSizeSetting !== false) {
- try {
- store.setItem(pageSizeKey, query.Limit);
- } catch (e) {
-
- }
- }
-
- var html = '';
-
- var recordsEnd = Math.min(query.StartIndex + query.Limit, totalRecordCount);
-
- // 20 is the minimum page size
- var showControls = totalRecordCount > 20 || query.Limit < totalRecordCount;
-
- html += '';
-
- html += '
';
-
- var startAtDisplay = totalRecordCount ? query.StartIndex + 1 : 0;
- html += startAtDisplay + '-' + recordsEnd + ' of ' + totalRecordCount;
-
- html += ' ';
-
- if (showControls) {
-
- html += '
';
- html += '' + Globalize.translate('ButtonPreviousPage') + ' ';
-
- html += '= totalRecordCount ? 'disabled' : '') + '>' + Globalize.translate('ButtonNextPage') + ' ';
- html += '
';
-
- if (showLimit !== false) {
- var id = "selectPageSize" + new Date().getTime();
-
- var options = '';
-
- function getOption(val) {
-
- if (query.Limit == val) {
-
- return '
' + val + ' ';
-
- } else {
- return '
' + val + ' ';
- }
- }
-
- pageSizes = pageSizes || [20, 50, 100, 200, 300, 400, 500];
-
- for (var j = 0, length = pageSizes.length; j < length; j++) {
- options += getOption(pageSizes[j]);
- }
-
- // Add styles to defeat jquery mobile
- html += '
' + Globalize.translate('LabelLimit') + ' ' + options + '
';
- }
- }
-
- html += '
';
-
- return html;
- },
-
getRatingHtml: function (item, metascore) {
var html = "";
@@ -2271,13 +2324,14 @@
getUserDataButtonHtml: function (method, itemId, btnCssClass, icon, tooltip) {
+ return ' ';
btnCssClass += " imageButton";
return ' ';
},
- getUserDataIconsHtml: function (item) {
+ getUserDataIconsHtml: function (item, includePlayed) {
var html = '';
@@ -2286,13 +2340,15 @@
var itemId = item.Id;
var type = item.Type;
- var tooltipPlayed = Globalize.translate('TooltipPlayed');
+ if (includePlayed !== false) {
+ var tooltipPlayed = Globalize.translate('TooltipPlayed');
- if ((item.MediaType || item.IsFolder) && type != "TvChannel" && type != "MusicArtist" && item.MediaType != "Audio") {
- if (userData.Played) {
- html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating btnUserItemRating', 'fa-check', tooltipPlayed);
- } else {
- html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating btnUserItemRatingOff', 'fa-check', tooltipPlayed);
+ if ((item.MediaType || item.IsFolder) && type != "TvChannel" && type != "MusicArtist" && item.MediaType != "Audio") {
+ if (userData.Played) {
+ html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating btnUserItemRatingOn', 'check', tooltipPlayed);
+ } else {
+ html += LibraryBrowser.getUserDataButtonHtml('markPlayed', itemId, 'btnUserItemRating', 'check', tooltipPlayed);
+ }
}
}
@@ -2300,24 +2356,24 @@
var tooltipDislike = Globalize.translate('TooltipDislike');
if (typeof userData.Likes == "undefined") {
- html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating btnUserItemRatingOff', 'fa-thumbs-down', tooltipDislike);
- html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating btnUserItemRatingOff', 'fa-thumbs-up', tooltipLike);
+ html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating', 'thumb-down', tooltipDislike);
+ html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating', 'thumb-up', tooltipLike);
}
else if (userData.Likes) {
- html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating btnUserItemRatingOff', 'fa-thumbs-down', tooltipDislike);
- html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating', 'fa-thumbs-up', tooltipLike);
+ html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating', 'thumb-down', tooltipDislike);
+ html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating btnUserItemRatingOn', 'thumb-up', tooltipLike);
}
else {
- html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating', 'fa-thumbs-down', tooltipDislike);
- html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating btnUserItemRatingOff', 'fa-thumbs-up', tooltipLike);
+ html += LibraryBrowser.getUserDataButtonHtml('markDislike', itemId, 'btnUserItemRating btnUserItemRatingOn', 'thumb-down', tooltipDislike);
+ html += LibraryBrowser.getUserDataButtonHtml('markLike', itemId, 'btnUserItemRating', 'thumb-up', tooltipLike);
}
var tooltipFavorite = Globalize.translate('TooltipFavorite');
if (userData.IsFavorite) {
- html += LibraryBrowser.getUserDataButtonHtml('markFavorite', itemId, 'btnUserItemRating', 'fa-heart', tooltipFavorite);
+ html += LibraryBrowser.getUserDataButtonHtml('markFavorite', itemId, 'btnUserItemRating btnUserItemRatingOn', 'favorite', tooltipFavorite);
} else {
- html += LibraryBrowser.getUserDataButtonHtml('markFavorite', itemId, 'btnUserItemRating btnUserItemRatingOff', 'fa-heart', tooltipFavorite);
+ html += LibraryBrowser.getUserDataButtonHtml('markFavorite', itemId, 'btnUserItemRating', 'favorite', tooltipFavorite);
}
return html;
@@ -2327,16 +2383,14 @@
var id = link.getAttribute('data-itemid');
- var $link = $(link);
-
- var markAsPlayed = $link.hasClass('btnUserItemRatingOff');
+ var markAsPlayed = !link.classList.contains('btnUserItemRatingOn');
if (markAsPlayed) {
ApiClient.markPlayed(Dashboard.getCurrentUserId(), id);
- $link.removeClass('btnUserItemRatingOff');
+ link.classList.add('btnUserItemRatingOn');
} else {
ApiClient.markUnplayed(Dashboard.getCurrentUserId(), id);
- $link.addClass('btnUserItemRatingOff');
+ link.classList.remove('btnUserItemRatingOn');
}
},
@@ -2346,14 +2400,14 @@
var $link = $(link);
- var markAsFavorite = $link.hasClass('btnUserItemRatingOff');
+ var markAsFavorite = !$link.hasClass('btnUserItemRatingOn');
ApiClient.updateFavoriteStatus(Dashboard.getCurrentUserId(), id, markAsFavorite);
if (markAsFavorite) {
- $link.removeClass('btnUserItemRatingOff');
+ $link.addClass('btnUserItemRatingOn');
} else {
- $link.addClass('btnUserItemRatingOff');
+ $link.removeClass('btnUserItemRatingOn');
}
},
@@ -2363,20 +2417,20 @@
var $link = $(link);
- if ($link.hasClass('btnUserItemRatingOff')) {
+ if (!$link.hasClass('btnUserItemRatingOn')) {
ApiClient.updateUserItemRating(Dashboard.getCurrentUserId(), id, true);
- $link.removeClass('btnUserItemRatingOff');
+ $link.addClass('btnUserItemRatingOn');
} else {
ApiClient.clearUserItemRating(Dashboard.getCurrentUserId(), id);
- $link.addClass('btnUserItemRatingOff');
+ $link.removeClass('btnUserItemRatingOn');
}
- $link.prev().addClass('btnUserItemRatingOff');
+ $link.prev().removeClass('btnUserItemRatingOn');
},
markDislike: function (link) {
@@ -2385,20 +2439,20 @@
var $link = $(link);
- if ($link.hasClass('btnUserItemRatingOff')) {
+ if (!$link.hasClass('btnUserItemRatingOn')) {
ApiClient.updateUserItemRating(Dashboard.getCurrentUserId(), id, false);
- $link.removeClass('btnUserItemRatingOff');
+ $link.addClass('btnUserItemRatingOn');
} else {
ApiClient.clearUserItemRating(Dashboard.getCurrentUserId(), id);
- $link.addClass('btnUserItemRatingOff');
+ $link.removeClass('btnUserItemRatingOn');
}
- $link.next().addClass('btnUserItemRatingOff');
+ $link.next().removeClass('btnUserItemRatingOn');
},
getDetailImageHtml: function (item, href, preferThumb) {
@@ -2640,40 +2694,51 @@
html += " ";
- elem.html(html);
+ elem.innerHTML = html;
- var page = $(elem).parents('.page');
+ function addClass(elems, name) {
+ for (var i = 0, length = elems.length; i < length; i++) {
+ elems[i].classList.add(name);
+ }
+ }
+ function removeClass(elems, name) {
+ for (var i = 0, length = elems.length; i < length; i++) {
+ elems[i].classList.remove(name);
+ }
+ }
- var detailContentEffectedByImage = $('.detailContentEffectedByImage', page);
+ var page = $(elem).parents('.page')[0];
+
+ var detailContentEffectedByImage = page.querySelectorAll('.detailContentEffectedByImage');
if (shape == 'thumb') {
- detailContentEffectedByImage.addClass('detailContentEffectedByThumbImage');
- detailContentEffectedByImage.removeClass('detailContentEffectedBySquareImage');
- detailContentEffectedByImage.removeClass('detailContentEffectedByPortraitImage');
+ addClass(detailContentEffectedByImage, 'detailContentEffectedByThumbImage');
+ removeClass(detailContentEffectedByImage, 'detailContentEffectedBySquareImage');
+ removeClass(detailContentEffectedByImage, 'detailContentEffectedByPortraitImage');
- elem.addClass('thumbDetailImageContainer');
- elem.removeClass('portraitDetailImageContainer');
- elem.removeClass('squareDetailImageContainer');
+ elem.classList.add('thumbDetailImageContainer');
+ elem.classList.remove('portraitDetailImageContainer');
+ elem.classList.remove('squareDetailImageContainer');
}
else if (shape == 'square') {
- detailContentEffectedByImage.removeClass('detailContentEffectedByThumbImage');
- detailContentEffectedByImage.addClass('detailContentEffectedBySquareImage');
- detailContentEffectedByImage.removeClass('detailContentEffectedByPortraitImage');
+ removeClass(detailContentEffectedByImage, 'detailContentEffectedByThumbImage');
+ removeClass(detailContentEffectedByImage, 'detailContentEffectedByPortraitImage');
+ addClass(detailContentEffectedByImage, 'detailContentEffectedBySquareImage');
- elem.removeClass('thumbDetailImageContainer');
- elem.removeClass('portraitDetailImageContainer');
- elem.addClass('squareDetailImageContainer');
+ elem.classList.remove('thumbDetailImageContainer');
+ elem.classList.remove('portraitDetailImageContainer');
+ elem.classList.add('squareDetailImageContainer');
} else {
- detailContentEffectedByImage.removeClass('detailContentEffectedByThumbImage');
- detailContentEffectedByImage.removeClass('detailContentEffectedBySquareImage');
- detailContentEffectedByImage.addClass('detailContentEffectedByPortraitImage');
+ removeClass(detailContentEffectedByImage, 'detailContentEffectedByThumbImage');
+ removeClass(detailContentEffectedByImage, 'detailContentEffectedBySquareImage');
+ addClass(detailContentEffectedByImage, 'detailContentEffectedByPortraitImage');
- elem.removeClass('thumbDetailImageContainer');
- elem.addClass('portraitDetailImageContainer');
- elem.removeClass('squareDetailImageContainer');
+ elem.classList.remove('thumbDetailImageContainer');
+ elem.classList.add('portraitDetailImageContainer');
+ elem.classList.remove('squareDetailImageContainer');
}
- elem.lazyChildren();
+ ImageLoader.lazyChildren(elem);
},
getDisplayTime: function (date) {
@@ -2742,7 +2807,7 @@
miscInfo.push(text);
}
catch (e) {
- console.log("Error parsing date: " + item.PremiereDate);
+ Logger.log("Error parsing date: " + item.PremiereDate);
}
}
}
@@ -2761,7 +2826,7 @@
}
}
catch (e) {
- console.log("Error parsing date: " + item.PremiereDate);
+ Logger.log("Error parsing date: " + item.PremiereDate);
}
}
@@ -2787,7 +2852,7 @@
}
catch (e) {
- console.log("Error parsing date: " + item.EndDate);
+ Logger.log("Error parsing date: " + item.EndDate);
}
}
@@ -2808,7 +2873,7 @@
miscInfo.push(text);
}
catch (e) {
- console.log("Error parsing date: " + item.PremiereDate);
+ Logger.log("Error parsing date: " + item.PremiereDate);
}
}
}
@@ -2849,16 +2914,16 @@
var overview = item.Overview || '';
- elem.html(overview).trigger('create');
+ elem.innerHTML = overview;
$('a', elem).each(function () {
- $(this).attr("target", "_blank");
+ this.setAttribute("target", "_blank");
});
if (overview) {
- elem.removeClass('empty');
+ elem.classList.remove('empty');
} else {
- elem.addClass('empty');
+ elem.classList.add('empty');
}
},
@@ -2966,7 +3031,7 @@
renderDetailPageBackdrop: function (page, item) {
- var screenWidth = Math.max(screen.height, screen.width);
+ var screenWidth = screen.availWidth;
var imgUrl;
@@ -2979,7 +3044,7 @@
tag: item.BackdropImageTags[0]
});
- $('#itemBackdrop', page).removeClass('noBackdrop').lazyImage(imgUrl);
+ ImageLoader.lazyImage($('#itemBackdrop', page).removeClass('noBackdrop')[0], imgUrl);
}
else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) {
@@ -2990,7 +3055,7 @@
maxWidth: screenWidth
});
- $('#itemBackdrop', page).removeClass('noBackdrop').lazyImage(imgUrl);
+ ImageLoader.lazyImage($('#itemBackdrop', page).removeClass('noBackdrop')[0], imgUrl);
}
else {
@@ -3000,4 +3065,4 @@
}
};
-})(window, document, jQuery, screen, window.appStorage);
\ No newline at end of file
+})(window, document, jQuery, screen);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index a99f163c2e..ad9937c23a 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -9,23 +9,19 @@
showOverlayTimeout = null;
}
- $('.cardOverlayTarget:visible', this).each(function () {
+ var elem = this.querySelector('.cardOverlayTarget');
- var elem = this;
-
- $(this).animate({ "height": "0" }, "fast", function () {
-
- $(elem).hide();
+ if ($(elem).is(':visible')) {
+ require(["jquery", "velocity"], function ($, Velocity) {
+ Velocity.animate(elem, { "height": "0" },
+ {
+ complete: function () {
+ $(elem).hide();
+ }
+ });
});
-
- });
-
- $('.cardOverlayTarget:visible', this).stop().animate({ "height": "0" }, function () {
-
- $(this).hide();
-
- });
+ }
}
function getOverlayHtml(item, currentUser, card, commands) {
@@ -119,16 +115,16 @@
var resumePosition = (item.UserData || {}).PlaybackPositionTicks || 0;
- html += '
' + Globalize.translate('ButtonPlay') + ' ';
+ html += '
';
buttonCount++;
}
if (commands.indexOf('trailer') != -1) {
- html += '
' + Globalize.translate('ButtonPlayTrailer') + ' ';
+ html += '
';
buttonCount++;
}
- html += '
' + Globalize.translate('ButtonMore') + ' ';
+ html += '
';
buttonCount++;
html += '
';
@@ -138,12 +134,6 @@
return html;
}
- function closeContextMenu() {
-
- // Used by the tab menu, not the slide up
- $('.tapHoldMenu').popup('close');
- }
-
function onTrailerButtonClick() {
var id = this.getAttribute('data-itemid');
@@ -152,8 +142,6 @@
MediaController.play({ items: trailers });
});
- closeContextMenu();
-
return false;
}
@@ -165,8 +153,6 @@
var mediaType = this.getAttribute('data-mediatype');
var resumePosition = parseInt(this.getAttribute('data-resumeposition'));
- closeContextMenu();
-
LibraryBrowser.showPlayMenu(this, id, type, isFolder, mediaType, resumePosition);
return false;
@@ -176,8 +162,6 @@
var card = $(this).parents('.card')[0];
- closeContextMenu();
-
showContextMenu(card, {
showPlayOptions: false
});
@@ -185,169 +169,6 @@
return false;
}
- function onAddToCollectionButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- closeContextMenu();
-
- BoxSetEditor.showPanel([id]);
-
- return false;
- }
-
- function onAddToPlaylistButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- closeContextMenu();
-
- PlaylistManager.showPanel([id]);
-
- return false;
- }
-
- function onShuffleButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- MediaController.shuffle(id);
-
- closeContextMenu();
-
- return false;
- }
-
- function onInstantMixButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- MediaController.instantMix(id);
-
- closeContextMenu();
-
- return false;
- }
-
- function onQueueButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- MediaController.queue(id);
-
- closeContextMenu();
-
- return false;
- }
-
- function onPlayButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- MediaController.play(id);
-
- closeContextMenu();
-
- return false;
- }
-
- function onDeleteButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- closeContextMenu();
-
- LibraryBrowser.deleteItem(id);
-
- return false;
- }
-
- function onSyncButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- closeContextMenu();
-
- SyncManager.showMenu({
- items: [
- {
- Id: id
- }]
- });
-
- return false;
- }
-
- function onExternalPlayerButtonClick() {
-
- closeContextMenu();
-
- var id = this.getAttribute('data-itemid');
-
- LibraryBrowser.playInExternalPlayer(id);
-
- return false;
- }
-
- function onPlayAllFromHereButtonClick() {
-
- var index = this.getAttribute('data-index');
-
- var page = $(this).parents('.page');
-
- var itemsContainer = $('.hasContextMenu', page).parents('.itemsContainer');
-
- closeContextMenu();
-
- itemsContainer.trigger('playallfromhere', [index]);
-
- return false;
- }
-
- function onQueueAllFromHereButtonClick() {
-
- var index = this.getAttribute('data-index');
-
- var page = $(this).parents('.page');
-
- var itemsContainer = $('.hasContextMenu', page).parents('.itemsContainer');
-
- closeContextMenu();
-
- itemsContainer.trigger('queueallfromhere', [index]);
-
- return false;
- }
-
- function onRemoveFromPlaylistButtonClick() {
-
- var playlistItemId = this.getAttribute('data-playlistitemid');
-
- var page = $(this).parents('.page');
-
- var itemsContainer = $('.hasContextMenu', page).parents('.itemsContainer');
-
- itemsContainer.trigger('removefromplaylist', [playlistItemId]);
-
- closeContextMenu();
-
- return false;
- }
-
- function onResumeButtonClick() {
-
- var id = this.getAttribute('data-itemid');
-
- MediaController.play({
- ids: [id],
- startPositionTicks: parseInt(this.getAttribute('data-ticks'))
- });
-
- closeContextMenu();
-
- return false;
- }
-
function onCardTapHold(e) {
showContextMenu(this, {});
@@ -358,11 +179,9 @@
function showContextMenu(card, options) {
- closeContextMenu();
-
var displayContextItem = card;
- if ($(card).hasClass('listviewMenuButton')) {
+ if (card.classList.contains('listviewMenuButton')) {
card = $(card).parents('.listItem,.card')[0];
}
@@ -379,116 +198,263 @@
var albumid = card.getAttribute('data-albumid');
var artistid = card.getAttribute('data-artistid');
- $(card).addClass('hasContextMenu');
-
Dashboard.getCurrentUser().done(function (user) {
- var html = '';
+ if (!href) {
+ var links = card.getElementsByTagName('a');
+ if (links.length) {
+ href = links[0].href;
+ }
+ }
- $($.mobile.activePage).append(html);
+ require(['actionsheet'], function () {
- var elem = $('.tapHoldMenu').popup({ positionTo: displayContextItem }).trigger('create').popup("open").on("popupafterclose", function () {
+ ActionSheetElement.show({
+ items: items,
+ positionTo: displayContextItem,
+ callback: function (id) {
+
+ switch (id) {
+
+ case 'addtocollection':
+ BoxSetEditor.showPanel([itemId]);
+ break;
+ case 'playlist':
+ PlaylistManager.showPanel([itemId]);
+ break;
+ case 'delete':
+ LibraryBrowser.deleteItem(itemId);
+ break;
+ case 'download':
+ {
+ var downloadHref = ApiClient.getUrl("Items/" + itemId + "/Download", {
+ api_key: ApiClient.accessToken()
+ });
+ window.location.href = downloadHref;
+
+ break;
+ }
+ case 'edit':
+ Dashboard.navigate('edititemmetadata.html?id=' + itemId);
+ break;
+ case 'refresh':
+ ApiClient.refreshItem(itemId, {
+
+ Recursive: true,
+ ImageRefreshMode: 'FullRefresh',
+ MetadataRefreshMode: 'FullRefresh',
+ ReplaceAllImages: false,
+ ReplaceAllMetadata: true
+ });
+ break;
+ case 'instantmix':
+ MediaController.instantMix(itemId);
+ break;
+ case 'shuffle':
+ MediaController.shuffle(itemId);
+ break;
+ case 'open':
+ Dashboard.navigate(href);
+ break;
+ case 'album':
+ Dashboard.navigate('itemdetails.html?id=' + albumid);
+ break;
+ case 'artist':
+ Dashboard.navigate('itembynamedetails.html?context=music&id=' + artistid);
+ break;
+ case 'play':
+ MediaController.play(itemId);
+ break;
+ case 'playallfromhere':
+ $(card).parents('.itemsContainer').trigger('playallfromhere', [index]);
+ break;
+ case 'queue':
+ MediaController.queue(itemId);
+ break;
+ case 'trailer':
+ ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), itemId).done(function (trailers) {
+ MediaController.play({ items: trailers });
+ });
+ break;
+ case 'resume':
+ MediaController.play({
+ ids: [itemId],
+ startPositionTicks: playbackPositionTicks
+ });
+ break;
+ case 'queueallfromhere':
+ $(card).parents('.itemsContainer').trigger('queueallfromhere', [index]);
+ break;
+ case 'sync':
+ SyncManager.showMenu({
+ items: [
+ {
+ Id: itemId
+ }]
+ });
+ break;
+ case 'externalplayer':
+ LibraryBrowser.playInExternalPlayer(itemId);
+ break;
+ case 'removefromplaylist':
+ $(card).parents('.itemsContainer').trigger('removefromplaylist', [playlistItemId]);
+ break;
+ default:
+ break;
+ }
+ }
+ });
- $(this).off("popupafterclose").remove();
- $(card).removeClass('hasContextMenu');
});
-
- $('.btnPlay', elem).on('click', onPlayButtonClick);
- $('.btnResume', elem).on('click', onResumeButtonClick);
- $('.btnQueue', elem).on('click', onQueueButtonClick);
- $('.btnInstantMix', elem).on('click', onInstantMixButtonClick);
- $('.btnShuffle', elem).on('click', onShuffleButtonClick);
- $('.btnPlayTrailer', elem).on('click', onTrailerButtonClick);
- $('.btnAddToPlaylist', elem).on('click', onAddToPlaylistButtonClick);
- $('.btnRemoveFromPlaylist', elem).on('click', onRemoveFromPlaylistButtonClick);
- $('.btnPlayAllFromHere', elem).on('click', onPlayAllFromHereButtonClick);
- $('.btnQueueAllFromHere', elem).on('click', onQueueAllFromHereButtonClick);
- $('.btnExternalPlayer', elem).on('click', onExternalPlayerButtonClick);
- $('.btnDelete', elem).on('click', onDeleteButtonClick);
- $('.btnSync', elem).on('click', onSyncButtonClick);
- $('.btnAddToCollection', elem).on('click', onAddToCollectionButtonClick);
});
}
@@ -506,8 +472,6 @@
var itemId = card.getAttribute('data-itemid');
var context = card.getAttribute('data-context');
- $(card).addClass('hasContextMenu');
-
var userId = Dashboard.getCurrentUserId();
var options = {
@@ -518,12 +482,12 @@
GroupItems: false
};
- var target = $(e.target);
- if (target.is('a') || target.is('button')) {
+ var target = e.target;
+ if (target.tagName == 'A' || target.tagName == 'BUTTON') {
return;
}
- var buttonParents = target.parents('a:not(.card,.cardContent),button:not(.card,.cardContent)');
+ var buttonParents = $(target).parents('a:not(.card,.cardContent),button:not(.card,.cardContent)');
if (buttonParents.length) {
return;
}
@@ -554,7 +518,7 @@
$('.detailsMenu').remove();
- var html = '';
}
- $('.channelList', page).html(html);
+ page.querySelector('.channelList').innerHTML = html;
}
function renderGuide(page, date, channels, programs) {
@@ -309,7 +314,7 @@
var startDate = date;
var endDate = new Date(startDate.getTime() + msPerDay);
- $('.timeslotHeaders', page).html(getTimeslotHeadersHtml(startDate, endDate));
+ page.querySelector('.timeslotHeaders').innerHTML = getTimeslotHeadersHtml(startDate, endDate);
renderPrograms(page, date, channels, programs);
}
@@ -319,9 +324,8 @@
if (!headersScrolling) {
gridScrolling = true;
- var grid = $(elem);
- $('.timeslotHeaders', page).scrollLeft(grid.scrollLeft());
+ $(page.querySelector('.timeslotHeaders')).scrollLeft($(elem).scrollLeft());
gridScrolling = false;
}
}
@@ -330,8 +334,7 @@
if (!gridScrolling) {
headersScrolling = true;
- elem = $(elem);
- $('.programGrid', page).scrollLeft(elem.scrollLeft());
+ $(page.querySelector('.programGrid')).scrollLeft($(elem).scrollLeft());
headersScrolling = false;
}
}
@@ -344,9 +347,11 @@
var text = LibraryBrowser.getFutureDateText(date);
text = '' + text.replace(' ', ' ');
- $('.currentDate', page).html(text);
+ page.querySelector('.currentDate').innerHTML = text;
}
+ var dateOptions = [];
+
function setDateRange(page, guideInfo) {
var today = new Date();
@@ -364,28 +369,24 @@
start = new Date(Math.max(today, start));
- var html = '';
+ dateOptions = [];
while (start <= end) {
-
- html += '' + LibraryBrowser.getFutureDateText(start) + ' ';
+ dateOptions.push({
+ name: LibraryBrowser.getFutureDateText(start),
+ id: start.getTime(),
+ ironIcon: 'today'
+ });
start.setDate(start.getDate() + 1);
start.setHours(0, 0, 0, 0);
}
- var elem = $('#selectDate', page).html(html).selectmenu('refresh');
-
- if (currentDate) {
- elem.val(currentDate.getTime()).selectmenu('refresh');
- }
-
- var val = elem.val();
var date = new Date();
- if (val) {
- date.setTime(parseInt(val));
+ if (currentDate) {
+ date.setTime(currentDate.getTime());
}
changeDate(page, date);
@@ -403,14 +404,16 @@
function reloadPage(page) {
- showLoadingMessage(page);
-
$('.guideRequiresUnlock', page).hide();
RegistrationServices.validateFeature('livetv').done(function () {
+ Dashboard.showModalLoadingMsg();
+
reloadPageAfterValidation(page, 1000);
}).fail(function () {
+ Dashboard.showModalLoadingMsg();
+
var limit = 5;
$('.guideRequiresUnlock', page).show();
$('.unlockText', page).html(Globalize.translate('MessageLiveTvGuideRequiresUnlock', limit));
@@ -419,35 +422,41 @@
});
}
+ function selectDate(page) {
+
+ require(['actionsheet'], function () {
+
+ ActionSheetElement.show({
+ items: dateOptions,
+ showCancel: true,
+ title: Globalize.translate('HeaderSelectDate'),
+ callback: function (id) {
+
+ var date = new Date();
+ date.setTime(parseInt(id));
+ changeDate(page, date);
+ }
+ });
+
+ });
+ }
+
$(document).on('pageinitdepends', "#liveTvGuidePage", function () {
var page = this;
- $('.programGrid', page).on('scroll', function () {
+ Events.on(page.querySelector('.programGrid'), 'scroll', function () {
onProgramGridScroll(page, this);
});
- $('#selectDate', page).on('change', function () {
-
- var date = new Date();
- date.setTime(parseInt(this.value));
-
- $('#popupConfig', page).popup('close');
-
- setTimeout(function () {
-
- changeDate(page, date);
- }, 300);
- });
-
if ($.browser.mobile) {
- $('.tvGuide', page).addClass('mobileGuide');
+ page.querySelector('.tvGuide').classList.add('mobileGuide');
} else {
- $('.tvGuide', page).removeClass('mobileGuide');
+ page.querySelector('.tvGuide').classList.remove('mobileGuide');
- $('.timeslotHeaders', page).on('scroll', function () {
+ Events.on(page.querySelector('.timeslotHeaders'), 'scroll', function () {
onTimeslotHeadersScroll(page, this);
});
@@ -456,14 +465,10 @@
if (AppInfo.enableHeadRoom) {
requirejs(["thirdparty/headroom"], function () {
- $('.tvGuideHeader', page).each(function () {
-
- // construct an instance of Headroom, passing the element
- var headroom = new Headroom(this);
- // initialise
- headroom.init();
-
- });
+ // construct an instance of Headroom, passing the element
+ var headroom = new Headroom(page.querySelector('.tvGuideHeader'));
+ // initialise
+ headroom.init();
});
}
@@ -472,10 +477,18 @@
reloadPage(page);
});
- }).on('pageshowready', "#liveTvGuidePage", function () {
+ $('.btnSelectDate', page).on('click', function () {
+
+ selectDate(page);
+ });
+
+ }).on('pagebeforeshowready', "#liveTvGuidePage", function () {
var page = this;
- reloadPage(page);
+
+ if (LibraryBrowser.needsRefresh(page)) {
+ reloadPage(page);
+ }
});
})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/livetvitems.js b/dashboard-ui/scripts/livetvitems.js
index 83e5388353..2a55572d72 100644
--- a/dashboard-ui/scripts/livetvitems.js
+++ b/dashboard-ui/scripts/livetvitems.js
@@ -31,7 +31,7 @@
ApiClient.getLiveTvPrograms(query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -42,7 +42,7 @@
showLimit: false
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
@@ -72,9 +72,9 @@
});
}
- var elem = $('.itemsContainer', page).html(html).lazyChildren();
-
- $(pagingHtml).appendTo(elem).trigger('create');
+ var elem = page.querySelector('.itemsContainer');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -137,7 +137,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#liveTvItemsPage", function () {
+ }).on('pagebeforeshowready', "#liveTvItemsPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/livetvnewrecording.js b/dashboard-ui/scripts/livetvnewrecording.js
index 692a3d14fa..d9379c3b38 100644
--- a/dashboard-ui/scripts/livetvnewrecording.js
+++ b/dashboard-ui/scripts/livetvnewrecording.js
@@ -15,7 +15,7 @@
$('.itemCommunityRating', page).html(LibraryBrowser.getRatingHtml(program));
LibraryBrowser.renderGenres($('.itemGenres', page), program, context);
- LibraryBrowser.renderOverview($('.itemOverview', page), program);
+ LibraryBrowser.renderOverview(page.querySelector('.itemOverview'), program);
$('.itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(program));
@@ -175,7 +175,7 @@
reload(page);
- }).on('pagehide', "#liveTvNewRecordingPage", function () {
+ }).on('pagebeforehide', "#liveTvNewRecordingPage", function () {
currentProgram = null;
diff --git a/dashboard-ui/scripts/livetvprogram.js b/dashboard-ui/scripts/livetvprogram.js
index 40483d1876..dcae97c64a 100644
--- a/dashboard-ui/scripts/livetvprogram.js
+++ b/dashboard-ui/scripts/livetvprogram.js
@@ -45,12 +45,12 @@
$('.userDataIcons', page).html(LibraryBrowser.getUserDataIconsHtml(item));
LibraryBrowser.renderGenres($('.itemGenres', page), item, context);
- LibraryBrowser.renderOverview($('.itemOverview', page), item);
+ LibraryBrowser.renderOverview(page.querySelector('.itemOverview'), item);
$('.itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
LiveTvHelpers.renderMiscProgramInfo($('.miscTvProgramInfo', page), item);
- $(page).trigger('displayingitem', [{
+ Events.trigger(page, 'displayingitem', [{
item: item,
context: 'livetv'
@@ -98,7 +98,7 @@
var page = this;
- $('#btnRecord', page).on('click', function() {
+ $('.btnRecord', page).on('click', function() {
var id = getParameterByName('id');
@@ -106,28 +106,28 @@
});
- $('#btnPlay', page).on('click', function () {
+ $('.btnPlay', page).on('click', function () {
ApiClient.getLiveTvChannel(currentItem.ChannelId, Dashboard.getCurrentUserId()).done(function (channel) {
var userdata = channel.UserData || {};
- LibraryBrowser.showPlayMenu(this, channel.Id, channel.Type, false, channel.MediaType, userdata.PlaybackPositionTicks);
+ LibraryBrowser.showPlayMenu(null, channel.Id, channel.Type, false, channel.MediaType, userdata.PlaybackPositionTicks);
});
});
- $('#btnCancelRecording', page).on('click', function () {
+ $('.btnCancelRecording', page).on('click', function () {
deleteTimer(page, currentItem.TimerId);
});
- }).on('pageshowready', "#liveTvProgramPage", function () {
+ }).on('pagebeforeshowready', "#liveTvProgramPage", function () {
var page = this;
reload(page);
- }).on('pagehide', "#liveTvProgramPage", function () {
+ }).on('pagebeforehide', "#liveTvProgramPage", function () {
currentItem = null;
});
diff --git a/dashboard-ui/scripts/livetvrecording.js b/dashboard-ui/scripts/livetvrecording.js
index 29aecfb05a..6fe239556e 100644
--- a/dashboard-ui/scripts/livetvrecording.js
+++ b/dashboard-ui/scripts/livetvrecording.js
@@ -27,7 +27,7 @@
var mediaType = currentItem.MediaType;
- LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, false, mediaType, userdata.PlaybackPositionTicks);
+ LibraryBrowser.showPlayMenu(null, currentItem.Id, currentItem.Type, false, mediaType, userdata.PlaybackPositionTicks);
}
function renderRecording(page, item) {
@@ -50,7 +50,7 @@
$('.userDataIcons', page).html(LibraryBrowser.getUserDataIconsHtml(item));
LibraryBrowser.renderGenres($('.itemGenres', page), item, context);
- LibraryBrowser.renderOverview($('.itemOverview', page), item);
+ LibraryBrowser.renderOverview(page.querySelector('.itemOverview'), item);
$('.itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
LiveTvHelpers.renderMiscProgramInfo($('.miscTvProgramInfo', page), item);
@@ -106,8 +106,8 @@
var page = this;
- $('#btnDelete', page).on('click', deleteRecording);
- $('#btnPlay', page).on('click', play);
+ $('.btnDelete', page).on('click', deleteRecording);
+ $('.btnPlay', page).on('click', play);
$('.btnSync', page).on('click', function () {
@@ -122,7 +122,7 @@
reload(page);
- }).on('pagehide', "#liveTvRecordingPage", function () {
+ }).on('pagebeforehide', "#liveTvRecordingPage", function () {
currentItem = null;
});
diff --git a/dashboard-ui/scripts/livetvrecordinglist.js b/dashboard-ui/scripts/livetvrecordinglist.js
index 5d47f6dfcd..04c3e74db1 100644
--- a/dashboard-ui/scripts/livetvrecordinglist.js
+++ b/dashboard-ui/scripts/livetvrecordinglist.js
@@ -14,11 +14,17 @@
ApiClient.getLiveTvRecordings(query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
- $('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
+ $('.listTopPaging', page).html(LibraryBrowser.getQueryPagingHtml({
+ startIndex: query.StartIndex,
+ limit: query.Limit,
+ totalRecordCount: result.TotalRecordCount,
+ showLimit: false,
+ updatePageSizeSetting: false
+ }));
updateFilterControls();
@@ -35,9 +41,17 @@
});
- html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
+ html += LibraryBrowser.getQueryPagingHtml({
+ startIndex: query.StartIndex,
+ limit: query.Limit,
+ totalRecordCount: result.TotalRecordCount,
+ showLimit: false,
+ updatePageSizeSetting: false
+ });
- $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -72,10 +86,10 @@
var page = this;
- }).on('pageshowready', "#liveTvRecordingListPage", function () {
+ }).on('pagebeforeshowready', "#liveTvRecordingListPage", function () {
var page = this;
-
+
var limit = LibraryBrowser.getDefaultPageSize();
// If the default page size has changed, the start index will have to be reset
diff --git a/dashboard-ui/scripts/livetvrecordings.js b/dashboard-ui/scripts/livetvrecordings.js
index 3e8dc548ca..600738d24a 100644
--- a/dashboard-ui/scripts/livetvrecordings.js
+++ b/dashboard-ui/scripts/livetvrecordings.js
@@ -89,6 +89,7 @@
renderRecordings($('#latestRecordings', page), result.Items);
+ LibraryBrowser.setLastRefreshed(page);
});
ApiClient.getLiveTvRecordingGroups({
@@ -102,11 +103,13 @@
});
}
- $(document).on('pageshowready', "#liveTvRecordingsPage", function () {
+ $(document).on('pagebeforeshowready', "#liveTvRecordingsPage", function () {
var page = this;
- reload(page);
+ if (LibraryBrowser.needsRefresh(page)) {
+ reload(page);
+ }
});
diff --git a/dashboard-ui/scripts/livetvseriestimer.js b/dashboard-ui/scripts/livetvseriestimer.js
index 5c57d49c87..165645abe5 100644
--- a/dashboard-ui/scripts/livetvseriestimer.js
+++ b/dashboard-ui/scripts/livetvseriestimer.js
@@ -285,7 +285,7 @@
reload(page);
- }).on('pagehide', "#liveTvSeriesTimerPage", function () {
+ }).on('pagebeforehide', "#liveTvSeriesTimerPage", function () {
currentItem = null;
});
diff --git a/dashboard-ui/scripts/livetvseriestimers.js b/dashboard-ui/scripts/livetvseriestimers.js
index fc363ef21b..e5516dd5d4 100644
--- a/dashboard-ui/scripts/livetvseriestimers.js
+++ b/dashboard-ui/scripts/livetvseriestimers.js
@@ -97,6 +97,7 @@
renderTimers(page, result.Items);
+ LibraryBrowser.setLastRefreshed(page);
});
}
@@ -116,11 +117,13 @@
}).checkboxradio('refresh');
}
- $(document).on('pageshowready', "#liveTvSeriesTimersPage", function () {
+ $(document).on('pagebeforeshowready', "#liveTvSeriesTimersPage", function () {
var page = this;
- reload(page);
+ if (LibraryBrowser.needsRefresh(page)) {
+ reload(page);
+ }
}).on('pageinit', "#liveTvSeriesTimersPage", function () {
diff --git a/dashboard-ui/scripts/livetvstatus.js b/dashboard-ui/scripts/livetvstatus.js
index 1b84c53bc6..4b4de3fedc 100644
--- a/dashboard-ui/scripts/livetvstatus.js
+++ b/dashboard-ui/scripts/livetvstatus.js
@@ -190,7 +190,7 @@
taskKey: 'RefreshGuide'
});
- }).on('pagehide', "#liveTvStatusPage", function () {
+ }).on('pagebeforehide', "#liveTvStatusPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/livetvsuggested.js b/dashboard-ui/scripts/livetvsuggested.js
index b3649f6789..500424a6bb 100644
--- a/dashboard-ui/scripts/livetvsuggested.js
+++ b/dashboard-ui/scripts/livetvsuggested.js
@@ -24,8 +24,12 @@
});
- $('.activeProgramItems', page).html(html).lazyChildren();
+ var elem = page.querySelector('.activeProgramItems');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
Dashboard.hideLoadingMsg();
+
+ LibraryBrowser.setLastRefreshed(page);
});
}
@@ -56,7 +60,9 @@
});
- $('.upcomingProgramItems', page).html(html).lazyChildren();
+ var elem = page.querySelector('.upcomingProgramItems');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
});
ApiClient.getLiveTvRecommendedPrograms({
@@ -78,7 +84,9 @@
lazy: true
});
- $('.upcomingTvMovieItems', page).html(html).lazyChildren();
+ var elem = page.querySelector('.upcomingTvMovieItems');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
});
ApiClient.getLiveTvRecommendedPrograms({
@@ -100,16 +108,19 @@
lazy: true
});
- $('.upcomingSportsItems', page).html(html).lazyChildren();
+ var elem = page.querySelector('.upcomingSportsItems');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
});
}
- $(document).on('pageshowready', "#liveTvSuggestedPage", function () {
+ $(document).on('pagebeforeshowready', "#liveTvSuggestedPage", function () {
var page = this;
- reload(page);
-
+ if (LibraryBrowser.needsRefresh(page)) {
+ reload(page);
+ }
});
})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/livetvtimer.js b/dashboard-ui/scripts/livetvtimer.js
index 2d7347f3b3..993af28389 100644
--- a/dashboard-ui/scripts/livetvtimer.js
+++ b/dashboard-ui/scripts/livetvtimer.js
@@ -35,7 +35,7 @@
$('.itemCommunityRating', page).html(LibraryBrowser.getRatingHtml(programInfo));
LibraryBrowser.renderGenres($('.itemGenres', page), programInfo, context);
- LibraryBrowser.renderOverview($('.itemOverview', page), programInfo);
+ LibraryBrowser.renderOverview(page.querySelector('.itemOverview'), programInfo);
if (programInfo.ImageTags && programInfo.ImageTags.Primary) {
@@ -121,7 +121,7 @@
reload(page);
- }).on('pagehide', "#liveTvTimerPage", function () {
+ }).on('pagebeforehide', "#liveTvTimerPage", function () {
currentItem = null;
});
diff --git a/dashboard-ui/scripts/livetvtimers.js b/dashboard-ui/scripts/livetvtimers.js
index d318ea12db..c0691a78f2 100644
--- a/dashboard-ui/scripts/livetvtimers.js
+++ b/dashboard-ui/scripts/livetvtimers.js
@@ -104,14 +104,17 @@
renderTimers(page, result.Items);
+ LibraryBrowser.setLastRefreshed(page);
});
}
- $(document).on('pageshowready', "#liveTvTimersPage", function () {
+ $(document).on('pagebeforeshowready', "#liveTvTimersPage", function () {
var page = this;
- reload(page);
+ if (LibraryBrowser.needsRefresh(page)) {
+ reload(page);
+ }
});
})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/loginpage.js b/dashboard-ui/scripts/loginpage.js
index 7685d0a090..99b9de4f68 100644
--- a/dashboard-ui/scripts/loginpage.js
+++ b/dashboard-ui/scripts/loginpage.js
@@ -23,10 +23,7 @@
LoginPage.getApiClient().done(function (apiClient) {
- // Show all users on localhost
- var promise1 = apiClient.getPublicUsers();
-
- promise1.done(function (users) {
+ apiClient.getPublicUsers().done(function (users) {
var showManualForm = !users.length;
@@ -110,6 +107,8 @@
newUrl = "index.html";
}
+ Dashboard.hideLoadingMsg();
+
Dashboard.onServerChanged(user.Id, result.AccessToken, apiClient);
Dashboard.navigate(newUrl);
@@ -221,4 +220,8 @@ $(document).on('pageinitdepends', "#loginPage", function () {
$('.manualLoginForm', page).off('submit', LoginPage.onManualSubmit).on('submit', LoginPage.onManualSubmit);
+ $('.btnForgotPassword', page).on('click', function () {
+ Dashboard.navigate('forgotpassword.html');
+ });
+
}).on('pageshowready', "#loginPage", LoginPage.onPageShow);
diff --git a/dashboard-ui/scripts/logpage.js b/dashboard-ui/scripts/logpage.js
index 33f6a59e68..09cf7901db 100644
--- a/dashboard-ui/scripts/logpage.js
+++ b/dashboard-ui/scripts/logpage.js
@@ -43,7 +43,7 @@
html += '';
- $('.serverLogs', page).html(html).trigger('create');
+ Events.trigger($('.serverLogs', page).html(html)[0], 'create');
});
});
diff --git a/dashboard-ui/scripts/mediacontroller.js b/dashboard-ui/scripts/mediacontroller.js
index cb2e475063..728da6f476 100644
--- a/dashboard-ui/scripts/mediacontroller.js
+++ b/dashboard-ui/scripts/mediacontroller.js
@@ -1,14 +1,14 @@
-(function ($, window, store) {
+(function ($, window) {
function setMirrorModeEnabled(enabled) {
var val = enabled ? '1' : '0';
- store.setItem('displaymirror--' + Dashboard.getCurrentUserId(), val);
+ appStorage.setItem('displaymirror--' + Dashboard.getCurrentUserId(), val);
}
function isMirrorModeEnabled() {
- return (store.getItem('displaymirror--' + Dashboard.getCurrentUserId()) || '') != '0';
+ return (appStorage.getItem('displaymirror--' + Dashboard.getCurrentUserId()) || '') != '0';
}
var currentDisplayInfo;
@@ -39,7 +39,7 @@
function monitorPlayer(player) {
- $(player).on('playbackstart.mediacontroller', function (e, state) {
+ Events.on(player, 'playbackstart', function (e, state) {
var info = {
QueueableMediaTypes: state.NowPlayingItem.MediaType,
@@ -51,7 +51,9 @@
ApiClient.reportPlaybackStart(info);
- }).on('playbackstop.mediacontroller', function (e, state) {
+ });
+
+ Events.on(player, 'playbackstop', function (e, state) {
var stopInfo = {
itemId: state.NowPlayingItem.Id,
@@ -72,6 +74,186 @@
});
}
+
+
+ function getTargetsHtml(targets) {
+
+ var playerInfo = MediaController.getPlayerInfo();
+
+ var html = '';
+ html += ' ';
+
+ html += '' + Globalize.translate('HeaderSelectPlayer') + ' ';
+ html += '';
+
+ var checkedHtml;
+
+ for (var i = 0, length = targets.length; i < length; i++) {
+
+ var target = targets[i];
+
+ var id = 'radioPlayerTarget' + i;
+
+ var isChecked = target.id == playerInfo.id;
+ checkedHtml = isChecked ? ' checked="checked"' : '';
+
+ var mirror = (!target.isLocalPlayer && target.supportedCommands.indexOf('DisplayContent') != -1) ? 'true' : 'false';
+
+ html += ' ';
+ html += '' + target.name;
+
+ if (target.appName && target.appName != target.name) {
+ html += '' + target.appName + ' ';
+ }
+
+ html += ' ';
+ }
+
+ html += ' ';
+
+ html += '' + Globalize.translate('LabelAllPlaysSentToPlayer') + '
';
+
+ checkedHtml = isMirrorModeEnabled() ? ' checked="checked"' : '';
+
+ html += 'Enable display mirroring
';
+
+ html += ' ';
+
+ return html;
+ }
+
+ function showPlayerSelection() {
+
+ var promise = MediaController.getTargets();
+
+ var html = '
';
+
+ $(document.body).append(html);
+
+ require(['jqmicons']);
+
+ var elem = $('#playerSelectionPanel').panel({}).trigger('create').panel("open").on("panelclose", function () {
+
+ $(this).off("panelclose").remove();
+ });
+
+ promise.done(function (targets) {
+
+ $('.players', elem).html(getTargetsHtml(targets)).trigger('create');
+
+ $('.chkEnableMirrorMode', elem).on('change', function () {
+ setMirrorModeEnabled(this.checked);
+
+ if (this.checked && currentDisplayInfo) {
+
+ mirrorItem(currentDisplayInfo);
+
+ }
+
+ });
+
+ $('.radioSelectPlayerTarget', elem).off('change').on('change', function () {
+
+ var supportsMirror = this.getAttribute('data-mirror') == 'true';
+
+ if (supportsMirror) {
+ $('.fldMirrorMode', elem).show();
+ } else {
+ $('.fldMirrorMode', elem).hide();
+ }
+
+ var playerName = this.getAttribute('data-playername');
+ var targetId = this.getAttribute('data-targetid');
+ var targetName = this.getAttribute('data-targetname');
+ var deviceName = this.getAttribute('data-deviceName');
+ var playableMediaTypes = this.getAttribute('data-mediatypes').split(',');
+ var supportedCommands = this.getAttribute('data-commands').split(',');
+
+ MediaController.trySetActivePlayer(playerName, {
+ id: targetId,
+ name: targetName,
+ playableMediaTypes: playableMediaTypes,
+ supportedCommands: supportedCommands,
+ deviceName: deviceName
+
+ });
+
+ if (currentDisplayInfo) {
+
+ mirrorIfEnabled(currentDisplayInfo);
+ }
+
+ });
+
+ if ($('.radioSelectPlayerTarget:checked', elem)[0].getAttribute('data-mirror') == 'true') {
+ $('.fldMirrorMode', elem).show();
+ } else {
+ $('.fldMirrorMode', elem).hide();
+ }
+ });
+ }
+
+ function bindKeys(controller) {
+
+ var self = this;
+ var keyResult = {};
+
+ self.keyBinding = function (e) {
+
+ if (bypass()) return;
+
+ Logger.log("keyCode", e.keyCode);
+
+ if (keyResult[e.keyCode]) {
+ e.preventDefault();
+ keyResult[e.keyCode](e);
+ }
+ };
+
+ self.keyPrevent = function (e) {
+
+ if (bypass()) return;
+
+ var codes = [32, 38, 40, 37, 39, 81, 77, 65, 84, 83, 70];
+
+ if (codes.indexOf(e.keyCode) != -1) {
+ e.preventDefault();
+ }
+ };
+
+ keyResult[32] = function () { // spacebar
+
+ var player = controller.getCurrentPlayer();
+
+ player.getPlayerState().done(function (result) {
+
+ var state = result;
+
+ if (state.NowPlayingItem && state.PlayState) {
+ if (state.PlayState.IsPaused) {
+ player.unpause();
+ } else {
+ player.pause();
+ }
+ }
+ });
+ };
+
+ var bypass = function () {
+ // Get active elem to see what type it is
+ var active = document.activeElement;
+ var type = active.type || active.tagName.toLowerCase();
+ return (type === "text" || type === "select" || type === "textarea" || type == "password");
+ };
+ }
+
function mediaController() {
var self = this;
@@ -81,7 +263,7 @@
var keys = new bindKeys(self);
- $(window).on("keydown", keys.keyBinding).on("keypress keyup", keys.keyPrevent);
+ $(window).on("keydown", keys.keyBinding).on("keypress", keys.keyPrevent).on("keyup", keys.keyPrevent);
self.registerPlayer = function (player) {
@@ -122,10 +304,11 @@
throw new Error('null player');
}
+ currentPairingId = null;
currentPlayer = player;
currentTargetInfo = targetInfo;
- console.log('Active player: ' + JSON.stringify(currentTargetInfo));
+ Logger.log('Active player: ' + JSON.stringify(currentTargetInfo));
triggerPlayerChange(player, targetInfo);
};
@@ -154,7 +337,7 @@
currentPlayer = player;
currentTargetInfo = targetInfo;
- console.log('Active player: ' + JSON.stringify(currentTargetInfo));
+ Logger.log('Active player: ' + JSON.stringify(currentTargetInfo));
triggerPlayerChange(player, targetInfo);
});
@@ -400,7 +583,7 @@
// Full list
// https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Model/Session/GeneralCommand.cs#L23
- console.log('MediaController received command: ' + cmd.Name);
+ Logger.log('MediaController received command: ' + cmd.Name);
switch (cmd.Name) {
case 'VolumeUp':
@@ -613,6 +796,8 @@
return false;
};
+
+ self.showPlayerSelection = showPlayerSelection;
}
window.MediaController = new mediaController();
@@ -690,188 +875,14 @@
});
});
- function getTargetsHtml(targets) {
-
- var playerInfo = MediaController.getPlayerInfo();
-
- var html = '';
- html += '
';
-
- html += '' + Globalize.translate('HeaderSelectPlayer') + ' ';
- html += '';
-
- var checkedHtml;
-
- for (var i = 0, length = targets.length; i < length; i++) {
-
- var target = targets[i];
-
- var id = 'radioPlayerTarget' + i;
-
- var isChecked = target.id == playerInfo.id;
- checkedHtml = isChecked ? ' checked="checked"' : '';
-
- var mirror = (!target.isLocalPlayer && target.supportedCommands.indexOf('DisplayContent') != -1) ? 'true' : 'false';
-
- html += ' ';
- html += '' + target.name;
-
- if (target.appName && target.appName != target.name) {
- html += '' + target.appName + ' ';
- }
-
- html += ' ';
- }
-
- html += ' ';
-
- html += '' + Globalize.translate('LabelAllPlaysSentToPlayer') + '
';
-
- checkedHtml = isMirrorModeEnabled() ? ' checked="checked"' : '';
-
- html += 'Enable display mirroring
';
-
- html += ' ';
-
- return html;
- }
-
- function showPlayerSelection(page) {
-
- var promise = MediaController.getTargets();
-
- var html = '
';
-
- $(document.body).append(html);
-
- var elem = $('#playerSelectionPanel').panel({}).trigger('create').panel("open").on("panelclose", function () {
-
- $(this).off("panelclose").remove();
- });
-
- promise.done(function (targets) {
-
- $('.players', elem).html(getTargetsHtml(targets)).trigger('create');
-
- $('.chkEnableMirrorMode', elem).on('change', function () {
- setMirrorModeEnabled(this.checked);
-
- if (this.checked && currentDisplayInfo) {
-
- mirrorItem(currentDisplayInfo);
-
- }
-
- });
-
- $('.radioSelectPlayerTarget', elem).off('change').on('change', function () {
-
- var supportsMirror = this.getAttribute('data-mirror') == 'true';
-
- if (supportsMirror) {
- $('.fldMirrorMode', elem).show();
- } else {
- $('.fldMirrorMode', elem).hide();
- }
-
- var playerName = this.getAttribute('data-playername');
- var targetId = this.getAttribute('data-targetid');
- var targetName = this.getAttribute('data-targetname');
- var deviceName = this.getAttribute('data-deviceName');
- var playableMediaTypes = this.getAttribute('data-mediatypes').split(',');
- var supportedCommands = this.getAttribute('data-commands').split(',');
-
- MediaController.trySetActivePlayer(playerName, {
- id: targetId,
- name: targetName,
- playableMediaTypes: playableMediaTypes,
- supportedCommands: supportedCommands,
- deviceName: deviceName
-
- });
-
- if (currentDisplayInfo) {
-
- mirrorIfEnabled(currentDisplayInfo);
- }
-
- });
-
- if ($('.radioSelectPlayerTarget:checked', elem).attr('data-mirror') == 'true') {
- $('.fldMirrorMode', elem).show();
- } else {
- $('.fldMirrorMode', elem).hide();
- }
- });
- }
-
- function bindKeys(controller) {
-
- var self = this;
- var keyResult = {};
-
- self.keyBinding = function (e) {
-
- if (bypass()) return;
-
- console.log("keyCode", e.keyCode);
-
- if (keyResult[e.keyCode]) {
- e.preventDefault();
- keyResult[e.keyCode](e);
- }
- };
-
- self.keyPrevent = function (e) {
-
- if (bypass()) return;
-
- var codes = [32, 38, 40, 37, 39, 81, 77, 65, 84, 83, 70];
-
- if (codes.indexOf(e.keyCode) != -1) {
- e.preventDefault();
- }
- };
-
- keyResult[32] = function () { // spacebar
-
- var player = controller.getCurrentPlayer();
-
- player.getPlayerState().done(function (result) {
-
- var state = result;
-
- if (state.NowPlayingItem && state.PlayState) {
- if (state.PlayState.IsPaused) {
- player.unpause();
- } else {
- player.pause();
- }
- }
- });
- };
-
- var bypass = function () {
- // Get active elem to see what type it is
- var active = document.activeElement;
- var type = active.type || active.tagName.toLowerCase();
- return (type === "text" || type === "select" || type === "textarea" || type == "password");
- };
+ function onCastButtonClicked() {
+
+ showPlayerSelection();
}
$(document).on('headercreated', function () {
- $('.btnCast').off('.mediacontroller').on('click.mediacontroller', function () {
-
- showPlayerSelection($.mobile.activePage);
- });
+ $('.btnCast').off('click', onCastButtonClicked).on('click', onCastButtonClicked);
}).on('pagebeforeshow', ".page", function () {
@@ -881,11 +892,9 @@
}).on('displayingitem', ".libraryPage", function (e, info) {
- var page = this;
-
currentDisplayInfo = info;
mirrorIfEnabled(info);
});
-})(jQuery, window, window.appStorage);
\ No newline at end of file
+})(jQuery, window);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/medialibrarypage.js b/dashboard-ui/scripts/medialibrarypage.js
index 2a13ef6a3e..e47f611517 100644
--- a/dashboard-ui/scripts/medialibrarypage.js
+++ b/dashboard-ui/scripts/medialibrarypage.js
@@ -383,7 +383,7 @@ var WizardLibraryPage = {
taskKey: 'RefreshLibrary'
});
- }).on('pagehide', "#mediaLibraryPage", function () {
+ }).on('pagebeforehide', "#mediaLibraryPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js
index bb5c0f567f..9fb27c0a5c 100644
--- a/dashboard-ui/scripts/mediaplayer-video.js
+++ b/dashboard-ui/scripts/mediaplayer-video.js
@@ -9,7 +9,6 @@
var unmuteButton = null;
var volumeSlider = null;
var positionSlider;
- var isPositionSliderActive;
var currentTimeElement;
self.currentSubtitleStreamIndex = null;
@@ -59,20 +58,14 @@
return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement ? true : false;
};
- function onFlyoutClose() {
- $('.itemVideo').css('visibility', 'visible');
- }
-
- function onPopupOpen(elem) {
- elem.popup("open").parents(".ui-popup-container").css("margin-top", 30);
-
- if ($.browser.safari) {
- //$('.itemVideo').css('visibility', 'hidden');
- }
- }
-
self.showChaptersFlyout = function () {
+ function onFlyoutClose() {
+ $('.itemVideo').css('visibility', 'visible');
+ }
+
+ require(['jqmicons']);
+
var html = getChaptersFlyoutHtml();
var elem = $('.videoChaptersPopup').html(html)
@@ -81,46 +74,187 @@
.off('popupafterclose', onFlyoutClose)
.on('popupafterclose', onFlyoutClose);
- onPopupOpen(elem);
+ elem.popup("open").parents(".ui-popup-container").css("margin-top", 30);
};
self.showSubtitleMenu = function () {
- var html = getSubtitleTracksHtml();
+ var streams = self.currentMediaSource.MediaStreams.filter(function (currentStream) {
+ return currentStream.Type == "Subtitle";
+ });
- var elem = $('.videoSubtitlePopup').html(html)
- .trigger('create')
- .popup("option", "positionTo", $('.videoSubtitleButton'))
- .off('popupafterclose', onFlyoutClose)
- .on('popupafterclose', onFlyoutClose);
+ var currentIndex = self.currentSubtitleStreamIndex || -1;
- onPopupOpen(elem);
+ streams.unshift({
+ Index: -1,
+ Language: "Off"
+ });
+
+ var menuItems = streams.map(function (stream) {
+
+ var attributes = [];
+
+ attributes.push(stream.Language || Globalize.translate('LabelUnknownLanguage'));
+
+ if (stream.Codec) {
+ attributes.push(stream.Codec);
+ }
+
+ var name = attributes.join(' - ');
+
+ if (stream.IsDefault) {
+ name += ' (D)';
+ }
+ if (stream.IsForced) {
+ name += ' (F)';
+ }
+ if (stream.External) {
+ name += ' (EXT)';
+ }
+
+ var opt = {
+ name: name,
+ id: stream.Index
+ };
+
+ if (stream.Index == currentIndex) {
+ opt.ironIcon = "check";
+ }
+
+ return opt;
+ });
+
+ require(['actionsheet'], function () {
+
+ ActionSheetElement.show({
+ items: menuItems,
+ positionTo: $('.videoSubtitleButton')[0],
+ callback: function (id) {
+
+ var index = parseInt(id);
+ if (index != currentIndex) {
+ self.onSubtitleOptionSelected(index);
+ }
+ }
+ });
+
+ });
};
self.showQualityFlyout = function () {
- var html = getQualityFlyoutHtml();
+ var currentSrc = self.getCurrentSrc(self.currentMediaRenderer).toLowerCase();
+ var isStatic = currentSrc.indexOf('static=true') != -1;
- var elem = $('.videoQualityPopup').html(html)
- .trigger('create')
- .popup("option", "positionTo", $('.videoQualityButton'))
- .off('popupafterclose', onFlyoutClose)
- .on('popupafterclose', onFlyoutClose);
+ var videoStream = self.currentMediaSource.MediaStreams.filter(function (stream) {
+ return stream.Type == "Video";
+ })[0];
+ var videoWidth = videoStream ? videoStream.Width : null;
+ var videoHeight = videoStream ? videoStream.Height : null;
- onPopupOpen(elem);
+ var options = self.getVideoQualityOptions(videoWidth, videoHeight);
+
+ if (isStatic) {
+ options[0].name = "Direct";
+ }
+
+ var menuItems = options.map(function (o) {
+
+ var opt = {
+ name: o.name,
+ id: o.bitrate
+ };
+
+ if (o.selected) {
+ opt.ironIcon = "check";
+ }
+
+ return opt;
+ });
+
+ var selectedId = options.filter(function (o) {
+ return o.selected;
+ });
+ selectedId = selectedId.length ? selectedId[0].bitrate : null;
+ require(['actionsheet'], function () {
+
+ ActionSheetElement.show({
+ items: menuItems,
+ positionTo: $('.videoQualityButton')[0],
+ callback: function (id) {
+
+ var bitrate = parseInt(id);
+ if (bitrate != selectedId) {
+ self.onQualityOptionSelected(bitrate);
+ }
+ }
+ });
+
+ });
};
self.showAudioTracksFlyout = function () {
- var html = getAudioTracksHtml();
+ var options = self.currentMediaSource.MediaStreams.filter(function (currentStream) {
+ return currentStream.Type == "Audio";
+ });
- var elem = $('.videoAudioPopup').html(html)
- .trigger('create')
- .popup("option", "positionTo", $('.videoAudioButton'))
- .off('popupafterclose', onFlyoutClose)
- .on('popupafterclose', onFlyoutClose);
+ var currentIndex = getParameterByName('AudioStreamIndex', self.getCurrentSrc(self.currentMediaRenderer));
- onPopupOpen(elem);
+ var menuItems = options.map(function (stream) {
+
+ var attributes = [];
+
+ attributes.push(stream.Language || Globalize.translate('LabelUnknownLanguage'));
+
+ if (stream.Codec) {
+ attributes.push(stream.Codec);
+ }
+ if (stream.Profile) {
+ attributes.push(stream.Profile);
+ }
+
+ if (stream.BitRate) {
+ attributes.push((Math.floor(stream.BitRate / 1000)) + ' kbps');
+ }
+
+ if (stream.Channels) {
+ attributes.push(stream.Channels + ' ch');
+ }
+
+ var name = attributes.join(' - ');
+
+ if (stream.IsDefault) {
+ name += ' (D)';
+ }
+
+ var opt = {
+ name: name,
+ id: stream.Index
+ };
+
+ if (stream.Index == currentIndex) {
+ opt.ironIcon = "check";
+ }
+
+ return opt;
+ });
+
+ require(['actionsheet'], function () {
+
+ ActionSheetElement.show({
+ items: menuItems,
+ positionTo: $('.videoAudioButton')[0],
+ callback: function (id) {
+
+ var index = parseInt(id);
+ if (index != currentIndex) {
+ self.onAudioOptionSelected(index);
+ }
+ }
+ });
+
+ });
};
self.setAudioStreamIndex = function (index) {
@@ -129,7 +263,7 @@
self.setSubtitleStreamIndex = function (index) {
- if (!self.supportsTextTracks()) {
+ if (!self.currentMediaRenderer.supportsTextTracks()) {
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: index });
self.currentSubtitleStreamIndex = index;
@@ -184,8 +318,6 @@
self.setCurrentTrackElement = function (index) {
- var modes = ['disabled', 'showing', 'hidden'];
-
var textStreams = self.currentMediaSource.MediaStreams.filter(function (s) {
return s.DeliveryMethod == 'External';
});
@@ -196,70 +328,12 @@
var trackIndex = newStream ? textStreams.indexOf(newStream) : -1;
- console.log('Setting new text track index to: ' + trackIndex);
-
- var allTracks = self.currentMediaElement.textTracks; // get list of tracks
-
- for (var i = 0; i < allTracks.length; i++) {
-
- var mode;
-
- if (trackIndex == i) {
- mode = 1; // show this track
- } else {
- mode = 0; // hide all other tracks
- }
-
- console.log('Setting track ' + i + ' mode to: ' + mode);
-
- // Safari uses integers for the mode property
- // http://www.jwplayer.com/html5/scripting/
- var useNumericMode = false;
-
- if (!isNaN(allTracks[i].mode)) {
- useNumericMode = true;
- }
-
- if (useNumericMode) {
- allTracks[i].mode = mode;
- } else {
- allTracks[i].mode = modes[mode];
- }
- }
+ self.currentMediaRenderer.setCurrentTrackElement(trackIndex);
};
self.updateTextStreamUrls = function (startPositionTicks) {
- if (!self.supportsTextTracks()) {
- return;
- }
-
- var allTracks = self.currentMediaElement.textTracks; // get list of tracks
-
- for (var i = 0; i < allTracks.length; i++) {
-
- var track = allTracks[i];
-
- // This throws an error in IE, but is fine in chrome
- // In IE it's not necessary anyway because changing the src seems to be enough
- try {
- while (track.cues.length) {
- track.removeCue(track.cues[0]);
- }
- } catch (e) {
- console.log('Error removing cue from textTrack');
- }
- }
-
- $('track', self.currentMediaElement).each(function () {
-
- var currentSrc = this.src;
-
- currentSrc = replaceQueryString(currentSrc, 'startPositionTicks', startPositionTicks);
-
- this.src = currentSrc;
-
- });
+ self.currentMediaRenderer.updateTextStreamUrls(startPositionTicks);
};
self.updateNowPlayingInfo = function (item) {
@@ -395,7 +469,7 @@
var chapterIndex = 0;
html += item.Chapters.map(function (c) {
- var width = 320;
+ var width = 240;
var chapterHtml = '
';
chapterHtml += '';
chapterHtml += '
';
@@ -498,8 +572,6 @@
function onPositionSliderChange() {
- isPositionSliderActive = false;
-
var newPercent = parseInt(this.value);
var newPositionTicks = (newPercent / 100) * self.currentMediaSource.RunTimeTicks;
@@ -517,92 +589,133 @@
$('.videoChaptersPopup').popup('close');
};
- self.onAudioOptionSelected = function (elem) {
+ self.onAudioOptionSelected = function (index) {
- if (!$(elem).hasClass('selectedMediaPopupOption')) {
- var index = parseInt(elem.getAttribute('data-value'));
-
- self.setAudioStreamIndex(index);
- }
- $('.videoAudioPopup').popup('close');
+ self.setAudioStreamIndex(index);
};
- self.onSubtitleOptionSelected = function (elem) {
+ self.onSubtitleOptionSelected = function (index) {
- if (!$(elem).hasClass('selectedMediaPopupOption')) {
- var index = parseInt(elem.getAttribute('data-value'));
-
- self.setSubtitleStreamIndex(index);
- }
- $('.videoSubtitlePopup').popup('close');
+ self.setSubtitleStreamIndex(index);
};
- self.onQualityOptionSelected = function (elem) {
+ self.onQualityOptionSelected = function (bitrate) {
- if (!$(elem).hasClass('selectedMediaPopupOption')) {
- var bitrate = parseInt(elem.getAttribute('data-value'));
+ AppSettings.maxStreamingBitrate(bitrate);
- AppSettings.maxStreamingBitrate(bitrate);
+ $('.videoQualityPopup').popup('close');
- $('.videoQualityPopup').popup('close');
-
- self.changeStream(self.getCurrentTicks(), {
- Bitrate: bitrate
- });
- }
-
- $('.videoSubtitlePopup').popup('close');
+ self.changeStream(self.getCurrentTicks(), {
+ Bitrate: bitrate
+ });
};
- $(function () {
+ function ensureVideoPlayerElements() {
+
+ var html = '
'; // mediaPlayer
+
+ var div = document.createElement('div');
+ div.innerHTML = html;
+ document.body.appendChild(div);
+ }
+
+ Dashboard.ready(function () {
+
+ ensureVideoPlayerElements();
var parent = $("#mediaPlayer");
+
muteButton = $('.muteButton', parent);
unmuteButton = $('.unmuteButton', parent);
currentTimeElement = $('.currentTime', parent);
- positionSlider = $(".positionSlider", parent).on('slidestart', function (e) {
+ positionSlider = $(".videoPositionSlider", parent).on('change', onPositionSliderChange)[0];
- isPositionSliderActive = true;
+ positionSlider._setPinValue = function (value) {
- }).on('slidestop', onPositionSliderChange);
+ if (!self.currentMediaSource || !self.currentMediaSource.RunTimeTicks) {
+ this.pinValue = '--:--';
+ return;
+ }
- volumeSlider = $('.volumeSlider', parent).on('slidestop', function () {
+ var ticks = self.currentMediaSource.RunTimeTicks;
+ ticks /= 100;
+ ticks *= value;
+
+ this.pinValue = Dashboard.getDisplayTime(ticks);
+ };
+
+ volumeSlider = $('.videoVolumeSlider', parent).on('change', function () {
var vol = this.value;
updateVolumeButtons(vol);
- self.setVolume(vol * 100);
- });
-
- var trackChange = false;
-
- var tooltip = $('
');
-
- $(".videoControls .positionSliderContainer .slider").on("change", function (e) {
- if (!trackChange) return;
-
- var pct = $(this).val();
-
- var time = self.currentDurationTicks * (Number(pct) * .01);
-
- var tooltext = Dashboard.getDisplayTime(time);
-
- tooltip.text(tooltext);
-
- console.log("slidin", pct, self.currentDurationTicks, time);
-
- }).on("slidestart", function (e) {
- trackChange = true;
-
- var handle = $(".videoControls .positionSliderContainer .ui-slider-handle");
-
- handle.after(tooltip);
- }).on("slidestop", function (e) {
- trackChange = false;
-
- tooltip.remove();
- });
+ self.setVolume(vol);
+ })[0];
});
var idleHandlerTimeout;
@@ -623,7 +736,7 @@
idleState = true;
$('.hiddenOnIdle').addClass("inactive");
$('#videoPlayer').addClass('idlePlayer');
- }, 4000);
+ }, 3500);
}
function updateVolumeButtons(vol) {
@@ -744,282 +857,73 @@
return html;
}
- function getAudioTracksHtml() {
-
- var streams = self.currentMediaSource.MediaStreams.filter(function (currentStream) {
- return currentStream.Type == "Audio";
- });
-
- var currentIndex = getParameterByName('AudioStreamIndex', self.getCurrentSrc(self.currentMediaRenderer));
-
- var html = '';
- html += '';
-
- return html;
+ function onPopState() {
+ // Stop playback on browser back button nav
+ self.stop();
+ return;
}
- function getSubtitleTracksHtml() {
-
- var streams = self.currentMediaSource.MediaStreams.filter(function (currentStream) {
- return currentStream.Type == "Subtitle";
- });
-
- var currentIndex = self.currentSubtitleStreamIndex || -1;
-
- streams.unshift({
- Index: -1,
- Language: "Off"
- });
-
- var html = '';
- html += '';
-
- return html;
+ function onBodyMouseMove() {
+ idleHandler();
}
- function getQualityFlyoutHtml() {
+ function onFullScreenChange() {
+ if (self.isFullScreen()) {
+ enterFullScreen();
+ idleState = true;
- var currentSrc = self.getCurrentSrc(self.currentMediaRenderer).toLowerCase();
- var isStatic = currentSrc.indexOf('static=true') != -1;
-
- var videoStream = self.currentMediaSource.MediaStreams.filter(function (stream) {
- return stream.Type == "Video";
- })[0];
- var videoWidth = videoStream ? videoStream.Width : null;
-
- var options = self.getVideoQualityOptions(videoWidth);
-
- if (isStatic) {
- options[0].name = "Direct";
+ } else {
+ exitFullScreenToWindow();
}
-
- var html = '';
-
- html += '';
-
- return html;
}
- function bindEventsForPlayback() {
+ function bindEventsForPlayback(mediaRenderer) {
var hideElementsOnIdle = true;
if (hideElementsOnIdle) {
- $('.itemVideo').off('mousemove.videoplayer keydown.videoplayer scroll.videoplayer mousedown.videoplayer', idleHandler).on('mousemove.videoplayer keydown.videoplayer scroll.videoplayer mousedown.videoplayer', idleHandler).trigger('mousemove');
+
+ var itemVideo = document.querySelector('.itemVideo');
+ if (itemVideo) {
+ Events.on(itemVideo, 'mousemove', idleHandler);
+ Events.on(itemVideo, 'keydown', idleHandler);
+ Events.on(itemVideo, 'scroll', idleHandler);
+ Events.on(itemVideo, 'mousedown', idleHandler);
+ idleHandler();
+ }
}
- $(document).on('webkitfullscreenchange.videoplayer mozfullscreenchange.videoplayer msfullscreenchange.videoplayer fullscreenchange.videoplayer', function (e) {
+ $(document).on('webkitfullscreenchange', onFullScreenChange);
+ $(document).on('mozfullscreenchange', onFullScreenChange);
+ $(document).on('msfullscreenchange', onFullScreenChange);
+ $(document).on('fullscreenchange', onFullScreenChange);
- if (self.isFullScreen()) {
- enterFullScreen();
- idleState = true;
-
- } else {
- exitFullScreenToWindow();
- }
- });
-
- // Stop playback on browser back button nav
- $(window).one("popstate.videoplayer", function () {
- self.stop();
- return;
- });
+ $(window).one("popstate", onPopState);
if (hideElementsOnIdle) {
- $(document.body).on("mousemove.videoplayer", function () {
-
- idleHandler(this);
- });
+ $(document.body).on("mousemove", onBodyMouseMove);
}
}
- function unbindEventsForPlayback() {
+ function unbindEventsForPlayback(mediaRenderer) {
- $(document).off('.videoplayer');
+ $(document).off('webkitfullscreenchange', onFullScreenChange);
+ $(document).off('mozfullscreenchange', onFullScreenChange);
+ $(document).off('msfullscreenchange', onFullScreenChange);
+ $(document).off('fullscreenchange', onFullScreenChange);
// Stop playback on browser back button nav
- $(window).off("popstate.videoplayer");
+ $(window).off("popstate", onPopState);
- $(document.body).off("mousemove.videoplayer");
+ $(document.body).off("mousemove", onBodyMouseMove);
- $('.itemVideo').off('mousemove.videoplayer keydown.videoplayer scroll.videoplayer mousedown.videoplayer');
+ var itemVideo = document.querySelector('.itemVideo');
+ if (itemVideo) {
+ Events.off(itemVideo, 'mousemove', idleHandler);
+ Events.off(itemVideo, 'keydown', idleHandler);
+ Events.off(itemVideo, 'scroll', idleHandler);
+ Events.off(itemVideo, 'mousedown', idleHandler);
+ }
}
self.canAutoPlayVideo = function () {
@@ -1045,7 +949,7 @@
currentTimeElement.html('--:--');
- unbindEventsForPlayback();
+ unbindEventsForPlayback(mediaRenderer);
};
self.playVideo = function (item, mediaSource, startPosition) {
@@ -1176,11 +1080,11 @@
}
if (AppInfo.hasPhysicalVolumeButtons) {
- $('.volumeSliderContainer', videoControls).addClass('hide');
+ $(volumeSlider).visible(false);
$('.muteButton', videoControls).addClass('hide');
$('.unmuteButton', videoControls).addClass('hide');
} else {
- $('.volumeSliderContainer', videoControls).removeClass('hide');
+ $(volumeSlider).visible(true);
$('.muteButton', videoControls).removeClass('hide');
$('.unmuteButton', videoControls).removeClass('hide');
}
@@ -1197,7 +1101,7 @@
mediaRenderer.volume(initialVolume);
- volumeSlider.val(initialVolume).slider('refresh');
+ volumeSlider.value = initialVolume * 100;
updateVolumeButtons(initialVolume);
$(mediaRenderer).on("volumechange.mediaplayerevent", function (e) {
@@ -1206,9 +1110,8 @@
}).one("playing.mediaplayerevent", function () {
-
// For some reason this is firing at the start, so don't bind until playback has begun
- $(this).on("ended.playbackstopped", self.onPlaybackStopped).one('ended.playnext', self.playNextAfterEnded);
+ $(this).on("ended", self.onPlaybackStopped).one('ended', self.playNextAfterEnded);
self.onPlaybackStart(this, item, mediaSource);
@@ -1232,7 +1135,7 @@
}).on("timeupdate.mediaplayerevent", function () {
- if (!isPositionSliderActive) {
+ if (!positionSlider.dragging) {
self.setCurrentTime(self.getCurrentTicks(this), positionSlider, currentTimeElement);
}
@@ -1279,13 +1182,13 @@
}
});
- bindEventsForPlayback();
+ bindEventsForPlayback(mediaRenderer);
- mediaPlayerContainer.trigger("create");
+ mediaPlayerContainer.trigger('create');
self.currentSubtitleStreamIndex = mediaSource.DefaultSubtitleStreamIndex;
- $('body').addClass('bodyWithPopupOpen');
+ $(document.body).addClass('bodyWithPopupOpen');
self.currentMediaRenderer = mediaRenderer;
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
@@ -1297,23 +1200,28 @@
var index = self.currentPlaylistIndex(null);
var length = self.playlist.length;
var requiresNativeControls = !self.enableCustomVideoControls();
- var controls = $(requiresNativeControls ? '.videoAdvancedControls' : '.videoControls');
if (length < 2) {
$('.videoTrackControl').hide();
return;
}
+ var controls = requiresNativeControls ? '.videoAdvancedControls' : '.videoControls';
+ controls = document.querySelector(controls);
+
+ var previousTrackButton = controls.getElementsByClassName('previousTrackButton')[0];
+ var nextTrackButton = controls.getElementsByClassName('nextTrackButton')[0];
+
if (index === 0) {
- $('.previousTrackButton', controls).attr('disabled', 'disabled');
+ previousTrackButton.setAttribute('disabled', 'disabled');
} else {
- $('.previousTrackButton', controls).removeAttr('disabled');
+ previousTrackButton.removeAttribute('disabled');
}
if ((index + 1) >= length) {
- $('.nextTrackButton', controls).attr('disabled', 'disabled');
+ nextTrackButton.setAttribute('disabled', 'disabled');
} else {
- $('.nextTrackButton', controls).removeAttr('disabled');
+ nextTrackButton.removeAttribute('disabled');
}
$('.videoTrackControl', controls).show();
diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js
index 52597b6a6d..f9ae5be8cf 100644
--- a/dashboard-ui/scripts/mediaplayer.js
+++ b/dashboard-ui/scripts/mediaplayer.js
@@ -1,4 +1,4 @@
-(function (document, setTimeout, clearTimeout, screen, store, $, setInterval, window) {
+(function (document, setTimeout, clearTimeout, screen, $, setInterval, window) {
function mediaPlayer() {
@@ -38,53 +38,57 @@
var canPlayAac = document.createElement('audio').canPlayType('audio/aac').replace(/no/, '');
- self.getVideoQualityOptions = function (videoWidth) {
+ self.getVideoQualityOptions = function (videoWidth, videoHeight) {
var bitrateSetting = AppSettings.maxStreamingBitrate();
var maxAllowedWidth = videoWidth || 4096;
+ var maxAllowedHeight = videoHeight || 2304;
var options = [];
// Some 1080- videos are reported as 1912?
if (maxAllowedWidth >= 1900) {
- options.push({ name: '1080p - 30Mbps', maxWidth: 1920, bitrate: 30000000 });
- options.push({ name: '1080p - 25Mbps', maxWidth: 1920, bitrate: 25000000 });
- options.push({ name: '1080p - 20Mbps', maxWidth: 1920, bitrate: 20000000 });
- options.push({ name: '1080p - 15Mbps', maxWidth: 1920, bitrate: 15000000 });
- options.push({ name: '1080p - 10Mbps', maxWidth: 1920, bitrate: 10000000 });
- options.push({ name: '1080p - 8Mbps', maxWidth: 1920, bitrate: 8000000 });
- options.push({ name: '1080p - 6Mbps', maxWidth: 1920, bitrate: 6000000 });
- options.push({ name: '1080p - 5Mbps', maxWidth: 1920, bitrate: 5000000 });
+
+ options.push({ name: '1080p - 30Mbps', maxHeight: 1080, bitrate: 30000000 });
+ options.push({ name: '1080p - 25Mbps', maxHeight: 1080, bitrate: 25000000 });
+ options.push({ name: '1080p - 20Mbps', maxHeight: 1080, bitrate: 20000000 });
+ options.push({ name: '1080p - 15Mbps', maxHeight: 1080, bitrate: 15000000 });
+ options.push({ name: '1080p - 10Mbps', maxHeight: 1080, bitrate: 10000000 });
+ options.push({ name: '1080p - 8Mbps', maxHeight: 1080, bitrate: 8000000 });
+ options.push({ name: '1080p - 6Mbps', maxHeight: 1080, bitrate: 6000000 });
+ options.push({ name: '1080p - 5Mbps', maxHeight: 1080, bitrate: 5000000 });
+
} else if (maxAllowedWidth >= 1260) {
- options.push({ name: '720p - 10Mbps', maxWidth: 1280, bitrate: 10000000 });
- options.push({ name: '720p - 8Mbps', maxWidth: 1280, bitrate: 8000000 });
- options.push({ name: '720p - 6Mbps', maxWidth: 1280, bitrate: 6000000 });
- options.push({ name: '720p - 5Mbps', maxWidth: 1280, bitrate: 5000000 });
- } else if (maxAllowedWidth >= 460) {
- options.push({ name: '480p - 4Mbps', maxWidth: 720, bitrate: 4000000 });
- options.push({ name: '480p - 3Mbps', maxWidth: 720, bitrate: 3000000 });
- options.push({ name: '480p - 2.5Mbps', maxWidth: 720, bitrate: 2500000 });
- options.push({ name: '480p - 2Mbps', maxWidth: 720, bitrate: 2000000 });
- options.push({ name: '480p - 1.5Mbps', maxWidth: 720, bitrate: 1500000 });
+ options.push({ name: '720p - 10Mbps', maxHeight: 720, bitrate: 10000000 });
+ options.push({ name: '720p - 8Mbps', maxHeight: 720, bitrate: 8000000 });
+ options.push({ name: '720p - 6Mbps', maxHeight: 720, bitrate: 6000000 });
+ options.push({ name: '720p - 5Mbps', maxHeight: 720, bitrate: 5000000 });
+
+ } else if (maxAllowedWidth >= 700) {
+ options.push({ name: '480p - 4Mbps', maxHeight: 480, bitrate: 4000000 });
+ options.push({ name: '480p - 3Mbps', maxHeight: 480, bitrate: 3000000 });
+ options.push({ name: '480p - 2.5Mbps', maxHeight: 480, bitrate: 2500000 });
+ options.push({ name: '480p - 2Mbps', maxHeight: 480, bitrate: 2000000 });
+ options.push({ name: '480p - 1.5Mbps', maxHeight: 480, bitrate: 1500000 });
}
if (maxAllowedWidth >= 1260) {
- options.push({ name: '720p - 4Mbps', maxWidth: 1280, bitrate: 4000000 });
- options.push({ name: '720p - 3Mbps', maxWidth: 1280, bitrate: 3000000 });
- options.push({ name: '720p - 2Mbps', maxWidth: 1280, bitrate: 2000000 });
+ options.push({ name: '720p - 4Mbps', maxHeight: 720, bitrate: 4000000 });
+ options.push({ name: '720p - 3Mbps', maxHeight: 720, bitrate: 3000000 });
+ options.push({ name: '720p - 2Mbps', maxHeight: 720, bitrate: 2000000 });
// The extra 1 is because they're keyed off the bitrate value
- options.push({ name: '720p - 1.5Mbps', maxWidth: 1280, bitrate: 1500001 });
- options.push({ name: '720p - 1Mbps', maxWidth: 1280, bitrate: 1000001 });
+ options.push({ name: '720p - 1.5Mbps', maxHeight: 720, bitrate: 1500001 });
+ options.push({ name: '720p - 1Mbps', maxHeight: 720, bitrate: 1000001 });
}
- options.push({ name: '480p - 1.0Mbps', maxWidth: 720, bitrate: 1000000 });
- options.push({ name: '480p - 720kbps', maxWidth: 720, bitrate: 720000 });
- options.push({ name: '480p - 420kbps', maxWidth: 720, bitrate: 420000 });
- options.push({ name: '360p', maxWidth: 640, bitrate: 400000 });
- options.push({ name: '240p', maxWidth: 426, bitrate: 320000 });
- options.push({ name: '144p', maxWidth: 256, bitrate: 192000 });
+ options.push({ name: '480p - 1.0Mbps', maxHeight: 480, bitrate: 1000000 });
+ options.push({ name: '480p - 720kbps', maxHeight: 480, bitrate: 720000 });
+ options.push({ name: '480p - 420kbps', maxHeight: 480, bitrate: 420000 });
+ options.push({ name: '360p', maxHeight: 360, bitrate: 400000 });
+ options.push({ name: '240p', maxHeight: 240, bitrate: 320000 });
+ options.push({ name: '144p', maxHeight: 144, bitrate: 192000 });
var i, length, option;
var selectedIndex = -1;
@@ -107,12 +111,12 @@
return options;
};
- self.getDeviceProfile = function (maxWidth) {
+ self.getDeviceProfile = function (maxHeight) {
- if (!maxWidth) {
- maxWidth = self.getVideoQualityOptions().filter(function (q) {
+ if (!maxHeight) {
+ maxHeight = self.getVideoQualityOptions().filter(function (q) {
return q.selected;
- })[0].maxWidth;
+ })[0].maxHeight;
}
var bitrateSetting = AppSettings.maxStreamingBitrate();
@@ -161,6 +165,15 @@
});
}
+ var directPlayAudioContainers = AppInfo.directPlayAudioContainers;
+
+ if (directPlayAudioContainers && directPlayAudioContainers.length) {
+ profile.DirectPlayProfiles.push({
+ Container: directPlayAudioContainers.join(','),
+ Type: 'Audio'
+ });
+ }
+
if (canPlayWebm) {
profile.DirectPlayProfiles.push({
Container: 'webm',
@@ -339,8 +352,8 @@
},
{
Condition: 'LessThanEqual',
- Property: 'Width',
- Value: maxWidth
+ Property: 'Height',
+ Value: maxHeight
}]
});
@@ -356,8 +369,8 @@
},
{
Condition: 'LessThanEqual',
- Property: 'Width',
- Value: maxWidth
+ Property: 'Height',
+ Value: maxHeight
}]
});
@@ -394,6 +407,17 @@
return profile;
};
+ var supportsTextTracks;
+ self.supportsTextTracks = function () {
+
+ if (supportsTextTracks == null) {
+ supportsTextTracks = document.createElement('video').textTracks != null;
+ }
+
+ // For now, until ready
+ return supportsTextTracks;
+ };
+
self.updateCanClientSeek = function (mediaRenderer) {
var duration = mediaRenderer.duration();
@@ -407,7 +431,7 @@
self.getCurrentTicks = function (mediaRenderer) {
- var playerTime = Math.floor(10000000 * (mediaRenderer || self.currentMediaRenderer).currentTime());
+ var playerTime = Math.floor(10000 * (mediaRenderer || self.currentMediaRenderer).currentTime());
playerTime += self.startTimeTicksOffset;
@@ -449,15 +473,15 @@
self.canPlayNativeHls = function () {
// Don't use HLS on android 4.x, regardless of what the browser reports
- if ($.browser.android) {
- var agent = navigator.userAgent.toLowerCase();
+ //if ($.browser.android) {
+ // var agent = navigator.userAgent.toLowerCase();
- for (var i = 0; i <= 4; i++) {
- if (agent.indexOf('android 4.' + i) != -1) {
- return false;
- }
- }
- }
+ // for (var i = 0; i <= 4; i++) {
+ // if (agent.indexOf('android 4.' + i) != -1) {
+ // return false;
+ // }
+ // }
+ //}
var media = document.createElement('video');
@@ -486,7 +510,7 @@
if (canClientSeek && params == null) {
- mediaRenderer.currentTime(ticks / (1000 * 10000));
+ mediaRenderer.currentTime(ticks / 10000);
return;
}
@@ -533,11 +557,16 @@
clearProgressInterval();
- $(mediaRenderer).off('ended.playbackstopped').off('ended.playnext').one("play", function () {
+ Events.off(mediaRenderer, 'ended', self.onPlaybackStopped);
+ Events.off(mediaRenderer, 'ended', self.playNextAfterEnded);
+
+ $(mediaRenderer).one("play", function () {
self.updateCanClientSeek(this);
- $(this).on('ended.playbackstopped', self.onPlaybackStopped).one('ended.playnext', self.playNextAfterEnded);
+ Events.on(this, 'ended', self.onPlaybackStopped);
+
+ $(this).one('ended', self.playNextAfterEnded);
self.startProgressInterval();
sendProgressUpdate();
@@ -548,14 +577,14 @@
ApiClient.stopActiveEncodings(playSessionId).done(function () {
self.startTimeTicksOffset = newPositionTicks;
- mediaRenderer.setCurrentSrc(url);
+ mediaRenderer.setCurrentSrc(url, self.currentItem, self.currentMediaSource);
});
self.updateTextStreamUrls(newPositionTicks || 0);
} else {
self.startTimeTicksOffset = newPositionTicks;
- mediaRenderer.setCurrentSrc(url);
+ mediaRenderer.setCurrentSrc(url, self.currentItem, self.currentMediaSource);
}
}
@@ -575,13 +604,14 @@
var percent = ticks / self.currentDurationTicks;
percent *= 100;
- positionSlider.val(percent).slider('enable').slider('refresh');
+ positionSlider.disabled = false;
+ positionSlider.value = percent;
}
} else {
if (positionSlider) {
- positionSlider.slider('disable').slider('refresh');
+ positionSlider.disabled = true;
}
}
@@ -591,19 +621,7 @@
var state = self.getPlayerStateInternal(self.currentMediaRenderer, self.currentItem, self.currentMediaSource);
- $(self).trigger('positionchange', [state]);
- };
-
- var supportsTextTracks;
-
- self.supportsTextTracks = function () {
-
- if (supportsTextTracks == null) {
- supportsTextTracks = document.createElement('video').textTracks != null;
- }
-
- // For now, until ready
- return supportsTextTracks;
+ Events.trigger(self, 'positionchange', [state]);
};
self.canQueueMediaType = function (mediaType) {
@@ -843,7 +861,7 @@
}
if (self.isPlaying()) {
- self.stop();
+ self.stop(false);
}
if (item.MediaType !== 'Audio' && item.MediaType !== 'Video') {
@@ -1029,7 +1047,7 @@
if (newItem) {
- console.log('playing next track');
+ Logger.log('playing next track');
self.playInternal(newItem, 0, function () {
self.setPlaylistState(newIndex);
@@ -1167,7 +1185,7 @@
if (self.currentMediaRenderer) {
- console.log('MediaPlayer toggling mute');
+ Logger.log('MediaPlayer toggling mute');
if (self.volume()) {
self.mute();
@@ -1196,7 +1214,7 @@
if (self.currentMediaRenderer) {
- console.log('MediaPlayer setting volume to ' + val);
+ Logger.log('MediaPlayer setting volume to ' + val);
self.currentMediaRenderer.volume(val / 100);
self.onVolumeChanged(self.currentMediaRenderer);
@@ -1208,13 +1226,13 @@
self.saveVolume = function (val) {
if (val) {
- store.setItem("volume", val);
+ appStorage.setItem("volume", val);
}
};
self.getSavedVolume = function () {
- return store.getItem("volume") || 0.5;
+ return appStorage.getItem("volume") || 0.5;
};
self.shuffle = function (id) {
@@ -1332,7 +1350,7 @@
};
- self.stop = function () {
+ self.stop = function (destroyRenderer) {
var mediaRenderer = self.currentMediaRenderer;
@@ -1340,16 +1358,21 @@
mediaRenderer.stop();
- $(mediaRenderer).off("ended.playnext").one("ended", function () {
+ Events.off(mediaRenderer, 'ended', self.playNextAfterEnded);
- $(this).off();
+ $(mediaRenderer).one("ended", function() {
+
+ $(this).off('.mediaplayerevent');
+
+ this.cleanup(destroyRenderer);
- this.destroy();
self.currentMediaRenderer = null;
self.currentItem = null;
self.currentMediaSource = null;
- }).trigger("ended");
+ });
+
+ Events.trigger(mediaRenderer, "ended");
} else {
self.currentMediaRenderer = null;
@@ -1517,7 +1540,7 @@
var state = self.getPlayerStateInternal(mediaRenderer, item, mediaSource);
- $(self).trigger('playbackstart', [state]);
+ Events.trigger(self, 'playbackstart', [state]);
self.startProgressInterval();
};
@@ -1528,7 +1551,7 @@
var state = self.getPlayerStateInternal(mediaRenderer, self.currentItem, self.currentMediaSource);
- $(self).trigger('volumechange', [state]);
+ Events.trigger(self, 'volumechange', [state]);
};
self.cleanup = function () {
@@ -1537,13 +1560,15 @@
self.onPlaybackStopped = function () {
- console.log('playback stopped');
+ Logger.log('playback stopped');
- $('body').removeClass('bodyWithPopupOpen');
+ document.body.classList.remove('bodyWithPopupOpen');
var mediaRenderer = this;
- $(mediaRenderer).off('.mediaplayerevent').off('ended.playbackstopped');
+ Events.off(mediaRenderer, '.mediaplayerevent');
+
+ Events.off(mediaRenderer, 'ended', self.onPlaybackStopped);
self.cleanup(mediaRenderer);
@@ -1562,17 +1587,17 @@
var state = self.getPlayerStateInternal(mediaRenderer, item, mediaSource);
- $(self).trigger('playbackstop', [state]);
+ Events.trigger(self, 'playbackstop', [state]);
};
self.onPlaystateChange = function (mediaRenderer) {
var state = self.getPlayerStateInternal(mediaRenderer, self.currentItem, self.currentMediaSource);
- $(self).trigger('playstatechange', [state]);
+ Events.trigger(self, 'playstatechange', [state]);
};
- $(window).on("beforeunload", function () {
+ Events.on(window, "beforeunload", function () {
// Try to report playback stopped before the browser closes
if (self.currentItem && self.currentMediaRenderer && currentProgressInterval) {
@@ -1657,26 +1682,30 @@
// Set volume first to avoid an audible change
mediaRenderer.volume(initialVolume);
mediaRenderer.setPoster(self.getPosterUrl(item));
- mediaRenderer.setCurrentSrc(audioUrl);
+ mediaRenderer.setCurrentSrc(audioUrl, item, mediaSource);
- $(mediaRenderer).on("volumechange.mediaplayerevent", function () {
+ Events.on(mediaRenderer, "volumechange.mediaplayerevent", function() {
- console.log('audio element event: volumechange');
+ Logger.log('audio element event: volumechange');
self.onVolumeChanged(this);
- }).one("playing.mediaplayerevent", function () {
+ });
- console.log('audio element event: playing');
+ $(mediaRenderer).one("playing.mediaplayerevent", function () {
+
+ Logger.log('audio element event: playing');
// For some reason this is firing at the start, so don't bind until playback has begun
- $(this).on("ended.playbackstopped", self.onPlaybackStopped).one('ended.playnext', self.playNextAfterEnded);
+ Events.on(this, 'ended', self.onPlaybackStopped);
+
+ $(this).one('ended', self.playNextAfterEnded);
self.onPlaybackStart(this, item, mediaSource);
}).on("pause.mediaplayerevent", function () {
- console.log('audio element event: pause');
+ Logger.log('audio element event: pause');
self.onPlaystateChange(this);
@@ -1685,7 +1714,7 @@
}).on("playing.mediaplayerevent", function () {
- console.log('audio element event: playing');
+ Logger.log('audio element event: playing');
self.onPlaystateChange(this);
@@ -1716,4 +1745,4 @@
});
-})(document, setTimeout, clearTimeout, screen, window.appStorage, $, setInterval, window);
\ No newline at end of file
+})(document, setTimeout, clearTimeout, screen, $, setInterval, window);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/metadatasubtitles.js b/dashboard-ui/scripts/metadatasubtitles.js
index b7b56c1200..b282fd5757 100644
--- a/dashboard-ui/scripts/metadatasubtitles.js
+++ b/dashboard-ui/scripts/metadatasubtitles.js
@@ -32,7 +32,7 @@
html += '
';
- $('.downloadLanguages', page).html(html).trigger("create");
+ $('.downloadLanguages', page).html(html).trigger('create');
var langs = config.DownloadLanguages || [];
diff --git a/dashboard-ui/scripts/moviecollections.js b/dashboard-ui/scripts/moviecollections.js
index 639f815ac4..24207caaf1 100644
--- a/dashboard-ui/scripts/moviecollections.js
+++ b/dashboard-ui/scripts/moviecollections.js
@@ -33,21 +33,16 @@
var user = response2[0];
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
- var addiontalButtonsHtml = user.Policy.IsAdministrator ?
- ('
' + Globalize.translate('ButtonNew') + ' ') :
- '';
-
$('.listTopPaging', page).html(LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
viewButton: true,
showLimit: false,
- additionalButtonsHtml: addiontalButtonsHtml
})).trigger('create');
updateFilterControls(page);
@@ -116,10 +111,12 @@
$('.noItemsMessage', page).show();
}
- $('.itemsContainer', page).html(html).lazyChildren();
+ var elem = page.querySelector('.itemsContainer');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- $('.itemsContainer', page).trigger('create');
+ $(elem).trigger('create');
}
$('.btnNextPage', page).on('click', function () {
@@ -168,8 +165,6 @@
$('#chkThemeSong', page).checked(query.HasThemeSong == true).checkboxradio('refresh');
$('#chkThemeVideo', page).checked(query.HasThemeVideo == true).checkboxradio('refresh');
- $('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater);
-
$('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
}
@@ -228,20 +223,6 @@
reloadItems(page);
});
- $('.alphabetPicker', this).on('alphaselect', function (e, character) {
-
- query.NameStartsWithOrGreater = character;
- query.StartIndex = 0;
-
- reloadItems(page);
-
- }).on('alphaclear', function (e) {
-
- query.NameStartsWithOrGreater = '';
-
- reloadItems(page);
- });
-
$('#selectView', this).on('change', function () {
view = this.value;
@@ -257,7 +238,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#boxsetsPage", function () {
+ }).on('pagebeforeshowready', "#boxsetsPage", function () {
var page = this;
@@ -380,6 +361,9 @@
$('.fldSelectedItemIds', panel).val(items.join(','));
+
+ require(['jqmicons']);
+
if (items.length) {
$('.fldSelectCollection', panel).show();
populateCollections(panel);
diff --git a/dashboard-ui/scripts/moviegenres.js b/dashboard-ui/scripts/moviegenres.js
index b81a8b8c44..003ca9092e 100644
--- a/dashboard-ui/scripts/moviegenres.js
+++ b/dashboard-ui/scripts/moviegenres.js
@@ -25,7 +25,7 @@
ApiClient.getGenres(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -85,7 +85,9 @@
});
}
- $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -154,7 +156,7 @@
LibraryBrowser.saveViewSetting(getSavedQueryKey(), view);
});
- }).on('pageshowready', "#movieGenresPage", function () {
+ }).on('pagebeforeshowready', "#movieGenresPage", function () {
var page = this;
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/moviepeople.js b/dashboard-ui/scripts/moviepeople.js
index 36176ce991..64a11bf241 100644
--- a/dashboard-ui/scripts/moviepeople.js
+++ b/dashboard-ui/scripts/moviepeople.js
@@ -27,7 +27,7 @@
ApiClient.getPeople(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -40,7 +40,7 @@
pageSizeKey: pageSizeKey
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
@@ -54,9 +54,9 @@
lazy: true
});
- var elem = $('#items', page).html(html).lazyChildren();
-
- $(pagingHtml).appendTo(elem).trigger('create');
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -140,7 +140,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#moviePeoplePage", function () {
+ }).on('pagebeforeshowready', "#moviePeoplePage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js
index af90dd7961..f9794d4421 100644
--- a/dashboard-ui/scripts/movies.js
+++ b/dashboard-ui/scripts/movies.js
@@ -29,7 +29,7 @@
ApiClient.getItems(userId, query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -43,7 +43,7 @@
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
var trigger = false;
@@ -129,14 +129,14 @@
});
}
- var elem = $('.itemsContainer', page).html(html).lazyChildren();
+ var elem = page.querySelector('.itemsContainer');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- $(elem).trigger('create');
+ Events.trigger(elem, 'create');
}
- $(pagingHtml).appendTo(elem).trigger('create');
-
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
@@ -399,7 +399,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#moviesPage", function () {
+ }).on('pagebeforeshowready', "#moviesPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js
index 397e1b6d62..bf1066b4e5 100644
--- a/dashboard-ui/scripts/moviesrecommended.js
+++ b/dashboard-ui/scripts/moviesrecommended.js
@@ -67,7 +67,7 @@
});
}
- $('#recentlyAddedItems', page).html(html).lazyChildren().trigger('create');
+ $('#recentlyAddedItems', page).html(html).lazyChildren();
});
}
@@ -128,7 +128,7 @@
});
}
- $('#resumableItems', page).html(html).lazyChildren().trigger('create');
+ $('#resumableItems', page).html(html).lazyChildren();
});
}
@@ -235,24 +235,27 @@
$('.recommendations', page).createCardMenus();
- }).on('pageshowready', "#moviesRecommendedPage", function () {
+ }).on('pagebeforeshowready', "#moviesRecommendedPage", function () {
var parentId = LibraryMenu.getTopParentId();
var page = this;
var userId = Dashboard.getCurrentUserId();
+ var containers = page.querySelectorAll('.itemsContainer');
if (enableScrollX()) {
- $('.itemsContainer', page).addClass('hiddenScrollX');
+ $(containers).addClass('hiddenScrollX');
} else {
- $('.itemsContainer', page).removeClass('hiddenScrollX');
+ $(containers).removeClass('hiddenScrollX');
}
- loadResume(page, userId, parentId);
- loadLatest(page, userId, parentId);
+ if (LibraryBrowser.needsRefresh(page)) {
+ loadResume(page, userId, parentId);
+ loadLatest(page, userId, parentId);
- if (AppInfo.enableMovieHomeSuggestions) {
- loadSuggestions(page, userId, parentId);
+ if (AppInfo.enableMovieHomeSuggestions) {
+ loadSuggestions(page, userId, parentId);
+ }
}
});
diff --git a/dashboard-ui/scripts/moviestudios.js b/dashboard-ui/scripts/moviestudios.js
index e973ba517b..51bca2fe2d 100644
--- a/dashboard-ui/scripts/moviestudios.js
+++ b/dashboard-ui/scripts/moviestudios.js
@@ -23,7 +23,7 @@
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -34,7 +34,7 @@
showLimit: false
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
@@ -48,9 +48,9 @@
lazy: true
});
- var elem = $('#items', page).html(html).lazyChildren().trigger('create');
-
- $(pagingHtml).appendTo(elem).trigger('create');
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -99,7 +99,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#movieStudiosPage", function () {
+ }).on('pagebeforeshowready', "#movieStudiosPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/movietrailers.js b/dashboard-ui/scripts/movietrailers.js
index 53683433ec..e859ac1083 100644
--- a/dashboard-ui/scripts/movietrailers.js
+++ b/dashboard-ui/scripts/movietrailers.js
@@ -28,7 +28,7 @@
ApiClient.getJSON(ApiClient.getUrl('Trailers', query)).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
if (result.Items.length) {
$('.noItemsMessage', page).hide();
@@ -46,7 +46,7 @@
showLimit: false
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
@@ -58,9 +58,9 @@
showDetailsMenu: true
});
- var elem = $('.itemsContainer', page).html(html).lazyChildren();
-
- $(pagingHtml).appendTo(elem).trigger('create');
+ var elem = page.querySelector('.itemsContainer');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -212,7 +212,7 @@
$('.popupTrailerReelForm').off('submit', onSubmit).on('submit', onSubmit);
- }).on('pageshowready', "#movieTrailersPage", function () {
+ }).on('pagebeforeshowready', "#movieTrailersPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/musicalbumartists.js b/dashboard-ui/scripts/musicalbumartists.js
index b34b9cd684..92778b37a0 100644
--- a/dashboard-ui/scripts/musicalbumartists.js
+++ b/dashboard-ui/scripts/musicalbumartists.js
@@ -28,7 +28,7 @@
ApiClient.getAlbumArtists(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -41,7 +41,7 @@
pageSizeKey: pageSizeKey
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
var trigger = false;
@@ -80,14 +80,14 @@
});
}
- var elem = $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- elem.trigger('create');
+ $(elem).trigger('create');
}
- $(pagingHtml).appendTo(elem).trigger('create');
-
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
@@ -190,7 +190,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#musicAlbumArtistsPage", function () {
+ }).on('pagebeforeshowready', "#musicAlbumArtistsPage", function () {
var page = this;
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/musicalbums.js b/dashboard-ui/scripts/musicalbums.js
index d94abeb3cb..5544de4024 100644
--- a/dashboard-ui/scripts/musicalbums.js
+++ b/dashboard-ui/scripts/musicalbums.js
@@ -27,7 +27,7 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -39,7 +39,7 @@
addSelectionButton: true
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
var trigger = false;
@@ -88,14 +88,14 @@
});
}
- var elem = $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- elem.trigger('create');
+ $(elem).trigger('create');
}
- $(pagingHtml).appendTo(elem).trigger('create');
-
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
@@ -242,7 +242,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#musicAlbumsPage", function () {
+ }).on('pagebeforeshowready', "#musicAlbumsPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/musicartists.js b/dashboard-ui/scripts/musicartists.js
index a4214a9fed..7bc195f8b1 100644
--- a/dashboard-ui/scripts/musicartists.js
+++ b/dashboard-ui/scripts/musicartists.js
@@ -28,7 +28,7 @@
ApiClient.getArtists(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -42,7 +42,7 @@
pageSizeKey: pageSizeKey
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
var trigger = false;
@@ -81,14 +81,14 @@
});
}
- var elem = $('.itemsContainer', page).html(html).lazyChildren();
+ var elem = page.querySelector('.itemsContainer');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- elem.trigger('create');
+ $(elem).trigger('create');
}
- $(pagingHtml).appendTo(elem).trigger('create');
-
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
@@ -191,7 +191,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#musicArtistsPage", function () {
+ }).on('pagebeforeshowready', "#musicArtistsPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/musicgenres.js b/dashboard-ui/scripts/musicgenres.js
index a737e18c82..0638343718 100644
--- a/dashboard-ui/scripts/musicgenres.js
+++ b/dashboard-ui/scripts/musicgenres.js
@@ -25,7 +25,7 @@
ApiClient.getMusicGenres(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -65,7 +65,9 @@
});
}
- $('#items', page).html(html).lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -115,7 +117,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#musicGenresPage", function () {
+ }).on('pagebeforeshowready', "#musicGenresPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
diff --git a/dashboard-ui/scripts/musicrecommended.js b/dashboard-ui/scripts/musicrecommended.js
index 73fe4f7b6b..69beef1333 100644
--- a/dashboard-ui/scripts/musicrecommended.js
+++ b/dashboard-ui/scripts/musicrecommended.js
@@ -17,6 +17,8 @@
function loadLatest(page, parentId) {
+ Dashboard.showLoadingMsg();
+
var userId = Dashboard.getCurrentUserId();
var options = {
@@ -30,7 +32,8 @@
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
- $('#recentlyAddedSongs', page).html(LibraryBrowser.getPosterViewHtml({
+ var elem = page.querySelector('#recentlyAddedSongs');
+ elem.innerHTML = LibraryBrowser.getPosterViewHtml({
items: items,
showUnplayedIndicator: false,
showLatestItemsPopup: false,
@@ -40,8 +43,12 @@
lazy: true,
cardLayout: true
- })).lazyChildren();
+ });
+ ImageLoader.lazyChildren(elem);
+ Dashboard.hideLoadingMsg();
+
+ LibraryBrowser.setLastRefreshed(page);
});
}
@@ -63,13 +70,16 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
+ var elem;
+
if (result.Items.length) {
- $('#recentlyPlayed', page).show();
+ elem = $('#recentlyPlayed', page).show()[0];
} else {
- $('#recentlyPlayed', page).hide();
+ elem = $('#recentlyPlayed', page).hide()[0];
}
- $('#recentlyPlayedSongs', page).html(LibraryBrowser.getPosterViewHtml({
+ var itemsContainer = elem.querySelector('.itemsContainer');
+ itemsContainer.innerHTML = LibraryBrowser.getPosterViewHtml({
items: result.Items,
showUnplayedIndicator: false,
shape: getSquareShape(),
@@ -79,7 +89,8 @@
lazy: true,
cardLayout: true
- })).lazyChildren();
+ });
+ ImageLoader.lazyChildren(itemsContainer);
});
@@ -103,13 +114,16 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
+ var elem;
+
if (result.Items.length) {
- $('#topPlayed', page).show();
+ elem = $('#topPlayed', page).show()[0];
} else {
- $('#topPlayed', page).hide();
+ elem = $('#topPlayed', page).hide()[0];
}
- $('#topPlayedSongs', page).html(LibraryBrowser.getPosterViewHtml({
+ var itemsContainer = elem.querySelector('.itemsContainer');
+ itemsContainer.innerHTML = LibraryBrowser.getPosterViewHtml({
items: result.Items,
showUnplayedIndicator: false,
shape: getSquareShape(),
@@ -119,7 +133,8 @@
lazy: true,
cardLayout: true
- })).lazyChildren();
+ });
+ ImageLoader.lazyChildren(itemsContainer);
});
@@ -144,12 +159,13 @@
var elem;
if (result.Items.length) {
- elem = $('#playlists', page).show();
+ elem = $('#playlists', page).show()[0];
} else {
- elem = $('#playlists', page).hide();
+ elem = $('#playlists', page).hide()[0];
}
- $('.itemsContainer', elem).html(LibraryBrowser.getPosterViewHtml({
+ var itemsContainer = elem.querySelector('.itemsContainer');
+ itemsContainer.innerHTML = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: getSquareShape(),
showTitle: true,
@@ -159,26 +175,30 @@
showItemCounts: true,
cardLayout: true
- })).lazyChildren();
+ });
+ ImageLoader.lazyChildren(itemsContainer);
});
}
- $(document).on('pageshowready', "#musicRecommendedPage", function () {
+ $(document).on('pagebeforeshowready', "#musicRecommendedPage", function () {
var parentId = LibraryMenu.getTopParentId();
var page = this;
- loadLatest(page, parentId);
- loadPlaylists(page, parentId);
- loadRecentlyPlayed(page, parentId);
- loadFrequentlyPlayed(page, parentId);
-
+ var containers = page.querySelectorAll('.itemsContainer');
if (enableScrollX()) {
- $('.itemsContainer', page).addClass('hiddenScrollX');
+ $(containers).addClass('hiddenScrollX');
} else {
- $('.itemsContainer', page).removeClass('hiddenScrollX');
+ $(containers).removeClass('hiddenScrollX');
+ }
+
+ if (LibraryBrowser.needsRefresh(page)) {
+ loadLatest(page, parentId);
+ loadPlaylists(page, parentId);
+ loadRecentlyPlayed(page, parentId);
+ loadFrequentlyPlayed(page, parentId);
}
});
diff --git a/dashboard-ui/scripts/musicvideos.js b/dashboard-ui/scripts/musicvideos.js
index 05a27a2684..7bf9057302 100644
--- a/dashboard-ui/scripts/musicvideos.js
+++ b/dashboard-ui/scripts/musicvideos.js
@@ -25,7 +25,7 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -65,7 +65,9 @@
});
}
- $('#items', page).html(html).trigger('create').lazyChildren();
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -183,7 +185,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#musicVideosPage", function () {
+ }).on('pagebeforeshowready', "#musicVideosPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/mypreferencesdisplay.js b/dashboard-ui/scripts/mypreferencesdisplay.js
index f0a6c5ecec..37a5a0c37c 100644
--- a/dashboard-ui/scripts/mypreferencesdisplay.js
+++ b/dashboard-ui/scripts/mypreferencesdisplay.js
@@ -236,8 +236,7 @@
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
Dashboard.alert(Globalize.translate('SettingsSaved'));
- loadForm(page, user, false);
-
+ loadForm(page, user);
});
}
diff --git a/dashboard-ui/scripts/mypreferenceswebclient.js b/dashboard-ui/scripts/mypreferenceswebclient.js
index aab149c7a2..48bade203c 100644
--- a/dashboard-ui/scripts/mypreferenceswebclient.js
+++ b/dashboard-ui/scripts/mypreferenceswebclient.js
@@ -41,7 +41,7 @@
ApiClient.updateDisplayPreferences('home', displayPreferences, userId, 'webclient').done(function () {
Dashboard.alert(Globalize.translate('SettingsSaved'));
-
+ Dashboard.hideLoadingMsg();
});
}
diff --git a/dashboard-ui/scripts/myprofile.js b/dashboard-ui/scripts/myprofile.js
index 1f66052383..f475c28603 100644
--- a/dashboard-ui/scripts/myprofile.js
+++ b/dashboard-ui/scripts/myprofile.js
@@ -11,7 +11,7 @@
ApiClient.getUser(userId).done(function (user) {
$('.username', page).html(user.Name);
- $('#uploadUserImage', page).val('').trigger('change');
+ Events.trigger($('#uploadUserImage', page).val('')[0], 'change');
Dashboard.setPageTitle(user.Name);
diff --git a/dashboard-ui/scripts/notifications.js b/dashboard-ui/scripts/notifications.js
index 2c67005118..51d7a9556e 100644
--- a/dashboard-ui/scripts/notifications.js
+++ b/dashboard-ui/scripts/notifications.js
@@ -95,7 +95,13 @@
var query = { StartIndex: startIndex, Limit: limit };
- html += LibraryBrowser.getPagingHtml(query, totalRecordCount, false, limit, false);
+ html += LibraryBrowser.getQueryPagingHtml({
+ startIndex: query.StartIndex,
+ limit: query.Limit,
+ totalRecordCount: totalRecordCount,
+ showLimit: false,
+ updatePageSizeSetting: false
+ });
}
for (var i = 0, length = list.length; i < length; i++) {
diff --git a/dashboard-ui/scripts/nowplayingbar.js b/dashboard-ui/scripts/nowplayingbar.js
index 62a2d24c5b..1039c2846a 100644
--- a/dashboard-ui/scripts/nowplayingbar.js
+++ b/dashboard-ui/scripts/nowplayingbar.js
@@ -5,15 +5,13 @@
var currentTimeElement;
var nowPlayingImageElement;
var nowPlayingTextElement;
+ var nowPlayingUserData;
var unmuteButton;
var muteButton;
var volumeSlider;
- var volumeSliderContainer;
- var isVolumeSliderActive;
var unpauseButton;
var pauseButton;
var positionSlider;
- var isPositionSliderActive;
var lastPlayerState;
@@ -21,35 +19,48 @@
var html = '';
+ // add return false because on iOS clicking the bar often ends up clicking the content underneath.
html += '
';
- html += '
';
- html += '
';
-
- html += '
';
- html += '
';
-
- html += '
';
-
- html += '
';
- html += '
';
-
- html += '
';
-
- html += '
';
-
- html += '
';
-
- html += '
';
- html += '
';
+ html += '
';
+ html += '
';
html += '
';
- html += '
';
- html += '
';
- html += '
';
+ html += '
';
+ html += '
';
+ html += '
';
+ html += '
';
+
+ // The onclicks are needed due to the return false above
+ html += '
';
+
+ html += '
';
+
+ html += '
';
+ html += '
';
+
+ html += '
';
+
+ html += '
';
+
+ html += '
';
+ html += '
';
+
+ html += '
';
+
+ html += '
';
+ html += '
';
+
+ html += '
';
+
+ html += '
';
+ html += '
';
+
+ html += '
';
+ html += '
';
+ html += '
';
+ html += '
';
- html += '
';
- html += ' ';
html += '
';
html += '
';
@@ -59,9 +70,10 @@
function bindEvents(elem) {
- currentTimeElement = $('.currentTime', elem);
+ currentTimeElement = $('.nowPlayingBarCurrentTime', elem);
nowPlayingImageElement = $('.nowPlayingImage', elem);
- nowPlayingTextElement = $('.nowPlayingText', elem);
+ nowPlayingTextElement = $('.nowPlayingBarText', elem);
+ nowPlayingUserData = $('.nowPlayingBarUserDataButtons', elem);
$(elem).on('swipeup', function () {
Dashboard.navigate('nowplaying.html');
@@ -116,28 +128,15 @@
}
});
- volumeSlider = $('.volumeSlider', elem).on('slidestart', function () {
-
- isVolumeSliderActive = true;
-
- }).on('slidestop', function () {
-
- isVolumeSliderActive = false;
+ volumeSlider = $('.nowPlayingBarVolumeSlider', elem).on('change', function () {
if (currentPlayer) {
currentPlayer.setVolume(this.value);
}
- });
- volumeSliderContainer = $('.volumeSliderContainer', elem);
+ })[0];
- positionSlider = $('.positionSlider', elem).on('slidestart', function () {
-
- isPositionSliderActive = true;
-
- }).on('slidestop', function () {
-
- isPositionSliderActive = false;
+ positionSlider = $('.nowPlayingBarPositionSlider', elem).on('change', function () {
if (currentPlayer && lastPlayerState) {
@@ -146,18 +145,40 @@
currentPlayer.seek(Math.floor(newPositionTicks));
}
- });
+
+ })[0];
+
+ positionSlider._setPinValue = function (value) {
+
+ var state = lastPlayerState;
+
+ if (!state || !state.NowPlayingItem || !state.NowPlayingItem.RunTimeTicks) {
+ this.pinValue = '--:--';
+ return;
+ }
+
+ var ticks = state.NowPlayingItem.RunTimeTicks;
+ ticks /= 100;
+ ticks *= value;
+
+ this.pinValue = Dashboard.getDisplayTime(ticks);
+ };
}
function getNowPlayingBar() {
- var elem = $('.nowPlayingBar');
+ var elem = document.querySelector('.nowPlayingBar');
- if (elem.length) {
+ if (elem) {
return elem;
}
- elem = $(getNowPlayingBarHtml()).insertBefore('#footerNotifications').trigger('create');
+ elem = $(getNowPlayingBarHtml()).insertBefore('#footerNotifications')[0];
+
+ if (($.browser.safari || !AppInfo.isNativeApp) && $.browser.mobile) {
+ // Not handled well here. The wrong elements receive events, bar doesn't update quickly enough, etc.
+ elem.classList.add('noMediaProgress');
+ }
bindEvents(elem);
@@ -174,7 +195,7 @@
function updatePlayerState(state) {
- if (state.NowPlayingItem && !$($.mobile.activePage).hasClass('nowPlayingPage')) {
+ if (state.NowPlayingItem) {
showNowPlayingBar();
} else {
hideNowPlayingBar();
@@ -205,27 +226,21 @@
updatePlayerVolumeState(state, playerInfo);
var nowPlayingItem = state.NowPlayingItem || {};
- if (!isPositionSliderActive) {
+ if (!positionSlider.dragging) {
if (nowPlayingItem && nowPlayingItem.RunTimeTicks) {
var pct = playState.PositionTicks / nowPlayingItem.RunTimeTicks;
pct *= 100;
- positionSlider.val(pct);
+ positionSlider.value = pct;
} else {
- positionSlider.val(0);
+ positionSlider.value = 0;
}
- if (playState.CanSeek) {
- positionSlider.slider("enable");
- } else {
- positionSlider.slider("disable");
- }
-
- positionSlider.slider('refresh');
+ positionSlider.disabled = !playState.CanSeek;
}
var timeText = Dashboard.getDisplayTime(playState.PositionTicks);
@@ -256,12 +271,6 @@
var showUnmuteButton = true;
var showVolumeSlider = true;
- //if (supportedCommands.indexOf('SetVolume') == -1) {
- // volumeSlider.prop('disabled', 'disabled');
- //} else {
- // volumeSlider.prop('disabled', '');
- //}
-
if (supportedCommands.indexOf('Mute') == -1) {
showMuteButton = false;
}
@@ -300,17 +309,11 @@
hideButton(unmuteButton);
}
- if (showVolumeSlider) {
- volumeSliderContainer.show();
- } else {
- volumeSliderContainer.hide();
- }
+ $(volumeSlider).visible(showVolumeSlider);
- if (!isVolumeSliderActive) {
- volumeSlider.val(playState.VolumeLevel || 0);
+ if (!volumeSlider.dragging) {
+ volumeSlider.value = playState.VolumeLevel || 0;
}
-
- volumeSlider.slider('refresh');
}
var currentImgUrl;
@@ -324,10 +327,14 @@
nowPlayingTextElement.removeClass('nowPlayingDoubleText');
}
+ if (state.NowPlayingItem.Id) {
+ nameHtml = '
' + nameHtml + ' ';
+ }
+
nowPlayingTextElement.html(nameHtml);
var url;
- var imgHeight = 50;
+ var imgHeight = 90;
var nowPlayingItem = state.NowPlayingItem;
@@ -373,12 +380,22 @@
currentImgUrl = url;
- nowPlayingImageElement.html('
');
+ var imgHtml = '
';
+
+ nowPlayingImageElement.html(imgHtml);
+
+ if (nowPlayingItem.Id) {
+ ApiClient.getItem(Dashboard.getCurrentUserId(), nowPlayingItem.Id).done(function (item) {
+ nowPlayingUserData.html(LibraryBrowser.getUserDataIconsHtml(item, false));
+ });
+ } else {
+ nowPlayingUserData.html('');
+ }
}
function onPlaybackStart(e, state) {
- console.log('nowplaying event: ' + e.type);
+ Logger.log('nowplaying event: ' + e.type);
var player = this;
@@ -391,19 +408,24 @@
var nowPlayingBar = getNowPlayingBar();
- nowPlayingBar.show();
+ $(nowPlayingBar).show();
}
function hideNowPlayingBar() {
// Use a timeout to prevent the bar from hiding and showing quickly
// in the event of a stop->play command
- getNowPlayingBar().hide();
+
+ // Don't call getNowPlayingBar here because we don't want to end up creating it just to hide it
+ var elem = document.getElementsByClassName('nowPlayingBar')[0];
+ if (elem) {
+ elem.style.display = 'none';
+ }
}
function onPlaybackStopped(e, state) {
- console.log('nowplaying event: ' + e.type);
+ Logger.log('nowplaying event: ' + e.type);
var player = this;
player.endPlayerUpdates();
@@ -413,7 +435,7 @@
function onStateChanged(e, state) {
- //console.log('nowplaying event: ' + e.type);
+ //Logger.log('nowplaying event: ' + e.type);
var player = this;
if (player.isDefaultPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
@@ -427,7 +449,12 @@
if (currentPlayer) {
- $(currentPlayer).off('.nowplayingbar');
+ $(currentPlayer).off('playbackstart', onPlaybackStart)
+ .off('playbackstop', onPlaybackStopped)
+ .off('volumechange', onVolumeChanged)
+ .off('playstatechange', onStateChanged)
+ .off('positionchange', onStateChanged);
+
currentPlayer.endPlayerUpdates();
currentPlayer = null;
@@ -464,16 +491,16 @@
onStateChanged.call(player, { type: 'init' }, state);
});
- $(player).on('playbackstart.nowplayingbar', onPlaybackStart)
- .on('playbackstop.nowplayingbar', onPlaybackStopped)
- .on('volumechange.nowplayingbar', onVolumeChanged)
- .on('playstatechange.nowplayingbar', onStateChanged)
- .on('positionchange.nowplayingbar', onStateChanged);
+ $(player).on('playbackstart', onPlaybackStart)
+ .on('playbackstop', onPlaybackStopped)
+ .on('volumechange', onVolumeChanged)
+ .on('playstatechange', onStateChanged)
+ .on('positionchange', onStateChanged);
}
Dashboard.ready(function () {
- $(MediaController).on('playerchange', function () {
+ Events.on(MediaController, 'playerchange', function () {
bindToPlayer(MediaController.getCurrentPlayer());
});
diff --git a/dashboard-ui/scripts/nowplayingpage.js b/dashboard-ui/scripts/nowplayingpage.js
index dd0aed0ec6..e073295dc6 100644
--- a/dashboard-ui/scripts/nowplayingpage.js
+++ b/dashboard-ui/scripts/nowplayingpage.js
@@ -2,7 +2,6 @@
var currentPlayer;
var lastPlayerState;
- var isPositionSliderActive;
function populateChapters(elem, chapters, itemId, runtimeTicks) {
@@ -53,7 +52,9 @@
html += "
";
}
- elem.html(html).trigger('create').lazyChildren();
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
+ $(elem).trigger('create');
}
function selectCurrentChapter(elem, positionTicks) {
@@ -70,30 +71,31 @@
var chapterElem = matches[matches.length - 1];
- $(chapterElem).addClass('currentChapter');
+ chapterElem.classList.add('currentChapter');
chapterElem.scrollIntoView();
- elem[0].scrollLeft += 50;
+ elem.scrollLeft += 50;
}
function showChapterMenu(page, item, currentPositionTicks) {
$('.chapterMenuOverlay', page).show();
- var elem = $('.chapterMenu', page).show();
+ var elem = page.querySelector('.chapterMenu');
+ $(elem).show();
- if (item.Id == elem.attr('data-itemid')) {
+ if (item.Id == elem.getAttribute('data-itemid')) {
selectCurrentChapter(elem, currentPositionTicks);
return;
}
- var innerElem = $('.chapterMenuInner', elem);
+ var innerElem = elem.querySelector('.chapterMenuInner');
populateChapters(innerElem, item.Chapters, item.Id, item.RunTimeTicks);
- elem.attr('data-itemid', item.Id);
+ elem.setAttribute('data-itemid', item.Id);
selectCurrentChapter(elem, currentPositionTicks);
}
@@ -104,125 +106,106 @@
$('.chapterMenu', page).hide();
}
- function showAudioMenu(page, item, currentIndex) {
+ function showAudioMenu(page, button, item, currentIndex) {
var streams = (item.MediaStreams || []).filter(function (i) {
return i.Type == 'Audio';
});
- var elem = $('#popupAudioTrackMenu', page);
+ var menuItems = streams.map(function (s) {
- var html = '
';
-
- $('.trackList', elem).html(html).trigger('create');
-
- elem.popup('open');
+ });
}
- function showSubtitleMenu(page, item, currentIndex) {
-
- var currentStreamImage = '
';
+ function showSubtitleMenu(page, button, item, currentIndex) {
var streams = (item.MediaStreams || []).filter(function (i) {
return i.Type == 'Subtitle';
});
- var elem = $('#popupSubtitleTrackMenu', page);
+ var menuItems = streams.map(function (s) {
- var html = '
';
+ ActionSheetElement.show({
+ items: menuItems,
+ positionTo: button,
+ callback: function (id) {
- $('.trackList', elem).html(html).trigger('create');
+ currentPlayer.setSubtitleStreamIndex(parseInt(id));
+ }
+ });
- elem.popup('open');
+ });
}
function bindEvents(page) {
@@ -264,35 +247,12 @@
}
});
- $('#popupAudioTrackMenu', page).on('click', '.lnkTrackOption', function () {
-
- if (currentPlayer && lastPlayerState) {
-
- var index = this.getAttribute('data-index');
-
- currentPlayer.setAudioStreamIndex(parseInt(index));
-
- $('#popupAudioTrackMenu', page).popup('close');
- }
- });
-
- $('#popupSubtitleTrackMenu', page).on('click', '.lnkTrackOption', function () {
-
- if (currentPlayer && lastPlayerState) {
- var index = this.getAttribute('data-index');
-
- currentPlayer.setSubtitleStreamIndex(parseInt(index));
-
- $('#popupSubtitleTrackMenu', page).popup('close');
- }
- });
-
$('.btnAudioTracks', page).on('click', function () {
if (currentPlayer && lastPlayerState && lastPlayerState.PlayState) {
var currentIndex = lastPlayerState.PlayState.AudioStreamIndex;
- showAudioMenu(page, lastPlayerState.NowPlayingItem, currentIndex);
+ showAudioMenu(page, this, lastPlayerState.NowPlayingItem, currentIndex);
}
});
@@ -301,7 +261,7 @@
if (currentPlayer && lastPlayerState && lastPlayerState.PlayState) {
var currentIndex = lastPlayerState.PlayState.SubtitleStreamIndex;
- showSubtitleMenu(page, lastPlayerState.NowPlayingItem, currentIndex);
+ showSubtitleMenu(page, this, lastPlayerState.NowPlayingItem, currentIndex);
}
});
@@ -349,28 +309,33 @@
}
});
- $('.positionSlider', page).on('slidestart', function () {
+ $('.nowPlayingPositionSlider', page).on('change', function () {
- isPositionSliderActive = true;
-
- }).on('slidestop', function () {
-
- isPositionSliderActive = false;
+ var value = this.value;
if (currentPlayer && lastPlayerState) {
- var newPercent = parseFloat(this.value);
+ var newPercent = parseFloat(value);
var newPositionTicks = (newPercent / 100) * lastPlayerState.NowPlayingItem.RunTimeTicks;
-
currentPlayer.seek(Math.floor(newPositionTicks));
}
});
- $(page).on('swipedown', function () {
+ $('.nowPlayingPositionSlider', page)[0]._setPinValue = function (value) {
- document.title = new Date().getTime();
- history.back();
- });
+ var state = lastPlayerState;
+
+ if (!state || !state.NowPlayingItem || !state.NowPlayingItem.RunTimeTicks) {
+ this.pinValue = '--:--';
+ return;
+ }
+
+ var ticks = state.NowPlayingItem.RunTimeTicks;
+ ticks /= 100;
+ ticks *= value;
+
+ this.pinValue = Dashboard.getDisplayTime(ticks);
+ };
$(page).on('click', '.lnkPlayFromIndex', function () {
@@ -387,7 +352,7 @@
loadPlaylist(page);
});
- $(page).on('click', '.mediaItem', onListItemClick);
+ Events.on(page, 'click', '.mediaItem', onListItemClick);
}
function onPlaybackStart(e, state) {
@@ -397,6 +362,7 @@
player.beginPlayerUpdates();
onStateChanged.call(player, e, state);
+ loadPlaylist($.mobile.activePage);
}
function onPlaybackStopped(e, state) {
@@ -406,11 +372,12 @@
player.endPlayerUpdates();
onStateChanged.call(player, e, {});
+ loadPlaylist($.mobile.activePage);
}
function onStateChanged(e, state) {
- updatePlayerState($.mobile.activePage, state);
+ updatePlayerState($($.mobile.activePage)[0], state);
}
function showButton(button) {
@@ -472,29 +439,23 @@
hideButton(btnPlay);
}
- if (!isPositionSliderActive) {
+ var positionSlider = $('.nowPlayingPositionSlider', page)[0];
- var positionSlider = $('.positionSlider', page);
+ if (!positionSlider.dragging) {
if (item && item.RunTimeTicks) {
var pct = playState.PositionTicks / item.RunTimeTicks;
pct *= 100;
- positionSlider.val(pct);
+ positionSlider.value = pct;
} else {
- positionSlider.val(0);
+ positionSlider.value = 0;
}
- if (playState.CanSeek) {
- positionSlider.slider("enable");
- } else {
- positionSlider.slider("disable");
- }
-
- positionSlider.slider('refresh');
+ positionSlider.disabled = !playState.CanSeek;
}
if (playState.PositionTicks == null) {
@@ -515,6 +476,20 @@
$('.videoButton', page).css('visibility', 'hidden');
}
+ if (playerInfo.isLocalPlayer && AppInfo.hasPhysicalVolumeButtons) {
+ $('.volumeButton', page).css('visibility', 'hidden');
+ } else {
+ $('.volumeButton', page).css('visibility', 'visible');
+ }
+
+ if (playerInfo.isLocalPlayer && AppInfo.hasPhysicalVolumeButtons && item && item.MediaType == 'Audio') {
+ $('.buttonsRow2', page).hide();
+ $('.buttonsRow3', page).hide();
+ } else {
+ $('.buttonsRow2', page).show();
+ $('.buttonsRow3', page).show();
+ }
+
updateNowPlayingInfo(page, state);
}
@@ -522,8 +497,9 @@
function updateNowPlayingInfo(page, state) {
var item = state.NowPlayingItem;
+ var displayName = item ? MediaController.getNowPlayingNameHtml(item).replace('
', ' - ') : '';
- $('.itemName', page).html(item ? MediaController.getNowPlayingNameHtml(item) : '');
+ $('.nowPlayingPageTitle', page).html(displayName).visible(displayName.length > 0);
var url;
var backdropUrl = null;
@@ -574,6 +550,14 @@
setImageUrl(page, url);
Backdrops.setBackdropUrl(page, backdropUrl);
+
+ if (item) {
+ ApiClient.getItem(Dashboard.getCurrentUserId(), item.Id).done(function (fullItem) {
+ page.querySelector('.nowPlayingPageUserDataButtons').innerHTML = LibraryBrowser.getUserDataIconsHtml(fullItem, false);
+ });
+ } else {
+ page.querySelector('.nowPlayingPageUserDataButtons').innerHTML = '';
+ }
}
function setImageUrl(page, url) {
@@ -595,7 +579,12 @@
if (currentPlayer) {
- $(currentPlayer).off('.nowplayingpage');
+ $(currentPlayer).off('playbackstart', onPlaybackStart)
+ .off('playbackstop', onPlaybackStopped)
+ .off('volumechange', onStateChanged)
+ .off('playstatechange', onStateChanged)
+ .off('positionchange', onStateChanged);
+
currentPlayer.endPlayerUpdates();
currentPlayer = null;
}
@@ -616,11 +605,11 @@
onStateChanged.call(player, { type: 'init' }, state);
});
- $(player).on('playbackstart.nowplayingpage', onPlaybackStart)
- .on('playbackstop.nowplayingpage', onPlaybackStopped)
- .on('volumechange.nowplayingpage', onStateChanged)
- .on('playstatechange.nowplayingpage', onStateChanged)
- .on('positionchange.nowplayingpage', onStateChanged);
+ $(player).on('playbackstart', onPlaybackStart)
+ .on('playbackstop', onPlaybackStopped)
+ .on('volumechange', onStateChanged)
+ .on('playstatechange', onStateChanged)
+ .on('positionchange', onStateChanged);
var playerInfo = MediaController.getPlayerInfo();
@@ -629,20 +618,6 @@
updateSupportedCommands(page, supportedCommands);
}
- function showIntro() {
-
- var expected = '2';
-
- if (appStorage.getItem('remotecontrolswipedown') != expected) {
- Dashboard.alert({
- message: Globalize.translate('MessageSwipeDownOnRemoteControl'),
- title: Globalize.translate('HeaderAlert')
- });
- appStorage.setItem('remotecontrolswipedown', expected);
- }
-
- }
-
function loadPlaylist(page) {
var html = '';
@@ -674,7 +649,10 @@
smallIcon: true
});
- $(".playlist", page).html(html).trigger('create').lazyChildren();
+ var itemsContainer = page.querySelector('.playlist');
+ itemsContainer.innerHTML = html;
+ ImageLoader.lazyChildren(itemsContainer);
+ $(itemsContainer).trigger('create');
}
function onListItemClick(e) {
@@ -688,7 +666,7 @@
function getBackdropUrl(item) {
- var screenWidth = Math.max(screen.height, screen.width);
+ var screenWidth = screen.availWidth;
if (item.BackdropImageTags && item.BackdropImageTags.length) {
@@ -714,6 +692,45 @@
return null;
};
+ function updateCastIcon() {
+
+ var info = MediaController.getPlayerInfo();
+
+ if (info.isLocalPlayer) {
+
+ $('.nowPlayingCastIcon').each(function () {
+ this.icon = 'cast';
+ });
+ $('.headerSelectedPlayer').html('');
+
+ } else {
+
+ $('.nowPlayingCastIcon').each(function () {
+ this.icon = 'cast-connected';
+ });
+
+ $('.headerSelectedPlayer').html((info.deviceName || info.name));
+ }
+ }
+
+ function allowSwipe(e) {
+
+ var target = $(e.target);
+
+ if (target.is('.noSwipe')) {
+ return false;
+ }
+ if (target.parents('.noSwipe').length) {
+ return false;
+ }
+
+ return true;
+ }
+
+ function onPlayerChange() {
+ bindToPlayer($($.mobile.activePage)[0], MediaController.getCurrentPlayer());
+ }
+
$(document).on('pageinitdepends', "#nowPlayingPage", function () {
var page = this;
@@ -723,40 +740,77 @@
$('.sendMessageForm').off('submit', NowPlayingPage.onMessageSubmit).on('submit', NowPlayingPage.onMessageSubmit);
$('.typeTextForm').off('submit', NowPlayingPage.onSendStringSubmit).on('submit', NowPlayingPage.onSendStringSubmit);
- }).on('pageshowready', "#nowPlayingPage", function () {
+ $('.requiresJqmCreate', this).trigger('create');
+ $(page).on('swipeleft', function (e) {
+
+ if (allowSwipe(e)) {
+ var pages = this.querySelectorAll('neon-animated-pages')[0];
+ var tabs = this.querySelectorAll('paper-tabs')[0];
+
+ var selected = parseInt(pages.selected || '0');
+ if (selected < 2) {
+ pages.entryAnimation = 'slide-from-right-animation';
+ pages.exitAnimation = 'slide-left-animation';
+ tabs.selectNext();
+ }
+ }
+ });
+
+ $(page).on('swiperight', function (e) {
+
+ if (allowSwipe(e)) {
+ var pages = this.querySelectorAll('neon-animated-pages')[0];
+ var tabs = this.querySelectorAll('paper-tabs')[0];
+
+ var selected = parseInt(pages.selected || '0');
+ if (selected > 0) {
+ pages.entryAnimation = 'slide-from-left-animation';
+ pages.exitAnimation = 'slide-right-animation';
+ tabs.selectPrevious();
+ }
+ }
+ });
+
+ $(MediaController).on('playerchange', function () {
+ updateCastIcon(page);
+ });
+
+ $('paper-tabs').on('iron-select', function () {
+ page.querySelectorAll('neon-animated-pages')[0].selected = this.selected;
+ });
+
+ }).on('pagebeforeshowready', "#nowPlayingPage", function () {
+
+ $(document.body).addClass('hiddenViewMenuBar').addClass('hiddenNowPlayingBar');
var page = this;
currentImgUrl = null;
- var tab = getParameterByName('tab');
- if (tab) {
- $('.tabButton' + tab, page).trigger('click');
- } else {
- $('.tabButton:first', page).trigger('click');
- }
+ Dashboard.ready(function () {
- $(function () {
-
- $(MediaController).on('playerchange.nowplayingpage', function () {
-
- bindToPlayer(page, MediaController.getCurrentPlayer());
- });
+ $(MediaController).on('playerchange', onPlayerChange);
bindToPlayer(page, MediaController.getCurrentPlayer());
});
- showIntro();
loadPlaylist(page);
- }).on('pagehide', "#nowPlayingPage", function () {
+ var tab = getParameterByName('tab');
+ var selected = tab == 'Playlist' ? 2 : 0;;
+ this.querySelectorAll('paper-tabs')[0].selected = selected;
+
+ updateCastIcon(page);
+
+ }).on('pagebeforehide', "#nowPlayingPage", function () {
releaseCurrentPlayer();
- $(MediaController).off('playerchange.nowplayingpage');
+ $(MediaController).off('playerchange', onPlayerChange);
lastPlayerState = null;
+ $(document.body).removeClass('hiddenViewMenuBar').removeClass('hiddenNowPlayingBar');
});
window.NowPlayingPage = {
diff --git a/dashboard-ui/scripts/photos.js b/dashboard-ui/scripts/photos.js
index 328166f603..a596ea7efc 100644
--- a/dashboard-ui/scripts/photos.js
+++ b/dashboard-ui/scripts/photos.js
@@ -25,7 +25,7 @@
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
@@ -36,7 +36,7 @@
showLimit: false
});
- $('.listTopPaging', page).html(pagingHtml).trigger('create');
+ page.querySelector('.listTopPaging').innerHTML = pagingHtml;
updateFilterControls(page);
@@ -65,9 +65,9 @@
});
}
- var elem = $('#items', page).html(html).lazyChildren();
-
- $(pagingHtml).appendTo(elem).trigger('create');
+ var elem = page.querySelector('#items');
+ elem.innerHTML = html + pagingHtml;
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -282,7 +282,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#photosPage", function () {
+ }).on('pagebeforeshowready', "#photosPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/playlistedit.js b/dashboard-ui/scripts/playlistedit.js
index 5cb5d5ee4b..b3d24ce118 100644
--- a/dashboard-ui/scripts/playlistedit.js
+++ b/dashboard-ui/scripts/playlistedit.js
@@ -73,7 +73,7 @@
}
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -81,8 +81,9 @@
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
- viewButton: true,
- showLimit: false
+ showLimit: false,
+ updatePageSizeSetting: false
+
})).trigger('create');
updateFilterControls(page);
@@ -111,7 +112,10 @@
$('.noItemsMessage', page).show();
}
- $('.itemsContainer', page).html(html).trigger('create').lazyChildren();
+ var elem = page.querySelector('.itemsContainer');
+ elem.innerHTML = html;
+ $(elem).trigger('create');
+ ImageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@@ -171,20 +175,12 @@
}).checkboxradio('refresh');
$('#selectView', page).val(view).selectmenu('refresh');
-
- $('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
}
$(document).on('pageinitdepends', "#playlistEditorPage", function () {
var page = this;
- $('#selectPageSize', page).on('change', function () {
- query.Limit = parseInt(this.value);
- query.StartIndex = 0;
- reloadItems(page);
- });
-
$('.btnPlay', page).on('click', function () {
var userdata = currentItem.UserData || {};
@@ -194,7 +190,7 @@
mediaType = "Audio";
}
- LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, currentItem.IsFolder, mediaType, userdata.PlaybackPositionTicks);
+ LibraryBrowser.showPlayMenu(null, currentItem.Id, currentItem.Type, currentItem.IsFolder, mediaType, userdata.PlaybackPositionTicks);
});
$('.itemsContainer', page).on('needsrefresh', function () {
@@ -215,7 +211,7 @@
});
- }).on('pageshowready', "#playlistEditorPage", function () {
+ }).on('pagebeforeshowready', "#playlistEditorPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/playlists.js b/dashboard-ui/scripts/playlists.js
index 3dcc1aa733..48493667c6 100644
--- a/dashboard-ui/scripts/playlists.js
+++ b/dashboard-ui/scripts/playlists.js
@@ -20,11 +20,11 @@
function showLoadingMessage(page) {
- $('.popupLoading', page).popup('open');
+ Dashboard.showLoadingMsg();
}
function hideLoadingMessage(page) {
- $('.popupLoading', page).popup('close');
+ Dashboard.hideLoadingMsg();
}
function reloadItems(page) {
@@ -40,7 +40,7 @@
var user = response2[0];
// Scroll back up so they can see the results from the beginning
- $(document).scrollTop(0);
+ window.scrollTo(0, 0);
var html = '';
@@ -86,10 +86,12 @@
$('.noItemsMessage', page).show();
}
- $('.itemsContainer', page).html(html).lazyChildren();
+ var elem = page.querySelector('.itemsContainer');
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
if (trigger) {
- $('.itemsContainer', page).trigger('create');
+ $(elem).trigger('create');
}
$('.btnNextPage', page).on('click', function () {
@@ -183,7 +185,7 @@
reloadItems(page);
});
- }).on('pageshowready', "#playlistsPage", function () {
+ }).on('pagebeforeshowready', "#playlistsPage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/pluginspage.js b/dashboard-ui/scripts/pluginspage.js
index 2e5c637774..0624797a0d 100644
--- a/dashboard-ui/scripts/pluginspage.js
+++ b/dashboard-ui/scripts/pluginspage.js
@@ -84,8 +84,8 @@
html += '