UNPKG

tippy.js

Version:
1,583 lines (1,430 loc) 443 kB
// modules are defined as an array // [ module function, map of requires ] // // map of requires is short require name -> numeric require // // anything defined in a previous bundle is accessed via the // orig method which is the require for previous bundles // eslint-disable-next-line no-global-assign parcelRequire = (function(modules, cache, entry, globalName) { // Save the require from previous bundle to this closure if any var previousRequire = typeof parcelRequire === 'function' && parcelRequire var nodeRequire = typeof require === 'function' && require function newRequire(name, jumped) { if (!cache[name]) { if (!modules[name]) { // if we cannot find the module within our internal map or // cache jump to the current global require ie. the last bundle // that was added to the page. var currentRequire = typeof parcelRequire === 'function' && parcelRequire if (!jumped && currentRequire) { return currentRequire(name, true) } // If there are other bundles on this page the require from the // previous one is saved to 'previousRequire'. Repeat this as // many times as there are bundles until the module is found or // we exhaust the require chain. if (previousRequire) { return previousRequire(name, true) } // Try the node require function if it exists. if (nodeRequire && typeof name === 'string') { return nodeRequire(name) } var err = new Error("Cannot find module '" + name + "'") err.code = 'MODULE_NOT_FOUND' throw err } localRequire.resolve = resolve var module = (cache[name] = new newRequire.Module(name)) modules[name][0].call( module.exports, localRequire, module, module.exports, this ) } return cache[name].exports function localRequire(x) { return newRequire(localRequire.resolve(x)) } function resolve(x) { return modules[name][1][x] || x } } function Module(moduleName) { this.id = moduleName this.bundle = newRequire this.exports = {} } newRequire.isParcelRequire = true newRequire.Module = Module newRequire.modules = modules newRequire.cache = cache newRequire.parent = previousRequire newRequire.register = function(id, exports) { modules[id] = [ function(require, module) { module.exports = exports }, {} ] } for (var i = 0; i < entry.length; i++) { newRequire(entry[i]) } if (entry.length) { // Expose entry point to Node, AMD or browser globals // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js var mainExports = newRequire(entry[entry.length - 1]) // CommonJS if (typeof exports === 'object' && typeof module !== 'undefined') { module.exports = mainExports // RequireJS } else if (typeof define === 'function' && define.amd) { define(function() { return mainExports }) // <script> } else if (globalName) { this[globalName] = mainExports } } // Override the current require with this new one return newRequire })( { '../node_modules/parcel-bundler/src/builtins/bundle-url.js': [ function(require, module, exports) { var bundleURL = null function getBundleURLCached() { if (!bundleURL) { bundleURL = getBundleURL() } return bundleURL } function getBundleURL() { // Attempt to find the URL of the current script and use that as the base URL try { throw new Error() } catch (err) { var matches = ('' + err.stack).match( /(https?|file|ftp):\/\/[^)\n]+/g ) if (matches) { return getBaseURL(matches[0]) } } return '/' } function getBaseURL(url) { return ( ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/, '$1') + '/' ) } exports.getBundleURL = getBundleURLCached exports.getBaseURL = getBaseURL }, {} ], '../node_modules/parcel-bundler/src/builtins/css-loader.js': [ function(require, module, exports) { var bundle = require('./bundle-url') function updateLink(link) { var newLink = link.cloneNode() newLink.onload = function() { link.remove() } newLink.href = link.href.split('?')[0] + '?' + Date.now() link.parentNode.insertBefore(newLink, link.nextSibling) } var cssTimeout = null function reloadCSS() { if (cssTimeout) { return } cssTimeout = setTimeout(function() { var links = document.querySelectorAll('link[rel="stylesheet"]') for (var i = 0; i < links.length; i++) { if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) { updateLink(links[i]) } } cssTimeout = null }, 50) } module.exports = reloadCSS }, { './bundle-url': '../node_modules/parcel-bundler/src/builtins/bundle-url.js' } ], '../dist/tippy.css': [ function(require, module, exports) { var reloadCSS = require('_css_loader') module.hot.dispose(reloadCSS) module.hot.accept(reloadCSS) }, { _css_loader: '../node_modules/parcel-bundler/src/builtins/css-loader.js' } ], '../dist/themes/light.css': [ function(require, module, exports) { var reloadCSS = require('_css_loader') module.hot.dispose(reloadCSS) module.hot.accept(reloadCSS) }, { _css_loader: '../node_modules/parcel-bundler/src/builtins/css-loader.js' } ], '../dist/themes/translucent.css': [ function(require, module, exports) { var reloadCSS = require('_css_loader') module.hot.dispose(reloadCSS) module.hot.accept(reloadCSS) }, { _css_loader: '../node_modules/parcel-bundler/src/builtins/css-loader.js' } ], '../node_modules/normalize.css/normalize.css': [ function(require, module, exports) { var reloadCSS = require('_css_loader') module.hot.dispose(reloadCSS) module.hot.accept(reloadCSS) }, { _css_loader: '../node_modules/parcel-bundler/src/builtins/css-loader.js' } ], 'css/index.scss': [ function(require, module, exports) { var reloadCSS = require('_css_loader') module.hot.dispose(reloadCSS) module.hot.accept(reloadCSS) }, { _css_loader: '../node_modules/parcel-bundler/src/builtins/css-loader.js' } ], '../node_modules/focus-visible/dist/focus-visible.js': [ function(require, module, exports) { var define ;(function(global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define(factory) : factory() })(this, function() { 'use strict' /** * https://github.com/WICG/focus-visible */ function init() { var hadKeyboardEvent = true var hadFocusVisibleRecently = false var hadFocusVisibleRecentlyTimeout = null var inputTypesWhitelist = { text: true, search: true, url: true, tel: true, email: true, password: true, number: true, date: true, month: true, week: true, time: true, datetime: true, 'datetime-local': true } /** * Helper function for legacy browsers and iframes which sometimes focus * elements like document, body, and non-interactive SVG. * @param {Element} el */ function isValidFocusTarget(el) { if ( el && el !== document && el.nodeName !== 'HTML' && el.nodeName !== 'BODY' && 'classList' in el && 'contains' in el.classList ) { return true } return false } /** * Computes whether the given element should automatically trigger the * `focus-visible` class being added, i.e. whether it should always match * `:focus-visible` when focused. * @param {Element} el * @return {boolean} */ function focusTriggersKeyboardModality(el) { var type = el.type var tagName = el.tagName if ( tagName == 'INPUT' && inputTypesWhitelist[type] && !el.readOnly ) { return true } if (tagName == 'TEXTAREA' && !el.readOnly) { return true } if (el.isContentEditable) { return true } return false } /** * Add the `focus-visible` class to the given element if it was not added by * the author. * @param {Element} el */ function addFocusVisibleClass(el) { if (el.classList.contains('focus-visible')) { return } el.classList.add('focus-visible') el.setAttribute('data-focus-visible-added', '') } /** * Remove the `focus-visible` class from the given element if it was not * originally added by the author. * @param {Element} el */ function removeFocusVisibleClass(el) { if (!el.hasAttribute('data-focus-visible-added')) { return } el.classList.remove('focus-visible') el.removeAttribute('data-focus-visible-added') } /** * Treat `keydown` as a signal that the user is in keyboard modality. * Apply `focus-visible` to any current active element and keep track * of our keyboard modality state with `hadKeyboardEvent`. * @param {Event} e */ function onKeyDown(e) { if (isValidFocusTarget(document.activeElement)) { addFocusVisibleClass(document.activeElement) } hadKeyboardEvent = true } /** * If at any point a user clicks with a pointing device, ensure that we change * the modality away from keyboard. * This avoids the situation where a user presses a key on an already focused * element, and then clicks on a different element, focusing it with a * pointing device, while we still think we're in keyboard modality. * @param {Event} e */ function onPointerDown(e) { hadKeyboardEvent = false } /** * On `focus`, add the `focus-visible` class to the target if: * - the target received focus as a result of keyboard navigation, or * - the event target is an element that will likely require interaction * via the keyboard (e.g. a text box) * @param {Event} e */ function onFocus(e) { // Prevent IE from focusing the document or HTML element. if (!isValidFocusTarget(e.target)) { return } if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) { addFocusVisibleClass(e.target) } } /** * On `blur`, remove the `focus-visible` class from the target. * @param {Event} e */ function onBlur(e) { if (!isValidFocusTarget(e.target)) { return } if ( e.target.classList.contains('focus-visible') || e.target.hasAttribute('data-focus-visible-added') ) { // To detect a tab/window switch, we look for a blur event followed // rapidly by a visibility change. // If we don't see a visibility change within 100ms, it's probably a // regular focus change. hadFocusVisibleRecently = true window.clearTimeout(hadFocusVisibleRecentlyTimeout) hadFocusVisibleRecentlyTimeout = window.setTimeout(function() { hadFocusVisibleRecently = false window.clearTimeout(hadFocusVisibleRecentlyTimeout) }, 100) removeFocusVisibleClass(e.target) } } /** * If the user changes tabs, keep track of whether or not the previously * focused element had .focus-visible. * @param {Event} e */ function onVisibilityChange(e) { if (document.visibilityState == 'hidden') { // If the tab becomes active again, the browser will handle calling focus // on the element (Safari actually calls it twice). // If this tab change caused a blur on an element with focus-visible, // re-apply the class when the user switches back to the tab. if (hadFocusVisibleRecently) { hadKeyboardEvent = true } addInitialPointerMoveListeners() } } /** * Add a group of listeners to detect usage of any pointing devices. * These listeners will be added when the polyfill first loads, and anytime * the window is blurred, so that they are active when the window regains * focus. */ function addInitialPointerMoveListeners() { document.addEventListener('mousemove', onInitialPointerMove) document.addEventListener('mousedown', onInitialPointerMove) document.addEventListener('mouseup', onInitialPointerMove) document.addEventListener('pointermove', onInitialPointerMove) document.addEventListener('pointerdown', onInitialPointerMove) document.addEventListener('pointerup', onInitialPointerMove) document.addEventListener('touchmove', onInitialPointerMove) document.addEventListener('touchstart', onInitialPointerMove) document.addEventListener('touchend', onInitialPointerMove) } function removeInitialPointerMoveListeners() { document.removeEventListener('mousemove', onInitialPointerMove) document.removeEventListener('mousedown', onInitialPointerMove) document.removeEventListener('mouseup', onInitialPointerMove) document.removeEventListener('pointermove', onInitialPointerMove) document.removeEventListener('pointerdown', onInitialPointerMove) document.removeEventListener('pointerup', onInitialPointerMove) document.removeEventListener('touchmove', onInitialPointerMove) document.removeEventListener('touchstart', onInitialPointerMove) document.removeEventListener('touchend', onInitialPointerMove) } /** * When the polfyill first loads, assume the user is in keyboard modality. * If any event is received from a pointing device (e.g. mouse, pointer, * touch), turn off keyboard modality. * This accounts for situations where focus enters the page from the URL bar. * @param {Event} e */ function onInitialPointerMove(e) { // Work around a Safari quirk that fires a mousemove on <html> whenever the // window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯ if (e.target.nodeName.toLowerCase() === 'html') { return } hadKeyboardEvent = false removeInitialPointerMoveListeners() } document.addEventListener('keydown', onKeyDown, true) document.addEventListener('mousedown', onPointerDown, true) document.addEventListener('pointerdown', onPointerDown, true) document.addEventListener('touchstart', onPointerDown, true) document.addEventListener('focus', onFocus, true) document.addEventListener('blur', onBlur, true) document.addEventListener( 'visibilitychange', onVisibilityChange, true ) addInitialPointerMoveListeners() document.body.classList.add('js-focus-visible') } /** * Subscription when the DOM is ready * @param {Function} callback */ function onDOMReady(callback) { var loaded /** * Callback wrapper for check loaded state */ function load() { if (!loaded) { loaded = true callback() } } if (['interactive', 'complete'].indexOf(document.readyState) >= 0) { callback() } else { loaded = false document.addEventListener('DOMContentLoaded', load, false) window.addEventListener('load', load, false) } } if (typeof document !== 'undefined') { onDOMReady(init) } }) }, {} ], '../node_modules/hyperapp/src/index.js': [ function(require, module, exports) { 'use strict' Object.defineProperty(exports, '__esModule', { value: true }) exports.h = h exports.app = app function h(name, attributes) { var rest = [] var children = [] var length = arguments.length while (length-- > 2) rest.push(arguments[length]) while (rest.length) { var node = rest.pop() if (node && node.pop) { for (length = node.length; length--; ) { rest.push(node[length]) } } else if (node != null && node !== true && node !== false) { children.push(node) } } return typeof name === 'function' ? name(attributes || {}, children) : { nodeName: name, attributes: attributes || {}, children: children, key: attributes && attributes.key } } function app(state, actions, view, container) { var map = [].map var rootElement = (container && container.children[0]) || null var oldNode = rootElement && recycleElement(rootElement) var lifecycle = [] var skipRender var isRecycling = true var globalState = clone(state) var wiredActions = wireStateToActions([], globalState, clone(actions)) scheduleRender() return wiredActions function recycleElement(element) { return { nodeName: element.nodeName.toLowerCase(), attributes: {}, children: map.call(element.childNodes, function(element) { return element.nodeType === 3 // Node.TEXT_NODE ? element.nodeValue : recycleElement(element) }) } } function resolveNode(node) { return typeof node === 'function' ? resolveNode(node(globalState, wiredActions)) : node != null ? node : '' } function render() { skipRender = !skipRender var node = resolveNode(view) if (container && !skipRender) { rootElement = patch( container, rootElement, oldNode, (oldNode = node) ) } isRecycling = false while (lifecycle.length) lifecycle.pop()() } function scheduleRender() { if (!skipRender) { skipRender = true setTimeout(render) } } function clone(target, source) { var out = {} for (var i in target) out[i] = target[i] for (var i in source) out[i] = source[i] return out } function setPartialState(path, value, source) { var target = {} if (path.length) { target[path[0]] = path.length > 1 ? setPartialState(path.slice(1), value, source[path[0]]) : value return clone(source, target) } return value } function getPartialState(path, source) { var i = 0 while (i < path.length) { source = source[path[i++]] } return source } function wireStateToActions(path, state, actions) { for (var key in actions) { typeof actions[key] === 'function' ? (function(key, action) { actions[key] = function(data) { var result = action(data) if (typeof result === 'function') { result = result( getPartialState(path, globalState), actions ) } if ( result && result !== (state = getPartialState(path, globalState)) && !result.then // !isPromise ) { scheduleRender( (globalState = setPartialState( path, clone(state, result), globalState )) ) } return result } })(key, actions[key]) : wireStateToActions( path.concat(key), (state[key] = clone(state[key])), (actions[key] = clone(actions[key])) ) } return actions } function getKey(node) { return node ? node.key : null } function eventListener(event) { return event.currentTarget.events[event.type](event) } function updateAttribute(element, name, value, oldValue, isSvg) { if (name === 'key') { } else if (name === 'style') { for (var i in clone(oldValue, value)) { var style = value == null || value[i] == null ? '' : value[i] if (i[0] === '-') { element[name].setProperty(i, style) } else { element[name][i] = style } } } else { if (name[0] === 'o' && name[1] === 'n') { name = name.slice(2) if (element.events) { if (!oldValue) oldValue = element.events[name] } else { element.events = {} } element.events[name] = value if (value) { if (!oldValue) { element.addEventListener(name, eventListener) } } else { element.removeEventListener(name, eventListener) } } else if ( name in element && name !== 'list' && name !== 'type' && name !== 'draggable' && name !== 'spellcheck' && name !== 'translate' && !isSvg ) { element[name] = value == null ? '' : value } else if (value != null && value !== false) { element.setAttribute(name, value) } if (value == null || value === false) { element.removeAttribute(name) } } } function createElement(node, isSvg) { var element = typeof node === 'string' || typeof node === 'number' ? document.createTextNode(node) : (isSvg = isSvg || node.nodeName === 'svg') ? document.createElementNS( 'http://www.w3.org/2000/svg', node.nodeName ) : document.createElement(node.nodeName) var attributes = node.attributes if (attributes) { if (attributes.oncreate) { lifecycle.push(function() { attributes.oncreate(element) }) } for (var i = 0; i < node.children.length; i++) { element.appendChild( createElement( (node.children[i] = resolveNode(node.children[i])), isSvg ) ) } for (var name in attributes) { updateAttribute(element, name, attributes[name], null, isSvg) } } return element } function updateElement(element, oldAttributes, attributes, isSvg) { for (var name in clone(oldAttributes, attributes)) { if ( attributes[name] !== (name === 'value' || name === 'checked' ? element[name] : oldAttributes[name]) ) { updateAttribute( element, name, attributes[name], oldAttributes[name], isSvg ) } } var cb = isRecycling ? attributes.oncreate : attributes.onupdate if (cb) { lifecycle.push(function() { cb(element, oldAttributes) }) } } function removeChildren(element, node) { var attributes = node.attributes if (attributes) { for (var i = 0; i < node.children.length; i++) { removeChildren(element.childNodes[i], node.children[i]) } if (attributes.ondestroy) { attributes.ondestroy(element) } } return element } function removeElement(parent, element, node) { function done() { parent.removeChild(removeChildren(element, node)) } var cb = node.attributes && node.attributes.onremove if (cb) { cb(element, done) } else { done() } } function patch(parent, element, oldNode, node, isSvg) { if (node === oldNode) { } else if (oldNode == null || oldNode.nodeName !== node.nodeName) { var newElement = createElement(node, isSvg) parent.insertBefore(newElement, element) if (oldNode != null) { removeElement(parent, element, oldNode) } element = newElement } else if (oldNode.nodeName == null) { element.nodeValue = node } else { updateElement( element, oldNode.attributes, node.attributes, (isSvg = isSvg || node.nodeName === 'svg') ) var oldKeyed = {} var newKeyed = {} var oldElements = [] var oldChildren = oldNode.children var children = node.children for (var i = 0; i < oldChildren.length; i++) { oldElements[i] = element.childNodes[i] var oldKey = getKey(oldChildren[i]) if (oldKey != null) { oldKeyed[oldKey] = [oldElements[i], oldChildren[i]] } } var i = 0 var k = 0 while (k < children.length) { var oldKey = getKey(oldChildren[i]) var newKey = getKey((children[k] = resolveNode(children[k]))) if (newKeyed[oldKey]) { i++ continue } if (newKey != null && newKey === getKey(oldChildren[i + 1])) { if (oldKey == null) { removeElement(element, oldElements[i], oldChildren[i]) } i++ continue } if (newKey == null || isRecycling) { if (oldKey == null) { patch( element, oldElements[i], oldChildren[i], children[k], isSvg ) k++ } i++ } else { var keyedNode = oldKeyed[newKey] || [] if (oldKey === newKey) { patch( element, keyedNode[0], keyedNode[1], children[k], isSvg ) i++ } else if (keyedNode[0]) { patch( element, element.insertBefore(keyedNode[0], oldElements[i]), keyedNode[1], children[k], isSvg ) } else { patch(element, oldElements[i], null, children[k], isSvg) } newKeyed[newKey] = children[k] k++ } } while (i < oldChildren.length) { if (getKey(oldChildren[i]) == null) { removeElement(element, oldElements[i], oldChildren[i]) } i++ } for (var i in oldKeyed) { if (!newKeyed[i]) { removeElement(element, oldKeyed[i][0], oldKeyed[i][1]) } } } return element } } }, {} ], '../node_modules/@hyperapp/render/browser/module.js': [ function(require, module, exports) { 'use strict' Object.defineProperty(exports, '__esModule', { value: true }) /*! Hyperapp Render | MIT Licence | https://github.com/hyperapp/render */ var styleNameCache = new Map() var uppercasePattern = /([A-Z])/g var msPattern = /^ms-/ var voidElements = new Set([ 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr' ]) var ignoreAttributes = new Set(['key', 'innerHTML', '__source']) var escapeRegExp = /["&'<>]/g var escapeLookup = new Map([ ['"', '&quot;'], ['&', '&amp;'], ["'", '&#39;'], ['<', '&lt;'], ['>', '&gt;'] ]) function escaper(match) { return escapeLookup.get(match) } function escapeHtml(value) { if (typeof value === 'number') { return '' + value } return ('' + value).replace(escapeRegExp, escaper) } function hyphenateStyleName(styleName) { return ( styleNameCache.get(styleName) || styleNameCache .set( styleName, styleName .replace(uppercasePattern, '-$&') .toLowerCase() .replace(msPattern, '-ms-') ) .get(styleName) ) } function stringifyStyles(styles) { var out = '' var delimiter = '' var styleNames = Object.keys(styles) for (var i = 0; i < styleNames.length; i++) { var styleName = styleNames[i] var styleValue = styles[styleName] if (styleValue != null) { if (styleName === 'cssText') { out += delimiter + styleValue } else { out += delimiter + hyphenateStyleName(styleName) + ':' + styleValue } delimiter = ';' } } return out || null } function renderFragment(_ref, stack) { var nodeName = _ref.nodeName, attributes = _ref.attributes, children = _ref.children var out = '' var footer = '' if (nodeName) { out += '<' + nodeName var keys = Object.keys(attributes) for (var i = 0; i < keys.length; i++) { var name = keys[i] var value = attributes[name] if (name === 'style' && value && typeof value === 'object') { value = stringifyStyles(value) } if ( value != null && value !== false && typeof value !== 'function' && !ignoreAttributes.has(name) ) { out += ' ' + name if (value !== true) { out += '="' + escapeHtml(value) + '"' } } } if (voidElements.has(nodeName)) { out += '/>' } else { out += '>' footer = '</' + nodeName + '>' } } var innerHTML = attributes.innerHTML if (innerHTML != null) { out += innerHTML } if (children.length > 0) { stack.push({ childIndex: 0, children: children, footer: footer }) } else { out += footer } return out } function resolveNode(node, state, actions) { if (typeof node === 'function') { return resolveNode(node(state, actions), state, actions) } return node } function renderer(view, state, actions) { var stack = [ { childIndex: 0, children: [view], footer: '' } ] var end = false return function(bytes) { if (end) { return null } var out = '' while (out.length < bytes) { if (stack.length === 0) { end = true break } var frame = stack[stack.length - 1] if (frame.childIndex >= frame.children.length) { out += frame.footer stack.pop() } else { var node = resolveNode( frame.children[frame.childIndex++], state, actions ) if (node != null && typeof node !== 'boolean') { if (node.pop) { stack.push({ childIndex: 0, children: node, footer: '' }) } else if (node.attributes) { out += renderFragment(node, stack) } else { out += escapeHtml(node) } } } } return out } } function renderToString(view, state, actions) { return renderer(view, state, actions)(Infinity) } function withRender(nextApp) { return function(initialState, actionsTemplate, view, container) { var actions = nextApp( initialState, Object.assign({}, actionsTemplate, { getState: function getState() { return function(state) { return state } } }), view, container ) actions.toString = function() { return renderToString(view, actions.getState(), actions) } return actions } } exports.renderToString = renderToString exports.withRender = withRender //# sourceMappingURL=module.js.map }, {} ], '../node_modules/animejs/anime.min.js': [ function(require, module, exports) { var global = arguments[3] var define /* 2017 Julian Garnier Released under the MIT license */ var $jscomp = { scope: {} } $jscomp.defineProperty = 'function' == typeof Object.defineProperties ? Object.defineProperty : function(e, r, p) { if (p.get || p.set) throw new TypeError( 'ES3 does not support getters and setters.' ) e != Array.prototype && e != Object.prototype && (e[r] = p.value) } $jscomp.getGlobal = function(e) { return 'undefined' != typeof window && window === e ? e : 'undefined' != typeof global && null != global ? global : e } $jscomp.global = $jscomp.getGlobal(this) $jscomp.SYMBOL_PREFIX = 'jscomp_symbol_' $jscomp.initSymbol = function() { $jscomp.initSymbol = function() {} $jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol) } $jscomp.symbolCounter_ = 0 $jscomp.Symbol = function(e) { return $jscomp.SYMBOL_PREFIX + (e || '') + $jscomp.symbolCounter_++ } $jscomp.initSymbolIterator = function() { $jscomp.initSymbol() var e = $jscomp.global.Symbol.iterator e || (e = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol( 'iterator' )) 'function' != typeof Array.prototype[e] && $jscomp.defineProperty(Array.prototype, e, { configurable: !0, writable: !0, value: function() { return $jscomp.arrayIterator(this) } }) $jscomp.initSymbolIterator = function() {} } $jscomp.arrayIterator = function(e) { var r = 0 return $jscomp.iteratorPrototype(function() { return r < e.length ? { done: !1, value: e[r++] } : { done: !0 } }) } $jscomp.iteratorPrototype = function(e) { $jscomp.initSymbolIterator() e = { next: e } e[$jscomp.global.Symbol.iterator] = function() { return this } return e } $jscomp.array = $jscomp.array || {} $jscomp.iteratorFromArray = function(e, r) { $jscomp.initSymbolIterator() e instanceof String && (e += '') var p = 0, m = { next: function() { if (p < e.length) { var u = p++ return { value: r(u, e[u]), done: !1 } } m.next = function() { return { done: !0, value: void 0 } } return m.next() } } m[Symbol.iterator] = function() { return m } return m } $jscomp.polyfill = function(e, r, p, m) { if (r) { p = $jscomp.global e = e.split('.') for (m = 0; m < e.length - 1; m++) { var u = e[m] u in p || (p[u] = {}) p = p[u] } e = e[e.length - 1] m = p[e] r = r(m) r != m && null != r && $jscomp.defineProperty(p, e, { configurable: !0, writable: !0, value: r }) } } $jscomp.polyfill( 'Array.prototype.keys', function(e) { return e ? e : function() { return $jscomp.iteratorFromArray(this, function(e) { return e }) } }, 'es6-impl', 'es3' ) var $jscomp$this = this ;(function(e, r) { 'function' === typeof define && define.amd ? define([], r) : 'object' === typeof module && module.exports ? (module.exports = r()) : (e.anime = r()) })(this, function() { function e(a) { if (!h.col(a)) try { return document.querySelectorAll(a) } catch (c) {} } function r(a, c) { for ( var d = a.length, b = 2 <= arguments.length ? arguments[1] : void 0, f = [], n = 0; n < d; n++ ) if (n in a) { var k = a[n] c.call(b, k, n, a) && f.push(k) } return f } function p(a) { return a.reduce(function(a, d) { return a.concat(h.arr(d) ? p(d) : d) }, []) } function m(a) { if (h.arr(a)) return a h.str(a) && (a = e(a) || a) return a instanceof NodeList || a instanceof HTMLCollection ? [].slice.call(a) : [a] } function u(a, c) { return a.some(function(a) { return a === c }) } function C(a) { var c = {}, d for (d in a) c[d] = a[d] return c } function D(a, c) { var d = C(a), b for (b in a) d[b] = c.hasOwnProperty(b) ? c[b] : a[b] return d } function z(a, c) { var d = C(a), b for (b in c) d[b] = h.und(a[b]) ? c[b] : a[b] return d } function T(a) { a = a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function( a, c, d, k ) { return c + c + d + d + k + k }) var c = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a) a = parseInt(c[1], 16) var d = parseInt(c[2], 16), c = parseInt(c[3], 16) return 'rgba(' + a + ',' + d + ',' + c + ',1)' } function U(a) { function c(a, c, b) { 0 > b && (b += 1) 1 < b && --b return b < 1 / 6 ? a + 6 * (c - a) * b : 0.5 > b ? c : b < 2 / 3 ? a + (c - a) * (2 / 3 - b) * 6 : a } var d = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a) a = parseInt(d[1]) / 360 var b = parseInt(d[2]) / 100, f = parseInt(d[3]) / 100, d = d[4] || 1 if (0 == b) f = b = a = f else { var n = 0.5 > f ? f * (1 + b) : f + b - f * b, k = 2 * f - n, f = c(k, n, a + 1 / 3), b = c(k, n, a) a = c(k, n, a - 1 / 3) } return ( 'rgba(' + 255 * f + ',' + 255 * b + ',' + 255 * a + ',' + d + ')' ) } function y(a) { if ( (a = /([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec( a )) ) return a[2] } function V(a) { if (-1 < a.indexOf('translate') || 'perspective' === a) return 'px' if (-1 < a.indexOf('rotate') || -1 < a.indexOf('skew')) return 'deg' } function I(a, c) { return h.fnc(a) ? a(c.target, c.id, c.total) : a } function E(a, c) { if (c in a.style) return ( getComputedStyle(a).getPropertyValue( c.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() ) || '0' ) } function J(a, c) { if (h.dom(a) && u(W, c)) return 'transform' if (h.dom(a) && (a.getAttribute(c) || (h.svg(a) && a[c]))) return 'attribute' if (h.dom(a) && 'transform' !== c && E(a, c)) return 'css' if (null != a[c]) return 'object' } function X(a, c) { var d = V(c), d = -1 < c.indexOf('scale') ? 1 : 0 + d a = a.style.transform if (!a) return d for ( var b = [], f = [], n = [], k = /(\w+)\((.+?)\)/g; (b = k.exec(a)); ) f.push(b[1]), n.push(b[2]) a = r(n, function(a, b) { return f[b] === c }) return a.length ? a[0] : d } function K(a, c) { switch (J(a, c)) { case 'transform': return X(a, c) case 'css': return E(a, c) case 'attribute': return a.getAttribute(c) } return a[c] || 0 } function L(a, c) { var d = /^(\*=|\+=|-=)/.exec(a) if (!d) return a var b = y(a) || 0 c = parseFloat(c) a = parseFloat(a.replace(d[0], '')) switch (d[0][0]) { case '+': return c + a + b case '-': return c - a + b case '*': return c * a + b } } function F(a, c) { return Math.sqrt(Math.pow(c.x - a.x, 2) + Math.pow(c.y - a.y, 2)) } function M(a) { a = a.points for (var c = 0, d, b = 0; b < a.numberOfItems; b++) { var f = a.getItem(b) 0 < b && (c += F(d, f)) d = f } return c } function N(a) { if (a.getTotalLength) return a.getTotalLength() switch (a.tagName.toLowerCase()) { case 'circle': return 2 * Math.PI * a.getAttribute('r') case 'rect': return ( 2 * a.getAttribute('width') + 2 * a.getAttribute('height') ) case 'line': return F( { x: a.getAttribute('x1'), y: a.getAttribute('y1') }, { x: a.getAttribute('x2'), y: a.getAttribute('y2') } ) case 'polyline': return M(a) case 'polygon': var c = a.points return M(a) + F(c.getItem(c.numberOfItems - 1), c.getItem(0)) } } function Y(a, c) { function d(b) { b = void 0 === b ? 0 : b return a.el.getPointAtLength(1 <= c + b ? c + b : 0) } var b = d(), f = d(-1), n = d(1) switch (a.property) { case 'x': return b.x case 'y': return b.y case 'angle': return (180 * Math.atan2(n.y - f.y, n.x - f.x)) / Math.PI } } function O(a, c) { var d = /-?\d*\.?\d+/g, b b = h.pth(a) ? a.totalLength : a if (h.col(b)) if (h.rgb(b)) { var f = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b) b = f ? 'rgba(' + f[1] + ',1)' : b