["^ ","~:resource-id",["~:shadow.build.classpath/resource","goog/style/style.js"],"~:js","goog.provide(\"goog.style\");\ngoog.require(\"goog.asserts\");\ngoog.require(\"goog.dom\");\ngoog.require(\"goog.dom.NodeType\");\ngoog.require(\"goog.dom.TagName\");\ngoog.require(\"goog.dom.safe\");\ngoog.require(\"goog.dom.vendor\");\ngoog.require(\"goog.html.SafeStyleSheet\");\ngoog.require(\"goog.math.Box\");\ngoog.require(\"goog.math.Coordinate\");\ngoog.require(\"goog.math.Rect\");\ngoog.require(\"goog.math.Size\");\ngoog.require(\"goog.object\");\ngoog.require(\"goog.reflect\");\ngoog.require(\"goog.string\");\ngoog.require(\"goog.userAgent\");\ngoog.requireType(\"goog.events.Event\");\ngoog.style.setStyle = function(element, style, opt_value) {\n if (typeof style === \"string\") {\n goog.style.setStyle_(element, opt_value, style);\n } else {\n for (var key in style) {\n goog.style.setStyle_(element, style[key], key);\n }\n }\n};\ngoog.style.setStyle_ = function(element, value, style) {\n var propertyName = goog.style.getVendorJsStyleName_(element, style);\n if (propertyName) {\n element.style[propertyName] = value;\n }\n};\ngoog.style.styleNameCache_ = {};\ngoog.style.getVendorJsStyleName_ = function(element, style) {\n var propertyName = goog.style.styleNameCache_[style];\n if (!propertyName) {\n var camelStyle = goog.string.toCamelCase(style);\n propertyName = camelStyle;\n if (element.style[camelStyle] === undefined) {\n var prefixedStyle = goog.dom.vendor.getVendorJsPrefix() + goog.string.toTitleCase(camelStyle);\n if (element.style[prefixedStyle] !== undefined) {\n propertyName = prefixedStyle;\n }\n }\n goog.style.styleNameCache_[style] = propertyName;\n }\n return propertyName;\n};\ngoog.style.getVendorStyleName_ = function(element, style) {\n var camelStyle = goog.string.toCamelCase(style);\n if (element.style[camelStyle] === undefined) {\n var prefixedStyle = goog.dom.vendor.getVendorJsPrefix() + goog.string.toTitleCase(camelStyle);\n if (element.style[prefixedStyle] !== undefined) {\n return goog.dom.vendor.getVendorPrefix() + \"-\" + style;\n }\n }\n return style;\n};\ngoog.style.getStyle = function(element, property) {\n var styleValue = element.style[goog.string.toCamelCase(property)];\n if (typeof styleValue !== \"undefined\") {\n return styleValue;\n }\n return element.style[goog.style.getVendorJsStyleName_(element, property)] || \"\";\n};\ngoog.style.getComputedStyle = function(element, property) {\n var doc = goog.dom.getOwnerDocument(element);\n if (doc.defaultView && doc.defaultView.getComputedStyle) {\n var styles = doc.defaultView.getComputedStyle(element, null);\n if (styles) {\n return styles[property] || styles.getPropertyValue(property) || \"\";\n }\n }\n return \"\";\n};\ngoog.style.getCascadedStyle = function(element, style) {\n return element.currentStyle ? element.currentStyle[style] : null;\n};\ngoog.style.getStyle_ = function(element, style) {\n return goog.style.getComputedStyle(element, style) || goog.style.getCascadedStyle(element, style) || element.style && element.style[style];\n};\ngoog.style.getComputedBoxSizing = function(element) {\n return goog.style.getStyle_(element, \"boxSizing\") || goog.style.getStyle_(element, \"MozBoxSizing\") || goog.style.getStyle_(element, \"WebkitBoxSizing\") || null;\n};\ngoog.style.getComputedPosition = function(element) {\n return goog.style.getStyle_(element, \"position\");\n};\ngoog.style.getBackgroundColor = function(element) {\n return goog.style.getStyle_(element, \"backgroundColor\");\n};\ngoog.style.getComputedOverflowX = function(element) {\n return goog.style.getStyle_(element, \"overflowX\");\n};\ngoog.style.getComputedOverflowY = function(element) {\n return goog.style.getStyle_(element, \"overflowY\");\n};\ngoog.style.getComputedZIndex = function(element) {\n return goog.style.getStyle_(element, \"zIndex\");\n};\ngoog.style.getComputedTextAlign = function(element) {\n return goog.style.getStyle_(element, \"textAlign\");\n};\ngoog.style.getComputedCursor = function(element) {\n return goog.style.getStyle_(element, \"cursor\");\n};\ngoog.style.getComputedTransform = function(element) {\n var property = goog.style.getVendorStyleName_(element, \"transform\");\n return goog.style.getStyle_(element, property) || goog.style.getStyle_(element, \"transform\");\n};\ngoog.style.setPosition = function(el, arg1, opt_arg2) {\n var x, y;\n if (arg1 instanceof goog.math.Coordinate) {\n x = arg1.x;\n y = arg1.y;\n } else {\n x = arg1;\n y = opt_arg2;\n }\n el.style.left = goog.style.getPixelStyleValue_(x, false);\n el.style.top = goog.style.getPixelStyleValue_(y, false);\n};\ngoog.style.getPosition = function(element) {\n return new goog.math.Coordinate(element.offsetLeft, element.offsetTop);\n};\ngoog.style.getClientViewportElement = function(opt_node) {\n var doc;\n if (opt_node) {\n doc = goog.dom.getOwnerDocument(opt_node);\n } else {\n doc = goog.dom.getDocument();\n }\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9) && !goog.dom.getDomHelper(doc).isCss1CompatMode()) {\n return doc.body;\n }\n return doc.documentElement;\n};\ngoog.style.getViewportPageOffset = function(doc) {\n var body = doc.body;\n var documentElement = doc.documentElement;\n var scrollLeft = body.scrollLeft || documentElement.scrollLeft;\n var scrollTop = body.scrollTop || documentElement.scrollTop;\n return new goog.math.Coordinate(scrollLeft, scrollTop);\n};\ngoog.style.getBoundingClientRect_ = function(el) {\n try {\n return el.getBoundingClientRect();\n } catch (e) {\n return {\"left\":0, \"top\":0, \"right\":0, \"bottom\":0};\n }\n};\ngoog.style.getOffsetParent = function(element) {\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(8)) {\n goog.asserts.assert(element && \"offsetParent\" in element);\n return element.offsetParent;\n }\n var doc = goog.dom.getOwnerDocument(element);\n var positionStyle = goog.style.getStyle_(element, \"position\");\n var skipStatic = positionStyle == \"fixed\" || positionStyle == \"absolute\";\n for (var parent = element.parentNode; parent && parent != doc; parent = parent.parentNode) {\n if (parent.nodeType == goog.dom.NodeType.DOCUMENT_FRAGMENT && parent.host) {\n parent = parent.host;\n }\n positionStyle = goog.style.getStyle_(parent, \"position\");\n skipStatic = skipStatic && positionStyle == \"static\" && parent != doc.documentElement && parent != doc.body;\n if (!skipStatic && (parent.scrollWidth > parent.clientWidth || parent.scrollHeight > parent.clientHeight || positionStyle == \"fixed\" || positionStyle == \"absolute\" || positionStyle == \"relative\")) {\n return parent;\n }\n }\n return null;\n};\ngoog.style.getVisibleRectForElement = function(element) {\n var visibleRect = new goog.math.Box(0, Infinity, Infinity, 0);\n var dom = goog.dom.getDomHelper(element);\n var body = dom.getDocument().body;\n var documentElement = dom.getDocument().documentElement;\n var scrollEl = dom.getDocumentScrollElement();\n for (var el = element; el = goog.style.getOffsetParent(el);) {\n if ((!goog.userAgent.IE || el.clientWidth != 0) && (!goog.userAgent.WEBKIT || el.clientHeight != 0 || el != body) && (el != body && el != documentElement && goog.style.getStyle_(el, \"overflow\") != \"visible\")) {\n var pos = goog.style.getPageOffset(el);\n var client = goog.style.getClientLeftTop(el);\n pos.x += client.x;\n pos.y += client.y;\n visibleRect.top = Math.max(visibleRect.top, pos.y);\n visibleRect.right = Math.min(visibleRect.right, pos.x + el.clientWidth);\n visibleRect.bottom = Math.min(visibleRect.bottom, pos.y + el.clientHeight);\n visibleRect.left = Math.max(visibleRect.left, pos.x);\n }\n }\n var scrollX = scrollEl.scrollLeft, scrollY = scrollEl.scrollTop;\n visibleRect.left = Math.max(visibleRect.left, scrollX);\n visibleRect.top = Math.max(visibleRect.top, scrollY);\n var winSize = dom.getViewportSize();\n visibleRect.right = Math.min(visibleRect.right, scrollX + winSize.width);\n visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + winSize.height);\n return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;\n};\ngoog.style.getContainerOffsetToScrollInto = function(element, opt_container, opt_center) {\n var container = opt_container || goog.dom.getDocumentScrollElement();\n var elementPos = goog.style.getPageOffset(element);\n var containerPos = goog.style.getPageOffset(container);\n var containerBorder = goog.style.getBorderBox(container);\n if (container == goog.dom.getDocumentScrollElement()) {\n var relX = elementPos.x - container.scrollLeft;\n var relY = elementPos.y - container.scrollTop;\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(10)) {\n relX += containerBorder.left;\n relY += containerBorder.top;\n }\n } else {\n var relX = elementPos.x - containerPos.x - containerBorder.left;\n var relY = elementPos.y - containerPos.y - containerBorder.top;\n }\n var elementSize = goog.style.getSizeWithDisplay_(element);\n var spaceX = container.clientWidth - elementSize.width;\n var spaceY = container.clientHeight - elementSize.height;\n var scrollLeft = container.scrollLeft;\n var scrollTop = container.scrollTop;\n if (opt_center) {\n scrollLeft += relX - spaceX / 2;\n scrollTop += relY - spaceY / 2;\n } else {\n scrollLeft += Math.min(relX, Math.max(relX - spaceX, 0));\n scrollTop += Math.min(relY, Math.max(relY - spaceY, 0));\n }\n return new goog.math.Coordinate(scrollLeft, scrollTop);\n};\ngoog.style.scrollIntoContainerView = function(element, opt_container, opt_center) {\n var container = opt_container || goog.dom.getDocumentScrollElement();\n var offset = goog.style.getContainerOffsetToScrollInto(element, container, opt_center);\n container.scrollLeft = offset.x;\n container.scrollTop = offset.y;\n};\ngoog.style.getClientLeftTop = function(el) {\n return new goog.math.Coordinate(el.clientLeft, el.clientTop);\n};\ngoog.style.getPageOffset = function(el) {\n var doc = goog.dom.getOwnerDocument(el);\n goog.asserts.assertObject(el, \"Parameter is required\");\n var pos = new goog.math.Coordinate(0, 0);\n var viewportElement = goog.style.getClientViewportElement(doc);\n if (el == viewportElement) {\n return pos;\n }\n var box = goog.style.getBoundingClientRect_(el);\n var scrollCoord = goog.dom.getDomHelper(doc).getDocumentScroll();\n pos.x = box.left + scrollCoord.x;\n pos.y = box.top + scrollCoord.y;\n return pos;\n};\ngoog.style.getPageOffsetLeft = function(el) {\n return goog.style.getPageOffset(el).x;\n};\ngoog.style.getPageOffsetTop = function(el) {\n return goog.style.getPageOffset(el).y;\n};\ngoog.style.getFramedPageOffset = function(el, relativeWin) {\n var position = new goog.math.Coordinate(0, 0);\n var currentWin = goog.dom.getWindow(goog.dom.getOwnerDocument(el));\n if (!goog.reflect.canAccessProperty(currentWin, \"parent\")) {\n return position;\n }\n var currentEl = el;\n do {\n var offset = currentWin == relativeWin ? goog.style.getPageOffset(currentEl) : goog.style.getClientPositionForElement_(goog.asserts.assert(currentEl));\n position.x += offset.x;\n position.y += offset.y;\n } while (currentWin && currentWin != relativeWin && currentWin != currentWin.parent && (currentEl = currentWin.frameElement) && (currentWin = currentWin.parent));\n return position;\n};\ngoog.style.translateRectForAnotherFrame = function(rect, origBase, newBase) {\n if (origBase.getDocument() != newBase.getDocument()) {\n var body = origBase.getDocument().body;\n var pos = goog.style.getFramedPageOffset(body, newBase.getWindow());\n pos = goog.math.Coordinate.difference(pos, goog.style.getPageOffset(body));\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9) && !origBase.isCss1CompatMode()) {\n pos = goog.math.Coordinate.difference(pos, origBase.getDocumentScroll());\n }\n rect.left += pos.x;\n rect.top += pos.y;\n }\n};\ngoog.style.getRelativePosition = function(a, b) {\n var ap = goog.style.getClientPosition(a);\n var bp = goog.style.getClientPosition(b);\n return new goog.math.Coordinate(ap.x - bp.x, ap.y - bp.y);\n};\ngoog.style.getClientPositionForElement_ = function(el) {\n var box = goog.style.getBoundingClientRect_(el);\n return new goog.math.Coordinate(box.left, box.top);\n};\ngoog.style.getClientPosition = function(el) {\n goog.asserts.assert(el);\n if (el.nodeType == goog.dom.NodeType.ELEMENT) {\n return goog.style.getClientPositionForElement_(el);\n } else {\n var targetEvent = el.changedTouches ? el.changedTouches[0] : el;\n return new goog.math.Coordinate(targetEvent.clientX, targetEvent.clientY);\n }\n};\ngoog.style.setPageOffset = function(el, x, opt_y) {\n var cur = goog.style.getPageOffset(el);\n if (x instanceof goog.math.Coordinate) {\n opt_y = x.y;\n x = x.x;\n }\n var dx = goog.asserts.assertNumber(x) - cur.x;\n var dy = Number(opt_y) - cur.y;\n goog.style.setPosition(el, el.offsetLeft + dx, el.offsetTop + dy);\n};\ngoog.style.setSize = function(element, w, opt_h) {\n var h;\n if (w instanceof goog.math.Size) {\n h = w.height;\n w = w.width;\n } else {\n if (opt_h == undefined) {\n throw new Error(\"missing height argument\");\n }\n h = opt_h;\n }\n goog.style.setWidth(element, w);\n goog.style.setHeight(element, h);\n};\ngoog.style.getPixelStyleValue_ = function(value, round) {\n if (typeof value == \"number\") {\n value = (round ? Math.round(value) : value) + \"px\";\n }\n return value;\n};\ngoog.style.setHeight = function(element, height) {\n element.style.height = goog.style.getPixelStyleValue_(height, true);\n};\ngoog.style.setWidth = function(element, width) {\n element.style.width = goog.style.getPixelStyleValue_(width, true);\n};\ngoog.style.getSize = function(element) {\n return goog.style.evaluateWithTemporaryDisplay_(goog.style.getSizeWithDisplay_, element);\n};\ngoog.style.evaluateWithTemporaryDisplay_ = function(fn, element) {\n if (goog.style.getStyle_(element, \"display\") != \"none\") {\n return fn(element);\n }\n var style = element.style;\n var originalDisplay = style.display;\n var originalVisibility = style.visibility;\n var originalPosition = style.position;\n style.visibility = \"hidden\";\n style.position = \"absolute\";\n style.display = \"inline\";\n var retVal = fn(element);\n style.display = originalDisplay;\n style.position = originalPosition;\n style.visibility = originalVisibility;\n return retVal;\n};\ngoog.style.getSizeWithDisplay_ = function(element) {\n var offsetWidth = element.offsetWidth;\n var offsetHeight = element.offsetHeight;\n var webkitOffsetsZero = goog.userAgent.WEBKIT && !offsetWidth && !offsetHeight;\n if ((offsetWidth === undefined || webkitOffsetsZero) && element.getBoundingClientRect) {\n var clientRect = goog.style.getBoundingClientRect_(element);\n return new goog.math.Size(clientRect.right - clientRect.left, clientRect.bottom - clientRect.top);\n }\n return new goog.math.Size(offsetWidth, offsetHeight);\n};\ngoog.style.getTransformedSize = function(element) {\n if (!element.getBoundingClientRect) {\n return null;\n }\n var clientRect = goog.style.evaluateWithTemporaryDisplay_(goog.style.getBoundingClientRect_, element);\n return new goog.math.Size(clientRect.right - clientRect.left, clientRect.bottom - clientRect.top);\n};\ngoog.style.getBounds = function(element) {\n var o = goog.style.getPageOffset(element);\n var s = goog.style.getSize(element);\n return new goog.math.Rect(o.x, o.y, s.width, s.height);\n};\ngoog.style.toCamelCase = function(selector) {\n return goog.string.toCamelCase(String(selector));\n};\ngoog.style.toSelectorCase = function(selector) {\n return goog.string.toSelectorCase(selector);\n};\ngoog.style.getOpacity = function(el) {\n goog.asserts.assert(el);\n var style = el.style;\n var result = \"\";\n if (\"opacity\" in style) {\n result = style.opacity;\n } else if (\"MozOpacity\" in style) {\n result = style.MozOpacity;\n } else if (\"filter\" in style) {\n var match = style.filter.match(/alpha\\(opacity=([\\d.]+)\\)/);\n if (match) {\n result = String(match[1] / 100);\n }\n }\n return result == \"\" ? result : Number(result);\n};\ngoog.style.setOpacity = function(el, alpha) {\n goog.asserts.assert(el);\n var style = el.style;\n if (\"opacity\" in style) {\n style.opacity = alpha;\n } else if (\"MozOpacity\" in style) {\n style.MozOpacity = alpha;\n } else if (\"filter\" in style) {\n if (alpha === \"\") {\n style.filter = \"\";\n } else {\n style.filter = \"alpha(opacity\\x3d\" + Number(alpha) * 100 + \")\";\n }\n }\n};\ngoog.style.setTransparentBackgroundImage = function(el, src) {\n var style = el.style;\n style.backgroundImage = \"url(\" + src + \")\";\n style.backgroundPosition = \"top left\";\n style.backgroundRepeat = \"no-repeat\";\n};\ngoog.style.clearTransparentBackgroundImage = function(el) {\n var style = el.style;\n if (\"filter\" in style) {\n style.filter = \"\";\n } else {\n style.backgroundImage = \"none\";\n }\n};\ngoog.style.showElement = function(el, display) {\n goog.style.setElementShown(el, display);\n};\ngoog.style.setElementShown = function(el, isShown) {\n el.style.display = isShown ? \"\" : \"none\";\n};\ngoog.style.isElementShown = function(el) {\n return el.style.display != \"none\";\n};\ngoog.style.installSafeStyleSheet = function(safeStyleSheet, opt_node) {\n var dh = goog.dom.getDomHelper(opt_node);\n var doc = dh.getDocument();\n if (goog.userAgent.IE && doc.createStyleSheet) {\n var styleSheet = doc.createStyleSheet();\n goog.style.setSafeStyleSheet(styleSheet, safeStyleSheet);\n return styleSheet;\n } else {\n var head = dh.getElementsByTagNameAndClass(goog.dom.TagName.HEAD)[0];\n if (!head) {\n var body = dh.getElementsByTagNameAndClass(goog.dom.TagName.BODY)[0];\n head = dh.createDom(goog.dom.TagName.HEAD);\n body.parentNode.insertBefore(head, body);\n }\n var el = dh.createDom(goog.dom.TagName.STYLE);\n const nonce = goog.dom.safe.getStyleNonce();\n if (nonce) {\n el.setAttribute(\"nonce\", nonce);\n }\n goog.style.setSafeStyleSheet(el, safeStyleSheet);\n dh.appendChild(head, el);\n return el;\n }\n};\ngoog.style.uninstallStyles = function(styleSheet) {\n var node = styleSheet.ownerNode || styleSheet.owningElement || styleSheet;\n goog.dom.removeNode(node);\n};\ngoog.style.setSafeStyleSheet = function(element, safeStyleSheet) {\n var stylesString = goog.html.SafeStyleSheet.unwrap(safeStyleSheet);\n if (goog.userAgent.IE && element.cssText !== undefined) {\n element.cssText = stylesString;\n } else if (goog.global.trustedTypes) {\n goog.dom.setTextContent(element, stylesString);\n } else {\n element.innerHTML = stylesString;\n }\n};\ngoog.style.setPreWrap = function(el) {\n var style = el.style;\n if (goog.userAgent.GECKO) {\n style.whiteSpace = \"-moz-pre-wrap\";\n } else {\n style.whiteSpace = \"pre-wrap\";\n }\n};\ngoog.style.setInlineBlock = function(el) {\n var style = el.style;\n style.position = \"relative\";\n style.display = \"inline-block\";\n};\ngoog.style.isRightToLeft = function(el) {\n return \"rtl\" == goog.style.getStyle_(el, \"direction\");\n};\ngoog.style.unselectableStyle_ = goog.userAgent.GECKO ? \"MozUserSelect\" : goog.userAgent.WEBKIT || goog.userAgent.EDGE ? \"WebkitUserSelect\" : null;\ngoog.style.isUnselectable = function(el) {\n if (goog.style.unselectableStyle_) {\n return el.style[goog.style.unselectableStyle_].toLowerCase() == \"none\";\n } else if (goog.userAgent.IE) {\n return el.getAttribute(\"unselectable\") == \"on\";\n }\n return false;\n};\ngoog.style.setUnselectable = function(el, unselectable, opt_noRecurse) {\n var descendants = !opt_noRecurse ? el.getElementsByTagName(\"*\") : null;\n var name = goog.style.unselectableStyle_;\n if (name) {\n var value = unselectable ? \"none\" : \"\";\n if (el.style) {\n el.style[name] = value;\n }\n if (descendants) {\n for (var i = 0, descendant; descendant = descendants[i]; i++) {\n if (descendant.style) {\n descendant.style[name] = value;\n }\n }\n }\n } else if (goog.userAgent.IE) {\n var value = unselectable ? \"on\" : \"\";\n el.setAttribute(\"unselectable\", value);\n if (descendants) {\n for (var i = 0, descendant; descendant = descendants[i]; i++) {\n descendant.setAttribute(\"unselectable\", value);\n }\n }\n }\n};\ngoog.style.getBorderBoxSize = function(element) {\n return new goog.math.Size(element.offsetWidth, element.offsetHeight);\n};\ngoog.style.setBorderBoxSize = function(element, size) {\n goog.style.setBoxSizingSize_(element, size, \"border-box\");\n};\ngoog.style.getContentBoxSize = function(element) {\n var doc = goog.dom.getOwnerDocument(element);\n var ieCurrentStyle = goog.userAgent.IE && element.currentStyle;\n if (ieCurrentStyle && goog.dom.getDomHelper(doc).isCss1CompatMode() && ieCurrentStyle.width != \"auto\" && ieCurrentStyle.height != \"auto\" && !ieCurrentStyle.boxSizing) {\n var width = goog.style.getIePixelValue_(element, ieCurrentStyle.width, \"width\", \"pixelWidth\");\n var height = goog.style.getIePixelValue_(element, ieCurrentStyle.height, \"height\", \"pixelHeight\");\n return new goog.math.Size(width, height);\n } else {\n var borderBoxSize = goog.style.getBorderBoxSize(element);\n var paddingBox = goog.style.getPaddingBox(element);\n var borderBox = goog.style.getBorderBox(element);\n return new goog.math.Size(borderBoxSize.width - borderBox.left - paddingBox.left - paddingBox.right - borderBox.right, borderBoxSize.height - borderBox.top - paddingBox.top - paddingBox.bottom - borderBox.bottom);\n }\n};\ngoog.style.setContentBoxSize = function(element, size) {\n goog.style.setBoxSizingSize_(element, size, \"content-box\");\n};\ngoog.style.setBoxSizingSize_ = function(element, size, boxSizing) {\n var style = element.style;\n if (goog.userAgent.GECKO) {\n style.MozBoxSizing = boxSizing;\n } else if (goog.userAgent.WEBKIT) {\n style.WebkitBoxSizing = boxSizing;\n } else {\n style.boxSizing = boxSizing;\n }\n style.width = Math.max(size.width, 0) + \"px\";\n style.height = Math.max(size.height, 0) + \"px\";\n};\ngoog.style.getIePixelValue_ = function(element, value, name, pixelName) {\n if (/^\\d+px?$/.test(value)) {\n return parseInt(value, 10);\n } else {\n var oldStyleValue = element.style[name];\n var oldRuntimeValue = element.runtimeStyle[name];\n element.runtimeStyle[name] = element.currentStyle[name];\n element.style[name] = value;\n var pixelValue = element.style[pixelName];\n element.style[name] = oldStyleValue;\n element.runtimeStyle[name] = oldRuntimeValue;\n return +pixelValue;\n }\n};\ngoog.style.getIePixelDistance_ = function(element, propName) {\n var value = goog.style.getCascadedStyle(element, propName);\n return value ? goog.style.getIePixelValue_(element, value, \"left\", \"pixelLeft\") : 0;\n};\ngoog.style.getBox_ = function(element, stylePrefix) {\n if (goog.userAgent.IE) {\n var left = goog.style.getIePixelDistance_(element, stylePrefix + \"Left\");\n var right = goog.style.getIePixelDistance_(element, stylePrefix + \"Right\");\n var top = goog.style.getIePixelDistance_(element, stylePrefix + \"Top\");\n var bottom = goog.style.getIePixelDistance_(element, stylePrefix + \"Bottom\");\n return new goog.math.Box(top, right, bottom, left);\n } else {\n var left = goog.style.getComputedStyle(element, stylePrefix + \"Left\");\n var right = goog.style.getComputedStyle(element, stylePrefix + \"Right\");\n var top = goog.style.getComputedStyle(element, stylePrefix + \"Top\");\n var bottom = goog.style.getComputedStyle(element, stylePrefix + \"Bottom\");\n return new goog.math.Box(parseFloat(top), parseFloat(right), parseFloat(bottom), parseFloat(left));\n }\n};\ngoog.style.getPaddingBox = function(element) {\n return goog.style.getBox_(element, \"padding\");\n};\ngoog.style.getMarginBox = function(element) {\n return goog.style.getBox_(element, \"margin\");\n};\ngoog.style.ieBorderWidthKeywords_ = {\"thin\":2, \"medium\":4, \"thick\":6};\ngoog.style.getIePixelBorder_ = function(element, prop) {\n if (goog.style.getCascadedStyle(element, prop + \"Style\") == \"none\") {\n return 0;\n }\n var width = goog.style.getCascadedStyle(element, prop + \"Width\");\n if (width in goog.style.ieBorderWidthKeywords_) {\n return goog.style.ieBorderWidthKeywords_[width];\n }\n return goog.style.getIePixelValue_(element, width, \"left\", \"pixelLeft\");\n};\ngoog.style.getBorderBox = function(element) {\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9)) {\n var left = goog.style.getIePixelBorder_(element, \"borderLeft\");\n var right = goog.style.getIePixelBorder_(element, \"borderRight\");\n var top = goog.style.getIePixelBorder_(element, \"borderTop\");\n var bottom = goog.style.getIePixelBorder_(element, \"borderBottom\");\n return new goog.math.Box(top, right, bottom, left);\n } else {\n var left = goog.style.getComputedStyle(element, \"borderLeftWidth\");\n var right = goog.style.getComputedStyle(element, \"borderRightWidth\");\n var top = goog.style.getComputedStyle(element, \"borderTopWidth\");\n var bottom = goog.style.getComputedStyle(element, \"borderBottomWidth\");\n return new goog.math.Box(parseFloat(top), parseFloat(right), parseFloat(bottom), parseFloat(left));\n }\n};\ngoog.style.getFontFamily = function(el) {\n var doc = goog.dom.getOwnerDocument(el);\n var font = \"\";\n if (doc.body.createTextRange && goog.dom.contains(doc, el)) {\n var range = doc.body.createTextRange();\n range.moveToElementText(el);\n try {\n font = range.queryCommandValue(\"FontName\");\n } catch (e) {\n font = \"\";\n }\n }\n if (!font) {\n font = goog.style.getStyle_(el, \"fontFamily\");\n }\n var fontsArray = font.split(\",\");\n if (fontsArray.length > 1) {\n font = fontsArray[0];\n }\n return goog.string.stripQuotes(font, \"\\\"'\");\n};\ngoog.style.lengthUnitRegex_ = /[^\\d]+$/;\ngoog.style.getLengthUnits = function(value) {\n var units = value.match(goog.style.lengthUnitRegex_);\n return units && units[0] || null;\n};\ngoog.style.ABSOLUTE_CSS_LENGTH_UNITS_ = {\"cm\":1, \"in\":1, \"mm\":1, \"pc\":1, \"pt\":1};\ngoog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_ = {\"em\":1, \"ex\":1};\ngoog.style.getFontSize = function(el) {\n var fontSize = goog.style.getStyle_(el, \"fontSize\");\n var sizeUnits = goog.style.getLengthUnits(fontSize);\n if (fontSize && \"px\" == sizeUnits) {\n return parseInt(fontSize, 10);\n }\n if (goog.userAgent.IE) {\n if (String(sizeUnits) in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_) {\n return goog.style.getIePixelValue_(el, fontSize, \"left\", \"pixelLeft\");\n } else if (el.parentNode && el.parentNode.nodeType == goog.dom.NodeType.ELEMENT && String(sizeUnits) in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_) {\n var parentElement = el.parentNode;\n var parentSize = goog.style.getStyle_(parentElement, \"fontSize\");\n return goog.style.getIePixelValue_(parentElement, fontSize == parentSize ? \"1em\" : fontSize, \"left\", \"pixelLeft\");\n }\n }\n var sizeElement = goog.dom.createDom(goog.dom.TagName.SPAN, {\"style\":\"visibility:hidden;position:absolute;\" + \"line-height:0;padding:0;margin:0;border:0;height:1em;\"});\n goog.dom.appendChild(el, sizeElement);\n fontSize = sizeElement.offsetHeight;\n goog.dom.removeNode(sizeElement);\n return fontSize;\n};\ngoog.style.parseStyleAttribute = function(value) {\n var result = {};\n value.split(/\\s*;\\s*/).forEach(function(pair) {\n var keyValue = pair.match(/\\s*([\\w-]+)\\s*:(.+)/);\n if (keyValue) {\n var styleName = keyValue[1];\n var styleValue = goog.string.trim(keyValue[2]);\n result[goog.string.toCamelCase(styleName.toLowerCase())] = styleValue;\n }\n });\n return result;\n};\ngoog.style.toStyleAttribute = function(obj) {\n var buffer = [];\n goog.object.forEach(obj, function(value, key) {\n buffer.push(goog.string.toSelectorCase(key), \":\", value, \";\");\n });\n return buffer.join(\"\");\n};\ngoog.style.setFloat = function(el, value) {\n el.style[goog.userAgent.IE ? \"styleFloat\" : \"cssFloat\"] = value;\n};\ngoog.style.getFloat = function(el) {\n return el.style[goog.userAgent.IE ? \"styleFloat\" : \"cssFloat\"] || \"\";\n};\ngoog.style.getScrollbarWidth = function(opt_className) {\n var outerDiv = goog.dom.createElement(goog.dom.TagName.DIV);\n if (opt_className) {\n outerDiv.className = opt_className;\n }\n outerDiv.style.cssText = \"overflow:auto;\" + \"position:absolute;top:0;width:100px;height:100px\";\n var innerDiv = goog.dom.createElement(goog.dom.TagName.DIV);\n goog.style.setSize(innerDiv, \"200px\", \"200px\");\n outerDiv.appendChild(innerDiv);\n goog.dom.appendChild(goog.dom.getDocument().body, outerDiv);\n var width = outerDiv.offsetWidth - outerDiv.clientWidth;\n goog.dom.removeNode(outerDiv);\n return width;\n};\ngoog.style.MATRIX_TRANSLATION_REGEX_ = new RegExp(\"matrix\\\\([0-9\\\\.\\\\-]+, [0-9\\\\.\\\\-]+, \" + \"[0-9\\\\.\\\\-]+, [0-9\\\\.\\\\-]+, \" + \"([0-9\\\\.\\\\-]+)p?x?, ([0-9\\\\.\\\\-]+)p?x?\\\\)\");\ngoog.style.getCssTranslation = function(element) {\n var transform = goog.style.getComputedTransform(element);\n if (!transform) {\n return new goog.math.Coordinate(0, 0);\n }\n var matches = transform.match(goog.style.MATRIX_TRANSLATION_REGEX_);\n if (!matches) {\n return new goog.math.Coordinate(0, 0);\n }\n return new goog.math.Coordinate(parseFloat(matches[1]), parseFloat(matches[2]));\n};\n","~:source","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for element styles.\n *\n * @see ../demos/inline_block_quirks.html\n * @see ../demos/inline_block_standards.html\n * @see ../demos/style_viewport.html\n */\n\ngoog.provide('goog.style');\n\n\ngoog.require('goog.asserts');\ngoog.require('goog.dom');\ngoog.require('goog.dom.NodeType');\ngoog.require('goog.dom.TagName');\ngoog.require('goog.dom.safe');\ngoog.require('goog.dom.vendor');\ngoog.require('goog.html.SafeStyleSheet');\ngoog.require('goog.math.Box');\ngoog.require('goog.math.Coordinate');\ngoog.require('goog.math.Rect');\ngoog.require('goog.math.Size');\ngoog.require('goog.object');\ngoog.require('goog.reflect');\ngoog.require('goog.string');\ngoog.require('goog.userAgent');\ngoog.requireType('goog.events.Event');\n\n\n/**\n * Sets a style value on an element.\n *\n * This function is not indended to patch issues in the browser's style\n * handling, but to allow easy programmatic access to setting dash-separated\n * style properties. An example is setting a batch of properties from a data\n * object without overwriting old styles. When possible, use native APIs:\n * elem.style.propertyKey = 'value' or (if obliterating old styles is fine)\n * elem.style.cssText = 'property1: value1; property2: value2'.\n *\n * @param {Element} element The element to change.\n * @param {string|Object} style If a string, a style name. If an object, a hash\n * of style names to style values.\n * @param {string|number|boolean=} opt_value If style was a string, then this\n * should be the value.\n * @return {void}\n */\ngoog.style.setStyle = function(element, style, opt_value) {\n 'use strict';\n if (typeof style === 'string') {\n goog.style.setStyle_(element, opt_value, style);\n } else {\n for (var key in style) {\n goog.style.setStyle_(element, style[key], key);\n }\n }\n};\n\n\n/**\n * Sets a style value on an element, with parameters swapped to work with\n * `goog.object.forEach()`. Prepends a vendor-specific prefix when\n * necessary.\n * @param {Element} element The element to change.\n * @param {string|number|boolean|undefined} value Style value.\n * @param {string} style Style name.\n * @private\n */\ngoog.style.setStyle_ = function(element, value, style) {\n 'use strict';\n var propertyName = goog.style.getVendorJsStyleName_(element, style);\n\n if (propertyName) {\n // TODO(johnlenz): coerce to string?\n element.style[propertyName] = /** @type {?} */ (value);\n }\n};\n\n\n/**\n * Style name cache that stores previous property name lookups.\n *\n * This is used by setStyle to speed up property lookups, entries look like:\n * { StyleName: ActualPropertyName }\n *\n * @private {!Object}\n */\ngoog.style.styleNameCache_ = {};\n\n\n/**\n * Returns the style property name in camel-case. If it does not exist and a\n * vendor-specific version of the property does exist, then return the vendor-\n * specific property name instead.\n * @param {Element} element The element to change.\n * @param {string} style Style name.\n * @return {string} Vendor-specific style.\n * @private\n */\ngoog.style.getVendorJsStyleName_ = function(element, style) {\n 'use strict';\n var propertyName = goog.style.styleNameCache_[style];\n if (!propertyName) {\n var camelStyle = goog.string.toCamelCase(style);\n propertyName = camelStyle;\n\n if (element.style[camelStyle] === undefined) {\n var prefixedStyle = goog.dom.vendor.getVendorJsPrefix() +\n goog.string.toTitleCase(camelStyle);\n\n if (element.style[prefixedStyle] !== undefined) {\n propertyName = prefixedStyle;\n }\n }\n goog.style.styleNameCache_[style] = propertyName;\n }\n\n return propertyName;\n};\n\n\n/**\n * Returns the style property name in CSS notation. If it does not exist and a\n * vendor-specific version of the property does exist, then return the vendor-\n * specific property name instead.\n * @param {Element} element The element to change.\n * @param {string} style Style name.\n * @return {string} Vendor-specific style.\n * @private\n */\ngoog.style.getVendorStyleName_ = function(element, style) {\n 'use strict';\n var camelStyle = goog.string.toCamelCase(style);\n\n if (element.style[camelStyle] === undefined) {\n var prefixedStyle = goog.dom.vendor.getVendorJsPrefix() +\n goog.string.toTitleCase(camelStyle);\n\n if (element.style[prefixedStyle] !== undefined) {\n return goog.dom.vendor.getVendorPrefix() + '-' + style;\n }\n }\n\n return style;\n};\n\n\n/**\n * Retrieves an explicitly-set style value of a node. This returns '' if there\n * isn't a style attribute on the element or if this style property has not been\n * explicitly set in script.\n *\n * @param {Element} element Element to get style of.\n * @param {string} property Property to get, css-style (if you have a camel-case\n * property, use element.style[style]).\n * @return {string} Style value.\n */\ngoog.style.getStyle = function(element, property) {\n 'use strict';\n // element.style is '' for well-known properties which are unset.\n // For for browser specific styles as 'filter' is undefined\n // so we need to return '' explicitly to make it consistent across\n // browsers.\n var styleValue = element.style[goog.string.toCamelCase(property)];\n\n // Using typeof here because of a bug in Safari 5.1, where this value\n // was undefined, but === undefined returned false.\n if (typeof(styleValue) !== 'undefined') {\n return styleValue;\n }\n\n return element.style[goog.style.getVendorJsStyleName_(element, property)] ||\n '';\n};\n\n\n/**\n * Retrieves a computed style value of a node. It returns empty string if the\n * value cannot be computed (which will be the case in Internet Explorer) or\n * \"none\" if the property requested is an SVG one and it has not been\n * explicitly set (firefox and webkit).\n *\n * @param {Element} element Element to get style of.\n * @param {string} property Property to get (camel-case).\n * @return {string} Style value.\n */\ngoog.style.getComputedStyle = function(element, property) {\n 'use strict';\n var doc = goog.dom.getOwnerDocument(element);\n if (doc.defaultView && doc.defaultView.getComputedStyle) {\n var styles = doc.defaultView.getComputedStyle(element, null);\n if (styles) {\n // element.style[..] is undefined for browser specific styles\n // as 'filter'.\n return styles[property] || styles.getPropertyValue(property) || '';\n }\n }\n\n return '';\n};\n\n\n/**\n * Gets the cascaded style value of a node, or null if the value cannot be\n * computed (only Internet Explorer can do this).\n *\n * @param {Element} element Element to get style of.\n * @param {string} style Property to get (camel-case).\n * @return {string} Style value.\n */\ngoog.style.getCascadedStyle = function(element, style) {\n 'use strict';\n // TODO(nicksantos): This should be documented to return null. #fixTypes\n return /** @type {string} */ (\n element.currentStyle ? element.currentStyle[style] : null);\n};\n\n\n/**\n * Cross-browser pseudo get computed style. It returns the computed style where\n * available. If not available it tries the cascaded style value (IE\n * currentStyle) and in worst case the inline style value. It shouldn't be\n * called directly, see http://wiki/Main/ComputedStyleVsCascadedStyle for\n * discussion.\n *\n * @param {Element} element Element to get style of.\n * @param {string} style Property to get (must be camelCase, not css-style.).\n * @return {string} Style value.\n * @private\n */\ngoog.style.getStyle_ = function(element, style) {\n 'use strict';\n return goog.style.getComputedStyle(element, style) ||\n goog.style.getCascadedStyle(element, style) ||\n (element.style && element.style[style]);\n};\n\n\n/**\n * Retrieves the computed value of the box-sizing CSS attribute.\n * Browser support: http://caniuse.com/css3-boxsizing.\n * @param {!Element} element The element whose box-sizing to get.\n * @return {?string} 'content-box', 'border-box' or 'padding-box'. null if\n * box-sizing is not supported (IE7 and below).\n */\ngoog.style.getComputedBoxSizing = function(element) {\n 'use strict';\n return goog.style.getStyle_(element, 'boxSizing') ||\n goog.style.getStyle_(element, 'MozBoxSizing') ||\n goog.style.getStyle_(element, 'WebkitBoxSizing') || null;\n};\n\n\n/**\n * Retrieves the computed value of the position CSS attribute.\n * @param {Element} element The element to get the position of.\n * @return {string} Position value.\n */\ngoog.style.getComputedPosition = function(element) {\n 'use strict';\n return goog.style.getStyle_(element, 'position');\n};\n\n\n/**\n * Retrieves the computed background color string for a given element. The\n * string returned is suitable for assigning to another element's\n * background-color, but is not guaranteed to be in any particular string\n * format. Accessing the color in a numeric form may not be possible in all\n * browsers or with all input.\n *\n * If the background color for the element is defined as a hexadecimal value,\n * the resulting string can be parsed by goog.color.parse in all supported\n * browsers.\n *\n * Whether named colors like \"red\" or \"lightblue\" get translated into a\n * format which can be parsed is browser dependent. Calling this function on\n * transparent elements will return \"transparent\" in most browsers or\n * \"rgba(0, 0, 0, 0)\" in WebKit.\n * @param {Element} element The element to get the background color of.\n * @return {string} The computed string value of the background color.\n */\ngoog.style.getBackgroundColor = function(element) {\n 'use strict';\n return goog.style.getStyle_(element, 'backgroundColor');\n};\n\n\n/**\n * Retrieves the computed value of the overflow-x CSS attribute.\n * @param {Element} element The element to get the overflow-x of.\n * @return {string} The computed string value of the overflow-x attribute.\n */\ngoog.style.getComputedOverflowX = function(element) {\n 'use strict';\n return goog.style.getStyle_(element, 'overflowX');\n};\n\n\n/**\n * Retrieves the computed value of the overflow-y CSS attribute.\n * @param {Element} element The element to get the overflow-y of.\n * @return {string} The computed string value of the overflow-y attribute.\n */\ngoog.style.getComputedOverflowY = function(element) {\n 'use strict';\n return goog.style.getStyle_(element, 'overflowY');\n};\n\n\n/**\n * Retrieves the computed value of the z-index CSS attribute.\n * @param {Element} element The element to get the z-index of.\n * @return {string|number} The computed value of the z-index attribute.\n */\ngoog.style.getComputedZIndex = function(element) {\n 'use strict';\n return goog.style.getStyle_(element, 'zIndex');\n};\n\n\n/**\n * Retrieves the computed value of the text-align CSS attribute.\n * @param {Element} element The element to get the text-align of.\n * @return {string} The computed string value of the text-align attribute.\n */\ngoog.style.getComputedTextAlign = function(element) {\n 'use strict';\n return goog.style.getStyle_(element, 'textAlign');\n};\n\n\n/**\n * Retrieves the computed value of the cursor CSS attribute.\n * @param {Element} element The element to get the cursor of.\n * @return {string} The computed string value of the cursor attribute.\n */\ngoog.style.getComputedCursor = function(element) {\n 'use strict';\n return goog.style.getStyle_(element, 'cursor');\n};\n\n\n/**\n * Retrieves the computed value of the CSS transform attribute.\n * @param {Element} element The element to get the transform of.\n * @return {string} The computed string representation of the transform matrix.\n */\ngoog.style.getComputedTransform = function(element) {\n 'use strict';\n var property = goog.style.getVendorStyleName_(element, 'transform');\n return goog.style.getStyle_(element, property) ||\n goog.style.getStyle_(element, 'transform');\n};\n\n\n/**\n * Sets the top/left values of an element. If no unit is specified in the\n * argument then it will add px. The second argument is required if the first\n * argument is a string or number and is ignored if the first argument\n * is a coordinate.\n * @param {Element} el Element to move.\n * @param {string|number|goog.math.Coordinate} arg1 Left position or coordinate.\n * @param {string|number=} opt_arg2 Top position.\n * @return {void}\n */\ngoog.style.setPosition = function(el, arg1, opt_arg2) {\n 'use strict';\n var x, y;\n\n if (arg1 instanceof goog.math.Coordinate) {\n x = arg1.x;\n y = arg1.y;\n } else {\n x = arg1;\n y = opt_arg2;\n }\n\n el.style.left = goog.style.getPixelStyleValue_(\n /** @type {number|string} */ (x), false);\n el.style.top = goog.style.getPixelStyleValue_(\n /** @type {number|string} */ (y), false);\n};\n\n\n/**\n * Gets the offsetLeft and offsetTop properties of an element and returns them\n * in a Coordinate object\n * @param {Element} element Element.\n * @return {!goog.math.Coordinate} The position.\n */\ngoog.style.getPosition = function(element) {\n 'use strict';\n return new goog.math.Coordinate(\n /** @type {!HTMLElement} */ (element).offsetLeft,\n /** @type {!HTMLElement} */ (element).offsetTop);\n};\n\n\n/**\n * Returns the viewport element for a particular document\n * @param {Node=} opt_node DOM node (Document is OK) to get the viewport element\n * of.\n * @return {Element} document.documentElement or document.body.\n */\ngoog.style.getClientViewportElement = function(opt_node) {\n 'use strict';\n var doc;\n if (opt_node) {\n doc = goog.dom.getOwnerDocument(opt_node);\n } else {\n doc = goog.dom.getDocument();\n }\n\n // In old IE versions the document.body represented the viewport\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9) &&\n !goog.dom.getDomHelper(doc).isCss1CompatMode()) {\n return doc.body;\n }\n return doc.documentElement;\n};\n\n\n/**\n * Calculates the viewport coordinates relative to the page/document\n * containing the node. The viewport may be the browser viewport for\n * non-iframe document, or the iframe container for iframe'd document.\n * @param {!Document} doc The document to use as the reference point.\n * @return {!goog.math.Coordinate} The page offset of the viewport.\n */\ngoog.style.getViewportPageOffset = function(doc) {\n 'use strict';\n var body = doc.body;\n var documentElement = doc.documentElement;\n var scrollLeft = body.scrollLeft || documentElement.scrollLeft;\n var scrollTop = body.scrollTop || documentElement.scrollTop;\n return new goog.math.Coordinate(scrollLeft, scrollTop);\n};\n\n\n/**\n * Gets the client rectangle of the DOM element.\n *\n * getBoundingClientRect is part of a new CSS object model draft (with a\n * long-time presence in IE), replacing the error-prone parent offset\n * computation and the now-deprecated Gecko getBoxObjectFor.\n *\n * This utility patches common browser bugs in getBoundingClientRect. It\n * will fail if getBoundingClientRect is unsupported.\n *\n * If the element is not in the DOM, the result is undefined, and an error may\n * be thrown depending on user agent.\n *\n * @param {!Element} el The element whose bounding rectangle is being queried.\n * @return {!Object} A native bounding rectangle with numerical left, top,\n * right, and bottom. Reported by Firefox to be of object type ClientRect.\n * @private\n */\ngoog.style.getBoundingClientRect_ = function(el) {\n 'use strict';\n try {\n return el.getBoundingClientRect();\n } catch (e) {\n // In IE, calling getBoundingClientRect on an orphan element raises an\n // \"Unspecified Error\". All other browsers return zeros.\n return {'left': 0, 'top': 0, 'right': 0, 'bottom': 0};\n }\n};\n\n\n/**\n * Returns the first parent that could affect the position of a given element.\n * @param {Element} element The element to get the offset parent for.\n * @return {Element} The first offset parent or null if one cannot be found.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.style.getOffsetParent = function(element) {\n 'use strict';\n // element.offsetParent does the right thing in IE7 and below. In other\n // browsers it only includes elements with position absolute, relative or\n // fixed, not elements with overflow set to auto or scroll.\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(8)) {\n goog.asserts.assert(element && 'offsetParent' in element);\n return element.offsetParent;\n }\n\n var doc = goog.dom.getOwnerDocument(element);\n var positionStyle = goog.style.getStyle_(element, 'position');\n var skipStatic = positionStyle == 'fixed' || positionStyle == 'absolute';\n for (var parent = element.parentNode; parent && parent != doc;\n parent = parent.parentNode) {\n // Skip shadowDOM roots.\n if (parent.nodeType == goog.dom.NodeType.DOCUMENT_FRAGMENT && parent.host) {\n // Cast because the assignment is not type safe, and without a cast we\n // start typing parent loosely and get bad disambiguation.\n parent = /** @type {!Element} */ (parent.host);\n }\n positionStyle =\n goog.style.getStyle_(/** @type {!Element} */ (parent), 'position');\n skipStatic = skipStatic && positionStyle == 'static' &&\n parent != doc.documentElement && parent != doc.body;\n if (!skipStatic &&\n (parent.scrollWidth > parent.clientWidth ||\n parent.scrollHeight > parent.clientHeight ||\n positionStyle == 'fixed' || positionStyle == 'absolute' ||\n positionStyle == 'relative')) {\n return /** @type {!Element} */ (parent);\n }\n }\n return null;\n};\n\n\n/**\n * Calculates and returns the visible rectangle for a given element. Returns a\n * box describing the visible portion of the nearest scrollable offset ancestor.\n * Coordinates are given relative to the document.\n *\n * @param {Element} element Element to get the visible rect for.\n * @return {goog.math.Box} Bounding elementBox describing the visible rect or\n * null if scrollable ancestor isn't inside the visible viewport.\n */\ngoog.style.getVisibleRectForElement = function(element) {\n 'use strict';\n var visibleRect = new goog.math.Box(0, Infinity, Infinity, 0);\n var dom = goog.dom.getDomHelper(element);\n var body = dom.getDocument().body;\n var documentElement = dom.getDocument().documentElement;\n var scrollEl = dom.getDocumentScrollElement();\n\n // Determine the size of the visible rect by climbing the dom accounting for\n // all scrollable containers.\n for (var el = element; el = goog.style.getOffsetParent(el);) {\n // clientWidth is zero for inline block elements in IE.\n // on WEBKIT, body element can have clientHeight = 0 and scrollHeight > 0\n if ((!goog.userAgent.IE || el.clientWidth != 0) &&\n (!goog.userAgent.WEBKIT || el.clientHeight != 0 || el != body) &&\n // body may have overflow set on it, yet we still get the entire\n // viewport. In some browsers, el.offsetParent may be\n // document.documentElement, so check for that too.\n (el != body && el != documentElement &&\n goog.style.getStyle_(el, 'overflow') != 'visible')) {\n var pos = goog.style.getPageOffset(el);\n var client = goog.style.getClientLeftTop(el);\n pos.x += client.x;\n pos.y += client.y;\n\n visibleRect.top = Math.max(visibleRect.top, pos.y);\n visibleRect.right = Math.min(visibleRect.right, pos.x + el.clientWidth);\n visibleRect.bottom =\n Math.min(visibleRect.bottom, pos.y + el.clientHeight);\n visibleRect.left = Math.max(visibleRect.left, pos.x);\n }\n }\n\n // Clip by window's viewport.\n var scrollX = scrollEl.scrollLeft, scrollY = scrollEl.scrollTop;\n visibleRect.left = Math.max(visibleRect.left, scrollX);\n visibleRect.top = Math.max(visibleRect.top, scrollY);\n var winSize = dom.getViewportSize();\n visibleRect.right = Math.min(visibleRect.right, scrollX + winSize.width);\n visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + winSize.height);\n return visibleRect.top >= 0 && visibleRect.left >= 0 &&\n visibleRect.bottom > visibleRect.top &&\n visibleRect.right > visibleRect.left ?\n visibleRect :\n null;\n};\n\n\n/**\n * Calculate the scroll position of `container` with the minimum amount so\n * that the content and the borders of the given `element` become visible.\n * If the element is bigger than the container, its top left corner will be\n * aligned as close to the container's top left corner as possible.\n *\n * @param {Element} element The element to make visible.\n * @param {Element=} opt_container The container to scroll. If not set, then the\n * document scroll element will be used.\n * @param {boolean=} opt_center Whether to center the element in the container.\n * Defaults to false.\n * @return {!goog.math.Coordinate} The new scroll position of the container,\n * in form of goog.math.Coordinate(scrollLeft, scrollTop).\n */\ngoog.style.getContainerOffsetToScrollInto = function(\n element, opt_container, opt_center) {\n 'use strict';\n var container = opt_container || goog.dom.getDocumentScrollElement();\n // Absolute position of the element's border's top left corner.\n var elementPos = goog.style.getPageOffset(element);\n // Absolute position of the container's border's top left corner.\n var containerPos = goog.style.getPageOffset(container);\n var containerBorder = goog.style.getBorderBox(container);\n if (container == goog.dom.getDocumentScrollElement()) {\n // The element position is calculated based on the page offset, and the\n // document scroll element holds the scroll position within the page. We can\n // use the scroll position to calculate the relative position from the\n // element.\n var relX = elementPos.x - container.scrollLeft;\n var relY = elementPos.y - container.scrollTop;\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(10)) {\n // In older versions of IE getPageOffset(element) does not include the\n // container border so it has to be added to accommodate.\n relX += containerBorder.left;\n relY += containerBorder.top;\n }\n } else {\n // Relative pos. of the element's border box to the container's content box.\n var relX = elementPos.x - containerPos.x - containerBorder.left;\n var relY = elementPos.y - containerPos.y - containerBorder.top;\n }\n // How much the element can move in the container, i.e. the difference between\n // the element's bottom-right-most and top-left-most position where it's\n // fully visible.\n var elementSize = goog.style.getSizeWithDisplay_(element);\n var spaceX = container.clientWidth - elementSize.width;\n var spaceY = container.clientHeight - elementSize.height;\n var scrollLeft = container.scrollLeft;\n var scrollTop = container.scrollTop;\n if (opt_center) {\n // All browsers round non-integer scroll positions down.\n scrollLeft += relX - spaceX / 2;\n scrollTop += relY - spaceY / 2;\n } else {\n // This formula was designed to give the correct scroll values in the\n // following cases:\n // - element is higher than container (spaceY < 0) => scroll down by relY\n // - element is not higher that container (spaceY >= 0):\n // - it is above container (relY < 0) => scroll up by abs(relY)\n // - it is below container (relY > spaceY) => scroll down by relY - spaceY\n // - it is in the container => don't scroll\n scrollLeft += Math.min(relX, Math.max(relX - spaceX, 0));\n scrollTop += Math.min(relY, Math.max(relY - spaceY, 0));\n }\n return new goog.math.Coordinate(scrollLeft, scrollTop);\n};\n\n\n/**\n * Changes the scroll position of `container` with the minimum amount so\n * that the content and the borders of the given `element` become visible.\n * If the element is bigger than the container, its top left corner will be\n * aligned as close to the container's top left corner as possible.\n *\n * @param {Element} element The element to make visible.\n * @param {Element=} opt_container The container to scroll. If not set, then the\n * document scroll element will be used.\n * @param {boolean=} opt_center Whether to center the element in the container.\n * Defaults to false.\n */\ngoog.style.scrollIntoContainerView = function(\n element, opt_container, opt_center) {\n 'use strict';\n var container = opt_container || goog.dom.getDocumentScrollElement();\n var offset =\n goog.style.getContainerOffsetToScrollInto(element, container, opt_center);\n container.scrollLeft = offset.x;\n container.scrollTop = offset.y;\n};\n\n\n/**\n * Returns clientLeft (width of the left border and, if the directionality is\n * right to left, the vertical scrollbar) and clientTop as a coordinate object.\n *\n * @param {Element} el Element to get clientLeft for.\n * @return {!goog.math.Coordinate} Client left and top.\n */\ngoog.style.getClientLeftTop = function(el) {\n 'use strict';\n return new goog.math.Coordinate(el.clientLeft, el.clientTop);\n};\n\n\n/**\n * Returns a Coordinate object relative to the top-left of the HTML document.\n * Implemented as a single function to save having to do two recursive loops in\n * opera and safari just to get both coordinates. If you just want one value do\n * use goog.style.getPageOffsetLeft() and goog.style.getPageOffsetTop(), but\n * note if you call both those methods the tree will be analysed twice.\n *\n * @param {Element} el Element to get the page offset for.\n * @return {!goog.math.Coordinate} The page offset.\n */\ngoog.style.getPageOffset = function(el) {\n 'use strict';\n var doc = goog.dom.getOwnerDocument(el);\n // TODO(gboyer): Update the jsdoc in a way that doesn't break the universe.\n goog.asserts.assertObject(el, 'Parameter is required');\n\n // NOTE(arv): If element is hidden (display none or disconnected or any the\n // ancestors are hidden) we get (0,0) by default but we still do the\n // accumulation of scroll position.\n\n // TODO(arv): Should we check if the node is disconnected and in that case\n // return (0,0)?\n\n var pos = new goog.math.Coordinate(0, 0);\n var viewportElement = goog.style.getClientViewportElement(doc);\n if (el == viewportElement) {\n // viewport is always at 0,0 as that defined the coordinate system for this\n // function - this avoids special case checks in the code below\n return pos;\n }\n\n var box = goog.style.getBoundingClientRect_(el);\n // Must add the scroll coordinates in to get the absolute page offset\n // of element since getBoundingClientRect returns relative coordinates to\n // the viewport.\n var scrollCoord = goog.dom.getDomHelper(doc).getDocumentScroll();\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n pos.x = box.left + scrollCoord.x;\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n pos.y = box.top + scrollCoord.y;\n\n return pos;\n};\n\n\n/**\n * Returns the left coordinate of an element relative to the HTML document\n * @param {Element} el Elements.\n * @return {number} The left coordinate.\n */\ngoog.style.getPageOffsetLeft = function(el) {\n 'use strict';\n return goog.style.getPageOffset(el).x;\n};\n\n\n/**\n * Returns the top coordinate of an element relative to the HTML document\n * @param {Element} el Elements.\n * @return {number} The top coordinate.\n */\ngoog.style.getPageOffsetTop = function(el) {\n 'use strict';\n return goog.style.getPageOffset(el).y;\n};\n\n\n/**\n * Returns a Coordinate object relative to the top-left of an HTML document\n * in an ancestor frame of this element. Used for measuring the position of\n * an element inside a frame relative to a containing frame.\n *\n * @param {Element} el Element to get the page offset for.\n * @param {Window} relativeWin The window to measure relative to. If relativeWin\n * is not in the ancestor frame chain of the element, we measure relative to\n * the top-most window.\n * @return {!goog.math.Coordinate} The page offset.\n */\ngoog.style.getFramedPageOffset = function(el, relativeWin) {\n 'use strict';\n var position = new goog.math.Coordinate(0, 0);\n\n // Iterate up the ancestor frame chain, keeping track of the current window\n // and the current element in that window.\n var currentWin = goog.dom.getWindow(goog.dom.getOwnerDocument(el));\n\n // MS Edge throws when accessing \"parent\" if el's containing iframe has been\n // deleted.\n if (!goog.reflect.canAccessProperty(currentWin, 'parent')) {\n return position;\n }\n\n var currentEl = el;\n do {\n // if we're at the top window, we want to get the page offset.\n // if we're at an inner frame, we only want to get the window position\n // so that we can determine the actual page offset in the context of\n // the outer window.\n var offset = currentWin == relativeWin ?\n goog.style.getPageOffset(currentEl) :\n goog.style.getClientPositionForElement_(goog.asserts.assert(currentEl));\n\n position.x += offset.x;\n position.y += offset.y;\n } while (currentWin && currentWin != relativeWin &&\n currentWin != currentWin.parent &&\n (currentEl = currentWin.frameElement) &&\n (currentWin = currentWin.parent));\n\n return position;\n};\n\n\n/**\n * Translates the specified rect relative to origBase page, for newBase page.\n * If origBase and newBase are the same, this function does nothing.\n *\n * @param {goog.math.Rect} rect The source rectangle relative to origBase page,\n * and it will have the translated result.\n * @param {goog.dom.DomHelper} origBase The DomHelper for the input rectangle.\n * @param {goog.dom.DomHelper} newBase The DomHelper for the resultant\n * coordinate. This must be a DOM for an ancestor frame of origBase\n * or the same as origBase.\n */\ngoog.style.translateRectForAnotherFrame = function(rect, origBase, newBase) {\n 'use strict';\n if (origBase.getDocument() != newBase.getDocument()) {\n var body = origBase.getDocument().body;\n var pos = goog.style.getFramedPageOffset(body, newBase.getWindow());\n\n // Adjust Body's margin.\n pos = goog.math.Coordinate.difference(pos, goog.style.getPageOffset(body));\n\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9) &&\n !origBase.isCss1CompatMode()) {\n pos = goog.math.Coordinate.difference(pos, origBase.getDocumentScroll());\n }\n\n rect.left += pos.x;\n rect.top += pos.y;\n }\n};\n\n\n/**\n * Returns the position of an element relative to another element in the\n * document. A relative to B\n * @param {Element|Event|goog.events.Event} a Element or mouse event whose\n * position we're calculating.\n * @param {Element|Event|goog.events.Event} b Element or mouse event position\n * is relative to.\n * @return {!goog.math.Coordinate} The relative position.\n */\ngoog.style.getRelativePosition = function(a, b) {\n 'use strict';\n var ap = goog.style.getClientPosition(a);\n var bp = goog.style.getClientPosition(b);\n return new goog.math.Coordinate(ap.x - bp.x, ap.y - bp.y);\n};\n\n\n/**\n * Returns the position of the event or the element's border box relative to\n * the client viewport.\n * @param {!Element} el Element whose position to get.\n * @return {!goog.math.Coordinate} The position.\n * @private\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.style.getClientPositionForElement_ = function(el) {\n 'use strict';\n var box = goog.style.getBoundingClientRect_(el);\n return new goog.math.Coordinate(box.left, box.top);\n};\n\n\n/**\n * Returns the position of the event or the element's border box relative to\n * the client viewport. If an event is passed, and if this event is a \"touch\"\n * event, then the position of the first changedTouches will be returned.\n * @param {Element|Event|goog.events.Event} el Element or a mouse / touch event.\n * @return {!goog.math.Coordinate} The position.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.style.getClientPosition = function(el) {\n 'use strict';\n goog.asserts.assert(el);\n if (el.nodeType == goog.dom.NodeType.ELEMENT) {\n return goog.style.getClientPositionForElement_(\n /** @type {!Element} */ (el));\n } else {\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n var targetEvent = el.changedTouches ? el.changedTouches[0] : el;\n return new goog.math.Coordinate(targetEvent.clientX, targetEvent.clientY);\n }\n};\n\n\n/**\n * Moves an element to the given coordinates relative to the client viewport.\n * @param {Element} el Absolutely positioned element to set page offset for.\n * It must be in the document.\n * @param {number|goog.math.Coordinate} x Left position of the element's margin\n * box or a coordinate object.\n * @param {number=} opt_y Top position of the element's margin box.\n * @return {void}\n */\ngoog.style.setPageOffset = function(el, x, opt_y) {\n 'use strict';\n // Get current pageoffset\n var cur = goog.style.getPageOffset(el);\n\n if (x instanceof goog.math.Coordinate) {\n opt_y = x.y;\n x = x.x;\n }\n\n // NOTE(arv): We cannot allow strings for x and y. We could but that would\n // require us to manually transform between different units\n\n // Work out deltas\n var dx = goog.asserts.assertNumber(x) - cur.x;\n var dy = Number(opt_y) - cur.y;\n\n // Set position to current left/top + delta\n goog.style.setPosition(\n el, /** @type {!HTMLElement} */ (el).offsetLeft + dx,\n /** @type {!HTMLElement} */ (el).offsetTop + dy);\n};\n\n\n/**\n * Sets the width/height values of an element. If an argument is numeric,\n * or a goog.math.Size is passed, it is assumed to be pixels and will add\n * 'px' after converting it to an integer in string form. (This just sets the\n * CSS width and height properties so it might set content-box or border-box\n * size depending on the box model the browser is using.)\n *\n * @param {Element} element Element to set the size of.\n * @param {string|number|goog.math.Size} w Width of the element, or a\n * size object.\n * @param {string|number=} opt_h Height of the element. Required if w is not a\n * size object.\n * @return {void}\n */\ngoog.style.setSize = function(element, w, opt_h) {\n 'use strict';\n var h;\n if (w instanceof goog.math.Size) {\n h = w.height;\n w = w.width;\n } else {\n if (opt_h == undefined) {\n throw new Error('missing height argument');\n }\n h = opt_h;\n }\n\n goog.style.setWidth(element, /** @type {string|number} */ (w));\n goog.style.setHeight(element, h);\n};\n\n\n/**\n * Helper function to create a string to be set into a pixel-value style\n * property of an element. Can round to the nearest integer value.\n *\n * @param {string|number} value The style value to be used. If a number,\n * 'px' will be appended, otherwise the value will be applied directly.\n * @param {boolean} round Whether to round the nearest integer (if property\n * is a number).\n * @return {string} The string value for the property.\n * @private\n */\ngoog.style.getPixelStyleValue_ = function(value, round) {\n 'use strict';\n if (typeof value == 'number') {\n value = (round ? Math.round(value) : value) + 'px';\n }\n\n return value;\n};\n\n\n/**\n * Set the height of an element. Sets the element's style property.\n * @param {Element} element Element to set the height of.\n * @param {string|number} height The height value to set. If a number, 'px'\n * will be appended, otherwise the value will be applied directly.\n */\ngoog.style.setHeight = function(element, height) {\n 'use strict';\n element.style.height = goog.style.getPixelStyleValue_(height, true);\n};\n\n\n/**\n * Set the width of an element. Sets the element's style property.\n * @param {Element} element Element to set the width of.\n * @param {string|number} width The width value to set. If a number, 'px'\n * will be appended, otherwise the value will be applied directly.\n */\ngoog.style.setWidth = function(element, width) {\n 'use strict';\n element.style.width = goog.style.getPixelStyleValue_(width, true);\n};\n\n\n/**\n * Gets the height and width of an element, even if its display is none.\n *\n * Specifically, this returns the height and width of the border box,\n * irrespective of the box model in effect.\n *\n * Note that this function does not take CSS transforms into account. Please see\n * `goog.style.getTransformedSize`.\n * @param {Element} element Element to get size of.\n * @return {!goog.math.Size} Object with width/height properties.\n */\ngoog.style.getSize = function(element) {\n 'use strict';\n return goog.style.evaluateWithTemporaryDisplay_(\n goog.style.getSizeWithDisplay_, /** @type {!Element} */ (element));\n};\n\n\n/**\n * Call `fn` on `element` such that `element`'s dimensions are\n * accurate when it's passed to `fn`.\n * @param {function(!Element): T} fn Function to call with `element` as\n * an argument after temporarily changing `element`'s display such\n * that its dimensions are accurate.\n * @param {!Element} element Element (which may have display none) to use as\n * argument to `fn`.\n * @return {T} Value returned by calling `fn` with `element`.\n * @template T\n * @private\n */\ngoog.style.evaluateWithTemporaryDisplay_ = function(fn, element) {\n 'use strict';\n if (goog.style.getStyle_(element, 'display') != 'none') {\n return fn(element);\n }\n\n var style = element.style;\n var originalDisplay = style.display;\n var originalVisibility = style.visibility;\n var originalPosition = style.position;\n\n style.visibility = 'hidden';\n style.position = 'absolute';\n style.display = 'inline';\n\n var retVal = fn(element);\n\n style.display = originalDisplay;\n style.position = originalPosition;\n style.visibility = originalVisibility;\n\n return retVal;\n};\n\n\n/**\n * Gets the height and width of an element when the display is not none.\n * @param {Element} element Element to get size of.\n * @return {!goog.math.Size} Object with width/height properties.\n * @private\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.style.getSizeWithDisplay_ = function(element) {\n 'use strict';\n var offsetWidth = /** @type {!HTMLElement} */ (element).offsetWidth;\n var offsetHeight = /** @type {!HTMLElement} */ (element).offsetHeight;\n var webkitOffsetsZero =\n goog.userAgent.WEBKIT && !offsetWidth && !offsetHeight;\n if ((offsetWidth === undefined || webkitOffsetsZero) &&\n element.getBoundingClientRect) {\n // Fall back to calling getBoundingClientRect when offsetWidth or\n // offsetHeight are not defined, or when they are zero in WebKit browsers.\n // This makes sure that we return for the correct size for SVG elements, but\n // will still return 0 on Webkit prior to 534.8, see\n // http://trac.webkit.org/changeset/67252.\n var clientRect = goog.style.getBoundingClientRect_(element);\n return new goog.math.Size(\n clientRect.right - clientRect.left, clientRect.bottom - clientRect.top);\n }\n return new goog.math.Size(offsetWidth, offsetHeight);\n};\n\n\n/**\n * Gets the height and width of an element, post transform, even if its display\n * is none.\n *\n * This is like `goog.style.getSize`, except:\n *
    \n *
  1. Takes webkitTransforms such as rotate and scale into account.\n *
  2. Will return null if `element` doesn't respond to\n * `getBoundingClientRect`.\n *
  3. Currently doesn't make sense on non-WebKit browsers which don't support\n * webkitTransforms.\n *
\n * @param {!Element} element Element to get size of.\n * @return {goog.math.Size} Object with width/height properties.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.style.getTransformedSize = function(element) {\n 'use strict';\n if (!element.getBoundingClientRect) {\n return null;\n }\n\n var clientRect = goog.style.evaluateWithTemporaryDisplay_(\n goog.style.getBoundingClientRect_, element);\n return new goog.math.Size(\n clientRect.right - clientRect.left, clientRect.bottom - clientRect.top);\n};\n\n\n/**\n * Returns a bounding rectangle for a given element in page space.\n * @param {Element} element Element to get bounds of. Must not be display none.\n * @return {!goog.math.Rect} Bounding rectangle for the element.\n */\ngoog.style.getBounds = function(element) {\n 'use strict';\n var o = goog.style.getPageOffset(element);\n var s = goog.style.getSize(element);\n return new goog.math.Rect(o.x, o.y, s.width, s.height);\n};\n\n\n/**\n * Converts a CSS selector in the form style-property to styleProperty.\n * @param {*} selector CSS Selector.\n * @return {string} Camel case selector.\n * @deprecated Use goog.string.toCamelCase instead.\n */\ngoog.style.toCamelCase = function(selector) {\n 'use strict';\n return goog.string.toCamelCase(String(selector));\n};\n\n\n/**\n * Converts a CSS selector in the form styleProperty to style-property.\n * @param {string} selector Camel case selector.\n * @return {string} Selector cased.\n * @deprecated Use goog.string.toSelectorCase instead.\n */\ngoog.style.toSelectorCase = function(selector) {\n 'use strict';\n return goog.string.toSelectorCase(selector);\n};\n\n\n/**\n * Gets the opacity of a node (x-browser). This gets the inline style opacity\n * of the node, and does not take into account the cascaded or the computed\n * style for this node.\n * @param {Element} el Element whose opacity has to be found.\n * @return {number|string} Opacity between 0 and 1 or an empty string {@code ''}\n * if the opacity is not set.\n */\ngoog.style.getOpacity = function(el) {\n 'use strict';\n goog.asserts.assert(el);\n var style = el.style;\n var result = '';\n if ('opacity' in style) {\n result = style.opacity;\n } else if ('MozOpacity' in style) {\n result = style.MozOpacity;\n } else if ('filter' in style) {\n var match = style.filter.match(/alpha\\(opacity=([\\d.]+)\\)/);\n if (match) {\n result = String(match[1] / 100);\n }\n }\n return result == '' ? result : Number(result);\n};\n\n\n/**\n * Sets the opacity of a node (x-browser).\n * @param {Element} el Elements whose opacity has to be set.\n * @param {number|string} alpha Opacity between 0 and 1 or an empty string\n * {@code ''} to clear the opacity.\n * @return {void}\n */\ngoog.style.setOpacity = function(el, alpha) {\n 'use strict';\n goog.asserts.assert(el);\n var style = el.style;\n if ('opacity' in style) {\n style.opacity = alpha;\n } else if ('MozOpacity' in style) {\n style.MozOpacity = alpha;\n } else if ('filter' in style) {\n // TODO(arv): Overwriting the filter might have undesired side effects.\n if (alpha === '') {\n /**\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\n style.filter = '';\n } else {\n /**\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\n style.filter = 'alpha(opacity=' + (Number(alpha) * 100) + ')';\n }\n }\n};\n\n\n/**\n * Sets the background of an element to a transparent image in a browser-\n * independent manner.\n *\n * This function does not support repeating backgrounds or alternate background\n * positions to match the behavior of Internet Explorer. It also does not\n * support sizingMethods other than crop since they cannot be replicated in\n * browsers other than Internet Explorer.\n *\n * @param {Element} el The element to set background on.\n * @param {string} src The image source URL.\n * @return {void}\n */\ngoog.style.setTransparentBackgroundImage = function(el, src) {\n 'use strict';\n var style = el.style;\n // It is safe to use the style.filter in IE only. In Safari 'filter' is in\n // style object but access to style.filter causes it to throw an exception.\n // Note: IE8 supports images with an alpha channel.\n\n // Set style properties individually instead of using background shorthand\n // to prevent overwriting a pre-existing background color.\n style.backgroundImage = 'url(' + src + ')';\n style.backgroundPosition = 'top left';\n style.backgroundRepeat = 'no-repeat';\n};\n\n\n/**\n * Clears the background image of an element in a browser independent manner.\n * @param {Element} el The element to clear background image for.\n */\ngoog.style.clearTransparentBackgroundImage = function(el) {\n 'use strict';\n var style = el.style;\n if ('filter' in style) {\n // See TODO in setOpacity.\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n style.filter = '';\n } else {\n // Set style properties individually instead of using background shorthand\n // to prevent overwriting a pre-existing background color.\n style.backgroundImage = 'none';\n }\n};\n\n\n/**\n * Shows or hides an element from the page. Hiding the element is done by\n * setting the display property to \"none\", removing the element from the\n * rendering hierarchy so it takes up no space. To show the element, the default\n * inherited display property is restored (defined either in stylesheets or by\n * the browser's default style rules.)\n *\n * Caveat 1: if the inherited display property for the element is set to \"none\"\n * by the stylesheets, that is the property that will be restored by a call to\n * showElement(), effectively toggling the display between \"none\" and \"none\".\n *\n * Caveat 2: if the element display style is set inline (by setting either\n * element.style.display or a style attribute in the HTML), a call to\n * showElement will clear that setting and defer to the inherited style in the\n * stylesheet.\n * @param {Element} el Element to show or hide.\n * @param {*} display True to render the element in its default style,\n * false to disable rendering the element.\n * @return {void}\n * @deprecated Use goog.style.setElementShown instead.\n */\ngoog.style.showElement = function(el, display) {\n 'use strict';\n goog.style.setElementShown(el, display);\n};\n\n\n/**\n * Shows or hides an element from the page. Hiding the element is done by\n * setting the display property to \"none\", removing the element from the\n * rendering hierarchy so it takes up no space. To show the element, the default\n * inherited display property is restored (defined either in stylesheets or by\n * the browser's default style rules).\n *\n * Caveat 1: if the inherited display property for the element is set to \"none\"\n * by the stylesheets, that is the property that will be restored by a call to\n * setElementShown(), effectively toggling the display between \"none\" and\n * \"none\".\n *\n * Caveat 2: if the element display style is set inline (by setting either\n * element.style.display or a style attribute in the HTML), a call to\n * setElementShown will clear that setting and defer to the inherited style in\n * the stylesheet.\n * @param {Element} el Element to show or hide.\n * @param {*} isShown True to render the element in its default style,\n * false to disable rendering the element.\n * @return {void}\n */\ngoog.style.setElementShown = function(el, isShown) {\n 'use strict';\n el.style.display = isShown ? '' : 'none';\n};\n\n\n/**\n * Test whether the given element has been shown or hidden via a call to\n * {@link #setElementShown}.\n *\n * Note this is strictly a companion method for a call\n * to {@link #setElementShown} and the same caveats apply; in particular, this\n * method does not guarantee that the return value will be consistent with\n * whether or not the element is actually visible.\n *\n * @param {Element} el The element to test.\n * @return {boolean} Whether the element has been shown.\n * @see #setElementShown\n */\ngoog.style.isElementShown = function(el) {\n 'use strict';\n return el.style.display != 'none';\n};\n\n\n/**\n * Installs the style sheet into the window that contains opt_node. If\n * opt_node is null, the main window is used.\n * @param {!goog.html.SafeStyleSheet} safeStyleSheet The style sheet to install.\n * @param {?Node=} opt_node Node whose parent document should have the\n * styles installed.\n * @return {!HTMLStyleElement|!StyleSheet} In IE<11, a StyleSheet object with no\n * owning <style> tag (this is how IE creates style sheets). In every\n * other browser, a <style> element with an attached style. This\n * doesn't return a StyleSheet object so that setSafeStyleSheet can replace\n * it (otherwise, if you pass a StyleSheet to setSafeStyleSheet, it will\n * make a new StyleSheet and leave the original StyleSheet orphaned).\n */\ngoog.style.installSafeStyleSheet = function(safeStyleSheet, opt_node) {\n 'use strict';\n var dh = goog.dom.getDomHelper(opt_node);\n\n // IE < 11 requires createStyleSheet. Note that doc.createStyleSheet will be\n // undefined as of IE 11.\n var doc = dh.getDocument();\n if (goog.userAgent.IE && doc.createStyleSheet) {\n /** @type {(!HTMLStyleElement|!StyleSheet)} */\n var styleSheet = doc.createStyleSheet();\n goog.style.setSafeStyleSheet(styleSheet, safeStyleSheet);\n return styleSheet;\n } else {\n var head = dh.getElementsByTagNameAndClass(goog.dom.TagName.HEAD)[0];\n\n // In opera documents are not guaranteed to have a head element, thus we\n // have to make sure one exists before using it.\n if (!head) {\n var body = dh.getElementsByTagNameAndClass(goog.dom.TagName.BODY)[0];\n head = dh.createDom(goog.dom.TagName.HEAD);\n body.parentNode.insertBefore(head, body);\n }\n var el = dh.createDom(goog.dom.TagName.STYLE);\n const nonce = goog.dom.safe.getStyleNonce();\n if (nonce) {\n el.setAttribute('nonce', nonce);\n }\n\n // NOTE(user): Setting styles after the style element has been appended\n // to the head results in a nasty Webkit bug in certain scenarios. Please\n // refer to https://bugs.webkit.org/show_bug.cgi?id=26307 for additional\n // details.\n goog.style.setSafeStyleSheet(el, safeStyleSheet);\n dh.appendChild(head, el);\n return el;\n }\n};\n\n\n/**\n * Removes the styles added by {@link #installSafeStyleSheet}.\n * @param {Element|StyleSheet} styleSheet The value returned by\n * {@link #installSafeStyleSheet}.\n */\ngoog.style.uninstallStyles = function(styleSheet) {\n 'use strict';\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n var node = styleSheet.ownerNode || styleSheet.owningElement ||\n /** @type {Element} */ (styleSheet);\n goog.dom.removeNode(node);\n};\n\n\n/**\n * Sets the content of a style element. The style element can be any valid\n * style element. This element will have its content completely replaced by\n * the safeStyleSheet.\n * @param {!Element|!StyleSheet} element A stylesheet element as returned by\n * installSafeStyleSheet.\n * @param {!goog.html.SafeStyleSheet} safeStyleSheet The new content of the\n * stylesheet.\n * @return {void}\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.style.setSafeStyleSheet = function(element, safeStyleSheet) {\n 'use strict';\n var stylesString = goog.html.SafeStyleSheet.unwrap(safeStyleSheet);\n if (goog.userAgent.IE && element.cssText !== undefined) {\n // Adding the selectors individually caused the browser to hang if the\n // selector was invalid or there were CSS comments. Setting the cssText of\n // the style node works fine and ignores CSS that IE doesn't understand.\n // However IE >= 11 doesn't support cssText any more, so we make sure that\n // cssText is a defined property and otherwise fall back to innerHTML.\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n element.cssText = stylesString;\n } else if (goog.global.trustedTypes) {\n goog.dom.setTextContent(/** @type {!Element} */ (element), stylesString);\n } else {\n // Setting textContent doesn't work in Safari, see b/29340337.\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n element.innerHTML = stylesString;\n }\n};\n\n\n/**\n * Sets 'white-space: pre-wrap' for a node (x-browser).\n *\n * There are as many ways of specifying pre-wrap as there are browsers.\n *\n * CSS3/IE8: white-space: pre-wrap;\n * Mozilla: white-space: -moz-pre-wrap;\n * Opera: white-space: -o-pre-wrap;\n * IE6/7: white-space: pre; word-wrap: break-word;\n *\n * @param {Element} el Element to enable pre-wrap for.\n */\ngoog.style.setPreWrap = function(el) {\n 'use strict';\n var style = el.style;\n if (goog.userAgent.GECKO) {\n style.whiteSpace = '-moz-pre-wrap';\n } else {\n style.whiteSpace = 'pre-wrap';\n }\n};\n\n\n/**\n * Sets 'display: inline-block' for an element (cross-browser).\n * @param {Element} el Element to which the inline-block display style is to be\n * applied.\n * @return {void}\n * @see ../demos/inline_block_quirks.html\n * @see ../demos/inline_block_standards.html\n */\ngoog.style.setInlineBlock = function(el) {\n 'use strict';\n var style = el.style;\n // Without position:relative, weirdness ensues. Just accept it and move on.\n style.position = 'relative';\n style.display = 'inline-block';\n};\n\n\n/**\n * Returns true if the element is using right to left (rtl) direction.\n * @param {Element} el The element to test.\n * @return {boolean} True for right to left, false for left to right.\n */\ngoog.style.isRightToLeft = function(el) {\n 'use strict';\n return 'rtl' == goog.style.getStyle_(el, 'direction');\n};\n\n\n/**\n * The CSS style property corresponding to an element being\n * unselectable on the current browser platform (null if none).\n * Opera and IE instead use a DOM attribute 'unselectable'. MS Edge uses\n * the Webkit prefix.\n * @type {?string}\n * @private\n */\ngoog.style.unselectableStyle_ = goog.userAgent.GECKO ?\n 'MozUserSelect' :\n goog.userAgent.WEBKIT || goog.userAgent.EDGE ? 'WebkitUserSelect' : null;\n\n\n/**\n * Returns true if the element is set to be unselectable, false otherwise.\n * Note that on some platforms (e.g. Mozilla), even if an element isn't set\n * to be unselectable, it will behave as such if any of its ancestors is\n * unselectable.\n * @param {Element} el Element to check.\n * @return {boolean} Whether the element is set to be unselectable.\n */\ngoog.style.isUnselectable = function(el) {\n 'use strict';\n if (goog.style.unselectableStyle_) {\n return el.style[goog.style.unselectableStyle_].toLowerCase() == 'none';\n } else if (goog.userAgent.IE) {\n return el.getAttribute('unselectable') == 'on';\n }\n return false;\n};\n\n\n/**\n * Makes the element and its descendants selectable or unselectable. Note\n * that on some platforms (e.g. Mozilla), even if an element isn't set to\n * be unselectable, it will behave as such if any of its ancestors is\n * unselectable.\n * @param {Element} el The element to alter.\n * @param {boolean} unselectable Whether the element and its descendants\n * should be made unselectable.\n * @param {boolean=} opt_noRecurse Whether to only alter the element's own\n * selectable state, and leave its descendants alone; defaults to false.\n */\ngoog.style.setUnselectable = function(el, unselectable, opt_noRecurse) {\n 'use strict';\n // TODO(attila): Do we need all of TR_DomUtil.makeUnselectable() in Closure?\n var descendants = !opt_noRecurse ? el.getElementsByTagName('*') : null;\n var name = goog.style.unselectableStyle_;\n if (name) {\n // Add/remove the appropriate CSS style to/from the element and its\n // descendants.\n var value = unselectable ? 'none' : '';\n // MathML elements do not have a style property. Verify before setting.\n if (el.style) {\n el.style[name] = value;\n }\n if (descendants) {\n for (var i = 0, descendant; descendant = descendants[i]; i++) {\n if (descendant.style) {\n descendant.style[name] = value;\n }\n }\n }\n } else if (goog.userAgent.IE) {\n // Toggle the 'unselectable' attribute on the element and its descendants.\n var value = unselectable ? 'on' : '';\n el.setAttribute('unselectable', value);\n if (descendants) {\n for (var i = 0, descendant; descendant = descendants[i]; i++) {\n descendant.setAttribute('unselectable', value);\n }\n }\n }\n};\n\n\n/**\n * Gets the border box size for an element.\n * @param {Element} element The element to get the size for.\n * @return {!goog.math.Size} The border box size.\n */\ngoog.style.getBorderBoxSize = function(element) {\n 'use strict';\n return new goog.math.Size(\n /** @type {!HTMLElement} */ (element).offsetWidth,\n /** @type {!HTMLElement} */ (element).offsetHeight);\n};\n\n\n/**\n * Sets the border box size of an element. This is potentially expensive in IE\n * if the document is CSS1Compat mode\n * @param {Element} element The element to set the size on.\n * @param {goog.math.Size} size The new size.\n */\ngoog.style.setBorderBoxSize = function(element, size) {\n 'use strict';\n goog.style.setBoxSizingSize_(element, size, 'border-box');\n};\n\n\n/**\n * Gets the content box size for an element. This is potentially expensive in\n * all browsers.\n * @param {Element} element The element to get the size for.\n * @return {!goog.math.Size} The content box size.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.style.getContentBoxSize = function(element) {\n 'use strict';\n var doc = goog.dom.getOwnerDocument(element);\n var ieCurrentStyle = goog.userAgent.IE && element.currentStyle;\n if (ieCurrentStyle && goog.dom.getDomHelper(doc).isCss1CompatMode() &&\n ieCurrentStyle.width != 'auto' && ieCurrentStyle.height != 'auto' &&\n !ieCurrentStyle.boxSizing) {\n // If IE in CSS1Compat mode than just use the width and height.\n // If we have a boxSizing then fall back on measuring the borders etc.\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n var width = goog.style.getIePixelValue_(\n element, /** @type {string} */ (ieCurrentStyle.width), 'width',\n 'pixelWidth');\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n var height = goog.style.getIePixelValue_(\n element, /** @type {string} */ (ieCurrentStyle.height), 'height',\n 'pixelHeight');\n return new goog.math.Size(width, height);\n } else {\n var borderBoxSize = goog.style.getBorderBoxSize(element);\n var paddingBox = goog.style.getPaddingBox(element);\n var borderBox = goog.style.getBorderBox(element);\n return new goog.math.Size(\n borderBoxSize.width - borderBox.left - paddingBox.left -\n paddingBox.right - borderBox.right,\n borderBoxSize.height - borderBox.top - paddingBox.top -\n paddingBox.bottom - borderBox.bottom);\n }\n};\n\n\n/**\n * Sets the content box size of an element. This is potentially expensive in IE\n * if the document is BackCompat mode.\n * @param {Element} element The element to set the size on.\n * @param {goog.math.Size} size The new size.\n */\ngoog.style.setContentBoxSize = function(element, size) {\n 'use strict';\n goog.style.setBoxSizingSize_(element, size, 'content-box');\n};\n\n\n/**\n * Helper function that sets the box sizing as well as the width and height\n * @param {Element} element The element to set the size on.\n * @param {goog.math.Size} size The new size to set.\n * @param {string} boxSizing The box-sizing value.\n * @private\n */\ngoog.style.setBoxSizingSize_ = function(element, size, boxSizing) {\n 'use strict';\n var style = element.style;\n if (goog.userAgent.GECKO) {\n style.MozBoxSizing = boxSizing;\n } else if (goog.userAgent.WEBKIT) {\n style.WebkitBoxSizing = boxSizing;\n } else {\n // Includes IE8 and Opera 9.50+\n style.boxSizing = boxSizing;\n }\n\n // Setting this to a negative value will throw an exception on IE\n // (and doesn't do anything different than setting it to 0).\n style.width = Math.max(size.width, 0) + 'px';\n style.height = Math.max(size.height, 0) + 'px';\n};\n\n\n/**\n * IE specific function that converts a non pixel unit to pixels.\n * @param {Element} element The element to convert the value for.\n * @param {string} value The current value as a string. The value must not be\n * ''.\n * @param {string} name The CSS property name to use for the converstion. This\n * should be 'left', 'top', 'width' or 'height'.\n * @param {string} pixelName The CSS pixel property name to use to get the\n * value in pixels.\n * @return {number} The value in pixels.\n * @private\n */\ngoog.style.getIePixelValue_ = function(element, value, name, pixelName) {\n 'use strict';\n // Try if we already have a pixel value. IE does not do half pixels so we\n // only check if it matches a number followed by 'px'.\n if (/^\\d+px?$/.test(value)) {\n return parseInt(value, 10);\n } else {\n var oldStyleValue = element.style[name];\n var oldRuntimeValue = element.runtimeStyle[name];\n // set runtime style to prevent changes\n element.runtimeStyle[name] = element.currentStyle[name];\n element.style[name] = value;\n var pixelValue = element.style[pixelName];\n // restore\n element.style[name] = oldStyleValue;\n element.runtimeStyle[name] = oldRuntimeValue;\n return +pixelValue;\n }\n};\n\n\n/**\n * Helper function for getting the pixel padding or margin for IE.\n * @param {Element} element The element to get the padding for.\n * @param {string} propName The property name.\n * @return {number} The pixel padding.\n * @private\n */\ngoog.style.getIePixelDistance_ = function(element, propName) {\n 'use strict';\n var value = goog.style.getCascadedStyle(element, propName);\n return value ?\n goog.style.getIePixelValue_(element, value, 'left', 'pixelLeft') :\n 0;\n};\n\n\n/**\n * Gets the computed paddings or margins (on all sides) in pixels.\n * @param {Element} element The element to get the padding for.\n * @param {string} stylePrefix Pass 'padding' to retrieve the padding box,\n * or 'margin' to retrieve the margin box.\n * @return {!goog.math.Box} The computed paddings or margins.\n * @private\n */\ngoog.style.getBox_ = function(element, stylePrefix) {\n 'use strict';\n if (goog.userAgent.IE) {\n var left = goog.style.getIePixelDistance_(element, stylePrefix + 'Left');\n var right = goog.style.getIePixelDistance_(element, stylePrefix + 'Right');\n var top = goog.style.getIePixelDistance_(element, stylePrefix + 'Top');\n var bottom =\n goog.style.getIePixelDistance_(element, stylePrefix + 'Bottom');\n return new goog.math.Box(top, right, bottom, left);\n } else {\n // On non-IE browsers, getComputedStyle is always non-null.\n var left = goog.style.getComputedStyle(element, stylePrefix + 'Left');\n var right = goog.style.getComputedStyle(element, stylePrefix + 'Right');\n var top = goog.style.getComputedStyle(element, stylePrefix + 'Top');\n var bottom = goog.style.getComputedStyle(element, stylePrefix + 'Bottom');\n\n // NOTE(arv): Gecko can return floating point numbers for the computed\n // style values.\n return new goog.math.Box(\n parseFloat(top), parseFloat(right), parseFloat(bottom),\n parseFloat(left));\n }\n};\n\n\n/**\n * Gets the computed paddings (on all sides) in pixels.\n * @param {Element} element The element to get the padding for.\n * @return {!goog.math.Box} The computed paddings.\n */\ngoog.style.getPaddingBox = function(element) {\n 'use strict';\n return goog.style.getBox_(element, 'padding');\n};\n\n\n/**\n * Gets the computed margins (on all sides) in pixels.\n * @param {Element} element The element to get the margins for.\n * @return {!goog.math.Box} The computed margins.\n */\ngoog.style.getMarginBox = function(element) {\n 'use strict';\n return goog.style.getBox_(element, 'margin');\n};\n\n\n/**\n * A map used to map the border width keywords to a pixel width.\n * @type {!Object}\n * @private\n */\ngoog.style.ieBorderWidthKeywords_ = {\n 'thin': 2,\n 'medium': 4,\n 'thick': 6\n};\n\n\n/**\n * Helper function for IE to get the pixel border.\n * @param {Element} element The element to get the pixel border for.\n * @param {string} prop The part of the property name.\n * @return {number} The value in pixels.\n * @private\n */\ngoog.style.getIePixelBorder_ = function(element, prop) {\n 'use strict';\n if (goog.style.getCascadedStyle(element, prop + 'Style') == 'none') {\n return 0;\n }\n var width = goog.style.getCascadedStyle(element, prop + 'Width');\n if (width in goog.style.ieBorderWidthKeywords_) {\n return goog.style.ieBorderWidthKeywords_[width];\n }\n return goog.style.getIePixelValue_(element, width, 'left', 'pixelLeft');\n};\n\n\n/**\n * Gets the computed border widths (on all sides) in pixels\n * @param {Element} element The element to get the border widths for.\n * @return {!goog.math.Box} The computed border widths.\n */\ngoog.style.getBorderBox = function(element) {\n 'use strict';\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9)) {\n var left = goog.style.getIePixelBorder_(element, 'borderLeft');\n var right = goog.style.getIePixelBorder_(element, 'borderRight');\n var top = goog.style.getIePixelBorder_(element, 'borderTop');\n var bottom = goog.style.getIePixelBorder_(element, 'borderBottom');\n return new goog.math.Box(top, right, bottom, left);\n } else {\n // On non-IE browsers, getComputedStyle is always non-null.\n var left = goog.style.getComputedStyle(element, 'borderLeftWidth');\n var right = goog.style.getComputedStyle(element, 'borderRightWidth');\n var top = goog.style.getComputedStyle(element, 'borderTopWidth');\n var bottom = goog.style.getComputedStyle(element, 'borderBottomWidth');\n\n return new goog.math.Box(\n parseFloat(top), parseFloat(right), parseFloat(bottom),\n parseFloat(left));\n }\n};\n\n\n/**\n * Returns the font face applied to a given node. Opera and IE should return\n * the font actually displayed. Firefox returns the author's most-preferred\n * font (whether the browser is capable of displaying it or not.)\n * @param {Element} el The element whose font family is returned.\n * @return {string} The font family applied to el.\n */\ngoog.style.getFontFamily = function(el) {\n 'use strict';\n var doc = goog.dom.getOwnerDocument(el);\n var font = '';\n // The moveToElementText method from the TextRange only works if the element\n // is attached to the owner document.\n if (doc.body.createTextRange && goog.dom.contains(doc, el)) {\n var range = doc.body.createTextRange();\n range.moveToElementText(el);\n\n try {\n font = range.queryCommandValue('FontName');\n } catch (e) {\n // This is a workaround for a awkward exception.\n // On some IE, there is an exception coming from it.\n // The error description from this exception is:\n // This window has already been registered as a drop target\n // This is bogus description, likely due to a bug in ie.\n font = '';\n }\n }\n if (!font) {\n // Note if for some reason IE can't derive FontName with a TextRange, we\n // fallback to using currentStyle\n font = goog.style.getStyle_(el, 'fontFamily');\n }\n\n // Firefox returns the applied font-family string (author's list of\n // preferred fonts.) We want to return the most-preferred font, in lieu of\n // the *actually* applied font.\n var fontsArray = font.split(',');\n if (fontsArray.length > 1) font = fontsArray[0];\n\n // Sanitize for x-browser consistency:\n // Strip quotes because browsers aren't consistent with how they're\n // applied; Opera always encloses, Firefox sometimes, and IE never.\n return goog.string.stripQuotes(font, '\"\\'');\n};\n\n\n/**\n * Regular expression used for getLengthUnits.\n * @type {RegExp}\n * @private\n */\ngoog.style.lengthUnitRegex_ = /[^\\d]+$/;\n\n\n/**\n * Returns the units used for a CSS length measurement.\n * @param {string} value A CSS length quantity.\n * @return {?string} The units of measurement.\n */\ngoog.style.getLengthUnits = function(value) {\n 'use strict';\n var units = value.match(goog.style.lengthUnitRegex_);\n return units && units[0] || null;\n};\n\n\n/**\n * Map of absolute CSS length units\n * @type {!Object}\n * @private\n */\ngoog.style.ABSOLUTE_CSS_LENGTH_UNITS_ = {\n 'cm': 1,\n 'in': 1,\n 'mm': 1,\n 'pc': 1,\n 'pt': 1\n};\n\n\n/**\n * Map of relative CSS length units that can be accurately converted to px\n * font-size values using getIePixelValue_. Only units that are defined in\n * relation to a font size are convertible (%, small, etc. are not).\n * @type {!Object}\n * @private\n */\ngoog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_ = {\n 'em': 1,\n 'ex': 1\n};\n\n\n/**\n * Returns the font size, in pixels, of text in an element.\n * @param {Element} el The element whose font size is returned.\n * @return {number} The font size (in pixels).\n */\ngoog.style.getFontSize = function(el) {\n 'use strict';\n var fontSize = goog.style.getStyle_(el, 'fontSize');\n var sizeUnits = goog.style.getLengthUnits(fontSize);\n if (fontSize && 'px' == sizeUnits) {\n // NOTE(user): This could be parseFloat instead, but IE doesn't return\n // decimal fractions in getStyle_ and Firefox reports the fractions, but\n // ignores them when rendering. Interestingly enough, when we force the\n // issue and size something to e.g., 50% of 25px, the browsers round in\n // opposite directions with Firefox reporting 12px and IE 13px. I punt.\n return parseInt(fontSize, 10);\n }\n\n // In IE, we can convert absolute length units to a px value using\n // goog.style.getIePixelValue_. Units defined in relation to a font size\n // (em, ex) are applied relative to the element's parentNode and can also\n // be converted.\n if (goog.userAgent.IE) {\n if (String(sizeUnits) in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_) {\n return goog.style.getIePixelValue_(el, fontSize, 'left', 'pixelLeft');\n } else if (\n el.parentNode && el.parentNode.nodeType == goog.dom.NodeType.ELEMENT &&\n String(sizeUnits) in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_) {\n // Check the parent size - if it is the same it means the relative size\n // value is inherited and we therefore don't want to count it twice. If\n // it is different, this element either has explicit style or has a CSS\n // rule applying to it.\n var parentElement = /** @type {!Element} */ (el.parentNode);\n var parentSize = goog.style.getStyle_(parentElement, 'fontSize');\n return goog.style.getIePixelValue_(\n parentElement, fontSize == parentSize ? '1em' : fontSize, 'left',\n 'pixelLeft');\n }\n }\n\n // Sometimes we can't cleanly find the font size (some units relative to a\n // node's parent's font size are difficult: %, smaller et al), so we create\n // an invisible, absolutely-positioned span sized to be the height of an 'M'\n // rendered in its parent's (i.e., our target element's) font size. This is\n // the definition of CSS's font size attribute.\n var sizeElement = goog.dom.createDom(goog.dom.TagName.SPAN, {\n 'style': 'visibility:hidden;position:absolute;' +\n 'line-height:0;padding:0;margin:0;border:0;height:1em;'\n });\n goog.dom.appendChild(el, sizeElement);\n fontSize = sizeElement.offsetHeight;\n goog.dom.removeNode(sizeElement);\n\n return fontSize;\n};\n\n\n/**\n * Parses a style attribute value. Converts CSS property names to camel case.\n * @param {string} value The style attribute value.\n * @return {!Object} Map of CSS properties to string values.\n */\ngoog.style.parseStyleAttribute = function(value) {\n 'use strict';\n var result = {};\n value.split(/\\s*;\\s*/).forEach(function(pair) {\n 'use strict';\n var keyValue = pair.match(/\\s*([\\w-]+)\\s*:(.+)/);\n if (keyValue) {\n var styleName = keyValue[1];\n var styleValue = goog.string.trim(keyValue[2]);\n result[goog.string.toCamelCase(styleName.toLowerCase())] = styleValue;\n }\n });\n return result;\n};\n\n\n/**\n * Reverse of parseStyleAttribute; that is, takes a style object and returns the\n * corresponding attribute value. Converts camel case property names to proper\n * CSS selector names.\n * @param {Object} obj Map of CSS properties to values.\n * @return {string} The style attribute value.\n */\ngoog.style.toStyleAttribute = function(obj) {\n 'use strict';\n var buffer = [];\n goog.object.forEach(obj, function(value, key) {\n 'use strict';\n buffer.push(goog.string.toSelectorCase(key), ':', value, ';');\n });\n return buffer.join('');\n};\n\n\n/**\n * Sets CSS float property on an element.\n * @param {Element} el The element to set float property on.\n * @param {string} value The value of float CSS property to set on this element.\n */\ngoog.style.setFloat = function(el, value) {\n 'use strict';\n el.style[goog.userAgent.IE ? 'styleFloat' : 'cssFloat'] = value;\n};\n\n\n/**\n * Gets value of explicitly-set float CSS property on an element.\n * @param {Element} el The element to get float property of.\n * @return {string} The value of explicitly-set float CSS property on this\n * element.\n */\ngoog.style.getFloat = function(el) {\n 'use strict';\n return el.style[goog.userAgent.IE ? 'styleFloat' : 'cssFloat'] || '';\n};\n\n\n/**\n * Returns the scroll bar width (represents the width of both horizontal\n * and vertical scroll).\n *\n * @param {string=} opt_className An optional class name (or names) to apply\n * to the invisible div created to measure the scrollbar. This is necessary\n * if some scrollbars are styled differently than others.\n * @return {number} The scroll bar width in px.\n */\ngoog.style.getScrollbarWidth = function(opt_className) {\n 'use strict';\n // Add two hidden divs. The child div is larger than the parent and\n // forces scrollbars to appear on it.\n // Using overflow:scroll does not work consistently with scrollbars that\n // are styled with ::-webkit-scrollbar.\n var outerDiv = goog.dom.createElement(goog.dom.TagName.DIV);\n if (opt_className) {\n outerDiv.className = opt_className;\n }\n outerDiv.style.cssText = 'overflow:auto;' +\n 'position:absolute;top:0;width:100px;height:100px';\n var innerDiv = goog.dom.createElement(goog.dom.TagName.DIV);\n goog.style.setSize(innerDiv, '200px', '200px');\n outerDiv.appendChild(innerDiv);\n goog.dom.appendChild(goog.dom.getDocument().body, outerDiv);\n var width = outerDiv.offsetWidth - outerDiv.clientWidth;\n goog.dom.removeNode(outerDiv);\n return width;\n};\n\n\n/**\n * Regular expression to extract x and y translation components from a CSS\n * transform Matrix representation.\n *\n * @type {!RegExp}\n * @const\n * @private\n */\ngoog.style.MATRIX_TRANSLATION_REGEX_ = new RegExp(\n 'matrix\\\\([0-9\\\\.\\\\-]+, [0-9\\\\.\\\\-]+, ' +\n '[0-9\\\\.\\\\-]+, [0-9\\\\.\\\\-]+, ' +\n '([0-9\\\\.\\\\-]+)p?x?, ([0-9\\\\.\\\\-]+)p?x?\\\\)');\n\n\n/**\n * Returns the x,y translation component of any CSS transforms applied to the\n * element, in pixels.\n *\n * @param {!Element} element The element to get the translation of.\n * @return {!goog.math.Coordinate} The CSS translation of the element in px.\n */\ngoog.style.getCssTranslation = function(element) {\n 'use strict';\n var transform = goog.style.getComputedTransform(element);\n if (!transform) {\n return new goog.math.Coordinate(0, 0);\n }\n var matches = transform.match(goog.style.MATRIX_TRANSLATION_REGEX_);\n if (!matches) {\n return new goog.math.Coordinate(0, 0);\n }\n return new goog.math.Coordinate(\n parseFloat(matches[1]), parseFloat(matches[2]));\n};\n","~:compiled-at",1684858198086,"~:source-map-json","{\n\"version\":3,\n\"file\":\"goog.style.style.js\",\n\"lineCount\":726,\n\"mappings\":\"AAcAA,IAAKC,CAAAA,OAAL,CAAa,YAAb,CAAA;AAGAD,IAAKE,CAAAA,OAAL,CAAa,cAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,UAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,mBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,kBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,eAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,iBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,0BAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,eAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,sBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,gBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,gBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,aAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,cAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,aAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,gBAAb,CAAA;AACAF,IAAKG,CAAAA,WAAL,CAAiB,mBAAjB,CAAA;AAoBAH,IAAKI,CAAAA,KAAMC,CAAAA,QAAX,GAAsBC,QAAQ,CAACC,OAAD,EAAUH,KAAV,EAAiBI,SAAjB,CAA4B;AAExD,MAAI,MAAOJ,MAAX,KAAqB,QAArB;AACEJ,QAAKI,CAAAA,KAAMK,CAAAA,SAAX,CAAqBF,OAArB,EAA8BC,SAA9B,EAAyCJ,KAAzC,CAAA;AADF;AAGE,SAAK,IAAIM,GAAT,GAAgBN,MAAhB;AACEJ,UAA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O,IAAIjb,IAAKsE,CAAAA,IAAKC,CAAAA,UAAd,CAAyB,CAAzB,EAA4B,CAA5B,CAAP;AADF;AAGA,SAAO,IAAIvE,IAAKsE,CAAAA,IAAKC,CAAAA,UAAd,CACHwS,UAAA,CAAWkE,OAAA,CAAQ,CAAR,CAAX,CADG,EACqBlE,UAAA,CAAWkE,OAAA,CAAQ,CAAR,CAAX,CADrB,CAAP;AAV+C,CAAjD;;\",\n\"sources\":[\"goog/style/style.js\"],\n\"sourcesContent\":[\"/**\\n * @license\\n * Copyright The Closure Library Authors.\\n * SPDX-License-Identifier: Apache-2.0\\n */\\n\\n/**\\n * @fileoverview Utilities for element styles.\\n *\\n * @see ../demos/inline_block_quirks.html\\n * @see ../demos/inline_block_standards.html\\n * @see ../demos/style_viewport.html\\n */\\n\\ngoog.provide('goog.style');\\n\\n\\ngoog.require('goog.asserts');\\ngoog.require('goog.dom');\\ngoog.require('goog.dom.NodeType');\\ngoog.require('goog.dom.TagName');\\ngoog.require('goog.dom.safe');\\ngoog.require('goog.dom.vendor');\\ngoog.require('goog.html.SafeStyleSheet');\\ngoog.require('goog.math.Box');\\ngoog.require('goog.math.Coordinate');\\ngoog.require('goog.math.Rect');\\ngoog.require('goog.math.Size');\\ngoog.require('goog.object');\\ngoog.require('goog.reflect');\\ngoog.require('goog.string');\\ngoog.require('goog.userAgent');\\ngoog.requireType('goog.events.Event');\\n\\n\\n/**\\n * Sets a style value on an element.\\n *\\n * This function is not indended to patch issues in the browser's style\\n * handling, but to allow easy programmatic access to setting dash-separated\\n * style properties. An example is setting a batch of properties from a data\\n * object without overwriting old styles. When possible, use native APIs:\\n * elem.style.propertyKey = 'value' or (if obliterating old styles is fine)\\n * elem.style.cssText = 'property1: value1; property2: value2'.\\n *\\n * @param {Element} element The element to change.\\n * @param {string|Object} style If a string, a style name. If an object, a hash\\n * of style names to style values.\\n * @param {string|number|boolean=} opt_value If style was a string, then this\\n * should be the value.\\n * @return {void}\\n */\\ngoog.style.setStyle = function(element, style, opt_value) {\\n 'use strict';\\n if (typeof style === 'string') {\\n goog.style.setStyle_(element, opt_value, style);\\n } else {\\n for (var key in style) {\\n goog.style.setStyle_(element, style[key], key);\\n }\\n }\\n};\\n\\n\\n/**\\n * Sets a style value on an element, with parameters swapped to work with\\n * `goog.object.forEach()`. Prepends a vendor-specific prefix when\\n * necessary.\\n * @param {Element} element The element to change.\\n * @param {string|number|boolean|undefined} value Style value.\\n * @param {string} style Style name.\\n * @private\\n */\\ngoog.style.setStyle_ = function(element, value, style) {\\n 'use strict';\\n var propertyName = goog.style.getVendorJsStyleName_(element, style);\\n\\n if (propertyName) {\\n // TODO(johnlenz): coerce to string?\\n element.style[propertyName] = /** @type {?} */ (value);\\n }\\n};\\n\\n\\n/**\\n * Style name cache that stores previous property name lookups.\\n *\\n * This is used by setStyle to speed up property lookups, entries look like:\\n * { StyleName: ActualPropertyName }\\n *\\n * @private {!Object}\\n */\\ngoog.style.styleNameCache_ = {};\\n\\n\\n/**\\n * Returns the style property name in camel-case. If it does not exist and a\\n * vendor-specific version of the property does exist, then return the vendor-\\n * specific property name instead.\\n * @param {Element} element The element to change.\\n * @param {string} style Style name.\\n * @return {string} Vendor-specific style.\\n * @private\\n */\\ngoog.style.getVendorJsStyleName_ = function(element, style) {\\n 'use strict';\\n var propertyName = goog.style.styleNameCache_[style];\\n if (!propertyName) {\\n var camelStyle = goog.string.toCamelCase(style);\\n propertyName = camelStyle;\\n\\n if (element.style[camelStyle] === undefined) {\\n var prefixedStyle = goog.dom.vendor.getVendorJsPrefix() +\\n goog.string.toTitleCase(camelStyle);\\n\\n if (element.style[prefixedStyle] !== undefined) {\\n propertyName = prefixedStyle;\\n }\\n }\\n goog.style.styleNameCache_[style] = propertyName;\\n }\\n\\n return propertyName;\\n};\\n\\n\\n/**\\n * Returns the style property name in CSS notation. If it does not exist and a\\n * vendor-specific version of the property does exist, then return the vendor-\\n * specific property name instead.\\n * @param {Element} element The element to change.\\n * @param {string} style Style name.\\n * @return {string} Vendor-specific style.\\n * @private\\n */\\ngoog.style.getVendorStyleName_ = function(element, style) {\\n 'use strict';\\n var camelStyle = goog.string.toCamelCase(style);\\n\\n if (element.style[camelStyle] === undefined) {\\n var prefixedStyle = goog.dom.vendor.getVendorJsPrefix() +\\n goog.string.toTitleCase(camelStyle);\\n\\n if (element.style[prefixedStyle] !== undefined) {\\n return goog.dom.vendor.getVendorPrefix() + '-' + style;\\n }\\n }\\n\\n return style;\\n};\\n\\n\\n/**\\n * Retrieves an explicitly-set style value of a node. This returns '' if there\\n * isn't a style attribute on the element or if this style property has not been\\n * explicitly set in script.\\n *\\n * @param {Element} element Element to get style of.\\n * @param {string} property Property to get, css-style (if you have a camel-case\\n * property, use element.style[style]).\\n * @return {string} Style value.\\n */\\ngoog.style.getStyle = function(element, property) {\\n 'use strict';\\n // element.style is '' for well-known properties which are unset.\\n // For for browser specific styles as 'filter' is undefined\\n // so we need to return '' explicitly to make it consistent across\\n // browsers.\\n var styleValue = element.style[goog.string.toCamelCase(property)];\\n\\n // Using typeof here because of a bug in Safari 5.1, where this value\\n // was undefined, but === undefined returned false.\\n if (typeof(styleValue) !== 'undefined') {\\n return styleValue;\\n }\\n\\n return element.style[goog.style.getVendorJsStyleName_(element, property)] ||\\n '';\\n};\\n\\n\\n/**\\n * Retrieves a computed style value of a node. It returns empty string if the\\n * value cannot be computed (which will be the case in Internet Explorer) or\\n * \\\"none\\\" if the property requested is an SVG one and it has not been\\n * explicitly set (firefox and webkit).\\n *\\n * @param {Element} element Element to get style of.\\n * @param {string} property Property to get (camel-case).\\n * @return {string} Style value.\\n */\\ngoog.style.getComputedStyle = function(element, property) {\\n 'use strict';\\n var doc = goog.dom.getOwnerDocument(element);\\n if (doc.defaultView && doc.defaultView.getComputedStyle) {\\n var styles = doc.defaultView.getComputedStyle(element, null);\\n if (styles) {\\n // element.style[..] is undefined for browser specific styles\\n // as 'filter'.\\n return styles[property] || styles.getPropertyValue(property) || '';\\n }\\n }\\n\\n return '';\\n};\\n\\n\\n/**\\n * Gets the cascaded style value of a node, or null if the value cannot be\\n * computed (only Internet Explorer can do this).\\n *\\n * @param {Element} element Element to get style of.\\n * @param {string} style Property to get (camel-case).\\n * @return {string} Style value.\\n */\\ngoog.style.getCascadedStyle = function(element, style) {\\n 'use strict';\\n // TODO(nicksantos): This should be documented to return null. #fixTypes\\n return /** @type {string} */ (\\n element.currentStyle ? element.currentStyle[style] : null);\\n};\\n\\n\\n/**\\n * Cross-browser pseudo get computed style. It returns the computed style where\\n * available. If not available it tries the cascaded style value (IE\\n * currentStyle) and in worst case the inline style value. It shouldn't be\\n * called directly, see http://wiki/Main/ComputedStyleVsCascadedStyle for\\n * discussion.\\n *\\n * @param {Element} element Element to get style of.\\n * @param {string} style Property to get (must be camelCase, not css-style.).\\n * @return {string} Style value.\\n * @private\\n */\\ngoog.style.getStyle_ = function(element, style) {\\n 'use strict';\\n return goog.style.getComputedStyle(element, style) ||\\n goog.style.getCascadedStyle(element, style) ||\\n (element.style && element.style[style]);\\n};\\n\\n\\n/**\\n * Retrieves the computed value of the box-sizing CSS attribute.\\n * Browser support: http://caniuse.com/css3-boxsizing.\\n * @param {!Element} element The element whose box-sizing to get.\\n * @return {?string} 'content-box', 'border-box' or 'padding-box'. null if\\n * box-sizing is not supported (IE7 and below).\\n */\\ngoog.style.getComputedBoxSizing = function(element) {\\n 'use strict';\\n return goog.style.getStyle_(element, 'boxSizing') ||\\n goog.style.getStyle_(element, 'MozBoxSizing') ||\\n goog.style.getStyle_(element, 'WebkitBoxSizing') || null;\\n};\\n\\n\\n/**\\n * Retrieves the computed value of the position CSS attribute.\\n * @param {Element} element The element to get the position of.\\n * @return {string} Position value.\\n */\\ngoog.style.getComputedPosition = function(element) {\\n 'use strict';\\n return goog.style.getStyle_(element, 'position');\\n};\\n\\n\\n/**\\n * Retrieves the computed background color string for a given element. The\\n * string returned is suitable for assigning to another element's\\n * background-color, but is not guaranteed to be in any particular string\\n * format. Accessing the color in a numeric form may not be possible in all\\n * browsers or with all input.\\n *\\n * If the background color for the element is defined as a hexadecimal value,\\n * the resulting string can be parsed by goog.color.parse in all supported\\n * browsers.\\n *\\n * Whether named colors like \\\"red\\\" or \\\"lightblue\\\" get translated into a\\n * format which can be parsed is browser dependent. Calling this function on\\n * transparent elements will return \\\"transparent\\\" in most browsers or\\n * \\\"rgba(0, 0, 0, 0)\\\" in WebKit.\\n * @param {Element} element The element to get the background color of.\\n * @return {string} The computed string value of the background color.\\n */\\ngoog.style.getBackgroundColor = function(element) {\\n 'use strict';\\n return goog.style.getStyle_(element, 'backgroundColor');\\n};\\n\\n\\n/**\\n * Retrieves the computed value of the overflow-x CSS attribute.\\n * @param {Element} element The element to get the overflow-x of.\\n * @return {string} The computed string value of the overflow-x attribute.\\n */\\ngoog.style.getComputedOverflowX = function(element) {\\n 'use strict';\\n return goog.style.getStyle_(element, 'overflowX');\\n};\\n\\n\\n/**\\n * Retrieves the computed value of the overflow-y CSS attribute.\\n * @param {Element} element The element to get the overflow-y of.\\n * @return {string} The computed string value of the overflow-y attribute.\\n */\\ngoog.style.getComputedOverflowY = function(element) {\\n 'use strict';\\n return goog.style.getStyle_(element, 'overflowY');\\n};\\n\\n\\n/**\\n * Retrieves the computed value of the z-index CSS attribute.\\n * @param {Element} element The element to get the z-index of.\\n * @return {string|number} The computed value of the z-index attribute.\\n */\\ngoog.style.getComputedZIndex = function(element) {\\n 'use strict';\\n return goog.style.getStyle_(element, 'zIndex');\\n};\\n\\n\\n/**\\n * Retrieves the computed value of the text-align CSS attribute.\\n * @param {Element} element The element to get the text-align of.\\n * @return {string} The computed string value of the text-align attribute.\\n */\\ngoog.style.getComputedTextAlign = function(element) {\\n 'use strict';\\n return goog.style.getStyle_(element, 'textAlign');\\n};\\n\\n\\n/**\\n * Retrieves the computed value of the cursor CSS attribute.\\n * @param {Element} element The element to get the cursor of.\\n * @return {string} The computed string value of the cursor attribute.\\n */\\ngoog.style.getComputedCursor = function(element) {\\n 'use strict';\\n return goog.style.getStyle_(element, 'cursor');\\n};\\n\\n\\n/**\\n * Retrieves the computed value of the CSS transform attribute.\\n * @param {Element} element The element to get the transform of.\\n * @return {string} The computed string representation of the transform matrix.\\n */\\ngoog.style.getComputedTransform = function(element) {\\n 'use strict';\\n var property = goog.style.getVendorStyleName_(element, 'transform');\\n return goog.style.getStyle_(element, property) ||\\n goog.style.getStyle_(element, 'transform');\\n};\\n\\n\\n/**\\n * Sets the top/left values of an element. If no unit is specified in the\\n * argument then it will add px. The second argument is required if the first\\n * argument is a string or number and is ignored if the first argument\\n * is a coordinate.\\n * @param {Element} el Element to move.\\n * @param {string|number|goog.math.Coordinate} arg1 Left position or coordinate.\\n * @param {string|number=} opt_arg2 Top position.\\n * @return {void}\\n */\\ngoog.style.setPosition = function(el, arg1, opt_arg2) {\\n 'use strict';\\n var x, y;\\n\\n if (arg1 instanceof goog.math.Coordinate) {\\n x = arg1.x;\\n y = arg1.y;\\n } else {\\n x = arg1;\\n y = opt_arg2;\\n }\\n\\n el.style.left = goog.style.getPixelStyleValue_(\\n /** @type {number|string} */ (x), false);\\n el.style.top = goog.style.getPixelStyleValue_(\\n /** @type {number|string} */ (y), false);\\n};\\n\\n\\n/**\\n * Gets the offsetLeft and offsetTop properties of an element and returns them\\n * in a Coordinate object\\n * @param {Element} element Element.\\n * @return {!goog.math.Coordinate} The position.\\n */\\ngoog.style.getPosition = function(element) {\\n 'use strict';\\n return new goog.math.Coordinate(\\n /** @type {!HTMLElement} */ (element).offsetLeft,\\n /** @type {!HTMLElement} */ (element).offsetTop);\\n};\\n\\n\\n/**\\n * Returns the viewport element for a particular document\\n * @param {Node=} opt_node DOM node (Document is OK) to get the viewport element\\n * of.\\n * @return {Element} document.documentElement or document.body.\\n */\\ngoog.style.getClientViewportElement = function(opt_node) {\\n 'use strict';\\n var doc;\\n if (opt_node) {\\n doc = goog.dom.getOwnerDocument(opt_node);\\n } else {\\n doc = goog.dom.getDocument();\\n }\\n\\n // In old IE versions the document.body represented the viewport\\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9) &&\\n !goog.dom.getDomHelper(doc).isCss1CompatMode()) {\\n return doc.body;\\n }\\n return doc.documentElement;\\n};\\n\\n\\n/**\\n * Calculates the viewport coordinates relative to the page/document\\n * containing the node. The viewport may be the browser viewport for\\n * non-iframe document, or the iframe container for iframe'd document.\\n * @param {!Document} doc The document to use as the reference point.\\n * @return {!goog.math.Coordinate} The page offset of the viewport.\\n */\\ngoog.style.getViewportPageOffset = function(doc) {\\n 'use strict';\\n var body = doc.body;\\n var documentElement = doc.documentElement;\\n var scrollLeft = body.scrollLeft || documentElement.scrollLeft;\\n var scrollTop = body.scrollTop || documentElement.scrollTop;\\n return new goog.math.Coordinate(scrollLeft, scrollTop);\\n};\\n\\n\\n/**\\n * Gets the client rectangle of the DOM element.\\n *\\n * getBoundingClientRect is part of a new CSS object model draft (with a\\n * long-time presence in IE), replacing the error-prone parent offset\\n * computation and the now-deprecated Gecko getBoxObjectFor.\\n *\\n * This utility patches common browser bugs in getBoundingClientRect. It\\n * will fail if getBoundingClientRect is unsupported.\\n *\\n * If the element is not in the DOM, the result is undefined, and an error may\\n * be thrown depending on user agent.\\n *\\n * @param {!Element} el The element whose bounding rectangle is being queried.\\n * @return {!Object} A native bounding rectangle with numerical left, top,\\n * right, and bottom. Reported by Firefox to be of object type ClientRect.\\n * @private\\n */\\ngoog.style.getBoundingClientRect_ = function(el) {\\n 'use strict';\\n try {\\n return el.getBoundingClientRect();\\n } catch (e) {\\n // In IE, calling getBoundingClientRect on an orphan element raises an\\n // \\\"Unspecified Error\\\". All other browsers return zeros.\\n return {'left': 0, 'top': 0, 'right': 0, 'bottom': 0};\\n }\\n};\\n\\n\\n/**\\n * Returns the first parent that could affect the position of a given element.\\n * @param {Element} element The element to get the offset parent for.\\n * @return {Element} The first offset parent or null if one cannot be found.\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\ngoog.style.getOffsetParent = function(element) {\\n 'use strict';\\n // element.offsetParent does the right thing in IE7 and below. In other\\n // browsers it only includes elements with position absolute, relative or\\n // fixed, not elements with overflow set to auto or scroll.\\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(8)) {\\n goog.asserts.assert(element && 'offsetParent' in element);\\n return element.offsetParent;\\n }\\n\\n var doc = goog.dom.getOwnerDocument(element);\\n var positionStyle = goog.style.getStyle_(element, 'position');\\n var skipStatic = positionStyle == 'fixed' || positionStyle == 'absolute';\\n for (var parent = element.parentNode; parent && parent != doc;\\n parent = parent.parentNode) {\\n // Skip shadowDOM roots.\\n if (parent.nodeType == goog.dom.NodeType.DOCUMENT_FRAGMENT && parent.host) {\\n // Cast because the assignment is not type safe, and without a cast we\\n // start typing parent loosely and get bad disambiguation.\\n parent = /** @type {!Element} */ (parent.host);\\n }\\n positionStyle =\\n goog.style.getStyle_(/** @type {!Element} */ (parent), 'position');\\n skipStatic = skipStatic && positionStyle == 'static' &&\\n parent != doc.documentElement && parent != doc.body;\\n if (!skipStatic &&\\n (parent.scrollWidth > parent.clientWidth ||\\n parent.scrollHeight > parent.clientHeight ||\\n positionStyle == 'fixed' || positionStyle == 'absolute' ||\\n positionStyle == 'relative')) {\\n return /** @type {!Element} */ (parent);\\n }\\n }\\n return null;\\n};\\n\\n\\n/**\\n * Calculates and returns the visible rectangle for a given element. Returns a\\n * box describing the visible portion of the nearest scrollable offset ancestor.\\n * Coordinates are given relative to the document.\\n *\\n * @param {Element} element Element to get the visible rect for.\\n * @return {goog.math.Box} Bounding elementBox describing the visible rect or\\n * null if scrollable ancestor isn't inside the visible viewport.\\n */\\ngoog.style.getVisibleRectForElement = function(element) {\\n 'use strict';\\n var visibleRect = new goog.math.Box(0, Infinity, Infinity, 0);\\n var dom = goog.dom.getDomHelper(element);\\n var body = dom.getDocument().body;\\n var documentElement = dom.getDocument().documentElement;\\n var scrollEl = dom.getDocumentScrollElement();\\n\\n // Determine the size of the visible rect by climbing the dom accounting for\\n // all scrollable containers.\\n for (var el = element; el = goog.style.getOffsetParent(el);) {\\n // clientWidth is zero for inline block elements in IE.\\n // on WEBKIT, body element can have clientHeight = 0 and scrollHeight > 0\\n if ((!goog.userAgent.IE || el.clientWidth != 0) &&\\n (!goog.userAgent.WEBKIT || el.clientHeight != 0 || el != body) &&\\n // body may have overflow set on it, yet we still get the entire\\n // viewport. In some browsers, el.offsetParent may be\\n // document.documentElement, so check for that too.\\n (el != body && el != documentElement &&\\n goog.style.getStyle_(el, 'overflow') != 'visible')) {\\n var pos = goog.style.getPageOffset(el);\\n var client = goog.style.getClientLeftTop(el);\\n pos.x += client.x;\\n pos.y += client.y;\\n\\n visibleRect.top = Math.max(visibleRect.top, pos.y);\\n visibleRect.right = Math.min(visibleRect.right, pos.x + el.clientWidth);\\n visibleRect.bottom =\\n Math.min(visibleRect.bottom, pos.y + el.clientHeight);\\n visibleRect.left = Math.max(visibleRect.left, pos.x);\\n }\\n }\\n\\n // Clip by window's viewport.\\n var scrollX = scrollEl.scrollLeft, scrollY = scrollEl.scrollTop;\\n visibleRect.left = Math.max(visibleRect.left, scrollX);\\n visibleRect.top = Math.max(visibleRect.top, scrollY);\\n var winSize = dom.getViewportSize();\\n visibleRect.right = Math.min(visibleRect.right, scrollX + winSize.width);\\n visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + winSize.height);\\n return visibleRect.top >= 0 && visibleRect.left >= 0 &&\\n visibleRect.bottom > visibleRect.top &&\\n visibleRect.right > visibleRect.left ?\\n visibleRect :\\n null;\\n};\\n\\n\\n/**\\n * Calculate the scroll position of `container` with the minimum amount so\\n * that the content and the borders of the given `element` become visible.\\n * If the element is bigger than the container, its top left corner will be\\n * aligned as close to the container's top left corner as possible.\\n *\\n * @param {Element} element The element to make visible.\\n * @param {Element=} opt_container The container to scroll. If not set, then the\\n * document scroll element will be used.\\n * @param {boolean=} opt_center Whether to center the element in the container.\\n * Defaults to false.\\n * @return {!goog.math.Coordinate} The new scroll position of the container,\\n * in form of goog.math.Coordinate(scrollLeft, scrollTop).\\n */\\ngoog.style.getContainerOffsetToScrollInto = function(\\n element, opt_container, opt_center) {\\n 'use strict';\\n var container = opt_container || goog.dom.getDocumentScrollElement();\\n // Absolute position of the element's border's top left corner.\\n var elementPos = goog.style.getPageOffset(element);\\n // Absolute position of the container's border's top left corner.\\n var containerPos = goog.style.getPageOffset(container);\\n var containerBorder = goog.style.getBorderBox(container);\\n if (container == goog.dom.getDocumentScrollElement()) {\\n // The element position is calculated based on the page offset, and the\\n // document scroll element holds the scroll position within the page. We can\\n // use the scroll position to calculate the relative position from the\\n // element.\\n var relX = elementPos.x - container.scrollLeft;\\n var relY = elementPos.y - container.scrollTop;\\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(10)) {\\n // In older versions of IE getPageOffset(element) does not include the\\n // container border so it has to be added to accommodate.\\n relX += containerBorder.left;\\n relY += containerBorder.top;\\n }\\n } else {\\n // Relative pos. of the element's border box to the container's content box.\\n var relX = elementPos.x - containerPos.x - containerBorder.left;\\n var relY = elementPos.y - containerPos.y - containerBorder.top;\\n }\\n // How much the element can move in the container, i.e. the difference between\\n // the element's bottom-right-most and top-left-most position where it's\\n // fully visible.\\n var elementSize = goog.style.getSizeWithDisplay_(element);\\n var spaceX = container.clientWidth - elementSize.width;\\n var spaceY = container.clientHeight - elementSize.height;\\n var scrollLeft = container.scrollLeft;\\n var scrollTop = container.scrollTop;\\n if (opt_center) {\\n // All browsers round non-integer scroll positions down.\\n scrollLeft += relX - spaceX / 2;\\n scrollTop += relY - spaceY / 2;\\n } else {\\n // This formula was designed to give the correct scroll values in the\\n // following cases:\\n // - element is higher than container (spaceY < 0) => scroll down by relY\\n // - element is not higher that container (spaceY >= 0):\\n // - it is above container (relY < 0) => scroll up by abs(relY)\\n // - it is below container (relY > spaceY) => scroll down by relY - spaceY\\n // - it is in the container => don't scroll\\n scrollLeft += Math.min(relX, Math.max(relX - spaceX, 0));\\n scrollTop += Math.min(relY, Math.max(relY - spaceY, 0));\\n }\\n return new goog.math.Coordinate(scrollLeft, scrollTop);\\n};\\n\\n\\n/**\\n * Changes the scroll position of `container` with the minimum amount so\\n * that the content and the borders of the given `element` become visible.\\n * If the element is bigger than the container, its top left corner will be\\n * aligned as close to the container's top left corner as possible.\\n *\\n * @param {Element} element The element to make visible.\\n * @param {Element=} opt_container The container to scroll. If not set, then the\\n * document scroll element will be used.\\n * @param {boolean=} opt_center Whether to center the element in the container.\\n * Defaults to false.\\n */\\ngoog.style.scrollIntoContainerView = function(\\n element, opt_container, opt_center) {\\n 'use strict';\\n var container = opt_container || goog.dom.getDocumentScrollElement();\\n var offset =\\n goog.style.getContainerOffsetToScrollInto(element, container, opt_center);\\n container.scrollLeft = offset.x;\\n container.scrollTop = offset.y;\\n};\\n\\n\\n/**\\n * Returns clientLeft (width of the left border and, if the directionality is\\n * right to left, the vertical scrollbar) and clientTop as a coordinate object.\\n *\\n * @param {Element} el Element to get clientLeft for.\\n * @return {!goog.math.Coordinate} Client left and top.\\n */\\ngoog.style.getClientLeftTop = function(el) {\\n 'use strict';\\n return new goog.math.Coordinate(el.clientLeft, el.clientTop);\\n};\\n\\n\\n/**\\n * Returns a Coordinate object relative to the top-left of the HTML document.\\n * Implemented as a single function to save having to do two recursive loops in\\n * opera and safari just to get both coordinates. If you just want one value do\\n * use goog.style.getPageOffsetLeft() and goog.style.getPageOffsetTop(), but\\n * note if you call both those methods the tree will be analysed twice.\\n *\\n * @param {Element} el Element to get the page offset for.\\n * @return {!goog.math.Coordinate} The page offset.\\n */\\ngoog.style.getPageOffset = function(el) {\\n 'use strict';\\n var doc = goog.dom.getOwnerDocument(el);\\n // TODO(gboyer): Update the jsdoc in a way that doesn't break the universe.\\n goog.asserts.assertObject(el, 'Parameter is required');\\n\\n // NOTE(arv): If element is hidden (display none or disconnected or any the\\n // ancestors are hidden) we get (0,0) by default but we still do the\\n // accumulation of scroll position.\\n\\n // TODO(arv): Should we check if the node is disconnected and in that case\\n // return (0,0)?\\n\\n var pos = new goog.math.Coordinate(0, 0);\\n var viewportElement = goog.style.getClientViewportElement(doc);\\n if (el == viewportElement) {\\n // viewport is always at 0,0 as that defined the coordinate system for this\\n // function - this avoids special case checks in the code below\\n return pos;\\n }\\n\\n var box = goog.style.getBoundingClientRect_(el);\\n // Must add the scroll coordinates in to get the absolute page offset\\n // of element since getBoundingClientRect returns relative coordinates to\\n // the viewport.\\n var scrollCoord = goog.dom.getDomHelper(doc).getDocumentScroll();\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n pos.x = box.left + scrollCoord.x;\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n pos.y = box.top + scrollCoord.y;\\n\\n return pos;\\n};\\n\\n\\n/**\\n * Returns the left coordinate of an element relative to the HTML document\\n * @param {Element} el Elements.\\n * @return {number} The left coordinate.\\n */\\ngoog.style.getPageOffsetLeft = function(el) {\\n 'use strict';\\n return goog.style.getPageOffset(el).x;\\n};\\n\\n\\n/**\\n * Returns the top coordinate of an element relative to the HTML document\\n * @param {Element} el Elements.\\n * @return {number} The top coordinate.\\n */\\ngoog.style.getPageOffsetTop = function(el) {\\n 'use strict';\\n return goog.style.getPageOffset(el).y;\\n};\\n\\n\\n/**\\n * Returns a Coordinate object relative to the top-left of an HTML document\\n * in an ancestor frame of this element. Used for measuring the position of\\n * an element inside a frame relative to a containing frame.\\n *\\n * @param {Element} el Element to get the page offset for.\\n * @param {Window} relativeWin The window to measure relative to. If relativeWin\\n * is not in the ancestor frame chain of the element, we measure relative to\\n * the top-most window.\\n * @return {!goog.math.Coordinate} The page offset.\\n */\\ngoog.style.getFramedPageOffset = function(el, relativeWin) {\\n 'use strict';\\n var position = new goog.math.Coordinate(0, 0);\\n\\n // Iterate up the ancestor frame chain, keeping track of the current window\\n // and the current element in that window.\\n var currentWin = goog.dom.getWindow(goog.dom.getOwnerDocument(el));\\n\\n // MS Edge throws when accessing \\\"parent\\\" if el's containing iframe has been\\n // deleted.\\n if (!goog.reflect.canAccessProperty(currentWin, 'parent')) {\\n return position;\\n }\\n\\n var currentEl = el;\\n do {\\n // if we're at the top window, we want to get the page offset.\\n // if we're at an inner frame, we only want to get the window position\\n // so that we can determine the actual page offset in the context of\\n // the outer window.\\n var offset = currentWin == relativeWin ?\\n goog.style.getPageOffset(currentEl) :\\n goog.style.getClientPositionForElement_(goog.asserts.assert(currentEl));\\n\\n position.x += offset.x;\\n position.y += offset.y;\\n } while (currentWin && currentWin != relativeWin &&\\n currentWin != currentWin.parent &&\\n (currentEl = currentWin.frameElement) &&\\n (currentWin = currentWin.parent));\\n\\n return position;\\n};\\n\\n\\n/**\\n * Translates the specified rect relative to origBase page, for newBase page.\\n * If origBase and newBase are the same, this function does nothing.\\n *\\n * @param {goog.math.Rect} rect The source rectangle relative to origBase page,\\n * and it will have the translated result.\\n * @param {goog.dom.DomHelper} origBase The DomHelper for the input rectangle.\\n * @param {goog.dom.DomHelper} newBase The DomHelper for the resultant\\n * coordinate. This must be a DOM for an ancestor frame of origBase\\n * or the same as origBase.\\n */\\ngoog.style.translateRectForAnotherFrame = function(rect, origBase, newBase) {\\n 'use strict';\\n if (origBase.getDocument() != newBase.getDocument()) {\\n var body = origBase.getDocument().body;\\n var pos = goog.style.getFramedPageOffset(body, newBase.getWindow());\\n\\n // Adjust Body's margin.\\n pos = goog.math.Coordinate.difference(pos, goog.style.getPageOffset(body));\\n\\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9) &&\\n !origBase.isCss1CompatMode()) {\\n pos = goog.math.Coordinate.difference(pos, origBase.getDocumentScroll());\\n }\\n\\n rect.left += pos.x;\\n rect.top += pos.y;\\n }\\n};\\n\\n\\n/**\\n * Returns the position of an element relative to another element in the\\n * document. A relative to B\\n * @param {Element|Event|goog.events.Event} a Element or mouse event whose\\n * position we're calculating.\\n * @param {Element|Event|goog.events.Event} b Element or mouse event position\\n * is relative to.\\n * @return {!goog.math.Coordinate} The relative position.\\n */\\ngoog.style.getRelativePosition = function(a, b) {\\n 'use strict';\\n var ap = goog.style.getClientPosition(a);\\n var bp = goog.style.getClientPosition(b);\\n return new goog.math.Coordinate(ap.x - bp.x, ap.y - bp.y);\\n};\\n\\n\\n/**\\n * Returns the position of the event or the element's border box relative to\\n * the client viewport.\\n * @param {!Element} el Element whose position to get.\\n * @return {!goog.math.Coordinate} The position.\\n * @private\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\ngoog.style.getClientPositionForElement_ = function(el) {\\n 'use strict';\\n var box = goog.style.getBoundingClientRect_(el);\\n return new goog.math.Coordinate(box.left, box.top);\\n};\\n\\n\\n/**\\n * Returns the position of the event or the element's border box relative to\\n * the client viewport. If an event is passed, and if this event is a \\\"touch\\\"\\n * event, then the position of the first changedTouches will be returned.\\n * @param {Element|Event|goog.events.Event} el Element or a mouse / touch event.\\n * @return {!goog.math.Coordinate} The position.\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\ngoog.style.getClientPosition = function(el) {\\n 'use strict';\\n goog.asserts.assert(el);\\n if (el.nodeType == goog.dom.NodeType.ELEMENT) {\\n return goog.style.getClientPositionForElement_(\\n /** @type {!Element} */ (el));\\n } else {\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n var targetEvent = el.changedTouches ? el.changedTouches[0] : el;\\n return new goog.math.Coordinate(targetEvent.clientX, targetEvent.clientY);\\n }\\n};\\n\\n\\n/**\\n * Moves an element to the given coordinates relative to the client viewport.\\n * @param {Element} el Absolutely positioned element to set page offset for.\\n * It must be in the document.\\n * @param {number|goog.math.Coordinate} x Left position of the element's margin\\n * box or a coordinate object.\\n * @param {number=} opt_y Top position of the element's margin box.\\n * @return {void}\\n */\\ngoog.style.setPageOffset = function(el, x, opt_y) {\\n 'use strict';\\n // Get current pageoffset\\n var cur = goog.style.getPageOffset(el);\\n\\n if (x instanceof goog.math.Coordinate) {\\n opt_y = x.y;\\n x = x.x;\\n }\\n\\n // NOTE(arv): We cannot allow strings for x and y. We could but that would\\n // require us to manually transform between different units\\n\\n // Work out deltas\\n var dx = goog.asserts.assertNumber(x) - cur.x;\\n var dy = Number(opt_y) - cur.y;\\n\\n // Set position to current left/top + delta\\n goog.style.setPosition(\\n el, /** @type {!HTMLElement} */ (el).offsetLeft + dx,\\n /** @type {!HTMLElement} */ (el).offsetTop + dy);\\n};\\n\\n\\n/**\\n * Sets the width/height values of an element. If an argument is numeric,\\n * or a goog.math.Size is passed, it is assumed to be pixels and will add\\n * 'px' after converting it to an integer in string form. (This just sets the\\n * CSS width and height properties so it might set content-box or border-box\\n * size depending on the box model the browser is using.)\\n *\\n * @param {Element} element Element to set the size of.\\n * @param {string|number|goog.math.Size} w Width of the element, or a\\n * size object.\\n * @param {string|number=} opt_h Height of the element. Required if w is not a\\n * size object.\\n * @return {void}\\n */\\ngoog.style.setSize = function(element, w, opt_h) {\\n 'use strict';\\n var h;\\n if (w instanceof goog.math.Size) {\\n h = w.height;\\n w = w.width;\\n } else {\\n if (opt_h == undefined) {\\n throw new Error('missing height argument');\\n }\\n h = opt_h;\\n }\\n\\n goog.style.setWidth(element, /** @type {string|number} */ (w));\\n goog.style.setHeight(element, h);\\n};\\n\\n\\n/**\\n * Helper function to create a string to be set into a pixel-value style\\n * property of an element. Can round to the nearest integer value.\\n *\\n * @param {string|number} value The style value to be used. If a number,\\n * 'px' will be appended, otherwise the value will be applied directly.\\n * @param {boolean} round Whether to round the nearest integer (if property\\n * is a number).\\n * @return {string} The string value for the property.\\n * @private\\n */\\ngoog.style.getPixelStyleValue_ = function(value, round) {\\n 'use strict';\\n if (typeof value == 'number') {\\n value = (round ? Math.round(value) : value) + 'px';\\n }\\n\\n return value;\\n};\\n\\n\\n/**\\n * Set the height of an element. Sets the element's style property.\\n * @param {Element} element Element to set the height of.\\n * @param {string|number} height The height value to set. If a number, 'px'\\n * will be appended, otherwise the value will be applied directly.\\n */\\ngoog.style.setHeight = function(element, height) {\\n 'use strict';\\n element.style.height = goog.style.getPixelStyleValue_(height, true);\\n};\\n\\n\\n/**\\n * Set the width of an element. Sets the element's style property.\\n * @param {Element} element Element to set the width of.\\n * @param {string|number} width The width value to set. If a number, 'px'\\n * will be appended, otherwise the value will be applied directly.\\n */\\ngoog.style.setWidth = function(element, width) {\\n 'use strict';\\n element.style.width = goog.style.getPixelStyleValue_(width, true);\\n};\\n\\n\\n/**\\n * Gets the height and width of an element, even if its display is none.\\n *\\n * Specifically, this returns the height and width of the border box,\\n * irrespective of the box model in effect.\\n *\\n * Note that this function does not take CSS transforms into account. Please see\\n * `goog.style.getTransformedSize`.\\n * @param {Element} element Element to get size of.\\n * @return {!goog.math.Size} Object with width/height properties.\\n */\\ngoog.style.getSize = function(element) {\\n 'use strict';\\n return goog.style.evaluateWithTemporaryDisplay_(\\n goog.style.getSizeWithDisplay_, /** @type {!Element} */ (element));\\n};\\n\\n\\n/**\\n * Call `fn` on `element` such that `element`'s dimensions are\\n * accurate when it's passed to `fn`.\\n * @param {function(!Element): T} fn Function to call with `element` as\\n * an argument after temporarily changing `element`'s display such\\n * that its dimensions are accurate.\\n * @param {!Element} element Element (which may have display none) to use as\\n * argument to `fn`.\\n * @return {T} Value returned by calling `fn` with `element`.\\n * @template T\\n * @private\\n */\\ngoog.style.evaluateWithTemporaryDisplay_ = function(fn, element) {\\n 'use strict';\\n if (goog.style.getStyle_(element, 'display') != 'none') {\\n return fn(element);\\n }\\n\\n var style = element.style;\\n var originalDisplay = style.display;\\n var originalVisibility = style.visibility;\\n var originalPosition = style.position;\\n\\n style.visibility = 'hidden';\\n style.position = 'absolute';\\n style.display = 'inline';\\n\\n var retVal = fn(element);\\n\\n style.display = originalDisplay;\\n style.position = originalPosition;\\n style.visibility = originalVisibility;\\n\\n return retVal;\\n};\\n\\n\\n/**\\n * Gets the height and width of an element when the display is not none.\\n * @param {Element} element Element to get size of.\\n * @return {!goog.math.Size} Object with width/height properties.\\n * @private\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\ngoog.style.getSizeWithDisplay_ = function(element) {\\n 'use strict';\\n var offsetWidth = /** @type {!HTMLElement} */ (element).offsetWidth;\\n var offsetHeight = /** @type {!HTMLElement} */ (element).offsetHeight;\\n var webkitOffsetsZero =\\n goog.userAgent.WEBKIT && !offsetWidth && !offsetHeight;\\n if ((offsetWidth === undefined || webkitOffsetsZero) &&\\n element.getBoundingClientRect) {\\n // Fall back to calling getBoundingClientRect when offsetWidth or\\n // offsetHeight are not defined, or when they are zero in WebKit browsers.\\n // This makes sure that we return for the correct size for SVG elements, but\\n // will still return 0 on Webkit prior to 534.8, see\\n // http://trac.webkit.org/changeset/67252.\\n var clientRect = goog.style.getBoundingClientRect_(element);\\n return new goog.math.Size(\\n clientRect.right - clientRect.left, clientRect.bottom - clientRect.top);\\n }\\n return new goog.math.Size(offsetWidth, offsetHeight);\\n};\\n\\n\\n/**\\n * Gets the height and width of an element, post transform, even if its display\\n * is none.\\n *\\n * This is like `goog.style.getSize`, except:\\n *
    \\n *
  1. Takes webkitTransforms such as rotate and scale into account.\\n *
  2. Will return null if `element` doesn't respond to\\n * `getBoundingClientRect`.\\n *
  3. Currently doesn't make sense on non-WebKit browsers which don't support\\n * webkitTransforms.\\n *
\\n * @param {!Element} element Element to get size of.\\n * @return {goog.math.Size} Object with width/height properties.\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\ngoog.style.getTransformedSize = function(element) {\\n 'use strict';\\n if (!element.getBoundingClientRect) {\\n return null;\\n }\\n\\n var clientRect = goog.style.evaluateWithTemporaryDisplay_(\\n goog.style.getBoundingClientRect_, element);\\n return new goog.math.Size(\\n clientRect.right - clientRect.left, clientRect.bottom - clientRect.top);\\n};\\n\\n\\n/**\\n * Returns a bounding rectangle for a given element in page space.\\n * @param {Element} element Element to get bounds of. Must not be display none.\\n * @return {!goog.math.Rect} Bounding rectangle for the element.\\n */\\ngoog.style.getBounds = function(element) {\\n 'use strict';\\n var o = goog.style.getPageOffset(element);\\n var s = goog.style.getSize(element);\\n return new goog.math.Rect(o.x, o.y, s.width, s.height);\\n};\\n\\n\\n/**\\n * Converts a CSS selector in the form style-property to styleProperty.\\n * @param {*} selector CSS Selector.\\n * @return {string} Camel case selector.\\n * @deprecated Use goog.string.toCamelCase instead.\\n */\\ngoog.style.toCamelCase = function(selector) {\\n 'use strict';\\n return goog.string.toCamelCase(String(selector));\\n};\\n\\n\\n/**\\n * Converts a CSS selector in the form styleProperty to style-property.\\n * @param {string} selector Camel case selector.\\n * @return {string} Selector cased.\\n * @deprecated Use goog.string.toSelectorCase instead.\\n */\\ngoog.style.toSelectorCase = function(selector) {\\n 'use strict';\\n return goog.string.toSelectorCase(selector);\\n};\\n\\n\\n/**\\n * Gets the opacity of a node (x-browser). This gets the inline style opacity\\n * of the node, and does not take into account the cascaded or the computed\\n * style for this node.\\n * @param {Element} el Element whose opacity has to be found.\\n * @return {number|string} Opacity between 0 and 1 or an empty string {@code ''}\\n * if the opacity is not set.\\n */\\ngoog.style.getOpacity = function(el) {\\n 'use strict';\\n goog.asserts.assert(el);\\n var style = el.style;\\n var result = '';\\n if ('opacity' in style) {\\n result = style.opacity;\\n } else if ('MozOpacity' in style) {\\n result = style.MozOpacity;\\n } else if ('filter' in style) {\\n var match = style.filter.match(/alpha\\\\(opacity=([\\\\d.]+)\\\\)/);\\n if (match) {\\n result = String(match[1] / 100);\\n }\\n }\\n return result == '' ? result : Number(result);\\n};\\n\\n\\n/**\\n * Sets the opacity of a node (x-browser).\\n * @param {Element} el Elements whose opacity has to be set.\\n * @param {number|string} alpha Opacity between 0 and 1 or an empty string\\n * {@code ''} to clear the opacity.\\n * @return {void}\\n */\\ngoog.style.setOpacity = function(el, alpha) {\\n 'use strict';\\n goog.asserts.assert(el);\\n var style = el.style;\\n if ('opacity' in style) {\\n style.opacity = alpha;\\n } else if ('MozOpacity' in style) {\\n style.MozOpacity = alpha;\\n } else if ('filter' in style) {\\n // TODO(arv): Overwriting the filter might have undesired side effects.\\n if (alpha === '') {\\n /**\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\n style.filter = '';\\n } else {\\n /**\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\n style.filter = 'alpha(opacity=' + (Number(alpha) * 100) + ')';\\n }\\n }\\n};\\n\\n\\n/**\\n * Sets the background of an element to a transparent image in a browser-\\n * independent manner.\\n *\\n * This function does not support repeating backgrounds or alternate background\\n * positions to match the behavior of Internet Explorer. It also does not\\n * support sizingMethods other than crop since they cannot be replicated in\\n * browsers other than Internet Explorer.\\n *\\n * @param {Element} el The element to set background on.\\n * @param {string} src The image source URL.\\n * @return {void}\\n */\\ngoog.style.setTransparentBackgroundImage = function(el, src) {\\n 'use strict';\\n var style = el.style;\\n // It is safe to use the style.filter in IE only. In Safari 'filter' is in\\n // style object but access to style.filter causes it to throw an exception.\\n // Note: IE8 supports images with an alpha channel.\\n\\n // Set style properties individually instead of using background shorthand\\n // to prevent overwriting a pre-existing background color.\\n style.backgroundImage = 'url(' + src + ')';\\n style.backgroundPosition = 'top left';\\n style.backgroundRepeat = 'no-repeat';\\n};\\n\\n\\n/**\\n * Clears the background image of an element in a browser independent manner.\\n * @param {Element} el The element to clear background image for.\\n */\\ngoog.style.clearTransparentBackgroundImage = function(el) {\\n 'use strict';\\n var style = el.style;\\n if ('filter' in style) {\\n // See TODO in setOpacity.\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n style.filter = '';\\n } else {\\n // Set style properties individually instead of using background shorthand\\n // to prevent overwriting a pre-existing background color.\\n style.backgroundImage = 'none';\\n }\\n};\\n\\n\\n/**\\n * Shows or hides an element from the page. Hiding the element is done by\\n * setting the display property to \\\"none\\\", removing the element from the\\n * rendering hierarchy so it takes up no space. To show the element, the default\\n * inherited display property is restored (defined either in stylesheets or by\\n * the browser's default style rules.)\\n *\\n * Caveat 1: if the inherited display property for the element is set to \\\"none\\\"\\n * by the stylesheets, that is the property that will be restored by a call to\\n * showElement(), effectively toggling the display between \\\"none\\\" and \\\"none\\\".\\n *\\n * Caveat 2: if the element display style is set inline (by setting either\\n * element.style.display or a style attribute in the HTML), a call to\\n * showElement will clear that setting and defer to the inherited style in the\\n * stylesheet.\\n * @param {Element} el Element to show or hide.\\n * @param {*} display True to render the element in its default style,\\n * false to disable rendering the element.\\n * @return {void}\\n * @deprecated Use goog.style.setElementShown instead.\\n */\\ngoog.style.showElement = function(el, display) {\\n 'use strict';\\n goog.style.setElementShown(el, display);\\n};\\n\\n\\n/**\\n * Shows or hides an element from the page. Hiding the element is done by\\n * setting the display property to \\\"none\\\", removing the element from the\\n * rendering hierarchy so it takes up no space. To show the element, the default\\n * inherited display property is restored (defined either in stylesheets or by\\n * the browser's default style rules).\\n *\\n * Caveat 1: if the inherited display property for the element is set to \\\"none\\\"\\n * by the stylesheets, that is the property that will be restored by a call to\\n * setElementShown(), effectively toggling the display between \\\"none\\\" and\\n * \\\"none\\\".\\n *\\n * Caveat 2: if the element display style is set inline (by setting either\\n * element.style.display or a style attribute in the HTML), a call to\\n * setElementShown will clear that setting and defer to the inherited style in\\n * the stylesheet.\\n * @param {Element} el Element to show or hide.\\n * @param {*} isShown True to render the element in its default style,\\n * false to disable rendering the element.\\n * @return {void}\\n */\\ngoog.style.setElementShown = function(el, isShown) {\\n 'use strict';\\n el.style.display = isShown ? '' : 'none';\\n};\\n\\n\\n/**\\n * Test whether the given element has been shown or hidden via a call to\\n * {@link #setElementShown}.\\n *\\n * Note this is strictly a companion method for a call\\n * to {@link #setElementShown} and the same caveats apply; in particular, this\\n * method does not guarantee that the return value will be consistent with\\n * whether or not the element is actually visible.\\n *\\n * @param {Element} el The element to test.\\n * @return {boolean} Whether the element has been shown.\\n * @see #setElementShown\\n */\\ngoog.style.isElementShown = function(el) {\\n 'use strict';\\n return el.style.display != 'none';\\n};\\n\\n\\n/**\\n * Installs the style sheet into the window that contains opt_node. If\\n * opt_node is null, the main window is used.\\n * @param {!goog.html.SafeStyleSheet} safeStyleSheet The style sheet to install.\\n * @param {?Node=} opt_node Node whose parent document should have the\\n * styles installed.\\n * @return {!HTMLStyleElement|!StyleSheet} In IE<11, a StyleSheet object with no\\n * owning <style> tag (this is how IE creates style sheets). In every\\n * other browser, a <style> element with an attached style. This\\n * doesn't return a StyleSheet object so that setSafeStyleSheet can replace\\n * it (otherwise, if you pass a StyleSheet to setSafeStyleSheet, it will\\n * make a new StyleSheet and leave the original StyleSheet orphaned).\\n */\\ngoog.style.installSafeStyleSheet = function(safeStyleSheet, opt_node) {\\n 'use strict';\\n var dh = goog.dom.getDomHelper(opt_node);\\n\\n // IE < 11 requires createStyleSheet. Note that doc.createStyleSheet will be\\n // undefined as of IE 11.\\n var doc = dh.getDocument();\\n if (goog.userAgent.IE && doc.createStyleSheet) {\\n /** @type {(!HTMLStyleElement|!StyleSheet)} */\\n var styleSheet = doc.createStyleSheet();\\n goog.style.setSafeStyleSheet(styleSheet, safeStyleSheet);\\n return styleSheet;\\n } else {\\n var head = dh.getElementsByTagNameAndClass(goog.dom.TagName.HEAD)[0];\\n\\n // In opera documents are not guaranteed to have a head element, thus we\\n // have to make sure one exists before using it.\\n if (!head) {\\n var body = dh.getElementsByTagNameAndClass(goog.dom.TagName.BODY)[0];\\n head = dh.createDom(goog.dom.TagName.HEAD);\\n body.parentNode.insertBefore(head, body);\\n }\\n var el = dh.createDom(goog.dom.TagName.STYLE);\\n const nonce = goog.dom.safe.getStyleNonce();\\n if (nonce) {\\n el.setAttribute('nonce', nonce);\\n }\\n\\n // NOTE(user): Setting styles after the style element has been appended\\n // to the head results in a nasty Webkit bug in certain scenarios. Please\\n // refer to https://bugs.webkit.org/show_bug.cgi?id=26307 for additional\\n // details.\\n goog.style.setSafeStyleSheet(el, safeStyleSheet);\\n dh.appendChild(head, el);\\n return el;\\n }\\n};\\n\\n\\n/**\\n * Removes the styles added by {@link #installSafeStyleSheet}.\\n * @param {Element|StyleSheet} styleSheet The value returned by\\n * {@link #installSafeStyleSheet}.\\n */\\ngoog.style.uninstallStyles = function(styleSheet) {\\n 'use strict';\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n var node = styleSheet.ownerNode || styleSheet.owningElement ||\\n /** @type {Element} */ (styleSheet);\\n goog.dom.removeNode(node);\\n};\\n\\n\\n/**\\n * Sets the content of a style element. The style element can be any valid\\n * style element. This element will have its content completely replaced by\\n * the safeStyleSheet.\\n * @param {!Element|!StyleSheet} element A stylesheet element as returned by\\n * installSafeStyleSheet.\\n * @param {!goog.html.SafeStyleSheet} safeStyleSheet The new content of the\\n * stylesheet.\\n * @return {void}\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\ngoog.style.setSafeStyleSheet = function(element, safeStyleSheet) {\\n 'use strict';\\n var stylesString = goog.html.SafeStyleSheet.unwrap(safeStyleSheet);\\n if (goog.userAgent.IE && element.cssText !== undefined) {\\n // Adding the selectors individually caused the browser to hang if the\\n // selector was invalid or there were CSS comments. Setting the cssText of\\n // the style node works fine and ignores CSS that IE doesn't understand.\\n // However IE >= 11 doesn't support cssText any more, so we make sure that\\n // cssText is a defined property and otherwise fall back to innerHTML.\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n element.cssText = stylesString;\\n } else if (goog.global.trustedTypes) {\\n goog.dom.setTextContent(/** @type {!Element} */ (element), stylesString);\\n } else {\\n // Setting textContent doesn't work in Safari, see b/29340337.\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n element.innerHTML = stylesString;\\n }\\n};\\n\\n\\n/**\\n * Sets 'white-space: pre-wrap' for a node (x-browser).\\n *\\n * There are as many ways of specifying pre-wrap as there are browsers.\\n *\\n * CSS3/IE8: white-space: pre-wrap;\\n * Mozilla: white-space: -moz-pre-wrap;\\n * Opera: white-space: -o-pre-wrap;\\n * IE6/7: white-space: pre; word-wrap: break-word;\\n *\\n * @param {Element} el Element to enable pre-wrap for.\\n */\\ngoog.style.setPreWrap = function(el) {\\n 'use strict';\\n var style = el.style;\\n if (goog.userAgent.GECKO) {\\n style.whiteSpace = '-moz-pre-wrap';\\n } else {\\n style.whiteSpace = 'pre-wrap';\\n }\\n};\\n\\n\\n/**\\n * Sets 'display: inline-block' for an element (cross-browser).\\n * @param {Element} el Element to which the inline-block display style is to be\\n * applied.\\n * @return {void}\\n * @see ../demos/inline_block_quirks.html\\n * @see ../demos/inline_block_standards.html\\n */\\ngoog.style.setInlineBlock = function(el) {\\n 'use strict';\\n var style = el.style;\\n // Without position:relative, weirdness ensues. Just accept it and move on.\\n style.position = 'relative';\\n style.display = 'inline-block';\\n};\\n\\n\\n/**\\n * Returns true if the element is using right to left (rtl) direction.\\n * @param {Element} el The element to test.\\n * @return {boolean} True for right to left, false for left to right.\\n */\\ngoog.style.isRightToLeft = function(el) {\\n 'use strict';\\n return 'rtl' == goog.style.getStyle_(el, 'direction');\\n};\\n\\n\\n/**\\n * The CSS style property corresponding to an element being\\n * unselectable on the current browser platform (null if none).\\n * Opera and IE instead use a DOM attribute 'unselectable'. MS Edge uses\\n * the Webkit prefix.\\n * @type {?string}\\n * @private\\n */\\ngoog.style.unselectableStyle_ = goog.userAgent.GECKO ?\\n 'MozUserSelect' :\\n goog.userAgent.WEBKIT || goog.userAgent.EDGE ? 'WebkitUserSelect' : null;\\n\\n\\n/**\\n * Returns true if the element is set to be unselectable, false otherwise.\\n * Note that on some platforms (e.g. Mozilla), even if an element isn't set\\n * to be unselectable, it will behave as such if any of its ancestors is\\n * unselectable.\\n * @param {Element} el Element to check.\\n * @return {boolean} Whether the element is set to be unselectable.\\n */\\ngoog.style.isUnselectable = function(el) {\\n 'use strict';\\n if (goog.style.unselectableStyle_) {\\n return el.style[goog.style.unselectableStyle_].toLowerCase() == 'none';\\n } else if (goog.userAgent.IE) {\\n return el.getAttribute('unselectable') == 'on';\\n }\\n return false;\\n};\\n\\n\\n/**\\n * Makes the element and its descendants selectable or unselectable. Note\\n * that on some platforms (e.g. Mozilla), even if an element isn't set to\\n * be unselectable, it will behave as such if any of its ancestors is\\n * unselectable.\\n * @param {Element} el The element to alter.\\n * @param {boolean} unselectable Whether the element and its descendants\\n * should be made unselectable.\\n * @param {boolean=} opt_noRecurse Whether to only alter the element's own\\n * selectable state, and leave its descendants alone; defaults to false.\\n */\\ngoog.style.setUnselectable = function(el, unselectable, opt_noRecurse) {\\n 'use strict';\\n // TODO(attila): Do we need all of TR_DomUtil.makeUnselectable() in Closure?\\n var descendants = !opt_noRecurse ? el.getElementsByTagName('*') : null;\\n var name = goog.style.unselectableStyle_;\\n if (name) {\\n // Add/remove the appropriate CSS style to/from the element and its\\n // descendants.\\n var value = unselectable ? 'none' : '';\\n // MathML elements do not have a style property. Verify before setting.\\n if (el.style) {\\n el.style[name] = value;\\n }\\n if (descendants) {\\n for (var i = 0, descendant; descendant = descendants[i]; i++) {\\n if (descendant.style) {\\n descendant.style[name] = value;\\n }\\n }\\n }\\n } else if (goog.userAgent.IE) {\\n // Toggle the 'unselectable' attribute on the element and its descendants.\\n var value = unselectable ? 'on' : '';\\n el.setAttribute('unselectable', value);\\n if (descendants) {\\n for (var i = 0, descendant; descendant = descendants[i]; i++) {\\n descendant.setAttribute('unselectable', value);\\n }\\n }\\n }\\n};\\n\\n\\n/**\\n * Gets the border box size for an element.\\n * @param {Element} element The element to get the size for.\\n * @return {!goog.math.Size} The border box size.\\n */\\ngoog.style.getBorderBoxSize = function(element) {\\n 'use strict';\\n return new goog.math.Size(\\n /** @type {!HTMLElement} */ (element).offsetWidth,\\n /** @type {!HTMLElement} */ (element).offsetHeight);\\n};\\n\\n\\n/**\\n * Sets the border box size of an element. This is potentially expensive in IE\\n * if the document is CSS1Compat mode\\n * @param {Element} element The element to set the size on.\\n * @param {goog.math.Size} size The new size.\\n */\\ngoog.style.setBorderBoxSize = function(element, size) {\\n 'use strict';\\n goog.style.setBoxSizingSize_(element, size, 'border-box');\\n};\\n\\n\\n/**\\n * Gets the content box size for an element. This is potentially expensive in\\n * all browsers.\\n * @param {Element} element The element to get the size for.\\n * @return {!goog.math.Size} The content box size.\\n * @suppress {strictMissingProperties} Added to tighten compiler checks\\n */\\ngoog.style.getContentBoxSize = function(element) {\\n 'use strict';\\n var doc = goog.dom.getOwnerDocument(element);\\n var ieCurrentStyle = goog.userAgent.IE && element.currentStyle;\\n if (ieCurrentStyle && goog.dom.getDomHelper(doc).isCss1CompatMode() &&\\n ieCurrentStyle.width != 'auto' && ieCurrentStyle.height != 'auto' &&\\n !ieCurrentStyle.boxSizing) {\\n // If IE in CSS1Compat mode than just use the width and height.\\n // If we have a boxSizing then fall back on measuring the borders etc.\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n var width = goog.style.getIePixelValue_(\\n element, /** @type {string} */ (ieCurrentStyle.width), 'width',\\n 'pixelWidth');\\n /** @suppress {strictMissingProperties} Added to tighten compiler checks */\\n var height = goog.style.getIePixelValue_(\\n element, /** @type {string} */ (ieCurrentStyle.height), 'height',\\n 'pixelHeight');\\n return new goog.math.Size(width, height);\\n } else {\\n var borderBoxSize = goog.style.getBorderBoxSize(element);\\n var paddingBox = goog.style.getPaddingBox(element);\\n var borderBox = goog.style.getBorderBox(element);\\n return new goog.math.Size(\\n borderBoxSize.width - borderBox.left - paddingBox.left -\\n paddingBox.right - borderBox.right,\\n borderBoxSize.height - borderBox.top - paddingBox.top -\\n paddingBox.bottom - borderBox.bottom);\\n }\\n};\\n\\n\\n/**\\n * Sets the content box size of an element. This is potentially expensive in IE\\n * if the document is BackCompat mode.\\n * @param {Element} element The element to set the size on.\\n * @param {goog.math.Size} size The new size.\\n */\\ngoog.style.setContentBoxSize = function(element, size) {\\n 'use strict';\\n goog.style.setBoxSizingSize_(element, size, 'content-box');\\n};\\n\\n\\n/**\\n * Helper function that sets the box sizing as well as the width and height\\n * @param {Element} element The element to set the size on.\\n * @param {goog.math.Size} size The new size to set.\\n * @param {string} boxSizing The box-sizing value.\\n * @private\\n */\\ngoog.style.setBoxSizingSize_ = function(element, size, boxSizing) {\\n 'use strict';\\n var style = element.style;\\n if (goog.userAgent.GECKO) {\\n style.MozBoxSizing = boxSizing;\\n } else if (goog.userAgent.WEBKIT) {\\n style.WebkitBoxSizing = boxSizing;\\n } else {\\n // Includes IE8 and Opera 9.50+\\n style.boxSizing = boxSizing;\\n }\\n\\n // Setting this to a negative value will throw an exception on IE\\n // (and doesn't do anything different than setting it to 0).\\n style.width = Math.max(size.width, 0) + 'px';\\n style.height = Math.max(size.height, 0) + 'px';\\n};\\n\\n\\n/**\\n * IE specific function that converts a non pixel unit to pixels.\\n * @param {Element} element The element to convert the value for.\\n * @param {string} value The current value as a string. The value must not be\\n * ''.\\n * @param {string} name The CSS property name to use for the converstion. This\\n * should be 'left', 'top', 'width' or 'height'.\\n * @param {string} pixelName The CSS pixel property name to use to get the\\n * value in pixels.\\n * @return {number} The value in pixels.\\n * @private\\n */\\ngoog.style.getIePixelValue_ = function(element, value, name, pixelName) {\\n 'use strict';\\n // Try if we already have a pixel value. IE does not do half pixels so we\\n // only check if it matches a number followed by 'px'.\\n if (/^\\\\d+px?$/.test(value)) {\\n return parseInt(value, 10);\\n } else {\\n var oldStyleValue = element.style[name];\\n var oldRuntimeValue = element.runtimeStyle[name];\\n // set runtime style to prevent changes\\n element.runtimeStyle[name] = element.currentStyle[name];\\n element.style[name] = value;\\n var pixelValue = element.style[pixelName];\\n // restore\\n element.style[name] = oldStyleValue;\\n element.runtimeStyle[name] = oldRuntimeValue;\\n return +pixelValue;\\n }\\n};\\n\\n\\n/**\\n * Helper function for getting the pixel padding or margin for IE.\\n * @param {Element} element The element to get the padding for.\\n * @param {string} propName The property name.\\n * @return {number} The pixel padding.\\n * @private\\n */\\ngoog.style.getIePixelDistance_ = function(element, propName) {\\n 'use strict';\\n var value = goog.style.getCascadedStyle(element, propName);\\n return value ?\\n goog.style.getIePixelValue_(element, value, 'left', 'pixelLeft') :\\n 0;\\n};\\n\\n\\n/**\\n * Gets the computed paddings or margins (on all sides) in pixels.\\n * @param {Element} element The element to get the padding for.\\n * @param {string} stylePrefix Pass 'padding' to retrieve the padding box,\\n * or 'margin' to retrieve the margin box.\\n * @return {!goog.math.Box} The computed paddings or margins.\\n * @private\\n */\\ngoog.style.getBox_ = function(element, stylePrefix) {\\n 'use strict';\\n if (goog.userAgent.IE) {\\n var left = goog.style.getIePixelDistance_(element, stylePrefix + 'Left');\\n var right = goog.style.getIePixelDistance_(element, stylePrefix + 'Right');\\n var top = goog.style.getIePixelDistance_(element, stylePrefix + 'Top');\\n var bottom =\\n goog.style.getIePixelDistance_(element, stylePrefix + 'Bottom');\\n return new goog.math.Box(top, right, bottom, left);\\n } else {\\n // On non-IE browsers, getComputedStyle is always non-null.\\n var left = goog.style.getComputedStyle(element, stylePrefix + 'Left');\\n var right = goog.style.getComputedStyle(element, stylePrefix + 'Right');\\n var top = goog.style.getComputedStyle(element, stylePrefix + 'Top');\\n var bottom = goog.style.getComputedStyle(element, stylePrefix + 'Bottom');\\n\\n // NOTE(arv): Gecko can return floating point numbers for the computed\\n // style values.\\n return new goog.math.Box(\\n parseFloat(top), parseFloat(right), parseFloat(bottom),\\n parseFloat(left));\\n }\\n};\\n\\n\\n/**\\n * Gets the computed paddings (on all sides) in pixels.\\n * @param {Element} element The element to get the padding for.\\n * @return {!goog.math.Box} The computed paddings.\\n */\\ngoog.style.getPaddingBox = function(element) {\\n 'use strict';\\n return goog.style.getBox_(element, 'padding');\\n};\\n\\n\\n/**\\n * Gets the computed margins (on all sides) in pixels.\\n * @param {Element} element The element to get the margins for.\\n * @return {!goog.math.Box} The computed margins.\\n */\\ngoog.style.getMarginBox = function(element) {\\n 'use strict';\\n return goog.style.getBox_(element, 'margin');\\n};\\n\\n\\n/**\\n * A map used to map the border width keywords to a pixel width.\\n * @type {!Object}\\n * @private\\n */\\ngoog.style.ieBorderWidthKeywords_ = {\\n 'thin': 2,\\n 'medium': 4,\\n 'thick': 6\\n};\\n\\n\\n/**\\n * Helper function for IE to get the pixel border.\\n * @param {Element} element The element to get the pixel border for.\\n * @param {string} prop The part of the property name.\\n * @return {number} The value in pixels.\\n * @private\\n */\\ngoog.style.getIePixelBorder_ = function(element, prop) {\\n 'use strict';\\n if (goog.style.getCascadedStyle(element, prop + 'Style') == 'none') {\\n return 0;\\n }\\n var width = goog.style.getCascadedStyle(element, prop + 'Width');\\n if (width in goog.style.ieBorderWidthKeywords_) {\\n return goog.style.ieBorderWidthKeywords_[width];\\n }\\n return goog.style.getIePixelValue_(element, width, 'left', 'pixelLeft');\\n};\\n\\n\\n/**\\n * Gets the computed border widths (on all sides) in pixels\\n * @param {Element} element The element to get the border widths for.\\n * @return {!goog.math.Box} The computed border widths.\\n */\\ngoog.style.getBorderBox = function(element) {\\n 'use strict';\\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9)) {\\n var left = goog.style.getIePixelBorder_(element, 'borderLeft');\\n var right = goog.style.getIePixelBorder_(element, 'borderRight');\\n var top = goog.style.getIePixelBorder_(element, 'borderTop');\\n var bottom = goog.style.getIePixelBorder_(element, 'borderBottom');\\n return new goog.math.Box(top, right, bottom, left);\\n } else {\\n // On non-IE browsers, getComputedStyle is always non-null.\\n var left = goog.style.getComputedStyle(element, 'borderLeftWidth');\\n var right = goog.style.getComputedStyle(element, 'borderRightWidth');\\n var top = goog.style.getComputedStyle(element, 'borderTopWidth');\\n var bottom = goog.style.getComputedStyle(element, 'borderBottomWidth');\\n\\n return new goog.math.Box(\\n parseFloat(top), parseFloat(right), parseFloat(bottom),\\n parseFloat(left));\\n }\\n};\\n\\n\\n/**\\n * Returns the font face applied to a given node. Opera and IE should return\\n * the font actually displayed. Firefox returns the author's most-preferred\\n * font (whether the browser is capable of displaying it or not.)\\n * @param {Element} el The element whose font family is returned.\\n * @return {string} The font family applied to el.\\n */\\ngoog.style.getFontFamily = function(el) {\\n 'use strict';\\n var doc = goog.dom.getOwnerDocument(el);\\n var font = '';\\n // The moveToElementText method from the TextRange only works if the element\\n // is attached to the owner document.\\n if (doc.body.createTextRange && goog.dom.contains(doc, el)) {\\n var range = doc.body.createTextRange();\\n range.moveToElementText(el);\\n\\n try {\\n font = range.queryCommandValue('FontName');\\n } catch (e) {\\n // This is a workaround for a awkward exception.\\n // On some IE, there is an exception coming from it.\\n // The error description from this exception is:\\n // This window has already been registered as a drop target\\n // This is bogus description, likely due to a bug in ie.\\n font = '';\\n }\\n }\\n if (!font) {\\n // Note if for some reason IE can't derive FontName with a TextRange, we\\n // fallback to using currentStyle\\n font = goog.style.getStyle_(el, 'fontFamily');\\n }\\n\\n // Firefox returns the applied font-family string (author's list of\\n // preferred fonts.) We want to return the most-preferred font, in lieu of\\n // the *actually* applied font.\\n var fontsArray = font.split(',');\\n if (fontsArray.length > 1) font = fontsArray[0];\\n\\n // Sanitize for x-browser consistency:\\n // Strip quotes because browsers aren't consistent with how they're\\n // applied; Opera always encloses, Firefox sometimes, and IE never.\\n return goog.string.stripQuotes(font, '\\\"\\\\'');\\n};\\n\\n\\n/**\\n * Regular expression used for getLengthUnits.\\n * @type {RegExp}\\n * @private\\n */\\ngoog.style.lengthUnitRegex_ = /[^\\\\d]+$/;\\n\\n\\n/**\\n * Returns the units used for a CSS length measurement.\\n * @param {string} value A CSS length quantity.\\n * @return {?string} The units of measurement.\\n */\\ngoog.style.getLengthUnits = function(value) {\\n 'use strict';\\n var units = value.match(goog.style.lengthUnitRegex_);\\n return units && units[0] || null;\\n};\\n\\n\\n/**\\n * Map of absolute CSS length units\\n * @type {!Object}\\n * @private\\n */\\ngoog.style.ABSOLUTE_CSS_LENGTH_UNITS_ = {\\n 'cm': 1,\\n 'in': 1,\\n 'mm': 1,\\n 'pc': 1,\\n 'pt': 1\\n};\\n\\n\\n/**\\n * Map of relative CSS length units that can be accurately converted to px\\n * font-size values using getIePixelValue_. Only units that are defined in\\n * relation to a font size are convertible (%, small, etc. are not).\\n * @type {!Object}\\n * @private\\n */\\ngoog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_ = {\\n 'em': 1,\\n 'ex': 1\\n};\\n\\n\\n/**\\n * Returns the font size, in pixels, of text in an element.\\n * @param {Element} el The element whose font size is returned.\\n * @return {number} The font size (in pixels).\\n */\\ngoog.style.getFontSize = function(el) {\\n 'use strict';\\n var fontSize = goog.style.getStyle_(el, 'fontSize');\\n var sizeUnits = goog.style.getLengthUnits(fontSize);\\n if (fontSize && 'px' == sizeUnits) {\\n // NOTE(user): This could be parseFloat instead, but IE doesn't return\\n // decimal fractions in getStyle_ and Firefox reports the fractions, but\\n // ignores them when rendering. Interestingly enough, when we force the\\n // issue and size something to e.g., 50% of 25px, the browsers round in\\n // opposite directions with Firefox reporting 12px and IE 13px. I punt.\\n return parseInt(fontSize, 10);\\n }\\n\\n // In IE, we can convert absolute length units to a px value using\\n // goog.style.getIePixelValue_. Units defined in relation to a font size\\n // (em, ex) are applied relative to the element's parentNode and can also\\n // be converted.\\n if (goog.userAgent.IE) {\\n if (String(sizeUnits) in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_) {\\n return goog.style.getIePixelValue_(el, fontSize, 'left', 'pixelLeft');\\n } else if (\\n el.parentNode && el.parentNode.nodeType == goog.dom.NodeType.ELEMENT &&\\n String(sizeUnits) in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_) {\\n // Check the parent size - if it is the same it means the relative size\\n // value is inherited and we therefore don't want to count it twice. If\\n // it is different, this element either has explicit style or has a CSS\\n // rule applying to it.\\n var parentElement = /** @type {!Element} */ (el.parentNode);\\n var parentSize = goog.style.getStyle_(parentElement, 'fontSize');\\n return goog.style.getIePixelValue_(\\n parentElement, fontSize == parentSize ? '1em' : fontSize, 'left',\\n 'pixelLeft');\\n }\\n }\\n\\n // Sometimes we can't cleanly find the font size (some units relative to a\\n // node's parent's font size are difficult: %, smaller et al), so we create\\n // an invisible, absolutely-positioned span sized to be the height of an 'M'\\n // rendered in its parent's (i.e., our target element's) font size. This is\\n // the definition of CSS's font size attribute.\\n var sizeElement = goog.dom.createDom(goog.dom.TagName.SPAN, {\\n 'style': 'visibility:hidden;position:absolute;' +\\n 'line-height:0;padding:0;margin:0;border:0;height:1em;'\\n });\\n goog.dom.appendChild(el, sizeElement);\\n fontSize = sizeElement.offsetHeight;\\n goog.dom.removeNode(sizeElement);\\n\\n return fontSize;\\n};\\n\\n\\n/**\\n * Parses a style attribute value. Converts CSS property names to camel case.\\n * @param {string} value The style attribute value.\\n * @return {!Object} Map of CSS properties to string values.\\n */\\ngoog.style.parseStyleAttribute = function(value) {\\n 'use strict';\\n var result = {};\\n value.split(/\\\\s*;\\\\s*/).forEach(function(pair) {\\n 'use strict';\\n var keyValue = pair.match(/\\\\s*([\\\\w-]+)\\\\s*:(.+)/);\\n if (keyValue) {\\n var styleName = keyValue[1];\\n var styleValue = goog.string.trim(keyValue[2]);\\n result[goog.string.toCamelCase(styleName.toLowerCase())] = styleValue;\\n }\\n });\\n return result;\\n};\\n\\n\\n/**\\n * Reverse of parseStyleAttribute; that is, takes a style object and returns the\\n * corresponding attribute value. Converts camel case property names to proper\\n * CSS selector names.\\n * @param {Object} obj Map of CSS properties to values.\\n * @return {string} The style attribute value.\\n */\\ngoog.style.toStyleAttribute = function(obj) {\\n 'use strict';\\n var buffer = [];\\n goog.object.forEach(obj, function(value, key) {\\n 'use strict';\\n buffer.push(goog.string.toSelectorCase(key), ':', value, ';');\\n });\\n return buffer.join('');\\n};\\n\\n\\n/**\\n * Sets CSS float property on an element.\\n * @param {Element} el The element to set float property on.\\n * @param {string} value The value of float CSS property to set on this element.\\n */\\ngoog.style.setFloat = function(el, value) {\\n 'use strict';\\n el.style[goog.userAgent.IE ? 'styleFloat' : 'cssFloat'] = value;\\n};\\n\\n\\n/**\\n * Gets value of explicitly-set float CSS property on an element.\\n * @param {Element} el The element to get float property of.\\n * @return {string} The value of explicitly-set float CSS property on this\\n * element.\\n */\\ngoog.style.getFloat = function(el) {\\n 'use strict';\\n return el.style[goog.userAgent.IE ? 'styleFloat' : 'cssFloat'] || '';\\n};\\n\\n\\n/**\\n * Returns the scroll bar width (represents the width of both horizontal\\n * and vertical scroll).\\n *\\n * @param {string=} opt_className An optional class name (or names) to apply\\n * to the invisible div created to measure the scrollbar. This is necessary\\n * if some scrollbars are styled differently than others.\\n * @return {number} The scroll bar width in px.\\n */\\ngoog.style.getScrollbarWidth = function(opt_className) {\\n 'use strict';\\n // Add two hidden divs. The child div is larger than the parent and\\n // forces scrollbars to appear on it.\\n // Using overflow:scroll does not work consistently with scrollbars that\\n // are styled with ::-webkit-scrollbar.\\n var outerDiv = goog.dom.createElement(goog.dom.TagName.DIV);\\n if (opt_className) {\\n outerDiv.className = opt_className;\\n }\\n outerDiv.style.cssText = 'overflow:auto;' +\\n 'position:absolute;top:0;width:100px;height:100px';\\n var innerDiv = goog.dom.createElement(goog.dom.TagName.DIV);\\n goog.style.setSize(innerDiv, '200px', '200px');\\n outerDiv.appendChild(innerDiv);\\n goog.dom.appendChild(goog.dom.getDocument().body, outerDiv);\\n var width = outerDiv.offsetWidth - outerDiv.clientWidth;\\n goog.dom.removeNode(outerDiv);\\n return width;\\n};\\n\\n\\n/**\\n * Regular expression to extract x and y translation components from a CSS\\n * transform Matrix representation.\\n *\\n * @type {!RegExp}\\n * @const\\n * @private\\n */\\ngoog.style.MATRIX_TRANSLATION_REGEX_ = new RegExp(\\n 'matrix\\\\\\\\([0-9\\\\\\\\.\\\\\\\\-]+, [0-9\\\\\\\\.\\\\\\\\-]+, ' +\\n '[0-9\\\\\\\\.\\\\\\\\-]+, [0-9\\\\\\\\.\\\\\\\\-]+, ' +\\n '([0-9\\\\\\\\.\\\\\\\\-]+)p?x?, ([0-9\\\\\\\\.\\\\\\\\-]+)p?x?\\\\\\\\)');\\n\\n\\n/**\\n * Returns the x,y translation component of any CSS transforms applied to the\\n * element, in pixels.\\n *\\n * @param {!Element} element The element to get the translation of.\\n * @return {!goog.math.Coordinate} The CSS translation of the element in px.\\n */\\ngoog.style.getCssTranslation = function(element) {\\n 'use strict';\\n var transform = goog.style.getComputedTransform(element);\\n if (!transform) {\\n return new goog.math.Coordinate(0, 0);\\n }\\n var matches = transform.match(goog.style.MATRIX_TRANSLATION_REGEX_);\\n if (!matches) {\\n return new goog.math.Coordinate(0, 0);\\n }\\n return new goog.math.Coordinate(\\n parseFloat(matches[1]), parseFloat(matches[2]));\\n};\\n\"],\n\"names\":[\"goog\",\"provide\",\"require\",\"requireType\",\"style\",\"setStyle\",\"goog.style.setStyle\",\"element\",\"opt_value\",\"setStyle_\",\"key\",\"goog.style.setStyle_\",\"value\",\"propertyName\",\"getVendorJsStyleName_\",\"styleNameCache_\",\"goog.style.getVendorJsStyleName_\",\"camelStyle\",\"string\",\"toCamelCase\",\"undefined\",\"prefixedStyle\",\"dom\",\"vendor\",\"getVendorJsPrefix\",\"toTitleCase\",\"getVendorStyleName_\",\"goog.style.getVendorStyleName_\",\"getVendorPrefix\",\"getStyle\",\"goog.style.getStyle\",\"property\",\"styleValue\",\"getComputedStyle\",\"goog.style.getComputedStyle\",\"doc\",\"getOwnerDocument\",\"defaultView\",\"styles\",\"getPropertyValue\",\"getCascadedStyle\",\"goog.style.getCascadedStyle\",\"currentStyle\",\"getStyle_\",\"goog.style.getStyle_\",\"getComputedBoxSizing\",\"goog.style.getComputedBoxSizing\",\"getComputedPosition\",\"goog.style.getComputedPosition\",\"getBackgroundColor\",\"goog.style.getBackgroundColor\",\"getComputedOverflowX\",\"goog.style.getComputedOverflowX\",\"getComputedOverflowY\",\"goog.style.getComputedOverflowY\",\"getComputedZIndex\",\"goog.style.getComputedZIndex\",\"getComputedTextAlign\",\"goog.style.getComputedTextAlign\",\"getComputedCursor\",\"goog.style.getComputedCursor\",\"getComputedTransform\",\"goog.style.getComputedTransform\",\"setPosition\",\"goog.style.setPosition\",\"el\",\"arg1\",\"opt_arg2\",\"x\",\"y\",\"math\",\"Coordinate\",\"left\",\"getPixelStyleValue_\",\"top\",\"getPosition\",\"goog.style.getPosition\",\"offsetLeft\",\"offsetTop\",\"getClientViewportElement\",\"goog.style.getClientViewportElement\",\"opt_node\",\"getDocument\",\"userAgent\",\"IE\",\"isDocumentModeOrHigher\",\"getDomHelper\",\"isCss1CompatMode\",\"body\",\"documentElement\",\"getViewportPageOffset\",\"goog.style.getViewportPageOffset\",\"scrollLeft\",\"scrollTop\",\"getBoundingClientRect_\",\"goog.style.getBoundingClientRect_\",\"getBoundingClientRect\",\"e\",\"getOffsetParent\",\"goog.style.getOffsetParent\",\"asserts\",\"assert\",\"offsetParent\",\"positionStyle\",\"skipStatic\",\"parent\",\"parentNode\",\"nodeType\",\"NodeType\",\"DOCUMENT_FRAGMENT\",\"host\",\"scrollWidth\",\"clientWidth\",\"scrollHeight\",\"clientHeight\",\"getVisibleRectForElement\",\"goog.style.getVisibleRectForElement\",\"visibleRect\",\"Box\",\"Infinity\",\"scrollEl\",\"getDocumentScrollElement\",\"WEBKIT\",\"pos\",\"getPageOffset\",\"client\",\"getClientLeftTop\",\"Math\",\"max\",\"right\",\"min\",\"bottom\",\"scrollX\",\"scrollY\",\"winSize\",\"getViewportSize\",\"width\",\"height\",\"getContainerOffsetToScrollInto\",\"goog.style.getContainerOffsetToScrollInto\",\"opt_container\",\"opt_center\",\"container\",\"elementPos\",\"containerPos\",\"containerBorder\",\"getBorderBox\",\"relX\",\"relY\",\"elementSize\",\"getSizeWithDisplay_\",\"spaceX\",\"spaceY\",\"scrollIntoContainerView\",\"goog.style.scrollIntoContainerView\",\"offset\",\"goog.style.getClientLeftTop\",\"clientLeft\",\"clientTop\",\"goog.style.getPageOffset\",\"assertObject\",\"viewportElement\",\"box\",\"scrollCoord\",\"getDocumentScroll\",\"getPageOffsetLeft\",\"goog.style.getPageOffsetLeft\",\"getPageOffsetTop\",\"goog.style.getPageOffsetTop\",\"getFramedPageOffset\",\"goog.style.getFramedPageOffset\",\"relativeWin\",\"position\",\"currentWin\",\"getWindow\",\"reflect\",\"canAccessProperty\",\"currentEl\",\"getClientPositionForElement_\",\"frameElement\",\"translateRectForAnotherFrame\",\"goog.style.translateRectForAnotherFrame\",\"rect\",\"origBase\",\"newBase\",\"difference\",\"getRelativePosition\",\"goog.style.getRelativePosition\",\"a\",\"b\",\"ap\",\"getClientPosition\",\"bp\",\"goog.style.getClientPositionForElement_\",\"goog.style.getClientPosition\",\"ELEMENT\",\"targetEvent\",\"changedTouches\",\"clientX\",\"clientY\",\"setPageOffset\",\"goog.style.setPageOffset\",\"opt_y\",\"cur\",\"dx\",\"assertNumber\",\"dy\",\"Number\",\"setSize\",\"goog.style.setSize\",\"w\",\"opt_h\",\"h\",\"Size\",\"Error\",\"setWidth\",\"setHeight\",\"goog.style.getPixelStyleValue_\",\"round\",\"goog.style.setHeight\",\"goog.style.setWidth\",\"getSize\",\"goog.style.getSize\",\"evaluateWithTemporaryDisplay_\",\"goog.style.evaluateWithTemporaryDisplay_\",\"fn\",\"originalDisplay\",\"display\",\"originalVisibility\",\"visibility\",\"originalPosition\",\"retVal\",\"goog.style.getSizeWithDisplay_\",\"offsetWidth\",\"offsetHeight\",\"webkitOffsetsZero\",\"clientRect\",\"getTransformedSize\",\"goog.style.getTransformedSize\",\"getBounds\",\"goog.style.getBounds\",\"o\",\"s\",\"Rect\",\"goog.style.toCamelCase\",\"selector\",\"String\",\"toSelectorCase\",\"goog.style.toSelectorCase\",\"getOpacity\",\"goog.style.getOpacity\",\"result\",\"opacity\",\"MozOpacity\",\"match\",\"filter\",\"setOpacity\",\"goog.style.setOpacity\",\"alpha\",\"setTransparentBackgroundImage\",\"goog.style.setTransparentBackgroundImage\",\"src\",\"backgroundImage\",\"backgroundPosition\",\"backgroundRepeat\",\"clearTransparentBackgroundImage\",\"goog.style.clearTransparentBackgroundImage\",\"showElement\",\"goog.style.showElement\",\"setElementShown\",\"goog.style.setElementShown\",\"isShown\",\"isElementShown\",\"goog.style.isElementShown\",\"installSafeStyleSheet\",\"goog.style.installSafeStyleSheet\",\"safeStyleSheet\",\"dh\",\"createStyleSheet\",\"styleSheet\",\"setSafeStyleSheet\",\"head\",\"getElementsByTagNameAndClass\",\"TagName\",\"HEAD\",\"BODY\",\"createDom\",\"insertBefore\",\"STYLE\",\"nonce\",\"safe\",\"getStyleNonce\",\"setAttribute\",\"appendChild\",\"uninstallStyles\",\"goog.style.uninstallStyles\",\"node\",\"ownerNode\",\"owningElement\",\"removeNode\",\"goog.style.setSafeStyleSheet\",\"stylesString\",\"html\",\"SafeStyleSheet\",\"unwrap\",\"cssText\",\"global\",\"trustedTypes\",\"setTextContent\",\"innerHTML\",\"setPreWrap\",\"goog.style.setPreWrap\",\"GECKO\",\"whiteSpace\",\"setInlineBlock\",\"goog.style.setInlineBlock\",\"isRightToLeft\",\"goog.style.isRightToLeft\",\"unselectableStyle_\",\"EDGE\",\"isUnselectable\",\"goog.style.isUnselectable\",\"toLowerCase\",\"getAttribute\",\"setUnselectable\",\"goog.style.setUnselectable\",\"unselectable\",\"opt_noRecurse\",\"descendants\",\"getElementsByTagName\",\"name\",\"i\",\"descendant\",\"getBorderBoxSize\",\"goog.style.getBorderBoxSize\",\"setBorderBoxSize\",\"goog.style.setBorderBoxSize\",\"size\",\"setBoxSizingSize_\",\"getContentBoxSize\",\"goog.style.getContentBoxSize\",\"ieCurrentStyle\",\"boxSizing\",\"getIePixelValue_\",\"borderBoxSize\",\"paddingBox\",\"getPaddingBox\",\"borderBox\",\"setContentBoxSize\",\"goog.style.setContentBoxSize\",\"goog.style.setBoxSizingSize_\",\"MozBoxSizing\",\"WebkitBoxSizing\",\"goog.style.getIePixelValue_\",\"pixelName\",\"test\",\"parseInt\",\"oldStyleValue\",\"oldRuntimeValue\",\"runtimeStyle\",\"pixelValue\",\"getIePixelDistance_\",\"goog.style.getIePixelDistance_\",\"propName\",\"getBox_\",\"goog.style.getBox_\",\"stylePrefix\",\"parseFloat\",\"goog.style.getPaddingBox\",\"getMarginBox\",\"goog.style.getMarginBox\",\"ieBorderWidthKeywords_\",\"getIePixelBorder_\",\"goog.style.getIePixelBorder_\",\"prop\",\"goog.style.getBorderBox\",\"getFontFamily\",\"goog.style.getFontFamily\",\"font\",\"createTextRange\",\"contains\",\"range\",\"moveToElementText\",\"queryCommandValue\",\"fontsArray\",\"split\",\"length\",\"stripQuotes\",\"lengthUnitRegex_\",\"getLengthUnits\",\"goog.style.getLengthUnits\",\"units\",\"ABSOLUTE_CSS_LENGTH_UNITS_\",\"CONVERTIBLE_RELATIVE_CSS_UNITS_\",\"getFontSize\",\"goog.style.getFontSize\",\"fontSize\",\"sizeUnits\",\"parentElement\",\"parentSize\",\"sizeElement\",\"SPAN\",\"parseStyleAttribute\",\"goog.style.parseStyleAttribute\",\"forEach\",\"pair\",\"keyValue\",\"styleName\",\"trim\",\"toStyleAttribute\",\"goog.style.toStyleAttribute\",\"obj\",\"buffer\",\"object\",\"push\",\"join\",\"setFloat\",\"goog.style.setFloat\",\"getFloat\",\"goog.style.getFloat\",\"getScrollbarWidth\",\"goog.style.getScrollbarWidth\",\"opt_className\",\"outerDiv\",\"createElement\",\"DIV\",\"className\",\"innerDiv\",\"MATRIX_TRANSLATION_REGEX_\",\"RegExp\",\"getCssTranslation\",\"goog.style.getCssTranslation\",\"transform\",\"matches\"]\n}\n"]