@p4ulcristian/iris-layout 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/cljs-runtime/cljs.core.js +38746 -0
  2. package/dist/cljs-runtime/cljs.core.js.map +1 -0
  3. package/dist/cljs-runtime/cljs.pprint.js +8400 -0
  4. package/dist/cljs-runtime/cljs.pprint.js.map +1 -0
  5. package/dist/cljs-runtime/cljs.stacktrace.js +561 -0
  6. package/dist/cljs-runtime/cljs.stacktrace.js.map +1 -0
  7. package/dist/cljs-runtime/cljs_env.js +1286 -0
  8. package/dist/cljs-runtime/clojure.data.js +295 -0
  9. package/dist/cljs-runtime/clojure.data.js.map +1 -0
  10. package/dist/cljs-runtime/clojure.set.js +382 -0
  11. package/dist/cljs-runtime/clojure.set.js.map +1 -0
  12. package/dist/cljs-runtime/clojure.string.js +480 -0
  13. package/dist/cljs-runtime/clojure.string.js.map +1 -0
  14. package/dist/cljs-runtime/clojure.walk.js +132 -0
  15. package/dist/cljs-runtime/clojure.walk.js.map +1 -0
  16. package/dist/cljs-runtime/devtools.async.js +90 -0
  17. package/dist/cljs-runtime/devtools.async.js.map +1 -0
  18. package/dist/cljs-runtime/devtools.context.js +11 -0
  19. package/dist/cljs-runtime/devtools.context.js.map +1 -0
  20. package/dist/cljs-runtime/devtools.core.js +175 -0
  21. package/dist/cljs-runtime/devtools.core.js.map +1 -0
  22. package/dist/cljs-runtime/devtools.defaults.js +20 -0
  23. package/dist/cljs-runtime/devtools.defaults.js.map +1 -0
  24. package/dist/cljs-runtime/devtools.format.js +631 -0
  25. package/dist/cljs-runtime/devtools.format.js.map +1 -0
  26. package/dist/cljs-runtime/devtools.formatters.budgeting.js +182 -0
  27. package/dist/cljs-runtime/devtools.formatters.budgeting.js.map +1 -0
  28. package/dist/cljs-runtime/devtools.formatters.core.js +220 -0
  29. package/dist/cljs-runtime/devtools.formatters.core.js.map +1 -0
  30. package/dist/cljs-runtime/devtools.formatters.helpers.js +228 -0
  31. package/dist/cljs-runtime/devtools.formatters.helpers.js.map +1 -0
  32. package/dist/cljs-runtime/devtools.formatters.js +261 -0
  33. package/dist/cljs-runtime/devtools.formatters.js.map +1 -0
  34. package/dist/cljs-runtime/devtools.formatters.markup.js +1174 -0
  35. package/dist/cljs-runtime/devtools.formatters.markup.js.map +1 -0
  36. package/dist/cljs-runtime/devtools.formatters.printing.js +313 -0
  37. package/dist/cljs-runtime/devtools.formatters.printing.js.map +1 -0
  38. package/dist/cljs-runtime/devtools.formatters.state.js +325 -0
  39. package/dist/cljs-runtime/devtools.formatters.state.js.map +1 -0
  40. package/dist/cljs-runtime/devtools.formatters.templating.js +666 -0
  41. package/dist/cljs-runtime/devtools.formatters.templating.js.map +1 -0
  42. package/dist/cljs-runtime/devtools.hints.js +193 -0
  43. package/dist/cljs-runtime/devtools.hints.js.map +1 -0
  44. package/dist/cljs-runtime/devtools.munging.js +1058 -0
  45. package/dist/cljs-runtime/devtools.munging.js.map +1 -0
  46. package/dist/cljs-runtime/devtools.prefs.js +87 -0
  47. package/dist/cljs-runtime/devtools.prefs.js.map +1 -0
  48. package/dist/cljs-runtime/devtools.preload.js +11 -0
  49. package/dist/cljs-runtime/devtools.preload.js.map +1 -0
  50. package/dist/cljs-runtime/devtools.protocols.js +98 -0
  51. package/dist/cljs-runtime/devtools.protocols.js.map +1 -0
  52. package/dist/cljs-runtime/devtools.reporter.js +81 -0
  53. package/dist/cljs-runtime/devtools.reporter.js.map +1 -0
  54. package/dist/cljs-runtime/devtools.toolbox.js +141 -0
  55. package/dist/cljs-runtime/devtools.toolbox.js.map +1 -0
  56. package/dist/cljs-runtime/devtools.util.js +517 -0
  57. package/dist/cljs-runtime/devtools.util.js.map +1 -0
  58. package/dist/cljs-runtime/devtools.version.js +9 -0
  59. package/dist/cljs-runtime/devtools.version.js.map +1 -0
  60. package/dist/cljs-runtime/goog.array.array.js +659 -0
  61. package/dist/cljs-runtime/goog.array.array.js.map +9 -0
  62. package/dist/cljs-runtime/goog.asserts.asserts.js +133 -0
  63. package/dist/cljs-runtime/goog.asserts.asserts.js.map +9 -0
  64. package/dist/cljs-runtime/goog.asserts.dom.js +90 -0
  65. package/dist/cljs-runtime/goog.asserts.dom.js.map +9 -0
  66. package/dist/cljs-runtime/goog.async.nexttick.js +93 -0
  67. package/dist/cljs-runtime/goog.async.nexttick.js.map +9 -0
  68. package/dist/cljs-runtime/goog.base.js +1261 -0
  69. package/dist/cljs-runtime/goog.base.js.map +9 -0
  70. package/dist/cljs-runtime/goog.collections.maps.js +82 -0
  71. package/dist/cljs-runtime/goog.collections.maps.js.map +9 -0
  72. package/dist/cljs-runtime/goog.debug.entrypointregistry.js +44 -0
  73. package/dist/cljs-runtime/goog.debug.entrypointregistry.js.map +9 -0
  74. package/dist/cljs-runtime/goog.debug.error.js +30 -0
  75. package/dist/cljs-runtime/goog.debug.error.js.map +9 -0
  76. package/dist/cljs-runtime/goog.dom.asserts.js +40 -0
  77. package/dist/cljs-runtime/goog.dom.asserts.js.map +9 -0
  78. package/dist/cljs-runtime/goog.dom.browserfeature.js +21 -0
  79. package/dist/cljs-runtime/goog.dom.browserfeature.js.map +9 -0
  80. package/dist/cljs-runtime/goog.dom.dom.js +1087 -0
  81. package/dist/cljs-runtime/goog.dom.dom.js.map +9 -0
  82. package/dist/cljs-runtime/goog.dom.element.js +69 -0
  83. package/dist/cljs-runtime/goog.dom.element.js.map +9 -0
  84. package/dist/cljs-runtime/goog.dom.htmlelement.js +7 -0
  85. package/dist/cljs-runtime/goog.dom.htmlelement.js.map +9 -0
  86. package/dist/cljs-runtime/goog.dom.nodetype.js +6 -0
  87. package/dist/cljs-runtime/goog.dom.nodetype.js.map +9 -0
  88. package/dist/cljs-runtime/goog.dom.safe.js +277 -0
  89. package/dist/cljs-runtime/goog.dom.safe.js.map +9 -0
  90. package/dist/cljs-runtime/goog.dom.tagname.js +147 -0
  91. package/dist/cljs-runtime/goog.dom.tagname.js.map +9 -0
  92. package/dist/cljs-runtime/goog.dom.tags.js +10 -0
  93. package/dist/cljs-runtime/goog.dom.tags.js.map +9 -0
  94. package/dist/cljs-runtime/goog.flags.flags.js +12 -0
  95. package/dist/cljs-runtime/goog.flags.flags.js.map +9 -0
  96. package/dist/cljs-runtime/goog.fs.blob.js +38 -0
  97. package/dist/cljs-runtime/goog.fs.blob.js.map +9 -0
  98. package/dist/cljs-runtime/goog.fs.url.js +37 -0
  99. package/dist/cljs-runtime/goog.fs.url.js.map +9 -0
  100. package/dist/cljs-runtime/goog.functions.functions.js +211 -0
  101. package/dist/cljs-runtime/goog.functions.functions.js.map +9 -0
  102. package/dist/cljs-runtime/goog.html.safehtml.js +321 -0
  103. package/dist/cljs-runtime/goog.html.safehtml.js.map +9 -0
  104. package/dist/cljs-runtime/goog.html.safescript.js +65 -0
  105. package/dist/cljs-runtime/goog.html.safescript.js.map +9 -0
  106. package/dist/cljs-runtime/goog.html.safestyle.js +175 -0
  107. package/dist/cljs-runtime/goog.html.safestyle.js.map +9 -0
  108. package/dist/cljs-runtime/goog.html.safestylesheet.js +99 -0
  109. package/dist/cljs-runtime/goog.html.safestylesheet.js.map +9 -0
  110. package/dist/cljs-runtime/goog.html.safeurl.js +231 -0
  111. package/dist/cljs-runtime/goog.html.safeurl.js.map +9 -0
  112. package/dist/cljs-runtime/goog.html.trustedresourceurl.js +123 -0
  113. package/dist/cljs-runtime/goog.html.trustedresourceurl.js.map +9 -0
  114. package/dist/cljs-runtime/goog.html.trustedtypes.js +16 -0
  115. package/dist/cljs-runtime/goog.html.trustedtypes.js.map +9 -0
  116. package/dist/cljs-runtime/goog.html.uncheckedconversions.js +52 -0
  117. package/dist/cljs-runtime/goog.html.uncheckedconversions.js.map +9 -0
  118. package/dist/cljs-runtime/goog.labs.useragent.browser.js +352 -0
  119. package/dist/cljs-runtime/goog.labs.useragent.browser.js.map +9 -0
  120. package/dist/cljs-runtime/goog.labs.useragent.engine.js +73 -0
  121. package/dist/cljs-runtime/goog.labs.useragent.engine.js.map +9 -0
  122. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js +14 -0
  123. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js.map +9 -0
  124. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js +74 -0
  125. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js.map +9 -0
  126. package/dist/cljs-runtime/goog.labs.useragent.platform.js +147 -0
  127. package/dist/cljs-runtime/goog.labs.useragent.platform.js.map +9 -0
  128. package/dist/cljs-runtime/goog.labs.useragent.useragent.js +21 -0
  129. package/dist/cljs-runtime/goog.labs.useragent.useragent.js.map +9 -0
  130. package/dist/cljs-runtime/goog.labs.useragent.util.js +81 -0
  131. package/dist/cljs-runtime/goog.labs.useragent.util.js.map +9 -0
  132. package/dist/cljs-runtime/goog.math.coordinate.js +97 -0
  133. package/dist/cljs-runtime/goog.math.coordinate.js.map +9 -0
  134. package/dist/cljs-runtime/goog.math.integer.js +445 -0
  135. package/dist/cljs-runtime/goog.math.integer.js.map +9 -0
  136. package/dist/cljs-runtime/goog.math.long.js +437 -0
  137. package/dist/cljs-runtime/goog.math.long.js.map +9 -0
  138. package/dist/cljs-runtime/goog.math.math.js +158 -0
  139. package/dist/cljs-runtime/goog.math.math.js.map +9 -0
  140. package/dist/cljs-runtime/goog.math.size.js +76 -0
  141. package/dist/cljs-runtime/goog.math.size.js.map +9 -0
  142. package/dist/cljs-runtime/goog.object.object.js +284 -0
  143. package/dist/cljs-runtime/goog.object.object.js.map +9 -0
  144. package/dist/cljs-runtime/goog.reflect.reflect.js +32 -0
  145. package/dist/cljs-runtime/goog.reflect.reflect.js.map +9 -0
  146. package/dist/cljs-runtime/goog.string.const.js +35 -0
  147. package/dist/cljs-runtime/goog.string.const.js.map +9 -0
  148. package/dist/cljs-runtime/goog.string.internal.js +119 -0
  149. package/dist/cljs-runtime/goog.string.internal.js.map +9 -0
  150. package/dist/cljs-runtime/goog.string.string.js +462 -0
  151. package/dist/cljs-runtime/goog.string.string.js.map +9 -0
  152. package/dist/cljs-runtime/goog.string.stringbuffer.js +32 -0
  153. package/dist/cljs-runtime/goog.string.stringbuffer.js.map +9 -0
  154. package/dist/cljs-runtime/goog.string.typedstring.js +9 -0
  155. package/dist/cljs-runtime/goog.string.typedstring.js.map +9 -0
  156. package/dist/cljs-runtime/goog.structs.structs.js +199 -0
  157. package/dist/cljs-runtime/goog.structs.structs.js.map +9 -0
  158. package/dist/cljs-runtime/goog.uri.uri.js +628 -0
  159. package/dist/cljs-runtime/goog.uri.uri.js.map +9 -0
  160. package/dist/cljs-runtime/goog.uri.utils.js +326 -0
  161. package/dist/cljs-runtime/goog.uri.utils.js.map +9 -0
  162. package/dist/cljs-runtime/goog.useragent.useragent.js +139 -0
  163. package/dist/cljs-runtime/goog.useragent.useragent.js.map +9 -0
  164. package/dist/cljs-runtime/iris_layout.components.entity_card_group.js +202 -0
  165. package/dist/cljs-runtime/iris_layout.components.entity_card_group.js.map +1 -0
  166. package/dist/cljs-runtime/iris_layout.components.entity_tile.js +295 -0
  167. package/dist/cljs-runtime/iris_layout.components.entity_tile.js.map +1 -0
  168. package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js +33 -0
  169. package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js.map +1 -0
  170. package/dist/cljs-runtime/iris_layout.components.resizer.js +91 -0
  171. package/dist/cljs-runtime/iris_layout.components.resizer.js.map +1 -0
  172. package/dist/cljs-runtime/iris_layout.components.touch_drag.js +399 -0
  173. package/dist/cljs-runtime/iris_layout.components.touch_drag.js.map +1 -0
  174. package/dist/cljs-runtime/iris_layout.core.js +1372 -0
  175. package/dist/cljs-runtime/iris_layout.core.js.map +1 -0
  176. package/dist/cljs-runtime/iris_layout.layout.js +328 -0
  177. package/dist/cljs-runtime/iris_layout.layout.js.map +1 -0
  178. package/dist/cljs-runtime/reagent.core.js +993 -0
  179. package/dist/cljs-runtime/reagent.core.js.map +1 -0
  180. package/dist/cljs-runtime/reagent.debug.js +75 -0
  181. package/dist/cljs-runtime/reagent.debug.js.map +1 -0
  182. package/dist/cljs-runtime/reagent.impl.batching.js +270 -0
  183. package/dist/cljs-runtime/reagent.impl.batching.js.map +1 -0
  184. package/dist/cljs-runtime/reagent.impl.component.js +758 -0
  185. package/dist/cljs-runtime/reagent.impl.component.js.map +1 -0
  186. package/dist/cljs-runtime/reagent.impl.input.js +175 -0
  187. package/dist/cljs-runtime/reagent.impl.input.js.map +1 -0
  188. package/dist/cljs-runtime/reagent.impl.protocols.js +99 -0
  189. package/dist/cljs-runtime/reagent.impl.protocols.js.map +1 -0
  190. package/dist/cljs-runtime/reagent.impl.template.js +660 -0
  191. package/dist/cljs-runtime/reagent.impl.template.js.map +1 -0
  192. package/dist/cljs-runtime/reagent.impl.util.js +748 -0
  193. package/dist/cljs-runtime/reagent.impl.util.js.map +1 -0
  194. package/dist/cljs-runtime/reagent.ratom.js +1668 -0
  195. package/dist/cljs-runtime/reagent.ratom.js.map +1 -0
  196. package/dist/cljs-runtime/shadow.esm.esm_import$react.js +5 -0
  197. package/dist/cljs-runtime/shadow.module.iris-layout.append.js +2 -0
  198. package/dist/cljs-runtime/shadow.module.iris-layout.prepend.js +2 -0
  199. package/dist/iris-layout.js +375 -355
  200. package/dist/styles.css +287 -9
  201. package/package.json +1 -1
@@ -0,0 +1,1087 @@
1
+ import "./cljs_env.js";
2
+ import "./goog.array.array.js";
3
+ import "./goog.asserts.asserts.js";
4
+ import "./goog.asserts.dom.js";
5
+ import "./goog.dom.browserfeature.js";
6
+ import "./goog.dom.nodetype.js";
7
+ import "./goog.dom.tagname.js";
8
+ import "./goog.dom.safe.js";
9
+ import "./goog.html.safehtml.js";
10
+ import "./goog.html.uncheckedconversions.js";
11
+ import "./goog.math.coordinate.js";
12
+ import "./goog.math.size.js";
13
+ import "./goog.object.object.js";
14
+ import "./goog.string.string.js";
15
+ import "./goog.string.const.js";
16
+ import "./goog.useragent.useragent.js";
17
+ goog.provide("goog.dom");
18
+ goog.provide("goog.dom.Appendable");
19
+ goog.provide("goog.dom.DomHelper");
20
+ goog.require("goog.array");
21
+ goog.require("goog.asserts");
22
+ goog.require("goog.asserts.dom");
23
+ goog.require("goog.dom.BrowserFeature");
24
+ goog.require("goog.dom.NodeType");
25
+ goog.require("goog.dom.TagName");
26
+ goog.require("goog.dom.safe");
27
+ goog.require("goog.html.SafeHtml");
28
+ goog.require("goog.html.uncheckedconversions");
29
+ goog.require("goog.math.Coordinate");
30
+ goog.require("goog.math.Size");
31
+ goog.require("goog.object");
32
+ goog.require("goog.string");
33
+ goog.require("goog.string.Const");
34
+ goog.require("goog.string.Unicode");
35
+ goog.require("goog.userAgent");
36
+ goog.dom.ASSUME_QUIRKS_MODE = goog.define("goog.dom.ASSUME_QUIRKS_MODE", false);
37
+ goog.dom.ASSUME_STANDARDS_MODE = goog.define("goog.dom.ASSUME_STANDARDS_MODE", false);
38
+ goog.dom.COMPAT_MODE_KNOWN_ = goog.dom.ASSUME_QUIRKS_MODE || goog.dom.ASSUME_STANDARDS_MODE;
39
+ goog.dom.getDomHelper = function(opt_element) {
40
+ return opt_element ? new goog.dom.DomHelper(goog.dom.getOwnerDocument(opt_element)) : goog.dom.defaultDomHelper_ || (goog.dom.defaultDomHelper_ = new goog.dom.DomHelper());
41
+ };
42
+ goog.dom.defaultDomHelper_;
43
+ goog.dom.getDocument = function() {
44
+ return document;
45
+ };
46
+ goog.dom.getElement = function(element) {
47
+ return goog.dom.getElementHelper_(document, element);
48
+ };
49
+ goog.dom.getHTMLElement = function(id) {
50
+ const element = goog.dom.getElement(id);
51
+ if (!element) {
52
+ return null;
53
+ }
54
+ return goog.asserts.dom.assertIsHtmlElement(element);
55
+ };
56
+ goog.dom.getElementHelper_ = function(doc, element) {
57
+ return typeof element === "string" ? doc.getElementById(element) : element;
58
+ };
59
+ goog.dom.getRequiredElement = function(id) {
60
+ return goog.dom.getRequiredElementHelper_(document, id);
61
+ };
62
+ goog.dom.getRequiredHTMLElement = function(id) {
63
+ return goog.asserts.dom.assertIsHtmlElement(goog.dom.getRequiredElementHelper_(document, id));
64
+ };
65
+ goog.dom.getRequiredElementHelper_ = function(doc, id) {
66
+ goog.asserts.assertString(id);
67
+ var element = goog.dom.getElementHelper_(doc, id);
68
+ return goog.asserts.assert(element, "No element found with id: " + id);
69
+ };
70
+ goog.dom.$ = goog.dom.getElement;
71
+ goog.dom.getElementsByTagName = function(tagName, opt_parent) {
72
+ var parent = opt_parent || document;
73
+ return parent.getElementsByTagName(String(tagName));
74
+ };
75
+ goog.dom.getElementsByTagNameAndClass = function(opt_tag, opt_class, opt_el) {
76
+ return goog.dom.getElementsByTagNameAndClass_(document, opt_tag, opt_class, opt_el);
77
+ };
78
+ goog.dom.getElementByTagNameAndClass = function(opt_tag, opt_class, opt_el) {
79
+ return goog.dom.getElementByTagNameAndClass_(document, opt_tag, opt_class, opt_el);
80
+ };
81
+ goog.dom.getElementsByClass = function(className, opt_el) {
82
+ var parent = opt_el || document;
83
+ if (goog.dom.canUseQuerySelector_(parent)) {
84
+ return parent.querySelectorAll("." + className);
85
+ }
86
+ return goog.dom.getElementsByTagNameAndClass_(document, "*", className, opt_el);
87
+ };
88
+ goog.dom.getElementByClass = function(className, opt_el) {
89
+ var parent = opt_el || document;
90
+ var retVal = null;
91
+ if (parent.getElementsByClassName) {
92
+ retVal = parent.getElementsByClassName(className)[0];
93
+ } else {
94
+ retVal = goog.dom.getElementByTagNameAndClass_(document, "*", className, opt_el);
95
+ }
96
+ return retVal || null;
97
+ };
98
+ goog.dom.getHTMLElementByClass = function(className, opt_parent) {
99
+ const element = goog.dom.getElementByClass(className, opt_parent);
100
+ if (!element) {
101
+ return null;
102
+ }
103
+ return goog.asserts.dom.assertIsHtmlElement(element);
104
+ };
105
+ goog.dom.getRequiredElementByClass = function(className, opt_root) {
106
+ var retValue = goog.dom.getElementByClass(className, opt_root);
107
+ return goog.asserts.assert(retValue, "No element found with className: " + className);
108
+ };
109
+ goog.dom.getRequiredHTMLElementByClass = function(className, opt_parent) {
110
+ const retValue = goog.dom.getElementByClass(className, opt_parent);
111
+ goog.asserts.assert(retValue, "No HTMLElement found with className: " + className);
112
+ return goog.asserts.dom.assertIsHtmlElement(retValue);
113
+ };
114
+ goog.dom.canUseQuerySelector_ = function(parent) {
115
+ return !!(parent.querySelectorAll && parent.querySelector);
116
+ };
117
+ goog.dom.getElementsByTagNameAndClass_ = function(doc, opt_tag, opt_class, opt_el) {
118
+ var parent = opt_el || doc;
119
+ var tagName = opt_tag && opt_tag != "*" ? String(opt_tag).toUpperCase() : "";
120
+ if (goog.dom.canUseQuerySelector_(parent) && (tagName || opt_class)) {
121
+ var query = tagName + (opt_class ? "." + opt_class : "");
122
+ return parent.querySelectorAll(query);
123
+ }
124
+ if (opt_class && parent.getElementsByClassName) {
125
+ var els = parent.getElementsByClassName(opt_class);
126
+ if (tagName) {
127
+ var arrayLike = {};
128
+ var len = 0;
129
+ var i = 0;
130
+ var el;
131
+ for (; el = els[i]; i++) {
132
+ if (tagName == el.nodeName) {
133
+ arrayLike[len++] = el;
134
+ }
135
+ }
136
+ arrayLike.length = len;
137
+ return arrayLike;
138
+ } else {
139
+ return els;
140
+ }
141
+ }
142
+ els = parent.getElementsByTagName(tagName || "*");
143
+ if (opt_class) {
144
+ arrayLike = {};
145
+ len = 0;
146
+ i = 0;
147
+ for (; el = els[i]; i++) {
148
+ var className = el.className;
149
+ if (typeof className.split == "function" && goog.array.contains(className.split(/\s+/), opt_class)) {
150
+ arrayLike[len++] = el;
151
+ }
152
+ }
153
+ arrayLike.length = len;
154
+ return arrayLike;
155
+ } else {
156
+ return els;
157
+ }
158
+ };
159
+ goog.dom.getElementByTagNameAndClass_ = function(doc, opt_tag, opt_class, opt_el) {
160
+ var parent = opt_el || doc;
161
+ var tag = opt_tag && opt_tag != "*" ? String(opt_tag).toUpperCase() : "";
162
+ if (goog.dom.canUseQuerySelector_(parent) && (tag || opt_class)) {
163
+ return parent.querySelector(tag + (opt_class ? "." + opt_class : ""));
164
+ }
165
+ var elements = goog.dom.getElementsByTagNameAndClass_(doc, opt_tag, opt_class, opt_el);
166
+ return elements[0] || null;
167
+ };
168
+ goog.dom.$$ = goog.dom.getElementsByTagNameAndClass;
169
+ goog.dom.setProperties = function(element, properties) {
170
+ goog.object.forEach(properties, function(val, key) {
171
+ if (val && typeof val == "object" && val.implementsGoogStringTypedString) {
172
+ val = val.getTypedStringValue();
173
+ }
174
+ if (key == "style") {
175
+ element.style.cssText = val;
176
+ } else if (key == "class") {
177
+ element.className = val;
178
+ } else if (key == "for") {
179
+ element.htmlFor = val;
180
+ } else if (goog.dom.DIRECT_ATTRIBUTE_MAP_.hasOwnProperty(key)) {
181
+ element.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[key], val);
182
+ } else if (goog.string.startsWith(key, "aria-") || goog.string.startsWith(key, "data-")) {
183
+ element.setAttribute(key, val);
184
+ } else {
185
+ element[key] = val;
186
+ }
187
+ });
188
+ };
189
+ goog.dom.DIRECT_ATTRIBUTE_MAP_ = {"cellpadding":"cellPadding", "cellspacing":"cellSpacing", "colspan":"colSpan", "frameborder":"frameBorder", "height":"height", "maxlength":"maxLength", "nonce":"nonce", "role":"role", "rowspan":"rowSpan", "type":"type", "usemap":"useMap", "valign":"vAlign", "width":"width"};
190
+ goog.dom.getViewportSize = function(opt_window) {
191
+ return goog.dom.getViewportSize_(opt_window || window);
192
+ };
193
+ goog.dom.getViewportSize_ = function(win) {
194
+ var doc = win.document;
195
+ var el = goog.dom.isCss1CompatMode_(doc) ? doc.documentElement : doc.body;
196
+ return new goog.math.Size(el.clientWidth, el.clientHeight);
197
+ };
198
+ goog.dom.getDocumentHeight = function() {
199
+ return goog.dom.getDocumentHeight_(window);
200
+ };
201
+ goog.dom.getDocumentHeightForWindow = function(win) {
202
+ return goog.dom.getDocumentHeight_(win);
203
+ };
204
+ goog.dom.getDocumentHeight_ = function(win) {
205
+ var doc = win.document;
206
+ var height = 0;
207
+ if (doc) {
208
+ var body = doc.body;
209
+ var docEl = doc.documentElement;
210
+ if (!(docEl && body)) {
211
+ return 0;
212
+ }
213
+ var vh = goog.dom.getViewportSize_(win).height;
214
+ if (goog.dom.isCss1CompatMode_(doc) && docEl.scrollHeight) {
215
+ height = docEl.scrollHeight != vh ? docEl.scrollHeight : docEl.offsetHeight;
216
+ } else {
217
+ var sh = docEl.scrollHeight;
218
+ var oh = docEl.offsetHeight;
219
+ if (docEl.clientHeight != oh) {
220
+ sh = body.scrollHeight;
221
+ oh = body.offsetHeight;
222
+ }
223
+ if (sh > vh) {
224
+ height = sh > oh ? sh : oh;
225
+ } else {
226
+ height = sh < oh ? sh : oh;
227
+ }
228
+ }
229
+ }
230
+ return height;
231
+ };
232
+ goog.dom.getPageScroll = function(opt_window) {
233
+ var win = opt_window || goog.global || window;
234
+ return goog.dom.getDomHelper(win.document).getDocumentScroll();
235
+ };
236
+ goog.dom.getDocumentScroll = function() {
237
+ return goog.dom.getDocumentScroll_(document);
238
+ };
239
+ goog.dom.getDocumentScroll_ = function(doc) {
240
+ var el = goog.dom.getDocumentScrollElement_(doc);
241
+ var win = goog.dom.getWindow_(doc);
242
+ if (goog.userAgent.IE && win.pageYOffset != el.scrollTop) {
243
+ return new goog.math.Coordinate(el.scrollLeft, el.scrollTop);
244
+ }
245
+ return new goog.math.Coordinate(win.pageXOffset || el.scrollLeft, win.pageYOffset || el.scrollTop);
246
+ };
247
+ goog.dom.getDocumentScrollElement = function() {
248
+ return goog.dom.getDocumentScrollElement_(document);
249
+ };
250
+ goog.dom.getDocumentScrollElement_ = function(doc) {
251
+ if (doc.scrollingElement) {
252
+ return doc.scrollingElement;
253
+ }
254
+ if (!goog.userAgent.WEBKIT && goog.dom.isCss1CompatMode_(doc)) {
255
+ return doc.documentElement;
256
+ }
257
+ return doc.body || doc.documentElement;
258
+ };
259
+ goog.dom.getWindow = function(opt_doc) {
260
+ return opt_doc ? goog.dom.getWindow_(opt_doc) : window;
261
+ };
262
+ goog.dom.getWindow_ = function(doc) {
263
+ return doc.parentWindow || doc.defaultView;
264
+ };
265
+ goog.dom.createDom = function(tagName, opt_attributes, var_args) {
266
+ return goog.dom.createDom_(document, arguments);
267
+ };
268
+ goog.dom.createDom_ = function(doc, args) {
269
+ var tagName = String(args[0]);
270
+ var attributes = args[1];
271
+ var element = goog.dom.createElement_(doc, tagName);
272
+ if (attributes) {
273
+ if (typeof attributes === "string") {
274
+ element.className = attributes;
275
+ } else if (Array.isArray(attributes)) {
276
+ element.className = attributes.join(" ");
277
+ } else {
278
+ goog.dom.setProperties(element, attributes);
279
+ }
280
+ }
281
+ if (args.length > 2) {
282
+ goog.dom.append_(doc, element, args, 2);
283
+ }
284
+ return element;
285
+ };
286
+ goog.dom.append_ = function(doc, parent, args, startIndex) {
287
+ function childHandler(child) {
288
+ if (child) {
289
+ parent.appendChild(typeof child === "string" ? doc.createTextNode(child) : child);
290
+ }
291
+ }
292
+ var i = startIndex;
293
+ for (; i < args.length; i++) {
294
+ var arg = args[i];
295
+ if (goog.isArrayLike(arg) && !goog.dom.isNodeLike(arg)) {
296
+ goog.array.forEach(goog.dom.isNodeList(arg) ? goog.array.toArray(arg) : arg, childHandler);
297
+ } else {
298
+ childHandler(arg);
299
+ }
300
+ }
301
+ };
302
+ goog.dom.$dom = goog.dom.createDom;
303
+ goog.dom.createElement = function(name) {
304
+ return goog.dom.createElement_(document, name);
305
+ };
306
+ goog.dom.createElement_ = function(doc, name) {
307
+ name = String(name);
308
+ if (doc.contentType === "application/xhtml+xml") {
309
+ name = name.toLowerCase();
310
+ }
311
+ return doc.createElement(name);
312
+ };
313
+ goog.dom.createTextNode = function(content) {
314
+ return document.createTextNode(String(content));
315
+ };
316
+ goog.dom.createTable = function(rows, columns, opt_fillWithNbsp) {
317
+ return goog.dom.createTable_(document, rows, columns, !!opt_fillWithNbsp);
318
+ };
319
+ goog.dom.createTable_ = function(doc, rows, columns, fillWithNbsp) {
320
+ var table = goog.dom.createElement_(doc, goog.dom.TagName.TABLE);
321
+ var tbody = table.appendChild(goog.dom.createElement_(doc, goog.dom.TagName.TBODY));
322
+ var i = 0;
323
+ for (; i < rows; i++) {
324
+ var tr = goog.dom.createElement_(doc, goog.dom.TagName.TR);
325
+ var j = 0;
326
+ for (; j < columns; j++) {
327
+ var td = goog.dom.createElement_(doc, goog.dom.TagName.TD);
328
+ if (fillWithNbsp) {
329
+ goog.dom.setTextContent(td, goog.string.Unicode.NBSP);
330
+ }
331
+ tr.appendChild(td);
332
+ }
333
+ tbody.appendChild(tr);
334
+ }
335
+ return table;
336
+ };
337
+ goog.dom.constHtmlToNode = function(var_args) {
338
+ var stringArray = Array.prototype.map.call(arguments, goog.string.Const.unwrap);
339
+ var safeHtml = goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Constant HTML string, that gets turned into a " + "Node later, so it will be automatically balanced."), stringArray.join(""));
340
+ return goog.dom.safeHtmlToNode(safeHtml);
341
+ };
342
+ goog.dom.safeHtmlToNode = function(html) {
343
+ return goog.dom.safeHtmlToNode_(document, html);
344
+ };
345
+ goog.dom.safeHtmlToNode_ = function(doc, html) {
346
+ var tempDiv = goog.dom.createElement_(doc, goog.dom.TagName.DIV);
347
+ if (goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT) {
348
+ goog.dom.safe.setInnerHtml(tempDiv, goog.html.SafeHtml.concat(goog.html.SafeHtml.BR, html));
349
+ tempDiv.removeChild(goog.asserts.assert(tempDiv.firstChild));
350
+ } else {
351
+ goog.dom.safe.setInnerHtml(tempDiv, html);
352
+ }
353
+ return goog.dom.childrenToNode_(doc, tempDiv);
354
+ };
355
+ goog.dom.childrenToNode_ = function(doc, tempDiv) {
356
+ if (tempDiv.childNodes.length == 1) {
357
+ return tempDiv.removeChild(goog.asserts.assert(tempDiv.firstChild));
358
+ } else {
359
+ var fragment = doc.createDocumentFragment();
360
+ for (; tempDiv.firstChild;) {
361
+ fragment.appendChild(tempDiv.firstChild);
362
+ }
363
+ return fragment;
364
+ }
365
+ };
366
+ goog.dom.isCss1CompatMode = function() {
367
+ return goog.dom.isCss1CompatMode_(document);
368
+ };
369
+ goog.dom.isCss1CompatMode_ = function(doc) {
370
+ if (goog.dom.COMPAT_MODE_KNOWN_) {
371
+ return goog.dom.ASSUME_STANDARDS_MODE;
372
+ }
373
+ return doc.compatMode == "CSS1Compat";
374
+ };
375
+ goog.dom.canHaveChildren = function(node) {
376
+ if (node.nodeType != goog.dom.NodeType.ELEMENT) {
377
+ return false;
378
+ }
379
+ switch(node.tagName) {
380
+ case String(goog.dom.TagName.APPLET):
381
+ case String(goog.dom.TagName.AREA):
382
+ case String(goog.dom.TagName.BASE):
383
+ case String(goog.dom.TagName.BR):
384
+ case String(goog.dom.TagName.COL):
385
+ case String(goog.dom.TagName.COMMAND):
386
+ case String(goog.dom.TagName.EMBED):
387
+ case String(goog.dom.TagName.FRAME):
388
+ case String(goog.dom.TagName.HR):
389
+ case String(goog.dom.TagName.IMG):
390
+ case String(goog.dom.TagName.INPUT):
391
+ case String(goog.dom.TagName.IFRAME):
392
+ case String(goog.dom.TagName.ISINDEX):
393
+ case String(goog.dom.TagName.KEYGEN):
394
+ case String(goog.dom.TagName.LINK):
395
+ case String(goog.dom.TagName.NOFRAMES):
396
+ case String(goog.dom.TagName.NOSCRIPT):
397
+ case String(goog.dom.TagName.META):
398
+ case String(goog.dom.TagName.OBJECT):
399
+ case String(goog.dom.TagName.PARAM):
400
+ case String(goog.dom.TagName.SCRIPT):
401
+ case String(goog.dom.TagName.SOURCE):
402
+ case String(goog.dom.TagName.STYLE):
403
+ case String(goog.dom.TagName.TRACK):
404
+ case String(goog.dom.TagName.WBR):
405
+ return false;
406
+ }
407
+ return true;
408
+ };
409
+ goog.dom.appendChild = function(parent, child) {
410
+ goog.asserts.assert(parent != null && child != null, "goog.dom.appendChild expects non-null arguments");
411
+ parent.appendChild(child);
412
+ };
413
+ goog.dom.append = function(parent, var_args) {
414
+ goog.dom.append_(goog.dom.getOwnerDocument(parent), parent, arguments, 1);
415
+ };
416
+ goog.dom.removeChildren = function(node) {
417
+ var child;
418
+ for (; child = node.firstChild;) {
419
+ node.removeChild(child);
420
+ }
421
+ };
422
+ goog.dom.insertSiblingBefore = function(newNode, refNode) {
423
+ goog.asserts.assert(newNode != null && refNode != null, "goog.dom.insertSiblingBefore expects non-null arguments");
424
+ if (refNode.parentNode) {
425
+ refNode.parentNode.insertBefore(newNode, refNode);
426
+ }
427
+ };
428
+ goog.dom.insertSiblingAfter = function(newNode, refNode) {
429
+ goog.asserts.assert(newNode != null && refNode != null, "goog.dom.insertSiblingAfter expects non-null arguments");
430
+ if (refNode.parentNode) {
431
+ refNode.parentNode.insertBefore(newNode, refNode.nextSibling);
432
+ }
433
+ };
434
+ goog.dom.insertChildAt = function(parent, child, index) {
435
+ goog.asserts.assert(parent != null, "goog.dom.insertChildAt expects a non-null parent");
436
+ parent.insertBefore(child, parent.childNodes[index] || null);
437
+ };
438
+ goog.dom.removeNode = function(node) {
439
+ return node && node.parentNode ? node.parentNode.removeChild(node) : null;
440
+ };
441
+ goog.dom.replaceNode = function(newNode, oldNode) {
442
+ goog.asserts.assert(newNode != null && oldNode != null, "goog.dom.replaceNode expects non-null arguments");
443
+ var parent = oldNode.parentNode;
444
+ if (parent) {
445
+ parent.replaceChild(newNode, oldNode);
446
+ }
447
+ };
448
+ goog.dom.copyContents = function(target, source) {
449
+ goog.asserts.assert(target != null && source != null, "goog.dom.copyContents expects non-null arguments");
450
+ var childNodes = source.cloneNode(true).childNodes;
451
+ goog.dom.removeChildren(target);
452
+ for (; childNodes.length;) {
453
+ target.appendChild(childNodes[0]);
454
+ }
455
+ };
456
+ goog.dom.flattenElement = function(element) {
457
+ var child;
458
+ var parent = element.parentNode;
459
+ if (parent && parent.nodeType != goog.dom.NodeType.DOCUMENT_FRAGMENT) {
460
+ if (element.removeNode) {
461
+ return element.removeNode(false);
462
+ } else {
463
+ for (; child = element.firstChild;) {
464
+ parent.insertBefore(child, element);
465
+ }
466
+ return goog.dom.removeNode(element);
467
+ }
468
+ }
469
+ };
470
+ goog.dom.getChildren = function(element) {
471
+ if (element.children != undefined) {
472
+ return element.children;
473
+ }
474
+ return Array.prototype.filter.call(element.childNodes, function(node) {
475
+ return node.nodeType == goog.dom.NodeType.ELEMENT;
476
+ });
477
+ };
478
+ goog.dom.getFirstElementChild = function(node) {
479
+ if (node.firstElementChild !== undefined) {
480
+ return node.firstElementChild;
481
+ }
482
+ return goog.dom.getNextElementNode_(node.firstChild, true);
483
+ };
484
+ goog.dom.getLastElementChild = function(node) {
485
+ if (node.lastElementChild !== undefined) {
486
+ return node.lastElementChild;
487
+ }
488
+ return goog.dom.getNextElementNode_(node.lastChild, false);
489
+ };
490
+ goog.dom.getNextElementSibling = function(node) {
491
+ if (node.nextElementSibling !== undefined) {
492
+ return node.nextElementSibling;
493
+ }
494
+ return goog.dom.getNextElementNode_(node.nextSibling, true);
495
+ };
496
+ goog.dom.getPreviousElementSibling = function(node) {
497
+ if (node.previousElementSibling !== undefined) {
498
+ return node.previousElementSibling;
499
+ }
500
+ return goog.dom.getNextElementNode_(node.previousSibling, false);
501
+ };
502
+ goog.dom.getNextElementNode_ = function(node, forward) {
503
+ for (; node && node.nodeType != goog.dom.NodeType.ELEMENT;) {
504
+ node = forward ? node.nextSibling : node.previousSibling;
505
+ }
506
+ return node;
507
+ };
508
+ goog.dom.getNextNode = function(node) {
509
+ if (!node) {
510
+ return null;
511
+ }
512
+ if (node.firstChild) {
513
+ return node.firstChild;
514
+ }
515
+ for (; node && !node.nextSibling;) {
516
+ node = node.parentNode;
517
+ }
518
+ return node ? node.nextSibling : null;
519
+ };
520
+ goog.dom.getPreviousNode = function(node) {
521
+ if (!node) {
522
+ return null;
523
+ }
524
+ if (!node.previousSibling) {
525
+ return node.parentNode;
526
+ }
527
+ node = node.previousSibling;
528
+ for (; node && node.lastChild;) {
529
+ node = node.lastChild;
530
+ }
531
+ return node;
532
+ };
533
+ goog.dom.isNodeLike = function(obj) {
534
+ return goog.isObject(obj) && obj.nodeType > 0;
535
+ };
536
+ goog.dom.isElement = function(obj) {
537
+ return goog.isObject(obj) && obj.nodeType == goog.dom.NodeType.ELEMENT;
538
+ };
539
+ goog.dom.isWindow = function(obj) {
540
+ return goog.isObject(obj) && obj["window"] == obj;
541
+ };
542
+ goog.dom.getParentElement = function(element) {
543
+ var parent;
544
+ if (goog.dom.BrowserFeature.CAN_USE_PARENT_ELEMENT_PROPERTY) {
545
+ parent = element.parentElement;
546
+ if (parent) {
547
+ return parent;
548
+ }
549
+ }
550
+ parent = element.parentNode;
551
+ return goog.dom.isElement(parent) ? parent : null;
552
+ };
553
+ goog.dom.contains = function(parent, descendant) {
554
+ if (!parent || !descendant) {
555
+ return false;
556
+ }
557
+ if (parent.contains && descendant.nodeType == goog.dom.NodeType.ELEMENT) {
558
+ return parent == descendant || parent.contains(descendant);
559
+ }
560
+ if (typeof parent.compareDocumentPosition != "undefined") {
561
+ return parent == descendant || Boolean(parent.compareDocumentPosition(descendant) & 16);
562
+ }
563
+ for (; descendant && parent != descendant;) {
564
+ descendant = descendant.parentNode;
565
+ }
566
+ return descendant == parent;
567
+ };
568
+ goog.dom.compareNodeOrder = function(node1, node2) {
569
+ if (node1 == node2) {
570
+ return 0;
571
+ }
572
+ if (node1.compareDocumentPosition) {
573
+ return node1.compareDocumentPosition(node2) & 2 ? 1 : -1;
574
+ }
575
+ if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9)) {
576
+ if (node1.nodeType == goog.dom.NodeType.DOCUMENT) {
577
+ return -1;
578
+ }
579
+ if (node2.nodeType == goog.dom.NodeType.DOCUMENT) {
580
+ return 1;
581
+ }
582
+ }
583
+ if ("sourceIndex" in node1 || node1.parentNode && "sourceIndex" in node1.parentNode) {
584
+ var isElement1 = node1.nodeType == goog.dom.NodeType.ELEMENT;
585
+ var isElement2 = node2.nodeType == goog.dom.NodeType.ELEMENT;
586
+ if (isElement1 && isElement2) {
587
+ return node1.sourceIndex - node2.sourceIndex;
588
+ } else {
589
+ var parent1 = node1.parentNode;
590
+ var parent2 = node2.parentNode;
591
+ if (parent1 == parent2) {
592
+ return goog.dom.compareSiblingOrder_(node1, node2);
593
+ }
594
+ if (!isElement1 && goog.dom.contains(parent1, node2)) {
595
+ return -1 * goog.dom.compareParentsDescendantNodeIe_(node1, node2);
596
+ }
597
+ if (!isElement2 && goog.dom.contains(parent2, node1)) {
598
+ return goog.dom.compareParentsDescendantNodeIe_(node2, node1);
599
+ }
600
+ return (isElement1 ? node1.sourceIndex : parent1.sourceIndex) - (isElement2 ? node2.sourceIndex : parent2.sourceIndex);
601
+ }
602
+ }
603
+ var doc = goog.dom.getOwnerDocument(node1);
604
+ var range1;
605
+ var range2;
606
+ range1 = doc.createRange();
607
+ range1.selectNode(node1);
608
+ range1.collapse(true);
609
+ range2 = doc.createRange();
610
+ range2.selectNode(node2);
611
+ range2.collapse(true);
612
+ return range1.compareBoundaryPoints(goog.global["Range"].START_TO_END, range2);
613
+ };
614
+ goog.dom.compareParentsDescendantNodeIe_ = function(textNode, node) {
615
+ var parent = textNode.parentNode;
616
+ if (parent == node) {
617
+ return -1;
618
+ }
619
+ var sibling = node;
620
+ for (; sibling.parentNode != parent;) {
621
+ sibling = sibling.parentNode;
622
+ }
623
+ return goog.dom.compareSiblingOrder_(sibling, textNode);
624
+ };
625
+ goog.dom.compareSiblingOrder_ = function(node1, node2) {
626
+ var s = node2;
627
+ for (; s = s.previousSibling;) {
628
+ if (s == node1) {
629
+ return -1;
630
+ }
631
+ }
632
+ return 1;
633
+ };
634
+ goog.dom.findCommonAncestor = function(var_args) {
635
+ var i;
636
+ var count = arguments.length;
637
+ if (!count) {
638
+ return null;
639
+ } else if (count == 1) {
640
+ return arguments[0];
641
+ }
642
+ var paths = [];
643
+ var minLength = Infinity;
644
+ i = 0;
645
+ for (; i < count; i++) {
646
+ var ancestors = [];
647
+ var node = arguments[i];
648
+ for (; node;) {
649
+ ancestors.unshift(node);
650
+ node = node.parentNode;
651
+ }
652
+ paths.push(ancestors);
653
+ minLength = Math.min(minLength, ancestors.length);
654
+ }
655
+ var output = null;
656
+ i = 0;
657
+ for (; i < minLength; i++) {
658
+ var first = paths[0][i];
659
+ var j = 1;
660
+ for (; j < count; j++) {
661
+ if (first != paths[j][i]) {
662
+ return output;
663
+ }
664
+ }
665
+ output = first;
666
+ }
667
+ return output;
668
+ };
669
+ goog.dom.isInDocument = function(node) {
670
+ return (node.ownerDocument.compareDocumentPosition(node) & 16) == 16;
671
+ };
672
+ goog.dom.getOwnerDocument = function(node) {
673
+ goog.asserts.assert(node, "Node cannot be null or undefined.");
674
+ return node.nodeType == goog.dom.NodeType.DOCUMENT ? node : node.ownerDocument || node.document;
675
+ };
676
+ goog.dom.getFrameContentDocument = function(frame) {
677
+ return frame.contentDocument || frame.contentWindow.document;
678
+ };
679
+ goog.dom.getFrameContentWindow = function(frame) {
680
+ try {
681
+ return frame.contentWindow || (frame.contentDocument ? goog.dom.getWindow(frame.contentDocument) : null);
682
+ } catch (e) {
683
+ }
684
+ return null;
685
+ };
686
+ goog.dom.setTextContent = function(node, text) {
687
+ goog.asserts.assert(node != null, "goog.dom.setTextContent expects a non-null value for node");
688
+ if ("textContent" in node) {
689
+ node.textContent = text;
690
+ } else if (node.nodeType == goog.dom.NodeType.TEXT) {
691
+ node.data = String(text);
692
+ } else if (node.firstChild && node.firstChild.nodeType == goog.dom.NodeType.TEXT) {
693
+ for (; node.lastChild != node.firstChild;) {
694
+ node.removeChild(goog.asserts.assert(node.lastChild));
695
+ }
696
+ node.firstChild.data = String(text);
697
+ } else {
698
+ goog.dom.removeChildren(node);
699
+ var doc = goog.dom.getOwnerDocument(node);
700
+ node.appendChild(doc.createTextNode(String(text)));
701
+ }
702
+ };
703
+ goog.dom.getOuterHtml = function(element) {
704
+ goog.asserts.assert(element !== null, "goog.dom.getOuterHtml expects a non-null value for element");
705
+ if ("outerHTML" in element) {
706
+ return element.outerHTML;
707
+ } else {
708
+ var doc = goog.dom.getOwnerDocument(element);
709
+ var div = goog.dom.createElement_(doc, goog.dom.TagName.DIV);
710
+ div.appendChild(element.cloneNode(true));
711
+ return div.innerHTML;
712
+ }
713
+ };
714
+ goog.dom.findNode = function(root, p) {
715
+ var rv = [];
716
+ var found = goog.dom.findNodes_(root, p, rv, true);
717
+ return found ? rv[0] : undefined;
718
+ };
719
+ goog.dom.findNodes = function(root, p) {
720
+ var rv = [];
721
+ goog.dom.findNodes_(root, p, rv, false);
722
+ return rv;
723
+ };
724
+ goog.dom.findNodes_ = function(root, p, rv, findOne) {
725
+ if (root != null) {
726
+ var child = root.firstChild;
727
+ for (; child;) {
728
+ if (p(child)) {
729
+ rv.push(child);
730
+ if (findOne) {
731
+ return true;
732
+ }
733
+ }
734
+ if (goog.dom.findNodes_(child, p, rv, findOne)) {
735
+ return true;
736
+ }
737
+ child = child.nextSibling;
738
+ }
739
+ }
740
+ return false;
741
+ };
742
+ goog.dom.findElement = function(root, pred) {
743
+ var stack = goog.dom.getChildrenReverse_(root);
744
+ for (; stack.length > 0;) {
745
+ var next = stack.pop();
746
+ if (pred(next)) {
747
+ return next;
748
+ }
749
+ var c = next.lastElementChild;
750
+ for (; c; c = c.previousElementSibling) {
751
+ stack.push(c);
752
+ }
753
+ }
754
+ return null;
755
+ };
756
+ goog.dom.findElements = function(root, pred) {
757
+ var result = [];
758
+ var stack = goog.dom.getChildrenReverse_(root);
759
+ for (; stack.length > 0;) {
760
+ var next = stack.pop();
761
+ if (pred(next)) {
762
+ result.push(next);
763
+ }
764
+ var c = next.lastElementChild;
765
+ for (; c; c = c.previousElementSibling) {
766
+ stack.push(c);
767
+ }
768
+ }
769
+ return result;
770
+ };
771
+ goog.dom.getChildrenReverse_ = function(node) {
772
+ if (node.nodeType == goog.dom.NodeType.DOCUMENT) {
773
+ return [node.documentElement];
774
+ } else {
775
+ var children = [];
776
+ var c = node.lastElementChild;
777
+ for (; c; c = c.previousElementSibling) {
778
+ children.push(c);
779
+ }
780
+ return children;
781
+ }
782
+ };
783
+ goog.dom.TAGS_TO_IGNORE_ = {"SCRIPT":1, "STYLE":1, "HEAD":1, "IFRAME":1, "OBJECT":1};
784
+ goog.dom.PREDEFINED_TAG_VALUES_ = {"IMG":" ", "BR":"\n"};
785
+ goog.dom.isFocusableTabIndex = function(element) {
786
+ return goog.dom.hasSpecifiedTabIndex_(element) && goog.dom.isTabIndexFocusable_(element);
787
+ };
788
+ goog.dom.setFocusableTabIndex = function(element, enable) {
789
+ if (enable) {
790
+ element.tabIndex = 0;
791
+ } else {
792
+ element.tabIndex = -1;
793
+ element.removeAttribute("tabIndex");
794
+ }
795
+ };
796
+ goog.dom.isFocusable = function(element) {
797
+ var focusable;
798
+ if (goog.dom.nativelySupportsFocus_(element)) {
799
+ focusable = !element.disabled && (!goog.dom.hasSpecifiedTabIndex_(element) || goog.dom.isTabIndexFocusable_(element));
800
+ } else {
801
+ focusable = goog.dom.isFocusableTabIndex(element);
802
+ }
803
+ return focusable && goog.userAgent.IE ? goog.dom.hasNonZeroBoundingRect_(element) : focusable;
804
+ };
805
+ goog.dom.hasSpecifiedTabIndex_ = function(element) {
806
+ return element.hasAttribute("tabindex");
807
+ };
808
+ goog.dom.isTabIndexFocusable_ = function(element) {
809
+ var index = element.tabIndex;
810
+ return typeof index === "number" && index >= 0 && index < 32768;
811
+ };
812
+ goog.dom.nativelySupportsFocus_ = function(element) {
813
+ return element.tagName == goog.dom.TagName.A && element.hasAttribute("href") || element.tagName == goog.dom.TagName.INPUT || element.tagName == goog.dom.TagName.TEXTAREA || element.tagName == goog.dom.TagName.SELECT || element.tagName == goog.dom.TagName.BUTTON;
814
+ };
815
+ goog.dom.hasNonZeroBoundingRect_ = function(element) {
816
+ var rect;
817
+ if (typeof element["getBoundingClientRect"] !== "function" || goog.userAgent.IE && element.parentElement == null) {
818
+ rect = {"height":element.offsetHeight, "width":element.offsetWidth};
819
+ } else {
820
+ rect = element.getBoundingClientRect();
821
+ }
822
+ return rect != null && rect.height > 0 && rect.width > 0;
823
+ };
824
+ goog.dom.getTextContent = function(node) {
825
+ var textContent;
826
+ var buf = [];
827
+ goog.dom.getTextContent_(node, buf, true);
828
+ textContent = buf.join("");
829
+ textContent = textContent.replace(/ \xAD /g, " ").replace(/\xAD/g, "");
830
+ textContent = textContent.replace(/\u200B/g, "");
831
+ textContent = textContent.replace(/ +/g, " ");
832
+ if (textContent != " ") {
833
+ textContent = textContent.replace(/^\s*/, "");
834
+ }
835
+ return textContent;
836
+ };
837
+ goog.dom.getRawTextContent = function(node) {
838
+ var buf = [];
839
+ goog.dom.getTextContent_(node, buf, false);
840
+ return buf.join("");
841
+ };
842
+ goog.dom.getTextContent_ = function(node, buf, normalizeWhitespace) {
843
+ if (node.nodeName in goog.dom.TAGS_TO_IGNORE_) {
844
+ } else if (node.nodeType == goog.dom.NodeType.TEXT) {
845
+ if (normalizeWhitespace) {
846
+ buf.push(String(node.nodeValue).replace(/(\r\n|\r|\n)/g, ""));
847
+ } else {
848
+ buf.push(node.nodeValue);
849
+ }
850
+ } else if (node.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {
851
+ buf.push(goog.dom.PREDEFINED_TAG_VALUES_[node.nodeName]);
852
+ } else {
853
+ var child = node.firstChild;
854
+ for (; child;) {
855
+ goog.dom.getTextContent_(child, buf, normalizeWhitespace);
856
+ child = child.nextSibling;
857
+ }
858
+ }
859
+ };
860
+ goog.dom.getNodeTextLength = function(node) {
861
+ return goog.dom.getTextContent(node).length;
862
+ };
863
+ goog.dom.getNodeTextOffset = function(node, opt_offsetParent) {
864
+ var root = opt_offsetParent || goog.dom.getOwnerDocument(node).body;
865
+ var buf = [];
866
+ for (; node && node != root;) {
867
+ var cur = node;
868
+ for (; cur = cur.previousSibling;) {
869
+ buf.unshift(goog.dom.getTextContent(cur));
870
+ }
871
+ node = node.parentNode;
872
+ }
873
+ return goog.string.trimLeft(buf.join("")).replace(/ +/g, " ").length;
874
+ };
875
+ goog.dom.getNodeAtOffset = function(parent, offset, opt_result) {
876
+ var stack = [parent];
877
+ var pos = 0;
878
+ var cur = null;
879
+ for (; stack.length > 0 && pos < offset;) {
880
+ cur = stack.pop();
881
+ if (cur.nodeName in goog.dom.TAGS_TO_IGNORE_) {
882
+ } else if (cur.nodeType == goog.dom.NodeType.TEXT) {
883
+ var text = cur.nodeValue.replace(/(\r\n|\r|\n)/g, "").replace(/ +/g, " ");
884
+ pos = pos + text.length;
885
+ } else if (cur.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {
886
+ pos = pos + goog.dom.PREDEFINED_TAG_VALUES_[cur.nodeName].length;
887
+ } else {
888
+ var i = cur.childNodes.length - 1;
889
+ for (; i >= 0; i--) {
890
+ stack.push(cur.childNodes[i]);
891
+ }
892
+ }
893
+ }
894
+ if (goog.isObject(opt_result)) {
895
+ opt_result.remainder = cur ? cur.nodeValue.length + offset - pos - 1 : 0;
896
+ opt_result.node = cur;
897
+ }
898
+ return cur;
899
+ };
900
+ goog.dom.isNodeList = function(val) {
901
+ if (val && typeof val.length == "number") {
902
+ if (goog.isObject(val)) {
903
+ return typeof val.item == "function" || typeof val.item == "string";
904
+ } else if (typeof val === "function") {
905
+ return typeof val.item == "function";
906
+ }
907
+ }
908
+ return false;
909
+ };
910
+ goog.dom.getAncestorByTagNameAndClass = function(element, opt_tag, opt_class, opt_maxSearchSteps) {
911
+ if (!opt_tag && !opt_class) {
912
+ return null;
913
+ }
914
+ var tagName = opt_tag ? String(opt_tag).toUpperCase() : null;
915
+ return goog.dom.getAncestor(element, function(node) {
916
+ return (!tagName || node.nodeName == tagName) && (!opt_class || typeof node.className === "string" && goog.array.contains(node.className.split(/\s+/), opt_class));
917
+ }, true, opt_maxSearchSteps);
918
+ };
919
+ goog.dom.getAncestorByClass = function(element, className, opt_maxSearchSteps) {
920
+ return goog.dom.getAncestorByTagNameAndClass(element, null, className, opt_maxSearchSteps);
921
+ };
922
+ goog.dom.getAncestor = function(element, matcher, opt_includeNode, opt_maxSearchSteps) {
923
+ if (element && !opt_includeNode) {
924
+ element = element.parentNode;
925
+ }
926
+ var steps = 0;
927
+ for (; element && (opt_maxSearchSteps == null || steps <= opt_maxSearchSteps);) {
928
+ goog.asserts.assert(element.name != "parentNode");
929
+ if (matcher(element)) {
930
+ return element;
931
+ }
932
+ element = element.parentNode;
933
+ steps++;
934
+ }
935
+ return null;
936
+ };
937
+ goog.dom.getActiveElement = function(doc) {
938
+ try {
939
+ var activeElement = doc && doc.activeElement;
940
+ return activeElement && activeElement.nodeName ? activeElement : null;
941
+ } catch (e) {
942
+ return null;
943
+ }
944
+ };
945
+ goog.dom.getPixelRatio = function() {
946
+ var win = goog.dom.getWindow();
947
+ if (win.devicePixelRatio !== undefined) {
948
+ return win.devicePixelRatio;
949
+ } else if (win.matchMedia) {
950
+ return goog.dom.matchesPixelRatio_(3) || goog.dom.matchesPixelRatio_(2) || goog.dom.matchesPixelRatio_(1.5) || goog.dom.matchesPixelRatio_(1) || .75;
951
+ }
952
+ return 1;
953
+ };
954
+ goog.dom.matchesPixelRatio_ = function(pixelRatio) {
955
+ var win = goog.dom.getWindow();
956
+ var dpiPerDppx = 96;
957
+ var query = "(min-resolution: " + pixelRatio + "dppx)," + "(min--moz-device-pixel-ratio: " + pixelRatio + ")," + "(min-resolution: " + pixelRatio * dpiPerDppx + "dpi)";
958
+ return win.matchMedia(query).matches ? pixelRatio : 0;
959
+ };
960
+ goog.dom.getCanvasContext2D = function(canvas) {
961
+ return canvas.getContext("2d");
962
+ };
963
+ goog.dom.DomHelper = function(opt_document) {
964
+ this.document_ = opt_document || goog.global.document || document;
965
+ };
966
+ goog.dom.DomHelper.prototype.getDomHelper = goog.dom.getDomHelper;
967
+ goog.dom.DomHelper.prototype.setDocument = function(document) {
968
+ this.document_ = document;
969
+ };
970
+ goog.dom.DomHelper.prototype.getDocument = function() {
971
+ return this.document_;
972
+ };
973
+ goog.dom.DomHelper.prototype.getElement = function(element) {
974
+ return goog.dom.getElementHelper_(this.document_, element);
975
+ };
976
+ goog.dom.DomHelper.prototype.getRequiredElement = function(id) {
977
+ return goog.dom.getRequiredElementHelper_(this.document_, id);
978
+ };
979
+ goog.dom.DomHelper.prototype.$ = goog.dom.DomHelper.prototype.getElement;
980
+ goog.dom.DomHelper.prototype.getElementsByTagName = function(tagName, opt_parent) {
981
+ var parent = opt_parent || this.document_;
982
+ return parent.getElementsByTagName(String(tagName));
983
+ };
984
+ goog.dom.DomHelper.prototype.getElementsByTagNameAndClass = function(opt_tag, opt_class, opt_el) {
985
+ return goog.dom.getElementsByTagNameAndClass_(this.document_, opt_tag, opt_class, opt_el);
986
+ };
987
+ goog.dom.DomHelper.prototype.getElementByTagNameAndClass = function(opt_tag, opt_class, opt_el) {
988
+ return goog.dom.getElementByTagNameAndClass_(this.document_, opt_tag, opt_class, opt_el);
989
+ };
990
+ goog.dom.DomHelper.prototype.getElementsByClass = function(className, opt_el) {
991
+ var doc = opt_el || this.document_;
992
+ return goog.dom.getElementsByClass(className, doc);
993
+ };
994
+ goog.dom.DomHelper.prototype.getElementByClass = function(className, opt_el) {
995
+ var doc = opt_el || this.document_;
996
+ return goog.dom.getElementByClass(className, doc);
997
+ };
998
+ goog.dom.DomHelper.prototype.getRequiredElementByClass = function(className, opt_root) {
999
+ var root = opt_root || this.document_;
1000
+ return goog.dom.getRequiredElementByClass(className, root);
1001
+ };
1002
+ goog.dom.DomHelper.prototype.$$ = goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;
1003
+ goog.dom.DomHelper.prototype.setProperties = goog.dom.setProperties;
1004
+ goog.dom.DomHelper.prototype.getViewportSize = function(opt_window) {
1005
+ return goog.dom.getViewportSize(opt_window || this.getWindow());
1006
+ };
1007
+ goog.dom.DomHelper.prototype.getDocumentHeight = function() {
1008
+ return goog.dom.getDocumentHeight_(this.getWindow());
1009
+ };
1010
+ goog.dom.Appendable;
1011
+ goog.dom.DomHelper.prototype.createDom = function(tagName, opt_attributes, var_args) {
1012
+ return goog.dom.createDom_(this.document_, arguments);
1013
+ };
1014
+ goog.dom.DomHelper.prototype.$dom = goog.dom.DomHelper.prototype.createDom;
1015
+ goog.dom.DomHelper.prototype.createElement = function(name) {
1016
+ return goog.dom.createElement_(this.document_, name);
1017
+ };
1018
+ goog.dom.DomHelper.prototype.createTextNode = function(content) {
1019
+ return this.document_.createTextNode(String(content));
1020
+ };
1021
+ goog.dom.DomHelper.prototype.createTable = function(rows, columns, opt_fillWithNbsp) {
1022
+ return goog.dom.createTable_(this.document_, rows, columns, !!opt_fillWithNbsp);
1023
+ };
1024
+ goog.dom.DomHelper.prototype.safeHtmlToNode = function(html) {
1025
+ return goog.dom.safeHtmlToNode_(this.document_, html);
1026
+ };
1027
+ goog.dom.DomHelper.prototype.isCss1CompatMode = function() {
1028
+ return goog.dom.isCss1CompatMode_(this.document_);
1029
+ };
1030
+ goog.dom.DomHelper.prototype.getWindow = function() {
1031
+ return goog.dom.getWindow_(this.document_);
1032
+ };
1033
+ goog.dom.DomHelper.prototype.getDocumentScrollElement = function() {
1034
+ return goog.dom.getDocumentScrollElement_(this.document_);
1035
+ };
1036
+ goog.dom.DomHelper.prototype.getDocumentScroll = function() {
1037
+ return goog.dom.getDocumentScroll_(this.document_);
1038
+ };
1039
+ goog.dom.DomHelper.prototype.getActiveElement = function(opt_doc) {
1040
+ return goog.dom.getActiveElement(opt_doc || this.document_);
1041
+ };
1042
+ goog.dom.DomHelper.prototype.appendChild = goog.dom.appendChild;
1043
+ goog.dom.DomHelper.prototype.append = goog.dom.append;
1044
+ goog.dom.DomHelper.prototype.canHaveChildren = goog.dom.canHaveChildren;
1045
+ goog.dom.DomHelper.prototype.removeChildren = goog.dom.removeChildren;
1046
+ goog.dom.DomHelper.prototype.insertSiblingBefore = goog.dom.insertSiblingBefore;
1047
+ goog.dom.DomHelper.prototype.insertSiblingAfter = goog.dom.insertSiblingAfter;
1048
+ goog.dom.DomHelper.prototype.insertChildAt = goog.dom.insertChildAt;
1049
+ goog.dom.DomHelper.prototype.removeNode = goog.dom.removeNode;
1050
+ goog.dom.DomHelper.prototype.replaceNode = goog.dom.replaceNode;
1051
+ goog.dom.DomHelper.prototype.copyContents = goog.dom.copyContents;
1052
+ goog.dom.DomHelper.prototype.flattenElement = goog.dom.flattenElement;
1053
+ goog.dom.DomHelper.prototype.getChildren = goog.dom.getChildren;
1054
+ goog.dom.DomHelper.prototype.getFirstElementChild = goog.dom.getFirstElementChild;
1055
+ goog.dom.DomHelper.prototype.getLastElementChild = goog.dom.getLastElementChild;
1056
+ goog.dom.DomHelper.prototype.getNextElementSibling = goog.dom.getNextElementSibling;
1057
+ goog.dom.DomHelper.prototype.getPreviousElementSibling = goog.dom.getPreviousElementSibling;
1058
+ goog.dom.DomHelper.prototype.getNextNode = goog.dom.getNextNode;
1059
+ goog.dom.DomHelper.prototype.getPreviousNode = goog.dom.getPreviousNode;
1060
+ goog.dom.DomHelper.prototype.isNodeLike = goog.dom.isNodeLike;
1061
+ goog.dom.DomHelper.prototype.isElement = goog.dom.isElement;
1062
+ goog.dom.DomHelper.prototype.isWindow = goog.dom.isWindow;
1063
+ goog.dom.DomHelper.prototype.getParentElement = goog.dom.getParentElement;
1064
+ goog.dom.DomHelper.prototype.contains = goog.dom.contains;
1065
+ goog.dom.DomHelper.prototype.compareNodeOrder = goog.dom.compareNodeOrder;
1066
+ goog.dom.DomHelper.prototype.findCommonAncestor = goog.dom.findCommonAncestor;
1067
+ goog.dom.DomHelper.prototype.getOwnerDocument = goog.dom.getOwnerDocument;
1068
+ goog.dom.DomHelper.prototype.getFrameContentDocument = goog.dom.getFrameContentDocument;
1069
+ goog.dom.DomHelper.prototype.getFrameContentWindow = goog.dom.getFrameContentWindow;
1070
+ goog.dom.DomHelper.prototype.setTextContent = goog.dom.setTextContent;
1071
+ goog.dom.DomHelper.prototype.getOuterHtml = goog.dom.getOuterHtml;
1072
+ goog.dom.DomHelper.prototype.findNode = goog.dom.findNode;
1073
+ goog.dom.DomHelper.prototype.findNodes = goog.dom.findNodes;
1074
+ goog.dom.DomHelper.prototype.isFocusableTabIndex = goog.dom.isFocusableTabIndex;
1075
+ goog.dom.DomHelper.prototype.setFocusableTabIndex = goog.dom.setFocusableTabIndex;
1076
+ goog.dom.DomHelper.prototype.isFocusable = goog.dom.isFocusable;
1077
+ goog.dom.DomHelper.prototype.getTextContent = goog.dom.getTextContent;
1078
+ goog.dom.DomHelper.prototype.getNodeTextLength = goog.dom.getNodeTextLength;
1079
+ goog.dom.DomHelper.prototype.getNodeTextOffset = goog.dom.getNodeTextOffset;
1080
+ goog.dom.DomHelper.prototype.getNodeAtOffset = goog.dom.getNodeAtOffset;
1081
+ goog.dom.DomHelper.prototype.isNodeList = goog.dom.isNodeList;
1082
+ goog.dom.DomHelper.prototype.getAncestorByTagNameAndClass = goog.dom.getAncestorByTagNameAndClass;
1083
+ goog.dom.DomHelper.prototype.getAncestorByClass = goog.dom.getAncestorByClass;
1084
+ goog.dom.DomHelper.prototype.getAncestor = goog.dom.getAncestor;
1085
+ goog.dom.DomHelper.prototype.getCanvasContext2D = goog.dom.getCanvasContext2D;
1086
+
1087
+ //# sourceMappingURL=goog.dom.dom.js.map