--- a/src/iconolab/static/iconolab/js/iconolab.js Thu Feb 23 11:55:02 2017 +0100
+++ b/src/iconolab/static/iconolab/js/iconolab.js Thu Feb 23 11:55:36 2017 +0100
@@ -1,49705 +1,32 @@
-/******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId])
-/******/ return installedModules[moduleId].exports;
-/******/
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ exports: {},
-/******/ id: moduleId,
-/******/ loaded: false
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.loaded = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "/static/";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ function(module, exports, __webpack_require__) {
-
- __webpack_require__(1);
- module.exports = __webpack_require__(155);
-
-
-/***/ },
-/* 1 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
-
- __webpack_require__(2);
-
- __webpack_require__(4);
-
- __webpack_require__(6);
-
- var _vueResource = __webpack_require__(7);
-
- var _vueResource2 = _interopRequireDefault(_vueResource);
-
- var _Typeahead = __webpack_require__(8);
-
- var _Typeahead2 = _interopRequireDefault(_Typeahead);
-
- var _cutout = __webpack_require__(78);
-
- var _cutout2 = _interopRequireDefault(_cutout);
-
- var _Zoomview = __webpack_require__(85);
-
- var _Zoomview2 = _interopRequireDefault(_Zoomview);
-
- var _MergeTool = __webpack_require__(88);
-
- var _MergeTool2 = _interopRequireDefault(_MergeTool);
-
- var _CollectionSelector = __webpack_require__(98);
-
- var _CollectionSelector2 = _interopRequireDefault(_CollectionSelector);
-
- var _TabSelector = __webpack_require__(100);
-
- var _TabSelector2 = _interopRequireDefault(_TabSelector);
-
- var _DescriptionViewer = __webpack_require__(102);
-
- var _DescriptionViewer2 = _interopRequireDefault(_DescriptionViewer);
-
- var _diffviewer = __webpack_require__(90);
-
- var _diffviewer2 = _interopRequireDefault(_diffviewer);
-
- var _jsondiffpatch = __webpack_require__(104);
-
- var _jsondiffpatch2 = _interopRequireDefault(_jsondiffpatch);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var Diff = __webpack_require__(139);
- Vue.config.ignoredElements = ["mask"];
- var iconolab = {
- Cutout: _cutout2.default,
- JsDiff: Diff,
- JsonDiff: _jsondiffpatch2.default,
- CollectionSelector: _CollectionSelector2.default,
- TabSelector: _TabSelector2.default,
- DescriptionViewer: _DescriptionViewer2.default,
- VueComponents: {
- Typeahead: _Typeahead2.default,
- MergeTool: _MergeTool2.default,
- Zoomview: _Zoomview2.default,
- DiffViewer: _diffviewer2.default
- }
- };
-
- if (!window.iconolab) {
- window.iconolab = iconolab;
- }
-
-/***/ },
-/* 2 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["Vue"] = __webpack_require__(3);
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
-
-/***/ },
-/* 3 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global) {/*!
- * Vue.js v2.1.10
- * (c) 2014-2017 Evan You
- * Released under the MIT License.
- */
- (function (global, factory) {
- true ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.Vue = factory());
- }(this, (function () { 'use strict';
-
- /* */
-
- /**
- * Convert a value to a string that is actually rendered.
- */
- function _toString (val) {
- return val == null
- ? ''
- : typeof val === 'object'
- ? JSON.stringify(val, null, 2)
- : String(val)
- }
-
- /**
- * Convert a input value to a number for persistence.
- * If the conversion fails, return original string.
- */
- function toNumber (val) {
- var n = parseFloat(val);
- return isNaN(n) ? val : n
- }
-
- /**
- * Make a map and return a function for checking if a key
- * is in that map.
- */
- function makeMap (
- str,
- expectsLowerCase
- ) {
- var map = Object.create(null);
- var list = str.split(',');
- for (var i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase
- ? function (val) { return map[val.toLowerCase()]; }
- : function (val) { return map[val]; }
- }
-
- /**
- * Check if a tag is a built-in tag.
- */
- var isBuiltInTag = makeMap('slot,component', true);
-
- /**
- * Remove an item from an array
- */
- function remove$1 (arr, item) {
- if (arr.length) {
- var index = arr.indexOf(item);
- if (index > -1) {
- return arr.splice(index, 1)
- }
- }
- }
-
- /**
- * Check whether the object has the property.
- */
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function hasOwn (obj, key) {
- return hasOwnProperty.call(obj, key)
- }
-
- /**
- * Check if value is primitive
- */
- function isPrimitive (value) {
- return typeof value === 'string' || typeof value === 'number'
- }
-
- /**
- * Create a cached version of a pure function.
- */
- function cached (fn) {
- var cache = Object.create(null);
- return (function cachedFn (str) {
- var hit = cache[str];
- return hit || (cache[str] = fn(str))
- })
- }
-
- /**
- * Camelize a hyphen-delimited string.
- */
- var camelizeRE = /-(\w)/g;
- var camelize = cached(function (str) {
- return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
- });
-
- /**
- * Capitalize a string.
- */
- var capitalize = cached(function (str) {
- return str.charAt(0).toUpperCase() + str.slice(1)
- });
-
- /**
- * Hyphenate a camelCase string.
- */
- var hyphenateRE = /([^-])([A-Z])/g;
- var hyphenate = cached(function (str) {
- return str
- .replace(hyphenateRE, '$1-$2')
- .replace(hyphenateRE, '$1-$2')
- .toLowerCase()
- });
-
- /**
- * Simple bind, faster than native
- */
- function bind$1 (fn, ctx) {
- function boundFn (a) {
- var l = arguments.length;
- return l
- ? l > 1
- ? fn.apply(ctx, arguments)
- : fn.call(ctx, a)
- : fn.call(ctx)
- }
- // record original fn length
- boundFn._length = fn.length;
- return boundFn
- }
-
- /**
- * Convert an Array-like object to a real Array.
- */
- function toArray (list, start) {
- start = start || 0;
- var i = list.length - start;
- var ret = new Array(i);
- while (i--) {
- ret[i] = list[i + start];
- }
- return ret
- }
-
- /**
- * Mix properties into target object.
- */
- function extend (to, _from) {
- for (var key in _from) {
- to[key] = _from[key];
- }
- return to
- }
-
- /**
- * Quick object check - this is primarily used to tell
- * Objects from primitive values when we know the value
- * is a JSON-compliant type.
- */
- function isObject (obj) {
- return obj !== null && typeof obj === 'object'
- }
-
- /**
- * Strict object type check. Only returns true
- * for plain JavaScript objects.
- */
- var toString = Object.prototype.toString;
- var OBJECT_STRING = '[object Object]';
- function isPlainObject (obj) {
- return toString.call(obj) === OBJECT_STRING
- }
-
- /**
- * Merge an Array of Objects into a single Object.
- */
- function toObject (arr) {
- var res = {};
- for (var i = 0; i < arr.length; i++) {
- if (arr[i]) {
- extend(res, arr[i]);
- }
- }
- return res
- }
-
- /**
- * Perform no operation.
- */
- function noop () {}
-
- /**
- * Always return false.
- */
- var no = function () { return false; };
-
- /**
- * Return same value
- */
- var identity = function (_) { return _; };
-
- /**
- * Generate a static keys string from compiler modules.
- */
- function genStaticKeys (modules) {
- return modules.reduce(function (keys, m) {
- return keys.concat(m.staticKeys || [])
- }, []).join(',')
- }
-
- /**
- * Check if two values are loosely equal - that is,
- * if they are plain objects, do they have the same shape?
- */
- function looseEqual (a, b) {
- var isObjectA = isObject(a);
- var isObjectB = isObject(b);
- if (isObjectA && isObjectB) {
- return JSON.stringify(a) === JSON.stringify(b)
- } else if (!isObjectA && !isObjectB) {
- return String(a) === String(b)
- } else {
- return false
- }
- }
-
- function looseIndexOf (arr, val) {
- for (var i = 0; i < arr.length; i++) {
- if (looseEqual(arr[i], val)) { return i }
- }
- return -1
- }
-
- /* */
-
- var config = {
- /**
- * Option merge strategies (used in core/util/options)
- */
- optionMergeStrategies: Object.create(null),
-
- /**
- * Whether to suppress warnings.
- */
- silent: false,
-
- /**
- * Whether to enable devtools
- */
- devtools: "development" !== 'production',
-
- /**
- * Error handler for watcher errors
- */
- errorHandler: null,
-
- /**
- * Ignore certain custom elements
- */
- ignoredElements: [],
-
- /**
- * Custom user key aliases for v-on
- */
- keyCodes: Object.create(null),
-
- /**
- * Check if a tag is reserved so that it cannot be registered as a
- * component. This is platform-dependent and may be overwritten.
- */
- isReservedTag: no,
-
- /**
- * Check if a tag is an unknown element.
- * Platform-dependent.
- */
- isUnknownElement: no,
-
- /**
- * Get the namespace of an element
- */
- getTagNamespace: noop,
-
- /**
- * Parse the real tag name for the specific platform.
- */
- parsePlatformTagName: identity,
-
- /**
- * Check if an attribute must be bound using property, e.g. value
- * Platform-dependent.
- */
- mustUseProp: no,
-
- /**
- * List of asset types that a component can own.
- */
- _assetTypes: [
- 'component',
- 'directive',
- 'filter'
- ],
-
- /**
- * List of lifecycle hooks.
- */
- _lifecycleHooks: [
- 'beforeCreate',
- 'created',
- 'beforeMount',
- 'mounted',
- 'beforeUpdate',
- 'updated',
- 'beforeDestroy',
- 'destroyed',
- 'activated',
- 'deactivated'
- ],
-
- /**
- * Max circular updates allowed in a scheduler flush cycle.
- */
- _maxUpdateCount: 100
- };
-
- /* */
-
- /**
- * Check if a string starts with $ or _
- */
- function isReserved (str) {
- var c = (str + '').charCodeAt(0);
- return c === 0x24 || c === 0x5F
- }
-
- /**
- * Define a property.
- */
- function def (obj, key, val, enumerable) {
- Object.defineProperty(obj, key, {
- value: val,
- enumerable: !!enumerable,
- writable: true,
- configurable: true
- });
- }
-
- /**
- * Parse simple path.
- */
- var bailRE = /[^\w.$]/;
- function parsePath (path) {
- if (bailRE.test(path)) {
- return
- } else {
- var segments = path.split('.');
- return function (obj) {
- for (var i = 0; i < segments.length; i++) {
- if (!obj) { return }
- obj = obj[segments[i]];
- }
- return obj
- }
- }
- }
-
- /* */
- /* globals MutationObserver */
-
- // can we use __proto__?
- var hasProto = '__proto__' in {};
-
- // Browser environment sniffing
- var inBrowser = typeof window !== 'undefined';
- var UA = inBrowser && window.navigator.userAgent.toLowerCase();
- var isIE = UA && /msie|trident/.test(UA);
- var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
- var isEdge = UA && UA.indexOf('edge/') > 0;
- var isAndroid = UA && UA.indexOf('android') > 0;
- var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
-
- // this needs to be lazy-evaled because vue may be required before
- // vue-server-renderer can set VUE_ENV
- var _isServer;
- var isServerRendering = function () {
- if (_isServer === undefined) {
- /* istanbul ignore if */
- if (!inBrowser && typeof global !== 'undefined') {
- // detect presence of vue-server-renderer and avoid
- // Webpack shimming the process
- _isServer = global['process'].env.VUE_ENV === 'server';
- } else {
- _isServer = false;
- }
- }
- return _isServer
- };
-
- // detect devtools
- var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
-
- /* istanbul ignore next */
- function isNative (Ctor) {
- return /native code/.test(Ctor.toString())
- }
-
- /**
- * Defer a task to execute it asynchronously.
- */
- var nextTick = (function () {
- var callbacks = [];
- var pending = false;
- var timerFunc;
-
- function nextTickHandler () {
- pending = false;
- var copies = callbacks.slice(0);
- callbacks.length = 0;
- for (var i = 0; i < copies.length; i++) {
- copies[i]();
- }
- }
-
- // the nextTick behavior leverages the microtask queue, which can be accessed
- // via either native Promise.then or MutationObserver.
- // MutationObserver has wider support, however it is seriously bugged in
- // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
- // completely stops working after triggering a few times... so, if native
- // Promise is available, we will use it:
- /* istanbul ignore if */
- if (typeof Promise !== 'undefined' && isNative(Promise)) {
- var p = Promise.resolve();
- var logError = function (err) { console.error(err); };
- timerFunc = function () {
- p.then(nextTickHandler).catch(logError);
- // in problematic UIWebViews, Promise.then doesn't completely break, but
- // it can get stuck in a weird state where callbacks are pushed into the
- // microtask queue but the queue isn't being flushed, until the browser
- // needs to do some other work, e.g. handle a timer. Therefore we can
- // "force" the microtask queue to be flushed by adding an empty timer.
- if (isIOS) { setTimeout(noop); }
- };
- } else if (typeof MutationObserver !== 'undefined' && (
- isNative(MutationObserver) ||
- // PhantomJS and iOS 7.x
- MutationObserver.toString() === '[object MutationObserverConstructor]'
- )) {
- // use MutationObserver where native Promise is not available,
- // e.g. PhantomJS IE11, iOS7, Android 4.4
- var counter = 1;
- var observer = new MutationObserver(nextTickHandler);
- var textNode = document.createTextNode(String(counter));
- observer.observe(textNode, {
- characterData: true
- });
- timerFunc = function () {
- counter = (counter + 1) % 2;
- textNode.data = String(counter);
- };
- } else {
- // fallback to setTimeout
- /* istanbul ignore next */
- timerFunc = function () {
- setTimeout(nextTickHandler, 0);
- };
- }
-
- return function queueNextTick (cb, ctx) {
- var _resolve;
- callbacks.push(function () {
- if (cb) { cb.call(ctx); }
- if (_resolve) { _resolve(ctx); }
- });
- if (!pending) {
- pending = true;
- timerFunc();
- }
- if (!cb && typeof Promise !== 'undefined') {
- return new Promise(function (resolve) {
- _resolve = resolve;
- })
- }
- }
- })();
-
- var _Set;
- /* istanbul ignore if */
- if (typeof Set !== 'undefined' && isNative(Set)) {
- // use native Set when available.
- _Set = Set;
- } else {
- // a non-standard Set polyfill that only works with primitive keys.
- _Set = (function () {
- function Set () {
- this.set = Object.create(null);
- }
- Set.prototype.has = function has (key) {
- return this.set[key] === true
- };
- Set.prototype.add = function add (key) {
- this.set[key] = true;
- };
- Set.prototype.clear = function clear () {
- this.set = Object.create(null);
- };
-
- return Set;
- }());
- }
-
- var warn = noop;
- var formatComponentName;
-
- {
- var hasConsole = typeof console !== 'undefined';
-
- warn = function (msg, vm) {
- if (hasConsole && (!config.silent)) {
- console.error("[Vue warn]: " + msg + " " + (
- vm ? formatLocation(formatComponentName(vm)) : ''
- ));
- }
- };
-
- formatComponentName = function (vm) {
- if (vm.$root === vm) {
- return 'root instance'
- }
- var name = vm._isVue
- ? vm.$options.name || vm.$options._componentTag
- : vm.name;
- return (
- (name ? ("component <" + name + ">") : "anonymous component") +
- (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
- )
- };
-
- var formatLocation = function (str) {
- if (str === 'anonymous component') {
- str += " - use the \"name\" option for better debugging messages.";
- }
- return ("\n(found in " + str + ")")
- };
- }
-
- /* */
-
-
- var uid$1 = 0;
-
- /**
- * A dep is an observable that can have multiple
- * directives subscribing to it.
- */
- var Dep = function Dep () {
- this.id = uid$1++;
- this.subs = [];
- };
-
- Dep.prototype.addSub = function addSub (sub) {
- this.subs.push(sub);
- };
-
- Dep.prototype.removeSub = function removeSub (sub) {
- remove$1(this.subs, sub);
- };
-
- Dep.prototype.depend = function depend () {
- if (Dep.target) {
- Dep.target.addDep(this);
- }
- };
-
- Dep.prototype.notify = function notify () {
- // stablize the subscriber list first
- var subs = this.subs.slice();
- for (var i = 0, l = subs.length; i < l; i++) {
- subs[i].update();
- }
- };
-
- // the current target watcher being evaluated.
- // this is globally unique because there could be only one
- // watcher being evaluated at any time.
- Dep.target = null;
- var targetStack = [];
-
- function pushTarget (_target) {
- if (Dep.target) { targetStack.push(Dep.target); }
- Dep.target = _target;
- }
-
- function popTarget () {
- Dep.target = targetStack.pop();
- }
-
- /*
- * not type checking this file because flow doesn't play well with
- * dynamically accessing methods on Array prototype
- */
-
- var arrayProto = Array.prototype;
- var arrayMethods = Object.create(arrayProto);[
- 'push',
- 'pop',
- 'shift',
- 'unshift',
- 'splice',
- 'sort',
- 'reverse'
- ]
- .forEach(function (method) {
- // cache original method
- var original = arrayProto[method];
- def(arrayMethods, method, function mutator () {
- var arguments$1 = arguments;
-
- // avoid leaking arguments:
- // http://jsperf.com/closure-with-arguments
- var i = arguments.length;
- var args = new Array(i);
- while (i--) {
- args[i] = arguments$1[i];
- }
- var result = original.apply(this, args);
- var ob = this.__ob__;
- var inserted;
- switch (method) {
- case 'push':
- inserted = args;
- break
- case 'unshift':
- inserted = args;
- break
- case 'splice':
- inserted = args.slice(2);
- break
- }
- if (inserted) { ob.observeArray(inserted); }
- // notify change
- ob.dep.notify();
- return result
- });
- });
-
- /* */
-
- var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
-
- /**
- * By default, when a reactive property is set, the new value is
- * also converted to become reactive. However when passing down props,
- * we don't want to force conversion because the value may be a nested value
- * under a frozen data structure. Converting it would defeat the optimization.
- */
- var observerState = {
- shouldConvert: true,
- isSettingProps: false
- };
-
- /**
- * Observer class that are attached to each observed
- * object. Once attached, the observer converts target
- * object's property keys into getter/setters that
- * collect dependencies and dispatches updates.
- */
- var Observer = function Observer (value) {
- this.value = value;
- this.dep = new Dep();
- this.vmCount = 0;
- def(value, '__ob__', this);
- if (Array.isArray(value)) {
- var augment = hasProto
- ? protoAugment
- : copyAugment;
- augment(value, arrayMethods, arrayKeys);
- this.observeArray(value);
- } else {
- this.walk(value);
- }
- };
-
- /**
- * Walk through each property and convert them into
- * getter/setters. This method should only be called when
- * value type is Object.
- */
- Observer.prototype.walk = function walk (obj) {
- var keys = Object.keys(obj);
- for (var i = 0; i < keys.length; i++) {
- defineReactive$$1(obj, keys[i], obj[keys[i]]);
- }
- };
-
- /**
- * Observe a list of Array items.
- */
- Observer.prototype.observeArray = function observeArray (items) {
- for (var i = 0, l = items.length; i < l; i++) {
- observe(items[i]);
- }
- };
-
- // helpers
-
- /**
- * Augment an target Object or Array by intercepting
- * the prototype chain using __proto__
- */
- function protoAugment (target, src) {
- /* eslint-disable no-proto */
- target.__proto__ = src;
- /* eslint-enable no-proto */
- }
-
- /**
- * Augment an target Object or Array by defining
- * hidden properties.
- */
- /* istanbul ignore next */
- function copyAugment (target, src, keys) {
- for (var i = 0, l = keys.length; i < l; i++) {
- var key = keys[i];
- def(target, key, src[key]);
- }
- }
-
- /**
- * Attempt to create an observer instance for a value,
- * returns the new observer if successfully observed,
- * or the existing observer if the value already has one.
- */
- function observe (value, asRootData) {
- if (!isObject(value)) {
- return
- }
- var ob;
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
- ob = value.__ob__;
- } else if (
- observerState.shouldConvert &&
- !isServerRendering() &&
- (Array.isArray(value) || isPlainObject(value)) &&
- Object.isExtensible(value) &&
- !value._isVue
- ) {
- ob = new Observer(value);
- }
- if (asRootData && ob) {
- ob.vmCount++;
- }
- return ob
- }
-
- /**
- * Define a reactive property on an Object.
- */
- function defineReactive$$1 (
- obj,
- key,
- val,
- customSetter
- ) {
- var dep = new Dep();
-
- var property = Object.getOwnPropertyDescriptor(obj, key);
- if (property && property.configurable === false) {
- return
- }
-
- // cater for pre-defined getter/setters
- var getter = property && property.get;
- var setter = property && property.set;
-
- var childOb = observe(val);
- Object.defineProperty(obj, key, {
- enumerable: true,
- configurable: true,
- get: function reactiveGetter () {
- var value = getter ? getter.call(obj) : val;
- if (Dep.target) {
- dep.depend();
- if (childOb) {
- childOb.dep.depend();
- }
- if (Array.isArray(value)) {
- dependArray(value);
- }
- }
- return value
- },
- set: function reactiveSetter (newVal) {
- var value = getter ? getter.call(obj) : val;
- /* eslint-disable no-self-compare */
- if (newVal === value || (newVal !== newVal && value !== value)) {
- return
- }
- /* eslint-enable no-self-compare */
- if ("development" !== 'production' && customSetter) {
- customSetter();
- }
- if (setter) {
- setter.call(obj, newVal);
- } else {
- val = newVal;
- }
- childOb = observe(newVal);
- dep.notify();
- }
- });
- }
-
- /**
- * Set a property on an object. Adds the new property and
- * triggers change notification if the property doesn't
- * already exist.
- */
- function set$1 (obj, key, val) {
- if (Array.isArray(obj)) {
- obj.length = Math.max(obj.length, key);
- obj.splice(key, 1, val);
- return val
- }
- if (hasOwn(obj, key)) {
- obj[key] = val;
- return
- }
- var ob = obj.__ob__;
- if (obj._isVue || (ob && ob.vmCount)) {
- "development" !== 'production' && warn(
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
- 'at runtime - declare it upfront in the data option.'
- );
- return
- }
- if (!ob) {
- obj[key] = val;
- return
- }
- defineReactive$$1(ob.value, key, val);
- ob.dep.notify();
- return val
- }
-
- /**
- * Delete a property and trigger change if necessary.
- */
- function del (obj, key) {
- var ob = obj.__ob__;
- if (obj._isVue || (ob && ob.vmCount)) {
- "development" !== 'production' && warn(
- 'Avoid deleting properties on a Vue instance or its root $data ' +
- '- just set it to null.'
- );
- return
- }
- if (!hasOwn(obj, key)) {
- return
- }
- delete obj[key];
- if (!ob) {
- return
- }
- ob.dep.notify();
- }
-
- /**
- * Collect dependencies on array elements when the array is touched, since
- * we cannot intercept array element access like property getters.
- */
- function dependArray (value) {
- for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
- e = value[i];
- e && e.__ob__ && e.__ob__.dep.depend();
- if (Array.isArray(e)) {
- dependArray(e);
- }
- }
- }
-
- /* */
-
- /**
- * Option overwriting strategies are functions that handle
- * how to merge a parent option value and a child option
- * value into the final value.
- */
- var strats = config.optionMergeStrategies;
-
- /**
- * Options with restrictions
- */
- {
- strats.el = strats.propsData = function (parent, child, vm, key) {
- if (!vm) {
- warn(
- "option \"" + key + "\" can only be used during instance " +
- 'creation with the `new` keyword.'
- );
- }
- return defaultStrat(parent, child)
- };
- }
-
- /**
- * Helper that recursively merges two data objects together.
- */
- function mergeData (to, from) {
- if (!from) { return to }
- var key, toVal, fromVal;
- var keys = Object.keys(from);
- for (var i = 0; i < keys.length; i++) {
- key = keys[i];
- toVal = to[key];
- fromVal = from[key];
- if (!hasOwn(to, key)) {
- set$1(to, key, fromVal);
- } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
- mergeData(toVal, fromVal);
- }
- }
- return to
- }
-
- /**
- * Data
- */
- strats.data = function (
- parentVal,
- childVal,
- vm
- ) {
- if (!vm) {
- // in a Vue.extend merge, both should be functions
- if (!childVal) {
- return parentVal
- }
- if (typeof childVal !== 'function') {
- "development" !== 'production' && warn(
- 'The "data" option should be a function ' +
- 'that returns a per-instance value in component ' +
- 'definitions.',
- vm
- );
- return parentVal
- }
- if (!parentVal) {
- return childVal
- }
- // when parentVal & childVal are both present,
- // we need to return a function that returns the
- // merged result of both functions... no need to
- // check if parentVal is a function here because
- // it has to be a function to pass previous merges.
- return function mergedDataFn () {
- return mergeData(
- childVal.call(this),
- parentVal.call(this)
- )
- }
- } else if (parentVal || childVal) {
- return function mergedInstanceDataFn () {
- // instance merge
- var instanceData = typeof childVal === 'function'
- ? childVal.call(vm)
- : childVal;
- var defaultData = typeof parentVal === 'function'
- ? parentVal.call(vm)
- : undefined;
- if (instanceData) {
- return mergeData(instanceData, defaultData)
- } else {
- return defaultData
- }
- }
- }
- };
-
- /**
- * Hooks and param attributes are merged as arrays.
- */
- function mergeHook (
- parentVal,
- childVal
- ) {
- return childVal
- ? parentVal
- ? parentVal.concat(childVal)
- : Array.isArray(childVal)
- ? childVal
- : [childVal]
- : parentVal
- }
-
- config._lifecycleHooks.forEach(function (hook) {
- strats[hook] = mergeHook;
- });
-
- /**
- * Assets
- *
- * When a vm is present (instance creation), we need to do
- * a three-way merge between constructor options, instance
- * options and parent options.
- */
- function mergeAssets (parentVal, childVal) {
- var res = Object.create(parentVal || null);
- return childVal
- ? extend(res, childVal)
- : res
- }
-
- config._assetTypes.forEach(function (type) {
- strats[type + 's'] = mergeAssets;
- });
-
- /**
- * Watchers.
- *
- * Watchers hashes should not overwrite one
- * another, so we merge them as arrays.
- */
- strats.watch = function (parentVal, childVal) {
- /* istanbul ignore if */
- if (!childVal) { return parentVal }
- if (!parentVal) { return childVal }
- var ret = {};
- extend(ret, parentVal);
- for (var key in childVal) {
- var parent = ret[key];
- var child = childVal[key];
- if (parent && !Array.isArray(parent)) {
- parent = [parent];
- }
- ret[key] = parent
- ? parent.concat(child)
- : [child];
- }
- return ret
- };
-
- /**
- * Other object hashes.
- */
- strats.props =
- strats.methods =
- strats.computed = function (parentVal, childVal) {
- if (!childVal) { return parentVal }
- if (!parentVal) { return childVal }
- var ret = Object.create(null);
- extend(ret, parentVal);
- extend(ret, childVal);
- return ret
- };
-
- /**
- * Default strategy.
- */
- var defaultStrat = function (parentVal, childVal) {
- return childVal === undefined
- ? parentVal
- : childVal
- };
-
- /**
- * Validate component names
- */
- function checkComponents (options) {
- for (var key in options.components) {
- var lower = key.toLowerCase();
- if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
- warn(
- 'Do not use built-in or reserved HTML elements as component ' +
- 'id: ' + key
- );
- }
- }
- }
-
- /**
- * Ensure all props option syntax are normalized into the
- * Object-based format.
- */
- function normalizeProps (options) {
- var props = options.props;
- if (!props) { return }
- var res = {};
- var i, val, name;
- if (Array.isArray(props)) {
- i = props.length;
- while (i--) {
- val = props[i];
- if (typeof val === 'string') {
- name = camelize(val);
- res[name] = { type: null };
- } else {
- warn('props must be strings when using array syntax.');
- }
- }
- } else if (isPlainObject(props)) {
- for (var key in props) {
- val = props[key];
- name = camelize(key);
- res[name] = isPlainObject(val)
- ? val
- : { type: val };
- }
- }
- options.props = res;
- }
-
- /**
- * Normalize raw function directives into object format.
- */
- function normalizeDirectives (options) {
- var dirs = options.directives;
- if (dirs) {
- for (var key in dirs) {
- var def = dirs[key];
- if (typeof def === 'function') {
- dirs[key] = { bind: def, update: def };
- }
- }
- }
- }
-
- /**
- * Merge two option objects into a new one.
- * Core utility used in both instantiation and inheritance.
- */
- function mergeOptions (
- parent,
- child,
- vm
- ) {
- {
- checkComponents(child);
- }
- normalizeProps(child);
- normalizeDirectives(child);
- var extendsFrom = child.extends;
- if (extendsFrom) {
- parent = typeof extendsFrom === 'function'
- ? mergeOptions(parent, extendsFrom.options, vm)
- : mergeOptions(parent, extendsFrom, vm);
- }
- if (child.mixins) {
- for (var i = 0, l = child.mixins.length; i < l; i++) {
- var mixin = child.mixins[i];
- if (mixin.prototype instanceof Vue$3) {
- mixin = mixin.options;
- }
- parent = mergeOptions(parent, mixin, vm);
- }
- }
- var options = {};
- var key;
- for (key in parent) {
- mergeField(key);
- }
- for (key in child) {
- if (!hasOwn(parent, key)) {
- mergeField(key);
- }
- }
- function mergeField (key) {
- var strat = strats[key] || defaultStrat;
- options[key] = strat(parent[key], child[key], vm, key);
- }
- return options
- }
-
- /**
- * Resolve an asset.
- * This function is used because child instances need access
- * to assets defined in its ancestor chain.
- */
- function resolveAsset (
- options,
- type,
- id,
- warnMissing
- ) {
- /* istanbul ignore if */
- if (typeof id !== 'string') {
- return
- }
- var assets = options[type];
- // check local registration variations first
- if (hasOwn(assets, id)) { return assets[id] }
- var camelizedId = camelize(id);
- if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
- var PascalCaseId = capitalize(camelizedId);
- if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
- // fallback to prototype chain
- var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
- if ("development" !== 'production' && warnMissing && !res) {
- warn(
- 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
- options
- );
- }
- return res
- }
-
- /* */
-
- function validateProp (
- key,
- propOptions,
- propsData,
- vm
- ) {
- var prop = propOptions[key];
- var absent = !hasOwn(propsData, key);
- var value = propsData[key];
- // handle boolean props
- if (isType(Boolean, prop.type)) {
- if (absent && !hasOwn(prop, 'default')) {
- value = false;
- } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
- value = true;
- }
- }
- // check default value
- if (value === undefined) {
- value = getPropDefaultValue(vm, prop, key);
- // since the default value is a fresh copy,
- // make sure to observe it.
- var prevShouldConvert = observerState.shouldConvert;
- observerState.shouldConvert = true;
- observe(value);
- observerState.shouldConvert = prevShouldConvert;
- }
- {
- assertProp(prop, key, value, vm, absent);
- }
- return value
- }
-
- /**
- * Get the default value of a prop.
- */
- function getPropDefaultValue (vm, prop, key) {
- // no default, return undefined
- if (!hasOwn(prop, 'default')) {
- return undefined
- }
- var def = prop.default;
- // warn against non-factory defaults for Object & Array
- if (isObject(def)) {
- "development" !== 'production' && warn(
- 'Invalid default value for prop "' + key + '": ' +
- 'Props with type Object/Array must use a factory function ' +
- 'to return the default value.',
- vm
- );
- }
- // the raw prop value was also undefined from previous render,
- // return previous default value to avoid unnecessary watcher trigger
- if (vm && vm.$options.propsData &&
- vm.$options.propsData[key] === undefined &&
- vm[key] !== undefined) {
- return vm[key]
- }
- // call factory function for non-Function types
- return typeof def === 'function' && prop.type !== Function
- ? def.call(vm)
- : def
- }
-
- /**
- * Assert whether a prop is valid.
- */
- function assertProp (
- prop,
- name,
- value,
- vm,
- absent
- ) {
- if (prop.required && absent) {
- warn(
- 'Missing required prop: "' + name + '"',
- vm
- );
- return
- }
- if (value == null && !prop.required) {
- return
- }
- var type = prop.type;
- var valid = !type || type === true;
- var expectedTypes = [];
- if (type) {
- if (!Array.isArray(type)) {
- type = [type];
- }
- for (var i = 0; i < type.length && !valid; i++) {
- var assertedType = assertType(value, type[i]);
- expectedTypes.push(assertedType.expectedType || '');
- valid = assertedType.valid;
- }
- }
- if (!valid) {
- warn(
- 'Invalid prop: type check failed for prop "' + name + '".' +
- ' Expected ' + expectedTypes.map(capitalize).join(', ') +
- ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
- vm
- );
- return
- }
- var validator = prop.validator;
- if (validator) {
- if (!validator(value)) {
- warn(
- 'Invalid prop: custom validator check failed for prop "' + name + '".',
- vm
- );
- }
- }
- }
-
- /**
- * Assert the type of a value
- */
- function assertType (value, type) {
- var valid;
- var expectedType = getType(type);
- if (expectedType === 'String') {
- valid = typeof value === (expectedType = 'string');
- } else if (expectedType === 'Number') {
- valid = typeof value === (expectedType = 'number');
- } else if (expectedType === 'Boolean') {
- valid = typeof value === (expectedType = 'boolean');
- } else if (expectedType === 'Function') {
- valid = typeof value === (expectedType = 'function');
- } else if (expectedType === 'Object') {
- valid = isPlainObject(value);
- } else if (expectedType === 'Array') {
- valid = Array.isArray(value);
- } else {
- valid = value instanceof type;
- }
- return {
- valid: valid,
- expectedType: expectedType
- }
- }
-
- /**
- * Use function string name to check built-in types,
- * because a simple equality check will fail when running
- * across different vms / iframes.
- */
- function getType (fn) {
- var match = fn && fn.toString().match(/^\s*function (\w+)/);
- return match && match[1]
- }
-
- function isType (type, fn) {
- if (!Array.isArray(fn)) {
- return getType(fn) === getType(type)
- }
- for (var i = 0, len = fn.length; i < len; i++) {
- if (getType(fn[i]) === getType(type)) {
- return true
- }
- }
- /* istanbul ignore next */
- return false
- }
-
-
-
- var util = Object.freeze({
- defineReactive: defineReactive$$1,
- _toString: _toString,
- toNumber: toNumber,
- makeMap: makeMap,
- isBuiltInTag: isBuiltInTag,
- remove: remove$1,
- hasOwn: hasOwn,
- isPrimitive: isPrimitive,
- cached: cached,
- camelize: camelize,
- capitalize: capitalize,
- hyphenate: hyphenate,
- bind: bind$1,
- toArray: toArray,
- extend: extend,
- isObject: isObject,
- isPlainObject: isPlainObject,
- toObject: toObject,
- noop: noop,
- no: no,
- identity: identity,
- genStaticKeys: genStaticKeys,
- looseEqual: looseEqual,
- looseIndexOf: looseIndexOf,
- isReserved: isReserved,
- def: def,
- parsePath: parsePath,
- hasProto: hasProto,
- inBrowser: inBrowser,
- UA: UA,
- isIE: isIE,
- isIE9: isIE9,
- isEdge: isEdge,
- isAndroid: isAndroid,
- isIOS: isIOS,
- isServerRendering: isServerRendering,
- devtools: devtools,
- nextTick: nextTick,
- get _Set () { return _Set; },
- mergeOptions: mergeOptions,
- resolveAsset: resolveAsset,
- get warn () { return warn; },
- get formatComponentName () { return formatComponentName; },
- validateProp: validateProp
- });
-
- /* not type checking this file because flow doesn't play well with Proxy */
-
- var initProxy;
-
- {
- var allowedGlobals = makeMap(
- 'Infinity,undefined,NaN,isFinite,isNaN,' +
- 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
- 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
- 'require' // for Webpack/Browserify
- );
-
- var warnNonPresent = function (target, key) {
- warn(
- "Property or method \"" + key + "\" is not defined on the instance but " +
- "referenced during render. Make sure to declare reactive data " +
- "properties in the data option.",
- target
- );
- };
-
- var hasProxy =
- typeof Proxy !== 'undefined' &&
- Proxy.toString().match(/native code/);
-
- if (hasProxy) {
- var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
- config.keyCodes = new Proxy(config.keyCodes, {
- set: function set (target, key, value) {
- if (isBuiltInModifier(key)) {
- warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
- return false
- } else {
- target[key] = value;
- return true
- }
- }
- });
- }
-
- var hasHandler = {
- has: function has (target, key) {
- var has = key in target;
- var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
- if (!has && !isAllowed) {
- warnNonPresent(target, key);
- }
- return has || !isAllowed
- }
- };
-
- var getHandler = {
- get: function get (target, key) {
- if (typeof key === 'string' && !(key in target)) {
- warnNonPresent(target, key);
- }
- return target[key]
- }
- };
-
- initProxy = function initProxy (vm) {
- if (hasProxy) {
- // determine which proxy handler to use
- var options = vm.$options;
- var handlers = options.render && options.render._withStripped
- ? getHandler
- : hasHandler;
- vm._renderProxy = new Proxy(vm, handlers);
- } else {
- vm._renderProxy = vm;
- }
- };
- }
-
- /* */
-
- var VNode = function VNode (
- tag,
- data,
- children,
- text,
- elm,
- context,
- componentOptions
- ) {
- this.tag = tag;
- this.data = data;
- this.children = children;
- this.text = text;
- this.elm = elm;
- this.ns = undefined;
- this.context = context;
- this.functionalContext = undefined;
- this.key = data && data.key;
- this.componentOptions = componentOptions;
- this.componentInstance = undefined;
- this.parent = undefined;
- this.raw = false;
- this.isStatic = false;
- this.isRootInsert = true;
- this.isComment = false;
- this.isCloned = false;
- this.isOnce = false;
- };
-
- var prototypeAccessors = { child: {} };
-
- // DEPRECATED: alias for componentInstance for backwards compat.
- /* istanbul ignore next */
- prototypeAccessors.child.get = function () {
- return this.componentInstance
- };
-
- Object.defineProperties( VNode.prototype, prototypeAccessors );
-
- var createEmptyVNode = function () {
- var node = new VNode();
- node.text = '';
- node.isComment = true;
- return node
- };
-
- function createTextVNode (val) {
- return new VNode(undefined, undefined, undefined, String(val))
- }
-
- // optimized shallow clone
- // used for static nodes and slot nodes because they may be reused across
- // multiple renders, cloning them avoids errors when DOM manipulations rely
- // on their elm reference.
- function cloneVNode (vnode) {
- var cloned = new VNode(
- vnode.tag,
- vnode.data,
- vnode.children,
- vnode.text,
- vnode.elm,
- vnode.context,
- vnode.componentOptions
- );
- cloned.ns = vnode.ns;
- cloned.isStatic = vnode.isStatic;
- cloned.key = vnode.key;
- cloned.isCloned = true;
- return cloned
- }
-
- function cloneVNodes (vnodes) {
- var res = new Array(vnodes.length);
- for (var i = 0; i < vnodes.length; i++) {
- res[i] = cloneVNode(vnodes[i]);
- }
- return res
- }
-
- /* */
-
- var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
- var hooksToMerge = Object.keys(hooks);
-
- function createComponent (
- Ctor,
- data,
- context,
- children,
- tag
- ) {
- if (!Ctor) {
- return
- }
-
- var baseCtor = context.$options._base;
- if (isObject(Ctor)) {
- Ctor = baseCtor.extend(Ctor);
- }
-
- if (typeof Ctor !== 'function') {
- {
- warn(("Invalid Component definition: " + (String(Ctor))), context);
- }
- return
- }
-
- // async component
- if (!Ctor.cid) {
- if (Ctor.resolved) {
- Ctor = Ctor.resolved;
- } else {
- Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
- // it's ok to queue this on every render because
- // $forceUpdate is buffered by the scheduler.
- context.$forceUpdate();
- });
- if (!Ctor) {
- // return nothing if this is indeed an async component
- // wait for the callback to trigger parent update.
- return
- }
- }
- }
-
- // resolve constructor options in case global mixins are applied after
- // component constructor creation
- resolveConstructorOptions(Ctor);
-
- data = data || {};
-
- // extract props
- var propsData = extractProps(data, Ctor);
-
- // functional component
- if (Ctor.options.functional) {
- return createFunctionalComponent(Ctor, propsData, data, context, children)
- }
-
- // extract listeners, since these needs to be treated as
- // child component listeners instead of DOM listeners
- var listeners = data.on;
- // replace with listeners with .native modifier
- data.on = data.nativeOn;
-
- if (Ctor.options.abstract) {
- // abstract components do not keep anything
- // other than props & listeners
- data = {};
- }
-
- // merge component management hooks onto the placeholder node
- mergeHooks(data);
-
- // return a placeholder vnode
- var name = Ctor.options.name || tag;
- var vnode = new VNode(
- ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
- data, undefined, undefined, undefined, context,
- { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
- );
- return vnode
- }
-
- function createFunctionalComponent (
- Ctor,
- propsData,
- data,
- context,
- children
- ) {
- var props = {};
- var propOptions = Ctor.options.props;
- if (propOptions) {
- for (var key in propOptions) {
- props[key] = validateProp(key, propOptions, propsData);
- }
- }
- // ensure the createElement function in functional components
- // gets a unique context - this is necessary for correct named slot check
- var _context = Object.create(context);
- var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
- var vnode = Ctor.options.render.call(null, h, {
- props: props,
- data: data,
- parent: context,
- children: children,
- slots: function () { return resolveSlots(children, context); }
- });
- if (vnode instanceof VNode) {
- vnode.functionalContext = context;
- if (data.slot) {
- (vnode.data || (vnode.data = {})).slot = data.slot;
- }
- }
- return vnode
- }
-
- function createComponentInstanceForVnode (
- vnode, // we know it's MountedComponentVNode but flow doesn't
- parent, // activeInstance in lifecycle state
- parentElm,
- refElm
- ) {
- var vnodeComponentOptions = vnode.componentOptions;
- var options = {
- _isComponent: true,
- parent: parent,
- propsData: vnodeComponentOptions.propsData,
- _componentTag: vnodeComponentOptions.tag,
- _parentVnode: vnode,
- _parentListeners: vnodeComponentOptions.listeners,
- _renderChildren: vnodeComponentOptions.children,
- _parentElm: parentElm || null,
- _refElm: refElm || null
- };
- // check inline-template render functions
- var inlineTemplate = vnode.data.inlineTemplate;
- if (inlineTemplate) {
- options.render = inlineTemplate.render;
- options.staticRenderFns = inlineTemplate.staticRenderFns;
- }
- return new vnodeComponentOptions.Ctor(options)
- }
-
- function init (
- vnode,
- hydrating,
- parentElm,
- refElm
- ) {
- if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
- var child = vnode.componentInstance = createComponentInstanceForVnode(
- vnode,
- activeInstance,
- parentElm,
- refElm
- );
- child.$mount(hydrating ? vnode.elm : undefined, hydrating);
- } else if (vnode.data.keepAlive) {
- // kept-alive components, treat as a patch
- var mountedNode = vnode; // work around flow
- prepatch(mountedNode, mountedNode);
- }
- }
-
- function prepatch (
- oldVnode,
- vnode
- ) {
- var options = vnode.componentOptions;
- var child = vnode.componentInstance = oldVnode.componentInstance;
- child._updateFromParent(
- options.propsData, // updated props
- options.listeners, // updated listeners
- vnode, // new parent vnode
- options.children // new children
- );
- }
-
- function insert (vnode) {
- if (!vnode.componentInstance._isMounted) {
- vnode.componentInstance._isMounted = true;
- callHook(vnode.componentInstance, 'mounted');
- }
- if (vnode.data.keepAlive) {
- vnode.componentInstance._inactive = false;
- callHook(vnode.componentInstance, 'activated');
- }
- }
-
- function destroy$1 (vnode) {
- if (!vnode.componentInstance._isDestroyed) {
- if (!vnode.data.keepAlive) {
- vnode.componentInstance.$destroy();
- } else {
- vnode.componentInstance._inactive = true;
- callHook(vnode.componentInstance, 'deactivated');
- }
- }
- }
-
- function resolveAsyncComponent (
- factory,
- baseCtor,
- cb
- ) {
- if (factory.requested) {
- // pool callbacks
- factory.pendingCallbacks.push(cb);
- } else {
- factory.requested = true;
- var cbs = factory.pendingCallbacks = [cb];
- var sync = true;
-
- var resolve = function (res) {
- if (isObject(res)) {
- res = baseCtor.extend(res);
- }
- // cache resolved
- factory.resolved = res;
- // invoke callbacks only if this is not a synchronous resolve
- // (async resolves are shimmed as synchronous during SSR)
- if (!sync) {
- for (var i = 0, l = cbs.length; i < l; i++) {
- cbs[i](res);
- }
- }
- };
-
- var reject = function (reason) {
- "development" !== 'production' && warn(
- "Failed to resolve async component: " + (String(factory)) +
- (reason ? ("\nReason: " + reason) : '')
- );
- };
-
- var res = factory(resolve, reject);
-
- // handle promise
- if (res && typeof res.then === 'function' && !factory.resolved) {
- res.then(resolve, reject);
- }
-
- sync = false;
- // return in case resolved synchronously
- return factory.resolved
- }
- }
-
- function extractProps (data, Ctor) {
- // we are only extracting raw values here.
- // validation and default values are handled in the child
- // component itself.
- var propOptions = Ctor.options.props;
- if (!propOptions) {
- return
- }
- var res = {};
- var attrs = data.attrs;
- var props = data.props;
- var domProps = data.domProps;
- if (attrs || props || domProps) {
- for (var key in propOptions) {
- var altKey = hyphenate(key);
- checkProp(res, props, key, altKey, true) ||
- checkProp(res, attrs, key, altKey) ||
- checkProp(res, domProps, key, altKey);
- }
- }
- return res
- }
-
- function checkProp (
- res,
- hash,
- key,
- altKey,
- preserve
- ) {
- if (hash) {
- if (hasOwn(hash, key)) {
- res[key] = hash[key];
- if (!preserve) {
- delete hash[key];
- }
- return true
- } else if (hasOwn(hash, altKey)) {
- res[key] = hash[altKey];
- if (!preserve) {
- delete hash[altKey];
- }
- return true
- }
- }
- return false
- }
-
- function mergeHooks (data) {
- if (!data.hook) {
- data.hook = {};
- }
- for (var i = 0; i < hooksToMerge.length; i++) {
- var key = hooksToMerge[i];
- var fromParent = data.hook[key];
- var ours = hooks[key];
- data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
- }
- }
-
- function mergeHook$1 (one, two) {
- return function (a, b, c, d) {
- one(a, b, c, d);
- two(a, b, c, d);
- }
- }
-
- /* */
-
- function mergeVNodeHook (def, hookKey, hook, key) {
- key = key + hookKey;
- var injectedHash = def.__injected || (def.__injected = {});
- if (!injectedHash[key]) {
- injectedHash[key] = true;
- var oldHook = def[hookKey];
- if (oldHook) {
- def[hookKey] = function () {
- oldHook.apply(this, arguments);
- hook.apply(this, arguments);
- };
- } else {
- def[hookKey] = hook;
- }
- }
- }
-
- /* */
-
- var normalizeEvent = cached(function (name) {
- var once = name.charAt(0) === '~'; // Prefixed last, checked first
- name = once ? name.slice(1) : name;
- var capture = name.charAt(0) === '!';
- name = capture ? name.slice(1) : name;
- return {
- name: name,
- once: once,
- capture: capture
- }
- });
-
- function createEventHandle (fn) {
- var handle = {
- fn: fn,
- invoker: function () {
- var arguments$1 = arguments;
-
- var fn = handle.fn;
- if (Array.isArray(fn)) {
- for (var i = 0; i < fn.length; i++) {
- fn[i].apply(null, arguments$1);
- }
- } else {
- fn.apply(null, arguments);
- }
- }
- };
- return handle
- }
-
- function updateListeners (
- on,
- oldOn,
- add,
- remove$$1,
- vm
- ) {
- var name, cur, old, event;
- for (name in on) {
- cur = on[name];
- old = oldOn[name];
- event = normalizeEvent(name);
- if (!cur) {
- "development" !== 'production' && warn(
- "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
- vm
- );
- } else if (!old) {
- if (!cur.invoker) {
- cur = on[name] = createEventHandle(cur);
- }
- add(event.name, cur.invoker, event.once, event.capture);
- } else if (cur !== old) {
- old.fn = cur;
- on[name] = old;
- }
- }
- for (name in oldOn) {
- if (!on[name]) {
- event = normalizeEvent(name);
- remove$$1(event.name, oldOn[name].invoker, event.capture);
- }
- }
- }
-
- /* */
-
- // The template compiler attempts to minimize the need for normalization by
- // statically analyzing the template at compile time.
- //
- // For plain HTML markup, normalization can be completely skipped because the
- // generated render function is guaranteed to return Array<VNode>. There are
- // two cases where extra normalization is needed:
-
- // 1. When the children contains components - because a functional component
- // may return an Array instead of a single root. In this case, just a simple
- // nomralization is needed - if any child is an Array, we flatten the whole
- // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
- // because functional components already normalize their own children.
- function simpleNormalizeChildren (children) {
- for (var i = 0; i < children.length; i++) {
- if (Array.isArray(children[i])) {
- return Array.prototype.concat.apply([], children)
- }
- }
- return children
- }
-
- // 2. When the children contains constrcuts that always generated nested Arrays,
- // e.g. <template>, <slot>, v-for, or when the children is provided by user
- // with hand-written render functions / JSX. In such cases a full normalization
- // is needed to cater to all possible types of children values.
- function normalizeChildren (children) {
- return isPrimitive(children)
- ? [createTextVNode(children)]
- : Array.isArray(children)
- ? normalizeArrayChildren(children)
- : undefined
- }
-
- function normalizeArrayChildren (children, nestedIndex) {
- var res = [];
- var i, c, last;
- for (i = 0; i < children.length; i++) {
- c = children[i];
- if (c == null || typeof c === 'boolean') { continue }
- last = res[res.length - 1];
- // nested
- if (Array.isArray(c)) {
- res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
- } else if (isPrimitive(c)) {
- if (last && last.text) {
- last.text += String(c);
- } else if (c !== '') {
- // convert primitive to vnode
- res.push(createTextVNode(c));
- }
- } else {
- if (c.text && last && last.text) {
- res[res.length - 1] = createTextVNode(last.text + c.text);
- } else {
- // default key for nested array children (likely generated by v-for)
- if (c.tag && c.key == null && nestedIndex != null) {
- c.key = "__vlist" + nestedIndex + "_" + i + "__";
- }
- res.push(c);
- }
- }
- }
- return res
- }
-
- /* */
-
- function getFirstComponentChild (children) {
- return children && children.filter(function (c) { return c && c.componentOptions; })[0]
- }
-
- /* */
-
- var SIMPLE_NORMALIZE = 1;
- var ALWAYS_NORMALIZE = 2;
-
- // wrapper function for providing a more flexible interface
- // without getting yelled at by flow
- function createElement (
- context,
- tag,
- data,
- children,
- normalizationType,
- alwaysNormalize
- ) {
- if (Array.isArray(data) || isPrimitive(data)) {
- normalizationType = children;
- children = data;
- data = undefined;
- }
- if (alwaysNormalize) { normalizationType = ALWAYS_NORMALIZE; }
- return _createElement(context, tag, data, children, normalizationType)
- }
-
- function _createElement (
- context,
- tag,
- data,
- children,
- normalizationType
- ) {
- if (data && data.__ob__) {
- "development" !== 'production' && warn(
- "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
- 'Always create fresh vnode data objects in each render!',
- context
- );
- return createEmptyVNode()
- }
- if (!tag) {
- // in case of component :is set to falsy value
- return createEmptyVNode()
- }
- // support single function children as default scoped slot
- if (Array.isArray(children) &&
- typeof children[0] === 'function') {
- data = data || {};
- data.scopedSlots = { default: children[0] };
- children.length = 0;
- }
- if (normalizationType === ALWAYS_NORMALIZE) {
- children = normalizeChildren(children);
- } else if (normalizationType === SIMPLE_NORMALIZE) {
- children = simpleNormalizeChildren(children);
- }
- var vnode, ns;
- if (typeof tag === 'string') {
- var Ctor;
- ns = config.getTagNamespace(tag);
- if (config.isReservedTag(tag)) {
- // platform built-in elements
- vnode = new VNode(
- config.parsePlatformTagName(tag), data, children,
- undefined, undefined, context
- );
- } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
- // component
- vnode = createComponent(Ctor, data, context, children, tag);
- } else {
- // unknown or unlisted namespaced elements
- // check at runtime because it may get assigned a namespace when its
- // parent normalizes children
- vnode = new VNode(
- tag, data, children,
- undefined, undefined, context
- );
- }
- } else {
- // direct component options / constructor
- vnode = createComponent(tag, data, context, children);
- }
- if (vnode) {
- if (ns) { applyNS(vnode, ns); }
- return vnode
- } else {
- return createEmptyVNode()
- }
- }
-
- function applyNS (vnode, ns) {
- vnode.ns = ns;
- if (vnode.tag === 'foreignObject') {
- // use default namespace inside foreignObject
- return
- }
- if (vnode.children) {
- for (var i = 0, l = vnode.children.length; i < l; i++) {
- var child = vnode.children[i];
- if (child.tag && !child.ns) {
- applyNS(child, ns);
- }
- }
- }
- }
-
- /* */
-
- function initRender (vm) {
- vm.$vnode = null; // the placeholder node in parent tree
- vm._vnode = null; // the root of the child tree
- vm._staticTrees = null;
- var parentVnode = vm.$options._parentVnode;
- var renderContext = parentVnode && parentVnode.context;
- vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
- vm.$scopedSlots = {};
- // bind the createElement fn to this instance
- // so that we get proper render context inside it.
- // args order: tag, data, children, normalizationType, alwaysNormalize
- // internal version is used by render functions compiled from templates
- vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
- // normalization is always applied for the public version, used in
- // user-written render functions.
- vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
- }
-
- function renderMixin (Vue) {
- Vue.prototype.$nextTick = function (fn) {
- return nextTick(fn, this)
- };
-
- Vue.prototype._render = function () {
- var vm = this;
- var ref = vm.$options;
- var render = ref.render;
- var staticRenderFns = ref.staticRenderFns;
- var _parentVnode = ref._parentVnode;
-
- if (vm._isMounted) {
- // clone slot nodes on re-renders
- for (var key in vm.$slots) {
- vm.$slots[key] = cloneVNodes(vm.$slots[key]);
- }
- }
-
- if (_parentVnode && _parentVnode.data.scopedSlots) {
- vm.$scopedSlots = _parentVnode.data.scopedSlots;
- }
-
- if (staticRenderFns && !vm._staticTrees) {
- vm._staticTrees = [];
- }
- // set parent vnode. this allows render functions to have access
- // to the data on the placeholder node.
- vm.$vnode = _parentVnode;
- // render self
- var vnode;
- try {
- vnode = render.call(vm._renderProxy, vm.$createElement);
- } catch (e) {
- /* istanbul ignore else */
- if (config.errorHandler) {
- config.errorHandler.call(null, e, vm);
- } else {
- {
- warn(("Error when rendering " + (formatComponentName(vm)) + ":"));
- }
- throw e
- }
- // return previous vnode to prevent render error causing blank component
- vnode = vm._vnode;
- }
- // return empty vnode in case the render function errored out
- if (!(vnode instanceof VNode)) {
- if ("development" !== 'production' && Array.isArray(vnode)) {
- warn(
- 'Multiple root nodes returned from render function. Render function ' +
- 'should return a single root node.',
- vm
- );
- }
- vnode = createEmptyVNode();
- }
- // set parent
- vnode.parent = _parentVnode;
- return vnode
- };
-
- // toString for mustaches
- Vue.prototype._s = _toString;
- // convert text to vnode
- Vue.prototype._v = createTextVNode;
- // number conversion
- Vue.prototype._n = toNumber;
- // empty vnode
- Vue.prototype._e = createEmptyVNode;
- // loose equal
- Vue.prototype._q = looseEqual;
- // loose indexOf
- Vue.prototype._i = looseIndexOf;
-
- // render static tree by index
- Vue.prototype._m = function renderStatic (
- index,
- isInFor
- ) {
- var tree = this._staticTrees[index];
- // if has already-rendered static tree and not inside v-for,
- // we can reuse the same tree by doing a shallow clone.
- if (tree && !isInFor) {
- return Array.isArray(tree)
- ? cloneVNodes(tree)
- : cloneVNode(tree)
- }
- // otherwise, render a fresh tree.
- tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
- markStatic(tree, ("__static__" + index), false);
- return tree
- };
-
- // mark node as static (v-once)
- Vue.prototype._o = function markOnce (
- tree,
- index,
- key
- ) {
- markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
- return tree
- };
-
- function markStatic (tree, key, isOnce) {
- if (Array.isArray(tree)) {
- for (var i = 0; i < tree.length; i++) {
- if (tree[i] && typeof tree[i] !== 'string') {
- markStaticNode(tree[i], (key + "_" + i), isOnce);
- }
- }
- } else {
- markStaticNode(tree, key, isOnce);
- }
- }
-
- function markStaticNode (node, key, isOnce) {
- node.isStatic = true;
- node.key = key;
- node.isOnce = isOnce;
- }
-
- // filter resolution helper
- Vue.prototype._f = function resolveFilter (id) {
- return resolveAsset(this.$options, 'filters', id, true) || identity
- };
-
- // render v-for
- Vue.prototype._l = function renderList (
- val,
- render
- ) {
- var ret, i, l, keys, key;
- if (Array.isArray(val) || typeof val === 'string') {
- ret = new Array(val.length);
- for (i = 0, l = val.length; i < l; i++) {
- ret[i] = render(val[i], i);
- }
- } else if (typeof val === 'number') {
- ret = new Array(val);
- for (i = 0; i < val; i++) {
- ret[i] = render(i + 1, i);
- }
- } else if (isObject(val)) {
- keys = Object.keys(val);
- ret = new Array(keys.length);
- for (i = 0, l = keys.length; i < l; i++) {
- key = keys[i];
- ret[i] = render(val[key], key, i);
- }
- }
- return ret
- };
-
- // renderSlot
- Vue.prototype._t = function (
- name,
- fallback,
- props,
- bindObject
- ) {
- var scopedSlotFn = this.$scopedSlots[name];
- if (scopedSlotFn) { // scoped slot
- props = props || {};
- if (bindObject) {
- extend(props, bindObject);
- }
- return scopedSlotFn(props) || fallback
- } else {
- var slotNodes = this.$slots[name];
- // warn duplicate slot usage
- if (slotNodes && "development" !== 'production') {
- slotNodes._rendered && warn(
- "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
- "- this will likely cause render errors.",
- this
- );
- slotNodes._rendered = true;
- }
- return slotNodes || fallback
- }
- };
-
- // apply v-bind object
- Vue.prototype._b = function bindProps (
- data,
- tag,
- value,
- asProp
- ) {
- if (value) {
- if (!isObject(value)) {
- "development" !== 'production' && warn(
- 'v-bind without argument expects an Object or Array value',
- this
- );
- } else {
- if (Array.isArray(value)) {
- value = toObject(value);
- }
- for (var key in value) {
- if (key === 'class' || key === 'style') {
- data[key] = value[key];
- } else {
- var type = data.attrs && data.attrs.type;
- var hash = asProp || config.mustUseProp(tag, type, key)
- ? data.domProps || (data.domProps = {})
- : data.attrs || (data.attrs = {});
- hash[key] = value[key];
- }
- }
- }
- }
- return data
- };
-
- // check v-on keyCodes
- Vue.prototype._k = function checkKeyCodes (
- eventKeyCode,
- key,
- builtInAlias
- ) {
- var keyCodes = config.keyCodes[key] || builtInAlias;
- if (Array.isArray(keyCodes)) {
- return keyCodes.indexOf(eventKeyCode) === -1
- } else {
- return keyCodes !== eventKeyCode
- }
- };
- }
-
- function resolveSlots (
- children,
- context
- ) {
- var slots = {};
- if (!children) {
- return slots
- }
- var defaultSlot = [];
- var name, child;
- for (var i = 0, l = children.length; i < l; i++) {
- child = children[i];
- // named slots should only be respected if the vnode was rendered in the
- // same context.
- if ((child.context === context || child.functionalContext === context) &&
- child.data && (name = child.data.slot)) {
- var slot = (slots[name] || (slots[name] = []));
- if (child.tag === 'template') {
- slot.push.apply(slot, child.children);
- } else {
- slot.push(child);
- }
- } else {
- defaultSlot.push(child);
- }
- }
- // ignore single whitespace
- if (defaultSlot.length && !(
- defaultSlot.length === 1 &&
- (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
- )) {
- slots.default = defaultSlot;
- }
- return slots
- }
-
- /* */
-
- function initEvents (vm) {
- vm._events = Object.create(null);
- vm._hasHookEvent = false;
- // init parent attached events
- var listeners = vm.$options._parentListeners;
- if (listeners) {
- updateComponentListeners(vm, listeners);
- }
- }
-
- var target;
-
- function add$1 (event, fn, once) {
- if (once) {
- target.$once(event, fn);
- } else {
- target.$on(event, fn);
- }
- }
-
- function remove$2 (event, fn) {
- target.$off(event, fn);
- }
-
- function updateComponentListeners (
- vm,
- listeners,
- oldListeners
- ) {
- target = vm;
- updateListeners(listeners, oldListeners || {}, add$1, remove$2, vm);
- }
-
- function eventsMixin (Vue) {
- var hookRE = /^hook:/;
- Vue.prototype.$on = function (event, fn) {
- var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
- // optimize hook:event cost by using a boolean flag marked at registration
- // instead of a hash lookup
- if (hookRE.test(event)) {
- vm._hasHookEvent = true;
- }
- return vm
- };
-
- Vue.prototype.$once = function (event, fn) {
- var vm = this;
- function on () {
- vm.$off(event, on);
- fn.apply(vm, arguments);
- }
- on.fn = fn;
- vm.$on(event, on);
- return vm
- };
-
- Vue.prototype.$off = function (event, fn) {
- var vm = this;
- // all
- if (!arguments.length) {
- vm._events = Object.create(null);
- return vm
- }
- // specific event
- var cbs = vm._events[event];
- if (!cbs) {
- return vm
- }
- if (arguments.length === 1) {
- vm._events[event] = null;
- return vm
- }
- // specific handler
- var cb;
- var i = cbs.length;
- while (i--) {
- cb = cbs[i];
- if (cb === fn || cb.fn === fn) {
- cbs.splice(i, 1);
- break
- }
- }
- return vm
- };
-
- Vue.prototype.$emit = function (event) {
- var vm = this;
- var cbs = vm._events[event];
- if (cbs) {
- cbs = cbs.length > 1 ? toArray(cbs) : cbs;
- var args = toArray(arguments, 1);
- for (var i = 0, l = cbs.length; i < l; i++) {
- cbs[i].apply(vm, args);
- }
- }
- return vm
- };
- }
-
- /* */
-
- var activeInstance = null;
-
- function initLifecycle (vm) {
- var options = vm.$options;
-
- // locate first non-abstract parent
- var parent = options.parent;
- if (parent && !options.abstract) {
- while (parent.$options.abstract && parent.$parent) {
- parent = parent.$parent;
- }
- parent.$children.push(vm);
- }
-
- vm.$parent = parent;
- vm.$root = parent ? parent.$root : vm;
-
- vm.$children = [];
- vm.$refs = {};
-
- vm._watcher = null;
- vm._inactive = false;
- vm._isMounted = false;
- vm._isDestroyed = false;
- vm._isBeingDestroyed = false;
- }
-
- function lifecycleMixin (Vue) {
- Vue.prototype._mount = function (
- el,
- hydrating
- ) {
- var vm = this;
- vm.$el = el;
- if (!vm.$options.render) {
- vm.$options.render = createEmptyVNode;
- {
- /* istanbul ignore if */
- if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {
- warn(
- 'You are using the runtime-only build of Vue where the template ' +
- 'option is not available. Either pre-compile the templates into ' +
- 'render functions, or use the compiler-included build.',
- vm
- );
- } else {
- warn(
- 'Failed to mount component: template or render function not defined.',
- vm
- );
- }
- }
- }
- callHook(vm, 'beforeMount');
- vm._watcher = new Watcher(vm, function updateComponent () {
- vm._update(vm._render(), hydrating);
- }, noop);
- hydrating = false;
- // manually mounted instance, call mounted on self
- // mounted is called for render-created child components in its inserted hook
- if (vm.$vnode == null) {
- vm._isMounted = true;
- callHook(vm, 'mounted');
- }
- return vm
- };
-
- Vue.prototype._update = function (vnode, hydrating) {
- var vm = this;
- if (vm._isMounted) {
- callHook(vm, 'beforeUpdate');
- }
- var prevEl = vm.$el;
- var prevVnode = vm._vnode;
- var prevActiveInstance = activeInstance;
- activeInstance = vm;
- vm._vnode = vnode;
- // Vue.prototype.__patch__ is injected in entry points
- // based on the rendering backend used.
- if (!prevVnode) {
- // initial render
- vm.$el = vm.__patch__(
- vm.$el, vnode, hydrating, false /* removeOnly */,
- vm.$options._parentElm,
- vm.$options._refElm
- );
- } else {
- // updates
- vm.$el = vm.__patch__(prevVnode, vnode);
- }
- activeInstance = prevActiveInstance;
- // update __vue__ reference
- if (prevEl) {
- prevEl.__vue__ = null;
- }
- if (vm.$el) {
- vm.$el.__vue__ = vm;
- }
- // if parent is an HOC, update its $el as well
- if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
- vm.$parent.$el = vm.$el;
- }
- // updated hook is called by the scheduler to ensure that children are
- // updated in a parent's updated hook.
- };
-
- Vue.prototype._updateFromParent = function (
- propsData,
- listeners,
- parentVnode,
- renderChildren
- ) {
- var vm = this;
- var hasChildren = !!(vm.$options._renderChildren || renderChildren);
- vm.$options._parentVnode = parentVnode;
- vm.$vnode = parentVnode; // update vm's placeholder node without re-render
- if (vm._vnode) { // update child tree's parent
- vm._vnode.parent = parentVnode;
- }
- vm.$options._renderChildren = renderChildren;
- // update props
- if (propsData && vm.$options.props) {
- observerState.shouldConvert = false;
- {
- observerState.isSettingProps = true;
- }
- var propKeys = vm.$options._propKeys || [];
- for (var i = 0; i < propKeys.length; i++) {
- var key = propKeys[i];
- vm[key] = validateProp(key, vm.$options.props, propsData, vm);
- }
- observerState.shouldConvert = true;
- {
- observerState.isSettingProps = false;
- }
- vm.$options.propsData = propsData;
- }
- // update listeners
- if (listeners) {
- var oldListeners = vm.$options._parentListeners;
- vm.$options._parentListeners = listeners;
- updateComponentListeners(vm, listeners, oldListeners);
- }
- // resolve slots + force update if has children
- if (hasChildren) {
- vm.$slots = resolveSlots(renderChildren, parentVnode.context);
- vm.$forceUpdate();
- }
- };
-
- Vue.prototype.$forceUpdate = function () {
- var vm = this;
- if (vm._watcher) {
- vm._watcher.update();
- }
- };
-
- Vue.prototype.$destroy = function () {
- var vm = this;
- if (vm._isBeingDestroyed) {
- return
- }
- callHook(vm, 'beforeDestroy');
- vm._isBeingDestroyed = true;
- // remove self from parent
- var parent = vm.$parent;
- if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
- remove$1(parent.$children, vm);
- }
- // teardown watchers
- if (vm._watcher) {
- vm._watcher.teardown();
- }
- var i = vm._watchers.length;
- while (i--) {
- vm._watchers[i].teardown();
- }
- // remove reference from data ob
- // frozen object may not have observer.
- if (vm._data.__ob__) {
- vm._data.__ob__.vmCount--;
- }
- // call the last hook...
- vm._isDestroyed = true;
- callHook(vm, 'destroyed');
- // turn off all instance listeners.
- vm.$off();
- // remove __vue__ reference
- if (vm.$el) {
- vm.$el.__vue__ = null;
- }
- // invoke destroy hooks on current rendered tree
- vm.__patch__(vm._vnode, null);
- };
- }
-
- function callHook (vm, hook) {
- var handlers = vm.$options[hook];
- if (handlers) {
- for (var i = 0, j = handlers.length; i < j; i++) {
- handlers[i].call(vm);
- }
- }
- if (vm._hasHookEvent) {
- vm.$emit('hook:' + hook);
- }
- }
-
- /* */
-
-
- var queue = [];
- var has$1 = {};
- var circular = {};
- var waiting = false;
- var flushing = false;
- var index = 0;
-
- /**
- * Reset the scheduler's state.
- */
- function resetSchedulerState () {
- queue.length = 0;
- has$1 = {};
- {
- circular = {};
- }
- waiting = flushing = false;
- }
-
- /**
- * Flush both queues and run the watchers.
- */
- function flushSchedulerQueue () {
- flushing = true;
- var watcher, id, vm;
-
- // Sort queue before flush.
- // This ensures that:
- // 1. Components are updated from parent to child. (because parent is always
- // created before the child)
- // 2. A component's user watchers are run before its render watcher (because
- // user watchers are created before the render watcher)
- // 3. If a component is destroyed during a parent component's watcher run,
- // its watchers can be skipped.
- queue.sort(function (a, b) { return a.id - b.id; });
-
- // do not cache length because more watchers might be pushed
- // as we run existing watchers
- for (index = 0; index < queue.length; index++) {
- watcher = queue[index];
- id = watcher.id;
- has$1[id] = null;
- watcher.run();
- // in dev build, check and stop circular updates.
- if ("development" !== 'production' && has$1[id] != null) {
- circular[id] = (circular[id] || 0) + 1;
- if (circular[id] > config._maxUpdateCount) {
- warn(
- 'You may have an infinite update loop ' + (
- watcher.user
- ? ("in watcher with expression \"" + (watcher.expression) + "\"")
- : "in a component render function."
- ),
- watcher.vm
- );
- break
- }
- }
- }
-
- // call updated hooks
- index = queue.length;
- while (index--) {
- watcher = queue[index];
- vm = watcher.vm;
- if (vm._watcher === watcher && vm._isMounted) {
- callHook(vm, 'updated');
- }
- }
-
- // devtool hook
- /* istanbul ignore if */
- if (devtools && config.devtools) {
- devtools.emit('flush');
- }
-
- resetSchedulerState();
- }
-
- /**
- * Push a watcher into the watcher queue.
- * Jobs with duplicate IDs will be skipped unless it's
- * pushed when the queue is being flushed.
- */
- function queueWatcher (watcher) {
- var id = watcher.id;
- if (has$1[id] == null) {
- has$1[id] = true;
- if (!flushing) {
- queue.push(watcher);
- } else {
- // if already flushing, splice the watcher based on its id
- // if already past its id, it will be run next immediately.
- var i = queue.length - 1;
- while (i >= 0 && queue[i].id > watcher.id) {
- i--;
- }
- queue.splice(Math.max(i, index) + 1, 0, watcher);
- }
- // queue the flush
- if (!waiting) {
- waiting = true;
- nextTick(flushSchedulerQueue);
- }
- }
- }
-
- /* */
-
- var uid$2 = 0;
-
- /**
- * A watcher parses an expression, collects dependencies,
- * and fires callback when the expression value changes.
- * This is used for both the $watch() api and directives.
- */
- var Watcher = function Watcher (
- vm,
- expOrFn,
- cb,
- options
- ) {
- this.vm = vm;
- vm._watchers.push(this);
- // options
- if (options) {
- this.deep = !!options.deep;
- this.user = !!options.user;
- this.lazy = !!options.lazy;
- this.sync = !!options.sync;
- } else {
- this.deep = this.user = this.lazy = this.sync = false;
- }
- this.cb = cb;
- this.id = ++uid$2; // uid for batching
- this.active = true;
- this.dirty = this.lazy; // for lazy watchers
- this.deps = [];
- this.newDeps = [];
- this.depIds = new _Set();
- this.newDepIds = new _Set();
- this.expression = expOrFn.toString();
- // parse expression for getter
- if (typeof expOrFn === 'function') {
- this.getter = expOrFn;
- } else {
- this.getter = parsePath(expOrFn);
- if (!this.getter) {
- this.getter = function () {};
- "development" !== 'production' && warn(
- "Failed watching path: \"" + expOrFn + "\" " +
- 'Watcher only accepts simple dot-delimited paths. ' +
- 'For full control, use a function instead.',
- vm
- );
- }
- }
- this.value = this.lazy
- ? undefined
- : this.get();
- };
-
- /**
- * Evaluate the getter, and re-collect dependencies.
- */
- Watcher.prototype.get = function get () {
- pushTarget(this);
- var value = this.getter.call(this.vm, this.vm);
- // "touch" every property so they are all tracked as
- // dependencies for deep watching
- if (this.deep) {
- traverse(value);
- }
- popTarget();
- this.cleanupDeps();
- return value
- };
-
- /**
- * Add a dependency to this directive.
- */
- Watcher.prototype.addDep = function addDep (dep) {
- var id = dep.id;
- if (!this.newDepIds.has(id)) {
- this.newDepIds.add(id);
- this.newDeps.push(dep);
- if (!this.depIds.has(id)) {
- dep.addSub(this);
- }
- }
- };
-
- /**
- * Clean up for dependency collection.
- */
- Watcher.prototype.cleanupDeps = function cleanupDeps () {
- var this$1 = this;
-
- var i = this.deps.length;
- while (i--) {
- var dep = this$1.deps[i];
- if (!this$1.newDepIds.has(dep.id)) {
- dep.removeSub(this$1);
- }
- }
- var tmp = this.depIds;
- this.depIds = this.newDepIds;
- this.newDepIds = tmp;
- this.newDepIds.clear();
- tmp = this.deps;
- this.deps = this.newDeps;
- this.newDeps = tmp;
- this.newDeps.length = 0;
- };
-
- /**
- * Subscriber interface.
- * Will be called when a dependency changes.
- */
- Watcher.prototype.update = function update () {
- /* istanbul ignore else */
- if (this.lazy) {
- this.dirty = true;
- } else if (this.sync) {
- this.run();
- } else {
- queueWatcher(this);
- }
- };
-
- /**
- * Scheduler job interface.
- * Will be called by the scheduler.
- */
- Watcher.prototype.run = function run () {
- if (this.active) {
- var value = this.get();
- if (
- value !== this.value ||
- // Deep watchers and watchers on Object/Arrays should fire even
- // when the value is the same, because the value may
- // have mutated.
- isObject(value) ||
- this.deep
- ) {
- // set new value
- var oldValue = this.value;
- this.value = value;
- if (this.user) {
- try {
- this.cb.call(this.vm, value, oldValue);
- } catch (e) {
- /* istanbul ignore else */
- if (config.errorHandler) {
- config.errorHandler.call(null, e, this.vm);
- } else {
- "development" !== 'production' && warn(
- ("Error in watcher \"" + (this.expression) + "\""),
- this.vm
- );
- throw e
- }
- }
- } else {
- this.cb.call(this.vm, value, oldValue);
- }
- }
- }
- };
-
- /**
- * Evaluate the value of the watcher.
- * This only gets called for lazy watchers.
- */
- Watcher.prototype.evaluate = function evaluate () {
- this.value = this.get();
- this.dirty = false;
- };
-
- /**
- * Depend on all deps collected by this watcher.
- */
- Watcher.prototype.depend = function depend () {
- var this$1 = this;
-
- var i = this.deps.length;
- while (i--) {
- this$1.deps[i].depend();
- }
- };
-
- /**
- * Remove self from all dependencies' subscriber list.
- */
- Watcher.prototype.teardown = function teardown () {
- var this$1 = this;
-
- if (this.active) {
- // remove self from vm's watcher list
- // this is a somewhat expensive operation so we skip it
- // if the vm is being destroyed.
- if (!this.vm._isBeingDestroyed) {
- remove$1(this.vm._watchers, this);
- }
- var i = this.deps.length;
- while (i--) {
- this$1.deps[i].removeSub(this$1);
- }
- this.active = false;
- }
- };
-
- /**
- * Recursively traverse an object to evoke all converted
- * getters, so that every nested property inside the object
- * is collected as a "deep" dependency.
- */
- var seenObjects = new _Set();
- function traverse (val) {
- seenObjects.clear();
- _traverse(val, seenObjects);
- }
-
- function _traverse (val, seen) {
- var i, keys;
- var isA = Array.isArray(val);
- if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
- return
- }
- if (val.__ob__) {
- var depId = val.__ob__.dep.id;
- if (seen.has(depId)) {
- return
- }
- seen.add(depId);
- }
- if (isA) {
- i = val.length;
- while (i--) { _traverse(val[i], seen); }
- } else {
- keys = Object.keys(val);
- i = keys.length;
- while (i--) { _traverse(val[keys[i]], seen); }
- }
- }
-
- /* */
-
- function initState (vm) {
- vm._watchers = [];
- var opts = vm.$options;
- if (opts.props) { initProps(vm, opts.props); }
- if (opts.methods) { initMethods(vm, opts.methods); }
- if (opts.data) {
- initData(vm);
- } else {
- observe(vm._data = {}, true /* asRootData */);
- }
- if (opts.computed) { initComputed(vm, opts.computed); }
- if (opts.watch) { initWatch(vm, opts.watch); }
- }
-
- var isReservedProp = { key: 1, ref: 1, slot: 1 };
-
- function initProps (vm, props) {
- var propsData = vm.$options.propsData || {};
- var keys = vm.$options._propKeys = Object.keys(props);
- var isRoot = !vm.$parent;
- // root instance props should be converted
- observerState.shouldConvert = isRoot;
- var loop = function ( i ) {
- var key = keys[i];
- /* istanbul ignore else */
- {
- if (isReservedProp[key]) {
- warn(
- ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
- vm
- );
- }
- defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
- if (vm.$parent && !observerState.isSettingProps) {
- warn(
- "Avoid mutating a prop directly since the value will be " +
- "overwritten whenever the parent component re-renders. " +
- "Instead, use a data or computed property based on the prop's " +
- "value. Prop being mutated: \"" + key + "\"",
- vm
- );
- }
- });
- }
- };
-
- for (var i = 0; i < keys.length; i++) loop( i );
- observerState.shouldConvert = true;
- }
-
- function initData (vm) {
- var data = vm.$options.data;
- data = vm._data = typeof data === 'function'
- ? data.call(vm)
- : data || {};
- if (!isPlainObject(data)) {
- data = {};
- "development" !== 'production' && warn(
- 'data functions should return an object:\n' +
- 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
- vm
- );
- }
- // proxy data on instance
- var keys = Object.keys(data);
- var props = vm.$options.props;
- var i = keys.length;
- while (i--) {
- if (props && hasOwn(props, keys[i])) {
- "development" !== 'production' && warn(
- "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
- "Use prop default value instead.",
- vm
- );
- } else {
- proxy(vm, keys[i]);
- }
- }
- // observe data
- observe(data, true /* asRootData */);
- }
-
- var computedSharedDefinition = {
- enumerable: true,
- configurable: true,
- get: noop,
- set: noop
- };
-
- function initComputed (vm, computed) {
- for (var key in computed) {
- /* istanbul ignore if */
- if ("development" !== 'production' && key in vm) {
- warn(
- "existing instance property \"" + key + "\" will be " +
- "overwritten by a computed property with the same name.",
- vm
- );
- }
- var userDef = computed[key];
- if (typeof userDef === 'function') {
- computedSharedDefinition.get = makeComputedGetter(userDef, vm);
- computedSharedDefinition.set = noop;
- } else {
- computedSharedDefinition.get = userDef.get
- ? userDef.cache !== false
- ? makeComputedGetter(userDef.get, vm)
- : bind$1(userDef.get, vm)
- : noop;
- computedSharedDefinition.set = userDef.set
- ? bind$1(userDef.set, vm)
- : noop;
- }
- Object.defineProperty(vm, key, computedSharedDefinition);
- }
- }
-
- function makeComputedGetter (getter, owner) {
- var watcher = new Watcher(owner, getter, noop, {
- lazy: true
- });
- return function computedGetter () {
- if (watcher.dirty) {
- watcher.evaluate();
- }
- if (Dep.target) {
- watcher.depend();
- }
- return watcher.value
- }
- }
-
- function initMethods (vm, methods) {
- for (var key in methods) {
- vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
- if ("development" !== 'production' && methods[key] == null) {
- warn(
- "method \"" + key + "\" has an undefined value in the component definition. " +
- "Did you reference the function correctly?",
- vm
- );
- }
- }
- }
-
- function initWatch (vm, watch) {
- for (var key in watch) {
- var handler = watch[key];
- if (Array.isArray(handler)) {
- for (var i = 0; i < handler.length; i++) {
- createWatcher(vm, key, handler[i]);
- }
- } else {
- createWatcher(vm, key, handler);
- }
- }
- }
-
- function createWatcher (vm, key, handler) {
- var options;
- if (isPlainObject(handler)) {
- options = handler;
- handler = handler.handler;
- }
- if (typeof handler === 'string') {
- handler = vm[handler];
- }
- vm.$watch(key, handler, options);
- }
-
- function stateMixin (Vue) {
- // flow somehow has problems with directly declared definition object
- // when using Object.defineProperty, so we have to procedurally build up
- // the object here.
- var dataDef = {};
- dataDef.get = function () {
- return this._data
- };
- {
- dataDef.set = function (newData) {
- warn(
- 'Avoid replacing instance root $data. ' +
- 'Use nested data properties instead.',
- this
- );
- };
- }
- Object.defineProperty(Vue.prototype, '$data', dataDef);
-
- Vue.prototype.$set = set$1;
- Vue.prototype.$delete = del;
-
- Vue.prototype.$watch = function (
- expOrFn,
- cb,
- options
- ) {
- var vm = this;
- options = options || {};
- options.user = true;
- var watcher = new Watcher(vm, expOrFn, cb, options);
- if (options.immediate) {
- cb.call(vm, watcher.value);
- }
- return function unwatchFn () {
- watcher.teardown();
- }
- };
- }
-
- function proxy (vm, key) {
- if (!isReserved(key)) {
- Object.defineProperty(vm, key, {
- configurable: true,
- enumerable: true,
- get: function proxyGetter () {
- return vm._data[key]
- },
- set: function proxySetter (val) {
- vm._data[key] = val;
- }
- });
- }
- }
-
- /* */
-
- var uid = 0;
-
- function initMixin (Vue) {
- Vue.prototype._init = function (options) {
- var vm = this;
- // a uid
- vm._uid = uid++;
- // a flag to avoid this being observed
- vm._isVue = true;
- // merge options
- if (options && options._isComponent) {
- // optimize internal component instantiation
- // since dynamic options merging is pretty slow, and none of the
- // internal component options needs special treatment.
- initInternalComponent(vm, options);
- } else {
- vm.$options = mergeOptions(
- resolveConstructorOptions(vm.constructor),
- options || {},
- vm
- );
- }
- /* istanbul ignore else */
- {
- initProxy(vm);
- }
- // expose real self
- vm._self = vm;
- initLifecycle(vm);
- initEvents(vm);
- initRender(vm);
- callHook(vm, 'beforeCreate');
- initState(vm);
- callHook(vm, 'created');
- if (vm.$options.el) {
- vm.$mount(vm.$options.el);
- }
- };
- }
-
- function initInternalComponent (vm, options) {
- var opts = vm.$options = Object.create(vm.constructor.options);
- // doing this because it's faster than dynamic enumeration.
- opts.parent = options.parent;
- opts.propsData = options.propsData;
- opts._parentVnode = options._parentVnode;
- opts._parentListeners = options._parentListeners;
- opts._renderChildren = options._renderChildren;
- opts._componentTag = options._componentTag;
- opts._parentElm = options._parentElm;
- opts._refElm = options._refElm;
- if (options.render) {
- opts.render = options.render;
- opts.staticRenderFns = options.staticRenderFns;
- }
- }
-
- function resolveConstructorOptions (Ctor) {
- var options = Ctor.options;
- if (Ctor.super) {
- var superOptions = Ctor.super.options;
- var cachedSuperOptions = Ctor.superOptions;
- var extendOptions = Ctor.extendOptions;
- if (superOptions !== cachedSuperOptions) {
- // super option changed
- Ctor.superOptions = superOptions;
- extendOptions.render = options.render;
- extendOptions.staticRenderFns = options.staticRenderFns;
- extendOptions._scopeId = options._scopeId;
- options = Ctor.options = mergeOptions(superOptions, extendOptions);
- if (options.name) {
- options.components[options.name] = Ctor;
- }
- }
- }
- return options
- }
-
- function Vue$3 (options) {
- if ("development" !== 'production' &&
- !(this instanceof Vue$3)) {
- warn('Vue is a constructor and should be called with the `new` keyword');
- }
- this._init(options);
- }
-
- initMixin(Vue$3);
- stateMixin(Vue$3);
- eventsMixin(Vue$3);
- lifecycleMixin(Vue$3);
- renderMixin(Vue$3);
-
- /* */
-
- function initUse (Vue) {
- Vue.use = function (plugin) {
- /* istanbul ignore if */
- if (plugin.installed) {
- return
- }
- // additional parameters
- var args = toArray(arguments, 1);
- args.unshift(this);
- if (typeof plugin.install === 'function') {
- plugin.install.apply(plugin, args);
- } else {
- plugin.apply(null, args);
- }
- plugin.installed = true;
- return this
- };
- }
-
- /* */
-
- function initMixin$1 (Vue) {
- Vue.mixin = function (mixin) {
- this.options = mergeOptions(this.options, mixin);
- };
- }
-
- /* */
-
- function initExtend (Vue) {
- /**
- * Each instance constructor, including Vue, has a unique
- * cid. This enables us to create wrapped "child
- * constructors" for prototypal inheritance and cache them.
- */
- Vue.cid = 0;
- var cid = 1;
-
- /**
- * Class inheritance
- */
- Vue.extend = function (extendOptions) {
- extendOptions = extendOptions || {};
- var Super = this;
- var SuperId = Super.cid;
- var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
- if (cachedCtors[SuperId]) {
- return cachedCtors[SuperId]
- }
- var name = extendOptions.name || Super.options.name;
- {
- if (!/^[a-zA-Z][\w-]*$/.test(name)) {
- warn(
- 'Invalid component name: "' + name + '". Component names ' +
- 'can only contain alphanumeric characters and the hyphen, ' +
- 'and must start with a letter.'
- );
- }
- }
- var Sub = function VueComponent (options) {
- this._init(options);
- };
- Sub.prototype = Object.create(Super.prototype);
- Sub.prototype.constructor = Sub;
- Sub.cid = cid++;
- Sub.options = mergeOptions(
- Super.options,
- extendOptions
- );
- Sub['super'] = Super;
- // allow further extension/mixin/plugin usage
- Sub.extend = Super.extend;
- Sub.mixin = Super.mixin;
- Sub.use = Super.use;
- // create asset registers, so extended classes
- // can have their private assets too.
- config._assetTypes.forEach(function (type) {
- Sub[type] = Super[type];
- });
- // enable recursive self-lookup
- if (name) {
- Sub.options.components[name] = Sub;
- }
- // keep a reference to the super options at extension time.
- // later at instantiation we can check if Super's options have
- // been updated.
- Sub.superOptions = Super.options;
- Sub.extendOptions = extendOptions;
- // cache constructor
- cachedCtors[SuperId] = Sub;
- return Sub
- };
- }
-
- /* */
-
- function initAssetRegisters (Vue) {
- /**
- * Create asset registration methods.
- */
- config._assetTypes.forEach(function (type) {
- Vue[type] = function (
- id,
- definition
- ) {
- if (!definition) {
- return this.options[type + 's'][id]
- } else {
- /* istanbul ignore if */
- {
- if (type === 'component' && config.isReservedTag(id)) {
- warn(
- 'Do not use built-in or reserved HTML elements as component ' +
- 'id: ' + id
- );
- }
- }
- if (type === 'component' && isPlainObject(definition)) {
- definition.name = definition.name || id;
- definition = this.options._base.extend(definition);
- }
- if (type === 'directive' && typeof definition === 'function') {
- definition = { bind: definition, update: definition };
- }
- this.options[type + 's'][id] = definition;
- return definition
- }
- };
- });
- }
-
- /* */
-
- var patternTypes = [String, RegExp];
-
- function getComponentName (opts) {
- return opts && (opts.Ctor.options.name || opts.tag)
- }
-
- function matches (pattern, name) {
- if (typeof pattern === 'string') {
- return pattern.split(',').indexOf(name) > -1
- } else {
- return pattern.test(name)
- }
- }
-
- function pruneCache (cache, filter) {
- for (var key in cache) {
- var cachedNode = cache[key];
- if (cachedNode) {
- var name = getComponentName(cachedNode.componentOptions);
- if (name && !filter(name)) {
- pruneCacheEntry(cachedNode);
- cache[key] = null;
- }
- }
- }
- }
-
- function pruneCacheEntry (vnode) {
- if (vnode) {
- if (!vnode.componentInstance._inactive) {
- callHook(vnode.componentInstance, 'deactivated');
- }
- vnode.componentInstance.$destroy();
- }
- }
-
- var KeepAlive = {
- name: 'keep-alive',
- abstract: true,
-
- props: {
- include: patternTypes,
- exclude: patternTypes
- },
-
- created: function created () {
- this.cache = Object.create(null);
- },
-
- destroyed: function destroyed () {
- var this$1 = this;
-
- for (var key in this.cache) {
- pruneCacheEntry(this$1.cache[key]);
- }
- },
-
- watch: {
- include: function include (val) {
- pruneCache(this.cache, function (name) { return matches(val, name); });
- },
- exclude: function exclude (val) {
- pruneCache(this.cache, function (name) { return !matches(val, name); });
- }
- },
-
- render: function render () {
- var vnode = getFirstComponentChild(this.$slots.default);
- var componentOptions = vnode && vnode.componentOptions;
- if (componentOptions) {
- // check pattern
- var name = getComponentName(componentOptions);
- if (name && (
- (this.include && !matches(this.include, name)) ||
- (this.exclude && matches(this.exclude, name))
- )) {
- return vnode
- }
- var key = vnode.key == null
- // same constructor may get registered as different local components
- // so cid alone is not enough (#3269)
- ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
- : vnode.key;
- if (this.cache[key]) {
- vnode.componentInstance = this.cache[key].componentInstance;
- } else {
- this.cache[key] = vnode;
- }
- vnode.data.keepAlive = true;
- }
- return vnode
- }
- };
-
- var builtInComponents = {
- KeepAlive: KeepAlive
- };
-
- /* */
-
- function initGlobalAPI (Vue) {
- // config
- var configDef = {};
- configDef.get = function () { return config; };
- {
- configDef.set = function () {
- warn(
- 'Do not replace the Vue.config object, set individual fields instead.'
- );
- };
- }
- Object.defineProperty(Vue, 'config', configDef);
- Vue.util = util;
- Vue.set = set$1;
- Vue.delete = del;
- Vue.nextTick = nextTick;
-
- Vue.options = Object.create(null);
- config._assetTypes.forEach(function (type) {
- Vue.options[type + 's'] = Object.create(null);
- });
-
- // this is used to identify the "base" constructor to extend all plain-object
- // components with in Weex's multi-instance scenarios.
- Vue.options._base = Vue;
-
- extend(Vue.options.components, builtInComponents);
-
- initUse(Vue);
- initMixin$1(Vue);
- initExtend(Vue);
- initAssetRegisters(Vue);
- }
-
- initGlobalAPI(Vue$3);
-
- Object.defineProperty(Vue$3.prototype, '$isServer', {
- get: isServerRendering
- });
-
- Vue$3.version = '2.1.10';
-
- /* */
-
- // attributes that should be using props for binding
- var acceptValue = makeMap('input,textarea,option,select');
- var mustUseProp = function (tag, type, attr) {
- return (
- (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
- (attr === 'selected' && tag === 'option') ||
- (attr === 'checked' && tag === 'input') ||
- (attr === 'muted' && tag === 'video')
- )
- };
-
- var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
-
- var isBooleanAttr = makeMap(
- 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
- 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
- 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
- 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
- 'required,reversed,scoped,seamless,selected,sortable,translate,' +
- 'truespeed,typemustmatch,visible'
- );
-
- var xlinkNS = 'http://www.w3.org/1999/xlink';
-
- var isXlink = function (name) {
- return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
- };
-
- var getXlinkProp = function (name) {
- return isXlink(name) ? name.slice(6, name.length) : ''
- };
-
- var isFalsyAttrValue = function (val) {
- return val == null || val === false
- };
-
- /* */
-
- function genClassForVnode (vnode) {
- var data = vnode.data;
- var parentNode = vnode;
- var childNode = vnode;
- while (childNode.componentInstance) {
- childNode = childNode.componentInstance._vnode;
- if (childNode.data) {
- data = mergeClassData(childNode.data, data);
- }
- }
- while ((parentNode = parentNode.parent)) {
- if (parentNode.data) {
- data = mergeClassData(data, parentNode.data);
- }
- }
- return genClassFromData(data)
- }
-
- function mergeClassData (child, parent) {
- return {
- staticClass: concat(child.staticClass, parent.staticClass),
- class: child.class
- ? [child.class, parent.class]
- : parent.class
- }
- }
-
- function genClassFromData (data) {
- var dynamicClass = data.class;
- var staticClass = data.staticClass;
- if (staticClass || dynamicClass) {
- return concat(staticClass, stringifyClass(dynamicClass))
- }
- /* istanbul ignore next */
- return ''
- }
-
- function concat (a, b) {
- return a ? b ? (a + ' ' + b) : a : (b || '')
- }
-
- function stringifyClass (value) {
- var res = '';
- if (!value) {
- return res
- }
- if (typeof value === 'string') {
- return value
- }
- if (Array.isArray(value)) {
- var stringified;
- for (var i = 0, l = value.length; i < l; i++) {
- if (value[i]) {
- if ((stringified = stringifyClass(value[i]))) {
- res += stringified + ' ';
- }
- }
- }
- return res.slice(0, -1)
- }
- if (isObject(value)) {
- for (var key in value) {
- if (value[key]) { res += key + ' '; }
- }
- return res.slice(0, -1)
- }
- /* istanbul ignore next */
- return res
- }
-
- /* */
-
- var namespaceMap = {
- svg: 'http://www.w3.org/2000/svg',
- math: 'http://www.w3.org/1998/Math/MathML'
- };
-
- var isHTMLTag = makeMap(
- 'html,body,base,head,link,meta,style,title,' +
- 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
- 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
- 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
- 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
- 'embed,object,param,source,canvas,script,noscript,del,ins,' +
- 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
- 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
- 'output,progress,select,textarea,' +
- 'details,dialog,menu,menuitem,summary,' +
- 'content,element,shadow,template'
- );
-
- // this map is intentionally selective, only covering SVG elements that may
- // contain child elements.
- var isSVG = makeMap(
- 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' +
- 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
- 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
- true
- );
-
- var isPreTag = function (tag) { return tag === 'pre'; };
-
- var isReservedTag = function (tag) {
- return isHTMLTag(tag) || isSVG(tag)
- };
-
- function getTagNamespace (tag) {
- if (isSVG(tag)) {
- return 'svg'
- }
- // basic support for MathML
- // note it doesn't support other MathML elements being component roots
- if (tag === 'math') {
- return 'math'
- }
- }
-
- var unknownElementCache = Object.create(null);
- function isUnknownElement (tag) {
- /* istanbul ignore if */
- if (!inBrowser) {
- return true
- }
- if (isReservedTag(tag)) {
- return false
- }
- tag = tag.toLowerCase();
- /* istanbul ignore if */
- if (unknownElementCache[tag] != null) {
- return unknownElementCache[tag]
- }
- var el = document.createElement(tag);
- if (tag.indexOf('-') > -1) {
- // http://stackoverflow.com/a/28210364/1070244
- return (unknownElementCache[tag] = (
- el.constructor === window.HTMLUnknownElement ||
- el.constructor === window.HTMLElement
- ))
- } else {
- return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
- }
- }
-
- /* */
-
- /**
- * Query an element selector if it's not an element already.
- */
- function query (el) {
- if (typeof el === 'string') {
- var selector = el;
- el = document.querySelector(el);
- if (!el) {
- "development" !== 'production' && warn(
- 'Cannot find element: ' + selector
- );
- return document.createElement('div')
- }
- }
- return el
- }
-
- /* */
-
- function createElement$1 (tagName, vnode) {
- var elm = document.createElement(tagName);
- if (tagName !== 'select') {
- return elm
- }
- if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
- elm.setAttribute('multiple', 'multiple');
- }
- return elm
- }
-
- function createElementNS (namespace, tagName) {
- return document.createElementNS(namespaceMap[namespace], tagName)
- }
-
- function createTextNode (text) {
- return document.createTextNode(text)
- }
-
- function createComment (text) {
- return document.createComment(text)
- }
-
- function insertBefore (parentNode, newNode, referenceNode) {
- parentNode.insertBefore(newNode, referenceNode);
- }
-
- function removeChild (node, child) {
- node.removeChild(child);
- }
-
- function appendChild (node, child) {
- node.appendChild(child);
- }
-
- function parentNode (node) {
- return node.parentNode
- }
-
- function nextSibling (node) {
- return node.nextSibling
- }
-
- function tagName (node) {
- return node.tagName
- }
-
- function setTextContent (node, text) {
- node.textContent = text;
- }
-
- function setAttribute (node, key, val) {
- node.setAttribute(key, val);
- }
-
-
- var nodeOps = Object.freeze({
- createElement: createElement$1,
- createElementNS: createElementNS,
- createTextNode: createTextNode,
- createComment: createComment,
- insertBefore: insertBefore,
- removeChild: removeChild,
- appendChild: appendChild,
- parentNode: parentNode,
- nextSibling: nextSibling,
- tagName: tagName,
- setTextContent: setTextContent,
- setAttribute: setAttribute
- });
-
- /* */
-
- var ref = {
- create: function create (_, vnode) {
- registerRef(vnode);
- },
- update: function update (oldVnode, vnode) {
- if (oldVnode.data.ref !== vnode.data.ref) {
- registerRef(oldVnode, true);
- registerRef(vnode);
- }
- },
- destroy: function destroy (vnode) {
- registerRef(vnode, true);
- }
- };
-
- function registerRef (vnode, isRemoval) {
- var key = vnode.data.ref;
- if (!key) { return }
-
- var vm = vnode.context;
- var ref = vnode.componentInstance || vnode.elm;
- var refs = vm.$refs;
- if (isRemoval) {
- if (Array.isArray(refs[key])) {
- remove$1(refs[key], ref);
- } else if (refs[key] === ref) {
- refs[key] = undefined;
- }
- } else {
- if (vnode.data.refInFor) {
- if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
- refs[key].push(ref);
- } else {
- refs[key] = [ref];
- }
- } else {
- refs[key] = ref;
- }
- }
- }
-
- /**
- * Virtual DOM patching algorithm based on Snabbdom by
- * Simon Friis Vindum (@paldepind)
- * Licensed under the MIT License
- * https://github.com/paldepind/snabbdom/blob/master/LICENSE
- *
- * modified by Evan You (@yyx990803)
- *
-
- /*
- * Not type-checking this because this file is perf-critical and the cost
- * of making flow understand it is not worth it.
- */
-
- var emptyNode = new VNode('', {}, []);
-
- var hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];
-
- function isUndef (s) {
- return s == null
- }
-
- function isDef (s) {
- return s != null
- }
-
- function sameVnode (vnode1, vnode2) {
- return (
- vnode1.key === vnode2.key &&
- vnode1.tag === vnode2.tag &&
- vnode1.isComment === vnode2.isComment &&
- !vnode1.data === !vnode2.data
- )
- }
-
- function createKeyToOldIdx (children, beginIdx, endIdx) {
- var i, key;
- var map = {};
- for (i = beginIdx; i <= endIdx; ++i) {
- key = children[i].key;
- if (isDef(key)) { map[key] = i; }
- }
- return map
- }
-
- function createPatchFunction (backend) {
- var i, j;
- var cbs = {};
-
- var modules = backend.modules;
- var nodeOps = backend.nodeOps;
-
- for (i = 0; i < hooks$1.length; ++i) {
- cbs[hooks$1[i]] = [];
- for (j = 0; j < modules.length; ++j) {
- if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }
- }
- }
-
- function emptyNodeAt (elm) {
- return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
- }
-
- function createRmCb (childElm, listeners) {
- function remove$$1 () {
- if (--remove$$1.listeners === 0) {
- removeNode(childElm);
- }
- }
- remove$$1.listeners = listeners;
- return remove$$1
- }
-
- function removeNode (el) {
- var parent = nodeOps.parentNode(el);
- // element may have already been removed due to v-html / v-text
- if (parent) {
- nodeOps.removeChild(parent, el);
- }
- }
-
- var inPre = 0;
- function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
- vnode.isRootInsert = !nested; // for transition enter check
- if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
- return
- }
-
- var data = vnode.data;
- var children = vnode.children;
- var tag = vnode.tag;
- if (isDef(tag)) {
- {
- if (data && data.pre) {
- inPre++;
- }
- if (
- !inPre &&
- !vnode.ns &&
- !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
- config.isUnknownElement(tag)
- ) {
- warn(
- 'Unknown custom element: <' + tag + '> - did you ' +
- 'register the component correctly? For recursive components, ' +
- 'make sure to provide the "name" option.',
- vnode.context
- );
- }
- }
- vnode.elm = vnode.ns
- ? nodeOps.createElementNS(vnode.ns, tag)
- : nodeOps.createElement(tag, vnode);
- setScope(vnode);
-
- /* istanbul ignore if */
- {
- createChildren(vnode, children, insertedVnodeQueue);
- if (isDef(data)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- }
- insert(parentElm, vnode.elm, refElm);
- }
-
- if ("development" !== 'production' && data && data.pre) {
- inPre--;
- }
- } else if (vnode.isComment) {
- vnode.elm = nodeOps.createComment(vnode.text);
- insert(parentElm, vnode.elm, refElm);
- } else {
- vnode.elm = nodeOps.createTextNode(vnode.text);
- insert(parentElm, vnode.elm, refElm);
- }
- }
-
- function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- var i = vnode.data;
- if (isDef(i)) {
- var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
- if (isDef(i = i.hook) && isDef(i = i.init)) {
- i(vnode, false /* hydrating */, parentElm, refElm);
- }
- // after calling the init hook, if the vnode is a child component
- // it should've created a child instance and mounted it. the child
- // component also has set the placeholder vnode's elm.
- // in that case we can just return the element and be done.
- if (isDef(vnode.componentInstance)) {
- initComponent(vnode, insertedVnodeQueue);
- if (isReactivated) {
- reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
- }
- return true
- }
- }
- }
-
- function initComponent (vnode, insertedVnodeQueue) {
- if (vnode.data.pendingInsert) {
- insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
- }
- vnode.elm = vnode.componentInstance.$el;
- if (isPatchable(vnode)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- setScope(vnode);
- } else {
- // empty component root.
- // skip all element-related modules except for ref (#3455)
- registerRef(vnode);
- // make sure to invoke the insert hook
- insertedVnodeQueue.push(vnode);
- }
- }
-
- function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- var i;
- // hack for #4339: a reactivated component with inner transition
- // does not trigger because the inner node's created hooks are not called
- // again. It's not ideal to involve module-specific logic in here but
- // there doesn't seem to be a better way to do it.
- var innerNode = vnode;
- while (innerNode.componentInstance) {
- innerNode = innerNode.componentInstance._vnode;
- if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
- for (i = 0; i < cbs.activate.length; ++i) {
- cbs.activate[i](emptyNode, innerNode);
- }
- insertedVnodeQueue.push(innerNode);
- break
- }
- }
- // unlike a newly created component,
- // a reactivated keep-alive component doesn't insert itself
- insert(parentElm, vnode.elm, refElm);
- }
-
- function insert (parent, elm, ref) {
- if (parent) {
- if (ref) {
- nodeOps.insertBefore(parent, elm, ref);
- } else {
- nodeOps.appendChild(parent, elm);
- }
- }
- }
-
- function createChildren (vnode, children, insertedVnodeQueue) {
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; ++i) {
- createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
- }
- } else if (isPrimitive(vnode.text)) {
- nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
- }
- }
-
- function isPatchable (vnode) {
- while (vnode.componentInstance) {
- vnode = vnode.componentInstance._vnode;
- }
- return isDef(vnode.tag)
- }
-
- function invokeCreateHooks (vnode, insertedVnodeQueue) {
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
- cbs.create[i$1](emptyNode, vnode);
- }
- i = vnode.data.hook; // Reuse variable
- if (isDef(i)) {
- if (i.create) { i.create(emptyNode, vnode); }
- if (i.insert) { insertedVnodeQueue.push(vnode); }
- }
- }
-
- // set scope id attribute for scoped CSS.
- // this is implemented as a special case to avoid the overhead
- // of going through the normal attribute patching process.
- function setScope (vnode) {
- var i;
- if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {
- nodeOps.setAttribute(vnode.elm, i, '');
- }
- if (isDef(i = activeInstance) &&
- i !== vnode.context &&
- isDef(i = i.$options._scopeId)) {
- nodeOps.setAttribute(vnode.elm, i, '');
- }
- }
-
- function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
- for (; startIdx <= endIdx; ++startIdx) {
- createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
- }
- }
-
- function invokeDestroyHook (vnode) {
- var i, j;
- var data = vnode.data;
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
- for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
- }
- if (isDef(i = vnode.children)) {
- for (j = 0; j < vnode.children.length; ++j) {
- invokeDestroyHook(vnode.children[j]);
- }
- }
- }
-
- function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
- for (; startIdx <= endIdx; ++startIdx) {
- var ch = vnodes[startIdx];
- if (isDef(ch)) {
- if (isDef(ch.tag)) {
- removeAndInvokeRemoveHook(ch);
- invokeDestroyHook(ch);
- } else { // Text node
- removeNode(ch.elm);
- }
- }
- }
- }
-
- function removeAndInvokeRemoveHook (vnode, rm) {
- if (rm || isDef(vnode.data)) {
- var listeners = cbs.remove.length + 1;
- if (!rm) {
- // directly removing
- rm = createRmCb(vnode.elm, listeners);
- } else {
- // we have a recursively passed down rm callback
- // increase the listeners count
- rm.listeners += listeners;
- }
- // recursively invoke hooks on child component root node
- if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
- removeAndInvokeRemoveHook(i, rm);
- }
- for (i = 0; i < cbs.remove.length; ++i) {
- cbs.remove[i](vnode, rm);
- }
- if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
- i(vnode, rm);
- } else {
- rm();
- }
- } else {
- removeNode(vnode.elm);
- }
- }
-
- function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
- var oldStartIdx = 0;
- var newStartIdx = 0;
- var oldEndIdx = oldCh.length - 1;
- var oldStartVnode = oldCh[0];
- var oldEndVnode = oldCh[oldEndIdx];
- var newEndIdx = newCh.length - 1;
- var newStartVnode = newCh[0];
- var newEndVnode = newCh[newEndIdx];
- var oldKeyToIdx, idxInOld, elmToMove, refElm;
-
- // removeOnly is a special flag used only by <transition-group>
- // to ensure removed elements stay in correct relative positions
- // during leaving transitions
- var canMove = !removeOnly;
-
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
- if (isUndef(oldStartVnode)) {
- oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
- } else if (isUndef(oldEndVnode)) {
- oldEndVnode = oldCh[--oldEndIdx];
- } else if (sameVnode(oldStartVnode, newStartVnode)) {
- patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
- oldStartVnode = oldCh[++oldStartIdx];
- newStartVnode = newCh[++newStartIdx];
- } else if (sameVnode(oldEndVnode, newEndVnode)) {
- patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
- oldEndVnode = oldCh[--oldEndIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
- patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
- canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
- oldStartVnode = oldCh[++oldStartIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
- patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
- canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
- oldEndVnode = oldCh[--oldEndIdx];
- newStartVnode = newCh[++newStartIdx];
- } else {
- if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
- idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
- if (isUndef(idxInOld)) { // New element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
- newStartVnode = newCh[++newStartIdx];
- } else {
- elmToMove = oldCh[idxInOld];
- /* istanbul ignore if */
- if ("development" !== 'production' && !elmToMove) {
- warn(
- 'It seems there are duplicate keys that is causing an update error. ' +
- 'Make sure each v-for item has a unique key.'
- );
- }
- if (sameVnode(elmToMove, newStartVnode)) {
- patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
- oldCh[idxInOld] = undefined;
- canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
- newStartVnode = newCh[++newStartIdx];
- } else {
- // same key but different element. treat as new element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
- newStartVnode = newCh[++newStartIdx];
- }
- }
- }
- }
- if (oldStartIdx > oldEndIdx) {
- refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
- addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
- } else if (newStartIdx > newEndIdx) {
- removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
- }
- }
-
- function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
- if (oldVnode === vnode) {
- return
- }
- // reuse element for static trees.
- // note we only do this if the vnode is cloned -
- // if the new node is not cloned it means the render functions have been
- // reset by the hot-reload-api and we need to do a proper re-render.
- if (vnode.isStatic &&
- oldVnode.isStatic &&
- vnode.key === oldVnode.key &&
- (vnode.isCloned || vnode.isOnce)) {
- vnode.elm = oldVnode.elm;
- vnode.componentInstance = oldVnode.componentInstance;
- return
- }
- var i;
- var data = vnode.data;
- var hasData = isDef(data);
- if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {
- i(oldVnode, vnode);
- }
- var elm = vnode.elm = oldVnode.elm;
- var oldCh = oldVnode.children;
- var ch = vnode.children;
- if (hasData && isPatchable(vnode)) {
- for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
- if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
- }
- if (isUndef(vnode.text)) {
- if (isDef(oldCh) && isDef(ch)) {
- if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
- } else if (isDef(ch)) {
- if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
- addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
- } else if (isDef(oldCh)) {
- removeVnodes(elm, oldCh, 0, oldCh.length - 1);
- } else if (isDef(oldVnode.text)) {
- nodeOps.setTextContent(elm, '');
- }
- } else if (oldVnode.text !== vnode.text) {
- nodeOps.setTextContent(elm, vnode.text);
- }
- if (hasData) {
- if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
- }
- }
-
- function invokeInsertHook (vnode, queue, initial) {
- // delay insert hooks for component root nodes, invoke them after the
- // element is really inserted
- if (initial && vnode.parent) {
- vnode.parent.data.pendingInsert = queue;
- } else {
- for (var i = 0; i < queue.length; ++i) {
- queue[i].data.hook.insert(queue[i]);
- }
- }
- }
-
- var bailed = false;
- // list of modules that can skip create hook during hydration because they
- // are already rendered on the client or has no need for initialization
- var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
-
- // Note: this is a browser-only function so we can assume elms are DOM nodes.
- function hydrate (elm, vnode, insertedVnodeQueue) {
- {
- if (!assertNodeMatch(elm, vnode)) {
- return false
- }
- }
- vnode.elm = elm;
- var tag = vnode.tag;
- var data = vnode.data;
- var children = vnode.children;
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
- if (isDef(i = vnode.componentInstance)) {
- // child component. it should have hydrated its own tree.
- initComponent(vnode, insertedVnodeQueue);
- return true
- }
- }
- if (isDef(tag)) {
- if (isDef(children)) {
- // empty element, allow client to pick up and populate children
- if (!elm.hasChildNodes()) {
- createChildren(vnode, children, insertedVnodeQueue);
- } else {
- var childrenMatch = true;
- var childNode = elm.firstChild;
- for (var i$1 = 0; i$1 < children.length; i$1++) {
- if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
- childrenMatch = false;
- break
- }
- childNode = childNode.nextSibling;
- }
- // if childNode is not null, it means the actual childNodes list is
- // longer than the virtual children list.
- if (!childrenMatch || childNode) {
- if ("development" !== 'production' &&
- typeof console !== 'undefined' &&
- !bailed) {
- bailed = true;
- console.warn('Parent: ', elm);
- console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
- }
- return false
- }
- }
- }
- if (isDef(data)) {
- for (var key in data) {
- if (!isRenderedModule(key)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- break
- }
- }
- }
- } else if (elm.data !== vnode.text) {
- elm.data = vnode.text;
- }
- return true
- }
-
- function assertNodeMatch (node, vnode) {
- if (vnode.tag) {
- return (
- vnode.tag.indexOf('vue-component') === 0 ||
- vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
- )
- } else {
- return node.nodeType === (vnode.isComment ? 8 : 3)
- }
- }
-
- return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
- if (!vnode) {
- if (oldVnode) { invokeDestroyHook(oldVnode); }
- return
- }
-
- var isInitialPatch = false;
- var insertedVnodeQueue = [];
-
- if (!oldVnode) {
- // empty mount (likely as component), create new root element
- isInitialPatch = true;
- createElm(vnode, insertedVnodeQueue, parentElm, refElm);
- } else {
- var isRealElement = isDef(oldVnode.nodeType);
- if (!isRealElement && sameVnode(oldVnode, vnode)) {
- // patch existing root node
- patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
- } else {
- if (isRealElement) {
- // mounting to a real element
- // check if this is server-rendered content and if we can perform
- // a successful hydration.
- if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {
- oldVnode.removeAttribute('server-rendered');
- hydrating = true;
- }
- if (hydrating) {
- if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
- invokeInsertHook(vnode, insertedVnodeQueue, true);
- return oldVnode
- } else {
- warn(
- 'The client-side rendered virtual DOM tree is not matching ' +
- 'server-rendered content. This is likely caused by incorrect ' +
- 'HTML markup, for example nesting block-level elements inside ' +
- '<p>, or missing <tbody>. Bailing hydration and performing ' +
- 'full client-side render.'
- );
- }
- }
- // either not server-rendered, or hydration failed.
- // create an empty node and replace it
- oldVnode = emptyNodeAt(oldVnode);
- }
- // replacing existing element
- var oldElm = oldVnode.elm;
- var parentElm$1 = nodeOps.parentNode(oldElm);
- createElm(
- vnode,
- insertedVnodeQueue,
- // extremely rare edge case: do not insert if old element is in a
- // leaving transition. Only happens when combining transition +
- // keep-alive + HOCs. (#4590)
- oldElm._leaveCb ? null : parentElm$1,
- nodeOps.nextSibling(oldElm)
- );
-
- if (vnode.parent) {
- // component root element replaced.
- // update parent placeholder node element, recursively
- var ancestor = vnode.parent;
- while (ancestor) {
- ancestor.elm = vnode.elm;
- ancestor = ancestor.parent;
- }
- if (isPatchable(vnode)) {
- for (var i = 0; i < cbs.create.length; ++i) {
- cbs.create[i](emptyNode, vnode.parent);
- }
- }
- }
-
- if (parentElm$1 !== null) {
- removeVnodes(parentElm$1, [oldVnode], 0, 0);
- } else if (isDef(oldVnode.tag)) {
- invokeDestroyHook(oldVnode);
- }
- }
- }
-
- invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
- return vnode.elm
- }
- }
-
- /* */
-
- var directives = {
- create: updateDirectives,
- update: updateDirectives,
- destroy: function unbindDirectives (vnode) {
- updateDirectives(vnode, emptyNode);
- }
- };
-
- function updateDirectives (oldVnode, vnode) {
- if (oldVnode.data.directives || vnode.data.directives) {
- _update(oldVnode, vnode);
- }
- }
-
- function _update (oldVnode, vnode) {
- var isCreate = oldVnode === emptyNode;
- var isDestroy = vnode === emptyNode;
- var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
- var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
-
- var dirsWithInsert = [];
- var dirsWithPostpatch = [];
-
- var key, oldDir, dir;
- for (key in newDirs) {
- oldDir = oldDirs[key];
- dir = newDirs[key];
- if (!oldDir) {
- // new directive, bind
- callHook$1(dir, 'bind', vnode, oldVnode);
- if (dir.def && dir.def.inserted) {
- dirsWithInsert.push(dir);
- }
- } else {
- // existing directive, update
- dir.oldValue = oldDir.value;
- callHook$1(dir, 'update', vnode, oldVnode);
- if (dir.def && dir.def.componentUpdated) {
- dirsWithPostpatch.push(dir);
- }
- }
- }
-
- if (dirsWithInsert.length) {
- var callInsert = function () {
- for (var i = 0; i < dirsWithInsert.length; i++) {
- callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
- }
- };
- if (isCreate) {
- mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');
- } else {
- callInsert();
- }
- }
-
- if (dirsWithPostpatch.length) {
- mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
- for (var i = 0; i < dirsWithPostpatch.length; i++) {
- callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
- }
- }, 'dir-postpatch');
- }
-
- if (!isCreate) {
- for (key in oldDirs) {
- if (!newDirs[key]) {
- // no longer present, unbind
- callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
- }
- }
- }
- }
-
- var emptyModifiers = Object.create(null);
-
- function normalizeDirectives$1 (
- dirs,
- vm
- ) {
- var res = Object.create(null);
- if (!dirs) {
- return res
- }
- var i, dir;
- for (i = 0; i < dirs.length; i++) {
- dir = dirs[i];
- if (!dir.modifiers) {
- dir.modifiers = emptyModifiers;
- }
- res[getRawDirName(dir)] = dir;
- dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
- }
- return res
- }
-
- function getRawDirName (dir) {
- return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
- }
-
- function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
- var fn = dir.def && dir.def[hook];
- if (fn) {
- fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
- }
- }
-
- var baseModules = [
- ref,
- directives
- ];
-
- /* */
-
- function updateAttrs (oldVnode, vnode) {
- if (!oldVnode.data.attrs && !vnode.data.attrs) {
- return
- }
- var key, cur, old;
- var elm = vnode.elm;
- var oldAttrs = oldVnode.data.attrs || {};
- var attrs = vnode.data.attrs || {};
- // clone observed objects, as the user probably wants to mutate it
- if (attrs.__ob__) {
- attrs = vnode.data.attrs = extend({}, attrs);
- }
-
- for (key in attrs) {
- cur = attrs[key];
- old = oldAttrs[key];
- if (old !== cur) {
- setAttr(elm, key, cur);
- }
- }
- // #4391: in IE9, setting type can reset value for input[type=radio]
- /* istanbul ignore if */
- if (isIE9 && attrs.value !== oldAttrs.value) {
- setAttr(elm, 'value', attrs.value);
- }
- for (key in oldAttrs) {
- if (attrs[key] == null) {
- if (isXlink(key)) {
- elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
- } else if (!isEnumeratedAttr(key)) {
- elm.removeAttribute(key);
- }
- }
- }
- }
-
- function setAttr (el, key, value) {
- if (isBooleanAttr(key)) {
- // set attribute for blank value
- // e.g. <option disabled>Select one</option>
- if (isFalsyAttrValue(value)) {
- el.removeAttribute(key);
- } else {
- el.setAttribute(key, key);
- }
- } else if (isEnumeratedAttr(key)) {
- el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
- } else if (isXlink(key)) {
- if (isFalsyAttrValue(value)) {
- el.removeAttributeNS(xlinkNS, getXlinkProp(key));
- } else {
- el.setAttributeNS(xlinkNS, key, value);
- }
- } else {
- if (isFalsyAttrValue(value)) {
- el.removeAttribute(key);
- } else {
- el.setAttribute(key, value);
- }
- }
- }
-
- var attrs = {
- create: updateAttrs,
- update: updateAttrs
- };
-
- /* */
-
- function updateClass (oldVnode, vnode) {
- var el = vnode.elm;
- var data = vnode.data;
- var oldData = oldVnode.data;
- if (!data.staticClass && !data.class &&
- (!oldData || (!oldData.staticClass && !oldData.class))) {
- return
- }
-
- var cls = genClassForVnode(vnode);
-
- // handle transition classes
- var transitionClass = el._transitionClasses;
- if (transitionClass) {
- cls = concat(cls, stringifyClass(transitionClass));
- }
-
- // set the class
- if (cls !== el._prevClass) {
- el.setAttribute('class', cls);
- el._prevClass = cls;
- }
- }
-
- var klass = {
- create: updateClass,
- update: updateClass
- };
-
- /* */
-
- var target$1;
-
- function add$2 (
- event,
- handler,
- once,
- capture
- ) {
- if (once) {
- var oldHandler = handler;
- var _target = target$1; // save current target element in closure
- handler = function (ev) {
- remove$3(event, handler, capture, _target);
- arguments.length === 1
- ? oldHandler(ev)
- : oldHandler.apply(null, arguments);
- };
- }
- target$1.addEventListener(event, handler, capture);
- }
-
- function remove$3 (
- event,
- handler,
- capture,
- _target
- ) {
- (_target || target$1).removeEventListener(event, handler, capture);
- }
-
- function updateDOMListeners (oldVnode, vnode) {
- if (!oldVnode.data.on && !vnode.data.on) {
- return
- }
- var on = vnode.data.on || {};
- var oldOn = oldVnode.data.on || {};
- target$1 = vnode.elm;
- updateListeners(on, oldOn, add$2, remove$3, vnode.context);
- }
-
- var events = {
- create: updateDOMListeners,
- update: updateDOMListeners
- };
-
- /* */
-
- function updateDOMProps (oldVnode, vnode) {
- if (!oldVnode.data.domProps && !vnode.data.domProps) {
- return
- }
- var key, cur;
- var elm = vnode.elm;
- var oldProps = oldVnode.data.domProps || {};
- var props = vnode.data.domProps || {};
- // clone observed objects, as the user probably wants to mutate it
- if (props.__ob__) {
- props = vnode.data.domProps = extend({}, props);
- }
-
- for (key in oldProps) {
- if (props[key] == null) {
- elm[key] = '';
- }
- }
- for (key in props) {
- cur = props[key];
- // ignore children if the node has textContent or innerHTML,
- // as these will throw away existing DOM nodes and cause removal errors
- // on subsequent patches (#3360)
- if (key === 'textContent' || key === 'innerHTML') {
- if (vnode.children) { vnode.children.length = 0; }
- if (cur === oldProps[key]) { continue }
- }
-
- if (key === 'value') {
- // store value as _value as well since
- // non-string values will be stringified
- elm._value = cur;
- // avoid resetting cursor position when value is the same
- var strCur = cur == null ? '' : String(cur);
- if (shouldUpdateValue(elm, vnode, strCur)) {
- elm.value = strCur;
- }
- } else {
- elm[key] = cur;
- }
- }
- }
-
- // check platforms/web/util/attrs.js acceptValue
-
-
- function shouldUpdateValue (
- elm,
- vnode,
- checkVal
- ) {
- return (!elm.composing && (
- vnode.tag === 'option' ||
- isDirty(elm, checkVal) ||
- isInputChanged(vnode, checkVal)
- ))
- }
-
- function isDirty (elm, checkVal) {
- // return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value
- return document.activeElement !== elm && elm.value !== checkVal
- }
-
- function isInputChanged (vnode, newVal) {
- var value = vnode.elm.value;
- var modifiers = vnode.elm._vModifiers; // injected by v-model runtime
- if ((modifiers && modifiers.number) || vnode.elm.type === 'number') {
- return toNumber(value) !== toNumber(newVal)
- }
- if (modifiers && modifiers.trim) {
- return value.trim() !== newVal.trim()
- }
- return value !== newVal
- }
-
- var domProps = {
- create: updateDOMProps,
- update: updateDOMProps
- };
-
- /* */
-
- var parseStyleText = cached(function (cssText) {
- var res = {};
- var listDelimiter = /;(?![^(]*\))/g;
- var propertyDelimiter = /:(.+)/;
- cssText.split(listDelimiter).forEach(function (item) {
- if (item) {
- var tmp = item.split(propertyDelimiter);
- tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return res
- });
-
- // merge static and dynamic style data on the same vnode
- function normalizeStyleData (data) {
- var style = normalizeStyleBinding(data.style);
- // static style is pre-processed into an object during compilation
- // and is always a fresh object, so it's safe to merge into it
- return data.staticStyle
- ? extend(data.staticStyle, style)
- : style
- }
-
- // normalize possible array / string values into Object
- function normalizeStyleBinding (bindingStyle) {
- if (Array.isArray(bindingStyle)) {
- return toObject(bindingStyle)
- }
- if (typeof bindingStyle === 'string') {
- return parseStyleText(bindingStyle)
- }
- return bindingStyle
- }
-
- /**
- * parent component style should be after child's
- * so that parent component's style could override it
- */
- function getStyle (vnode, checkChild) {
- var res = {};
- var styleData;
-
- if (checkChild) {
- var childNode = vnode;
- while (childNode.componentInstance) {
- childNode = childNode.componentInstance._vnode;
- if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
- extend(res, styleData);
- }
- }
- }
-
- if ((styleData = normalizeStyleData(vnode.data))) {
- extend(res, styleData);
- }
-
- var parentNode = vnode;
- while ((parentNode = parentNode.parent)) {
- if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
- extend(res, styleData);
- }
- }
- return res
- }
-
- /* */
-
- var cssVarRE = /^--/;
- var importantRE = /\s*!important$/;
- var setProp = function (el, name, val) {
- /* istanbul ignore if */
- if (cssVarRE.test(name)) {
- el.style.setProperty(name, val);
- } else if (importantRE.test(val)) {
- el.style.setProperty(name, val.replace(importantRE, ''), 'important');
- } else {
- el.style[normalize(name)] = val;
- }
- };
-
- var prefixes = ['Webkit', 'Moz', 'ms'];
-
- var testEl;
- var normalize = cached(function (prop) {
- testEl = testEl || document.createElement('div');
- prop = camelize(prop);
- if (prop !== 'filter' && (prop in testEl.style)) {
- return prop
- }
- var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
- for (var i = 0; i < prefixes.length; i++) {
- var prefixed = prefixes[i] + upper;
- if (prefixed in testEl.style) {
- return prefixed
- }
- }
- });
-
- function updateStyle (oldVnode, vnode) {
- var data = vnode.data;
- var oldData = oldVnode.data;
-
- if (!data.staticStyle && !data.style &&
- !oldData.staticStyle && !oldData.style) {
- return
- }
-
- var cur, name;
- var el = vnode.elm;
- var oldStaticStyle = oldVnode.data.staticStyle;
- var oldStyleBinding = oldVnode.data.style || {};
-
- // if static style exists, stylebinding already merged into it when doing normalizeStyleData
- var oldStyle = oldStaticStyle || oldStyleBinding;
-
- var style = normalizeStyleBinding(vnode.data.style) || {};
-
- vnode.data.style = style.__ob__ ? extend({}, style) : style;
-
- var newStyle = getStyle(vnode, true);
-
- for (name in oldStyle) {
- if (newStyle[name] == null) {
- setProp(el, name, '');
- }
- }
- for (name in newStyle) {
- cur = newStyle[name];
- if (cur !== oldStyle[name]) {
- // ie9 setting to null has no effect, must use empty string
- setProp(el, name, cur == null ? '' : cur);
- }
- }
- }
-
- var style = {
- create: updateStyle,
- update: updateStyle
- };
-
- /* */
-
- /**
- * Add class with compatibility for SVG since classList is not supported on
- * SVG elements in IE
- */
- function addClass (el, cls) {
- /* istanbul ignore if */
- if (!cls || !cls.trim()) {
- return
- }
-
- /* istanbul ignore else */
- if (el.classList) {
- if (cls.indexOf(' ') > -1) {
- cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
- } else {
- el.classList.add(cls);
- }
- } else {
- var cur = ' ' + el.getAttribute('class') + ' ';
- if (cur.indexOf(' ' + cls + ' ') < 0) {
- el.setAttribute('class', (cur + cls).trim());
- }
- }
- }
-
- /**
- * Remove class with compatibility for SVG since classList is not supported on
- * SVG elements in IE
- */
- function removeClass (el, cls) {
- /* istanbul ignore if */
- if (!cls || !cls.trim()) {
- return
- }
-
- /* istanbul ignore else */
- if (el.classList) {
- if (cls.indexOf(' ') > -1) {
- cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
- } else {
- el.classList.remove(cls);
- }
- } else {
- var cur = ' ' + el.getAttribute('class') + ' ';
- var tar = ' ' + cls + ' ';
- while (cur.indexOf(tar) >= 0) {
- cur = cur.replace(tar, ' ');
- }
- el.setAttribute('class', cur.trim());
- }
- }
-
- /* */
-
- var hasTransition = inBrowser && !isIE9;
- var TRANSITION = 'transition';
- var ANIMATION = 'animation';
-
- // Transition property/event sniffing
- var transitionProp = 'transition';
- var transitionEndEvent = 'transitionend';
- var animationProp = 'animation';
- var animationEndEvent = 'animationend';
- if (hasTransition) {
- /* istanbul ignore if */
- if (window.ontransitionend === undefined &&
- window.onwebkittransitionend !== undefined) {
- transitionProp = 'WebkitTransition';
- transitionEndEvent = 'webkitTransitionEnd';
- }
- if (window.onanimationend === undefined &&
- window.onwebkitanimationend !== undefined) {
- animationProp = 'WebkitAnimation';
- animationEndEvent = 'webkitAnimationEnd';
- }
- }
-
- // binding to window is necessary to make hot reload work in IE in strict mode
- var raf = inBrowser && window.requestAnimationFrame
- ? window.requestAnimationFrame.bind(window)
- : setTimeout;
-
- function nextFrame (fn) {
- raf(function () {
- raf(fn);
- });
- }
-
- function addTransitionClass (el, cls) {
- (el._transitionClasses || (el._transitionClasses = [])).push(cls);
- addClass(el, cls);
- }
-
- function removeTransitionClass (el, cls) {
- if (el._transitionClasses) {
- remove$1(el._transitionClasses, cls);
- }
- removeClass(el, cls);
- }
-
- function whenTransitionEnds (
- el,
- expectedType,
- cb
- ) {
- var ref = getTransitionInfo(el, expectedType);
- var type = ref.type;
- var timeout = ref.timeout;
- var propCount = ref.propCount;
- if (!type) { return cb() }
- var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
- var ended = 0;
- var end = function () {
- el.removeEventListener(event, onEnd);
- cb();
- };
- var onEnd = function (e) {
- if (e.target === el) {
- if (++ended >= propCount) {
- end();
- }
- }
- };
- setTimeout(function () {
- if (ended < propCount) {
- end();
- }
- }, timeout + 1);
- el.addEventListener(event, onEnd);
- }
-
- var transformRE = /\b(transform|all)(,|$)/;
-
- function getTransitionInfo (el, expectedType) {
- var styles = window.getComputedStyle(el);
- var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');
- var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
- var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);
- var animationDelays = styles[animationProp + 'Delay'].split(', ');
- var animationDurations = styles[animationProp + 'Duration'].split(', ');
- var animationTimeout = getTimeout(animationDelays, animationDurations);
-
- var type;
- var timeout = 0;
- var propCount = 0;
- /* istanbul ignore if */
- if (expectedType === TRANSITION) {
- if (transitionTimeout > 0) {
- type = TRANSITION;
- timeout = transitionTimeout;
- propCount = transitionDurations.length;
- }
- } else if (expectedType === ANIMATION) {
- if (animationTimeout > 0) {
- type = ANIMATION;
- timeout = animationTimeout;
- propCount = animationDurations.length;
- }
- } else {
- timeout = Math.max(transitionTimeout, animationTimeout);
- type = timeout > 0
- ? transitionTimeout > animationTimeout
- ? TRANSITION
- : ANIMATION
- : null;
- propCount = type
- ? type === TRANSITION
- ? transitionDurations.length
- : animationDurations.length
- : 0;
- }
- var hasTransform =
- type === TRANSITION &&
- transformRE.test(styles[transitionProp + 'Property']);
- return {
- type: type,
- timeout: timeout,
- propCount: propCount,
- hasTransform: hasTransform
- }
- }
-
- function getTimeout (delays, durations) {
- /* istanbul ignore next */
- while (delays.length < durations.length) {
- delays = delays.concat(delays);
- }
-
- return Math.max.apply(null, durations.map(function (d, i) {
- return toMs(d) + toMs(delays[i])
- }))
- }
-
- function toMs (s) {
- return Number(s.slice(0, -1)) * 1000
- }
-
- /* */
-
- function enter (vnode, toggleDisplay) {
- var el = vnode.elm;
-
- // call leave callback now
- if (el._leaveCb) {
- el._leaveCb.cancelled = true;
- el._leaveCb();
- }
-
- var data = resolveTransition(vnode.data.transition);
- if (!data) {
- return
- }
-
- /* istanbul ignore if */
- if (el._enterCb || el.nodeType !== 1) {
- return
- }
-
- var css = data.css;
- var type = data.type;
- var enterClass = data.enterClass;
- var enterToClass = data.enterToClass;
- var enterActiveClass = data.enterActiveClass;
- var appearClass = data.appearClass;
- var appearToClass = data.appearToClass;
- var appearActiveClass = data.appearActiveClass;
- var beforeEnter = data.beforeEnter;
- var enter = data.enter;
- var afterEnter = data.afterEnter;
- var enterCancelled = data.enterCancelled;
- var beforeAppear = data.beforeAppear;
- var appear = data.appear;
- var afterAppear = data.afterAppear;
- var appearCancelled = data.appearCancelled;
-
- // activeInstance will always be the <transition> component managing this
- // transition. One edge case to check is when the <transition> is placed
- // as the root node of a child component. In that case we need to check
- // <transition>'s parent for appear check.
- var context = activeInstance;
- var transitionNode = activeInstance.$vnode;
- while (transitionNode && transitionNode.parent) {
- transitionNode = transitionNode.parent;
- context = transitionNode.context;
- }
-
- var isAppear = !context._isMounted || !vnode.isRootInsert;
-
- if (isAppear && !appear && appear !== '') {
- return
- }
-
- var startClass = isAppear ? appearClass : enterClass;
- var activeClass = isAppear ? appearActiveClass : enterActiveClass;
- var toClass = isAppear ? appearToClass : enterToClass;
- var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
- var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
- var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
- var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
-
- var expectsCSS = css !== false && !isIE9;
- var userWantsControl =
- enterHook &&
- // enterHook may be a bound method which exposes
- // the length of original fn as _length
- (enterHook._length || enterHook.length) > 1;
-
- var cb = el._enterCb = once(function () {
- if (expectsCSS) {
- removeTransitionClass(el, toClass);
- removeTransitionClass(el, activeClass);
- }
- if (cb.cancelled) {
- if (expectsCSS) {
- removeTransitionClass(el, startClass);
- }
- enterCancelledHook && enterCancelledHook(el);
- } else {
- afterEnterHook && afterEnterHook(el);
- }
- el._enterCb = null;
- });
-
- if (!vnode.data.show) {
- // remove pending leave element on enter by injecting an insert hook
- mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
- var parent = el.parentNode;
- var pendingNode = parent && parent._pending && parent._pending[vnode.key];
- if (pendingNode &&
- pendingNode.tag === vnode.tag &&
- pendingNode.elm._leaveCb) {
- pendingNode.elm._leaveCb();
- }
- enterHook && enterHook(el, cb);
- }, 'transition-insert');
- }
-
- // start enter transition
- beforeEnterHook && beforeEnterHook(el);
- if (expectsCSS) {
- addTransitionClass(el, startClass);
- addTransitionClass(el, activeClass);
- nextFrame(function () {
- addTransitionClass(el, toClass);
- removeTransitionClass(el, startClass);
- if (!cb.cancelled && !userWantsControl) {
- whenTransitionEnds(el, type, cb);
- }
- });
- }
-
- if (vnode.data.show) {
- toggleDisplay && toggleDisplay();
- enterHook && enterHook(el, cb);
- }
-
- if (!expectsCSS && !userWantsControl) {
- cb();
- }
- }
-
- function leave (vnode, rm) {
- var el = vnode.elm;
-
- // call enter callback now
- if (el._enterCb) {
- el._enterCb.cancelled = true;
- el._enterCb();
- }
-
- var data = resolveTransition(vnode.data.transition);
- if (!data) {
- return rm()
- }
-
- /* istanbul ignore if */
- if (el._leaveCb || el.nodeType !== 1) {
- return
- }
-
- var css = data.css;
- var type = data.type;
- var leaveClass = data.leaveClass;
- var leaveToClass = data.leaveToClass;
- var leaveActiveClass = data.leaveActiveClass;
- var beforeLeave = data.beforeLeave;
- var leave = data.leave;
- var afterLeave = data.afterLeave;
- var leaveCancelled = data.leaveCancelled;
- var delayLeave = data.delayLeave;
-
- var expectsCSS = css !== false && !isIE9;
- var userWantsControl =
- leave &&
- // leave hook may be a bound method which exposes
- // the length of original fn as _length
- (leave._length || leave.length) > 1;
-
- var cb = el._leaveCb = once(function () {
- if (el.parentNode && el.parentNode._pending) {
- el.parentNode._pending[vnode.key] = null;
- }
- if (expectsCSS) {
- removeTransitionClass(el, leaveToClass);
- removeTransitionClass(el, leaveActiveClass);
- }
- if (cb.cancelled) {
- if (expectsCSS) {
- removeTransitionClass(el, leaveClass);
- }
- leaveCancelled && leaveCancelled(el);
- } else {
- rm();
- afterLeave && afterLeave(el);
- }
- el._leaveCb = null;
- });
-
- if (delayLeave) {
- delayLeave(performLeave);
- } else {
- performLeave();
- }
-
- function performLeave () {
- // the delayed leave may have already been cancelled
- if (cb.cancelled) {
- return
- }
- // record leaving element
- if (!vnode.data.show) {
- (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
- }
- beforeLeave && beforeLeave(el);
- if (expectsCSS) {
- addTransitionClass(el, leaveClass);
- addTransitionClass(el, leaveActiveClass);
- nextFrame(function () {
- addTransitionClass(el, leaveToClass);
- removeTransitionClass(el, leaveClass);
- if (!cb.cancelled && !userWantsControl) {
- whenTransitionEnds(el, type, cb);
- }
- });
- }
- leave && leave(el, cb);
- if (!expectsCSS && !userWantsControl) {
- cb();
- }
- }
- }
-
- function resolveTransition (def$$1) {
- if (!def$$1) {
- return
- }
- /* istanbul ignore else */
- if (typeof def$$1 === 'object') {
- var res = {};
- if (def$$1.css !== false) {
- extend(res, autoCssTransition(def$$1.name || 'v'));
- }
- extend(res, def$$1);
- return res
- } else if (typeof def$$1 === 'string') {
- return autoCssTransition(def$$1)
- }
- }
-
- var autoCssTransition = cached(function (name) {
- return {
- enterClass: (name + "-enter"),
- leaveClass: (name + "-leave"),
- appearClass: (name + "-enter"),
- enterToClass: (name + "-enter-to"),
- leaveToClass: (name + "-leave-to"),
- appearToClass: (name + "-enter-to"),
- enterActiveClass: (name + "-enter-active"),
- leaveActiveClass: (name + "-leave-active"),
- appearActiveClass: (name + "-enter-active")
- }
- });
-
- function once (fn) {
- var called = false;
- return function () {
- if (!called) {
- called = true;
- fn();
- }
- }
- }
-
- function _enter (_, vnode) {
- if (!vnode.data.show) {
- enter(vnode);
- }
- }
-
- var transition = inBrowser ? {
- create: _enter,
- activate: _enter,
- remove: function remove (vnode, rm) {
- /* istanbul ignore else */
- if (!vnode.data.show) {
- leave(vnode, rm);
- } else {
- rm();
- }
- }
- } : {};
-
- var platformModules = [
- attrs,
- klass,
- events,
- domProps,
- style,
- transition
- ];
-
- /* */
-
- // the directive module should be applied last, after all
- // built-in modules have been applied.
- var modules = platformModules.concat(baseModules);
-
- var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
-
- /**
- * Not type checking this file because flow doesn't like attaching
- * properties to Elements.
- */
-
- var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;
-
- /* istanbul ignore if */
- if (isIE9) {
- // http://www.matts411.com/post/internet-explorer-9-oninput/
- document.addEventListener('selectionchange', function () {
- var el = document.activeElement;
- if (el && el.vmodel) {
- trigger(el, 'input');
- }
- });
- }
-
- var model = {
- inserted: function inserted (el, binding, vnode) {
- {
- if (!modelableTagRE.test(vnode.tag)) {
- warn(
- "v-model is not supported on element type: <" + (vnode.tag) + ">. " +
- 'If you are working with contenteditable, it\'s recommended to ' +
- 'wrap a library dedicated for that purpose inside a custom component.',
- vnode.context
- );
- }
- }
- if (vnode.tag === 'select') {
- var cb = function () {
- setSelected(el, binding, vnode.context);
- };
- cb();
- /* istanbul ignore if */
- if (isIE || isEdge) {
- setTimeout(cb, 0);
- }
- } else if (vnode.tag === 'textarea' || el.type === 'text') {
- el._vModifiers = binding.modifiers;
- if (!binding.modifiers.lazy) {
- if (!isAndroid) {
- el.addEventListener('compositionstart', onCompositionStart);
- el.addEventListener('compositionend', onCompositionEnd);
- }
- /* istanbul ignore if */
- if (isIE9) {
- el.vmodel = true;
- }
- }
- }
- },
- componentUpdated: function componentUpdated (el, binding, vnode) {
- if (vnode.tag === 'select') {
- setSelected(el, binding, vnode.context);
- // in case the options rendered by v-for have changed,
- // it's possible that the value is out-of-sync with the rendered options.
- // detect such cases and filter out values that no longer has a matching
- // option in the DOM.
- var needReset = el.multiple
- ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
- : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
- if (needReset) {
- trigger(el, 'change');
- }
- }
- }
- };
-
- function setSelected (el, binding, vm) {
- var value = binding.value;
- var isMultiple = el.multiple;
- if (isMultiple && !Array.isArray(value)) {
- "development" !== 'production' && warn(
- "<select multiple v-model=\"" + (binding.expression) + "\"> " +
- "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
- vm
- );
- return
- }
- var selected, option;
- for (var i = 0, l = el.options.length; i < l; i++) {
- option = el.options[i];
- if (isMultiple) {
- selected = looseIndexOf(value, getValue(option)) > -1;
- if (option.selected !== selected) {
- option.selected = selected;
- }
- } else {
- if (looseEqual(getValue(option), value)) {
- if (el.selectedIndex !== i) {
- el.selectedIndex = i;
- }
- return
- }
- }
- }
- if (!isMultiple) {
- el.selectedIndex = -1;
- }
- }
-
- function hasNoMatchingOption (value, options) {
- for (var i = 0, l = options.length; i < l; i++) {
- if (looseEqual(getValue(options[i]), value)) {
- return false
- }
- }
- return true
- }
-
- function getValue (option) {
- return '_value' in option
- ? option._value
- : option.value
- }
-
- function onCompositionStart (e) {
- e.target.composing = true;
- }
-
- function onCompositionEnd (e) {
- e.target.composing = false;
- trigger(e.target, 'input');
- }
-
- function trigger (el, type) {
- var e = document.createEvent('HTMLEvents');
- e.initEvent(type, true, true);
- el.dispatchEvent(e);
- }
-
- /* */
-
- // recursively search for possible transition defined inside the component root
- function locateNode (vnode) {
- return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
- ? locateNode(vnode.componentInstance._vnode)
- : vnode
- }
-
- var show = {
- bind: function bind (el, ref, vnode) {
- var value = ref.value;
-
- vnode = locateNode(vnode);
- var transition = vnode.data && vnode.data.transition;
- var originalDisplay = el.__vOriginalDisplay =
- el.style.display === 'none' ? '' : el.style.display;
- if (value && transition && !isIE9) {
- vnode.data.show = true;
- enter(vnode, function () {
- el.style.display = originalDisplay;
- });
- } else {
- el.style.display = value ? originalDisplay : 'none';
- }
- },
-
- update: function update (el, ref, vnode) {
- var value = ref.value;
- var oldValue = ref.oldValue;
-
- /* istanbul ignore if */
- if (value === oldValue) { return }
- vnode = locateNode(vnode);
- var transition = vnode.data && vnode.data.transition;
- if (transition && !isIE9) {
- vnode.data.show = true;
- if (value) {
- enter(vnode, function () {
- el.style.display = el.__vOriginalDisplay;
- });
- } else {
- leave(vnode, function () {
- el.style.display = 'none';
- });
- }
- } else {
- el.style.display = value ? el.__vOriginalDisplay : 'none';
- }
- },
-
- unbind: function unbind (
- el,
- binding,
- vnode,
- oldVnode,
- isDestroy
- ) {
- if (!isDestroy) {
- el.style.display = el.__vOriginalDisplay;
- }
- }
- };
-
- var platformDirectives = {
- model: model,
- show: show
- };
-
- /* */
-
- // Provides transition support for a single element/component.
- // supports transition mode (out-in / in-out)
-
- var transitionProps = {
- name: String,
- appear: Boolean,
- css: Boolean,
- mode: String,
- type: String,
- enterClass: String,
- leaveClass: String,
- enterToClass: String,
- leaveToClass: String,
- enterActiveClass: String,
- leaveActiveClass: String,
- appearClass: String,
- appearActiveClass: String,
- appearToClass: String
- };
-
- // in case the child is also an abstract component, e.g. <keep-alive>
- // we want to recursively retrieve the real component to be rendered
- function getRealChild (vnode) {
- var compOptions = vnode && vnode.componentOptions;
- if (compOptions && compOptions.Ctor.options.abstract) {
- return getRealChild(getFirstComponentChild(compOptions.children))
- } else {
- return vnode
- }
- }
-
- function extractTransitionData (comp) {
- var data = {};
- var options = comp.$options;
- // props
- for (var key in options.propsData) {
- data[key] = comp[key];
- }
- // events.
- // extract listeners and pass them directly to the transition methods
- var listeners = options._parentListeners;
- for (var key$1 in listeners) {
- data[camelize(key$1)] = listeners[key$1].fn;
- }
- return data
- }
-
- function placeholder (h, rawChild) {
- return /\d-keep-alive$/.test(rawChild.tag)
- ? h('keep-alive')
- : null
- }
-
- function hasParentTransition (vnode) {
- while ((vnode = vnode.parent)) {
- if (vnode.data.transition) {
- return true
- }
- }
- }
-
- function isSameChild (child, oldChild) {
- return oldChild.key === child.key && oldChild.tag === child.tag
- }
-
- var Transition = {
- name: 'transition',
- props: transitionProps,
- abstract: true,
-
- render: function render (h) {
- var this$1 = this;
-
- var children = this.$slots.default;
- if (!children) {
- return
- }
-
- // filter out text nodes (possible whitespaces)
- children = children.filter(function (c) { return c.tag; });
- /* istanbul ignore if */
- if (!children.length) {
- return
- }
-
- // warn multiple elements
- if ("development" !== 'production' && children.length > 1) {
- warn(
- '<transition> can only be used on a single element. Use ' +
- '<transition-group> for lists.',
- this.$parent
- );
- }
-
- var mode = this.mode;
-
- // warn invalid mode
- if ("development" !== 'production' &&
- mode && mode !== 'in-out' && mode !== 'out-in') {
- warn(
- 'invalid <transition> mode: ' + mode,
- this.$parent
- );
- }
-
- var rawChild = children[0];
-
- // if this is a component root node and the component's
- // parent container node also has transition, skip.
- if (hasParentTransition(this.$vnode)) {
- return rawChild
- }
-
- // apply transition data to child
- // use getRealChild() to ignore abstract components e.g. keep-alive
- var child = getRealChild(rawChild);
- /* istanbul ignore if */
- if (!child) {
- return rawChild
- }
-
- if (this._leaving) {
- return placeholder(h, rawChild)
- }
-
- // ensure a key that is unique to the vnode type and to this transition
- // component instance. This key will be used to remove pending leaving nodes
- // during entering.
- var id = "__transition-" + (this._uid) + "-";
- var key = child.key = child.key == null
- ? id + child.tag
- : isPrimitive(child.key)
- ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
- : child.key;
- var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
- var oldRawChild = this._vnode;
- var oldChild = getRealChild(oldRawChild);
-
- // mark v-show
- // so that the transition module can hand over the control to the directive
- if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
- child.data.show = true;
- }
-
- if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
- // replace old child transition data with fresh one
- // important for dynamic transitions!
- var oldData = oldChild && (oldChild.data.transition = extend({}, data));
- // handle transition mode
- if (mode === 'out-in') {
- // return placeholder node and queue update when leave finishes
- this._leaving = true;
- mergeVNodeHook(oldData, 'afterLeave', function () {
- this$1._leaving = false;
- this$1.$forceUpdate();
- }, key);
- return placeholder(h, rawChild)
- } else if (mode === 'in-out') {
- var delayedLeave;
- var performLeave = function () { delayedLeave(); };
- mergeVNodeHook(data, 'afterEnter', performLeave, key);
- mergeVNodeHook(data, 'enterCancelled', performLeave, key);
- mergeVNodeHook(oldData, 'delayLeave', function (leave) {
- delayedLeave = leave;
- }, key);
- }
- }
-
- return rawChild
- }
- };
-
- /* */
-
- // Provides transition support for list items.
- // supports move transitions using the FLIP technique.
-
- // Because the vdom's children update algorithm is "unstable" - i.e.
- // it doesn't guarantee the relative positioning of removed elements,
- // we force transition-group to update its children into two passes:
- // in the first pass, we remove all nodes that need to be removed,
- // triggering their leaving transition; in the second pass, we insert/move
- // into the final disired state. This way in the second pass removed
- // nodes will remain where they should be.
-
- var props = extend({
- tag: String,
- moveClass: String
- }, transitionProps);
-
- delete props.mode;
-
- var TransitionGroup = {
- props: props,
-
- render: function render (h) {
- var tag = this.tag || this.$vnode.data.tag || 'span';
- var map = Object.create(null);
- var prevChildren = this.prevChildren = this.children;
- var rawChildren = this.$slots.default || [];
- var children = this.children = [];
- var transitionData = extractTransitionData(this);
-
- for (var i = 0; i < rawChildren.length; i++) {
- var c = rawChildren[i];
- if (c.tag) {
- if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
- children.push(c);
- map[c.key] = c
- ;(c.data || (c.data = {})).transition = transitionData;
- } else {
- var opts = c.componentOptions;
- var name = opts
- ? (opts.Ctor.options.name || opts.tag)
- : c.tag;
- warn(("<transition-group> children must be keyed: <" + name + ">"));
- }
- }
- }
-
- if (prevChildren) {
- var kept = [];
- var removed = [];
- for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
- var c$1 = prevChildren[i$1];
- c$1.data.transition = transitionData;
- c$1.data.pos = c$1.elm.getBoundingClientRect();
- if (map[c$1.key]) {
- kept.push(c$1);
- } else {
- removed.push(c$1);
- }
- }
- this.kept = h(tag, null, kept);
- this.removed = removed;
- }
-
- return h(tag, null, children)
- },
-
- beforeUpdate: function beforeUpdate () {
- // force removing pass
- this.__patch__(
- this._vnode,
- this.kept,
- false, // hydrating
- true // removeOnly (!important, avoids unnecessary moves)
- );
- this._vnode = this.kept;
- },
-
- updated: function updated () {
- var children = this.prevChildren;
- var moveClass = this.moveClass || ((this.name || 'v') + '-move');
- if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
- return
- }
-
- // we divide the work into three loops to avoid mixing DOM reads and writes
- // in each iteration - which helps prevent layout thrashing.
- children.forEach(callPendingCbs);
- children.forEach(recordPosition);
- children.forEach(applyTranslation);
-
- // force reflow to put everything in position
- var f = document.body.offsetHeight; // eslint-disable-line
-
- children.forEach(function (c) {
- if (c.data.moved) {
- var el = c.elm;
- var s = el.style;
- addTransitionClass(el, moveClass);
- s.transform = s.WebkitTransform = s.transitionDuration = '';
- el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
- if (!e || /transform$/.test(e.propertyName)) {
- el.removeEventListener(transitionEndEvent, cb);
- el._moveCb = null;
- removeTransitionClass(el, moveClass);
- }
- });
- }
- });
- },
-
- methods: {
- hasMove: function hasMove (el, moveClass) {
- /* istanbul ignore if */
- if (!hasTransition) {
- return false
- }
- if (this._hasMove != null) {
- return this._hasMove
- }
- addTransitionClass(el, moveClass);
- var info = getTransitionInfo(el);
- removeTransitionClass(el, moveClass);
- return (this._hasMove = info.hasTransform)
- }
- }
- };
-
- function callPendingCbs (c) {
- /* istanbul ignore if */
- if (c.elm._moveCb) {
- c.elm._moveCb();
- }
- /* istanbul ignore if */
- if (c.elm._enterCb) {
- c.elm._enterCb();
- }
- }
-
- function recordPosition (c) {
- c.data.newPos = c.elm.getBoundingClientRect();
- }
-
- function applyTranslation (c) {
- var oldPos = c.data.pos;
- var newPos = c.data.newPos;
- var dx = oldPos.left - newPos.left;
- var dy = oldPos.top - newPos.top;
- if (dx || dy) {
- c.data.moved = true;
- var s = c.elm.style;
- s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
- s.transitionDuration = '0s';
- }
- }
-
- var platformComponents = {
- Transition: Transition,
- TransitionGroup: TransitionGroup
- };
-
- /* */
-
- // install platform specific utils
- Vue$3.config.isUnknownElement = isUnknownElement;
- Vue$3.config.isReservedTag = isReservedTag;
- Vue$3.config.getTagNamespace = getTagNamespace;
- Vue$3.config.mustUseProp = mustUseProp;
-
- // install platform runtime directives & components
- extend(Vue$3.options.directives, platformDirectives);
- extend(Vue$3.options.components, platformComponents);
-
- // install platform patch function
- Vue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;
-
- // wrap mount
- Vue$3.prototype.$mount = function (
- el,
- hydrating
- ) {
- el = el && inBrowser ? query(el) : undefined;
- return this._mount(el, hydrating)
- };
-
- if ("development" !== 'production' &&
- inBrowser && typeof console !== 'undefined') {
- console[console.info ? 'info' : 'log'](
- "You are running Vue in development mode.\n" +
- "Make sure to turn on production mode when deploying for production.\n" +
- "See more tips at https://vuejs.org/guide/deployment.html"
- );
- }
-
- // devtools global hook
- /* istanbul ignore next */
- setTimeout(function () {
- if (config.devtools) {
- if (devtools) {
- devtools.emit('init', Vue$3);
- } else if (
- "development" !== 'production' &&
- inBrowser && !isEdge && /Chrome\/\d+/.test(window.navigator.userAgent)
- ) {
- console[console.info ? 'info' : 'log'](
- 'Download the Vue Devtools extension for a better development experience:\n' +
- 'https://github.com/vuejs/vue-devtools'
- );
- }
- }
- }, 0);
-
- /* */
-
- // check whether current browser encodes a char inside attribute values
- function shouldDecode (content, encoded) {
- var div = document.createElement('div');
- div.innerHTML = "<div a=\"" + content + "\">";
- return div.innerHTML.indexOf(encoded) > 0
- }
-
- // #3663
- // IE encodes newlines inside attribute values while other browsers don't
- var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', ' ') : false;
-
- /* */
-
- var decoder;
-
- function decode (html) {
- decoder = decoder || document.createElement('div');
- decoder.innerHTML = html;
- return decoder.textContent
- }
-
- /* */
-
- var isUnaryTag = makeMap(
- 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
- 'link,meta,param,source,track,wbr',
- true
- );
-
- // Elements that you can, intentionally, leave open
- // (and which close themselves)
- var canBeLeftOpenTag = makeMap(
- 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',
- true
- );
-
- // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
- // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
- var isNonPhrasingTag = makeMap(
- 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
- 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
- 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
- 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
- 'title,tr,track',
- true
- );
-
- /**
- * Not type-checking this file because it's mostly vendor code.
- */
-
- /*!
- * HTML Parser By John Resig (ejohn.org)
- * Modified by Juriy "kangax" Zaytsev
- * Original code by Erik Arvidsson, Mozilla Public License
- * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
- */
-
- // Regular Expressions for parsing tags and attributes
- var singleAttrIdentifier = /([^\s"'<>/=]+)/;
- var singleAttrAssign = /(?:=)/;
- var singleAttrValues = [
- // attr value double quotes
- /"([^"]*)"+/.source,
- // attr value, single quotes
- /'([^']*)'+/.source,
- // attr value, no quotes
- /([^\s"'=<>`]+)/.source
- ];
- var attribute = new RegExp(
- '^\\s*' + singleAttrIdentifier.source +
- '(?:\\s*(' + singleAttrAssign.source + ')' +
- '\\s*(?:' + singleAttrValues.join('|') + '))?'
- );
-
- // could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
- // but for Vue templates we can enforce a simple charset
- var ncname = '[a-zA-Z_][\\w\\-\\.]*';
- var qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')';
- var startTagOpen = new RegExp('^<' + qnameCapture);
- var startTagClose = /^\s*(\/?)>/;
- var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
- var doctype = /^<!DOCTYPE [^>]+>/i;
- var comment = /^<!--/;
- var conditionalComment = /^<!\[/;
-
- var IS_REGEX_CAPTURING_BROKEN = false;
- 'x'.replace(/x(.)?/g, function (m, g) {
- IS_REGEX_CAPTURING_BROKEN = g === '';
- });
-
- // Special Elements (can contain anything)
- var isScriptOrStyle = makeMap('script,style', true);
- var reCache = {};
-
- var ltRE = /</g;
- var gtRE = />/g;
- var nlRE = / /g;
- var ampRE = /&/g;
- var quoteRE = /"/g;
-
- function decodeAttr (value, shouldDecodeNewlines) {
- if (shouldDecodeNewlines) {
- value = value.replace(nlRE, '\n');
- }
- return value
- .replace(ltRE, '<')
- .replace(gtRE, '>')
- .replace(ampRE, '&')
- .replace(quoteRE, '"')
- }
-
- function parseHTML (html, options) {
- var stack = [];
- var expectHTML = options.expectHTML;
- var isUnaryTag$$1 = options.isUnaryTag || no;
- var index = 0;
- var last, lastTag;
- while (html) {
- last = html;
- // Make sure we're not in a script or style element
- if (!lastTag || !isScriptOrStyle(lastTag)) {
- var textEnd = html.indexOf('<');
- if (textEnd === 0) {
- // Comment:
- if (comment.test(html)) {
- var commentEnd = html.indexOf('-->');
-
- if (commentEnd >= 0) {
- advance(commentEnd + 3);
- continue
- }
- }
-
- // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
- if (conditionalComment.test(html)) {
- var conditionalEnd = html.indexOf(']>');
-
- if (conditionalEnd >= 0) {
- advance(conditionalEnd + 2);
- continue
- }
- }
-
- // Doctype:
- var doctypeMatch = html.match(doctype);
- if (doctypeMatch) {
- advance(doctypeMatch[0].length);
- continue
- }
-
- // End tag:
- var endTagMatch = html.match(endTag);
- if (endTagMatch) {
- var curIndex = index;
- advance(endTagMatch[0].length);
- parseEndTag(endTagMatch[1], curIndex, index);
- continue
- }
-
- // Start tag:
- var startTagMatch = parseStartTag();
- if (startTagMatch) {
- handleStartTag(startTagMatch);
- continue
- }
- }
-
- var text = (void 0), rest$1 = (void 0), next = (void 0);
- if (textEnd > 0) {
- rest$1 = html.slice(textEnd);
- while (
- !endTag.test(rest$1) &&
- !startTagOpen.test(rest$1) &&
- !comment.test(rest$1) &&
- !conditionalComment.test(rest$1)
- ) {
- // < in plain text, be forgiving and treat it as text
- next = rest$1.indexOf('<', 1);
- if (next < 0) { break }
- textEnd += next;
- rest$1 = html.slice(textEnd);
- }
- text = html.substring(0, textEnd);
- advance(textEnd);
- }
-
- if (textEnd < 0) {
- text = html;
- html = '';
- }
-
- if (options.chars && text) {
- options.chars(text);
- }
- } else {
- var stackedTag = lastTag.toLowerCase();
- var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
- var endTagLength = 0;
- var rest = html.replace(reStackedTag, function (all, text, endTag) {
- endTagLength = endTag.length;
- if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {
- text = text
- .replace(/<!--([\s\S]*?)-->/g, '$1')
- .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
- }
- if (options.chars) {
- options.chars(text);
- }
- return ''
- });
- index += html.length - rest.length;
- html = rest;
- parseEndTag(stackedTag, index - endTagLength, index);
- }
-
- if (html === last && options.chars) {
- options.chars(html);
- break
- }
- }
-
- // Clean up any remaining tags
- parseEndTag();
-
- function advance (n) {
- index += n;
- html = html.substring(n);
- }
-
- function parseStartTag () {
- var start = html.match(startTagOpen);
- if (start) {
- var match = {
- tagName: start[1],
- attrs: [],
- start: index
- };
- advance(start[0].length);
- var end, attr;
- while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
- advance(attr[0].length);
- match.attrs.push(attr);
- }
- if (end) {
- match.unarySlash = end[1];
- advance(end[0].length);
- match.end = index;
- return match
- }
- }
- }
-
- function handleStartTag (match) {
- var tagName = match.tagName;
- var unarySlash = match.unarySlash;
-
- if (expectHTML) {
- if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
- parseEndTag(lastTag);
- }
- if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
- parseEndTag(tagName);
- }
- }
-
- var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
-
- var l = match.attrs.length;
- var attrs = new Array(l);
- for (var i = 0; i < l; i++) {
- var args = match.attrs[i];
- // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
- if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
- if (args[3] === '') { delete args[3]; }
- if (args[4] === '') { delete args[4]; }
- if (args[5] === '') { delete args[5]; }
- }
- var value = args[3] || args[4] || args[5] || '';
- attrs[i] = {
- name: args[1],
- value: decodeAttr(
- value,
- options.shouldDecodeNewlines
- )
- };
- }
-
- if (!unary) {
- stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
- lastTag = tagName;
- unarySlash = '';
- }
-
- if (options.start) {
- options.start(tagName, attrs, unary, match.start, match.end);
- }
- }
-
- function parseEndTag (tagName, start, end) {
- var pos, lowerCasedTagName;
- if (start == null) { start = index; }
- if (end == null) { end = index; }
-
- if (tagName) {
- lowerCasedTagName = tagName.toLowerCase();
- }
-
- // Find the closest opened tag of the same type
- if (tagName) {
- for (pos = stack.length - 1; pos >= 0; pos--) {
- if (stack[pos].lowerCasedTag === lowerCasedTagName) {
- break
- }
- }
- } else {
- // If no tag name is provided, clean shop
- pos = 0;
- }
-
- if (pos >= 0) {
- // Close all the open elements, up the stack
- for (var i = stack.length - 1; i >= pos; i--) {
- if (options.end) {
- options.end(stack[i].tag, start, end);
- }
- }
-
- // Remove the open elements from the stack
- stack.length = pos;
- lastTag = pos && stack[pos - 1].tag;
- } else if (lowerCasedTagName === 'br') {
- if (options.start) {
- options.start(tagName, [], true, start, end);
- }
- } else if (lowerCasedTagName === 'p') {
- if (options.start) {
- options.start(tagName, [], false, start, end);
- }
- if (options.end) {
- options.end(tagName, start, end);
- }
- }
- }
- }
-
- /* */
-
- function parseFilters (exp) {
- var inSingle = false;
- var inDouble = false;
- var inTemplateString = false;
- var inRegex = false;
- var curly = 0;
- var square = 0;
- var paren = 0;
- var lastFilterIndex = 0;
- var c, prev, i, expression, filters;
-
- for (i = 0; i < exp.length; i++) {
- prev = c;
- c = exp.charCodeAt(i);
- if (inSingle) {
- if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
- } else if (inDouble) {
- if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
- } else if (inTemplateString) {
- if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
- } else if (inRegex) {
- if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
- } else if (
- c === 0x7C && // pipe
- exp.charCodeAt(i + 1) !== 0x7C &&
- exp.charCodeAt(i - 1) !== 0x7C &&
- !curly && !square && !paren
- ) {
- if (expression === undefined) {
- // first filter, end of expression
- lastFilterIndex = i + 1;
- expression = exp.slice(0, i).trim();
- } else {
- pushFilter();
- }
- } else {
- switch (c) {
- case 0x22: inDouble = true; break // "
- case 0x27: inSingle = true; break // '
- case 0x60: inTemplateString = true; break // `
- case 0x28: paren++; break // (
- case 0x29: paren--; break // )
- case 0x5B: square++; break // [
- case 0x5D: square--; break // ]
- case 0x7B: curly++; break // {
- case 0x7D: curly--; break // }
- }
- if (c === 0x2f) { // /
- var j = i - 1;
- var p = (void 0);
- // find first non-whitespace prev char
- for (; j >= 0; j--) {
- p = exp.charAt(j);
- if (p !== ' ') { break }
- }
- if (!p || !/[\w$]/.test(p)) {
- inRegex = true;
- }
- }
- }
- }
-
- if (expression === undefined) {
- expression = exp.slice(0, i).trim();
- } else if (lastFilterIndex !== 0) {
- pushFilter();
- }
-
- function pushFilter () {
- (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
- lastFilterIndex = i + 1;
- }
-
- if (filters) {
- for (i = 0; i < filters.length; i++) {
- expression = wrapFilter(expression, filters[i]);
- }
- }
-
- return expression
- }
-
- function wrapFilter (exp, filter) {
- var i = filter.indexOf('(');
- if (i < 0) {
- // _f: resolveFilter
- return ("_f(\"" + filter + "\")(" + exp + ")")
- } else {
- var name = filter.slice(0, i);
- var args = filter.slice(i + 1);
- return ("_f(\"" + name + "\")(" + exp + "," + args)
- }
- }
-
- /* */
-
- var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
- var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
-
- var buildRegex = cached(function (delimiters) {
- var open = delimiters[0].replace(regexEscapeRE, '\\$&');
- var close = delimiters[1].replace(regexEscapeRE, '\\$&');
- return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
- });
-
- function parseText (
- text,
- delimiters
- ) {
- var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
- if (!tagRE.test(text)) {
- return
- }
- var tokens = [];
- var lastIndex = tagRE.lastIndex = 0;
- var match, index;
- while ((match = tagRE.exec(text))) {
- index = match.index;
- // push text token
- if (index > lastIndex) {
- tokens.push(JSON.stringify(text.slice(lastIndex, index)));
- }
- // tag token
- var exp = parseFilters(match[1].trim());
- tokens.push(("_s(" + exp + ")"));
- lastIndex = index + match[0].length;
- }
- if (lastIndex < text.length) {
- tokens.push(JSON.stringify(text.slice(lastIndex)));
- }
- return tokens.join('+')
- }
-
- /* */
-
- function baseWarn (msg) {
- console.error(("[Vue parser]: " + msg));
- }
-
- function pluckModuleFunction (
- modules,
- key
- ) {
- return modules
- ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
- : []
- }
-
- function addProp (el, name, value) {
- (el.props || (el.props = [])).push({ name: name, value: value });
- }
-
- function addAttr (el, name, value) {
- (el.attrs || (el.attrs = [])).push({ name: name, value: value });
- }
-
- function addDirective (
- el,
- name,
- rawName,
- value,
- arg,
- modifiers
- ) {
- (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
- }
-
- function addHandler (
- el,
- name,
- value,
- modifiers,
- important
- ) {
- // check capture modifier
- if (modifiers && modifiers.capture) {
- delete modifiers.capture;
- name = '!' + name; // mark the event as captured
- }
- if (modifiers && modifiers.once) {
- delete modifiers.once;
- name = '~' + name; // mark the event as once
- }
- var events;
- if (modifiers && modifiers.native) {
- delete modifiers.native;
- events = el.nativeEvents || (el.nativeEvents = {});
- } else {
- events = el.events || (el.events = {});
- }
- var newHandler = { value: value, modifiers: modifiers };
- var handlers = events[name];
- /* istanbul ignore if */
- if (Array.isArray(handlers)) {
- important ? handlers.unshift(newHandler) : handlers.push(newHandler);
- } else if (handlers) {
- events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
- } else {
- events[name] = newHandler;
- }
- }
-
- function getBindingAttr (
- el,
- name,
- getStatic
- ) {
- var dynamicValue =
- getAndRemoveAttr(el, ':' + name) ||
- getAndRemoveAttr(el, 'v-bind:' + name);
- if (dynamicValue != null) {
- return parseFilters(dynamicValue)
- } else if (getStatic !== false) {
- var staticValue = getAndRemoveAttr(el, name);
- if (staticValue != null) {
- return JSON.stringify(staticValue)
- }
- }
- }
-
- function getAndRemoveAttr (el, name) {
- var val;
- if ((val = el.attrsMap[name]) != null) {
- var list = el.attrsList;
- for (var i = 0, l = list.length; i < l; i++) {
- if (list[i].name === name) {
- list.splice(i, 1);
- break
- }
- }
- }
- return val
- }
-
- var len;
- var str;
- var chr;
- var index$1;
- var expressionPos;
- var expressionEndPos;
-
- /**
- * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
- *
- * for loop possible cases:
- *
- * - test
- * - test[idx]
- * - test[test1[idx]]
- * - test["a"][idx]
- * - xxx.test[a[a].test1[idx]]
- * - test.xxx.a["asa"][test1[idx]]
- *
- */
-
- function parseModel (val) {
- str = val;
- len = str.length;
- index$1 = expressionPos = expressionEndPos = 0;
-
- if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
- return {
- exp: val,
- idx: null
- }
- }
-
- while (!eof()) {
- chr = next();
- /* istanbul ignore if */
- if (isStringStart(chr)) {
- parseString(chr);
- } else if (chr === 0x5B) {
- parseBracket(chr);
- }
- }
-
- return {
- exp: val.substring(0, expressionPos),
- idx: val.substring(expressionPos + 1, expressionEndPos)
- }
- }
-
- function next () {
- return str.charCodeAt(++index$1)
- }
-
- function eof () {
- return index$1 >= len
- }
-
- function isStringStart (chr) {
- return chr === 0x22 || chr === 0x27
- }
-
- function parseBracket (chr) {
- var inBracket = 1;
- expressionPos = index$1;
- while (!eof()) {
- chr = next();
- if (isStringStart(chr)) {
- parseString(chr);
- continue
- }
- if (chr === 0x5B) { inBracket++; }
- if (chr === 0x5D) { inBracket--; }
- if (inBracket === 0) {
- expressionEndPos = index$1;
- break
- }
- }
- }
-
- function parseString (chr) {
- var stringQuote = chr;
- while (!eof()) {
- chr = next();
- if (chr === stringQuote) {
- break
- }
- }
- }
-
- /* */
-
- var dirRE = /^v-|^@|^:/;
- var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
- var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
- var bindRE = /^:|^v-bind:/;
- var onRE = /^@|^v-on:/;
- var argRE = /:(.*)$/;
- var modifierRE = /\.[^.]+/g;
-
- var decodeHTMLCached = cached(decode);
-
- // configurable state
- var warn$1;
- var platformGetTagNamespace;
- var platformMustUseProp;
- var platformIsPreTag;
- var preTransforms;
- var transforms;
- var postTransforms;
- var delimiters;
-
- /**
- * Convert HTML string to AST.
- */
- function parse (
- template,
- options
- ) {
- warn$1 = options.warn || baseWarn;
- platformGetTagNamespace = options.getTagNamespace || no;
- platformMustUseProp = options.mustUseProp || no;
- platformIsPreTag = options.isPreTag || no;
- preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
- transforms = pluckModuleFunction(options.modules, 'transformNode');
- postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
- delimiters = options.delimiters;
- var stack = [];
- var preserveWhitespace = options.preserveWhitespace !== false;
- var root;
- var currentParent;
- var inVPre = false;
- var inPre = false;
- var warned = false;
- parseHTML(template, {
- expectHTML: options.expectHTML,
- isUnaryTag: options.isUnaryTag,
- shouldDecodeNewlines: options.shouldDecodeNewlines,
- start: function start (tag, attrs, unary) {
- // check namespace.
- // inherit parent ns if there is one
- var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
-
- // handle IE svg bug
- /* istanbul ignore if */
- if (isIE && ns === 'svg') {
- attrs = guardIESVGBug(attrs);
- }
-
- var element = {
- type: 1,
- tag: tag,
- attrsList: attrs,
- attrsMap: makeAttrsMap(attrs),
- parent: currentParent,
- children: []
- };
- if (ns) {
- element.ns = ns;
- }
-
- if (isForbiddenTag(element) && !isServerRendering()) {
- element.forbidden = true;
- "development" !== 'production' && warn$1(
- 'Templates should only be responsible for mapping the state to the ' +
- 'UI. Avoid placing tags with side-effects in your templates, such as ' +
- "<" + tag + ">" + ', as they will not be parsed.'
- );
- }
-
- // apply pre-transforms
- for (var i = 0; i < preTransforms.length; i++) {
- preTransforms[i](element, options);
- }
-
- if (!inVPre) {
- processPre(element);
- if (element.pre) {
- inVPre = true;
- }
- }
- if (platformIsPreTag(element.tag)) {
- inPre = true;
- }
- if (inVPre) {
- processRawAttrs(element);
- } else {
- processFor(element);
- processIf(element);
- processOnce(element);
- processKey(element);
-
- // determine whether this is a plain element after
- // removing structural attributes
- element.plain = !element.key && !attrs.length;
-
- processRef(element);
- processSlot(element);
- processComponent(element);
- for (var i$1 = 0; i$1 < transforms.length; i$1++) {
- transforms[i$1](element, options);
- }
- processAttrs(element);
- }
-
- function checkRootConstraints (el) {
- if ("development" !== 'production' && !warned) {
- if (el.tag === 'slot' || el.tag === 'template') {
- warned = true;
- warn$1(
- "Cannot use <" + (el.tag) + "> as component root element because it may " +
- 'contain multiple nodes:\n' + template
- );
- }
- if (el.attrsMap.hasOwnProperty('v-for')) {
- warned = true;
- warn$1(
- 'Cannot use v-for on stateful component root element because ' +
- 'it renders multiple elements:\n' + template
- );
- }
- }
- }
-
- // tree management
- if (!root) {
- root = element;
- checkRootConstraints(root);
- } else if (!stack.length) {
- // allow root elements with v-if, v-else-if and v-else
- if (root.if && (element.elseif || element.else)) {
- checkRootConstraints(element);
- addIfCondition(root, {
- exp: element.elseif,
- block: element
- });
- } else if ("development" !== 'production' && !warned) {
- warned = true;
- warn$1(
- "Component template should contain exactly one root element:" +
- "\n\n" + template + "\n\n" +
- "If you are using v-if on multiple elements, " +
- "use v-else-if to chain them instead."
- );
- }
- }
- if (currentParent && !element.forbidden) {
- if (element.elseif || element.else) {
- processIfConditions(element, currentParent);
- } else if (element.slotScope) { // scoped slot
- currentParent.plain = false;
- var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
- } else {
- currentParent.children.push(element);
- element.parent = currentParent;
- }
- }
- if (!unary) {
- currentParent = element;
- stack.push(element);
- }
- // apply post-transforms
- for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {
- postTransforms[i$2](element, options);
- }
- },
-
- end: function end () {
- // remove trailing whitespace
- var element = stack[stack.length - 1];
- var lastNode = element.children[element.children.length - 1];
- if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {
- element.children.pop();
- }
- // pop stack
- stack.length -= 1;
- currentParent = stack[stack.length - 1];
- // check pre state
- if (element.pre) {
- inVPre = false;
- }
- if (platformIsPreTag(element.tag)) {
- inPre = false;
- }
- },
-
- chars: function chars (text) {
- if (!currentParent) {
- if ("development" !== 'production' && !warned && text === template) {
- warned = true;
- warn$1(
- 'Component template requires a root element, rather than just text:\n\n' + template
- );
- }
- return
- }
- // IE textarea placeholder bug
- /* istanbul ignore if */
- if (isIE &&
- currentParent.tag === 'textarea' &&
- currentParent.attrsMap.placeholder === text) {
- return
- }
- var children = currentParent.children;
- text = inPre || text.trim()
- ? decodeHTMLCached(text)
- // only preserve whitespace if its not right after a starting tag
- : preserveWhitespace && children.length ? ' ' : '';
- if (text) {
- var expression;
- if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
- children.push({
- type: 2,
- expression: expression,
- text: text
- });
- } else if (text !== ' ' || children[children.length - 1].text !== ' ') {
- currentParent.children.push({
- type: 3,
- text: text
- });
- }
- }
- }
- });
- return root
- }
-
- function processPre (el) {
- if (getAndRemoveAttr(el, 'v-pre') != null) {
- el.pre = true;
- }
- }
-
- function processRawAttrs (el) {
- var l = el.attrsList.length;
- if (l) {
- var attrs = el.attrs = new Array(l);
- for (var i = 0; i < l; i++) {
- attrs[i] = {
- name: el.attrsList[i].name,
- value: JSON.stringify(el.attrsList[i].value)
- };
- }
- } else if (!el.pre) {
- // non root node in pre blocks with no attributes
- el.plain = true;
- }
- }
-
- function processKey (el) {
- var exp = getBindingAttr(el, 'key');
- if (exp) {
- if ("development" !== 'production' && el.tag === 'template') {
- warn$1("<template> cannot be keyed. Place the key on real elements instead.");
- }
- el.key = exp;
- }
- }
-
- function processRef (el) {
- var ref = getBindingAttr(el, 'ref');
- if (ref) {
- el.ref = ref;
- el.refInFor = checkInFor(el);
- }
- }
-
- function processFor (el) {
- var exp;
- if ((exp = getAndRemoveAttr(el, 'v-for'))) {
- var inMatch = exp.match(forAliasRE);
- if (!inMatch) {
- "development" !== 'production' && warn$1(
- ("Invalid v-for expression: " + exp)
- );
- return
- }
- el.for = inMatch[2].trim();
- var alias = inMatch[1].trim();
- var iteratorMatch = alias.match(forIteratorRE);
- if (iteratorMatch) {
- el.alias = iteratorMatch[1].trim();
- el.iterator1 = iteratorMatch[2].trim();
- if (iteratorMatch[3]) {
- el.iterator2 = iteratorMatch[3].trim();
- }
- } else {
- el.alias = alias;
- }
- }
- }
-
- function processIf (el) {
- var exp = getAndRemoveAttr(el, 'v-if');
- if (exp) {
- el.if = exp;
- addIfCondition(el, {
- exp: exp,
- block: el
- });
- } else {
- if (getAndRemoveAttr(el, 'v-else') != null) {
- el.else = true;
- }
- var elseif = getAndRemoveAttr(el, 'v-else-if');
- if (elseif) {
- el.elseif = elseif;
- }
- }
- }
-
- function processIfConditions (el, parent) {
- var prev = findPrevElement(parent.children);
- if (prev && prev.if) {
- addIfCondition(prev, {
- exp: el.elseif,
- block: el
- });
- } else {
- warn$1(
- "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
- "used on element <" + (el.tag) + "> without corresponding v-if."
- );
- }
- }
-
- function findPrevElement (children) {
- var i = children.length;
- while (i--) {
- if (children[i].type === 1) {
- return children[i]
- } else {
- if ("development" !== 'production' && children[i].text !== ' ') {
- warn$1(
- "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
- "will be ignored."
- );
- }
- children.pop();
- }
- }
- }
-
- function addIfCondition (el, condition) {
- if (!el.ifConditions) {
- el.ifConditions = [];
- }
- el.ifConditions.push(condition);
- }
-
- function processOnce (el) {
- var once = getAndRemoveAttr(el, 'v-once');
- if (once != null) {
- el.once = true;
- }
- }
-
- function processSlot (el) {
- if (el.tag === 'slot') {
- el.slotName = getBindingAttr(el, 'name');
- if ("development" !== 'production' && el.key) {
- warn$1(
- "`key` does not work on <slot> because slots are abstract outlets " +
- "and can possibly expand into multiple elements. " +
- "Use the key on a wrapping element instead."
- );
- }
- } else {
- var slotTarget = getBindingAttr(el, 'slot');
- if (slotTarget) {
- el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
- }
- if (el.tag === 'template') {
- el.slotScope = getAndRemoveAttr(el, 'scope');
- }
- }
- }
-
- function processComponent (el) {
- var binding;
- if ((binding = getBindingAttr(el, 'is'))) {
- el.component = binding;
- }
- if (getAndRemoveAttr(el, 'inline-template') != null) {
- el.inlineTemplate = true;
- }
- }
-
- function processAttrs (el) {
- var list = el.attrsList;
- var i, l, name, rawName, value, arg, modifiers, isProp;
- for (i = 0, l = list.length; i < l; i++) {
- name = rawName = list[i].name;
- value = list[i].value;
- if (dirRE.test(name)) {
- // mark element as dynamic
- el.hasBindings = true;
- // modifiers
- modifiers = parseModifiers(name);
- if (modifiers) {
- name = name.replace(modifierRE, '');
- }
- if (bindRE.test(name)) { // v-bind
- name = name.replace(bindRE, '');
- value = parseFilters(value);
- isProp = false;
- if (modifiers) {
- if (modifiers.prop) {
- isProp = true;
- name = camelize(name);
- if (name === 'innerHtml') { name = 'innerHTML'; }
- }
- if (modifiers.camel) {
- name = camelize(name);
- }
- }
- if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
- addProp(el, name, value);
- } else {
- addAttr(el, name, value);
- }
- } else if (onRE.test(name)) { // v-on
- name = name.replace(onRE, '');
- addHandler(el, name, value, modifiers);
- } else { // normal directives
- name = name.replace(dirRE, '');
- // parse arg
- var argMatch = name.match(argRE);
- if (argMatch && (arg = argMatch[1])) {
- name = name.slice(0, -(arg.length + 1));
- }
- addDirective(el, name, rawName, value, arg, modifiers);
- if ("development" !== 'production' && name === 'model') {
- checkForAliasModel(el, value);
- }
- }
- } else {
- // literal attribute
- {
- var expression = parseText(value, delimiters);
- if (expression) {
- warn$1(
- name + "=\"" + value + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div id="{{ val }}">, use <div :id="val">.'
- );
- }
- }
- addAttr(el, name, JSON.stringify(value));
- }
- }
- }
-
- function checkInFor (el) {
- var parent = el;
- while (parent) {
- if (parent.for !== undefined) {
- return true
- }
- parent = parent.parent;
- }
- return false
- }
-
- function parseModifiers (name) {
- var match = name.match(modifierRE);
- if (match) {
- var ret = {};
- match.forEach(function (m) { ret[m.slice(1)] = true; });
- return ret
- }
- }
-
- function makeAttrsMap (attrs) {
- var map = {};
- for (var i = 0, l = attrs.length; i < l; i++) {
- if ("development" !== 'production' && map[attrs[i].name] && !isIE) {
- warn$1('duplicate attribute: ' + attrs[i].name);
- }
- map[attrs[i].name] = attrs[i].value;
- }
- return map
- }
-
- function isForbiddenTag (el) {
- return (
- el.tag === 'style' ||
- (el.tag === 'script' && (
- !el.attrsMap.type ||
- el.attrsMap.type === 'text/javascript'
- ))
- )
- }
-
- var ieNSBug = /^xmlns:NS\d+/;
- var ieNSPrefix = /^NS\d+:/;
-
- /* istanbul ignore next */
- function guardIESVGBug (attrs) {
- var res = [];
- for (var i = 0; i < attrs.length; i++) {
- var attr = attrs[i];
- if (!ieNSBug.test(attr.name)) {
- attr.name = attr.name.replace(ieNSPrefix, '');
- res.push(attr);
- }
- }
- return res
- }
-
- function checkForAliasModel (el, value) {
- var _el = el;
- while (_el) {
- if (_el.for && _el.alias === value) {
- warn$1(
- "<" + (el.tag) + " v-model=\"" + value + "\">: " +
- "You are binding v-model directly to a v-for iteration alias. " +
- "This will not be able to modify the v-for source array because " +
- "writing to the alias is like modifying a function local variable. " +
- "Consider using an array of objects and use v-model on an object property instead."
- );
- }
- _el = _el.parent;
- }
- }
-
- /* */
-
- var isStaticKey;
- var isPlatformReservedTag;
-
- var genStaticKeysCached = cached(genStaticKeys$1);
-
- /**
- * Goal of the optimizer: walk the generated template AST tree
- * and detect sub-trees that are purely static, i.e. parts of
- * the DOM that never needs to change.
- *
- * Once we detect these sub-trees, we can:
- *
- * 1. Hoist them into constants, so that we no longer need to
- * create fresh nodes for them on each re-render;
- * 2. Completely skip them in the patching process.
- */
- function optimize (root, options) {
- if (!root) { return }
- isStaticKey = genStaticKeysCached(options.staticKeys || '');
- isPlatformReservedTag = options.isReservedTag || no;
- // first pass: mark all non-static nodes.
- markStatic(root);
- // second pass: mark static roots.
- markStaticRoots(root, false);
- }
-
- function genStaticKeys$1 (keys) {
- return makeMap(
- 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
- (keys ? ',' + keys : '')
- )
- }
-
- function markStatic (node) {
- node.static = isStatic(node);
- if (node.type === 1) {
- // do not make component slot content static. this avoids
- // 1. components not able to mutate slot nodes
- // 2. static slot content fails for hot-reloading
- if (
- !isPlatformReservedTag(node.tag) &&
- node.tag !== 'slot' &&
- node.attrsMap['inline-template'] == null
- ) {
- return
- }
- for (var i = 0, l = node.children.length; i < l; i++) {
- var child = node.children[i];
- markStatic(child);
- if (!child.static) {
- node.static = false;
- }
- }
- }
- }
-
- function markStaticRoots (node, isInFor) {
- if (node.type === 1) {
- if (node.static || node.once) {
- node.staticInFor = isInFor;
- }
- // For a node to qualify as a static root, it should have children that
- // are not just static text. Otherwise the cost of hoisting out will
- // outweigh the benefits and it's better off to just always render it fresh.
- if (node.static && node.children.length && !(
- node.children.length === 1 &&
- node.children[0].type === 3
- )) {
- node.staticRoot = true;
- return
- } else {
- node.staticRoot = false;
- }
- if (node.children) {
- for (var i = 0, l = node.children.length; i < l; i++) {
- markStaticRoots(node.children[i], isInFor || !!node.for);
- }
- }
- if (node.ifConditions) {
- walkThroughConditionsBlocks(node.ifConditions, isInFor);
- }
- }
- }
-
- function walkThroughConditionsBlocks (conditionBlocks, isInFor) {
- for (var i = 1, len = conditionBlocks.length; i < len; i++) {
- markStaticRoots(conditionBlocks[i].block, isInFor);
- }
- }
-
- function isStatic (node) {
- if (node.type === 2) { // expression
- return false
- }
- if (node.type === 3) { // text
- return true
- }
- return !!(node.pre || (
- !node.hasBindings && // no dynamic bindings
- !node.if && !node.for && // not v-if or v-for or v-else
- !isBuiltInTag(node.tag) && // not a built-in
- isPlatformReservedTag(node.tag) && // not a component
- !isDirectChildOfTemplateFor(node) &&
- Object.keys(node).every(isStaticKey)
- ))
- }
-
- function isDirectChildOfTemplateFor (node) {
- while (node.parent) {
- node = node.parent;
- if (node.tag !== 'template') {
- return false
- }
- if (node.for) {
- return true
- }
- }
- return false
- }
-
- /* */
-
- var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
- var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
-
- // keyCode aliases
- var keyCodes = {
- esc: 27,
- tab: 9,
- enter: 13,
- space: 32,
- up: 38,
- left: 37,
- right: 39,
- down: 40,
- 'delete': [8, 46]
- };
-
- var modifierCode = {
- stop: '$event.stopPropagation();',
- prevent: '$event.preventDefault();',
- self: 'if($event.target !== $event.currentTarget)return;',
- ctrl: 'if(!$event.ctrlKey)return;',
- shift: 'if(!$event.shiftKey)return;',
- alt: 'if(!$event.altKey)return;',
- meta: 'if(!$event.metaKey)return;'
- };
-
- function genHandlers (events, native) {
- var res = native ? 'nativeOn:{' : 'on:{';
- for (var name in events) {
- res += "\"" + name + "\":" + (genHandler(name, events[name])) + ",";
- }
- return res.slice(0, -1) + '}'
- }
-
- function genHandler (
- name,
- handler
- ) {
- if (!handler) {
- return 'function(){}'
- } else if (Array.isArray(handler)) {
- return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
- } else if (!handler.modifiers) {
- return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)
- ? handler.value
- : ("function($event){" + (handler.value) + "}")
- } else {
- var code = '';
- var keys = [];
- for (var key in handler.modifiers) {
- if (modifierCode[key]) {
- code += modifierCode[key];
- } else {
- keys.push(key);
- }
- }
- if (keys.length) {
- code = genKeyFilter(keys) + code;
- }
- var handlerCode = simplePathRE.test(handler.value)
- ? handler.value + '($event)'
- : handler.value;
- return 'function($event){' + code + handlerCode + '}'
- }
- }
-
- function genKeyFilter (keys) {
- return ("if(" + (keys.map(genFilterCode).join('&&')) + ")return;")
- }
-
- function genFilterCode (key) {
- var keyVal = parseInt(key, 10);
- if (keyVal) {
- return ("$event.keyCode!==" + keyVal)
- }
- var alias = keyCodes[key];
- return ("_k($event.keyCode," + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + ")")
- }
-
- /* */
-
- function bind$2 (el, dir) {
- el.wrapData = function (code) {
- return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + ")")
- };
- }
-
- /* */
-
- var baseDirectives = {
- bind: bind$2,
- cloak: noop
- };
-
- /* */
-
- // configurable state
- var warn$2;
- var transforms$1;
- var dataGenFns;
- var platformDirectives$1;
- var isPlatformReservedTag$1;
- var staticRenderFns;
- var onceCount;
- var currentOptions;
-
- function generate (
- ast,
- options
- ) {
- // save previous staticRenderFns so generate calls can be nested
- var prevStaticRenderFns = staticRenderFns;
- var currentStaticRenderFns = staticRenderFns = [];
- var prevOnceCount = onceCount;
- onceCount = 0;
- currentOptions = options;
- warn$2 = options.warn || baseWarn;
- transforms$1 = pluckModuleFunction(options.modules, 'transformCode');
- dataGenFns = pluckModuleFunction(options.modules, 'genData');
- platformDirectives$1 = options.directives || {};
- isPlatformReservedTag$1 = options.isReservedTag || no;
- var code = ast ? genElement(ast) : '_c("div")';
- staticRenderFns = prevStaticRenderFns;
- onceCount = prevOnceCount;
- return {
- render: ("with(this){return " + code + "}"),
- staticRenderFns: currentStaticRenderFns
- }
- }
-
- function genElement (el) {
- if (el.staticRoot && !el.staticProcessed) {
- return genStatic(el)
- } else if (el.once && !el.onceProcessed) {
- return genOnce(el)
- } else if (el.for && !el.forProcessed) {
- return genFor(el)
- } else if (el.if && !el.ifProcessed) {
- return genIf(el)
- } else if (el.tag === 'template' && !el.slotTarget) {
- return genChildren(el) || 'void 0'
- } else if (el.tag === 'slot') {
- return genSlot(el)
- } else {
- // component or element
- var code;
- if (el.component) {
- code = genComponent(el.component, el);
- } else {
- var data = el.plain ? undefined : genData(el);
-
- var children = el.inlineTemplate ? null : genChildren(el, true);
- code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
- }
- // module transforms
- for (var i = 0; i < transforms$1.length; i++) {
- code = transforms$1[i](el, code);
- }
- return code
- }
- }
-
- // hoist static sub-trees out
- function genStatic (el) {
- el.staticProcessed = true;
- staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
- return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
- }
-
- // v-once
- function genOnce (el) {
- el.onceProcessed = true;
- if (el.if && !el.ifProcessed) {
- return genIf(el)
- } else if (el.staticInFor) {
- var key = '';
- var parent = el.parent;
- while (parent) {
- if (parent.for) {
- key = parent.key;
- break
- }
- parent = parent.parent;
- }
- if (!key) {
- "development" !== 'production' && warn$2(
- "v-once can only be used inside v-for that is keyed. "
- );
- return genElement(el)
- }
- return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
- } else {
- return genStatic(el)
- }
- }
-
- function genIf (el) {
- el.ifProcessed = true; // avoid recursion
- return genIfConditions(el.ifConditions.slice())
- }
-
- function genIfConditions (conditions) {
- if (!conditions.length) {
- return '_e()'
- }
-
- var condition = conditions.shift();
- if (condition.exp) {
- return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions)))
- } else {
- return ("" + (genTernaryExp(condition.block)))
- }
-
- // v-if with v-once should generate code like (a)?_m(0):_m(1)
- function genTernaryExp (el) {
- return el.once ? genOnce(el) : genElement(el)
- }
- }
-
- function genFor (el) {
- var exp = el.for;
- var alias = el.alias;
- var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
- var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
- el.forProcessed = true; // avoid recursion
- return "_l((" + exp + ")," +
- "function(" + alias + iterator1 + iterator2 + "){" +
- "return " + (genElement(el)) +
- '})'
- }
-
- function genData (el) {
- var data = '{';
-
- // directives first.
- // directives may mutate the el's other properties before they are generated.
- var dirs = genDirectives(el);
- if (dirs) { data += dirs + ','; }
-
- // key
- if (el.key) {
- data += "key:" + (el.key) + ",";
- }
- // ref
- if (el.ref) {
- data += "ref:" + (el.ref) + ",";
- }
- if (el.refInFor) {
- data += "refInFor:true,";
- }
- // pre
- if (el.pre) {
- data += "pre:true,";
- }
- // record original tag name for components using "is" attribute
- if (el.component) {
- data += "tag:\"" + (el.tag) + "\",";
- }
- // module data generation functions
- for (var i = 0; i < dataGenFns.length; i++) {
- data += dataGenFns[i](el);
- }
- // attributes
- if (el.attrs) {
- data += "attrs:{" + (genProps(el.attrs)) + "},";
- }
- // DOM props
- if (el.props) {
- data += "domProps:{" + (genProps(el.props)) + "},";
- }
- // event handlers
- if (el.events) {
- data += (genHandlers(el.events)) + ",";
- }
- if (el.nativeEvents) {
- data += (genHandlers(el.nativeEvents, true)) + ",";
- }
- // slot target
- if (el.slotTarget) {
- data += "slot:" + (el.slotTarget) + ",";
- }
- // scoped slots
- if (el.scopedSlots) {
- data += (genScopedSlots(el.scopedSlots)) + ",";
- }
- // inline-template
- if (el.inlineTemplate) {
- var inlineTemplate = genInlineTemplate(el);
- if (inlineTemplate) {
- data += inlineTemplate + ",";
- }
- }
- data = data.replace(/,$/, '') + '}';
- // v-bind data wrap
- if (el.wrapData) {
- data = el.wrapData(data);
- }
- return data
- }
-
- function genDirectives (el) {
- var dirs = el.directives;
- if (!dirs) { return }
- var res = 'directives:[';
- var hasRuntime = false;
- var i, l, dir, needRuntime;
- for (i = 0, l = dirs.length; i < l; i++) {
- dir = dirs[i];
- needRuntime = true;
- var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];
- if (gen) {
- // compile-time directive that manipulates AST.
- // returns true if it also needs a runtime counterpart.
- needRuntime = !!gen(el, dir, warn$2);
- }
- if (needRuntime) {
- hasRuntime = true;
- res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
- }
- }
- if (hasRuntime) {
- return res.slice(0, -1) + ']'
- }
- }
-
- function genInlineTemplate (el) {
- var ast = el.children[0];
- if ("development" !== 'production' && (
- el.children.length > 1 || ast.type !== 1
- )) {
- warn$2('Inline-template components must have exactly one child element.');
- }
- if (ast.type === 1) {
- var inlineRenderFns = generate(ast, currentOptions);
- return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
- }
- }
-
- function genScopedSlots (slots) {
- return ("scopedSlots:{" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + "}")
- }
-
- function genScopedSlot (key, el) {
- return key + ":function(" + (String(el.attrsMap.scope)) + "){" +
- "return " + (el.tag === 'template'
- ? genChildren(el) || 'void 0'
- : genElement(el)) + "}"
- }
-
- function genChildren (el, checkSkip) {
- var children = el.children;
- if (children.length) {
- var el$1 = children[0];
- // optimize single v-for
- if (children.length === 1 &&
- el$1.for &&
- el$1.tag !== 'template' &&
- el$1.tag !== 'slot') {
- return genElement(el$1)
- }
- var normalizationType = getNormalizationType(children);
- return ("[" + (children.map(genNode).join(',')) + "]" + (checkSkip
- ? normalizationType ? ("," + normalizationType) : ''
- : ''))
- }
- }
-
- // determine the normalization needed for the children array.
- // 0: no normalization needed
- // 1: simple normalization needed (possible 1-level deep nested array)
- // 2: full normalization needed
- function getNormalizationType (children) {
- var res = 0;
- for (var i = 0; i < children.length; i++) {
- var el = children[i];
- if (el.type !== 1) {
- continue
- }
- if (needsNormalization(el) ||
- (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
- res = 2;
- break
- }
- if (maybeComponent(el) ||
- (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
- res = 1;
- }
- }
- return res
- }
-
- function needsNormalization (el) {
- return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
- }
-
- function maybeComponent (el) {
- return !isPlatformReservedTag$1(el.tag)
- }
-
- function genNode (node) {
- if (node.type === 1) {
- return genElement(node)
- } else {
- return genText(node)
- }
- }
-
- function genText (text) {
- return ("_v(" + (text.type === 2
- ? text.expression // no need for () because already wrapped in _s()
- : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
- }
-
- function genSlot (el) {
- var slotName = el.slotName || '"default"';
- var children = genChildren(el);
- var res = "_t(" + slotName + (children ? ("," + children) : '');
- var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
- var bind$$1 = el.attrsMap['v-bind'];
- if ((attrs || bind$$1) && !children) {
- res += ",null";
- }
- if (attrs) {
- res += "," + attrs;
- }
- if (bind$$1) {
- res += (attrs ? '' : ',null') + "," + bind$$1;
- }
- return res + ')'
- }
-
- // componentName is el.component, take it as argument to shun flow's pessimistic refinement
- function genComponent (componentName, el) {
- var children = el.inlineTemplate ? null : genChildren(el, true);
- return ("_c(" + componentName + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
- }
-
- function genProps (props) {
- var res = '';
- for (var i = 0; i < props.length; i++) {
- var prop = props[i];
- res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
- }
- return res.slice(0, -1)
- }
-
- // #3895, #4268
- function transformSpecialNewlines (text) {
- return text
- .replace(/\u2028/g, '\\u2028')
- .replace(/\u2029/g, '\\u2029')
- }
-
- /* */
-
- /**
- * Compile a template.
- */
- function compile$1 (
- template,
- options
- ) {
- var ast = parse(template.trim(), options);
- optimize(ast, options);
- var code = generate(ast, options);
- return {
- ast: ast,
- render: code.render,
- staticRenderFns: code.staticRenderFns
- }
- }
-
- /* */
-
- // operators like typeof, instanceof and in are allowed
- var prohibitedKeywordRE = new RegExp('\\b' + (
- 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
- 'super,throw,while,yield,delete,export,import,return,switch,default,' +
- 'extends,finally,continue,debugger,function,arguments'
- ).split(',').join('\\b|\\b') + '\\b');
- // check valid identifier for v-for
- var identRE = /[A-Za-z_$][\w$]*/;
- // strip strings in expressions
- var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
-
- // detect problematic expressions in a template
- function detectErrors (ast) {
- var errors = [];
- if (ast) {
- checkNode(ast, errors);
- }
- return errors
- }
-
- function checkNode (node, errors) {
- if (node.type === 1) {
- for (var name in node.attrsMap) {
- if (dirRE.test(name)) {
- var value = node.attrsMap[name];
- if (value) {
- if (name === 'v-for') {
- checkFor(node, ("v-for=\"" + value + "\""), errors);
- } else {
- checkExpression(value, (name + "=\"" + value + "\""), errors);
- }
- }
- }
- }
- if (node.children) {
- for (var i = 0; i < node.children.length; i++) {
- checkNode(node.children[i], errors);
- }
- }
- } else if (node.type === 2) {
- checkExpression(node.expression, node.text, errors);
- }
- }
-
- function checkFor (node, text, errors) {
- checkExpression(node.for || '', text, errors);
- checkIdentifier(node.alias, 'v-for alias', text, errors);
- checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
- checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
- }
-
- function checkIdentifier (ident, type, text, errors) {
- if (typeof ident === 'string' && !identRE.test(ident)) {
- errors.push(("- invalid " + type + " \"" + ident + "\" in expression: " + text));
- }
- }
-
- function checkExpression (exp, text, errors) {
- try {
- new Function(("return " + exp));
- } catch (e) {
- var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
- if (keywordMatch) {
- errors.push(
- "- avoid using JavaScript keyword as property name: " +
- "\"" + (keywordMatch[0]) + "\" in expression " + text
- );
- } else {
- errors.push(("- invalid expression: " + text));
- }
- }
- }
-
- /* */
-
- function transformNode (el, options) {
- var warn = options.warn || baseWarn;
- var staticClass = getAndRemoveAttr(el, 'class');
- if ("development" !== 'production' && staticClass) {
- var expression = parseText(staticClass, options.delimiters);
- if (expression) {
- warn(
- "class=\"" + staticClass + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div class="{{ val }}">, use <div :class="val">.'
- );
- }
- }
- if (staticClass) {
- el.staticClass = JSON.stringify(staticClass);
- }
- var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
- if (classBinding) {
- el.classBinding = classBinding;
- }
- }
-
- function genData$1 (el) {
- var data = '';
- if (el.staticClass) {
- data += "staticClass:" + (el.staticClass) + ",";
- }
- if (el.classBinding) {
- data += "class:" + (el.classBinding) + ",";
- }
- return data
- }
-
- var klass$1 = {
- staticKeys: ['staticClass'],
- transformNode: transformNode,
- genData: genData$1
- };
-
- /* */
-
- function transformNode$1 (el, options) {
- var warn = options.warn || baseWarn;
- var staticStyle = getAndRemoveAttr(el, 'style');
- if (staticStyle) {
- /* istanbul ignore if */
- {
- var expression = parseText(staticStyle, options.delimiters);
- if (expression) {
- warn(
- "style=\"" + staticStyle + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div style="{{ val }}">, use <div :style="val">.'
- );
- }
- }
- el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
- }
-
- var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
- if (styleBinding) {
- el.styleBinding = styleBinding;
- }
- }
-
- function genData$2 (el) {
- var data = '';
- if (el.staticStyle) {
- data += "staticStyle:" + (el.staticStyle) + ",";
- }
- if (el.styleBinding) {
- data += "style:(" + (el.styleBinding) + "),";
- }
- return data
- }
-
- var style$1 = {
- staticKeys: ['staticStyle'],
- transformNode: transformNode$1,
- genData: genData$2
- };
-
- var modules$1 = [
- klass$1,
- style$1
- ];
-
- /* */
-
- var warn$3;
-
- function model$1 (
- el,
- dir,
- _warn
- ) {
- warn$3 = _warn;
- var value = dir.value;
- var modifiers = dir.modifiers;
- var tag = el.tag;
- var type = el.attrsMap.type;
- {
- var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
- if (tag === 'input' && dynamicType) {
- warn$3(
- "<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
- "v-model does not support dynamic input types. Use v-if branches instead."
- );
- }
- }
- if (tag === 'select') {
- genSelect(el, value, modifiers);
- } else if (tag === 'input' && type === 'checkbox') {
- genCheckboxModel(el, value, modifiers);
- } else if (tag === 'input' && type === 'radio') {
- genRadioModel(el, value, modifiers);
- } else {
- genDefaultModel(el, value, modifiers);
- }
- // ensure runtime directive metadata
- return true
- }
-
- function genCheckboxModel (
- el,
- value,
- modifiers
- ) {
- if ("development" !== 'production' &&
- el.attrsMap.checked != null) {
- warn$3(
- "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
- "inline checked attributes will be ignored when using v-model. " +
- 'Declare initial values in the component\'s data option instead.'
- );
- }
- var number = modifiers && modifiers.number;
- var valueBinding = getBindingAttr(el, 'value') || 'null';
- var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
- var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
- addProp(el, 'checked',
- "Array.isArray(" + value + ")" +
- "?_i(" + value + "," + valueBinding + ")>-1" + (
- trueValueBinding === 'true'
- ? (":(" + value + ")")
- : (":_q(" + value + "," + trueValueBinding + ")")
- )
- );
- addHandler(el, 'click',
- "var $$a=" + value + "," +
- '$$el=$event.target,' +
- "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
- 'if(Array.isArray($$a)){' +
- "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
- '$$i=_i($$a,$$v);' +
- "if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
- "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
- "}else{" + value + "=$$c}",
- null, true
- );
- }
-
- function genRadioModel (
- el,
- value,
- modifiers
- ) {
- if ("development" !== 'production' &&
- el.attrsMap.checked != null) {
- warn$3(
- "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
- "inline checked attributes will be ignored when using v-model. " +
- 'Declare initial values in the component\'s data option instead.'
- );
- }
- var number = modifiers && modifiers.number;
- var valueBinding = getBindingAttr(el, 'value') || 'null';
- valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
- addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
- addHandler(el, 'click', genAssignmentCode(value, valueBinding), null, true);
- }
-
- function genDefaultModel (
- el,
- value,
- modifiers
- ) {
- {
- if (el.tag === 'input' && el.attrsMap.value) {
- warn$3(
- "<" + (el.tag) + " v-model=\"" + value + "\" value=\"" + (el.attrsMap.value) + "\">:\n" +
- 'inline value attributes will be ignored when using v-model. ' +
- 'Declare initial values in the component\'s data option instead.'
- );
- }
- if (el.tag === 'textarea' && el.children.length) {
- warn$3(
- "<textarea v-model=\"" + value + "\">:\n" +
- 'inline content inside <textarea> will be ignored when using v-model. ' +
- 'Declare initial values in the component\'s data option instead.'
- );
- }
- }
-
- var type = el.attrsMap.type;
- var ref = modifiers || {};
- var lazy = ref.lazy;
- var number = ref.number;
- var trim = ref.trim;
- var event = lazy || (isIE && type === 'range') ? 'change' : 'input';
- var needCompositionGuard = !lazy && type !== 'range';
- var isNative = el.tag === 'input' || el.tag === 'textarea';
-
- var valueExpression = isNative
- ? ("$event.target.value" + (trim ? '.trim()' : ''))
- : trim ? "(typeof $event === 'string' ? $event.trim() : $event)" : "$event";
- valueExpression = number || type === 'number'
- ? ("_n(" + valueExpression + ")")
- : valueExpression;
-
- var code = genAssignmentCode(value, valueExpression);
- if (isNative && needCompositionGuard) {
- code = "if($event.target.composing)return;" + code;
- }
-
- // inputs with type="file" are read only and setting the input's
- // value will throw an error.
- if ("development" !== 'production' &&
- type === 'file') {
- warn$3(
- "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
- "File inputs are read only. Use a v-on:change listener instead."
- );
- }
-
- addProp(el, 'value', isNative ? ("_s(" + value + ")") : ("(" + value + ")"));
- addHandler(el, event, code, null, true);
- if (trim || number || type === 'number') {
- addHandler(el, 'blur', '$forceUpdate()');
- }
- }
-
- function genSelect (
- el,
- value,
- modifiers
- ) {
- {
- el.children.some(checkOptionWarning);
- }
-
- var number = modifiers && modifiers.number;
- var assignment = "Array.prototype.filter" +
- ".call($event.target.options,function(o){return o.selected})" +
- ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
- "return " + (number ? '_n(val)' : 'val') + "})" +
- (el.attrsMap.multiple == null ? '[0]' : '');
-
- var code = genAssignmentCode(value, assignment);
- addHandler(el, 'change', code, null, true);
- }
-
- function checkOptionWarning (option) {
- if (option.type === 1 &&
- option.tag === 'option' &&
- option.attrsMap.selected != null) {
- warn$3(
- "<select v-model=\"" + (option.parent.attrsMap['v-model']) + "\">:\n" +
- 'inline selected attributes on <option> will be ignored when using v-model. ' +
- 'Declare initial values in the component\'s data option instead.'
- );
- return true
- }
- return false
- }
-
- function genAssignmentCode (value, assignment) {
- var modelRs = parseModel(value);
- if (modelRs.idx === null) {
- return (value + "=" + assignment)
- } else {
- return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
- "if (!Array.isArray($$exp)){" +
- value + "=" + assignment + "}" +
- "else{$$exp.splice($$idx, 1, " + assignment + ")}"
- }
- }
-
- /* */
-
- function text (el, dir) {
- if (dir.value) {
- addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
- }
- }
-
- /* */
-
- function html (el, dir) {
- if (dir.value) {
- addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
- }
- }
-
- var directives$1 = {
- model: model$1,
- text: text,
- html: html
- };
-
- /* */
-
- var cache = Object.create(null);
-
- var baseOptions = {
- expectHTML: true,
- modules: modules$1,
- staticKeys: genStaticKeys(modules$1),
- directives: directives$1,
- isReservedTag: isReservedTag,
- isUnaryTag: isUnaryTag,
- mustUseProp: mustUseProp,
- getTagNamespace: getTagNamespace,
- isPreTag: isPreTag
- };
-
- function compile$$1 (
- template,
- options
- ) {
- options = options
- ? extend(extend({}, baseOptions), options)
- : baseOptions;
- return compile$1(template, options)
- }
-
- function compileToFunctions (
- template,
- options,
- vm
- ) {
- var _warn = (options && options.warn) || warn;
- // detect possible CSP restriction
- /* istanbul ignore if */
- {
- try {
- new Function('return 1');
- } catch (e) {
- if (e.toString().match(/unsafe-eval|CSP/)) {
- _warn(
- 'It seems you are using the standalone build of Vue.js in an ' +
- 'environment with Content Security Policy that prohibits unsafe-eval. ' +
- 'The template compiler cannot work in this environment. Consider ' +
- 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
- 'templates into render functions.'
- );
- }
- }
- }
- var key = options && options.delimiters
- ? String(options.delimiters) + template
- : template;
- if (cache[key]) {
- return cache[key]
- }
- var res = {};
- var compiled = compile$$1(template, options);
- res.render = makeFunction(compiled.render);
- var l = compiled.staticRenderFns.length;
- res.staticRenderFns = new Array(l);
- for (var i = 0; i < l; i++) {
- res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);
- }
- {
- if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {
- _warn(
- "failed to compile template:\n\n" + template + "\n\n" +
- detectErrors(compiled.ast).join('\n') +
- '\n\n',
- vm
- );
- }
- }
- return (cache[key] = res)
- }
-
- function makeFunction (code) {
- try {
- return new Function(code)
- } catch (e) {
- return noop
- }
- }
-
- /* */
-
- var idToTemplate = cached(function (id) {
- var el = query(id);
- return el && el.innerHTML
- });
-
- var mount = Vue$3.prototype.$mount;
- Vue$3.prototype.$mount = function (
- el,
- hydrating
- ) {
- el = el && query(el);
-
- /* istanbul ignore if */
- if (el === document.body || el === document.documentElement) {
- "development" !== 'production' && warn(
- "Do not mount Vue to <html> or <body> - mount to normal elements instead."
- );
- return this
- }
-
- var options = this.$options;
- // resolve template/el and convert to render function
- if (!options.render) {
- var template = options.template;
- if (template) {
- if (typeof template === 'string') {
- if (template.charAt(0) === '#') {
- template = idToTemplate(template);
- /* istanbul ignore if */
- if ("development" !== 'production' && !template) {
- warn(
- ("Template element not found or is empty: " + (options.template)),
- this
- );
- }
- }
- } else if (template.nodeType) {
- template = template.innerHTML;
- } else {
- {
- warn('invalid template option:' + template, this);
- }
- return this
- }
- } else if (el) {
- template = getOuterHTML(el);
- }
- if (template) {
- var ref = compileToFunctions(template, {
- warn: warn,
- shouldDecodeNewlines: shouldDecodeNewlines,
- delimiters: options.delimiters
- }, this);
- var render = ref.render;
- var staticRenderFns = ref.staticRenderFns;
- options.render = render;
- options.staticRenderFns = staticRenderFns;
- }
- }
- return mount.call(this, el, hydrating)
- };
-
- /**
- * Get outerHTML of elements, taking care
- * of SVG elements in IE as well.
- */
- function getOuterHTML (el) {
- if (el.outerHTML) {
- return el.outerHTML
- } else {
- var container = document.createElement('div');
- container.appendChild(el.cloneNode(true));
- return container.innerHTML
- }
- }
-
- Vue$3.compile = compileToFunctions;
-
- return Vue$3;
-
- })));
-
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
-
-/***/ },
-/* 4 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["jQuery"] = __webpack_require__(5);
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
-
-/***/ },
-/* 5 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * jQuery JavaScript Library v3.1.1
- * https://jquery.com/
- *
- * Includes Sizzle.js
- * https://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license
- * https://jquery.org/license
- *
- * Date: 2016-09-22T22:30Z
- */
- ( function( global, factory ) {
-
- "use strict";
-
- if ( typeof module === "object" && typeof module.exports === "object" ) {
-
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get jQuery.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
- module.exports = global.document ?
- factory( global, true ) :
- function( w ) {
- if ( !w.document ) {
- throw new Error( "jQuery requires a window with a document" );
- }
- return factory( w );
- };
- } else {
- factory( global );
- }
-
- // Pass this if window is not defined yet
- } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-
- // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
- // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
- // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
- // enough that all such attempts are guarded in a try block.
- "use strict";
-
- var arr = [];
-
- var document = window.document;
-
- var getProto = Object.getPrototypeOf;
-
- var slice = arr.slice;
-
- var concat = arr.concat;
-
- var push = arr.push;
-
- var indexOf = arr.indexOf;
-
- var class2type = {};
-
- var toString = class2type.toString;
-
- var hasOwn = class2type.hasOwnProperty;
-
- var fnToString = hasOwn.toString;
-
- var ObjectFunctionString = fnToString.call( Object );
-
- var support = {};
-
-
-
- function DOMEval( code, doc ) {
- doc = doc || document;
-
- var script = doc.createElement( "script" );
-
- script.text = code;
- doc.head.appendChild( script ).parentNode.removeChild( script );
- }
- /* global Symbol */
- // Defining this global in .eslintrc.json would create a danger of using the global
- // unguarded in another place, it seems safer to define global only for this module
-
-
-
- var
- version = "3.1.1",
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
-
- // The jQuery object is actually just the init constructor 'enhanced'
- // Need init if jQuery is called (just allow error to be thrown if not included)
- return new jQuery.fn.init( selector, context );
- },
-
- // Support: Android <=4.0 only
- // Make sure we trim BOM and NBSP
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // Matches dashed string for camelizing
- rmsPrefix = /^-ms-/,
- rdashAlpha = /-([a-z])/g,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
-
- jQuery.fn = jQuery.prototype = {
-
- // The current version of jQuery being used
- jquery: version,
-
- constructor: jQuery,
-
- // The default length of a jQuery object is 0
- length: 0,
-
- toArray: function() {
- return slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
-
- // Return all the elements in a clean array
- if ( num == null ) {
- return slice.call( this );
- }
-
- // Return just the one element from the set
- return num < 0 ? this[ num + this.length ] : this[ num ];
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- each: function( callback ) {
- return jQuery.each( this, callback );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map( this, function( elem, i ) {
- return callback.call( elem, i, elem );
- } ) );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ) );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- eq: function( i ) {
- var len = this.length,
- j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
- },
-
- end: function() {
- return this.prevObject || this.constructor();
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: arr.sort,
- splice: arr.splice
- };
-
- jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[ 0 ] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
-
- // Skip the boolean and the target
- target = arguments[ i ] || {};
- i++;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
- target = {};
- }
-
- // Extend jQuery itself if only one argument is passed
- if ( i === length ) {
- target = this;
- i--;
- }
-
- for ( ; i < length; i++ ) {
-
- // Only deal with non-null/undefined values
- if ( ( options = arguments[ i ] ) != null ) {
-
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
- ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
-
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray( src ) ? src : [];
-
- } else {
- clone = src && jQuery.isPlainObject( src ) ? src : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
- };
-
- jQuery.extend( {
-
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
- // Assume jQuery is ready without the ready module
- isReady: true,
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- noop: function() {},
-
- isFunction: function( obj ) {
- return jQuery.type( obj ) === "function";
- },
-
- isArray: Array.isArray,
-
- isWindow: function( obj ) {
- return obj != null && obj === obj.window;
- },
-
- isNumeric: function( obj ) {
-
- // As of jQuery 3.0, isNumeric is limited to
- // strings and numbers (primitives or objects)
- // that can be coerced to finite numbers (gh-2662)
- var type = jQuery.type( obj );
- return ( type === "number" || type === "string" ) &&
-
- // parseFloat NaNs numeric-cast false positives ("")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- !isNaN( obj - parseFloat( obj ) );
- },
-
- isPlainObject: function( obj ) {
- var proto, Ctor;
-
- // Detect obvious negatives
- // Use toString instead of jQuery.type to catch host objects
- if ( !obj || toString.call( obj ) !== "[object Object]" ) {
- return false;
- }
-
- proto = getProto( obj );
-
- // Objects with no prototype (e.g., `Object.create( null )`) are plain
- if ( !proto ) {
- return true;
- }
-
- // Objects with prototype are plain iff they were constructed by a global Object function
- Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
- return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
- },
-
- isEmptyObject: function( obj ) {
-
- /* eslint-disable no-unused-vars */
- // See https://github.com/eslint/eslint/issues/6125
- var name;
-
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- type: function( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
-
- // Support: Android <=2.3 only (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call( obj ) ] || "object" :
- typeof obj;
- },
-
- // Evaluates a script in a global context
- globalEval: function( code ) {
- DOMEval( code );
- },
-
- // Convert dashed to camelCase; used by the css and data modules
- // Support: IE <=9 - 11, Edge 12 - 13
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
- each: function( obj, callback ) {
- var length, i = 0;
-
- if ( isArrayLike( obj ) ) {
- length = obj.length;
- for ( ; i < length; i++ ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- }
-
- return obj;
- },
-
- // Support: Android <=4.0 only
- trim: function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var ret = results || [];
-
- if ( arr != null ) {
- if ( isArrayLike( Object( arr ) ) ) {
- jQuery.merge( ret,
- typeof arr === "string" ?
- [ arr ] : arr
- );
- } else {
- push.call( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- return arr == null ? -1 : indexOf.call( arr, elem, i );
- },
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- merge: function( first, second ) {
- var len = +second.length,
- j = 0,
- i = first.length;
-
- for ( ; j < len; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, invert ) {
- var callbackInverse,
- matches = [],
- i = 0,
- length = elems.length,
- callbackExpect = !invert;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- callbackInverse = !callback( elems[ i ], i );
- if ( callbackInverse !== callbackExpect ) {
- matches.push( elems[ i ] );
- }
- }
-
- return matches;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var length, value,
- i = 0,
- ret = [];
-
- // Go through the array, translating each of the items to their new values
- if ( isArrayLike( elems ) ) {
- length = elems.length;
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( i in elems ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
- }
-
- // Flatten any nested arrays
- return concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- },
-
- now: Date.now,
-
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support: support
- } );
-
- if ( typeof Symbol === "function" ) {
- jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
- }
-
- // Populate the class2type map
- jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
- function( i, name ) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
- } );
-
- function isArrayLike( obj ) {
-
- // Support: real iOS 8.2 only (not reproducible in simulator)
- // `in` check used to prevent JIT error (gh-2145)
- // hasOwn isn't used here due to false negatives
- // regarding Nodelist length in IE
- var length = !!obj && "length" in obj && obj.length,
- type = jQuery.type( obj );
-
- if ( type === "function" || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- return type === "array" || length === 0 ||
- typeof length === "number" && length > 0 && ( length - 1 ) in obj;
- }
- var Sizzle =
- /*!
- * Sizzle CSS Selector Engine v2.3.3
- * https://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2016-08-08
- */
- (function( window ) {
-
- var i,
- support,
- Expr,
- getText,
- isXML,
- tokenize,
- compile,
- select,
- outermostContext,
- sortInput,
- hasDuplicate,
-
- // Local document vars
- setDocument,
- document,
- docElem,
- documentIsHTML,
- rbuggyQSA,
- rbuggyMatches,
- matches,
- contains,
-
- // Instance-specific data
- expando = "sizzle" + 1 * new Date(),
- preferredDoc = window.document,
- dirruns = 0,
- done = 0,
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- }
- return 0;
- },
-
- // Instance methods
- hasOwn = ({}).hasOwnProperty,
- arr = [],
- pop = arr.pop,
- push_native = arr.push,
- push = arr.push,
- slice = arr.slice,
- // Use a stripped-down indexOf as it's faster than native
- // https://jsperf.com/thor-indexof-vs-for/5
- indexOf = function( list, elem ) {
- var i = 0,
- len = list.length;
- for ( ; i < len; i++ ) {
- if ( list[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
- // Regular expressions
-
- // http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
-
- // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
-
- // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
- attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
- // Operator (capture 2)
- "*([*^$|!~]?=)" + whitespace +
- // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
- "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
- "*\\]",
-
- pseudos = ":(" + identifier + ")(?:\\((" +
- // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
- // 1. quoted (capture 3; capture 4 or capture 5)
- "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
- // 2. simple (capture 6)
- "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
- // 3. anything else (capture 2)
- ".*" +
- ")\\)|)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rwhitespace = new RegExp( whitespace + "+", "g" ),
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
- rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
-
- rpseudo = new RegExp( pseudos ),
- ridentifier = new RegExp( "^" + identifier + "$" ),
-
- matchExpr = {
- "ID": new RegExp( "^#(" + identifier + ")" ),
- "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
- "TAG": new RegExp( "^(" + identifier + "|[*])" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
- },
-
- rinputs = /^(?:input|select|textarea|button)$/i,
- rheader = /^h\d$/i,
-
- rnative = /^[^{]+\{\s*\[native \w/,
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
- rsibling = /[+~]/,
-
- // CSS escapes
- // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
- runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
- funescape = function( _, escaped, escapedWhitespace ) {
- var high = "0x" + escaped - 0x10000;
- // NaN means non-codepoint
- // Support: Firefox<24
- // Workaround erroneous numeric interpretation of +"0x"
- return high !== high || escapedWhitespace ?
- escaped :
- high < 0 ?
- // BMP codepoint
- String.fromCharCode( high + 0x10000 ) :
- // Supplemental Plane codepoint (surrogate pair)
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
- },
-
- // CSS string/identifier serialization
- // https://drafts.csswg.org/cssom/#common-serializing-idioms
- rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
- fcssescape = function( ch, asCodePoint ) {
- if ( asCodePoint ) {
-
- // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
- if ( ch === "\0" ) {
- return "\uFFFD";
- }
-
- // Control characters and (dependent upon position) numbers get escaped as code points
- return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
- }
-
- // Other potentially-special ASCII characters get backslash-escaped
- return "\\" + ch;
- },
-
- // Used for iframes
- // See setDocument()
- // Removing the function wrapper causes a "Permission Denied"
- // error in IE
- unloadHandler = function() {
- setDocument();
- },
-
- disabledAncestor = addCombinator(
- function( elem ) {
- return elem.disabled === true && ("form" in elem || "label" in elem);
- },
- { dir: "parentNode", next: "legend" }
- );
-
- // Optimize for push.apply( _, NodeList )
- try {
- push.apply(
- (arr = slice.call( preferredDoc.childNodes )),
- preferredDoc.childNodes
- );
- // Support: Android<4.0
- // Detect silently failing push.apply
- arr[ preferredDoc.childNodes.length ].nodeType;
- } catch ( e ) {
- push = { apply: arr.length ?
-
- // Leverage slice if possible
- function( target, els ) {
- push_native.apply( target, slice.call(els) );
- } :
-
- // Support: IE<9
- // Otherwise append directly
- function( target, els ) {
- var j = target.length,
- i = 0;
- // Can't trust NodeList.length
- while ( (target[j++] = els[i++]) ) {}
- target.length = j - 1;
- }
- };
- }
-
- function Sizzle( selector, context, results, seed ) {
- var m, i, elem, nid, match, groups, newSelector,
- newContext = context && context.ownerDocument,
-
- // nodeType defaults to 9, since context defaults to document
- nodeType = context ? context.nodeType : 9;
-
- results = results || [];
-
- // Return early from calls with invalid selector or context
- if ( typeof selector !== "string" || !selector ||
- nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
- return results;
- }
-
- // Try to shortcut find operations (as opposed to filters) in HTML documents
- if ( !seed ) {
-
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
- setDocument( context );
- }
- context = context || document;
-
- if ( documentIsHTML ) {
-
- // If the selector is sufficiently simple, try using a "get*By*" DOM method
- // (excepting DocumentFragment context, where the methods don't exist)
- if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
-
- // ID selector
- if ( (m = match[1]) ) {
-
- // Document context
- if ( nodeType === 9 ) {
- if ( (elem = context.getElementById( m )) ) {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
-
- // Element context
- } else {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( newContext && (elem = newContext.getElementById( m )) &&
- contains( context, elem ) &&
- elem.id === m ) {
-
- results.push( elem );
- return results;
- }
- }
-
- // Type selector
- } else if ( match[2] ) {
- push.apply( results, context.getElementsByTagName( selector ) );
- return results;
-
- // Class selector
- } else if ( (m = match[3]) && support.getElementsByClassName &&
- context.getElementsByClassName ) {
-
- push.apply( results, context.getElementsByClassName( m ) );
- return results;
- }
- }
-
- // Take advantage of querySelectorAll
- if ( support.qsa &&
- !compilerCache[ selector + " " ] &&
- (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
-
- if ( nodeType !== 1 ) {
- newContext = context;
- newSelector = selector;
-
- // qSA looks outside Element context, which is not what we want
- // Thanks to Andrew Dupont for this workaround technique
- // Support: IE <=8
- // Exclude object elements
- } else if ( context.nodeName.toLowerCase() !== "object" ) {
-
- // Capture the context ID, setting it first if necessary
- if ( (nid = context.getAttribute( "id" )) ) {
- nid = nid.replace( rcssescape, fcssescape );
- } else {
- context.setAttribute( "id", (nid = expando) );
- }
-
- // Prefix every selector in the list
- groups = tokenize( selector );
- i = groups.length;
- while ( i-- ) {
- groups[i] = "#" + nid + " " + toSelector( groups[i] );
- }
- newSelector = groups.join( "," );
-
- // Expand context for sibling selectors
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
- context;
- }
-
- if ( newSelector ) {
- try {
- push.apply( results,
- newContext.querySelectorAll( newSelector )
- );
- return results;
- } catch ( qsaError ) {
- } finally {
- if ( nid === expando ) {
- context.removeAttribute( "id" );
- }
- }
- }
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
- }
-
- /**
- * Create key-value caches of limited size
- * @returns {function(string, object)} Returns the Object data after storing it on itself with
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- * deleting the oldest entry
- */
- function createCache() {
- var keys = [];
-
- function cache( key, value ) {
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
- if ( keys.push( key + " " ) > Expr.cacheLength ) {
- // Only keep the most recent entries
- delete cache[ keys.shift() ];
- }
- return (cache[ key + " " ] = value);
- }
- return cache;
- }
-
- /**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
- function markFunction( fn ) {
- fn[ expando ] = true;
- return fn;
- }
-
- /**
- * Support testing using an element
- * @param {Function} fn Passed the created element and returns a boolean result
- */
- function assert( fn ) {
- var el = document.createElement("fieldset");
-
- try {
- return !!fn( el );
- } catch (e) {
- return false;
- } finally {
- // Remove from its parent by default
- if ( el.parentNode ) {
- el.parentNode.removeChild( el );
- }
- // release memory in IE
- el = null;
- }
- }
-
- /**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
- function addHandle( attrs, handler ) {
- var arr = attrs.split("|"),
- i = arr.length;
-
- while ( i-- ) {
- Expr.attrHandle[ arr[i] ] = handler;
- }
- }
-
- /**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
- function siblingCheck( a, b ) {
- var cur = b && a,
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- a.sourceIndex - b.sourceIndex;
-
- // Use IE sourceIndex if available on both nodes
- if ( diff ) {
- return diff;
- }
-
- // Check if b follows a
- if ( cur ) {
- while ( (cur = cur.nextSibling) ) {
- if ( cur === b ) {
- return -1;
- }
- }
- }
-
- return a ? 1 : -1;
- }
-
- /**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
- function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
- }
-
- /**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
- function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && elem.type === type;
- };
- }
-
- /**
- * Returns a function to use in pseudos for :enabled/:disabled
- * @param {Boolean} disabled true for :disabled; false for :enabled
- */
- function createDisabledPseudo( disabled ) {
-
- // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
- return function( elem ) {
-
- // Only certain elements can match :enabled or :disabled
- // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
- // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
- if ( "form" in elem ) {
-
- // Check for inherited disabledness on relevant non-disabled elements:
- // * listed form-associated elements in a disabled fieldset
- // https://html.spec.whatwg.org/multipage/forms.html#category-listed
- // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
- // * option elements in a disabled optgroup
- // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
- // All such elements have a "form" property.
- if ( elem.parentNode && elem.disabled === false ) {
-
- // Option elements defer to a parent optgroup if present
- if ( "label" in elem ) {
- if ( "label" in elem.parentNode ) {
- return elem.parentNode.disabled === disabled;
- } else {
- return elem.disabled === disabled;
- }
- }
-
- // Support: IE 6 - 11
- // Use the isDisabled shortcut property to check for disabled fieldset ancestors
- return elem.isDisabled === disabled ||
-
- // Where there is no isDisabled, check manually
- /* jshint -W018 */
- elem.isDisabled !== !disabled &&
- disabledAncestor( elem ) === disabled;
- }
-
- return elem.disabled === disabled;
-
- // Try to winnow out elements that can't be disabled before trusting the disabled property.
- // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
- // even exist on them, let alone have a boolean value.
- } else if ( "label" in elem ) {
- return elem.disabled === disabled;
- }
-
- // Remaining elements are neither :enabled nor :disabled
- return false;
- };
- }
-
- /**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
- function createPositionalPseudo( fn ) {
- return markFunction(function( argument ) {
- argument = +argument;
- return markFunction(function( seed, matches ) {
- var j,
- matchIndexes = fn( [], seed.length, argument ),
- i = matchIndexes.length;
-
- // Match elements found at the specified indexes
- while ( i-- ) {
- if ( seed[ (j = matchIndexes[i]) ] ) {
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
- }
-
- /**
- * Checks a node for validity as a Sizzle context
- * @param {Element|Object=} context
- * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
- */
- function testContext( context ) {
- return context && typeof context.getElementsByTagName !== "undefined" && context;
- }
-
- // Expose support vars for convenience
- support = Sizzle.support = {};
-
- /**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
- isXML = Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
- };
-
- /**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
- setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare, subWindow,
- doc = node ? node.ownerDocument || node : preferredDoc;
-
- // Return early if doc is invalid or already selected
- if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
- return document;
- }
-
- // Update global variables
- document = doc;
- docElem = document.documentElement;
- documentIsHTML = !isXML( document );
-
- // Support: IE 9-11, Edge
- // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
- if ( preferredDoc !== document &&
- (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
-
- // Support: IE 11, Edge
- if ( subWindow.addEventListener ) {
- subWindow.addEventListener( "unload", unloadHandler, false );
-
- // Support: IE 9 - 10 only
- } else if ( subWindow.attachEvent ) {
- subWindow.attachEvent( "onunload", unloadHandler );
- }
- }
-
- /* Attributes
- ---------------------------------------------------------------------- */
-
- // Support: IE<8
- // Verify that getAttribute really returns attributes and not properties
- // (excepting IE8 booleans)
- support.attributes = assert(function( el ) {
- el.className = "i";
- return !el.getAttribute("className");
- });
-
- /* getElement(s)By*
- ---------------------------------------------------------------------- */
-
- // Check if getElementsByTagName("*") returns only elements
- support.getElementsByTagName = assert(function( el ) {
- el.appendChild( document.createComment("") );
- return !el.getElementsByTagName("*").length;
- });
-
- // Support: IE<9
- support.getElementsByClassName = rnative.test( document.getElementsByClassName );
-
- // Support: IE<10
- // Check if getElementById returns elements by name
- // The broken getElementById methods don't pick up programmatically-set names,
- // so use a roundabout getElementsByName test
- support.getById = assert(function( el ) {
- docElem.appendChild( el ).id = expando;
- return !document.getElementsByName || !document.getElementsByName( expando ).length;
- });
-
- // ID filter and find
- if ( support.getById ) {
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- return elem.getAttribute("id") === attrId;
- };
- };
- Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var elem = context.getElementById( id );
- return elem ? [ elem ] : [];
- }
- };
- } else {
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== "undefined" &&
- elem.getAttributeNode("id");
- return node && node.value === attrId;
- };
- };
-
- // Support: IE 6 - 7 only
- // getElementById is not reliable as a find shortcut
- Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var node, i, elems,
- elem = context.getElementById( id );
-
- if ( elem ) {
-
- // Verify the id attribute
- node = elem.getAttributeNode("id");
- if ( node && node.value === id ) {
- return [ elem ];
- }
-
- // Fall back on getElementsByName
- elems = context.getElementsByName( id );
- i = 0;
- while ( (elem = elems[i++]) ) {
- node = elem.getAttributeNode("id");
- if ( node && node.value === id ) {
- return [ elem ];
- }
- }
- }
-
- return [];
- }
- };
- }
-
- // Tag
- Expr.find["TAG"] = support.getElementsByTagName ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( tag );
-
- // DocumentFragment nodes don't have gEBTN
- } else if ( support.qsa ) {
- return context.querySelectorAll( tag );
- }
- } :
-
- function( tag, context ) {
- var elem,
- tmp = [],
- i = 0,
- // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
- results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- while ( (elem = results[i++]) ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- };
-
- // Class
- Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
- if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
- return context.getElementsByClassName( className );
- }
- };
-
- /* QSA/matchesSelector
- ---------------------------------------------------------------------- */
-
- // QSA and matchesSelector support
-
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- rbuggyMatches = [];
-
- // qSa(:focus) reports false when true (Chrome 21)
- // We allow this because of a bug in IE8/9 that throws an error
- // whenever `document.activeElement` is accessed on an iframe
- // So, we allow :focus to pass through QSA all the time to avoid the IE error
- // See https://bugs.jquery.com/ticket/13378
- rbuggyQSA = [];
-
- if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert(function( el ) {
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explicitly
- // setting a boolean content attribute,
- // since its presence should be enough
- // https://bugs.jquery.com/ticket/12359
- docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
- "<select id='" + expando + "-\r\\' msallowcapture=''>" +
- "<option selected=''></option></select>";
-
- // Support: IE8, Opera 11-12.16
- // Nothing should be selected when empty strings follow ^= or $= or *=
- // The test attribute must be unknown in Opera but "safe" for WinRT
- // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
- if ( el.querySelectorAll("[msallowcapture^='']").length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
- }
-
- // Support: IE8
- // Boolean attributes and "value" are not treated correctly
- if ( !el.querySelectorAll("[selected]").length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
- }
-
- // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
- if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
- rbuggyQSA.push("~=");
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here and will not see later tests
- if ( !el.querySelectorAll(":checked").length ) {
- rbuggyQSA.push(":checked");
- }
-
- // Support: Safari 8+, iOS 8+
- // https://bugs.webkit.org/show_bug.cgi?id=136851
- // In-page `selector#id sibling-combinator selector` fails
- if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
- rbuggyQSA.push(".#.+[+~]");
- }
- });
-
- assert(function( el ) {
- el.innerHTML = "<a href='' disabled='disabled'></a>" +
- "<select disabled='disabled'><option/></select>";
-
- // Support: Windows 8 Native Apps
- // The type and name attributes are restricted during .innerHTML assignment
- var input = document.createElement("input");
- input.setAttribute( "type", "hidden" );
- el.appendChild( input ).setAttribute( "name", "D" );
-
- // Support: IE8
- // Enforce case-sensitivity of name attribute
- if ( el.querySelectorAll("[name=d]").length ) {
- rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here and will not see later tests
- if ( el.querySelectorAll(":enabled").length !== 2 ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Support: IE9-11+
- // IE's :disabled selector does not pick up the children of disabled fieldsets
- docElem.appendChild( el ).disabled = true;
- if ( el.querySelectorAll(":disabled").length !== 2 ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Opera 10-11 does not throw on post-comma invalid pseudos
- el.querySelectorAll("*,:x");
- rbuggyQSA.push(",.*:");
- });
- }
-
- if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
- docElem.webkitMatchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector) )) ) {
-
- assert(function( el ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- support.disconnectedMatch = matches.call( el, "*" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( el, "[s!='']:x" );
- rbuggyMatches.push( "!=", pseudos );
- });
- }
-
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
- /* Contains
- ---------------------------------------------------------------------- */
- hasCompare = rnative.test( docElem.compareDocumentPosition );
-
- // Element contains another
- // Purposefully self-exclusive
- // As in, an element does not contain itself
- contains = hasCompare || rnative.test( docElem.contains ) ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && (
- adown.contains ?
- adown.contains( bup ) :
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
- ));
- } :
- function( a, b ) {
- if ( b ) {
- while ( (b = b.parentNode) ) {
- if ( b === a ) {
- return true;
- }
- }
- }
- return false;
- };
-
- /* Sorting
- ---------------------------------------------------------------------- */
-
- // Document order sorting
- sortOrder = hasCompare ?
- function( a, b ) {
-
- // Flag for duplicate removal
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- // Sort on method existence if only one input has compareDocumentPosition
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if ( compare ) {
- return compare;
- }
-
- // Calculate position if both inputs belong to the same document
- compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
- a.compareDocumentPosition( b ) :
-
- // Otherwise we know they are disconnected
- 1;
-
- // Disconnected nodes
- if ( compare & 1 ||
- (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
-
- // Choose the first element that is related to our preferred document
- if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
- return -1;
- }
- if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
- return 1;
- }
-
- // Maintain original order
- return sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
- }
-
- return compare & 4 ? -1 : 1;
- } :
- function( a, b ) {
- // Exit early if the nodes are identical
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- var cur,
- i = 0,
- aup = a.parentNode,
- bup = b.parentNode,
- ap = [ a ],
- bp = [ b ];
-
- // Parentless nodes are either documents or disconnected
- if ( !aup || !bup ) {
- return a === document ? -1 :
- b === document ? 1 :
- aup ? -1 :
- bup ? 1 :
- sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
-
- // If the nodes are siblings, we can do a quick check
- } else if ( aup === bup ) {
- return siblingCheck( a, b );
- }
-
- // Otherwise we need full lists of their ancestors for comparison
- cur = a;
- while ( (cur = cur.parentNode) ) {
- ap.unshift( cur );
- }
- cur = b;
- while ( (cur = cur.parentNode) ) {
- bp.unshift( cur );
- }
-
- // Walk down the tree looking for a discrepancy
- while ( ap[i] === bp[i] ) {
- i++;
- }
-
- return i ?
- // Do a sibling check if the nodes have a common ancestor
- siblingCheck( ap[i], bp[i] ) :
-
- // Otherwise nodes in our document sort first
- ap[i] === preferredDoc ? -1 :
- bp[i] === preferredDoc ? 1 :
- 0;
- };
-
- return document;
- };
-
- Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
- };
-
- Sizzle.matchesSelector = function( elem, expr ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- // Make sure that attribute selectors are quoted
- expr = expr.replace( rattributeQuotes, "='$1']" );
-
- if ( support.matchesSelector && documentIsHTML &&
- !compilerCache[ expr + " " ] &&
- ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
- ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
-
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || support.disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
- return ret;
- }
- } catch (e) {}
- }
-
- return Sizzle( expr, document, null, [ elem ] ).length > 0;
- };
-
- Sizzle.contains = function( context, elem ) {
- // Set document vars if needed
- if ( ( context.ownerDocument || context ) !== document ) {
- setDocument( context );
- }
- return contains( context, elem );
- };
-
- Sizzle.attr = function( elem, name ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- var fn = Expr.attrHandle[ name.toLowerCase() ],
- // Don't get fooled by Object.prototype properties (jQuery #13807)
- val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
- fn( elem, name, !documentIsHTML ) :
- undefined;
-
- return val !== undefined ?
- val :
- support.attributes || !documentIsHTML ?
- elem.getAttribute( name ) :
- (val = elem.getAttributeNode(name)) && val.specified ?
- val.value :
- null;
- };
-
- Sizzle.escape = function( sel ) {
- return (sel + "").replace( rcssescape, fcssescape );
- };
-
- Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
- };
-
- /**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
- Sizzle.uniqueSort = function( results ) {
- var elem,
- duplicates = [],
- j = 0,
- i = 0;
-
- // Unless we *know* we can detect duplicates, assume their presence
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice( 0 );
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- while ( (elem = results[i++]) ) {
- if ( elem === results[ i ] ) {
- j = duplicates.push( i );
- }
- }
- while ( j-- ) {
- results.splice( duplicates[ j ], 1 );
- }
- }
-
- // Clear input after sorting to release objects
- // See https://github.com/jquery/sizzle/pull/225
- sortInput = null;
-
- return results;
- };
-
- /**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
- getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( !nodeType ) {
- // If no nodeType, this is expected to be an array
- while ( (node = elem[i++]) ) {
- // Do not traverse comment nodes
- ret += getText( node );
- }
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (jQuery #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- // Do not include comment or processing instruction nodes
-
- return ret;
- };
-
- Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- attrHandle: {},
-
- find: {},
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[1] = match[1].replace( runescape, funescape );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
-
- if ( match[2] === "~=" ) {
- match[3] = " " + match[3] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 what (child|of-type)
- 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 4 xn-component of xn+y argument ([+-]?\d*n|)
- 5 sign of xn-component
- 6 x of xn-component
- 7 sign of y-component
- 8 y of y-component
- */
- match[1] = match[1].toLowerCase();
-
- if ( match[1].slice( 0, 3 ) === "nth" ) {
- // nth-* requires argument
- if ( !match[3] ) {
- Sizzle.error( match[0] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
- match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[3] ) {
- Sizzle.error( match[0] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var excess,
- unquoted = !match[6] && match[2];
-
- if ( matchExpr["CHILD"].test( match[0] ) ) {
- return null;
- }
-
- // Accept quoted arguments as-is
- if ( match[3] ) {
- match[2] = match[4] || match[5] || "";
-
- // Strip excess characters from unquoted arguments
- } else if ( unquoted && rpseudo.test( unquoted ) &&
- // Get excess from tokenize (recursively)
- (excess = tokenize( unquoted, true )) &&
- // advance to the next closing parenthesis
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
- // excess is a negative index
- match[0] = match[0].slice( 0, excess );
- match[2] = unquoted.slice( 0, excess );
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
-
- "TAG": function( nodeNameSelector ) {
- var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
- return nodeNameSelector === "*" ?
- function() { return true; } :
- function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ className + " " ];
-
- return pattern ||
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
- classCache( className, function( elem ) {
- return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
- });
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem ) {
- var result = Sizzle.attr( elem, name );
-
- if ( result == null ) {
- return operator === "!=";
- }
- if ( !operator ) {
- return true;
- }
-
- result += "";
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.slice( -check.length ) === check :
- operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
- false;
- };
- },
-
- "CHILD": function( type, what, argument, first, last ) {
- var simple = type.slice( 0, 3 ) !== "nth",
- forward = type.slice( -4 ) !== "last",
- ofType = what === "of-type";
-
- return first === 1 && last === 0 ?
-
- // Shortcut for :nth-*(n)
- function( elem ) {
- return !!elem.parentNode;
- } :
-
- function( elem, context, xml ) {
- var cache, uniqueCache, outerCache, node, nodeIndex, start,
- dir = simple !== forward ? "nextSibling" : "previousSibling",
- parent = elem.parentNode,
- name = ofType && elem.nodeName.toLowerCase(),
- useCache = !xml && !ofType,
- diff = false;
-
- if ( parent ) {
-
- // :(first|last|only)-(child|of-type)
- if ( simple ) {
- while ( dir ) {
- node = elem;
- while ( (node = node[ dir ]) ) {
- if ( ofType ?
- node.nodeName.toLowerCase() === name :
- node.nodeType === 1 ) {
-
- return false;
- }
- }
- // Reverse direction for :only-* (if we haven't yet done so)
- start = dir = type === "only" && !start && "nextSibling";
- }
- return true;
- }
-
- start = [ forward ? parent.firstChild : parent.lastChild ];
-
- // non-xml :nth-child(...) stores cache data on `parent`
- if ( forward && useCache ) {
-
- // Seek `elem` from a previously-cached index
-
- // ...in a gzip-friendly way
- node = parent;
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- cache = uniqueCache[ type ] || [];
- nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
- diff = nodeIndex && cache[ 2 ];
- node = nodeIndex && parent.childNodes[ nodeIndex ];
-
- while ( (node = ++nodeIndex && node && node[ dir ] ||
-
- // Fallback to seeking `elem` from the start
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- // When found, cache indexes on `parent` and break
- if ( node.nodeType === 1 && ++diff && node === elem ) {
- uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
- break;
- }
- }
-
- } else {
- // Use previously-cached element index if available
- if ( useCache ) {
- // ...in a gzip-friendly way
- node = elem;
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- cache = uniqueCache[ type ] || [];
- nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
- diff = nodeIndex;
- }
-
- // xml :nth-child(...)
- // or :nth-last-child(...) or :nth(-last)?-of-type(...)
- if ( diff === false ) {
- // Use the same loop as above to seek `elem` from the start
- while ( (node = ++nodeIndex && node && node[ dir ] ||
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- if ( ( ofType ?
- node.nodeName.toLowerCase() === name :
- node.nodeType === 1 ) &&
- ++diff ) {
-
- // Cache the index of each encountered element
- if ( useCache ) {
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- uniqueCache[ type ] = [ dirruns, diff ];
- }
-
- if ( node === elem ) {
- break;
- }
- }
- }
- }
- }
-
- // Incorporate the offset, then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- }
- };
- },
-
- "PSEUDO": function( pseudo, argument ) {
- // pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
- // Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
-
- // The user may use createPseudo to indicate that
- // arguments are needed to create the filter function
- // just as Sizzle does
- if ( fn[ expando ] ) {
- return fn( argument );
- }
-
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction(function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf( seed, matched[i] );
- seed[ idx ] = !( matches[ idx ] = matched[i] );
- }
- }) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- pseudos: {
- // Potentially complex pseudos
- "not": markFunction(function( selector ) {
- // Trim the selector passed to compile
- // to avoid treating leading and trailing
- // spaces as combinators
- var input = [],
- results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
-
- return matcher[ expando ] ?
- markFunction(function( seed, matches, context, xml ) {
- var elem,
- unmatched = matcher( seed, null, xml, [] ),
- i = seed.length;
-
- // Match elements unmatched by `matcher`
- while ( i-- ) {
- if ( (elem = unmatched[i]) ) {
- seed[i] = !(matches[i] = elem);
- }
- }
- }) :
- function( elem, context, xml ) {
- input[0] = elem;
- matcher( input, null, xml, results );
- // Don't keep the element (issue #299)
- input[0] = null;
- return !results.pop();
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
- "contains": markFunction(function( text ) {
- text = text.replace( runescape, funescape );
- return function( elem ) {
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- // "Whether an element is represented by a :lang() selector
- // is based solely on the element's language value
- // being equal to the identifier C,
- // or beginning with the identifier C immediately followed by "-".
- // The matching of C against the element's language value is performed case-insensitively.
- // The identifier C does not have to be a valid language name."
- // http://www.w3.org/TR/selectors/#lang-pseudo
- "lang": markFunction( function( lang ) {
- // lang value must be a valid identifier
- if ( !ridentifier.test(lang || "") ) {
- Sizzle.error( "unsupported lang: " + lang );
- }
- lang = lang.replace( runescape, funescape ).toLowerCase();
- return function( elem ) {
- var elemLang;
- do {
- if ( (elemLang = documentIsHTML ?
- elem.lang :
- elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
-
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
- }
- } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
- return false;
- };
- }),
-
- // Miscellaneous
- "target": function( elem ) {
- var hash = window.location && window.location.hash;
- return hash && hash.slice( 1 ) === elem.id;
- },
-
- "root": function( elem ) {
- return elem === docElem;
- },
-
- "focus": function( elem ) {
- return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
- },
-
- // Boolean properties
- "enabled": createDisabledPseudo( false ),
- "disabled": createDisabledPseudo( true ),
-
- "checked": function( elem ) {
- // In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
- },
-
- "selected": function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- // Contents
- "empty": function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
- // but not by others (comment: 8; processing instruction: 7; etc.)
- // nodeType < 6 works because attributes (2) do not appear as children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- if ( elem.nodeType < 6 ) {
- return false;
- }
- }
- return true;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos["empty"]( elem );
- },
-
- // Element/input types
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "text": function( elem ) {
- var attr;
- return elem.nodeName.toLowerCase() === "input" &&
- elem.type === "text" &&
-
- // Support: IE<8
- // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
- },
-
- // Position-in-collection
- "first": createPositionalPseudo(function() {
- return [ 0 ];
- }),
-
- "last": createPositionalPseudo(function( matchIndexes, length ) {
- return [ length - 1 ];
- }),
-
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ argument < 0 ? argument + length : argument ];
- }),
-
- "even": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 0;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 1;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- })
- }
- };
-
- Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
- // Add button/input type pseudos
- for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
- Expr.pseudos[ i ] = createInputPseudo( i );
- }
- for ( i in { submit: true, reset: true } ) {
- Expr.pseudos[ i ] = createButtonPseudo( i );
- }
-
- // Easy API for creating new setFilters
- function setFilters() {}
- setFilters.prototype = Expr.filters = Expr.pseudos;
- Expr.setFilters = new setFilters();
-
- tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
- var matched, match, tokens, type,
- soFar, groups, preFilters,
- cached = tokenCache[ selector + " " ];
-
- if ( cached ) {
- return parseOnly ? 0 : cached.slice( 0 );
- }
-
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
-
- while ( soFar ) {
-
- // Comma and first run
- if ( !matched || (match = rcomma.exec( soFar )) ) {
- if ( match ) {
- // Don't consume trailing commas as valid
- soFar = soFar.slice( match[0].length ) || soFar;
- }
- groups.push( (tokens = []) );
- }
-
- matched = false;
-
- // Combinators
- if ( (match = rcombinators.exec( soFar )) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- // Cast descendant combinators to space
- type: match[0].replace( rtrim, " " )
- });
- soFar = soFar.slice( matched.length );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- (match = preFilters[ type ]( match ))) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type: type,
- matches: match
- });
- soFar = soFar.slice( matched.length );
- }
- }
-
- if ( !matched ) {
- break;
- }
- }
-
- // Return the length of the invalid excess
- // if we're just parsing
- // Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
- };
-
- function toSelector( tokens ) {
- var i = 0,
- len = tokens.length,
- selector = "";
- for ( ; i < len; i++ ) {
- selector += tokens[i].value;
- }
- return selector;
- }
-
- function addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- skip = combinator.next,
- key = skip || dir,
- checkNonElements = base && key === "parentNode",
- doneName = done++;
-
- return combinator.first ?
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- return matcher( elem, context, xml );
- }
- }
- return false;
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- var oldCache, uniqueCache, outerCache,
- newCache = [ dirruns, doneName ];
-
- // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
- if ( xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- if ( matcher( elem, context, xml ) ) {
- return true;
- }
- }
- }
- } else {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- outerCache = elem[ expando ] || (elem[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
-
- if ( skip && skip === elem.nodeName.toLowerCase() ) {
- elem = elem[ dir ] || elem;
- } else if ( (oldCache = uniqueCache[ key ]) &&
- oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
-
- // Assign to newCache so results back-propagate to previous elements
- return (newCache[ 2 ] = oldCache[ 2 ]);
- } else {
- // Reuse newcache so results back-propagate to previous elements
- uniqueCache[ key ] = newCache;
-
- // A match means we're done; a fail means we have to keep checking
- if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
- return true;
- }
- }
- }
- }
- }
- return false;
- };
- }
-
- function elementMatcher( matchers ) {
- return matchers.length > 1 ?
- function( elem, context, xml ) {
- var i = matchers.length;
- while ( i-- ) {
- if ( !matchers[i]( elem, context, xml ) ) {
- return false;
- }
- }
- return true;
- } :
- matchers[0];
- }
-
- function multipleContexts( selector, contexts, results ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results );
- }
- return results;
- }
-
- function condense( unmatched, map, filter, context, xml ) {
- var elem,
- newUnmatched = [],
- i = 0,
- len = unmatched.length,
- mapped = map != null;
-
- for ( ; i < len; i++ ) {
- if ( (elem = unmatched[i]) ) {
- if ( !filter || filter( elem, context, xml ) ) {
- newUnmatched.push( elem );
- if ( mapped ) {
- map.push( i );
- }
- }
- }
- }
-
- return newUnmatched;
- }
-
- function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
- if ( postFilter && !postFilter[ expando ] ) {
- postFilter = setMatcher( postFilter );
- }
- if ( postFinder && !postFinder[ expando ] ) {
- postFinder = setMatcher( postFinder, postSelector );
- }
- return markFunction(function( seed, results, context, xml ) {
- var temp, i, elem,
- preMap = [],
- postMap = [],
- preexisting = results.length,
-
- // Get initial elements from seed or context
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
- matcherIn = preFilter && ( seed || !selector ) ?
- condense( elems, preMap, preFilter, context, xml ) :
- elems,
-
- matcherOut = matcher ?
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
- // ...intermediate processing is necessary
- [] :
-
- // ...otherwise use results directly
- results :
- matcherIn;
-
- // Find primary matches
- if ( matcher ) {
- matcher( matcherIn, matcherOut, context, xml );
- }
-
- // Apply postFilter
- if ( postFilter ) {
- temp = condense( matcherOut, postMap );
- postFilter( temp, [], context, xml );
-
- // Un-match failing elements by moving them back to matcherIn
- i = temp.length;
- while ( i-- ) {
- if ( (elem = temp[i]) ) {
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
- }
- }
- }
-
- if ( seed ) {
- if ( postFinder || preFilter ) {
- if ( postFinder ) {
- // Get the final matcherOut by condensing this intermediate into postFinder contexts
- temp = [];
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) ) {
- // Restore matcherIn since elem is not yet a final match
- temp.push( (matcherIn[i] = elem) );
- }
- }
- postFinder( null, (matcherOut = []), temp, xml );
- }
-
- // Move matched elements from seed to results to keep them synchronized
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) &&
- (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
-
- seed[temp] = !(results[temp] = elem);
- }
- }
- }
-
- // Add elements to results, through postFinder if defined
- } else {
- matcherOut = condense(
- matcherOut === results ?
- matcherOut.splice( preexisting, matcherOut.length ) :
- matcherOut
- );
- if ( postFinder ) {
- postFinder( null, results, matcherOut, xml );
- } else {
- push.apply( results, matcherOut );
- }
- }
- });
- }
-
- function matcherFromTokens( tokens ) {
- var checkContext, matcher, j,
- len = tokens.length,
- leadingRelative = Expr.relative[ tokens[0].type ],
- implicitRelative = leadingRelative || Expr.relative[" "],
- i = leadingRelative ? 1 : 0,
-
- // The foundational matcher ensures that elements are reachable from top-level context(s)
- matchContext = addCombinator( function( elem ) {
- return elem === checkContext;
- }, implicitRelative, true ),
- matchAnyContext = addCombinator( function( elem ) {
- return indexOf( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- (checkContext = context).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
- // Avoid hanging onto element (issue #299)
- checkContext = null;
- return ret;
- } ];
-
- for ( ; i < len; i++ ) {
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
- matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
- } else {
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
- // Return special upon seeing a positional matcher
- if ( matcher[ expando ] ) {
- // Find the next relative operator (if any) for proper handling
- j = ++i;
- for ( ; j < len; j++ ) {
- if ( Expr.relative[ tokens[j].type ] ) {
- break;
- }
- }
- return setMatcher(
- i > 1 && elementMatcher( matchers ),
- i > 1 && toSelector(
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
- ).replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
- j < len && toSelector( tokens )
- );
- }
- matchers.push( matcher );
- }
- }
-
- return elementMatcher( matchers );
- }
-
- function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
- var bySet = setMatchers.length > 0,
- byElement = elementMatchers.length > 0,
- superMatcher = function( seed, context, xml, results, outermost ) {
- var elem, j, matcher,
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- setMatched = [],
- contextBackup = outermostContext,
- // We must always have either seed elements or outermost context
- elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
- // Use integer dirruns iff this is the outermost matcher
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
- len = elems.length;
-
- if ( outermost ) {
- outermostContext = context === document || context || outermost;
- }
-
- // Add elements passing elementMatchers directly to results
- // Support: IE<9, Safari
- // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
- for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
- if ( byElement && elem ) {
- j = 0;
- if ( !context && elem.ownerDocument !== document ) {
- setDocument( elem );
- xml = !documentIsHTML;
- }
- while ( (matcher = elementMatchers[j++]) ) {
- if ( matcher( elem, context || document, xml) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- }
- }
-
- // Track unmatched elements for set filters
- if ( bySet ) {
- // They will have gone through all possible matchers
- if ( (elem = !matcher && elem) ) {
- matchedCount--;
- }
-
- // Lengthen the array for every element, matched or not
- if ( seed ) {
- unmatched.push( elem );
- }
- }
- }
-
- // `i` is now the count of elements visited above, and adding it to `matchedCount`
- // makes the latter nonnegative.
- matchedCount += i;
-
- // Apply set filters to unmatched elements
- // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
- // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
- // no element matchers and no seed.
- // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
- // case, which will result in a "00" `matchedCount` that differs from `i` but is also
- // numerically zero.
- if ( bySet && i !== matchedCount ) {
- j = 0;
- while ( (matcher = setMatchers[j++]) ) {
- matcher( unmatched, setMatched, context, xml );
- }
-
- if ( seed ) {
- // Reintegrate element matches to eliminate the need for sorting
- if ( matchedCount > 0 ) {
- while ( i-- ) {
- if ( !(unmatched[i] || setMatched[i]) ) {
- setMatched[i] = pop.call( results );
- }
- }
- }
-
- // Discard index placeholder values to get only actual matches
- setMatched = condense( setMatched );
- }
-
- // Add matches to results
- push.apply( results, setMatched );
-
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
- if ( outermost && !seed && setMatched.length > 0 &&
- ( matchedCount + setMatchers.length ) > 1 ) {
-
- Sizzle.uniqueSort( results );
- }
- }
-
- // Override manipulation of globals by nested matchers
- if ( outermost ) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
-
- return unmatched;
- };
-
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
- }
-
- compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ selector + " " ];
-
- if ( !cached ) {
- // Generate a function of recursive functions that can be used to check each element
- if ( !match ) {
- match = tokenize( selector );
- }
- i = match.length;
- while ( i-- ) {
- cached = matcherFromTokens( match[i] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-
- // Save selector and tokenization
- cached.selector = selector;
- }
- return cached;
- };
-
- /**
- * A low-level selection function that works with Sizzle's compiled
- * selector functions
- * @param {String|Function} selector A selector or a pre-compiled
- * selector function built with Sizzle.compile
- * @param {Element} context
- * @param {Array} [results]
- * @param {Array} [seed] A set of elements to match against
- */
- select = Sizzle.select = function( selector, context, results, seed ) {
- var i, tokens, token, type, find,
- compiled = typeof selector === "function" && selector,
- match = !seed && tokenize( (selector = compiled.selector || selector) );
-
- results = results || [];
-
- // Try to minimize operations if there is only one selector in the list and no seed
- // (the latter of which guarantees us context)
- if ( match.length === 1 ) {
-
- // Reduce context if the leading compound selector is an ID
- tokens = match[0] = match[0].slice( 0 );
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
- context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
-
- context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
- if ( !context ) {
- return results;
-
- // Precompiled matchers will still verify ancestry, so step up a level
- } else if ( compiled ) {
- context = context.parentNode;
- }
-
- selector = selector.slice( tokens.shift().value.length );
- }
-
- // Fetch a seed set for right-to-left matching
- i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
- while ( i-- ) {
- token = tokens[i];
-
- // Abort if we hit a combinator
- if ( Expr.relative[ (type = token.type) ] ) {
- break;
- }
- if ( (find = Expr.find[ type ]) ) {
- // Search, expanding context for leading sibling combinators
- if ( (seed = find(
- token.matches[0].replace( runescape, funescape ),
- rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
- )) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && toSelector( tokens );
- if ( !selector ) {
- push.apply( results, seed );
- return results;
- }
-
- break;
- }
- }
- }
- }
-
- // Compile and execute a filtering function if one is not provided
- // Provide `match` to avoid retokenization if we modified the selector above
- ( compiled || compile( selector, match ) )(
- seed,
- context,
- !documentIsHTML,
- results,
- !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
- );
- return results;
- };
-
- // One-time assignments
-
- // Sort stability
- support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
- // Support: Chrome 14-35+
- // Always assume duplicates if they aren't passed to the comparison function
- support.detectDuplicates = !!hasDuplicate;
-
- // Initialize against the default document
- setDocument();
-
- // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
- // Detached nodes confoundingly follow *each other*
- support.sortDetached = assert(function( el ) {
- // Should return 1, but returns 4 (following)
- return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
- });
-
- // Support: IE<8
- // Prevent attribute/property "interpolation"
- // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
- if ( !assert(function( el ) {
- el.innerHTML = "<a href='#'></a>";
- return el.firstChild.getAttribute("href") === "#" ;
- }) ) {
- addHandle( "type|href|height|width", function( elem, name, isXML ) {
- if ( !isXML ) {
- return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
- }
- });
- }
-
- // Support: IE<9
- // Use defaultValue in place of getAttribute("value")
- if ( !support.attributes || !assert(function( el ) {
- el.innerHTML = "<input/>";
- el.firstChild.setAttribute( "value", "" );
- return el.firstChild.getAttribute( "value" ) === "";
- }) ) {
- addHandle( "value", function( elem, name, isXML ) {
- if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
- return elem.defaultValue;
- }
- });
- }
-
- // Support: IE<9
- // Use getAttributeNode to fetch booleans when getAttribute lies
- if ( !assert(function( el ) {
- return el.getAttribute("disabled") == null;
- }) ) {
- addHandle( booleans, function( elem, name, isXML ) {
- var val;
- if ( !isXML ) {
- return elem[ name ] === true ? name.toLowerCase() :
- (val = elem.getAttributeNode( name )) && val.specified ?
- val.value :
- null;
- }
- });
- }
-
- return Sizzle;
-
- })( window );
-
-
-
- jQuery.find = Sizzle;
- jQuery.expr = Sizzle.selectors;
-
- // Deprecated
- jQuery.expr[ ":" ] = jQuery.expr.pseudos;
- jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
- jQuery.text = Sizzle.getText;
- jQuery.isXMLDoc = Sizzle.isXML;
- jQuery.contains = Sizzle.contains;
- jQuery.escapeSelector = Sizzle.escape;
-
-
-
-
- var dir = function( elem, dir, until ) {
- var matched = [],
- truncate = until !== undefined;
-
- while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
- if ( elem.nodeType === 1 ) {
- if ( truncate && jQuery( elem ).is( until ) ) {
- break;
- }
- matched.push( elem );
- }
- }
- return matched;
- };
-
-
- var siblings = function( n, elem ) {
- var matched = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- matched.push( n );
- }
- }
-
- return matched;
- };
-
-
- var rneedsContext = jQuery.expr.match.needsContext;
-
- var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
-
-
-
- var risSimple = /^.[^:#\[\.,]*$/;
-
- // Implement the identical functionality for filter and not
- function winnow( elements, qualifier, not ) {
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep( elements, function( elem, i ) {
- return !!qualifier.call( elem, i, elem ) !== not;
- } );
- }
-
- // Single element
- if ( qualifier.nodeType ) {
- return jQuery.grep( elements, function( elem ) {
- return ( elem === qualifier ) !== not;
- } );
- }
-
- // Arraylike of elements (jQuery, arguments, Array)
- if ( typeof qualifier !== "string" ) {
- return jQuery.grep( elements, function( elem ) {
- return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
- } );
- }
-
- // Simple selector that can be filtered directly, removing non-Elements
- if ( risSimple.test( qualifier ) ) {
- return jQuery.filter( qualifier, elements, not );
- }
-
- // Complex selector, compare the two sets, removing non-Elements
- qualifier = jQuery.filter( qualifier, elements );
- return jQuery.grep( elements, function( elem ) {
- return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
- } );
- }
-
- jQuery.filter = function( expr, elems, not ) {
- var elem = elems[ 0 ];
-
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- if ( elems.length === 1 && elem.nodeType === 1 ) {
- return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
- }
-
- return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
- return elem.nodeType === 1;
- } ) );
- };
-
- jQuery.fn.extend( {
- find: function( selector ) {
- var i, ret,
- len = this.length,
- self = this;
-
- if ( typeof selector !== "string" ) {
- return this.pushStack( jQuery( selector ).filter( function() {
- for ( i = 0; i < len; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- } ) );
- }
-
- ret = this.pushStack( [] );
-
- for ( i = 0; i < len; i++ ) {
- jQuery.find( selector, self[ i ], ret );
- }
-
- return len > 1 ? jQuery.uniqueSort( ret ) : ret;
- },
- filter: function( selector ) {
- return this.pushStack( winnow( this, selector || [], false ) );
- },
- not: function( selector ) {
- return this.pushStack( winnow( this, selector || [], true ) );
- },
- is: function( selector ) {
- return !!winnow(
- this,
-
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- typeof selector === "string" && rneedsContext.test( selector ) ?
- jQuery( selector ) :
- selector || [],
- false
- ).length;
- }
- } );
-
-
- // Initialize a jQuery object
-
-
- // A central reference to the root jQuery(document)
- var rootjQuery,
-
- // A simple way to check for HTML strings
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
- // Strict HTML recognition (#11290: must start with <)
- // Shortcut simple #id case for speed
- rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
-
- init = jQuery.fn.init = function( selector, context, root ) {
- var match, elem;
-
- // HANDLE: $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Method init() accepts an alternate rootjQuery
- // so migrate can support jQuery.sub (gh-2101)
- root = root || rootjQuery;
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- if ( selector[ 0 ] === "<" &&
- selector[ selector.length - 1 ] === ">" &&
- selector.length >= 3 ) {
-
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = rquickExpr.exec( selector );
- }
-
- // Match html or make sure no context is specified for #id
- if ( match && ( match[ 1 ] || !context ) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[ 1 ] ) {
- context = context instanceof jQuery ? context[ 0 ] : context;
-
- // Option to run scripts is true for back-compat
- // Intentionally let the error be thrown if parseHTML is not present
- jQuery.merge( this, jQuery.parseHTML(
- match[ 1 ],
- context && context.nodeType ? context.ownerDocument || context : document,
- true
- ) );
-
- // HANDLE: $(html, props)
- if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
- for ( match in context ) {
-
- // Properties of context are called as methods if possible
- if ( jQuery.isFunction( this[ match ] ) ) {
- this[ match ]( context[ match ] );
-
- // ...and otherwise set as attributes
- } else {
- this.attr( match, context[ match ] );
- }
- }
- }
-
- return this;
-
- // HANDLE: $(#id)
- } else {
- elem = document.getElementById( match[ 2 ] );
-
- if ( elem ) {
-
- // Inject the element directly into the jQuery object
- this[ 0 ] = elem;
- this.length = 1;
- }
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || root ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(DOMElement)
- } else if ( selector.nodeType ) {
- this[ 0 ] = selector;
- this.length = 1;
- return this;
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return root.ready !== undefined ?
- root.ready( selector ) :
-
- // Execute immediately if ready is not present
- selector( jQuery );
- }
-
- return jQuery.makeArray( selector, this );
- };
-
- // Give the init function the jQuery prototype for later instantiation
- init.prototype = jQuery.fn;
-
- // Initialize central reference
- rootjQuery = jQuery( document );
-
-
- var rparentsprev = /^(?:parents|prev(?:Until|All))/,
-
- // Methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
- jQuery.fn.extend( {
- has: function( target ) {
- var targets = jQuery( target, this ),
- l = targets.length;
-
- return this.filter( function() {
- var i = 0;
- for ( ; i < l; i++ ) {
- if ( jQuery.contains( this, targets[ i ] ) ) {
- return true;
- }
- }
- } );
- },
-
- closest: function( selectors, context ) {
- var cur,
- i = 0,
- l = this.length,
- matched = [],
- targets = typeof selectors !== "string" && jQuery( selectors );
-
- // Positional selectors never match, since there's no _selection_ context
- if ( !rneedsContext.test( selectors ) ) {
- for ( ; i < l; i++ ) {
- for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
-
- // Always skip document fragments
- if ( cur.nodeType < 11 && ( targets ?
- targets.index( cur ) > -1 :
-
- // Don't pass non-elements to Sizzle
- cur.nodeType === 1 &&
- jQuery.find.matchesSelector( cur, selectors ) ) ) {
-
- matched.push( cur );
- break;
- }
- }
- }
- }
-
- return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
- },
-
- // Determine the position of an element within the set
- index: function( elem ) {
-
- // No argument, return index in parent
- if ( !elem ) {
- return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
- }
-
- // Index in selector
- if ( typeof elem === "string" ) {
- return indexOf.call( jQuery( elem ), this[ 0 ] );
- }
-
- // Locate the position of the desired element
- return indexOf.call( this,
-
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[ 0 ] : elem
- );
- },
-
- add: function( selector, context ) {
- return this.pushStack(
- jQuery.uniqueSort(
- jQuery.merge( this.get(), jQuery( selector, context ) )
- )
- );
- },
-
- addBack: function( selector ) {
- return this.add( selector == null ?
- this.prevObject : this.prevObject.filter( selector )
- );
- }
- } );
-
- function sibling( cur, dir ) {
- while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
- return cur;
- }
-
- jQuery.each( {
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return sibling( elem, "nextSibling" );
- },
- prev: function( elem ) {
- return sibling( elem, "previousSibling" );
- },
- nextAll: function( elem ) {
- return dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return siblings( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return siblings( elem.firstChild );
- },
- contents: function( elem ) {
- return elem.contentDocument || jQuery.merge( [], elem.childNodes );
- }
- }, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var matched = jQuery.map( this, fn, until );
-
- if ( name.slice( -5 ) !== "Until" ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- matched = jQuery.filter( selector, matched );
- }
-
- if ( this.length > 1 ) {
-
- // Remove duplicates
- if ( !guaranteedUnique[ name ] ) {
- jQuery.uniqueSort( matched );
- }
-
- // Reverse order for parents* and prev-derivatives
- if ( rparentsprev.test( name ) ) {
- matched.reverse();
- }
- }
-
- return this.pushStack( matched );
- };
- } );
- var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
-
-
-
- // Convert String-formatted options into Object-formatted ones
- function createOptions( options ) {
- var object = {};
- jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
- object[ flag ] = true;
- } );
- return object;
- }
-
- /*
- * Create a callback list using the following parameters:
- *
- * options: an optional list of space-separated options that will change how
- * the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- * once: will ensure the callback list can only be fired once (like a Deferred)
- *
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
- *
- * unique: will ensure a callback can only be added once (no duplicate in the list)
- *
- * stopOnFalse: interrupt callings when a callback returns false
- *
- */
- jQuery.Callbacks = function( options ) {
-
- // Convert options from String-formatted to Object-formatted if needed
- // (we check in cache first)
- options = typeof options === "string" ?
- createOptions( options ) :
- jQuery.extend( {}, options );
-
- var // Flag to know if list is currently firing
- firing,
-
- // Last fire value for non-forgettable lists
- memory,
-
- // Flag to know if list was already fired
- fired,
-
- // Flag to prevent firing
- locked,
-
- // Actual callback list
- list = [],
-
- // Queue of execution data for repeatable lists
- queue = [],
-
- // Index of currently firing callback (modified by add/remove as needed)
- firingIndex = -1,
-
- // Fire callbacks
- fire = function() {
-
- // Enforce single-firing
- locked = options.once;
-
- // Execute callbacks for all pending executions,
- // respecting firingIndex overrides and runtime changes
- fired = firing = true;
- for ( ; queue.length; firingIndex = -1 ) {
- memory = queue.shift();
- while ( ++firingIndex < list.length ) {
-
- // Run callback and check for early termination
- if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
- options.stopOnFalse ) {
-
- // Jump to end and forget the data so .add doesn't re-fire
- firingIndex = list.length;
- memory = false;
- }
- }
- }
-
- // Forget the data if we're done with it
- if ( !options.memory ) {
- memory = false;
- }
-
- firing = false;
-
- // Clean up if we're done firing for good
- if ( locked ) {
-
- // Keep an empty list if we have data for future add calls
- if ( memory ) {
- list = [];
-
- // Otherwise, this object is spent
- } else {
- list = "";
- }
- }
- },
-
- // Actual Callbacks object
- self = {
-
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
-
- // If we have memory from a past run, we should fire after adding
- if ( memory && !firing ) {
- firingIndex = list.length - 1;
- queue.push( memory );
- }
-
- ( function add( args ) {
- jQuery.each( args, function( _, arg ) {
- if ( jQuery.isFunction( arg ) ) {
- if ( !options.unique || !self.has( arg ) ) {
- list.push( arg );
- }
- } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
-
- // Inspect recursively
- add( arg );
- }
- } );
- } )( arguments );
-
- if ( memory && !firing ) {
- fire();
- }
- }
- return this;
- },
-
- // Remove a callback from the list
- remove: function() {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
-
- // Handle firing indexes
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- } );
- return this;
- },
-
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function( fn ) {
- return fn ?
- jQuery.inArray( fn, list ) > -1 :
- list.length > 0;
- },
-
- // Remove all callbacks from the list
- empty: function() {
- if ( list ) {
- list = [];
- }
- return this;
- },
-
- // Disable .fire and .add
- // Abort any current/pending executions
- // Clear all callbacks and values
- disable: function() {
- locked = queue = [];
- list = memory = "";
- return this;
- },
- disabled: function() {
- return !list;
- },
-
- // Disable .fire
- // Also disable .add unless we have memory (since it would have no effect)
- // Abort any pending executions
- lock: function() {
- locked = queue = [];
- if ( !memory && !firing ) {
- list = memory = "";
- }
- return this;
- },
- locked: function() {
- return !!locked;
- },
-
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- if ( !locked ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- queue.push( args );
- if ( !firing ) {
- fire();
- }
- }
- return this;
- },
-
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
-
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
- };
-
-
- function Identity( v ) {
- return v;
- }
- function Thrower( ex ) {
- throw ex;
- }
-
- function adoptValue( value, resolve, reject ) {
- var method;
-
- try {
-
- // Check for promise aspect first to privilege synchronous behavior
- if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
- method.call( value ).done( resolve ).fail( reject );
-
- // Other thenables
- } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
- method.call( value, resolve, reject );
-
- // Other non-thenables
- } else {
-
- // Support: Android 4.0 only
- // Strict mode functions invoked without .call/.apply get global-object context
- resolve.call( undefined, value );
- }
-
- // For Promises/A+, convert exceptions into rejections
- // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
- // Deferred#then to conditionally suppress rejection.
- } catch ( value ) {
-
- // Support: Android 4.0 only
- // Strict mode functions invoked without .call/.apply get global-object context
- reject.call( undefined, value );
- }
- }
-
- jQuery.extend( {
-
- Deferred: function( func ) {
- var tuples = [
-
- // action, add listener, callbacks,
- // ... .then handlers, argument index, [final state]
- [ "notify", "progress", jQuery.Callbacks( "memory" ),
- jQuery.Callbacks( "memory" ), 2 ],
- [ "resolve", "done", jQuery.Callbacks( "once memory" ),
- jQuery.Callbacks( "once memory" ), 0, "resolved" ],
- [ "reject", "fail", jQuery.Callbacks( "once memory" ),
- jQuery.Callbacks( "once memory" ), 1, "rejected" ]
- ],
- state = "pending",
- promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done( arguments ).fail( arguments );
- return this;
- },
- "catch": function( fn ) {
- return promise.then( null, fn );
- },
-
- // Keep pipe for back-compat
- pipe: function( /* fnDone, fnFail, fnProgress */ ) {
- var fns = arguments;
-
- return jQuery.Deferred( function( newDefer ) {
- jQuery.each( tuples, function( i, tuple ) {
-
- // Map tuples (progress, done, fail) to arguments (done, fail, progress)
- var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
-
- // deferred.progress(function() { bind to newDefer or newDefer.notify })
- // deferred.done(function() { bind to newDefer or newDefer.resolve })
- // deferred.fail(function() { bind to newDefer or newDefer.reject })
- deferred[ tuple[ 1 ] ]( function() {
- var returned = fn && fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise()
- .progress( newDefer.notify )
- .done( newDefer.resolve )
- .fail( newDefer.reject );
- } else {
- newDefer[ tuple[ 0 ] + "With" ](
- this,
- fn ? [ returned ] : arguments
- );
- }
- } );
- } );
- fns = null;
- } ).promise();
- },
- then: function( onFulfilled, onRejected, onProgress ) {
- var maxDepth = 0;
- function resolve( depth, deferred, handler, special ) {
- return function() {
- var that = this,
- args = arguments,
- mightThrow = function() {
- var returned, then;
-
- // Support: Promises/A+ section 2.3.3.3.3
- // https://promisesaplus.com/#point-59
- // Ignore double-resolution attempts
- if ( depth < maxDepth ) {
- return;
- }
-
- returned = handler.apply( that, args );
-
- // Support: Promises/A+ section 2.3.1
- // https://promisesaplus.com/#point-48
- if ( returned === deferred.promise() ) {
- throw new TypeError( "Thenable self-resolution" );
- }
-
- // Support: Promises/A+ sections 2.3.3.1, 3.5
- // https://promisesaplus.com/#point-54
- // https://promisesaplus.com/#point-75
- // Retrieve `then` only once
- then = returned &&
-
- // Support: Promises/A+ section 2.3.4
- // https://promisesaplus.com/#point-64
- // Only check objects and functions for thenability
- ( typeof returned === "object" ||
- typeof returned === "function" ) &&
- returned.then;
-
- // Handle a returned thenable
- if ( jQuery.isFunction( then ) ) {
-
- // Special processors (notify) just wait for resolution
- if ( special ) {
- then.call(
- returned,
- resolve( maxDepth, deferred, Identity, special ),
- resolve( maxDepth, deferred, Thrower, special )
- );
-
- // Normal processors (resolve) also hook into progress
- } else {
-
- // ...and disregard older resolution values
- maxDepth++;
-
- then.call(
- returned,
- resolve( maxDepth, deferred, Identity, special ),
- resolve( maxDepth, deferred, Thrower, special ),
- resolve( maxDepth, deferred, Identity,
- deferred.notifyWith )
- );
- }
-
- // Handle all other returned values
- } else {
-
- // Only substitute handlers pass on context
- // and multiple values (non-spec behavior)
- if ( handler !== Identity ) {
- that = undefined;
- args = [ returned ];
- }
-
- // Process the value(s)
- // Default process is resolve
- ( special || deferred.resolveWith )( that, args );
- }
- },
-
- // Only normal processors (resolve) catch and reject exceptions
- process = special ?
- mightThrow :
- function() {
- try {
- mightThrow();
- } catch ( e ) {
-
- if ( jQuery.Deferred.exceptionHook ) {
- jQuery.Deferred.exceptionHook( e,
- process.stackTrace );
- }
-
- // Support: Promises/A+ section 2.3.3.3.4.1
- // https://promisesaplus.com/#point-61
- // Ignore post-resolution exceptions
- if ( depth + 1 >= maxDepth ) {
-
- // Only substitute handlers pass on context
- // and multiple values (non-spec behavior)
- if ( handler !== Thrower ) {
- that = undefined;
- args = [ e ];
- }
-
- deferred.rejectWith( that, args );
- }
- }
- };
-
- // Support: Promises/A+ section 2.3.3.3.1
- // https://promisesaplus.com/#point-57
- // Re-resolve promises immediately to dodge false rejection from
- // subsequent errors
- if ( depth ) {
- process();
- } else {
-
- // Call an optional hook to record the stack, in case of exception
- // since it's otherwise lost when execution goes async
- if ( jQuery.Deferred.getStackHook ) {
- process.stackTrace = jQuery.Deferred.getStackHook();
- }
- window.setTimeout( process );
- }
- };
- }
-
- return jQuery.Deferred( function( newDefer ) {
-
- // progress_handlers.add( ... )
- tuples[ 0 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- jQuery.isFunction( onProgress ) ?
- onProgress :
- Identity,
- newDefer.notifyWith
- )
- );
-
- // fulfilled_handlers.add( ... )
- tuples[ 1 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- jQuery.isFunction( onFulfilled ) ?
- onFulfilled :
- Identity
- )
- );
-
- // rejected_handlers.add( ... )
- tuples[ 2 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- jQuery.isFunction( onRejected ) ?
- onRejected :
- Thrower
- )
- );
- } ).promise();
- },
-
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- return obj != null ? jQuery.extend( obj, promise ) : promise;
- }
- },
- deferred = {};
-
- // Add list-specific methods
- jQuery.each( tuples, function( i, tuple ) {
- var list = tuple[ 2 ],
- stateString = tuple[ 5 ];
-
- // promise.progress = list.add
- // promise.done = list.add
- // promise.fail = list.add
- promise[ tuple[ 1 ] ] = list.add;
-
- // Handle state
- if ( stateString ) {
- list.add(
- function() {
-
- // state = "resolved" (i.e., fulfilled)
- // state = "rejected"
- state = stateString;
- },
-
- // rejected_callbacks.disable
- // fulfilled_callbacks.disable
- tuples[ 3 - i ][ 2 ].disable,
-
- // progress_callbacks.lock
- tuples[ 0 ][ 2 ].lock
- );
- }
-
- // progress_handlers.fire
- // fulfilled_handlers.fire
- // rejected_handlers.fire
- list.add( tuple[ 3 ].fire );
-
- // deferred.notify = function() { deferred.notifyWith(...) }
- // deferred.resolve = function() { deferred.resolveWith(...) }
- // deferred.reject = function() { deferred.rejectWith(...) }
- deferred[ tuple[ 0 ] ] = function() {
- deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
- return this;
- };
-
- // deferred.notifyWith = list.fireWith
- // deferred.resolveWith = list.fireWith
- // deferred.rejectWith = list.fireWith
- deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
- } );
-
- // Make the deferred a promise
- promise.promise( deferred );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( singleValue ) {
- var
-
- // count of uncompleted subordinates
- remaining = arguments.length,
-
- // count of unprocessed arguments
- i = remaining,
-
- // subordinate fulfillment data
- resolveContexts = Array( i ),
- resolveValues = slice.call( arguments ),
-
- // the master Deferred
- master = jQuery.Deferred(),
-
- // subordinate callback factory
- updateFunc = function( i ) {
- return function( value ) {
- resolveContexts[ i ] = this;
- resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
- if ( !( --remaining ) ) {
- master.resolveWith( resolveContexts, resolveValues );
- }
- };
- };
-
- // Single- and empty arguments are adopted like Promise.resolve
- if ( remaining <= 1 ) {
- adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
-
- // Use .then() to unwrap secondary thenables (cf. gh-3000)
- if ( master.state() === "pending" ||
- jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
-
- return master.then();
- }
- }
-
- // Multiple arguments are aggregated like Promise.all array elements
- while ( i-- ) {
- adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
- }
-
- return master.promise();
- }
- } );
-
-
- // These usually indicate a programmer mistake during development,
- // warn about them ASAP rather than swallowing them by default.
- var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
-
- jQuery.Deferred.exceptionHook = function( error, stack ) {
-
- // Support: IE 8 - 9 only
- // Console exists when dev tools are open, which can happen at any time
- if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
- window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
- }
- };
-
-
-
-
- jQuery.readyException = function( error ) {
- window.setTimeout( function() {
- throw error;
- } );
- };
-
-
-
-
- // The deferred used on DOM ready
- var readyList = jQuery.Deferred();
-
- jQuery.fn.ready = function( fn ) {
-
- readyList
- .then( fn )
-
- // Wrap jQuery.readyException in a function so that the lookup
- // happens at the time of error handling instead of callback
- // registration.
- .catch( function( error ) {
- jQuery.readyException( error );
- } );
-
- return this;
- };
-
- jQuery.extend( {
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Hold (or release) the ready event
- holdReady: function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- },
-
- // Handle when the DOM is ready
- ready: function( wait ) {
-
- // Abort if there are pending holds or we're already ready
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
- return;
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.resolveWith( document, [ jQuery ] );
- }
- } );
-
- jQuery.ready.then = readyList.then;
-
- // The ready event handler and self cleanup method
- function completed() {
- document.removeEventListener( "DOMContentLoaded", completed );
- window.removeEventListener( "load", completed );
- jQuery.ready();
- }
-
- // Catch cases where $(document).ready() is called
- // after the browser event has already occurred.
- // Support: IE <=9 - 10 only
- // Older IE sometimes signals "interactive" too soon
- if ( document.readyState === "complete" ||
- ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
-
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- window.setTimeout( jQuery.ready );
-
- } else {
-
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", completed );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", completed );
- }
-
-
-
-
- // Multifunctional method to get and set values of a collection
- // The value/s can optionally be executed if it's a function
- var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
- var i = 0,
- len = elems.length,
- bulk = key == null;
-
- // Sets many values
- if ( jQuery.type( key ) === "object" ) {
- chainable = true;
- for ( i in key ) {
- access( elems, fn, i, key[ i ], true, emptyGet, raw );
- }
-
- // Sets one value
- } else if ( value !== undefined ) {
- chainable = true;
-
- if ( !jQuery.isFunction( value ) ) {
- raw = true;
- }
-
- if ( bulk ) {
-
- // Bulk operations run against the entire set
- if ( raw ) {
- fn.call( elems, value );
- fn = null;
-
- // ...except when executing function values
- } else {
- bulk = fn;
- fn = function( elem, key, value ) {
- return bulk.call( jQuery( elem ), value );
- };
- }
- }
-
- if ( fn ) {
- for ( ; i < len; i++ ) {
- fn(
- elems[ i ], key, raw ?
- value :
- value.call( elems[ i ], i, fn( elems[ i ], key ) )
- );
- }
- }
- }
-
- if ( chainable ) {
- return elems;
- }
-
- // Gets
- if ( bulk ) {
- return fn.call( elems );
- }
-
- return len ? fn( elems[ 0 ], key ) : emptyGet;
- };
- var acceptData = function( owner ) {
-
- // Accepts only:
- // - Node
- // - Node.ELEMENT_NODE
- // - Node.DOCUMENT_NODE
- // - Object
- // - Any
- return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
- };
-
-
-
-
- function Data() {
- this.expando = jQuery.expando + Data.uid++;
- }
-
- Data.uid = 1;
-
- Data.prototype = {
-
- cache: function( owner ) {
-
- // Check if the owner object already has a cache
- var value = owner[ this.expando ];
-
- // If not, create one
- if ( !value ) {
- value = {};
-
- // We can accept data for non-element nodes in modern browsers,
- // but we should not, see #8335.
- // Always return an empty object.
- if ( acceptData( owner ) ) {
-
- // If it is a node unlikely to be stringify-ed or looped over
- // use plain assignment
- if ( owner.nodeType ) {
- owner[ this.expando ] = value;
-
- // Otherwise secure it in a non-enumerable property
- // configurable must be true to allow the property to be
- // deleted when data is removed
- } else {
- Object.defineProperty( owner, this.expando, {
- value: value,
- configurable: true
- } );
- }
- }
- }
-
- return value;
- },
- set: function( owner, data, value ) {
- var prop,
- cache = this.cache( owner );
-
- // Handle: [ owner, key, value ] args
- // Always use camelCase key (gh-2257)
- if ( typeof data === "string" ) {
- cache[ jQuery.camelCase( data ) ] = value;
-
- // Handle: [ owner, { properties } ] args
- } else {
-
- // Copy the properties one-by-one to the cache object
- for ( prop in data ) {
- cache[ jQuery.camelCase( prop ) ] = data[ prop ];
- }
- }
- return cache;
- },
- get: function( owner, key ) {
- return key === undefined ?
- this.cache( owner ) :
-
- // Always use camelCase key (gh-2257)
- owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
- },
- access: function( owner, key, value ) {
-
- // In cases where either:
- //
- // 1. No key was specified
- // 2. A string key was specified, but no value provided
- //
- // Take the "read" path and allow the get method to determine
- // which value to return, respectively either:
- //
- // 1. The entire cache object
- // 2. The data stored at the key
- //
- if ( key === undefined ||
- ( ( key && typeof key === "string" ) && value === undefined ) ) {
-
- return this.get( owner, key );
- }
-
- // When the key is not a string, or both a key and value
- // are specified, set or extend (existing objects) with either:
- //
- // 1. An object of properties
- // 2. A key and value
- //
- this.set( owner, key, value );
-
- // Since the "set" path can have two possible entry points
- // return the expected data based on which path was taken[*]
- return value !== undefined ? value : key;
- },
- remove: function( owner, key ) {
- var i,
- cache = owner[ this.expando ];
-
- if ( cache === undefined ) {
- return;
- }
-
- if ( key !== undefined ) {
-
- // Support array or space separated string of keys
- if ( jQuery.isArray( key ) ) {
-
- // If key is an array of keys...
- // We always set camelCase keys, so remove that.
- key = key.map( jQuery.camelCase );
- } else {
- key = jQuery.camelCase( key );
-
- // If a key with the spaces exists, use it.
- // Otherwise, create an array by matching non-whitespace
- key = key in cache ?
- [ key ] :
- ( key.match( rnothtmlwhite ) || [] );
- }
-
- i = key.length;
-
- while ( i-- ) {
- delete cache[ key[ i ] ];
- }
- }
-
- // Remove the expando if there's no more data
- if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
-
- // Support: Chrome <=35 - 45
- // Webkit & Blink performance suffers when deleting properties
- // from DOM nodes, so set to undefined instead
- // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
- if ( owner.nodeType ) {
- owner[ this.expando ] = undefined;
- } else {
- delete owner[ this.expando ];
- }
- }
- },
- hasData: function( owner ) {
- var cache = owner[ this.expando ];
- return cache !== undefined && !jQuery.isEmptyObject( cache );
- }
- };
- var dataPriv = new Data();
-
- var dataUser = new Data();
-
-
-
- // Implementation Summary
- //
- // 1. Enforce API surface and semantic compatibility with 1.9.x branch
- // 2. Improve the module's maintainability by reducing the storage
- // paths to a single mechanism.
- // 3. Use the same single mechanism to support "private" and "user" data.
- // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
- // 5. Avoid exposing implementation details on user objects (eg. expando properties)
- // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
-
- var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- rmultiDash = /[A-Z]/g;
-
- function getData( data ) {
- if ( data === "true" ) {
- return true;
- }
-
- if ( data === "false" ) {
- return false;
- }
-
- if ( data === "null" ) {
- return null;
- }
-
- // Only convert to a number if it doesn't change the string
- if ( data === +data + "" ) {
- return +data;
- }
-
- if ( rbrace.test( data ) ) {
- return JSON.parse( data );
- }
-
- return data;
- }
-
- function dataAttr( elem, key, data ) {
- var name;
-
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
- name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = getData( data );
- } catch ( e ) {}
-
- // Make sure we set the data so it isn't changed later
- dataUser.set( elem, key, data );
- } else {
- data = undefined;
- }
- }
- return data;
- }
-
- jQuery.extend( {
- hasData: function( elem ) {
- return dataUser.hasData( elem ) || dataPriv.hasData( elem );
- },
-
- data: function( elem, name, data ) {
- return dataUser.access( elem, name, data );
- },
-
- removeData: function( elem, name ) {
- dataUser.remove( elem, name );
- },
-
- // TODO: Now that all calls to _data and _removeData have been replaced
- // with direct calls to dataPriv methods, these can be deprecated.
- _data: function( elem, name, data ) {
- return dataPriv.access( elem, name, data );
- },
-
- _removeData: function( elem, name ) {
- dataPriv.remove( elem, name );
- }
- } );
-
- jQuery.fn.extend( {
- data: function( key, value ) {
- var i, name, data,
- elem = this[ 0 ],
- attrs = elem && elem.attributes;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = dataUser.get( elem );
-
- if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
- i = attrs.length;
- while ( i-- ) {
-
- // Support: IE 11 only
- // The attrs elements can be null (#14894)
- if ( attrs[ i ] ) {
- name = attrs[ i ].name;
- if ( name.indexOf( "data-" ) === 0 ) {
- name = jQuery.camelCase( name.slice( 5 ) );
- dataAttr( elem, name, data[ name ] );
- }
- }
- }
- dataPriv.set( elem, "hasDataAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each( function() {
- dataUser.set( this, key );
- } );
- }
-
- return access( this, function( value ) {
- var data;
-
- // The calling jQuery object (element matches) is not empty
- // (and therefore has an element appears at this[ 0 ]) and the
- // `value` parameter was not undefined. An empty jQuery object
- // will result in `undefined` for elem = this[ 0 ] which will
- // throw an exception if an attempt to read a data cache is made.
- if ( elem && value === undefined ) {
-
- // Attempt to get data from the cache
- // The key will always be camelCased in Data
- data = dataUser.get( elem, key );
- if ( data !== undefined ) {
- return data;
- }
-
- // Attempt to "discover" the data in
- // HTML5 custom data-* attrs
- data = dataAttr( elem, key );
- if ( data !== undefined ) {
- return data;
- }
-
- // We tried really hard, but the data doesn't exist.
- return;
- }
-
- // Set the data...
- this.each( function() {
-
- // We always store the camelCased key
- dataUser.set( this, key, value );
- } );
- }, null, value, arguments.length > 1, null, true );
- },
-
- removeData: function( key ) {
- return this.each( function() {
- dataUser.remove( this, key );
- } );
- }
- } );
-
-
- jQuery.extend( {
- queue: function( elem, type, data ) {
- var queue;
-
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- queue = dataPriv.get( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !queue || jQuery.isArray( data ) ) {
- queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
- } else {
- queue.push( data );
- }
- }
- return queue || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- startLength = queue.length,
- fn = queue.shift(),
- hooks = jQuery._queueHooks( elem, type ),
- next = function() {
- jQuery.dequeue( elem, type );
- };
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- startLength--;
- }
-
- if ( fn ) {
-
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- // Clear up the last queue stop function
- delete hooks.stop;
- fn.call( elem, next, hooks );
- }
-
- if ( !startLength && hooks ) {
- hooks.empty.fire();
- }
- },
-
- // Not public - generate a queueHooks object, or return the current one
- _queueHooks: function( elem, type ) {
- var key = type + "queueHooks";
- return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
- empty: jQuery.Callbacks( "once memory" ).add( function() {
- dataPriv.remove( elem, [ type + "queue", key ] );
- } )
- } );
- }
- } );
-
- jQuery.fn.extend( {
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[ 0 ], type );
- }
-
- return data === undefined ?
- this :
- this.each( function() {
- var queue = jQuery.queue( this, type, data );
-
- // Ensure a hooks for this queue
- jQuery._queueHooks( this, type );
-
- if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- } );
- },
- dequeue: function( type ) {
- return this.each( function() {
- jQuery.dequeue( this, type );
- } );
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
-
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, obj ) {
- var tmp,
- count = 1,
- defer = jQuery.Deferred(),
- elements = this,
- i = this.length,
- resolve = function() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- };
-
- if ( typeof type !== "string" ) {
- obj = type;
- type = undefined;
- }
- type = type || "fx";
-
- while ( i-- ) {
- tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
- if ( tmp && tmp.empty ) {
- count++;
- tmp.empty.add( resolve );
- }
- }
- resolve();
- return defer.promise( obj );
- }
- } );
- var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
-
- var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
-
-
- var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-
- var isHiddenWithinTree = function( elem, el ) {
-
- // isHiddenWithinTree might be called from jQuery#filter function;
- // in that case, element will be second argument
- elem = el || elem;
-
- // Inline style trumps all
- return elem.style.display === "none" ||
- elem.style.display === "" &&
-
- // Otherwise, check computed style
- // Support: Firefox <=43 - 45
- // Disconnected elements can have computed display: none, so first confirm that elem is
- // in the document.
- jQuery.contains( elem.ownerDocument, elem ) &&
-
- jQuery.css( elem, "display" ) === "none";
- };
-
- var swap = function( elem, options, callback, args ) {
- var ret, name,
- old = {};
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.apply( elem, args || [] );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
- };
-
-
-
-
- function adjustCSS( elem, prop, valueParts, tween ) {
- var adjusted,
- scale = 1,
- maxIterations = 20,
- currentValue = tween ?
- function() {
- return tween.cur();
- } :
- function() {
- return jQuery.css( elem, prop, "" );
- },
- initial = currentValue(),
- unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
- // Starting value computation is required for potential unit mismatches
- initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
- rcssNum.exec( jQuery.css( elem, prop ) );
-
- if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
-
- // Trust units reported by jQuery.css
- unit = unit || initialInUnit[ 3 ];
-
- // Make sure we update the tween properties later on
- valueParts = valueParts || [];
-
- // Iteratively approximate from a nonzero starting point
- initialInUnit = +initial || 1;
-
- do {
-
- // If previous iteration zeroed out, double until we get *something*.
- // Use string for doubling so we don't accidentally see scale as unchanged below
- scale = scale || ".5";
-
- // Adjust and apply
- initialInUnit = initialInUnit / scale;
- jQuery.style( elem, prop, initialInUnit + unit );
-
- // Update scale, tolerating zero or NaN from tween.cur()
- // Break the loop if scale is unchanged or perfect, or if we've just had enough.
- } while (
- scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
- );
- }
-
- if ( valueParts ) {
- initialInUnit = +initialInUnit || +initial || 0;
-
- // Apply relative offset (+=/-=) if specified
- adjusted = valueParts[ 1 ] ?
- initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
- +valueParts[ 2 ];
- if ( tween ) {
- tween.unit = unit;
- tween.start = initialInUnit;
- tween.end = adjusted;
- }
- }
- return adjusted;
- }
-
-
- var defaultDisplayMap = {};
-
- function getDefaultDisplay( elem ) {
- var temp,
- doc = elem.ownerDocument,
- nodeName = elem.nodeName,
- display = defaultDisplayMap[ nodeName ];
-
- if ( display ) {
- return display;
- }
-
- temp = doc.body.appendChild( doc.createElement( nodeName ) );
- display = jQuery.css( temp, "display" );
-
- temp.parentNode.removeChild( temp );
-
- if ( display === "none" ) {
- display = "block";
- }
- defaultDisplayMap[ nodeName ] = display;
-
- return display;
- }
-
- function showHide( elements, show ) {
- var display, elem,
- values = [],
- index = 0,
- length = elements.length;
-
- // Determine new display value for elements that need to change
- for ( ; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
-
- display = elem.style.display;
- if ( show ) {
-
- // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
- // check is required in this first loop unless we have a nonempty display value (either
- // inline or about-to-be-restored)
- if ( display === "none" ) {
- values[ index ] = dataPriv.get( elem, "display" ) || null;
- if ( !values[ index ] ) {
- elem.style.display = "";
- }
- }
- if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
- values[ index ] = getDefaultDisplay( elem );
- }
- } else {
- if ( display !== "none" ) {
- values[ index ] = "none";
-
- // Remember what we're overwriting
- dataPriv.set( elem, "display", display );
- }
- }
- }
-
- // Set the display of the elements in a second loop to avoid constant reflow
- for ( index = 0; index < length; index++ ) {
- if ( values[ index ] != null ) {
- elements[ index ].style.display = values[ index ];
- }
- }
-
- return elements;
- }
-
- jQuery.fn.extend( {
- show: function() {
- return showHide( this, true );
- },
- hide: function() {
- return showHide( this );
- },
- toggle: function( state ) {
- if ( typeof state === "boolean" ) {
- return state ? this.show() : this.hide();
- }
-
- return this.each( function() {
- if ( isHiddenWithinTree( this ) ) {
- jQuery( this ).show();
- } else {
- jQuery( this ).hide();
- }
- } );
- }
- } );
- var rcheckableType = ( /^(?:checkbox|radio)$/i );
-
- var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
-
- var rscriptType = ( /^$|\/(?:java|ecma)script/i );
-
-
-
- // We have to close these tags to support XHTML (#13200)
- var wrapMap = {
-
- // Support: IE <=9 only
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
-
- // XHTML parsers do not magically insert elements in the
- // same way that tag soup parsers do. So we cannot shorten
- // this by omitting <tbody> or other required elements.
- thead: [ 1, "<table>", "</table>" ],
- col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-
- _default: [ 0, "", "" ]
- };
-
- // Support: IE <=9 only
- wrapMap.optgroup = wrapMap.option;
-
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
- wrapMap.th = wrapMap.td;
-
-
- function getAll( context, tag ) {
-
- // Support: IE <=9 - 11 only
- // Use typeof to avoid zero-argument method invocation on host objects (#15151)
- var ret;
-
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- ret = context.getElementsByTagName( tag || "*" );
-
- } else if ( typeof context.querySelectorAll !== "undefined" ) {
- ret = context.querySelectorAll( tag || "*" );
-
- } else {
- ret = [];
- }
-
- if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
- return jQuery.merge( [ context ], ret );
- }
-
- return ret;
- }
-
-
- // Mark scripts as having already been evaluated
- function setGlobalEval( elems, refElements ) {
- var i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- dataPriv.set(
- elems[ i ],
- "globalEval",
- !refElements || dataPriv.get( refElements[ i ], "globalEval" )
- );
- }
- }
-
-
- var rhtml = /<|&#?\w+;/;
-
- function buildFragment( elems, context, scripts, selection, ignored ) {
- var elem, tmp, tag, wrap, contains, j,
- fragment = context.createDocumentFragment(),
- nodes = [],
- i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- elem = elems[ i ];
-
- if ( elem || elem === 0 ) {
-
- // Add nodes directly
- if ( jQuery.type( elem ) === "object" ) {
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
- // Convert non-html into a text node
- } else if ( !rhtml.test( elem ) ) {
- nodes.push( context.createTextNode( elem ) );
-
- // Convert html into DOM nodes
- } else {
- tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
-
- // Deserialize a standard representation
- tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
- wrap = wrapMap[ tag ] || wrapMap._default;
- tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
-
- // Descend through wrappers to the right content
- j = wrap[ 0 ];
- while ( j-- ) {
- tmp = tmp.lastChild;
- }
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, tmp.childNodes );
-
- // Remember the top-level container
- tmp = fragment.firstChild;
-
- // Ensure the created nodes are orphaned (#12392)
- tmp.textContent = "";
- }
- }
- }
-
- // Remove wrapper from fragment
- fragment.textContent = "";
-
- i = 0;
- while ( ( elem = nodes[ i++ ] ) ) {
-
- // Skip elements already in the context collection (trac-4087)
- if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
- if ( ignored ) {
- ignored.push( elem );
- }
- continue;
- }
-
- contains = jQuery.contains( elem.ownerDocument, elem );
-
- // Append to fragment
- tmp = getAll( fragment.appendChild( elem ), "script" );
-
- // Preserve script evaluation history
- if ( contains ) {
- setGlobalEval( tmp );
- }
-
- // Capture executables
- if ( scripts ) {
- j = 0;
- while ( ( elem = tmp[ j++ ] ) ) {
- if ( rscriptType.test( elem.type || "" ) ) {
- scripts.push( elem );
- }
- }
- }
- }
-
- return fragment;
- }
-
-
- ( function() {
- var fragment = document.createDocumentFragment(),
- div = fragment.appendChild( document.createElement( "div" ) ),
- input = document.createElement( "input" );
-
- // Support: Android 4.0 - 4.3 only
- // Check state lost if the name is set (#11217)
- // Support: Windows Web Apps (WWA)
- // `name` and `type` must use .setAttribute for WWA (#14901)
- input.setAttribute( "type", "radio" );
- input.setAttribute( "checked", "checked" );
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
-
- // Support: Android <=4.1 only
- // Older WebKit doesn't clone checked state correctly in fragments
- support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Support: IE <=11 only
- // Make sure textarea (and checkbox) defaultValue is properly cloned
- div.innerHTML = "<textarea>x</textarea>";
- support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
- } )();
- var documentElement = document.documentElement;
-
-
-
- var
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
- rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
-
- function returnTrue() {
- return true;
- }
-
- function returnFalse() {
- return false;
- }
-
- // Support: IE <=9 only
- // See #13393 for more info
- function safeActiveElement() {
- try {
- return document.activeElement;
- } catch ( err ) { }
- }
-
- function on( elem, types, selector, data, fn, one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
-
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) {
-
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- on( elem, type, selector, data, types[ type ], one );
- }
- return elem;
- }
-
- if ( data == null && fn == null ) {
-
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if ( fn == null ) {
- if ( typeof selector === "string" ) {
-
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
-
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if ( fn === false ) {
- fn = returnFalse;
- } else if ( !fn ) {
- return elem;
- }
-
- if ( one === 1 ) {
- origFn = fn;
- fn = function( event ) {
-
- // Can use an empty set, since event contains the info
- jQuery().off( event );
- return origFn.apply( this, arguments );
- };
-
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
- }
- return elem.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- } );
- }
-
- /*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
- jQuery.event = {
-
- global: {},
-
- add: function( elem, types, handler, data, selector ) {
-
- var handleObjIn, eventHandle, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = dataPriv.get( elem );
-
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
- if ( !elemData ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Ensure that invalid selectors throw exceptions at attach time
- // Evaluate against documentElement in case elem is a non-element node (e.g., document)
- if ( selector ) {
- jQuery.find.matchesSelector( documentElement, selector );
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- if ( !( events = elemData.events ) ) {
- events = elemData.events = {};
- }
- if ( !( eventHandle = elemData.handle ) ) {
- eventHandle = elemData.handle = function( e ) {
-
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
- jQuery.event.dispatch.apply( elem, arguments ) : undefined;
- };
- }
-
- // Handle multiple events separated by a space
- types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[ t ] ) || [];
- type = origType = tmp[ 1 ];
- namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
-
- // There *must* be a type, no attaching namespace-only handlers
- if ( !type ) {
- continue;
- }
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend( {
- type: type,
- origType: origType,
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
- namespace: namespaces.join( "." )
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- if ( !( handlers = events[ type ] ) ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener if the special events handler returns false
- if ( !special.setup ||
- special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- },
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var j, origCount, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
-
- if ( !elemData || !( events = elemData.events ) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[ t ] ) || [];
- type = origType = tmp[ 1 ];
- namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector ? special.delegateType : special.bindType ) || type;
- handlers = events[ type ] || [];
- tmp = tmp[ 2 ] &&
- new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
-
- // Remove matching events
- origCount = j = handlers.length;
- while ( j-- ) {
- handleObj = handlers[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector ||
- selector === "**" && handleObj.selector ) ) {
- handlers.splice( j, 1 );
-
- if ( handleObj.selector ) {
- handlers.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( origCount && !handlers.length ) {
- if ( !special.teardown ||
- special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove data and the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- dataPriv.remove( elem, "handle events" );
- }
- },
-
- dispatch: function( nativeEvent ) {
-
- // Make a writable jQuery.Event from the native event object
- var event = jQuery.event.fix( nativeEvent );
-
- var i, j, ret, matched, handleObj, handlerQueue,
- args = new Array( arguments.length ),
- handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
- special = jQuery.event.special[ event.type ] || {};
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[ 0 ] = event;
-
- for ( i = 1; i < arguments.length; i++ ) {
- args[ i ] = arguments[ i ];
- }
-
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
- // Run delegates first; they may want to stop propagation beneath us
- i = 0;
- while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
- event.currentTarget = matched.elem;
-
- j = 0;
- while ( ( handleObj = matched.handlers[ j++ ] ) &&
- !event.isImmediatePropagationStopped() ) {
-
- // Triggered event must either 1) have no namespace, or 2) have namespace(s)
- // a subset or equal to those in the bound event (both can have no namespace).
- if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
-
- event.handleObj = handleObj;
- event.data = handleObj.data;
-
- ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
- handleObj.handler ).apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- if ( ( event.result = ret ) === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- handlers: function( event, handlers ) {
- var i, handleObj, sel, matchedHandlers, matchedSelectors,
- handlerQueue = [],
- delegateCount = handlers.delegateCount,
- cur = event.target;
-
- // Find delegate handlers
- if ( delegateCount &&
-
- // Support: IE <=9
- // Black-hole SVG <use> instance trees (trac-13180)
- cur.nodeType &&
-
- // Support: Firefox <=42
- // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
- // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
- // Support: IE 11 only
- // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
- !( event.type === "click" && event.button >= 1 ) ) {
-
- for ( ; cur !== this; cur = cur.parentNode || this ) {
-
- // Don't check non-elements (#13208)
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
- if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
- matchedHandlers = [];
- matchedSelectors = {};
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
-
- // Don't conflict with Object.prototype properties (#13203)
- sel = handleObj.selector + " ";
-
- if ( matchedSelectors[ sel ] === undefined ) {
- matchedSelectors[ sel ] = handleObj.needsContext ?
- jQuery( sel, this ).index( cur ) > -1 :
- jQuery.find( sel, this, null, [ cur ] ).length;
- }
- if ( matchedSelectors[ sel ] ) {
- matchedHandlers.push( handleObj );
- }
- }
- if ( matchedHandlers.length ) {
- handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- cur = this;
- if ( delegateCount < handlers.length ) {
- handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
- }
-
- return handlerQueue;
- },
-
- addProp: function( name, hook ) {
- Object.defineProperty( jQuery.Event.prototype, name, {
- enumerable: true,
- configurable: true,
-
- get: jQuery.isFunction( hook ) ?
- function() {
- if ( this.originalEvent ) {
- return hook( this.originalEvent );
- }
- } :
- function() {
- if ( this.originalEvent ) {
- return this.originalEvent[ name ];
- }
- },
-
- set: function( value ) {
- Object.defineProperty( this, name, {
- enumerable: true,
- configurable: true,
- writable: true,
- value: value
- } );
- }
- } );
- },
-
- fix: function( originalEvent ) {
- return originalEvent[ jQuery.expando ] ?
- originalEvent :
- new jQuery.Event( originalEvent );
- },
-
- special: {
- load: {
-
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
- focus: {
-
- // Fire native event if possible so blur/focus sequence is correct
- trigger: function() {
- if ( this !== safeActiveElement() && this.focus ) {
- this.focus();
- return false;
- }
- },
- delegateType: "focusin"
- },
- blur: {
- trigger: function() {
- if ( this === safeActiveElement() && this.blur ) {
- this.blur();
- return false;
- }
- },
- delegateType: "focusout"
- },
- click: {
-
- // For checkbox, fire native event so checked state will be right
- trigger: function() {
- if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
- this.click();
- return false;
- }
- },
-
- // For cross-browser consistency, don't fire native .click() on links
- _default: function( event ) {
- return jQuery.nodeName( event.target, "a" );
- }
- },
-
- beforeunload: {
- postDispatch: function( event ) {
-
- // Support: Firefox 20+
- // Firefox doesn't alert if the returnValue field is not set.
- if ( event.result !== undefined && event.originalEvent ) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- }
- };
-
- jQuery.removeEvent = function( elem, type, handle ) {
-
- // This "if" is needed for plain objects
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle );
- }
- };
-
- jQuery.Event = function( src, props ) {
-
- // Allow instantiation without the 'new' keyword
- if ( !( this instanceof jQuery.Event ) ) {
- return new jQuery.Event( src, props );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
-
- // Events bubbling up the document may have been marked as prevented
- // by a handler lower down the tree; reflect the correct value.
- this.isDefaultPrevented = src.defaultPrevented ||
- src.defaultPrevented === undefined &&
-
- // Support: Android <=2.3 only
- src.returnValue === false ?
- returnTrue :
- returnFalse;
-
- // Create target properties
- // Support: Safari <=6 - 7 only
- // Target should not be a text node (#504, #13143)
- this.target = ( src.target && src.target.nodeType === 3 ) ?
- src.target.parentNode :
- src.target;
-
- this.currentTarget = src.currentTarget;
- this.relatedTarget = src.relatedTarget;
-
- // Event type
- } else {
- this.type = src;
- }
-
- // Put explicitly provided properties onto the event object
- if ( props ) {
- jQuery.extend( this, props );
- }
-
- // Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || jQuery.now();
-
- // Mark it as fixed
- this[ jQuery.expando ] = true;
- };
-
- // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
- // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
- jQuery.Event.prototype = {
- constructor: jQuery.Event,
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse,
- isSimulated: false,
-
- preventDefault: function() {
- var e = this.originalEvent;
-
- this.isDefaultPrevented = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.preventDefault();
- }
- },
- stopPropagation: function() {
- var e = this.originalEvent;
-
- this.isPropagationStopped = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.stopPropagation();
- }
- },
- stopImmediatePropagation: function() {
- var e = this.originalEvent;
-
- this.isImmediatePropagationStopped = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.stopImmediatePropagation();
- }
-
- this.stopPropagation();
- }
- };
-
- // Includes all common event props including KeyEvent and MouseEvent specific props
- jQuery.each( {
- altKey: true,
- bubbles: true,
- cancelable: true,
- changedTouches: true,
- ctrlKey: true,
- detail: true,
- eventPhase: true,
- metaKey: true,
- pageX: true,
- pageY: true,
- shiftKey: true,
- view: true,
- "char": true,
- charCode: true,
- key: true,
- keyCode: true,
- button: true,
- buttons: true,
- clientX: true,
- clientY: true,
- offsetX: true,
- offsetY: true,
- pointerId: true,
- pointerType: true,
- screenX: true,
- screenY: true,
- targetTouches: true,
- toElement: true,
- touches: true,
-
- which: function( event ) {
- var button = event.button;
-
- // Add which for key events
- if ( event.which == null && rkeyEvent.test( event.type ) ) {
- return event.charCode != null ? event.charCode : event.keyCode;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
- if ( button & 1 ) {
- return 1;
- }
-
- if ( button & 2 ) {
- return 3;
- }
-
- if ( button & 4 ) {
- return 2;
- }
-
- return 0;
- }
-
- return event.which;
- }
- }, jQuery.event.addProp );
-
- // Create mouseenter/leave events using mouseover/out and event-time checks
- // so that event delegation works in jQuery.
- // Do the same for pointerenter/pointerleave and pointerover/pointerout
- //
- // Support: Safari 7 only
- // Safari sends mouseenter too often; see:
- // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
- // for the description of the bug (it existed in older Chrome versions as well).
- jQuery.each( {
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- }, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var ret,
- target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj;
-
- // For mouseenter/leave call the handler if related is outside the target.
- // NB: No relatedTarget if the mouse left/entered the browser window
- if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply( this, arguments );
- event.type = fix;
- }
- return ret;
- }
- };
- } );
-
- jQuery.fn.extend( {
-
- on: function( types, selector, data, fn ) {
- return on( this, types, selector, data, fn );
- },
- one: function( types, selector, data, fn ) {
- return on( this, types, selector, data, fn, 1 );
- },
- off: function( types, selector, fn ) {
- var handleObj, type;
- if ( types && types.preventDefault && types.handleObj ) {
-
- // ( event ) dispatched jQuery.Event
- handleObj = types.handleObj;
- jQuery( types.delegateTarget ).off(
- handleObj.namespace ?
- handleObj.origType + "." + handleObj.namespace :
- handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if ( typeof types === "object" ) {
-
- // ( types-object [, selector] )
- for ( type in types ) {
- this.off( type, selector, types[ type ] );
- }
- return this;
- }
- if ( selector === false || typeof selector === "function" ) {
-
- // ( types [, fn] )
- fn = selector;
- selector = undefined;
- }
- if ( fn === false ) {
- fn = returnFalse;
- }
- return this.each( function() {
- jQuery.event.remove( this, types, fn, selector );
- } );
- }
- } );
-
-
- var
-
- /* eslint-disable max-len */
-
- // See https://github.com/eslint/eslint/issues/3229
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
-
- /* eslint-enable */
-
- // Support: IE <=10 - 11, Edge 12 - 13
- // In IE/Edge using regex groups here causes severe slowdowns.
- // See https://connect.microsoft.com/IE/feedback/details/1736512/
- rnoInnerhtml = /<script|<style|<link/i,
-
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rscriptTypeMasked = /^true\/(.*)/,
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
-
- function manipulationTarget( elem, content ) {
- if ( jQuery.nodeName( elem, "table" ) &&
- jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
-
- return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
- }
-
- return elem;
- }
-
- // Replace/restore the type attribute of script elements for safe DOM manipulation
- function disableScript( elem ) {
- elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
- return elem;
- }
- function restoreScript( elem ) {
- var match = rscriptTypeMasked.exec( elem.type );
-
- if ( match ) {
- elem.type = match[ 1 ];
- } else {
- elem.removeAttribute( "type" );
- }
-
- return elem;
- }
-
- function cloneCopyEvent( src, dest ) {
- var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
-
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- // 1. Copy private data: events, handlers, etc.
- if ( dataPriv.hasData( src ) ) {
- pdataOld = dataPriv.access( src );
- pdataCur = dataPriv.set( dest, pdataOld );
- events = pdataOld.events;
-
- if ( events ) {
- delete pdataCur.handle;
- pdataCur.events = {};
-
- for ( type in events ) {
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
- jQuery.event.add( dest, type, events[ type ][ i ] );
- }
- }
- }
- }
-
- // 2. Copy user data
- if ( dataUser.hasData( src ) ) {
- udataOld = dataUser.access( src );
- udataCur = jQuery.extend( {}, udataOld );
-
- dataUser.set( dest, udataCur );
- }
- }
-
- // Fix IE bugs, see support tests
- function fixInput( src, dest ) {
- var nodeName = dest.nodeName.toLowerCase();
-
- // Fails to persist the checked state of a cloned checkbox or radio button.
- if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
- dest.checked = src.checked;
-
- // Fails to return the selected option to the default selected state when cloning options
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
- dest.defaultValue = src.defaultValue;
- }
- }
-
- function domManip( collection, args, callback, ignored ) {
-
- // Flatten any nested arrays
- args = concat.apply( [], args );
-
- var fragment, first, scripts, hasScripts, node, doc,
- i = 0,
- l = collection.length,
- iNoClone = l - 1,
- value = args[ 0 ],
- isFunction = jQuery.isFunction( value );
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( isFunction ||
- ( l > 1 && typeof value === "string" &&
- !support.checkClone && rchecked.test( value ) ) ) {
- return collection.each( function( index ) {
- var self = collection.eq( index );
- if ( isFunction ) {
- args[ 0 ] = value.call( this, index, self.html() );
- }
- domManip( self, args, callback, ignored );
- } );
- }
-
- if ( l ) {
- fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
- first = fragment.firstChild;
-
- if ( fragment.childNodes.length === 1 ) {
- fragment = first;
- }
-
- // Require either new content or an interest in ignored elements to invoke the callback
- if ( first || ignored ) {
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
- hasScripts = scripts.length;
-
- // Use the original fragment for the last item
- // instead of the first because it can end up
- // being emptied incorrectly in certain situations (#8070).
- for ( ; i < l; i++ ) {
- node = fragment;
-
- if ( i !== iNoClone ) {
- node = jQuery.clone( node, true, true );
-
- // Keep references to cloned scripts for later restoration
- if ( hasScripts ) {
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( scripts, getAll( node, "script" ) );
- }
- }
-
- callback.call( collection[ i ], node, i );
- }
-
- if ( hasScripts ) {
- doc = scripts[ scripts.length - 1 ].ownerDocument;
-
- // Reenable scripts
- jQuery.map( scripts, restoreScript );
-
- // Evaluate executable scripts on first document insertion
- for ( i = 0; i < hasScripts; i++ ) {
- node = scripts[ i ];
- if ( rscriptType.test( node.type || "" ) &&
- !dataPriv.access( node, "globalEval" ) &&
- jQuery.contains( doc, node ) ) {
-
- if ( node.src ) {
-
- // Optional AJAX dependency, but won't run scripts if not present
- if ( jQuery._evalUrl ) {
- jQuery._evalUrl( node.src );
- }
- } else {
- DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
- }
- }
- }
- }
- }
- }
-
- return collection;
- }
-
- function remove( elem, selector, keepData ) {
- var node,
- nodes = selector ? jQuery.filter( selector, elem ) : elem,
- i = 0;
-
- for ( ; ( node = nodes[ i ] ) != null; i++ ) {
- if ( !keepData && node.nodeType === 1 ) {
- jQuery.cleanData( getAll( node ) );
- }
-
- if ( node.parentNode ) {
- if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
- setGlobalEval( getAll( node, "script" ) );
- }
- node.parentNode.removeChild( node );
- }
- }
-
- return elem;
- }
-
- jQuery.extend( {
- htmlPrefilter: function( html ) {
- return html.replace( rxhtmlTag, "<$1></$2>" );
- },
-
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
- var i, l, srcElements, destElements,
- clone = elem.cloneNode( true ),
- inPage = jQuery.contains( elem.ownerDocument, elem );
-
- // Fix IE cloning issues
- if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
- !jQuery.isXMLDoc( elem ) ) {
-
- // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
- destElements = getAll( clone );
- srcElements = getAll( elem );
-
- for ( i = 0, l = srcElements.length; i < l; i++ ) {
- fixInput( srcElements[ i ], destElements[ i ] );
- }
- }
-
- // Copy the events from the original to the clone
- if ( dataAndEvents ) {
- if ( deepDataAndEvents ) {
- srcElements = srcElements || getAll( elem );
- destElements = destElements || getAll( clone );
-
- for ( i = 0, l = srcElements.length; i < l; i++ ) {
- cloneCopyEvent( srcElements[ i ], destElements[ i ] );
- }
- } else {
- cloneCopyEvent( elem, clone );
- }
- }
-
- // Preserve script evaluation history
- destElements = getAll( clone, "script" );
- if ( destElements.length > 0 ) {
- setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
- }
-
- // Return the cloned set
- return clone;
- },
-
- cleanData: function( elems ) {
- var data, elem, type,
- special = jQuery.event.special,
- i = 0;
-
- for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
- if ( acceptData( elem ) ) {
- if ( ( data = elem[ dataPriv.expando ] ) ) {
- if ( data.events ) {
- for ( type in data.events ) {
- if ( special[ type ] ) {
- jQuery.event.remove( elem, type );
-
- // This is a shortcut to avoid jQuery.event.remove's overhead
- } else {
- jQuery.removeEvent( elem, type, data.handle );
- }
- }
- }
-
- // Support: Chrome <=35 - 45+
- // Assign undefined instead of using delete, see Data#remove
- elem[ dataPriv.expando ] = undefined;
- }
- if ( elem[ dataUser.expando ] ) {
-
- // Support: Chrome <=35 - 45+
- // Assign undefined instead of using delete, see Data#remove
- elem[ dataUser.expando ] = undefined;
- }
- }
- }
- }
- } );
-
- jQuery.fn.extend( {
- detach: function( selector ) {
- return remove( this, selector, true );
- },
-
- remove: function( selector ) {
- return remove( this, selector );
- },
-
- text: function( value ) {
- return access( this, function( value ) {
- return value === undefined ?
- jQuery.text( this ) :
- this.empty().each( function() {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- this.textContent = value;
- }
- } );
- }, null, value, arguments.length );
- },
-
- append: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.appendChild( elem );
- }
- } );
- },
-
- prepend: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.insertBefore( elem, target.firstChild );
- }
- } );
- },
-
- before: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this );
- }
- } );
- },
-
- after: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- }
- } );
- },
-
- empty: function() {
- var elem,
- i = 0;
-
- for ( ; ( elem = this[ i ] ) != null; i++ ) {
- if ( elem.nodeType === 1 ) {
-
- // Prevent memory leaks
- jQuery.cleanData( getAll( elem, false ) );
-
- // Remove any remaining nodes
- elem.textContent = "";
- }
- }
-
- return this;
- },
-
- clone: function( dataAndEvents, deepDataAndEvents ) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
- return this.map( function() {
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
- } );
- },
-
- html: function( value ) {
- return access( this, function( value ) {
- var elem = this[ 0 ] || {},
- i = 0,
- l = this.length;
-
- if ( value === undefined && elem.nodeType === 1 ) {
- return elem.innerHTML;
- }
-
- // See if we can take a shortcut and just use innerHTML
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
-
- value = jQuery.htmlPrefilter( value );
-
- try {
- for ( ; i < l; i++ ) {
- elem = this[ i ] || {};
-
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( getAll( elem, false ) );
- elem.innerHTML = value;
- }
- }
-
- elem = 0;
-
- // If using innerHTML throws an exception, use the fallback method
- } catch ( e ) {}
- }
-
- if ( elem ) {
- this.empty().append( value );
- }
- }, null, value, arguments.length );
- },
-
- replaceWith: function() {
- var ignored = [];
-
- // Make the changes, replacing each non-ignored context element with the new content
- return domManip( this, arguments, function( elem ) {
- var parent = this.parentNode;
-
- if ( jQuery.inArray( this, ignored ) < 0 ) {
- jQuery.cleanData( getAll( this ) );
- if ( parent ) {
- parent.replaceChild( elem, this );
- }
- }
-
- // Force callback invocation
- }, ignored );
- }
- } );
-
- jQuery.each( {
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var elems,
- ret = [],
- insert = jQuery( selector ),
- last = insert.length - 1,
- i = 0;
-
- for ( ; i <= last; i++ ) {
- elems = i === last ? this : this.clone( true );
- jQuery( insert[ i ] )[ original ]( elems );
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // .get() because push.apply(_, arraylike) throws on ancient WebKit
- push.apply( ret, elems.get() );
- }
-
- return this.pushStack( ret );
- };
- } );
- var rmargin = ( /^margin/ );
-
- var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
-
- var getStyles = function( elem ) {
-
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
- // IE throws on elements created in popups
- // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
- var view = elem.ownerDocument.defaultView;
-
- if ( !view || !view.opener ) {
- view = window;
- }
-
- return view.getComputedStyle( elem );
- };
-
-
-
- ( function() {
-
- // Executing both pixelPosition & boxSizingReliable tests require only one layout
- // so they're executed at the same time to save the second computation.
- function computeStyleTests() {
-
- // This is a singleton, we need to execute it only once
- if ( !div ) {
- return;
- }
-
- div.style.cssText =
- "box-sizing:border-box;" +
- "position:relative;display:block;" +
- "margin:auto;border:1px;padding:1px;" +
- "top:1%;width:50%";
- div.innerHTML = "";
- documentElement.appendChild( container );
-
- var divStyle = window.getComputedStyle( div );
- pixelPositionVal = divStyle.top !== "1%";
-
- // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
- reliableMarginLeftVal = divStyle.marginLeft === "2px";
- boxSizingReliableVal = divStyle.width === "4px";
-
- // Support: Android 4.0 - 4.3 only
- // Some styles come back with percentage values, even though they shouldn't
- div.style.marginRight = "50%";
- pixelMarginRightVal = divStyle.marginRight === "4px";
-
- documentElement.removeChild( container );
-
- // Nullify the div so it wouldn't be stored in the memory and
- // it will also be a sign that checks already performed
- div = null;
- }
-
- var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
- container = document.createElement( "div" ),
- div = document.createElement( "div" );
-
- // Finish early in limited (non-browser) environments
- if ( !div.style ) {
- return;
- }
-
- // Support: IE <=9 - 11 only
- // Style of cloned element affects source element cloned (#8908)
- div.style.backgroundClip = "content-box";
- div.cloneNode( true ).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
- container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
- "padding:0;margin-top:1px;position:absolute";
- container.appendChild( div );
-
- jQuery.extend( support, {
- pixelPosition: function() {
- computeStyleTests();
- return pixelPositionVal;
- },
- boxSizingReliable: function() {
- computeStyleTests();
- return boxSizingReliableVal;
- },
- pixelMarginRight: function() {
- computeStyleTests();
- return pixelMarginRightVal;
- },
- reliableMarginLeft: function() {
- computeStyleTests();
- return reliableMarginLeftVal;
- }
- } );
- } )();
-
-
- function curCSS( elem, name, computed ) {
- var width, minWidth, maxWidth, ret,
- style = elem.style;
-
- computed = computed || getStyles( elem );
-
- // Support: IE <=9 only
- // getPropertyValue is only needed for .css('filter') (#12537)
- if ( computed ) {
- ret = computed.getPropertyValue( name ) || computed[ name ];
-
- if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
- ret = jQuery.style( elem, name );
- }
-
- // A tribute to the "awesome hack by Dean Edwards"
- // Android Browser returns percentage for some values,
- // but width seems to be reliably pixels.
- // This is against the CSSOM draft spec:
- // https://drafts.csswg.org/cssom/#resolved-values
- if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-
- // Remember the original values
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
-
- // Put in the new values to get a computed value out
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
-
- // Revert the changed values
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
- }
-
- return ret !== undefined ?
-
- // Support: IE <=9 - 11 only
- // IE returns zIndex value as an integer.
- ret + "" :
- ret;
- }
-
-
- function addGetHookIf( conditionFn, hookFn ) {
-
- // Define the hook, we'll check on the first run if it's really needed.
- return {
- get: function() {
- if ( conditionFn() ) {
-
- // Hook not needed (or it's not possible to use it due
- // to missing dependency), remove it.
- delete this.get;
- return;
- }
-
- // Hook needed; redefine it so that the support test is not executed again.
- return ( this.get = hookFn ).apply( this, arguments );
- }
- };
- }
-
-
- var
-
- // Swappable if display is none or starts with table
- // except "table", "table-cell", or "table-caption"
- // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
- rdisplayswap = /^(none|table(?!-c[ea]).+)/,
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssNormalTransform = {
- letterSpacing: "0",
- fontWeight: "400"
- },
-
- cssPrefixes = [ "Webkit", "Moz", "ms" ],
- emptyStyle = document.createElement( "div" ).style;
-
- // Return a css property mapped to a potentially vendor prefixed property
- function vendorPropName( name ) {
-
- // Shortcut for names that are not vendor prefixed
- if ( name in emptyStyle ) {
- return name;
- }
-
- // Check for vendor prefixed names
- var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
- i = cssPrefixes.length;
-
- while ( i-- ) {
- name = cssPrefixes[ i ] + capName;
- if ( name in emptyStyle ) {
- return name;
- }
- }
- }
-
- function setPositiveNumber( elem, value, subtract ) {
-
- // Any relative (+/-) values have already been
- // normalized at this point
- var matches = rcssNum.exec( value );
- return matches ?
-
- // Guard against undefined "subtract", e.g., when used as in cssHooks
- Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
- value;
- }
-
- function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
- var i,
- val = 0;
-
- // If we already have the right measurement, avoid augmentation
- if ( extra === ( isBorderBox ? "border" : "content" ) ) {
- i = 4;
-
- // Otherwise initialize for horizontal or vertical properties
- } else {
- i = name === "width" ? 1 : 0;
- }
-
- for ( ; i < 4; i += 2 ) {
-
- // Both box models exclude margin, so add it if we want it
- if ( extra === "margin" ) {
- val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
- }
-
- if ( isBorderBox ) {
-
- // border-box includes padding, so remove it if we want content
- if ( extra === "content" ) {
- val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
- }
-
- // At this point, extra isn't border nor margin, so remove border
- if ( extra !== "margin" ) {
- val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
- } else {
-
- // At this point, extra isn't content, so add padding
- val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
- // At this point, extra isn't content nor padding, so add border
- if ( extra !== "padding" ) {
- val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
- }
- }
-
- return val;
- }
-
- function getWidthOrHeight( elem, name, extra ) {
-
- // Start with offset property, which is equivalent to the border-box value
- var val,
- valueIsBorderBox = true,
- styles = getStyles( elem ),
- isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
-
- // Support: IE <=11 only
- // Running getBoundingClientRect on a disconnected node
- // in IE throws an error.
- if ( elem.getClientRects().length ) {
- val = elem.getBoundingClientRect()[ name ];
- }
-
- // Some non-html elements return undefined for offsetWidth, so check for null/undefined
- // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
- // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
- if ( val <= 0 || val == null ) {
-
- // Fall back to computed then uncomputed css if necessary
- val = curCSS( elem, name, styles );
- if ( val < 0 || val == null ) {
- val = elem.style[ name ];
- }
-
- // Computed unit is not pixels. Stop here and return.
- if ( rnumnonpx.test( val ) ) {
- return val;
- }
-
- // Check for style in case a browser which returns unreliable values
- // for getComputedStyle silently falls back to the reliable elem.style
- valueIsBorderBox = isBorderBox &&
- ( support.boxSizingReliable() || val === elem.style[ name ] );
-
- // Normalize "", auto, and prepare for extra
- val = parseFloat( val ) || 0;
- }
-
- // Use the active box-sizing model to add/subtract irrelevant styles
- return ( val +
- augmentWidthOrHeight(
- elem,
- name,
- extra || ( isBorderBox ? "border" : "content" ),
- valueIsBorderBox,
- styles
- )
- ) + "px";
- }
-
- jQuery.extend( {
-
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
-
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity" );
- return ret === "" ? "1" : ret;
- }
- }
- }
- },
-
- // Don't automatically add "px" to these possibly-unitless properties
- cssNumber: {
- "animationIterationCount": true,
- "columnCount": true,
- "fillOpacity": true,
- "flexGrow": true,
- "flexShrink": true,
- "fontWeight": true,
- "lineHeight": true,
- "opacity": true,
- "order": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {
- "float": "cssFloat"
- },
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
-
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, type, hooks,
- origName = jQuery.camelCase( name ),
- style = elem.style;
-
- name = jQuery.cssProps[ origName ] ||
- ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
-
- // Gets hook for the prefixed version, then unprefixed version
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- type = typeof value;
-
- // Convert "+=" or "-=" to relative numbers (#7345)
- if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
- value = adjustCSS( elem, name, ret );
-
- // Fixes bug #9237
- type = "number";
- }
-
- // Make sure that null and NaN values aren't set (#7116)
- if ( value == null || value !== value ) {
- return;
- }
-
- // If a number was passed in, add the unit (except for certain CSS properties)
- if ( type === "number" ) {
- value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
- }
-
- // background-* props affect original clone's values
- if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
- style[ name ] = "inherit";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !( "set" in hooks ) ||
- ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
-
- style[ name ] = value;
- }
-
- } else {
-
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks &&
- ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
-
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, extra, styles ) {
- var val, num, hooks,
- origName = jQuery.camelCase( name );
-
- // Make sure that we're working with the right name
- name = jQuery.cssProps[ origName ] ||
- ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
-
- // Try prefixed name followed by the unprefixed name
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks ) {
- val = hooks.get( elem, true, extra );
- }
-
- // Otherwise, if a way to get the computed value exists, use that
- if ( val === undefined ) {
- val = curCSS( elem, name, styles );
- }
-
- // Convert "normal" to computed value
- if ( val === "normal" && name in cssNormalTransform ) {
- val = cssNormalTransform[ name ];
- }
-
- // Make numeric if forced or a qualifier was provided and val looks numeric
- if ( extra === "" || extra ) {
- num = parseFloat( val );
- return extra === true || isFinite( num ) ? num || 0 : val;
- }
- return val;
- }
- } );
-
- jQuery.each( [ "height", "width" ], function( i, name ) {
- jQuery.cssHooks[ name ] = {
- get: function( elem, computed, extra ) {
- if ( computed ) {
-
- // Certain elements can have dimension info if we invisibly show them
- // but it must have a current display style that would benefit
- return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
-
- // Support: Safari 8+
- // Table columns in Safari have non-zero offsetWidth & zero
- // getBoundingClientRect().width unless display is changed.
- // Support: IE <=11 only
- // Running getBoundingClientRect on a disconnected node
- // in IE throws an error.
- ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
- swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, name, extra );
- } ) :
- getWidthOrHeight( elem, name, extra );
- }
- },
-
- set: function( elem, value, extra ) {
- var matches,
- styles = extra && getStyles( elem ),
- subtract = extra && augmentWidthOrHeight(
- elem,
- name,
- extra,
- jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
- styles
- );
-
- // Convert to pixels if value adjustment is needed
- if ( subtract && ( matches = rcssNum.exec( value ) ) &&
- ( matches[ 3 ] || "px" ) !== "px" ) {
-
- elem.style[ name ] = value;
- value = jQuery.css( elem, name );
- }
-
- return setPositiveNumber( elem, value, subtract );
- }
- };
- } );
-
- jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
- function( elem, computed ) {
- if ( computed ) {
- return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
- elem.getBoundingClientRect().left -
- swap( elem, { marginLeft: 0 }, function() {
- return elem.getBoundingClientRect().left;
- } )
- ) + "px";
- }
- }
- );
-
- // These hooks are used by animate to expand properties
- jQuery.each( {
- margin: "",
- padding: "",
- border: "Width"
- }, function( prefix, suffix ) {
- jQuery.cssHooks[ prefix + suffix ] = {
- expand: function( value ) {
- var i = 0,
- expanded = {},
-
- // Assumes a single number if not a string
- parts = typeof value === "string" ? value.split( " " ) : [ value ];
-
- for ( ; i < 4; i++ ) {
- expanded[ prefix + cssExpand[ i ] + suffix ] =
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
- }
-
- return expanded;
- }
- };
-
- if ( !rmargin.test( prefix ) ) {
- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
- }
- } );
-
- jQuery.fn.extend( {
- css: function( name, value ) {
- return access( this, function( elem, name, value ) {
- var styles, len,
- map = {},
- i = 0;
-
- if ( jQuery.isArray( name ) ) {
- styles = getStyles( elem );
- len = name.length;
-
- for ( ; i < len; i++ ) {
- map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
- }
-
- return map;
- }
-
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- }, name, value, arguments.length > 1 );
- }
- } );
-
-
- function Tween( elem, options, prop, end, easing ) {
- return new Tween.prototype.init( elem, options, prop, end, easing );
- }
- jQuery.Tween = Tween;
-
- Tween.prototype = {
- constructor: Tween,
- init: function( elem, options, prop, end, easing, unit ) {
- this.elem = elem;
- this.prop = prop;
- this.easing = easing || jQuery.easing._default;
- this.options = options;
- this.start = this.now = this.cur();
- this.end = end;
- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
- },
- cur: function() {
- var hooks = Tween.propHooks[ this.prop ];
-
- return hooks && hooks.get ?
- hooks.get( this ) :
- Tween.propHooks._default.get( this );
- },
- run: function( percent ) {
- var eased,
- hooks = Tween.propHooks[ this.prop ];
-
- if ( this.options.duration ) {
- this.pos = eased = jQuery.easing[ this.easing ](
- percent, this.options.duration * percent, 0, 1, this.options.duration
- );
- } else {
- this.pos = eased = percent;
- }
- this.now = ( this.end - this.start ) * eased + this.start;
-
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- if ( hooks && hooks.set ) {
- hooks.set( this );
- } else {
- Tween.propHooks._default.set( this );
- }
- return this;
- }
- };
-
- Tween.prototype.init.prototype = Tween.prototype;
-
- Tween.propHooks = {
- _default: {
- get: function( tween ) {
- var result;
-
- // Use a property on the element directly when it is not a DOM element,
- // or when there is no matching style property that exists.
- if ( tween.elem.nodeType !== 1 ||
- tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
- return tween.elem[ tween.prop ];
- }
-
- // Passing an empty string as a 3rd parameter to .css will automatically
- // attempt a parseFloat and fallback to a string if the parse fails.
- // Simple values such as "10px" are parsed to Float;
- // complex values such as "rotate(1rad)" are returned as-is.
- result = jQuery.css( tween.elem, tween.prop, "" );
-
- // Empty strings, null, undefined and "auto" are converted to 0.
- return !result || result === "auto" ? 0 : result;
- },
- set: function( tween ) {
-
- // Use step hook for back compat.
- // Use cssHook if its there.
- // Use .style if available and use plain properties where available.
- if ( jQuery.fx.step[ tween.prop ] ) {
- jQuery.fx.step[ tween.prop ]( tween );
- } else if ( tween.elem.nodeType === 1 &&
- ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
- jQuery.cssHooks[ tween.prop ] ) ) {
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
- } else {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- }
- };
-
- // Support: IE <=9 only
- // Panic based approach to setting things on disconnected nodes
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function( tween ) {
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- };
-
- jQuery.easing = {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return 0.5 - Math.cos( p * Math.PI ) / 2;
- },
- _default: "swing"
- };
-
- jQuery.fx = Tween.prototype.init;
-
- // Back compat <1.8 extension point
- jQuery.fx.step = {};
-
-
-
-
- var
- fxNow, timerId,
- rfxtypes = /^(?:toggle|show|hide)$/,
- rrun = /queueHooks$/;
-
- function raf() {
- if ( timerId ) {
- window.requestAnimationFrame( raf );
- jQuery.fx.tick();
- }
- }
-
- // Animations created synchronously will run synchronously
- function createFxNow() {
- window.setTimeout( function() {
- fxNow = undefined;
- } );
- return ( fxNow = jQuery.now() );
- }
-
- // Generate parameters to create a standard animation
- function genFx( type, includeWidth ) {
- var which,
- i = 0,
- attrs = { height: type };
-
- // If we include width, step value is 1 to do all cssExpand values,
- // otherwise step value is 2 to skip over Left and Right
- includeWidth = includeWidth ? 1 : 0;
- for ( ; i < 4; i += 2 - includeWidth ) {
- which = cssExpand[ i ];
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
- }
-
- if ( includeWidth ) {
- attrs.opacity = attrs.width = type;
- }
-
- return attrs;
- }
-
- function createTween( value, prop, animation ) {
- var tween,
- collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
- index = 0,
- length = collection.length;
- for ( ; index < length; index++ ) {
- if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
-
- // We're done with this property
- return tween;
- }
- }
- }
-
- function defaultPrefilter( elem, props, opts ) {
- var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
- isBox = "width" in props || "height" in props,
- anim = this,
- orig = {},
- style = elem.style,
- hidden = elem.nodeType && isHiddenWithinTree( elem ),
- dataShow = dataPriv.get( elem, "fxshow" );
-
- // Queue-skipping animations hijack the fx hooks
- if ( !opts.queue ) {
- hooks = jQuery._queueHooks( elem, "fx" );
- if ( hooks.unqueued == null ) {
- hooks.unqueued = 0;
- oldfire = hooks.empty.fire;
- hooks.empty.fire = function() {
- if ( !hooks.unqueued ) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
-
- anim.always( function() {
-
- // Ensure the complete handler is called before this completes
- anim.always( function() {
- hooks.unqueued--;
- if ( !jQuery.queue( elem, "fx" ).length ) {
- hooks.empty.fire();
- }
- } );
- } );
- }
-
- // Detect show/hide animations
- for ( prop in props ) {
- value = props[ prop ];
- if ( rfxtypes.test( value ) ) {
- delete props[ prop ];
- toggle = toggle || value === "toggle";
- if ( value === ( hidden ? "hide" : "show" ) ) {
-
- // Pretend to be hidden if this is a "show" and
- // there is still data from a stopped show/hide
- if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
- hidden = true;
-
- // Ignore all other no-op show/hide data
- } else {
- continue;
- }
- }
- orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
- }
- }
-
- // Bail out if this is a no-op like .hide().hide()
- propTween = !jQuery.isEmptyObject( props );
- if ( !propTween && jQuery.isEmptyObject( orig ) ) {
- return;
- }
-
- // Restrict "overflow" and "display" styles during box animations
- if ( isBox && elem.nodeType === 1 ) {
-
- // Support: IE <=9 - 11, Edge 12 - 13
- // Record all 3 overflow attributes because IE does not infer the shorthand
- // from identically-valued overflowX and overflowY
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
- // Identify a display type, preferring old show/hide data over the CSS cascade
- restoreDisplay = dataShow && dataShow.display;
- if ( restoreDisplay == null ) {
- restoreDisplay = dataPriv.get( elem, "display" );
- }
- display = jQuery.css( elem, "display" );
- if ( display === "none" ) {
- if ( restoreDisplay ) {
- display = restoreDisplay;
- } else {
-
- // Get nonempty value(s) by temporarily forcing visibility
- showHide( [ elem ], true );
- restoreDisplay = elem.style.display || restoreDisplay;
- display = jQuery.css( elem, "display" );
- showHide( [ elem ] );
- }
- }
-
- // Animate inline elements as inline-block
- if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
- if ( jQuery.css( elem, "float" ) === "none" ) {
-
- // Restore the original display value at the end of pure show/hide animations
- if ( !propTween ) {
- anim.done( function() {
- style.display = restoreDisplay;
- } );
- if ( restoreDisplay == null ) {
- display = style.display;
- restoreDisplay = display === "none" ? "" : display;
- }
- }
- style.display = "inline-block";
- }
- }
- }
-
- if ( opts.overflow ) {
- style.overflow = "hidden";
- anim.always( function() {
- style.overflow = opts.overflow[ 0 ];
- style.overflowX = opts.overflow[ 1 ];
- style.overflowY = opts.overflow[ 2 ];
- } );
- }
-
- // Implement show/hide animations
- propTween = false;
- for ( prop in orig ) {
-
- // General show/hide setup for this element animation
- if ( !propTween ) {
- if ( dataShow ) {
- if ( "hidden" in dataShow ) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
- }
-
- // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
- if ( toggle ) {
- dataShow.hidden = !hidden;
- }
-
- // Show elements before animating them
- if ( hidden ) {
- showHide( [ elem ], true );
- }
-
- /* eslint-disable no-loop-func */
-
- anim.done( function() {
-
- /* eslint-enable no-loop-func */
-
- // The final step of a "hide" animation is actually hiding the element
- if ( !hidden ) {
- showHide( [ elem ] );
- }
- dataPriv.remove( elem, "fxshow" );
- for ( prop in orig ) {
- jQuery.style( elem, prop, orig[ prop ] );
- }
- } );
- }
-
- // Per-property setup
- propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
- if ( !( prop in dataShow ) ) {
- dataShow[ prop ] = propTween.start;
- if ( hidden ) {
- propTween.end = propTween.start;
- propTween.start = 0;
- }
- }
- }
- }
-
- function propFilter( props, specialEasing ) {
- var index, name, easing, value, hooks;
-
- // camelCase, specialEasing and expand cssHook pass
- for ( index in props ) {
- name = jQuery.camelCase( index );
- easing = specialEasing[ name ];
- value = props[ index ];
- if ( jQuery.isArray( value ) ) {
- easing = value[ 1 ];
- value = props[ index ] = value[ 0 ];
- }
-
- if ( index !== name ) {
- props[ name ] = value;
- delete props[ index ];
- }
-
- hooks = jQuery.cssHooks[ name ];
- if ( hooks && "expand" in hooks ) {
- value = hooks.expand( value );
- delete props[ name ];
-
- // Not quite $.extend, this won't overwrite existing keys.
- // Reusing 'index' because we have the correct "name"
- for ( index in value ) {
- if ( !( index in props ) ) {
- props[ index ] = value[ index ];
- specialEasing[ index ] = easing;
- }
- }
- } else {
- specialEasing[ name ] = easing;
- }
- }
- }
-
- function Animation( elem, properties, options ) {
- var result,
- stopped,
- index = 0,
- length = Animation.prefilters.length,
- deferred = jQuery.Deferred().always( function() {
-
- // Don't match elem in the :animated selector
- delete tick.elem;
- } ),
- tick = function() {
- if ( stopped ) {
- return false;
- }
- var currentTime = fxNow || createFxNow(),
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-
- // Support: Android 2.3 only
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
- temp = remaining / animation.duration || 0,
- percent = 1 - temp,
- index = 0,
- length = animation.tweens.length;
-
- for ( ; index < length; index++ ) {
- animation.tweens[ index ].run( percent );
- }
-
- deferred.notifyWith( elem, [ animation, percent, remaining ] );
-
- if ( percent < 1 && length ) {
- return remaining;
- } else {
- deferred.resolveWith( elem, [ animation ] );
- return false;
- }
- },
- animation = deferred.promise( {
- elem: elem,
- props: jQuery.extend( {}, properties ),
- opts: jQuery.extend( true, {
- specialEasing: {},
- easing: jQuery.easing._default
- }, options ),
- originalProperties: properties,
- originalOptions: options,
- startTime: fxNow || createFxNow(),
- duration: options.duration,
- tweens: [],
- createTween: function( prop, end ) {
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
- animation.tweens.push( tween );
- return tween;
- },
- stop: function( gotoEnd ) {
- var index = 0,
-
- // If we are going to the end, we want to run all the tweens
- // otherwise we skip this part
- length = gotoEnd ? animation.tweens.length : 0;
- if ( stopped ) {
- return this;
- }
- stopped = true;
- for ( ; index < length; index++ ) {
- animation.tweens[ index ].run( 1 );
- }
-
- // Resolve when we played the last frame; otherwise, reject
- if ( gotoEnd ) {
- deferred.notifyWith( elem, [ animation, 1, 0 ] );
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
- } else {
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
- }
- return this;
- }
- } ),
- props = animation.props;
-
- propFilter( props, animation.opts.specialEasing );
-
- for ( ; index < length; index++ ) {
- result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
- if ( result ) {
- if ( jQuery.isFunction( result.stop ) ) {
- jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
- jQuery.proxy( result.stop, result );
- }
- return result;
- }
- }
-
- jQuery.map( props, createTween, animation );
-
- if ( jQuery.isFunction( animation.opts.start ) ) {
- animation.opts.start.call( elem, animation );
- }
-
- jQuery.fx.timer(
- jQuery.extend( tick, {
- elem: elem,
- anim: animation,
- queue: animation.opts.queue
- } )
- );
-
- // attach callbacks from options
- return animation.progress( animation.opts.progress )
- .done( animation.opts.done, animation.opts.complete )
- .fail( animation.opts.fail )
- .always( animation.opts.always );
- }
-
- jQuery.Animation = jQuery.extend( Animation, {
-
- tweeners: {
- "*": [ function( prop, value ) {
- var tween = this.createTween( prop, value );
- adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
- return tween;
- } ]
- },
-
- tweener: function( props, callback ) {
- if ( jQuery.isFunction( props ) ) {
- callback = props;
- props = [ "*" ];
- } else {
- props = props.match( rnothtmlwhite );
- }
-
- var prop,
- index = 0,
- length = props.length;
-
- for ( ; index < length; index++ ) {
- prop = props[ index ];
- Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
- Animation.tweeners[ prop ].unshift( callback );
- }
- },
-
- prefilters: [ defaultPrefilter ],
-
- prefilter: function( callback, prepend ) {
- if ( prepend ) {
- Animation.prefilters.unshift( callback );
- } else {
- Animation.prefilters.push( callback );
- }
- }
- } );
-
- jQuery.speed = function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
- };
-
- // Go to the end state if fx are off or if document is hidden
- if ( jQuery.fx.off || document.hidden ) {
- opt.duration = 0;
-
- } else {
- if ( typeof opt.duration !== "number" ) {
- if ( opt.duration in jQuery.fx.speeds ) {
- opt.duration = jQuery.fx.speeds[ opt.duration ];
-
- } else {
- opt.duration = jQuery.fx.speeds._default;
- }
- }
- }
-
- // Normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function() {
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- }
- };
-
- return opt;
- };
-
- jQuery.fn.extend( {
- fadeTo: function( speed, to, easing, callback ) {
-
- // Show any hidden elements after setting opacity to 0
- return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
-
- // Animate to the value specified
- .end().animate( { opacity: to }, speed, easing, callback );
- },
- animate: function( prop, speed, easing, callback ) {
- var empty = jQuery.isEmptyObject( prop ),
- optall = jQuery.speed( speed, easing, callback ),
- doAnimation = function() {
-
- // Operate on a copy of prop so per-property easing won't be lost
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
- // Empty animations, or finishing resolves immediately
- if ( empty || dataPriv.get( this, "finish" ) ) {
- anim.stop( true );
- }
- };
- doAnimation.finish = doAnimation;
-
- return empty || optall.queue === false ?
- this.each( doAnimation ) :
- this.queue( optall.queue, doAnimation );
- },
- stop: function( type, clearQueue, gotoEnd ) {
- var stopQueue = function( hooks ) {
- var stop = hooks.stop;
- delete hooks.stop;
- stop( gotoEnd );
- };
-
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue && type !== false ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each( function() {
- var dequeue = true,
- index = type != null && type + "queueHooks",
- timers = jQuery.timers,
- data = dataPriv.get( this );
-
- if ( index ) {
- if ( data[ index ] && data[ index ].stop ) {
- stopQueue( data[ index ] );
- }
- } else {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
- stopQueue( data[ index ] );
- }
- }
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this &&
- ( type == null || timers[ index ].queue === type ) ) {
-
- timers[ index ].anim.stop( gotoEnd );
- dequeue = false;
- timers.splice( index, 1 );
- }
- }
-
- // Start the next in the queue if the last step wasn't forced.
- // Timers currently will call their complete callbacks, which
- // will dequeue but only if they were gotoEnd.
- if ( dequeue || !gotoEnd ) {
- jQuery.dequeue( this, type );
- }
- } );
- },
- finish: function( type ) {
- if ( type !== false ) {
- type = type || "fx";
- }
- return this.each( function() {
- var index,
- data = dataPriv.get( this ),
- queue = data[ type + "queue" ],
- hooks = data[ type + "queueHooks" ],
- timers = jQuery.timers,
- length = queue ? queue.length : 0;
-
- // Enable finishing flag on private data
- data.finish = true;
-
- // Empty the queue first
- jQuery.queue( this, type, [] );
-
- if ( hooks && hooks.stop ) {
- hooks.stop.call( this, true );
- }
-
- // Look for any active animations, and finish them
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
- timers[ index ].anim.stop( true );
- timers.splice( index, 1 );
- }
- }
-
- // Look for any animations in the old queue and finish them
- for ( index = 0; index < length; index++ ) {
- if ( queue[ index ] && queue[ index ].finish ) {
- queue[ index ].finish.call( this );
- }
- }
-
- // Turn off finishing flag
- delete data.finish;
- } );
- }
- } );
-
- jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
- var cssFn = jQuery.fn[ name ];
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return speed == null || typeof speed === "boolean" ?
- cssFn.apply( this, arguments ) :
- this.animate( genFx( name, true ), speed, easing, callback );
- };
- } );
-
- // Generate shortcuts for custom animations
- jQuery.each( {
- slideDown: genFx( "show" ),
- slideUp: genFx( "hide" ),
- slideToggle: genFx( "toggle" ),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
- }, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
- } );
-
- jQuery.timers = [];
- jQuery.fx.tick = function() {
- var timer,
- i = 0,
- timers = jQuery.timers;
-
- fxNow = jQuery.now();
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
-
- // Checks the timer has not already been removed
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- fxNow = undefined;
- };
-
- jQuery.fx.timer = function( timer ) {
- jQuery.timers.push( timer );
- if ( timer() ) {
- jQuery.fx.start();
- } else {
- jQuery.timers.pop();
- }
- };
-
- jQuery.fx.interval = 13;
- jQuery.fx.start = function() {
- if ( !timerId ) {
- timerId = window.requestAnimationFrame ?
- window.requestAnimationFrame( raf ) :
- window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
- }
- };
-
- jQuery.fx.stop = function() {
- if ( window.cancelAnimationFrame ) {
- window.cancelAnimationFrame( timerId );
- } else {
- window.clearInterval( timerId );
- }
-
- timerId = null;
- };
-
- jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
-
- // Default speed
- _default: 400
- };
-
-
- // Based off of the plugin by Clint Helfers, with permission.
- // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
- jQuery.fn.delay = function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = window.setTimeout( next, time );
- hooks.stop = function() {
- window.clearTimeout( timeout );
- };
- } );
- };
-
-
- ( function() {
- var input = document.createElement( "input" ),
- select = document.createElement( "select" ),
- opt = select.appendChild( document.createElement( "option" ) );
-
- input.type = "checkbox";
-
- // Support: Android <=4.3 only
- // Default value for a checkbox should be "on"
- support.checkOn = input.value !== "";
-
- // Support: IE <=11 only
- // Must access selectedIndex to make default options select
- support.optSelected = opt.selected;
-
- // Support: IE <=11 only
- // An input loses its value after becoming a radio
- input = document.createElement( "input" );
- input.value = "t";
- input.type = "radio";
- support.radioValue = input.value === "t";
- } )();
-
-
- var boolHook,
- attrHandle = jQuery.expr.attrHandle;
-
- jQuery.fn.extend( {
- attr: function( name, value ) {
- return access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each( function() {
- jQuery.removeAttr( this, name );
- } );
- }
- } );
-
- jQuery.extend( {
- attr: function( elem, name, value ) {
- var ret, hooks,
- nType = elem.nodeType;
-
- // Don't get/set attributes on text, comment and attribute nodes
- if ( nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === "undefined" ) {
- return jQuery.prop( elem, name, value );
- }
-
- // Attribute hooks are determined by the lowercase version
- // Grab necessary hook if one is defined
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
- hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
- ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
- }
-
- if ( value !== undefined ) {
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
- return;
- }
-
- if ( hooks && "set" in hooks &&
- ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
- return ret;
- }
-
- elem.setAttribute( name, value + "" );
- return value;
- }
-
- if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
- return ret;
- }
-
- ret = jQuery.find.attr( elem, name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret == null ? undefined : ret;
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- if ( !support.radioValue && value === "radio" &&
- jQuery.nodeName( elem, "input" ) ) {
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- },
-
- removeAttr: function( elem, value ) {
- var name,
- i = 0,
-
- // Attribute names can contain non-HTML whitespace characters
- // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
- attrNames = value && value.match( rnothtmlwhite );
-
- if ( attrNames && elem.nodeType === 1 ) {
- while ( ( name = attrNames[ i++ ] ) ) {
- elem.removeAttribute( name );
- }
- }
- }
- } );
-
- // Hooks for boolean attributes
- boolHook = {
- set: function( elem, value, name ) {
- if ( value === false ) {
-
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- elem.setAttribute( name, name );
- }
- return name;
- }
- };
-
- jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
- var getter = attrHandle[ name ] || jQuery.find.attr;
-
- attrHandle[ name ] = function( elem, name, isXML ) {
- var ret, handle,
- lowercaseName = name.toLowerCase();
-
- if ( !isXML ) {
-
- // Avoid an infinite loop by temporarily removing this function from the getter
- handle = attrHandle[ lowercaseName ];
- attrHandle[ lowercaseName ] = ret;
- ret = getter( elem, name, isXML ) != null ?
- lowercaseName :
- null;
- attrHandle[ lowercaseName ] = handle;
- }
- return ret;
- };
- } );
-
-
-
-
- var rfocusable = /^(?:input|select|textarea|button)$/i,
- rclickable = /^(?:a|area)$/i;
-
- jQuery.fn.extend( {
- prop: function( name, value ) {
- return access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- return this.each( function() {
- delete this[ jQuery.propFix[ name ] || name ];
- } );
- }
- } );
-
- jQuery.extend( {
- prop: function( elem, name, value ) {
- var ret, hooks,
- nType = elem.nodeType;
-
- // Don't get/set properties on text, comment and attribute nodes
- if ( nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
-
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- if ( hooks && "set" in hooks &&
- ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
- return ret;
- }
-
- return ( elem[ name ] = value );
- }
-
- if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
- return ret;
- }
-
- return elem[ name ];
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
-
- // Support: IE <=9 - 11 only
- // elem.tabIndex doesn't always return the
- // correct value when it hasn't been explicitly set
- // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- // Use proper attribute retrieval(#12072)
- var tabindex = jQuery.find.attr( elem, "tabindex" );
-
- if ( tabindex ) {
- return parseInt( tabindex, 10 );
- }
-
- if (
- rfocusable.test( elem.nodeName ) ||
- rclickable.test( elem.nodeName ) &&
- elem.href
- ) {
- return 0;
- }
-
- return -1;
- }
- }
- },
-
- propFix: {
- "for": "htmlFor",
- "class": "className"
- }
- } );
-
- // Support: IE <=11 only
- // Accessing the selectedIndex property
- // forces the browser to respect setting selected
- // on the option
- // The getter ensures a default option is selected
- // when in an optgroup
- // eslint rule "no-unused-expressions" is disabled for this code
- // since it considers such accessions noop
- if ( !support.optSelected ) {
- jQuery.propHooks.selected = {
- get: function( elem ) {
-
- /* eslint no-unused-expressions: "off" */
-
- var parent = elem.parentNode;
- if ( parent && parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- return null;
- },
- set: function( elem ) {
-
- /* eslint no-unused-expressions: "off" */
-
- var parent = elem.parentNode;
- if ( parent ) {
- parent.selectedIndex;
-
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- }
- };
- }
-
- jQuery.each( [
- "tabIndex",
- "readOnly",
- "maxLength",
- "cellSpacing",
- "cellPadding",
- "rowSpan",
- "colSpan",
- "useMap",
- "frameBorder",
- "contentEditable"
- ], function() {
- jQuery.propFix[ this.toLowerCase() ] = this;
- } );
-
-
-
-
- // Strip and collapse whitespace according to HTML spec
- // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
- function stripAndCollapse( value ) {
- var tokens = value.match( rnothtmlwhite ) || [];
- return tokens.join( " " );
- }
-
-
- function getClass( elem ) {
- return elem.getAttribute && elem.getAttribute( "class" ) || "";
- }
-
- jQuery.fn.extend( {
- addClass: function( value ) {
- var classes, elem, cur, curValue, clazz, j, finalValue,
- i = 0;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each( function( j ) {
- jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
- } );
- }
-
- if ( typeof value === "string" && value ) {
- classes = value.match( rnothtmlwhite ) || [];
-
- while ( ( elem = this[ i++ ] ) ) {
- curValue = getClass( elem );
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
-
- if ( cur ) {
- j = 0;
- while ( ( clazz = classes[ j++ ] ) ) {
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
- cur += clazz + " ";
- }
- }
-
- // Only assign if different to avoid unneeded rendering.
- finalValue = stripAndCollapse( cur );
- if ( curValue !== finalValue ) {
- elem.setAttribute( "class", finalValue );
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var classes, elem, cur, curValue, clazz, j, finalValue,
- i = 0;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each( function( j ) {
- jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
- } );
- }
-
- if ( !arguments.length ) {
- return this.attr( "class", "" );
- }
-
- if ( typeof value === "string" && value ) {
- classes = value.match( rnothtmlwhite ) || [];
-
- while ( ( elem = this[ i++ ] ) ) {
- curValue = getClass( elem );
-
- // This expression is here for better compressibility (see addClass)
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
-
- if ( cur ) {
- j = 0;
- while ( ( clazz = classes[ j++ ] ) ) {
-
- // Remove *all* instances
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
- cur = cur.replace( " " + clazz + " ", " " );
- }
- }
-
- // Only assign if different to avoid unneeded rendering.
- finalValue = stripAndCollapse( cur );
- if ( curValue !== finalValue ) {
- elem.setAttribute( "class", finalValue );
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value;
-
- if ( typeof stateVal === "boolean" && type === "string" ) {
- return stateVal ? this.addClass( value ) : this.removeClass( value );
- }
-
- if ( jQuery.isFunction( value ) ) {
- return this.each( function( i ) {
- jQuery( this ).toggleClass(
- value.call( this, i, getClass( this ), stateVal ),
- stateVal
- );
- } );
- }
-
- return this.each( function() {
- var className, i, self, classNames;
-
- if ( type === "string" ) {
-
- // Toggle individual class names
- i = 0;
- self = jQuery( this );
- classNames = value.match( rnothtmlwhite ) || [];
-
- while ( ( className = classNames[ i++ ] ) ) {
-
- // Check each className given, space separated list
- if ( self.hasClass( className ) ) {
- self.removeClass( className );
- } else {
- self.addClass( className );
- }
- }
-
- // Toggle whole class name
- } else if ( value === undefined || type === "boolean" ) {
- className = getClass( this );
- if ( className ) {
-
- // Store className if set
- dataPriv.set( this, "__className__", className );
- }
-
- // If the element has a class name or if we're passed `false`,
- // then remove the whole classname (if there was one, the above saved it).
- // Otherwise bring back whatever was previously saved (if anything),
- // falling back to the empty string if nothing was stored.
- if ( this.setAttribute ) {
- this.setAttribute( "class",
- className || value === false ?
- "" :
- dataPriv.get( this, "__className__" ) || ""
- );
- }
- }
- } );
- },
-
- hasClass: function( selector ) {
- var className, elem,
- i = 0;
-
- className = " " + selector + " ";
- while ( ( elem = this[ i++ ] ) ) {
- if ( elem.nodeType === 1 &&
- ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
- return true;
- }
- }
-
- return false;
- }
- } );
-
-
-
-
- var rreturn = /\r/g;
-
- jQuery.fn.extend( {
- val: function( value ) {
- var hooks, ret, isFunction,
- elem = this[ 0 ];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] ||
- jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks &&
- "get" in hooks &&
- ( ret = hooks.get( elem, "value" ) ) !== undefined
- ) {
- return ret;
- }
-
- ret = elem.value;
-
- // Handle most common string cases
- if ( typeof ret === "string" ) {
- return ret.replace( rreturn, "" );
- }
-
- // Handle cases where value is null/undef or number
- return ret == null ? "" : ret;
- }
-
- return;
- }
-
- isFunction = jQuery.isFunction( value );
-
- return this.each( function( i ) {
- var val;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call( this, i, jQuery( this ).val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
-
- } else if ( typeof val === "number" ) {
- val += "";
-
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map( val, function( value ) {
- return value == null ? "" : value + "";
- } );
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- } );
- }
- } );
-
- jQuery.extend( {
- valHooks: {
- option: {
- get: function( elem ) {
-
- var val = jQuery.find.attr( elem, "value" );
- return val != null ?
- val :
-
- // Support: IE <=10 - 11 only
- // option.text throws exceptions (#14686, #14858)
- // Strip and collapse whitespace
- // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
- stripAndCollapse( jQuery.text( elem ) );
- }
- },
- select: {
- get: function( elem ) {
- var value, option, i,
- options = elem.options,
- index = elem.selectedIndex,
- one = elem.type === "select-one",
- values = one ? null : [],
- max = one ? index + 1 : options.length;
-
- if ( index < 0 ) {
- i = max;
-
- } else {
- i = one ? index : 0;
- }
-
- // Loop through all the selected options
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // Support: IE <=9 only
- // IE8-9 doesn't update selected after form reset (#2551)
- if ( ( option.selected || i === index ) &&
-
- // Don't return options that are disabled or in a disabled optgroup
- !option.disabled &&
- ( !option.parentNode.disabled ||
- !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var optionSet, option,
- options = elem.options,
- values = jQuery.makeArray( value ),
- i = options.length;
-
- while ( i-- ) {
- option = options[ i ];
-
- /* eslint-disable no-cond-assign */
-
- if ( option.selected =
- jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
- ) {
- optionSet = true;
- }
-
- /* eslint-enable no-cond-assign */
- }
-
- // Force browsers to behave consistently when non-matching value is set
- if ( !optionSet ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- }
- } );
-
- // Radios and checkboxes getter/setter
- jQuery.each( [ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
- }
- }
- };
- if ( !support.checkOn ) {
- jQuery.valHooks[ this ].get = function( elem ) {
- return elem.getAttribute( "value" ) === null ? "on" : elem.value;
- };
- }
- } );
-
-
-
-
- // Return jQuery for attributes-only inclusion
-
-
- var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
-
- jQuery.extend( jQuery.event, {
-
- trigger: function( event, data, elem, onlyHandlers ) {
-
- var i, cur, tmp, bubbleType, ontype, handle, special,
- eventPath = [ elem || document ],
- type = hasOwn.call( event, "type" ) ? event.type : event,
- namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
-
- cur = tmp = elem = elem || document;
-
- // Don't do events on text and comment nodes
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
- return;
- }
-
- if ( type.indexOf( "." ) > -1 ) {
-
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split( "." );
- type = namespaces.shift();
- namespaces.sort();
- }
- ontype = type.indexOf( ":" ) < 0 && "on" + type;
-
- // Caller can pass in a jQuery.Event object, Object, or just an event type string
- event = event[ jQuery.expando ] ?
- event :
- new jQuery.Event( type, typeof event === "object" && event );
-
- // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
- event.isTrigger = onlyHandlers ? 2 : 3;
- event.namespace = namespaces.join( "." );
- event.rnamespace = event.namespace ?
- new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
- null;
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if ( !event.target ) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data == null ?
- [ event ] :
- jQuery.makeArray( data, [ event ] );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- if ( !rfocusMorph.test( bubbleType + type ) ) {
- cur = cur.parentNode;
- }
- for ( ; cur; cur = cur.parentNode ) {
- eventPath.push( cur );
- tmp = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( tmp === ( elem.ownerDocument || document ) ) {
- eventPath.push( tmp.defaultView || tmp.parentWindow || window );
- }
- }
-
- // Fire handlers on the event path
- i = 0;
- while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
-
- event.type = i > 1 ?
- bubbleType :
- special.bindType || type;
-
- // jQuery handler
- handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
- dataPriv.get( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
-
- // Native handler
- handle = ontype && cur[ ontype ];
- if ( handle && handle.apply && acceptData( cur ) ) {
- event.result = handle.apply( cur, data );
- if ( event.result === false ) {
- event.preventDefault();
- }
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
- if ( ( !special._default ||
- special._default.apply( eventPath.pop(), data ) === false ) &&
- acceptData( elem ) ) {
-
- // Call a native DOM method on the target with the same name as the event.
- // Don't do default actions on window, that's where global variables be (#6170)
- if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- tmp = elem[ ontype ];
-
- if ( tmp ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- elem[ type ]();
- jQuery.event.triggered = undefined;
-
- if ( tmp ) {
- elem[ ontype ] = tmp;
- }
- }
- }
- }
-
- return event.result;
- },
-
- // Piggyback on a donor event to simulate a different one
- // Used only for `focus(in | out)` events
- simulate: function( type, elem, event ) {
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- {
- type: type,
- isSimulated: true
- }
- );
-
- jQuery.event.trigger( e, null, elem );
- }
-
- } );
-
- jQuery.fn.extend( {
-
- trigger: function( type, data ) {
- return this.each( function() {
- jQuery.event.trigger( type, data, this );
- } );
- },
- triggerHandler: function( type, data ) {
- var elem = this[ 0 ];
- if ( elem ) {
- return jQuery.event.trigger( type, data, elem, true );
- }
- }
- } );
-
-
- jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup contextmenu" ).split( " " ),
- function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
- } );
-
- jQuery.fn.extend( {
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- }
- } );
-
-
-
-
- support.focusin = "onfocusin" in window;
-
-
- // Support: Firefox <=44
- // Firefox doesn't have focus(in | out) events
- // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
- //
- // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
- // focus(in | out) events fire after focus & blur events,
- // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
- // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
- if ( !support.focusin ) {
- jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler on the document while someone wants focusin/focusout
- var handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
- var doc = this.ownerDocument || this,
- attaches = dataPriv.access( doc, fix );
-
- if ( !attaches ) {
- doc.addEventListener( orig, handler, true );
- }
- dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
- },
- teardown: function() {
- var doc = this.ownerDocument || this,
- attaches = dataPriv.access( doc, fix ) - 1;
-
- if ( !attaches ) {
- doc.removeEventListener( orig, handler, true );
- dataPriv.remove( doc, fix );
-
- } else {
- dataPriv.access( doc, fix, attaches );
- }
- }
- };
- } );
- }
- var location = window.location;
-
- var nonce = jQuery.now();
-
- var rquery = ( /\?/ );
-
-
-
- // Cross-browser xml parsing
- jQuery.parseXML = function( data ) {
- var xml;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
-
- // Support: IE 9 - 11 only
- // IE throws on parseFromString with invalid input.
- try {
- xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
- } catch ( e ) {
- xml = undefined;
- }
-
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
- };
-
-
- var
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
- rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
- function buildParams( prefix, obj, traditional, add ) {
- var name;
-
- if ( jQuery.isArray( obj ) ) {
-
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
-
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
-
- // Item is non-scalar (array or object), encode its numeric index.
- buildParams(
- prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
- v,
- traditional,
- add
- );
- }
- } );
-
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
-
- // Serialize object item.
- for ( name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
-
- // Serialize scalar item.
- add( prefix, obj );
- }
- }
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- jQuery.param = function( a, traditional ) {
- var prefix,
- s = [],
- add = function( key, valueOrFunction ) {
-
- // If value is a function, invoke it and use its return value
- var value = jQuery.isFunction( valueOrFunction ) ?
- valueOrFunction() :
- valueOrFunction;
-
- s[ s.length ] = encodeURIComponent( key ) + "=" +
- encodeURIComponent( value == null ? "" : value );
- };
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- } );
-
- } else {
-
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" );
- };
-
- jQuery.fn.extend( {
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
- serializeArray: function() {
- return this.map( function() {
-
- // Can add propHook for "elements" to filter or add form elements
- var elements = jQuery.prop( this, "elements" );
- return elements ? jQuery.makeArray( elements ) : this;
- } )
- .filter( function() {
- var type = this.type;
-
- // Use .is( ":disabled" ) so that fieldset[disabled] works
- return this.name && !jQuery( this ).is( ":disabled" ) &&
- rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
- ( this.checked || !rcheckableType.test( type ) );
- } )
- .map( function( i, elem ) {
- var val = jQuery( this ).val();
-
- if ( val == null ) {
- return null;
- }
-
- if ( jQuery.isArray( val ) ) {
- return jQuery.map( val, function( val ) {
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- } );
- }
-
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- } ).get();
- }
- } );
-
-
- var
- r20 = /%20/g,
- rhash = /#.*$/,
- rantiCache = /([?&])_=[^&]*/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
-
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
-
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
-
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
-
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = "*/".concat( "*" ),
-
- // Anchor tag for parsing the document origin
- originAnchor = document.createElement( "a" );
- originAnchor.href = location.href;
-
- // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
- function addToPrefiltersOrTransports( structure ) {
-
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
-
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
-
- var dataType,
- i = 0,
- dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
-
- if ( jQuery.isFunction( func ) ) {
-
- // For each dataType in the dataTypeExpression
- while ( ( dataType = dataTypes[ i++ ] ) ) {
-
- // Prepend if requested
- if ( dataType[ 0 ] === "+" ) {
- dataType = dataType.slice( 1 ) || "*";
- ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
-
- // Otherwise append
- } else {
- ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
- }
- }
- }
- };
- }
-
- // Base inspection function for prefilters and transports
- function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
- var inspected = {},
- seekingTransport = ( structure === transports );
-
- function inspect( dataType ) {
- var selected;
- inspected[ dataType ] = true;
- jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
- var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
- if ( typeof dataTypeOrTransport === "string" &&
- !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
-
- options.dataTypes.unshift( dataTypeOrTransport );
- inspect( dataTypeOrTransport );
- return false;
- } else if ( seekingTransport ) {
- return !( selected = dataTypeOrTransport );
- }
- } );
- return selected;
- }
-
- return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
- }
-
- // A special extend for ajax options
- // that takes "flat" options (not to be deep extended)
- // Fixes #9887
- function ajaxExtend( target, src ) {
- var key, deep,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
-
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
- }
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
-
- return target;
- }
-
- /* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
- function ajaxHandleResponses( s, jqXHR, responses ) {
-
- var ct, type, finalDataType, firstDataType,
- contents = s.contents,
- dataTypes = s.dataTypes;
-
- // Remove auto dataType and get content-type in the process
- while ( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
-
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
-
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
- }
-
- /* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
- function ajaxConvert( s, response, jqXHR, isSuccess ) {
- var conv2, current, conv, tmp, prev,
- converters = {},
-
- // Work with a copy of dataTypes in case we need to modify it for conversion
- dataTypes = s.dataTypes.slice();
-
- // Create converters map with lowercased keys
- if ( dataTypes[ 1 ] ) {
- for ( conv in s.converters ) {
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
- }
- }
-
- current = dataTypes.shift();
-
- // Convert to each sequential dataType
- while ( current ) {
-
- if ( s.responseFields[ current ] ) {
- jqXHR[ s.responseFields[ current ] ] = response;
- }
-
- // Apply the dataFilter if provided
- if ( !prev && isSuccess && s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- prev = current;
- current = dataTypes.shift();
-
- if ( current ) {
-
- // There's only work to do if current dataType is non-auto
- if ( current === "*" ) {
-
- current = prev;
-
- // Convert response if prev dataType is non-auto and differs from current
- } else if ( prev !== "*" && prev !== current ) {
-
- // Seek a direct converter
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
- // If none found, seek a pair
- if ( !conv ) {
- for ( conv2 in converters ) {
-
- // If conv2 outputs current
- tmp = conv2.split( " " );
- if ( tmp[ 1 ] === current ) {
-
- // If prev can be converted to accepted input
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
- converters[ "* " + tmp[ 0 ] ];
- if ( conv ) {
-
- // Condense equivalence converters
- if ( conv === true ) {
- conv = converters[ conv2 ];
-
- // Otherwise, insert the intermediate dataType
- } else if ( converters[ conv2 ] !== true ) {
- current = tmp[ 0 ];
- dataTypes.unshift( tmp[ 1 ] );
- }
- break;
- }
- }
- }
- }
-
- // Apply converter (if not an equivalence)
- if ( conv !== true ) {
-
- // Unless errors are allowed to bubble, catch and return them
- if ( conv && s.throws ) {
- response = conv( response );
- } else {
- try {
- response = conv( response );
- } catch ( e ) {
- return {
- state: "parsererror",
- error: conv ? e : "No conversion from " + prev + " to " + current
- };
- }
- }
- }
- }
- }
- }
-
- return { state: "success", data: response };
- }
-
- jQuery.extend( {
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- ajaxSettings: {
- url: location.href,
- type: "GET",
- isLocal: rlocalProtocol.test( location.protocol ),
- global: true,
- processData: true,
- async: true,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- "*": allTypes,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
-
- contents: {
- xml: /\bxml\b/,
- html: /\bhtml/,
- json: /\bjson\b/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
-
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
-
- // Convert anything to text
- "* text": String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": JSON.parse,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- url: true,
- context: true
- }
- },
-
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- return settings ?
-
- // Building a settings object
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
- // Extending ajaxSettings
- ajaxExtend( jQuery.ajaxSettings, target );
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var transport,
-
- // URL without anti-cache param
- cacheURL,
-
- // Response headers
- responseHeadersString,
- responseHeaders,
-
- // timeout handle
- timeoutTimer,
-
- // Url cleanup var
- urlAnchor,
-
- // Request state (becomes false upon send and true upon completion)
- completed,
-
- // To know if global events are to be dispatched
- fireGlobals,
-
- // Loop variable
- i,
-
- // uncached part of the url
- uncached,
-
- // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
-
- // Callbacks context
- callbackContext = s.context || s,
-
- // Context for global events is callbackContext if it is a DOM node or jQuery collection
- globalEventContext = s.context &&
- ( callbackContext.nodeType || callbackContext.jquery ) ?
- jQuery( callbackContext ) :
- jQuery.event,
-
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks( "once memory" ),
-
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
-
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
-
- // Default abort message
- strAbort = "canceled",
-
- // Fake xhr
- jqXHR = {
- readyState: 0,
-
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( completed ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
- responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
- }
- }
- match = responseHeaders[ key.toLowerCase() ];
- }
- return match == null ? null : match;
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return completed ? responseHeadersString : null;
- },
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- if ( completed == null ) {
- name = requestHeadersNames[ name.toLowerCase() ] =
- requestHeadersNames[ name.toLowerCase() ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
-
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( completed == null ) {
- s.mimeType = type;
- }
- return this;
- },
-
- // Status-dependent callbacks
- statusCode: function( map ) {
- var code;
- if ( map ) {
- if ( completed ) {
-
- // Execute the appropriate callbacks
- jqXHR.always( map[ jqXHR.status ] );
- } else {
-
- // Lazy-add the new callbacks in a way that preserves old ones
- for ( code in map ) {
- statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
- }
- }
- }
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- var finalText = statusText || strAbort;
- if ( transport ) {
- transport.abort( finalText );
- }
- done( 0, finalText );
- return this;
- }
- };
-
- // Attach deferreds
- deferred.promise( jqXHR );
-
- // Add protocol if not provided (prefilters might expect it)
- // Handle falsy url in the settings object (#10093: consistency with old signature)
- // We also use the url parameter if available
- s.url = ( ( url || s.url || location.href ) + "" )
- .replace( rprotocol, location.protocol + "//" );
-
- // Alias method option to type as per ticket #12004
- s.type = options.method || options.type || s.method || s.type;
-
- // Extract dataTypes list
- s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
-
- // A cross-domain request is in order when the origin doesn't match the current origin.
- if ( s.crossDomain == null ) {
- urlAnchor = document.createElement( "a" );
-
- // Support: IE <=8 - 11, Edge 12 - 13
- // IE throws exception on accessing the href property if url is malformed,
- // e.g. http://example.com:80x/
- try {
- urlAnchor.href = s.url;
-
- // Support: IE <=8 - 11 only
- // Anchor's host property isn't correctly set when s.url is relative
- urlAnchor.href = urlAnchor.href;
- s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
- urlAnchor.protocol + "//" + urlAnchor.host;
- } catch ( e ) {
-
- // If there is an error parsing the URL, assume it is crossDomain,
- // it can be rejected by the transport if it is invalid
- s.crossDomain = true;
- }
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( completed ) {
- return jqXHR;
- }
-
- // We can fire global events as of now if asked to
- // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
- fireGlobals = jQuery.event && s.global;
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Save the URL in case we're toying with the If-Modified-Since
- // and/or If-None-Match header later on
- // Remove hash to simplify url manipulation
- cacheURL = s.url.replace( rhash, "" );
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // Remember the hash so we can put it back
- uncached = s.url.slice( cacheURL.length );
-
- // If data is available, append data to url
- if ( s.data ) {
- cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
-
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
- }
-
- // Add or update anti-cache param if needed
- if ( s.cache === false ) {
- cacheURL = cacheURL.replace( rantiCache, "$1" );
- uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
- }
-
- // Put hash and anti-cache on the URL that will be requested (gh-1732)
- s.url = cacheURL + uncached;
-
- // Change '%20' to '+' if this is encoded form body content (gh-2658)
- } else if ( s.data && s.processData &&
- ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
- s.data = s.data.replace( r20, "+" );
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
- }
- if ( jQuery.etag[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
- }
- }
-
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
-
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
- s.accepts[ s.dataTypes[ 0 ] ] +
- ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend &&
- ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
-
- // Abort if not done already and return
- return jqXHR.abort();
- }
-
- // Aborting is no longer a cancellation
- strAbort = "abort";
-
- // Install callbacks on deferreds
- completeDeferred.add( s.complete );
- jqXHR.done( s.success );
- jqXHR.fail( s.error );
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
-
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
-
- // If request was aborted inside ajaxSend, stop there
- if ( completed ) {
- return jqXHR;
- }
-
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = window.setTimeout( function() {
- jqXHR.abort( "timeout" );
- }, s.timeout );
- }
-
- try {
- completed = false;
- transport.send( requestHeaders, done );
- } catch ( e ) {
-
- // Rethrow post-completion exceptions
- if ( completed ) {
- throw e;
- }
-
- // Propagate others as results
- done( -1, e );
- }
- }
-
- // Callback for when everything is done
- function done( status, nativeStatusText, responses, headers ) {
- var isSuccess, success, error, response, modified,
- statusText = nativeStatusText;
-
- // Ignore repeat invocations
- if ( completed ) {
- return;
- }
-
- completed = true;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- window.clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- // Determine if successful
- isSuccess = status >= 200 && status < 300 || status === 304;
-
- // Get response data
- if ( responses ) {
- response = ajaxHandleResponses( s, jqXHR, responses );
- }
-
- // Convert no matter what (that way responseXXX fields are always set)
- response = ajaxConvert( s, response, jqXHR, isSuccess );
-
- // If successful, handle type chaining
- if ( isSuccess ) {
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- modified = jqXHR.getResponseHeader( "Last-Modified" );
- if ( modified ) {
- jQuery.lastModified[ cacheURL ] = modified;
- }
- modified = jqXHR.getResponseHeader( "etag" );
- if ( modified ) {
- jQuery.etag[ cacheURL ] = modified;
- }
- }
-
- // if no content
- if ( status === 204 || s.type === "HEAD" ) {
- statusText = "nocontent";
-
- // if not modified
- } else if ( status === 304 ) {
- statusText = "notmodified";
-
- // If we have data, let's convert it
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- isSuccess = !error;
- }
- } else {
-
- // Extract error from statusText and normalize for non-aborts
- error = statusText;
- if ( status || !statusText ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- }
- }
-
- return jqXHR;
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- }
- } );
-
- jQuery.each( [ "get", "post" ], function( i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
-
- // Shift arguments if data argument was omitted
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
-
- // The url can be an options object (which then must have .url)
- return jQuery.ajax( jQuery.extend( {
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- }, jQuery.isPlainObject( url ) && url ) );
- };
- } );
-
-
- jQuery._evalUrl = function( url ) {
- return jQuery.ajax( {
- url: url,
-
- // Make this explicit, since user can override this through ajaxSetup (#11264)
- type: "GET",
- dataType: "script",
- cache: true,
- async: false,
- global: false,
- "throws": true
- } );
- };
-
-
- jQuery.fn.extend( {
- wrapAll: function( html ) {
- var wrap;
-
- if ( this[ 0 ] ) {
- if ( jQuery.isFunction( html ) ) {
- html = html.call( this[ 0 ] );
- }
-
- // The elements to wrap the target around
- wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
-
- if ( this[ 0 ].parentNode ) {
- wrap.insertBefore( this[ 0 ] );
- }
-
- wrap.map( function() {
- var elem = this;
-
- while ( elem.firstElementChild ) {
- elem = elem.firstElementChild;
- }
-
- return elem;
- } ).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each( function( i ) {
- jQuery( this ).wrapInner( html.call( this, i ) );
- } );
- }
-
- return this.each( function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- } );
- },
-
- wrap: function( html ) {
- var isFunction = jQuery.isFunction( html );
-
- return this.each( function( i ) {
- jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
- } );
- },
-
- unwrap: function( selector ) {
- this.parent( selector ).not( "body" ).each( function() {
- jQuery( this ).replaceWith( this.childNodes );
- } );
- return this;
- }
- } );
-
-
- jQuery.expr.pseudos.hidden = function( elem ) {
- return !jQuery.expr.pseudos.visible( elem );
- };
- jQuery.expr.pseudos.visible = function( elem ) {
- return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
- };
-
-
-
-
- jQuery.ajaxSettings.xhr = function() {
- try {
- return new window.XMLHttpRequest();
- } catch ( e ) {}
- };
-
- var xhrSuccessStatus = {
-
- // File protocol always yields status code 0, assume 200
- 0: 200,
-
- // Support: IE <=9 only
- // #1450: sometimes IE returns 1223 when it should be 204
- 1223: 204
- },
- xhrSupported = jQuery.ajaxSettings.xhr();
-
- support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
- support.ajax = xhrSupported = !!xhrSupported;
-
- jQuery.ajaxTransport( function( options ) {
- var callback, errorCallback;
-
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( support.cors || xhrSupported && !options.crossDomain ) {
- return {
- send: function( headers, complete ) {
- var i,
- xhr = options.xhr();
-
- xhr.open(
- options.type,
- options.url,
- options.async,
- options.username,
- options.password
- );
-
- // Apply custom fields if provided
- if ( options.xhrFields ) {
- for ( i in options.xhrFields ) {
- xhr[ i ] = options.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( options.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( options.mimeType );
- }
-
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
- headers[ "X-Requested-With" ] = "XMLHttpRequest";
- }
-
- // Set headers
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
-
- // Callback
- callback = function( type ) {
- return function() {
- if ( callback ) {
- callback = errorCallback = xhr.onload =
- xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
-
- if ( type === "abort" ) {
- xhr.abort();
- } else if ( type === "error" ) {
-
- // Support: IE <=9 only
- // On a manual native abort, IE9 throws
- // errors on any property access that is not readyState
- if ( typeof xhr.status !== "number" ) {
- complete( 0, "error" );
- } else {
- complete(
-
- // File: protocol always yields status 0; see #8605, #14207
- xhr.status,
- xhr.statusText
- );
- }
- } else {
- complete(
- xhrSuccessStatus[ xhr.status ] || xhr.status,
- xhr.statusText,
-
- // Support: IE <=9 only
- // IE9 has no XHR2 but throws on binary (trac-11426)
- // For XHR2 non-text, let the caller handle it (gh-2498)
- ( xhr.responseType || "text" ) !== "text" ||
- typeof xhr.responseText !== "string" ?
- { binary: xhr.response } :
- { text: xhr.responseText },
- xhr.getAllResponseHeaders()
- );
- }
- }
- };
- };
-
- // Listen to events
- xhr.onload = callback();
- errorCallback = xhr.onerror = callback( "error" );
-
- // Support: IE 9 only
- // Use onreadystatechange to replace onabort
- // to handle uncaught aborts
- if ( xhr.onabort !== undefined ) {
- xhr.onabort = errorCallback;
- } else {
- xhr.onreadystatechange = function() {
-
- // Check readyState before timeout as it changes
- if ( xhr.readyState === 4 ) {
-
- // Allow onerror to be called first,
- // but that will not handle a native abort
- // Also, save errorCallback to a variable
- // as xhr.onerror cannot be accessed
- window.setTimeout( function() {
- if ( callback ) {
- errorCallback();
- }
- } );
- }
- };
- }
-
- // Create the abort callback
- callback = callback( "abort" );
-
- try {
-
- // Do send the request (this may raise an exception)
- xhr.send( options.hasContent && options.data || null );
- } catch ( e ) {
-
- // #14683: Only rethrow if this hasn't been notified as an error yet
- if ( callback ) {
- throw e;
- }
- }
- },
-
- abort: function() {
- if ( callback ) {
- callback();
- }
- }
- };
- }
- } );
-
-
-
-
- // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
- jQuery.ajaxPrefilter( function( s ) {
- if ( s.crossDomain ) {
- s.contents.script = false;
- }
- } );
-
- // Install script dataType
- jQuery.ajaxSetup( {
- accepts: {
- script: "text/javascript, application/javascript, " +
- "application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /\b(?:java|ecma)script\b/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
- }
- }
- } );
-
- // Handle cache's special case and crossDomain
- jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- }
- } );
-
- // Bind script tag hack transport
- jQuery.ajaxTransport( "script", function( s ) {
-
- // This transport only deals with cross domain requests
- if ( s.crossDomain ) {
- var script, callback;
- return {
- send: function( _, complete ) {
- script = jQuery( "<script>" ).prop( {
- charset: s.scriptCharset,
- src: s.url
- } ).on(
- "load error",
- callback = function( evt ) {
- script.remove();
- callback = null;
- if ( evt ) {
- complete( evt.type === "error" ? 404 : 200, evt.type );
- }
- }
- );
-
- // Use native DOM manipulation to avoid our domManip AJAX trickery
- document.head.appendChild( script[ 0 ] );
- },
- abort: function() {
- if ( callback ) {
- callback();
- }
- }
- };
- }
- } );
-
-
-
-
- var oldCallbacks = [],
- rjsonp = /(=)\?(?=&|$)|\?\?/;
-
- // Default jsonp settings
- jQuery.ajaxSetup( {
- jsonp: "callback",
- jsonpCallback: function() {
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
- this[ callback ] = true;
- return callback;
- }
- } );
-
- // Detect, normalize options and install callbacks for jsonp requests
- jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
- var callbackName, overwritten, responseContainer,
- jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
- "url" :
- typeof s.data === "string" &&
- ( s.contentType || "" )
- .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
- rjsonp.test( s.data ) && "data"
- );
-
- // Handle iff the expected data type is "jsonp" or we have a parameter to set
- if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
- // Get callback name, remembering preexisting value associated with it
- callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
- s.jsonpCallback() :
- s.jsonpCallback;
-
- // Insert callback into url or form data
- if ( jsonProp ) {
- s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
- } else if ( s.jsonp !== false ) {
- s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
- }
-
- // Use data converter to retrieve json after script execution
- s.converters[ "script json" ] = function() {
- if ( !responseContainer ) {
- jQuery.error( callbackName + " was not called" );
- }
- return responseContainer[ 0 ];
- };
-
- // Force json dataType
- s.dataTypes[ 0 ] = "json";
-
- // Install callback
- overwritten = window[ callbackName ];
- window[ callbackName ] = function() {
- responseContainer = arguments;
- };
-
- // Clean-up function (fires after converters)
- jqXHR.always( function() {
-
- // If previous value didn't exist - remove it
- if ( overwritten === undefined ) {
- jQuery( window ).removeProp( callbackName );
-
- // Otherwise restore preexisting value
- } else {
- window[ callbackName ] = overwritten;
- }
-
- // Save back as free
- if ( s[ callbackName ] ) {
-
- // Make sure that re-using the options doesn't screw things around
- s.jsonpCallback = originalSettings.jsonpCallback;
-
- // Save the callback name for future use
- oldCallbacks.push( callbackName );
- }
-
- // Call if it was a function and we have a response
- if ( responseContainer && jQuery.isFunction( overwritten ) ) {
- overwritten( responseContainer[ 0 ] );
- }
-
- responseContainer = overwritten = undefined;
- } );
-
- // Delegate to script
- return "script";
- }
- } );
-
-
-
-
- // Support: Safari 8 only
- // In Safari 8 documents created via document.implementation.createHTMLDocument
- // collapse sibling forms: the second one becomes a child of the first one.
- // Because of that, this security measure has to be disabled in Safari 8.
- // https://bugs.webkit.org/show_bug.cgi?id=137337
- support.createHTMLDocument = ( function() {
- var body = document.implementation.createHTMLDocument( "" ).body;
- body.innerHTML = "<form></form><form></form>";
- return body.childNodes.length === 2;
- } )();
-
-
- // Argument "data" should be string of html
- // context (optional): If specified, the fragment will be created in this context,
- // defaults to document
- // keepScripts (optional): If true, will include scripts passed in the html string
- jQuery.parseHTML = function( data, context, keepScripts ) {
- if ( typeof data !== "string" ) {
- return [];
- }
- if ( typeof context === "boolean" ) {
- keepScripts = context;
- context = false;
- }
-
- var base, parsed, scripts;
-
- if ( !context ) {
-
- // Stop scripts or inline event handlers from being executed immediately
- // by using document.implementation
- if ( support.createHTMLDocument ) {
- context = document.implementation.createHTMLDocument( "" );
-
- // Set the base href for the created document
- // so any parsed elements with URLs
- // are based on the document's URL (gh-2965)
- base = context.createElement( "base" );
- base.href = document.location.href;
- context.head.appendChild( base );
- } else {
- context = document;
- }
- }
-
- parsed = rsingleTag.exec( data );
- scripts = !keepScripts && [];
-
- // Single tag
- if ( parsed ) {
- return [ context.createElement( parsed[ 1 ] ) ];
- }
-
- parsed = buildFragment( [ data ], context, scripts );
-
- if ( scripts && scripts.length ) {
- jQuery( scripts ).remove();
- }
-
- return jQuery.merge( [], parsed.childNodes );
- };
-
-
- /**
- * Load a url into a page
- */
- jQuery.fn.load = function( url, params, callback ) {
- var selector, type, response,
- self = this,
- off = url.indexOf( " " );
-
- if ( off > -1 ) {
- selector = stripAndCollapse( url.slice( off ) );
- url = url.slice( 0, off );
- }
-
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
-
- // We assume that it's the callback
- callback = params;
- params = undefined;
-
- // Otherwise, build a param string
- } else if ( params && typeof params === "object" ) {
- type = "POST";
- }
-
- // If we have elements to modify, make the request
- if ( self.length > 0 ) {
- jQuery.ajax( {
- url: url,
-
- // If "type" variable is undefined, then "GET" method will be used.
- // Make value of this field explicit since
- // user can override it through ajaxSetup method
- type: type || "GET",
- dataType: "html",
- data: params
- } ).done( function( responseText ) {
-
- // Save response for use in complete callback
- response = arguments;
-
- self.html( selector ?
-
- // If a selector was specified, locate the right elements in a dummy div
- // Exclude scripts to avoid IE 'Permission Denied' errors
- jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
- // Otherwise use the full result
- responseText );
-
- // If the request succeeds, this function gets "data", "status", "jqXHR"
- // but they are ignored because response was set above.
- // If it fails, this function gets "jqXHR", "status", "error"
- } ).always( callback && function( jqXHR, status ) {
- self.each( function() {
- callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
- } );
- } );
- }
-
- return this;
- };
-
-
-
-
- // Attach a bunch of functions for handling common AJAX events
- jQuery.each( [
- "ajaxStart",
- "ajaxStop",
- "ajaxComplete",
- "ajaxError",
- "ajaxSuccess",
- "ajaxSend"
- ], function( i, type ) {
- jQuery.fn[ type ] = function( fn ) {
- return this.on( type, fn );
- };
- } );
-
-
-
-
- jQuery.expr.pseudos.animated = function( elem ) {
- return jQuery.grep( jQuery.timers, function( fn ) {
- return elem === fn.elem;
- } ).length;
- };
-
-
-
-
- /**
- * Gets a window from an element
- */
- function getWindow( elem ) {
- return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
- }
-
- jQuery.offset = {
- setOffset: function( elem, options, i ) {
- var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
- position = jQuery.css( elem, "position" ),
- curElem = jQuery( elem ),
- props = {};
-
- // Set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- curOffset = curElem.offset();
- curCSSTop = jQuery.css( elem, "top" );
- curCSSLeft = jQuery.css( elem, "left" );
- calculatePosition = ( position === "absolute" || position === "fixed" ) &&
- ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
-
- // Need to be able to calculate position if either
- // top or left is auto and position is either absolute or fixed
- if ( calculatePosition ) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
-
- } else {
- curTop = parseFloat( curCSSTop ) || 0;
- curLeft = parseFloat( curCSSLeft ) || 0;
- }
-
- if ( jQuery.isFunction( options ) ) {
-
- // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
- options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
- }
-
- if ( options.top != null ) {
- props.top = ( options.top - curOffset.top ) + curTop;
- }
- if ( options.left != null ) {
- props.left = ( options.left - curOffset.left ) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
-
- } else {
- curElem.css( props );
- }
- }
- };
-
- jQuery.fn.extend( {
- offset: function( options ) {
-
- // Preserve chaining for setter
- if ( arguments.length ) {
- return options === undefined ?
- this :
- this.each( function( i ) {
- jQuery.offset.setOffset( this, options, i );
- } );
- }
-
- var docElem, win, rect, doc,
- elem = this[ 0 ];
-
- if ( !elem ) {
- return;
- }
-
- // Support: IE <=11 only
- // Running getBoundingClientRect on a
- // disconnected node in IE throws an error
- if ( !elem.getClientRects().length ) {
- return { top: 0, left: 0 };
- }
-
- rect = elem.getBoundingClientRect();
-
- // Make sure element is not hidden (display: none)
- if ( rect.width || rect.height ) {
- doc = elem.ownerDocument;
- win = getWindow( doc );
- docElem = doc.documentElement;
-
- return {
- top: rect.top + win.pageYOffset - docElem.clientTop,
- left: rect.left + win.pageXOffset - docElem.clientLeft
- };
- }
-
- // Return zeros for disconnected and hidden elements (gh-2310)
- return rect;
- },
-
- position: function() {
- if ( !this[ 0 ] ) {
- return;
- }
-
- var offsetParent, offset,
- elem = this[ 0 ],
- parentOffset = { top: 0, left: 0 };
-
- // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
- // because it is its only offset parent
- if ( jQuery.css( elem, "position" ) === "fixed" ) {
-
- // Assume getBoundingClientRect is there when computed position is fixed
- offset = elem.getBoundingClientRect();
-
- } else {
-
- // Get *real* offsetParent
- offsetParent = this.offsetParent();
-
- // Get correct offsets
- offset = this.offset();
- if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
- parentOffset = offsetParent.offset();
- }
-
- // Add offsetParent borders
- parentOffset = {
- top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
- left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
- };
- }
-
- // Subtract parent offsets and element margins
- return {
- top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
- left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
- };
- },
-
- // This method will return documentElement in the following cases:
- // 1) For the element inside the iframe without offsetParent, this method will return
- // documentElement of the parent window
- // 2) For the hidden or detached element
- // 3) For body or html element, i.e. in case of the html node - it will return itself
- //
- // but those exceptions were never presented as a real life use-cases
- // and might be considered as more preferable results.
- //
- // This logic, however, is not guaranteed and can change at any point in the future
- offsetParent: function() {
- return this.map( function() {
- var offsetParent = this.offsetParent;
-
- while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
- offsetParent = offsetParent.offsetParent;
- }
-
- return offsetParent || documentElement;
- } );
- }
- } );
-
- // Create scrollLeft and scrollTop methods
- jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
- var top = "pageYOffset" === prop;
-
- jQuery.fn[ method ] = function( val ) {
- return access( this, function( elem, method, val ) {
- var win = getWindow( elem );
-
- if ( val === undefined ) {
- return win ? win[ prop ] : elem[ method ];
- }
-
- if ( win ) {
- win.scrollTo(
- !top ? val : win.pageXOffset,
- top ? val : win.pageYOffset
- );
-
- } else {
- elem[ method ] = val;
- }
- }, method, val, arguments.length );
- };
- } );
-
- // Support: Safari <=7 - 9.1, Chrome <=37 - 49
- // Add the top/left cssHooks using jQuery.fn.position
- // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
- // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
- // getComputedStyle returns percent when specified for top/left/bottom/right;
- // rather than make the css module depend on the offset module, just check for it here
- jQuery.each( [ "top", "left" ], function( i, prop ) {
- jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
- function( elem, computed ) {
- if ( computed ) {
- computed = curCSS( elem, prop );
-
- // If curCSS returns percentage, fallback to offset
- return rnumnonpx.test( computed ) ?
- jQuery( elem ).position()[ prop ] + "px" :
- computed;
- }
- }
- );
- } );
-
-
- // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
- jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
- function( defaultExtra, funcName ) {
-
- // Margin is only for outerHeight, outerWidth
- jQuery.fn[ funcName ] = function( margin, value ) {
- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
- return access( this, function( elem, type, value ) {
- var doc;
-
- if ( jQuery.isWindow( elem ) ) {
-
- // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
- return funcName.indexOf( "outer" ) === 0 ?
- elem[ "inner" + name ] :
- elem.document.documentElement[ "client" + name ];
- }
-
- // Get document width or height
- if ( elem.nodeType === 9 ) {
- doc = elem.documentElement;
-
- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
- // whichever is greatest
- return Math.max(
- elem.body[ "scroll" + name ], doc[ "scroll" + name ],
- elem.body[ "offset" + name ], doc[ "offset" + name ],
- doc[ "client" + name ]
- );
- }
-
- return value === undefined ?
-
- // Get width or height on the element, requesting but not forcing parseFloat
- jQuery.css( elem, type, extra ) :
-
- // Set width or height on the element
- jQuery.style( elem, type, value, extra );
- }, type, chainable ? margin : undefined, chainable );
- };
- } );
- } );
-
-
- jQuery.fn.extend( {
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
-
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length === 1 ?
- this.off( selector, "**" ) :
- this.off( types, selector || "**", fn );
- }
- } );
-
- jQuery.parseJSON = JSON.parse;
-
-
-
-
- // Register as a named AMD module, since jQuery can be concatenated with other
- // files that may use define, but not via a proper concatenation script that
- // understands anonymous AMD modules. A named AMD is safest and most robust
- // way to register. Lowercase jquery is used because AMD module names are
- // derived from file names, and jQuery is normally delivered in a lowercase
- // file name. Do this after creating the global so that if an AMD module wants
- // to call noConflict to hide this version of jQuery, it will work.
-
- // Note that for maximum portability, libraries that are not jQuery should
- // declare themselves as anonymous modules, and avoid setting a global if an
- // AMD loader is present. jQuery is a special case. For more information, see
- // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
-
- if ( true ) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
- return jQuery;
- }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- }
-
-
-
-
- var
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$;
-
- jQuery.noConflict = function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- };
-
- // Expose jQuery and $ identifiers, even in AMD
- // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
- // and CommonJS for browser emulators (#13566)
- if ( !noGlobal ) {
- window.jQuery = window.$ = jQuery;
- }
-
-
-
-
-
- return jQuery;
- } );
-
-
-/***/ },
-/* 6 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["$"] = __webpack_require__(5);
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
-
-/***/ },
-/* 7 */
-/***/ function(module, exports) {
-
- /*!
+webpackJsonp([1],[function(t,e,n){n(84),t.exports=n(174)},,function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(t,e,n){function r(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=u[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(l(r.parts[o],e))}else{for(var a=[],o=0;o<r.parts.length;o++)a.push(l(r.parts[o],e));u[r.id]={id:r.id,refs:1,parts:a}}}}function i(t){for(var e=[],n={},r=0;r<t.length;r++){var i=t[r],o=i[0],a=i[1],s=i[2],l=i[3],c={css:a,media:s,sourceMap:l};n[o]?n[o].parts.push(c):e.push(n[o]={id:o,parts:[c]})}return e}function o(t,e){var n=d(),r=m[m.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),m.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function a(t){t.parentNode.removeChild(t);var e=m.indexOf(t);e>=0&&m.splice(e,1)}function s(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function l(t,e){var n,r,i;if(e.singleton){var o=v++;n=g||(g=s(e)),r=c.bind(null,n,o,!1),i=c.bind(null,n,o,!0)}else n=s(e),r=f.bind(null,n),i=function(){a(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function c(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=y(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function f(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var u={},h=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},p=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),d=h(function(){return document.head||document.getElementsByTagName("head")[0]}),g=null,v=0,m=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=p()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=i(t);return r(n,e),function(t){for(var o=[],a=0;a<n.length;a++){var s=n[a],l=u[s.id];l.refs--,o.push(l)}if(t){var c=i(t);r(c,e)}for(var a=0;a<o.length;a++){var l=o[a];if(0===l.refs){for(var f=0;f<l.parts.length;f++)l.parts[f]();delete u[l.id]}}}};var y=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){var n="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},r="function"==typeof Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e},i=function(t){return"_"===t.substr(0,1)?t.slice(1):t},o=function(t){return"_t"===t?-1:"_"===t.substr(0,1)?parseInt(t.slice(1),10):parseInt(t,10)+.1},a=function(t,e){return o(t)-o(e)},s=function(){};s.prototype.format=function(t,e){var n={};return this.prepareContext(n),this.recurse(n,t,e),this.finalize(n)},s.prototype.prepareContext=function(t){t.buffer=[],t.out=function(){this.buffer.push.apply(this.buffer,arguments)}},s.prototype.typeFormattterNotFound=function(t,e){throw new Error("cannot format delta type: "+e)},s.prototype.typeFormattterErrorFormatter=function(t,e){return e.toString()},s.prototype.finalize=function(t){if(n(t.buffer))return t.buffer.join("")},s.prototype.recurse=function(t,e,n,r,i,o,a){var s=e&&o,l=s?o.value:n;if("undefined"!=typeof e||"undefined"!=typeof r){var c=this.getDeltaType(e,o),f="node"===c?"a"===e._t?"array":"object":"";"undefined"!=typeof r?this.nodeBegin(t,r,i,c,f,a):this.rootBegin(t,c,f);var u;try{u=this["format_"+c]||this.typeFormattterNotFound(t,c),u.call(this,t,e,l,r,i,o)}catch(n){this.typeFormattterErrorFormatter(t,n,e,l,r,i,o),"undefined"!=typeof console&&console.error&&console.error(n.stack)}"undefined"!=typeof r?this.nodeEnd(t,r,i,c,f,a):this.rootEnd(t,c,f)}},s.prototype.formatDeltaChildren=function(t,e,n){var r=this;this.forEachDeltaKey(e,n,function(i,o,a,s){r.recurse(t,e[i],n?n[o]:void 0,i,o,a,s)})},s.prototype.forEachDeltaKey=function(t,e,o){var s,l=r(t),c="a"===t._t,f={};if("undefined"!=typeof e)for(s in e)"undefined"!=typeof t[s]||c&&"undefined"!=typeof t["_"+s]||l.push(s);for(s in t){var u=t[s];n(u)&&3===u[2]&&(f[u[1].toString()]={key:s,value:e&&e[parseInt(s.substr(1))]},this.includeMoveDestinations!==!1&&"undefined"==typeof e&&"undefined"==typeof t[u[1]]&&l.push(u[1].toString()))}c?l.sort(a):l.sort();for(var h=0,p=l.length;h<p;h++){var d=l[h];if(!c||"_t"!==d){var g=c?"number"==typeof d?d:parseInt(i(d),10):d,v=h===p-1;o(d,g,f[g],v)}}},s.prototype.getDeltaType=function(t,e){if("undefined"==typeof t)return"undefined"!=typeof e?"movedestination":"unchanged";if(n(t)){if(1===t.length)return"added";if(2===t.length)return"modified";if(3===t.length&&0===t[2])return"deleted";if(3===t.length&&2===t[2])return"textdiff";if(3===t.length&&3===t[2])return"moved"}else if("object"==typeof t)return"node";return"unknown"},s.prototype.parseTextDiff=function(t){for(var e=[],n=t.split("\n@@ "),r=0,i=n.length;r<i;r++){var o=n[r],a={pieces:[]},s=/^(?:@@ )?[-+]?(\d+),(\d+)/.exec(o).slice(1);a.location={line:s[0],chr:s[1]};for(var l=o.split("\n").slice(1),c=0,f=l.length;c<f;c++){var u=l[c];if(u.length){var h={type:"context"};"+"===u.substr(0,1)?h.type="added":"-"===u.substr(0,1)&&(h.type="deleted"),h.text=u.slice(1),a.pieces.push(h)}}e.push(a)}return e},e.BaseFormatter=s},function(t,e){"use strict";function n(){}function r(t,e,n,r,i){for(var o=0,a=e.length,s=0,l=0;o<a;o++){var c=e[o];if(c.removed){if(c.value=t.join(r.slice(l,l+c.count)),l+=c.count,o&&e[o-1].added){var f=e[o-1];e[o-1]=e[o],e[o]=f}}else{if(!c.added&&i){var u=n.slice(s,s+c.count);u=u.map(function(t,e){var n=r[l+e];return n.length>t.length?n:t}),c.value=t.join(u)}else c.value=t.join(n.slice(s,s+c.count));s+=c.count,c.added||(l+=c.count)}}var h=e[a-1];return a>1&&(h.added||h.removed)&&t.equals("",h.value)&&(e[a-2].value+=h.value,e.pop()),e}function i(t){return{newPos:t.newPos,components:t.components.slice(0)}}e.__esModule=!0,e.default=n,n.prototype={diff:function(t,e){function n(t){return s?(setTimeout(function(){s(void 0,t)},0),!0):t}function o(){for(var o=-1*u;o<=u;o+=2){var a=void 0,s=p[o-1],h=p[o+1],d=(h?h.newPos:0)-o;s&&(p[o-1]=void 0);var g=s&&s.newPos+1<c,v=h&&0<=d&&d<f;if(g||v){if(!g||v&&s.newPos<h.newPos?(a=i(h),l.pushComponent(a.components,void 0,!0)):(a=s,a.newPos++,l.pushComponent(a.components,!0,void 0)),d=l.extractCommon(a,e,t,o),a.newPos+1>=c&&d+1>=f)return n(r(l,a.components,e,t,l.useLongestToken));p[o]=a}else p[o]=void 0}u++}var a=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],s=a.callback;"function"==typeof a&&(s=a,a={}),this.options=a;var l=this;t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t)),e=this.removeEmpty(this.tokenize(e));var c=e.length,f=t.length,u=1,h=c+f,p=[{newPos:-1,components:[]}],d=this.extractCommon(p[0],e,t,0);if(p[0].newPos+1>=c&&d+1>=f)return n([{value:this.join(e),count:e.length}]);if(s)!function t(){setTimeout(function(){return u>h?s():void(o()||t())},0)}();else for(;u<=h;){var g=o();if(g)return g}},pushComponent:function(t,e,n){var r=t[t.length-1];r&&r.added===e&&r.removed===n?t[t.length-1]={count:r.count+1,added:e,removed:n}:t.push({count:1,added:e,removed:n})},extractCommon:function(t,e,n,r){for(var i=e.length,o=n.length,a=t.newPos,s=a-r,l=0;a+1<i&&s+1<o&&this.equals(e[a+1],n[s+1]);)a++,s++,l++;return l&&t.components.push({count:l}),t.newPos=a,s},equals:function(t,e){return t===e},removeEmpty:function(t){for(var e=[],n=0;n<t.length;n++)t[n]&&e.push(t[n]);return e},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}}},function(t,e,n){var r,i,r,o;(function(){t.exports=0;!function(n){var o,a,s="0.4.2",l="hasOwnProperty",c=/[\.\/]/,f=/\s*,\s*/,u="*",h=function(t,e){return t-e},p={n:{}},d=function(){for(var t=0,e=this.length;t<e;t++)if("undefined"!=typeof this[t])return this[t]},g=function(){for(var t=this.length;--t;)if("undefined"!=typeof this[t])return this[t]},v=function(t,e){t=String(t);var n,r=a,i=Array.prototype.slice.call(arguments,2),s=v.listeners(t),l=0,c=[],f={},u=[],p=o;u.firstDefined=d,u.lastDefined=g,o=t,a=0;for(var m=0,y=s.length;m<y;m++)"zIndex"in s[m]&&(c.push(s[m].zIndex),s[m].zIndex<0&&(f[s[m].zIndex]=s[m]));for(c.sort(h);c[l]<0;)if(n=f[c[l++]],u.push(n.apply(e,i)),a)return a=r,u;for(m=0;m<y;m++)if(n=s[m],"zIndex"in n)if(n.zIndex==c[l]){if(u.push(n.apply(e,i)),a)break;do if(l++,n=f[c[l]],n&&u.push(n.apply(e,i)),a)break;while(n)}else f[n.zIndex]=n;else if(u.push(n.apply(e,i)),a)break;return a=r,o=p,u};v._events=p,v.listeners=function(t){var e,n,r,i,o,a,s,l,f=t.split(c),h=p,d=[h],g=[];for(i=0,o=f.length;i<o;i++){for(l=[],a=0,s=d.length;a<s;a++)for(h=d[a].n,n=[h[f[i]],h[u]],r=2;r--;)e=n[r],e&&(l.push(e),g=g.concat(e.f||[]));d=l}return g},v.on=function(t,e){if(t=String(t),"function"!=typeof e)return function(){};for(var n=t.split(f),r=0,i=n.length;r<i;r++)!function(t){for(var n,r=t.split(c),i=p,o=0,a=r.length;o<a;o++)i=i.n,i=i.hasOwnProperty(r[o])&&i[r[o]]||(i[r[o]]={n:{}});for(i.f=i.f||[],o=0,a=i.f.length;o<a;o++)if(i.f[o]==e){n=!0;break}!n&&i.f.push(e)}(n[r]);return function(t){+t==+t&&(e.zIndex=+t)}},v.f=function(t){var e=[].slice.call(arguments,1);return function(){v.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},v.stop=function(){a=1},v.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(o):o},v.nts=function(){return o.split(c)},v.off=v.unbind=function(t,e){if(!t)return void(v._events=p={n:{}});var n=t.split(f);if(n.length>1)for(var r=0,i=n.length;r<i;r++)v.off(n[r],e);else{n=t.split(c);var o,a,s,r,i,h,d,g=[p];for(r=0,i=n.length;r<i;r++)for(h=0;h<g.length;h+=s.length-2){if(s=[h,1],o=g[h].n,n[r]!=u)o[n[r]]&&s.push(o[n[r]]);else for(a in o)o[l](a)&&s.push(o[a]);g.splice.apply(g,s)}for(r=0,i=g.length;r<i;r++)for(o=g[r];o.n;){if(e){if(o.f){for(h=0,d=o.f.length;h<d;h++)if(o.f[h]==e){o.f.splice(h,1);break}!o.f.length&&delete o.f}for(a in o.n)if(o.n[l](a)&&o.n[a].f){var m=o.n[a].f;for(h=0,d=m.length;h<d;h++)if(m[h]==e){m.splice(h,1);break}!m.length&&delete o.n[a].f}}else{delete o.f;for(a in o.n)o.n[l](a)&&o.n[a].f&&delete o.n[a].f}o=o.n}}},v.once=function(t,e){var n=function(){return v.unbind(t,n),e.apply(this,arguments)};return v.on(t,n)},v.version=s,v.toString=function(){return"You are running Eve "+s},"undefined"!=typeof t&&t.exports?t.exports=v:(r=[],!(i=function(){return v}.apply(e,r)))}(this),function(n,a){r=[i],o=function(t){return a(n,t)}.apply(e,r),!(void 0!==o&&(t.exports=o))}(window||this,function(t,e){var n=function(e){var n={},r=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(t){setTimeout(t,16)},i=Array.isArray||function(t){return t instanceof Array||"[object Array]"==Object.prototype.toString.call(t)},o=0,a="M"+(+new Date).toString(36),s=function(){return a+(o++).toString(36)},l=Date.now||function(){return+new Date},c=function(t){var e=this;if(null==t)return e.s;var n=e.s-t;e.b+=e.dur*n,e.B+=e.dur*n,e.s=t},f=function(t){var e=this;return null==t?e.spd:void(e.spd=t)},u=function(t){var e=this;return null==t?e.dur:(e.s=e.s*t/e.dur,void(e.dur=t))},h=function(){var t=this;delete n[t.id],t.update(),e("mina.stop."+t.id,t)},p=function(){var t=this;t.pdif||(delete n[t.id],t.update(),t.pdif=t.get()-t.b)},d=function(){var t=this;t.pdif&&(t.b=t.get()-t.pdif,delete t.pdif,n[t.id]=t)},g=function(){var t,e=this;if(i(e.start)){t=[];for(var n=0,r=e.start.length;n<r;n++)t[n]=+e.start[n]+(e.end[n]-e.start[n])*e.easing(e.s)}else t=+e.start+(e.end-e.start)*e.easing(e.s);e.set(t)},v=function(){var t=0;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i],a=o.get();t++,o.s=(a-o.b)/(o.dur/o.spd),o.s>=1&&(delete n[i],o.s=1,t--,function(t){setTimeout(function(){e("mina.finish."+t.id,t)})}(o)),o.update()}t&&r(v)},m=function(t,e,i,o,a,l,y){var b={id:s(),start:t,end:e,b:i,s:0,dur:o-i,spd:1,get:a,set:l,easing:y||m.linear,status:c,speed:f,duration:u,stop:h,pause:p,resume:d,update:g};n[b.id]=b;var _,x=0;for(_ in n)if(n.hasOwnProperty(_)&&(x++,2==x))break;return 1==x&&r(v),b};return m.time=l,m.getById=function(t){return n[t]||null},m.linear=function(t){return t},m.easeout=function(t){return Math.pow(t,1.7)},m.easein=function(t){return Math.pow(t,.48)},m.easeinout=function(t){if(1==t)return 1;if(0==t)return 0;var e=.48-t/1.04,n=Math.sqrt(.1734+e*e),r=n-e,i=Math.pow(Math.abs(r),1/3)*(r<0?-1:1),o=-n-e,a=Math.pow(Math.abs(o),1/3)*(o<0?-1:1),s=i+a+.5;return 3*(1-s)*s*s+s*s*s},m.backin=function(t){if(1==t)return 1;var e=1.70158;return t*t*((e+1)*t-e)},m.backout=function(t){if(0==t)return 0;t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},m.elastic=function(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1},m.bounce=function(t){var e,n=7.5625,r=2.75;return t<1/r?e=n*t*t:t<2/r?(t-=1.5/r,e=n*t*t+.75):t<2.5/r?(t-=2.25/r,e=n*t*t+.9375):(t-=2.625/r,e=n*t*t+.984375),e},t.mina=m,m}("undefined"==typeof e?function(){}:e),r=function(t){function n(t,e){if(t){if(t.nodeType)return w(t);if(i(t,"array")&&n.set)return n.set.apply(n,t);if(t instanceof y)return t;if(null==e)return t=C.doc.querySelector(String(t)),w(t)}return t=null==t?"100%":t,e=null==e?"100%":e,new x(t,e)}function r(t,e){if(e){if("#text"==t&&(t=C.doc.createTextNode(e.text||e["#text"]||"")),"#comment"==t&&(t=C.doc.createComment(e.text||e["#text"]||"")),"string"==typeof t&&(t=r(t)),"string"==typeof e)return 1==t.nodeType?"xlink:"==e.substring(0,6)?t.getAttributeNS(U,e.substring(6)):"xml:"==e.substring(0,4)?t.getAttributeNS(W,e.substring(4)):t.getAttribute(e):"text"==e?t.nodeValue:null;if(1==t.nodeType){for(var n in e)if(e[T](n)){var i=j(e[n]);i?"xlink:"==n.substring(0,6)?t.setAttributeNS(U,n.substring(6),i):"xml:"==n.substring(0,4)?t.setAttributeNS(W,n.substring(4),i):t.setAttribute(n,i):t.removeAttribute(n)}}else"text"in e&&(t.nodeValue=e.text)}else t=C.doc.createElementNS(W,t);return t}function i(t,e){return e=j.prototype.toLowerCase.call(e),"finite"==e?isFinite(t):!("array"!=e||!(t instanceof Array||Array.isArray&&Array.isArray(t)))||("null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||F.call(t).slice(8,-1).toLowerCase()==e)}function o(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)t[T](n)&&(e[n]=o(t[n]));return e}function a(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}function s(t,e,n){function r(){var i=Array.prototype.slice.call(arguments,0),o=i.join("␀"),s=r.cache=r.cache||{},l=r.count=r.count||[];return s[T](o)?(a(l,o),n?n(s[o]):s[o]):(l.length>=1e3&&delete s[l.shift()],l.push(o),s[o]=t.apply(e,i),n?n(s[o]):s[o])}return r}function l(t,e,n,r,i,o){if(null==i){var a=t-n,s=e-r;return a||s?(180+180*S.atan2(-s,-a)/P+360)%360:0}return l(t,e,i,o)-l(n,r,i,o)}function c(t){return t%360*P/180}function f(t){return 180*t/P%360}function u(t){var e=[];return t=t.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(t,n,r){return r=r.split(/\s*,\s*|\s+/),"rotate"==n&&1==r.length&&r.push(0,0),"scale"==n&&(r.length>2?r=r.slice(0,2):2==r.length&&r.push(0,0),1==r.length&&r.push(r[0],0,0)),"skewX"==n?e.push(["m",1,0,S.tan(c(r[0])),1,0,0]):"skewY"==n?e.push(["m",1,S.tan(c(r[0])),0,1,0,0]):e.push([n.charAt(0)].concat(r)),t}),e}function h(t,e){var r=tt(t),i=new n.Matrix;if(r)for(var o=0,a=r.length;o<a;o++){var s,l,c,f,u,h=r[o],p=h.length,d=j(h[0]).toLowerCase(),g=h[0]!=d,v=g?i.invert():0;"t"==d&&2==p?i.translate(h[1],0):"t"==d&&3==p?g?(s=v.x(0,0),l=v.y(0,0),c=v.x(h[1],h[2]),f=v.y(h[1],h[2]),i.translate(c-s,f-l)):i.translate(h[1],h[2]):"r"==d?2==p?(u=u||e,i.rotate(h[1],u.x+u.width/2,u.y+u.height/2)):4==p&&(g?(c=v.x(h[2],h[3]),f=v.y(h[2],h[3]),i.rotate(h[1],c,f)):i.rotate(h[1],h[2],h[3])):"s"==d?2==p||3==p?(u=u||e,i.scale(h[1],h[p-1],u.x+u.width/2,u.y+u.height/2)):4==p?g?(c=v.x(h[2],h[3]),f=v.y(h[2],h[3]),i.scale(h[1],h[1],c,f)):i.scale(h[1],h[1],h[2],h[3]):5==p&&(g?(c=v.x(h[3],h[4]),f=v.y(h[3],h[4]),i.scale(h[1],h[2],c,f)):i.scale(h[1],h[2],h[3],h[4])):"m"==d&&7==p&&i.add(h[1],h[2],h[3],h[4],h[5],h[6])}return i}function p(t){var e=t.node.ownerSVGElement&&w(t.node.ownerSVGElement)||t.node.parentNode&&w(t.node.parentNode)||n.select("svg")||n(0,0),r=e.select("defs"),i=null!=r&&r.node;return i||(i=_("defs",e.node).node),i}function d(t){return t.node.ownerSVGElement&&w(t.node.ownerSVGElement)||n.select("svg")}function v(t,e,n){function i(t){if(null==t)return N;if(t==+t)return t;r(c,{width:t});try{return c.getBBox().width}catch(t){return 0}}function o(t){if(null==t)return N;if(t==+t)return t;r(c,{height:t});try{return c.getBBox().height}catch(t){return 0}}function a(r,i){null==e?l[r]=i(t.attr(r)||0):r==e&&(l=i(null==n?t.attr(r)||0:n))}var s=d(t).node,l={},c=s.querySelector(".svg---mgr");switch(c||(c=r("rect"),r(c,{x:-9e9,y:-9e9,width:10,height:10,class:"svg---mgr",fill:"none"}),s.appendChild(c)),t.type){case"rect":a("rx",i),a("ry",o);case"image":a("width",i),a("height",o);case"text":a("x",i),a("y",o);break;case"circle":a("cx",i),a("cy",o),a("r",i);break;case"ellipse":a("cx",i),a("cy",o),a("rx",i),a("ry",o);break;case"line":a("x1",i),a("x2",i),a("y1",o),a("y2",o);break;case"marker":a("refX",i),a("markerWidth",i),a("refY",o),a("markerHeight",o);break;case"radialGradient":a("fx",i),a("fy",o);break;case"tspan":a("dx",i),a("dy",o);break;default:a(e,i)}return s.removeChild(c),l}function m(t){i(t,"array")||(t=Array.prototype.slice.call(arguments,0));for(var e=0,n=0,r=this.node;this[e];)delete this[e++];for(e=0;e<t.length;e++)"set"==t[e].type?t[e].forEach(function(t){r.appendChild(t.node)}):r.appendChild(t[e].node);var o=r.childNodes;for(e=0;e<o.length;e++)this[n++]=w(o[e]);return this}function y(t){if(t.snap in Z)return Z[t.snap];var e;try{e=t.ownerSVGElement}catch(t){}this.node=t,e&&(this.paper=new x(e)),this.type=t.tagName||t.nodeName;var n=this.id=H(this);if(this.anims={},this._={transform:[]},t.snap=n,Z[n]=this,"g"==this.type&&(this.add=m),this.type in{g:1,mask:1,pattern:1,symbol:1})for(var r in x.prototype)x.prototype[T](r)&&(this[r]=x.prototype[r])}function b(t){this.node=t}function _(t,e){var n=r(t);e.appendChild(n);var i=w(n);return i}function x(t,e){var n,i,o,a=x.prototype;if(t&&"svg"==t.tagName){if(t.snap in Z)return Z[t.snap];var s=t.ownerDocument;n=new y(t),i=t.getElementsByTagName("desc")[0],o=t.getElementsByTagName("defs")[0],i||(i=r("desc"),i.appendChild(s.createTextNode("Created with Snap")),n.node.appendChild(i)),o||(o=r("defs"),n.node.appendChild(o)),n.defs=o;for(var l in a)a[T](l)&&(n[l]=a[l]);n.paper=n.root=n}else n=_("svg",C.doc.body),r(n.node,{height:e,version:1.1,width:t,xmlns:W});return n}function w(t){return t?t instanceof y||t instanceof b?t:t.tagName&&"svg"==t.tagName.toLowerCase()?new x(t):t.tagName&&"object"==t.tagName.toLowerCase()&&"image/svg+xml"==t.type?new x(t.contentDocument.getElementsByTagName("svg")[0]):new y(t):t}function k(t,e){for(var n=0,r=t.length;n<r;n++){var i={type:t[n].type,attr:t[n].attr()},o=t[n].children();e.push(i),o.length&&k(o,i.childNodes=[])}}n.version="0.4.0",n.toString=function(){return"Snap v"+this.version},n._={};var C={win:t.window,doc:t.window.document};n._.glob=C;var T="hasOwnProperty",j=String,$=parseFloat,A=parseInt,S=Math,O=S.max,M=S.min,E=S.abs,P=(S.pow,S.PI),N=(S.round,""),F=Object.prototype.toString,R=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,B=(n._.separator=/[,\s]+/,/[\s]*,[\s]*/),D={hs:1,rg:1},z=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,I=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,L=/(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/gi,q=0,V="S"+(+new Date).toString(36),H=function(t){return(t&&t.type?t.type:N)+V+(q++).toString(36)},U="http://www.w3.org/1999/xlink",W="http://www.w3.org/2000/svg",Z={};n.url=function(t){return"url('#"+t+"')"};n._.$=r,n._.id=H,n.format=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,n=function(t,n,r){var i=r;return n.replace(e,function(t,e,n,r,o){e=e||r,i&&(e in i&&(i=i[e]),"function"==typeof i&&o&&(i=i()))}),i=(null==i||i==r?t:i)+""};return function(e,r){return j(e).replace(t,function(t,e){return n(t,e,r)})}}(),n._.clone=o,n._.cacher=s,n.rad=c,n.deg=f,n.sin=function(t){return S.sin(n.rad(t))},n.tan=function(t){return S.tan(n.rad(t))},n.cos=function(t){return S.cos(n.rad(t))},n.asin=function(t){return n.deg(S.asin(t))},n.acos=function(t){return n.deg(S.acos(t))},n.atan=function(t){return n.deg(S.atan(t))},n.atan2=function(t){return n.deg(S.atan2(t))},n.angle=l,n.len=function(t,e,r,i){return Math.sqrt(n.len2(t,e,r,i))},n.len2=function(t,e,n,r){return(t-n)*(t-n)+(e-r)*(e-r)},n.closestPoint=function(t,e,n){function r(t){var r=t.x-e,i=t.y-n;return r*r+i*i}for(var i,o,a,s,l=t.node,c=l.getTotalLength(),f=c/l.pathSegList.numberOfItems*.125,u=1/0,h=0;h<=c;h+=f)(s=r(a=l.getPointAtLength(h)))<u&&(i=a,o=h,u=s);for(f*=.5;f>.5;){var p,d,g,v,m,y;(g=o-f)>=0&&(m=r(p=l.getPointAtLength(g)))<u?(i=p,o=g,u=m):(v=o+f)<=c&&(y=r(d=l.getPointAtLength(v)))<u?(i=d,o=v,u=y):f*=.5}return i={x:i.x,y:i.y,length:o,distance:Math.sqrt(u)}},n.is=i,n.snapTo=function(t,e,n){if(n=i(n,"finite")?n:10,i(t,"array")){for(var r=t.length;r--;)if(E(t[r]-e)<=n)return t[r]}else{t=+t;var o=e%t;if(o<n)return e-o;if(o>t-n)return e-o+t}return e},n.getRGB=s(function(t){if(!t||(t=j(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Y};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:Y};if(!(D[T](t.toLowerCase().substring(0,2))||"#"==t.charAt())&&(t=J(t)),!t)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Y};var e,r,o,a,s,l,c=t.match(R);return c?(c[2]&&(o=A(c[2].substring(5),16),r=A(c[2].substring(3,5),16),e=A(c[2].substring(1,3),16)),c[3]&&(o=A((s=c[3].charAt(3))+s,16),r=A((s=c[3].charAt(2))+s,16),e=A((s=c[3].charAt(1))+s,16)),c[4]&&(l=c[4].split(B),e=$(l[0]),"%"==l[0].slice(-1)&&(e*=2.55),r=$(l[1]),"%"==l[1].slice(-1)&&(r*=2.55),o=$(l[2]),"%"==l[2].slice(-1)&&(o*=2.55),"rgba"==c[1].toLowerCase().slice(0,4)&&(a=$(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100)),c[5]?(l=c[5].split(B),e=$(l[0]),"%"==l[0].slice(-1)&&(e/=100),r=$(l[1]),"%"==l[1].slice(-1)&&(r/=100),o=$(l[2]),"%"==l[2].slice(-1)&&(o/=100),("deg"==l[0].slice(-3)||"°"==l[0].slice(-1))&&(e/=360),"hsba"==c[1].toLowerCase().slice(0,4)&&(a=$(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),n.hsb2rgb(e,r,o,a)):c[6]?(l=c[6].split(B),e=$(l[0]),"%"==l[0].slice(-1)&&(e/=100),r=$(l[1]),"%"==l[1].slice(-1)&&(r/=100),o=$(l[2]),"%"==l[2].slice(-1)&&(o/=100),("deg"==l[0].slice(-3)||"°"==l[0].slice(-1))&&(e/=360),"hsla"==c[1].toLowerCase().slice(0,4)&&(a=$(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),n.hsl2rgb(e,r,o,a)):(e=M(S.round(e),255),r=M(S.round(r),255),o=M(S.round(o),255),a=M(O(a,0),1),c={r:e,g:r,b:o,toString:Y},c.hex="#"+(16777216|o|r<<8|e<<16).toString(16).slice(1),c.opacity=i(a,"finite")?a:1,c)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Y}},n),n.hsb=s(function(t,e,r){return n.hsb2rgb(t,e,r).hex}),n.hsl=s(function(t,e,r){return n.hsl2rgb(t,e,r).hex}),n.rgb=s(function(t,e,n,r){if(i(r,"finite")){var o=S.round;return"rgba("+[o(t),o(e),o(n),+r.toFixed(2)]+")"}return"#"+(16777216|n|e<<8|t<<16).toString(16).slice(1)});var J=function(t){var e=C.doc.getElementsByTagName("head")[0]||C.doc.getElementsByTagName("svg")[0],n="rgb(255, 0, 0)";return(J=s(function(t){if("red"==t.toLowerCase())return n;e.style.color=n,e.style.color=t;var r=C.doc.defaultView.getComputedStyle(e,N).getPropertyValue("color");return r==n?null:r}))(t)},G=function(){return"hsb("+[this.h,this.s,this.b]+")"},X=function(){return"hsl("+[this.h,this.s,this.l]+")"},Y=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},K=function(t,e,r){if(null==e&&i(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(r=t.b,e=t.g,t=t.r),null==e&&i(t,string)){var o=n.getRGB(t);t=o.r,e=o.g,r=o.b}return(t>1||e>1||r>1)&&(t/=255,e/=255,r/=255),[t,e,r]},Q=function(t,e,r,o){t=S.round(255*t),e=S.round(255*e),r=S.round(255*r);var a={r:t,g:e,b:r,opacity:i(o,"finite")?o:1,hex:n.rgb(t,e,r),toString:Y};return i(o,"finite")&&(a.opacity=o),a};n.color=function(t){var e;return i(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=n.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.opacity=1,t.hex=e.hex):i(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=n.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.opacity=1,t.hex=e.hex):(i(t,"string")&&(t=n.getRGB(t)),i(t,"object")&&"r"in t&&"g"in t&&"b"in t&&!("error"in t)?(e=n.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=n.rgb2hsb(t),t.v=e.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1,t.error=1)),t.toString=Y,t},n.hsb2rgb=function(t,e,n,r){i(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(n=t.b,e=t.s,r=t.o,t=t.h),t*=360;var o,a,s,l,c;return t=t%360/60,c=n*e,l=c*(1-E(t%2-1)),o=a=s=n-c,t=~~t,o+=[c,l,0,0,l,c][t],a+=[l,c,c,l,0,0][t],s+=[0,0,l,c,c,l][t],Q(o,a,s,r)},n.hsl2rgb=function(t,e,n,r){i(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(n=t.l,e=t.s,t=t.h),(t>1||e>1||n>1)&&(t/=360,e/=100,n/=100),t*=360;var o,a,s,l,c;return t=t%360/60,c=2*e*(n<.5?n:1-n),l=c*(1-E(t%2-1)),o=a=s=n-c/2,t=~~t,o+=[c,l,0,0,l,c][t],a+=[l,c,c,l,0,0][t],s+=[0,0,l,c,c,l][t],Q(o,a,s,r)},n.rgb2hsb=function(t,e,n){n=K(t,e,n),t=n[0],e=n[1],n=n[2];var r,i,o,a;return o=O(t,e,n),a=o-M(t,e,n),r=0==a?null:o==t?(e-n)/a:o==e?(n-t)/a+2:(t-e)/a+4,r=(r+360)%6*60/360,i=0==a?0:a/o,{h:r,s:i,b:o,toString:G}},n.rgb2hsl=function(t,e,n){n=K(t,e,n),t=n[0],e=n[1],n=n[2];var r,i,o,a,s,l;return a=O(t,e,n),s=M(t,e,n),l=a-s,r=0==l?null:a==t?(e-n)/l:a==e?(n-t)/l+2:(t-e)/l+4,r=(r+360)%6*60/360,o=(a+s)/2,i=0==l?0:o<.5?l/(2*o):l/(2-2*o),{h:r,s:i,l:o,toString:X}},n.parsePathString=function(t){if(!t)return null;var e=n.path(t);if(e.arr)return n.path.clone(e.arr);var r={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},o=[];return i(t,"array")&&i(t[0],"array")&&(o=n.path.clone(t)),o.length||j(t).replace(z,function(t,e,n){var i=[],a=e.toLowerCase();if(n.replace(L,function(t,e){e&&i.push(+e)}),"m"==a&&i.length>2&&(o.push([e].concat(i.splice(0,2))),a="l",e="m"==e?"l":"L"),"o"==a&&1==i.length&&o.push([e,i[0]]),"r"==a)o.push([e].concat(i));else for(;i.length>=r[a]&&(o.push([e].concat(i.splice(0,r[a]))),r[a]););}),o.toString=n.path.toString,e.arr=n.path.clone(o),o};var tt=n.parseTransformString=function(t){if(!t)return null;var e=[];return i(t,"array")&&i(t[0],"array")&&(e=n.path.clone(t)),e.length||j(t).replace(I,function(t,n,r){var i=[];n.toLowerCase();r.replace(L,function(t,e){e&&i.push(+e)}),e.push([n].concat(i))}),e.toString=n.path.toString,e};n._.svgTransform2string=u,n._.rgTransform=/^[a-z][\s]*-?\.?\d/i,n._.transform2matrix=h,n._unit2px=v;C.doc.contains||C.doc.compareDocumentPosition?function(t,e){var n=9==t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t==r||!(!r||1!=r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e;)if(e=e.parentNode,e==t)return!0;return!1};n._.getSomeDefs=p,n._.getSomeSVG=d,n.select=function(t){return t=j(t).replace(/([^\\]):/g,"$1\\:"),w(C.doc.querySelector(t))},n.selectAll=function(t){for(var e=C.doc.querySelectorAll(t),r=(n.set||Array)(),i=0;i<e.length;i++)r.push(w(e[i]));return r},setInterval(function(){for(var t in Z)if(Z[T](t)){var e=Z[t],n=e.node;("svg"!=e.type&&!n.ownerSVGElement||"svg"==e.type&&(!n.parentNode||"ownerSVGElement"in n.parentNode&&!n.ownerSVGElement))&&delete Z[t]}},1e4),y.prototype.attr=function(t,n){var r=this,o=r.node;if(!t){if(1!=o.nodeType)return{text:o.nodeValue};for(var a=o.attributes,s={},l=0,c=a.length;l<c;l++)s[a[l].nodeName]=a[l].nodeValue;return s}if(i(t,"string")){if(!(arguments.length>1))return e("snap.util.getattr."+t,r).firstDefined();var f={};f[t]=n,t=f}for(var u in t)t[T](u)&&e("snap.util.attr."+u,r,t[u]);return r},n.parse=function(t){var e=C.doc.createDocumentFragment(),n=!0,r=C.doc.createElement("div");if(t=j(t),t.match(/^\s*<\s*svg(?:\s|>)/)||(t="<svg>"+t+"</svg>",n=!1),r.innerHTML=t,t=r.getElementsByTagName("svg")[0])if(n)e=t;else for(;t.firstChild;)e.appendChild(t.firstChild);return new b(e)},n.fragment=function(){for(var t=Array.prototype.slice.call(arguments,0),e=C.doc.createDocumentFragment(),r=0,i=t.length;r<i;r++){var o=t[r];o.node&&o.node.nodeType&&e.appendChild(o.node),o.nodeType&&e.appendChild(o),"string"==typeof o&&e.appendChild(n.parse(o).node)}return new b(e)},n._.make=_,n._.wrap=w,x.prototype.el=function(t,e){var n=_(t,this.node);return e&&n.attr(e),n},y.prototype.children=function(){for(var t=[],e=this.node.childNodes,r=0,i=e.length;r<i;r++)t[r]=n(e[r]);return t},y.prototype.toJSON=function(){var t=[];return k([this],t),t[0]},e.on("snap.util.getattr",function(){var t=e.nt();t=t.substring(t.lastIndexOf(".")+1);var n=t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()});return et[T](n)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(n):r(this.node,t)});var et={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};e.on("snap.util.attr",function(t){var n=e.nt(),i={};n=n.substring(n.lastIndexOf(".")+1),i[n]=t;var o=n.replace(/-(\w)/gi,function(t,e){return e.toUpperCase()}),a=n.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()});et[T](a)?this.node.style[o]=null==t?N:t:r(this.node,i)}),function(t){}(x.prototype),n.ajax=function(t,n,r,o){var a=new XMLHttpRequest,s=H();if(a){if(i(n,"function"))o=r,r=n,n=null;else if(i(n,"object")){var l=[];for(var c in n)n.hasOwnProperty(c)&&l.push(encodeURIComponent(c)+"="+encodeURIComponent(n[c]));n=l.join("&")}return a.open(n?"POST":"GET",t,!0),n&&(a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.setRequestHeader("Content-type","application/x-www-form-urlencoded")),r&&(e.once("snap.ajax."+s+".0",r),e.once("snap.ajax."+s+".200",r),e.once("snap.ajax."+s+".304",r)),a.onreadystatechange=function(){4==a.readyState&&e("snap.ajax."+s+"."+a.status,o,a)},4==a.readyState?a:(a.send(n),a)}},n.load=function(t,e,r){n.ajax(t,function(t){var i=n.parse(t.responseText);r?e.call(r,i):e(i)})};var nt=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.body,i=n.documentElement,o=i.clientTop||r.clientTop||0,a=i.clientLeft||r.clientLeft||0,s=e.top+(g.win.pageYOffset||i.scrollTop||r.scrollTop)-o,l=e.left+(g.win.pageXOffset||i.scrollLeft||r.scrollLeft)-a;
+return{y:s,x:l}};return n.getElementByPoint=function(t,e){var n=this,r=(n.canvas,C.doc.elementFromPoint(t,e));if(C.win.opera&&"svg"==r.tagName){var i=nt(r),o=r.createSVGRect();o.x=t-i.x,o.y=e-i.y,o.width=o.height=1;var a=r.getIntersectionList(o,null);a.length&&(r=a[a.length-1])}return r?w(r):null},n.plugin=function(t){t(n,y,x,C,b)},C.win.Snap=n,n}(t||this);return r.plugin(function(r,i,o,a,s){function l(t,e){if(null==e){var n=!0;if(e="linearGradient"==t.type||"radialGradient"==t.type?t.node.getAttribute("gradientTransform"):"pattern"==t.type?t.node.getAttribute("patternTransform"):t.node.getAttribute("transform"),!e)return new r.Matrix;e=r._.svgTransform2string(e)}else e=r._.rgTransform.test(e)?d(e).replace(/\.{3}|\u2026/g,t._.transform||E):r._.svgTransform2string(e),p(e,"array")&&(e=r.path?r.path.toString.call(e):d(e)),t._.transform=e;var i=r._.transform2matrix(e,t.getBBox(1));return n?i:void(t.matrix=i)}function c(t){function e(t,e){var n=v(t.node,e);n=n&&n.match(o),n=n&&n[2],n&&"#"==n.charAt()&&(n=n.substring(1),n&&(s[n]=(s[n]||[]).concat(function(n){var r={};r[e]=URL(n),v(t.node,r)})))}function n(t){var e=v(t.node,"xlink:href");e&&"#"==e.charAt()&&(e=e.substring(1),e&&(s[e]=(s[e]||[]).concat(function(e){t.attr("xlink:href","#"+e)})))}for(var r,i=t.selectAll("*"),o=/^\s*url\(("|'|)(.*)\1\)\s*$/,a=[],s={},l=0,c=i.length;l<c;l++){r=i[l],e(r,"fill"),e(r,"stroke"),e(r,"filter"),e(r,"mask"),e(r,"clip-path"),n(r);var f=v(r.node,"id");f&&(v(r.node,{id:r.id}),a.push({old:f,id:r.id}))}for(l=0,c=a.length;l<c;l++){var u=s[a[l].old];if(u)for(var h=0,p=u.length;h<p;h++)u[h](a[l].id)}}function f(t,e,n){return function(r){var i=r.slice(t,e);return 1==i.length&&(i=i[0]),n?n(i):i}}function u(t){return function(){var e=t?"<"+this.type:"",n=this.node.attributes,r=this.node.childNodes;if(t)for(var i=0,o=n.length;i<o;i++)e+=" "+n[i].name+'="'+n[i].value.replace(/"/g,'\\"')+'"';if(r.length){for(t&&(e+=">"),i=0,o=r.length;i<o;i++)3==r[i].nodeType?e+=r[i].nodeValue:1==r[i].nodeType&&(e+=_(r[i]).toString());t&&(e+="</"+this.type+">")}else t&&(e+="/>");return e}}var h=i.prototype,p=r.is,d=String,g=r._unit2px,v=r._.$,m=r._.make,y=r._.getSomeDefs,b="hasOwnProperty",_=r._.wrap;h.getBBox=function(t){if(!r.Matrix||!r.path)return this.node.getBBox();var e=this,n=new r.Matrix;if(e.removed)return r._.box();for(;"use"==e.type;)if(t||(n=n.add(e.transform().localMatrix.translate(e.attr("x")||0,e.attr("y")||0))),e.original)e=e.original;else{var i=e.attr("xlink:href");e=e.original=e.node.ownerDocument.getElementById(i.substring(i.indexOf("#")+1))}var o=e._,a=r.path.get[e.type]||r.path.get.deflt;try{return t?(o.bboxwt=a?r.path.getBBox(e.realPath=a(e)):r._.box(e.node.getBBox()),r._.box(o.bboxwt)):(e.realPath=a(e),e.matrix=e.transform().localMatrix,o.bbox=r.path.getBBox(r.path.map(e.realPath,n.add(e.matrix))),r._.box(o.bbox))}catch(t){return r._.box()}};var x=function(){return this.string};h.transform=function(t){var e=this._;if(null==t){for(var n,i=this,o=new r.Matrix(this.node.getCTM()),a=l(this),s=[a],c=new r.Matrix,f=a.toTransformString(),u=d(a)==d(this.matrix)?d(e.transform):f;"svg"!=i.type&&(i=i.parent());)s.push(l(i));for(n=s.length;n--;)c.add(s[n]);return{string:u,globalMatrix:o,totalMatrix:c,localMatrix:a,diffMatrix:o.clone().add(a.invert()),global:o.toTransformString(),total:c.toTransformString(),local:f,toString:x}}return t instanceof r.Matrix?(this.matrix=t,this._.transform=t.toTransformString()):l(this,t),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?v(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?v(this.node,{patternTransform:this.matrix}):v(this.node,{transform:this.matrix})),this},h.parent=function(){return _(this.node.parentNode)},h.append=h.add=function(t){if(t){if("set"==t.type){var e=this;return t.forEach(function(t){e.add(t)}),this}t=_(t),this.node.appendChild(t.node),t.paper=this.paper}return this},h.appendTo=function(t){return t&&(t=_(t),t.append(this)),this},h.prepend=function(t){if(t){if("set"==t.type){var e,n=this;return t.forEach(function(t){e?e.after(t):n.prepend(t),e=t}),this}t=_(t);var r=t.parent();this.node.insertBefore(t.node,this.node.firstChild),this.add&&this.add(),t.paper=this.paper,this.parent()&&this.parent().add(),r&&r.add()}return this},h.prependTo=function(t){return t=_(t),t.prepend(this),this},h.before=function(t){if("set"==t.type){var e=this;return t.forEach(function(t){var n=t.parent();e.node.parentNode.insertBefore(t.node,e.node),n&&n.add()}),this.parent().add(),this}t=_(t);var n=t.parent();return this.node.parentNode.insertBefore(t.node,this.node),this.parent()&&this.parent().add(),n&&n.add(),t.paper=this.paper,this},h.after=function(t){t=_(t);var e=t.parent();return this.node.nextSibling?this.node.parentNode.insertBefore(t.node,this.node.nextSibling):this.node.parentNode.appendChild(t.node),this.parent()&&this.parent().add(),e&&e.add(),t.paper=this.paper,this},h.insertBefore=function(t){t=_(t);var e=this.parent();return t.node.parentNode.insertBefore(this.node,t.node),this.paper=t.paper,e&&e.add(),t.parent()&&t.parent().add(),this},h.insertAfter=function(t){t=_(t);var e=this.parent();return t.node.parentNode.insertBefore(this.node,t.node.nextSibling),this.paper=t.paper,e&&e.add(),t.parent()&&t.parent().add(),this},h.remove=function(){var t=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,t&&t.add(),this},h.select=function(t){return t=d(t).replace(/([^\\]):/g,"$1\\:"),_(this.node.querySelector(t))},h.selectAll=function(t){for(var e=this.node.querySelectorAll(t),n=(r.set||Array)(),i=0;i<e.length;i++)n.push(_(e[i]));return n},h.asPX=function(t,e){return null==e&&(e=this.attr(t)),+g(this,t,e)},h.use=function(){var t,e=this.node.id;return e||(e=this.id,v(this.node,{id:e})),t="linearGradient"==this.type||"radialGradient"==this.type||"pattern"==this.type?m(this.type,this.node.parentNode):m("use",this.node.parentNode),v(t.node,{"xlink:href":"#"+e}),t.original=this,t},h.clone=function(){var t=_(this.node.cloneNode(!0));return v(t.node,"id")&&v(t.node,{id:t.id}),c(t),t.insertAfter(this),t},h.toDefs=function(){var t=y(this);return t.appendChild(this.node),this},h.pattern=h.toPattern=function(t,e,n,r){var i=m("pattern",y(this));return null==t&&(t=this.getBBox()),p(t,"object")&&"x"in t&&(e=t.y,n=t.width,r=t.height,t=t.x),v(i.node,{x:t,y:e,width:n,height:r,patternUnits:"userSpaceOnUse",id:i.id,viewBox:[t,e,n,r].join(" ")}),i.node.appendChild(this.node),i},h.marker=function(t,e,n,r,i,o){var a=m("marker",y(this));return null==t&&(t=this.getBBox()),p(t,"object")&&"x"in t&&(e=t.y,n=t.width,r=t.height,i=t.refX||t.cx,o=t.refY||t.cy,t=t.x),v(a.node,{viewBox:[t,e,n,r].join(" "),markerWidth:n,markerHeight:r,orient:"auto",refX:i||0,refY:o||0,id:a.id}),a.node.appendChild(this.node),a};var w=function(t,e,r,i){"function"!=typeof r||r.length||(i=r,r=n.linear),this.attr=t,this.dur=e,r&&(this.easing=r),i&&(this.callback=i)};r._.Animation=w,r.animation=function(t,e,n,r){return new w(t,e,n,r)},h.inAnim=function(){var t=this,e=[];for(var n in t.anims)t.anims[b](n)&&!function(t){e.push({anim:new w(t._attrs,t.dur,t.easing,t._callback),mina:t,curStatus:t.status(),status:function(e){return t.status(e)},stop:function(){t.stop()}})}(t.anims[n]);return e},r.animate=function(t,r,i,o,a,s){"function"!=typeof a||a.length||(s=a,a=n.linear);var l=n.time(),c=n(t,r,l,l+o,n.time,i,a);return s&&e.once("mina.finish."+c.id,s),c},h.stop=function(){for(var t=this.inAnim(),e=0,n=t.length;e<n;e++)t[e].stop();return this},h.animate=function(t,r,i,o){"function"!=typeof i||i.length||(o=i,i=n.linear),t instanceof w&&(o=t.callback,i=t.easing,r=i.dur,t=t.attr);var a,s,l,c,u=[],h=[],g={},v=this;for(var m in t)if(t[b](m)){v.equal?(c=v.equal(m,d(t[m])),a=c.from,s=c.to,l=c.f):(a=+v.attr(m),s=+t[m]);var y=p(a,"array")?a.length:1;g[m]=f(u.length,u.length+y,l),u=u.concat(a),h=h.concat(s)}var _=n.time(),x=n(u,h,_,_+r,n.time,function(t){var e={};for(var n in g)g[b](n)&&(e[n]=g[n](t));v.attr(e)},i);return v.anims[x.id]=x,x._attrs=t,x._callback=o,e("snap.animcreated."+v.id,x),e.once("mina.finish."+x.id,function(){delete v.anims[x.id],o&&o.call(v)}),e.once("mina.stop."+x.id,function(){delete v.anims[x.id]}),v};var k={};h.data=function(t,n){var i=k[this.id]=k[this.id]||{};if(0==arguments.length)return e("snap.data.get."+this.id,this,i,null),i;if(1==arguments.length){if(r.is(t,"object")){for(var o in t)t[b](o)&&this.data(o,t[o]);return this}return e("snap.data.get."+this.id,this,i[t],t),i[t]}return i[t]=n,e("snap.data.set."+this.id,this,n,t),this},h.removeData=function(t){return null==t?k[this.id]={}:k[this.id]&&delete k[this.id][t],this},h.outerSVG=h.toString=u(1),h.innerSVG=u(),h.toDataURL=function(){if(t&&t.btoa){var e=this.getBBox(),n=r.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>',{x:+e.x.toFixed(3),y:+e.y.toFixed(3),width:+e.width.toFixed(3),height:+e.height.toFixed(3),contents:this.outerSVG()});return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(n)))}},s.prototype.select=h.select,s.prototype.selectAll=h.selectAll}),r.plugin(function(t,e,n,r,i){function o(t,e,n,r,i,o){return null==e&&"[object SVGMatrix]"==a.call(t)?(this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,void(this.f=t.f)):void(null!=t?(this.a=+t,this.b=+e,this.c=+n,this.d=+r,this.e=+i,this.f=+o):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0))}var a=Object.prototype.toString,s=String,l=Math,c="";!function(e){function n(t){return t[0]*t[0]+t[1]*t[1]}function r(t){var e=l.sqrt(n(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}e.add=function(t,e,n,r,i,a){var s,l,c,f,u=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],p=[[t,n,i],[e,r,a],[0,0,1]];for(t&&t instanceof o&&(p=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),s=0;s<3;s++)for(l=0;l<3;l++){for(f=0,c=0;c<3;c++)f+=h[s][c]*p[c][l];u[s][l]=f}return this.a=u[0][0],this.b=u[1][0],this.c=u[0][1],this.d=u[1][1],this.e=u[0][2],this.f=u[1][2],this},e.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new o(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},e.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},e.translate=function(t,e){return this.add(1,0,0,1,t,e)},e.scale=function(t,e,n,r){return null==e&&(e=t),(n||r)&&this.add(1,0,0,1,n,r),this.add(t,0,0,e,0,0),(n||r)&&this.add(1,0,0,1,-n,-r),this},e.rotate=function(e,n,r){e=t.rad(e),n=n||0,r=r||0;var i=+l.cos(e).toFixed(9),o=+l.sin(e).toFixed(9);return this.add(i,o,-o,i,n,r),this.add(1,0,0,1,-n,-r)},e.x=function(t,e){return t*this.a+e*this.c+this.e},e.y=function(t,e){return t*this.b+e*this.d+this.f},e.get=function(t){return+this[s.fromCharCode(97+t)].toFixed(4)},e.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},e.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},e.determinant=function(){return this.a*this.d-this.b*this.c},e.split=function(){var e={};e.dx=this.e,e.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];e.scalex=l.sqrt(n(i[0])),r(i[0]),e.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*e.shear,i[1][1]-i[0][1]*e.shear],e.scaley=l.sqrt(n(i[1])),r(i[1]),e.shear/=e.scaley,this.determinant()<0&&(e.scalex=-e.scalex);var o=-i[0][1],a=i[1][1];return a<0?(e.rotate=t.deg(l.acos(a)),o<0&&(e.rotate=360-e.rotate)):e.rotate=t.deg(l.asin(o)),e.isSimple=!(+e.shear.toFixed(9)||e.scalex.toFixed(9)!=e.scaley.toFixed(9)&&e.rotate),e.isSuperSimple=!+e.shear.toFixed(9)&&e.scalex.toFixed(9)==e.scaley.toFixed(9)&&!e.rotate,e.noRotation=!+e.shear.toFixed(9)&&!e.rotate,e},e.toTransformString=function(t){var e=t||this.split();return+e.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[+e.dx.toFixed(4),+e.dy.toFixed(4)]:c)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:c)+(e.rotate?"r"+[+e.rotate.toFixed(4),0,0]:c))}}(o.prototype),t.Matrix=o,t.matrix=function(t,e,n,r,i,a){return new o(t,e,n,r,i,a)}}),r.plugin(function(t,n,r,i,o){function a(r){return function(i){if(e.stop(),i instanceof o&&1==i.node.childNodes.length&&("radialGradient"==i.node.firstChild.tagName||"linearGradient"==i.node.firstChild.tagName||"pattern"==i.node.firstChild.tagName)&&(i=i.node.firstChild,p(this).appendChild(i),i=u(i)),i instanceof n)if("radialGradient"==i.type||"linearGradient"==i.type||"pattern"==i.type){i.node.id||g(i.node,{id:i.id});var a=v(i.node.id)}else a=i.attr(r);else if(a=t.color(i),a.error){var s=t(p(this).ownerSVGElement).gradient(i);s?(s.node.id||g(s.node,{id:s.id}),a=v(s.node.id)):a=i}else a=m(a);var l={};l[r]=a,g(this.node,l),this.node.style[r]=b}}function s(t){e.stop(),t==+t&&(t+="px"),this.node.style.fontSize=t}function l(t){for(var e=[],n=t.childNodes,r=0,i=n.length;r<i;r++){var o=n[r];3==o.nodeType&&e.push(o.nodeValue),"tspan"==o.tagName&&(1==o.childNodes.length&&3==o.firstChild.nodeType?e.push(o.firstChild.nodeValue):e.push(l(o)))}return e}function c(){return e.stop(),this.node.style.fontSize}var f=t._.make,u=t._.wrap,h=t.is,p=t._.getSomeDefs,d=/^url\(#?([^)]+)\)$/,g=t._.$,v=t.url,m=String,y=t._.separator,b="";e.on("snap.util.attr.mask",function(t){if(t instanceof n||t instanceof o){if(e.stop(),t instanceof o&&1==t.node.childNodes.length&&(t=t.node.firstChild,p(this).appendChild(t),t=u(t)),"mask"==t.type)var r=t;else r=f("mask",p(this)),r.node.appendChild(t.node);!r.node.id&&g(r.node,{id:r.id}),g(this.node,{mask:v(r.id)})}}),function(t){e.on("snap.util.attr.clip",t),e.on("snap.util.attr.clip-path",t),e.on("snap.util.attr.clipPath",t)}(function(t){if(t instanceof n||t instanceof o){if(e.stop(),"clipPath"==t.type)var r=t;else r=f("clipPath",p(this)),r.node.appendChild(t.node),!r.node.id&&g(r.node,{id:r.id});g(this.node,{"clip-path":v(r.node.id||r.id)})}}),e.on("snap.util.attr.fill",a("fill")),e.on("snap.util.attr.stroke",a("stroke"));var _=/^([lr])(?:\(([^)]*)\))?(.*)$/i;e.on("snap.util.grad.parse",function(t){t=m(t);var e=t.match(_);if(!e)return null;var n=e[1],r=e[2],i=e[3];return r=r.split(/\s*,\s*/).map(function(t){return+t==t?+t:t}),1==r.length&&0==r[0]&&(r=[]),i=i.split("-"),i=i.map(function(t){t=t.split(":");var e={color:t[0]};return t[1]&&(e.offset=parseFloat(t[1])),e}),{type:n,params:r,stops:i}}),e.on("snap.util.attr.d",function(n){e.stop(),h(n,"array")&&h(n[0],"array")&&(n=t.path.toString.call(n)),n=m(n),n.match(/[ruo]/i)&&(n=t.path.toAbsolute(n)),g(this.node,{d:n})})(-1),e.on("snap.util.attr.#text",function(t){e.stop(),t=m(t);for(var n=i.doc.createTextNode(t);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(n)})(-1),e.on("snap.util.attr.path",function(t){e.stop(),this.attr({d:t})})(-1),e.on("snap.util.attr.class",function(t){e.stop(),this.node.className.baseVal=t})(-1),e.on("snap.util.attr.viewBox",function(t){var n;n=h(t,"object")&&"x"in t?[t.x,t.y,t.width,t.height].join(" "):h(t,"array")?t.join(" "):t,g(this.node,{viewBox:n}),e.stop()})(-1),e.on("snap.util.attr.transform",function(t){this.transform(t),e.stop()})(-1),e.on("snap.util.attr.r",function(t){"rect"==this.type&&(e.stop(),g(this.node,{rx:t,ry:t}))})(-1),e.on("snap.util.attr.textpath",function(t){if(e.stop(),"text"==this.type){var r,i,o;if(!t&&this.textPath){for(i=this.textPath;i.node.firstChild;)this.node.appendChild(i.node.firstChild);return i.remove(),void delete this.textPath}if(h(t,"string")){var a=p(this),s=u(a.parentNode).path(t);a.appendChild(s.node),r=s.id,s.attr({id:r})}else t=u(t),t instanceof n&&(r=t.attr("id"),r||(r=t.id,t.attr({id:r})));if(r)if(i=this.textPath,o=this.node,i)i.attr({"xlink:href":"#"+r});else{for(i=g("textPath",{"xlink:href":"#"+r});o.firstChild;)i.appendChild(o.firstChild);o.appendChild(i),this.textPath=u(i)}}})(-1),e.on("snap.util.attr.text",function(t){if("text"==this.type){for(var n=this.node,r=function(t){var e=g("tspan");if(h(t,"array"))for(var n=0;n<t.length;n++)e.appendChild(r(t[n]));else e.appendChild(i.doc.createTextNode(t));return e.normalize&&e.normalize(),e};n.firstChild;)n.removeChild(n.firstChild);for(var o=r(t);o.firstChild;)n.appendChild(o.firstChild)}e.stop()})(-1),e.on("snap.util.attr.fontSize",s)(-1),e.on("snap.util.attr.font-size",s)(-1),e.on("snap.util.getattr.transform",function(){return e.stop(),this.transform()})(-1),e.on("snap.util.getattr.textpath",function(){return e.stop(),this.textPath})(-1),function(){function n(n){return function(){e.stop();var r=i.doc.defaultView.getComputedStyle(this.node,null).getPropertyValue("marker-"+n);return"none"==r?r:t(i.doc.getElementById(r.match(d)[1]))}}function r(t){return function(n){e.stop();var r="marker"+t.charAt(0).toUpperCase()+t.substring(1);if(""==n||!n)return void(this.node.style[r]="none");if("marker"==n.type){var i=n.node.id;return i||g(n.node,{id:n.id}),void(this.node.style[r]=v(i))}}}e.on("snap.util.getattr.marker-end",n("end"))(-1),e.on("snap.util.getattr.markerEnd",n("end"))(-1),e.on("snap.util.getattr.marker-start",n("start"))(-1),e.on("snap.util.getattr.markerStart",n("start"))(-1),e.on("snap.util.getattr.marker-mid",n("mid"))(-1),e.on("snap.util.getattr.markerMid",n("mid"))(-1),e.on("snap.util.attr.marker-end",r("end"))(-1),e.on("snap.util.attr.markerEnd",r("end"))(-1),e.on("snap.util.attr.marker-start",r("start"))(-1),e.on("snap.util.attr.markerStart",r("start"))(-1),e.on("snap.util.attr.marker-mid",r("mid"))(-1),e.on("snap.util.attr.markerMid",r("mid"))(-1)}(),e.on("snap.util.getattr.r",function(){if("rect"==this.type&&g(this.node,"rx")==g(this.node,"ry"))return e.stop(),g(this.node,"rx")})(-1),e.on("snap.util.getattr.text",function(){if("text"==this.type||"tspan"==this.type){e.stop();var t=l(this.node);return 1==t.length?t[0]:t}})(-1),e.on("snap.util.getattr.#text",function(){return this.node.textContent})(-1),e.on("snap.util.getattr.viewBox",function(){e.stop();var n=g(this.node,"viewBox");return n?(n=n.split(y),t._.box(+n[0],+n[1],+n[2],+n[3])):void 0})(-1),e.on("snap.util.getattr.points",function(){var t=g(this.node,"points");return e.stop(),t?t.split(y):void 0})(-1),e.on("snap.util.getattr.path",function(){var t=g(this.node,"d");return e.stop(),t})(-1),e.on("snap.util.getattr.class",function(){return this.node.className.baseVal})(-1),e.on("snap.util.getattr.fontSize",c)(-1),e.on("snap.util.getattr.font-size",c)(-1)}),r.plugin(function(t,e,n,r,i){var o=/\S+/g,a=String,s=e.prototype;s.addClass=function(t){var e,n,r,i,s=a(t||"").match(o)||[],l=this.node,c=l.className.baseVal,f=c.match(o)||[];if(s.length){for(e=0;r=s[e++];)n=f.indexOf(r),~n||f.push(r);i=f.join(" "),c!=i&&(l.className.baseVal=i)}return this},s.removeClass=function(t){var e,n,r,i,s=a(t||"").match(o)||[],l=this.node,c=l.className.baseVal,f=c.match(o)||[];if(f.length){for(e=0;r=s[e++];)n=f.indexOf(r),~n&&f.splice(n,1);i=f.join(" "),c!=i&&(l.className.baseVal=i)}return this},s.hasClass=function(t){var e=this.node,n=e.className.baseVal,r=n.match(o)||[];return!!~r.indexOf(t)},s.toggleClass=function(t,e){if(null!=e)return e?this.addClass(t):this.removeClass(t);var n,r,i,a,s=(t||"").match(o)||[],l=this.node,c=l.className.baseVal,f=c.match(o)||[];for(n=0;i=s[n++];)r=f.indexOf(i),~r?f.splice(r,1):f.push(i);return a=f.join(" "),c!=a&&(l.className.baseVal=a),this}}),r.plugin(function(t,n,r,i,o){function a(t){return t}function s(t){return function(e){return+e.toFixed(3)+t}}var l={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"/":function(t,e){return t/e},"*":function(t,e){return t*e}},c=String,f=/[a-z]+$/i,u=/^\s*([+\-\/*])\s*=\s*([\d.eE+\-]+)\s*([^\d\s]+)?\s*$/;e.on("snap.util.attr",function(t){var n=c(t).match(u);if(n){var r=e.nt(),i=r.substring(r.lastIndexOf(".")+1),o=this.attr(i),a={};e.stop();var s=n[3]||"",h=o.match(f),p=l[n[1]];if(h&&h==s?t=p(parseFloat(o),+n[2]):(o=this.asPX(i),t=p(this.asPX(i),this.asPX(i,n[2]+s))),isNaN(o)||isNaN(t))return;a[i]=t,this.attr(a)}})(-10),e.on("snap.util.equal",function(t,n){var r=c(this.attr(t)||""),i=c(n).match(u);if(i){e.stop();var o=i[3]||"",h=r.match(f),p=l[i[1]];return h&&h==o?{from:parseFloat(r),to:p(parseFloat(r),+i[2]),f:s(h)}:(r=this.asPX(t),{from:r,to:p(r,this.asPX(t,i[2]+o)),f:a})}})(-10)}),r.plugin(function(n,r,i,o,a){var s=i.prototype,l=n.is;s.rect=function(t,e,n,r,i,o){var a;return null==o&&(o=i),l(t,"object")&&"[object Object]"==t?a=t:null!=t&&(a={x:t,y:e,width:n,height:r},null!=i&&(a.rx=i,a.ry=o)),this.el("rect",a)},s.circle=function(t,e,n){var r;return l(t,"object")&&"[object Object]"==t?r=t:null!=t&&(r={cx:t,cy:e,r:n}),this.el("circle",r)};var c=function(){function t(){this.parentNode.removeChild(this)}return function(e,n){var r=o.doc.createElement("img"),i=o.doc.body;r.style.cssText="position:absolute;left:-9999em;top:-9999em",r.onload=function(){n.call(r),r.onload=r.onerror=null,i.removeChild(r)},r.onerror=t,i.appendChild(r),r.src=e}}();s.image=function(t,e,r,i,o){var a=this.el("image");if(l(t,"object")&&"src"in t)a.attr(t);else if(null!=t){var s={"xlink:href":t,preserveAspectRatio:"none"};null!=e&&null!=r&&(s.x=e,s.y=r),null!=i&&null!=o?(s.width=i,s.height=o):c(t,function(){n._.$(a.node,{width:this.offsetWidth,height:this.offsetHeight})}),n._.$(a.node,s)}return a},s.ellipse=function(t,e,n,r){var i;return l(t,"object")&&"[object Object]"==t?i=t:null!=t&&(i={cx:t,cy:e,rx:n,ry:r}),this.el("ellipse",i)},s.path=function(t){var e;return l(t,"object")&&!l(t,"array")?e=t:t&&(e={d:t}),this.el("path",e)},s.group=s.g=function(t){var e=this.el("g");return 1==arguments.length&&t&&!t.type?e.attr(t):arguments.length&&e.add(Array.prototype.slice.call(arguments,0)),e},s.svg=function(t,e,n,r,i,o,a,s){var c={};return l(t,"object")&&null==e?c=t:(null!=t&&(c.x=t),null!=e&&(c.y=e),null!=n&&(c.width=n),null!=r&&(c.height=r),null!=i&&null!=o&&null!=a&&null!=s&&(c.viewBox=[i,o,a,s])),this.el("svg",c)},s.mask=function(t){var e=this.el("mask");return 1==arguments.length&&t&&!t.type?e.attr(t):arguments.length&&e.add(Array.prototype.slice.call(arguments,0)),e},s.ptrn=function(t,e,n,r,i,o,a,s){if(l(t,"object"))var c=t;else c={patternUnits:"userSpaceOnUse"},t&&(c.x=t),e&&(c.y=e),null!=n&&(c.width=n),null!=r&&(c.height=r),null!=i&&null!=o&&null!=a&&null!=s?c.viewBox=[i,o,a,s]:c.viewBox=[t||0,e||0,n||0,r||0];return this.el("pattern",c)},s.use=function(t){return null!=t?(t instanceof r&&(t.attr("id")||t.attr({id:n._.id(t)}),t=t.attr("id")),"#"==String(t).charAt()&&(t=t.substring(1)),this.el("use",{"xlink:href":"#"+t})):r.prototype.use.call(this)},s.symbol=function(t,e,n,r){var i={};return null!=t&&null!=e&&null!=n&&null!=r&&(i.viewBox=[t,e,n,r]),this.el("symbol",i)},s.text=function(t,e,n){var r={};return l(t,"object")?r=t:null!=t&&(r={x:t,y:e,text:n||""}),this.el("text",r)},s.line=function(t,e,n,r){var i={};return l(t,"object")?i=t:null!=t&&(i={x1:t,x2:n,y1:e,y2:r}),this.el("line",i)},s.polyline=function(t){arguments.length>1&&(t=Array.prototype.slice.call(arguments,0));var e={};return l(t,"object")&&!l(t,"array")?e=t:null!=t&&(e={points:t}),this.el("polyline",e)},s.polygon=function(t){arguments.length>1&&(t=Array.prototype.slice.call(arguments,0));var e={};return l(t,"object")&&!l(t,"array")?e=t:null!=t&&(e={points:t}),this.el("polygon",e)},function(){function r(){return this.selectAll("stop")}function i(t,e){var r=f("stop"),i={offset:+e+"%"};return t=n.color(t),i["stop-color"]=t.hex,t.opacity<1&&(i["stop-opacity"]=t.opacity),f(r,i),this.node.appendChild(r),this}function o(){if("linearGradient"==this.type){var t=f(this.node,"x1")||0,e=f(this.node,"x2")||1,r=f(this.node,"y1")||0,i=f(this.node,"y2")||0;return n._.box(t,r,math.abs(e-t),math.abs(i-r))}var o=this.node.cx||.5,a=this.node.cy||.5,s=this.node.r||0;return n._.box(o-s,a-s,2*s,2*s)}function a(t,n){function r(t,e){for(var n=(e-u)/(t-h),r=h;r<t;r++)a[r].offset=+(+u+n*(r-h)).toFixed(2);h=t,u=e}var i,o=e("snap.util.grad.parse",null,n).firstDefined();if(!o)return null;o.params.unshift(t),i="l"==o.type.toLowerCase()?l.apply(0,o.params):c.apply(0,o.params),o.type!=o.type.toLowerCase()&&f(i.node,{gradientUnits:"userSpaceOnUse"});var a=o.stops,s=a.length,u=0,h=0;s--;for(var p=0;p<s;p++)"offset"in a[p]&&r(p,a[p].offset);for(a[s].offset=a[s].offset||100,r(s,a[s].offset),p=0;p<=s;p++){var d=a[p];i.addStop(d.color,d.offset)}return i}function l(t,e,a,s,l){var c=n._.make("linearGradient",t);return c.stops=r,c.addStop=i,c.getBBox=o,null!=e&&f(c.node,{x1:e,y1:a,x2:s,y2:l}),c}function c(t,e,a,s,l,c){var u=n._.make("radialGradient",t);return u.stops=r,u.addStop=i,u.getBBox=o,null!=e&&f(u.node,{cx:e,cy:a,r:s}),null!=l&&null!=c&&f(u.node,{fx:l,fy:c}),u}var f=n._.$;s.gradient=function(t){return a(this.defs,t)},s.gradientLinear=function(t,e,n,r){return l(this.defs,t,e,n,r)},s.gradientRadial=function(t,e,n,r,i){return c(this.defs,t,e,n,r,i)},s.toString=function(){var t,e=this.node.ownerDocument,r=e.createDocumentFragment(),i=e.createElement("div"),o=this.node.cloneNode(!0);return r.appendChild(i),i.appendChild(o),n._.$(o,{xmlns:"http://www.w3.org/2000/svg"}),t=i.innerHTML,r.removeChild(r.firstChild),t},s.toDataURL=function(){if(t&&t.btoa)return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this)))},s.clear=function(){for(var t,e=this.node.firstChild;e;)t=e.nextSibling,"defs"!=e.tagName?e.parentNode.removeChild(e):s.clear.call({node:e}),e=t}}()}),r.plugin(function(t,e,n,r){function i(t){var e=i.ps=i.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var n in e)e[D](n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])}),e[t]}function o(t,e,n,r){return null==t&&(t=e=n=r=0),null==e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:L.min(n,r)/2,r2:L.max(n,r)/2,r0:L.sqrt(n*n+r*r)/2,path:C(t,e,n,r),vb:[t,e,n,r].join(" ")}}function a(){return this.join(",").replace(z,"$1")}function s(t){var e=B(t);return e.toString=a,e}function l(t,e,n,r,i,o,a,s,l){return null==l?g(t,e,n,r,i,o,a,s):f(t,e,n,r,i,o,a,s,v(t,e,n,r,i,o,a,s,l))}function c(n,r){function i(t){return+(+t).toFixed(3)}return t._.cacher(function(t,o,a){t instanceof e&&(t=t.attr("d")),t=E(t);for(var s,c,u,h,p,d="",g={},v=0,m=0,y=t.length;m<y;m++){if(u=t[m],"M"==u[0])s=+u[1],c=+u[2];else{if(h=l(s,c,u[1],u[2],u[3],u[4],u[5],u[6]),v+h>o){if(r&&!g.start){if(p=l(s,c,u[1],u[2],u[3],u[4],u[5],u[6],o-v),d+=["C"+i(p.start.x),i(p.start.y),i(p.m.x),i(p.m.y),i(p.x),i(p.y)],a)return d;g.start=d,d=["M"+i(p.x),i(p.y)+"C"+i(p.n.x),i(p.n.y),i(p.end.x),i(p.end.y),i(u[5]),i(u[6])].join(),v+=h,s=+u[5],c=+u[6];continue}if(!n&&!r)return p=l(s,c,u[1],u[2],u[3],u[4],u[5],u[6],o-v)}v+=h,s=+u[5],c=+u[6]}d+=u.shift()+u}return g.end=d,p=n?v:r?g:f(s,c,u[0],u[1],u[2],u[3],u[4],u[5],1)},null,t._.clone)}function f(t,e,n,r,i,o,a,s,l){var c=1-l,f=U(c,3),u=U(c,2),h=l*l,p=h*l,d=f*t+3*u*l*n+3*c*l*l*i+p*a,g=f*e+3*u*l*r+3*c*l*l*o+p*s,v=t+2*l*(n-t)+h*(i-2*n+t),m=e+2*l*(r-e)+h*(o-2*r+e),y=n+2*l*(i-n)+h*(a-2*i+n),b=r+2*l*(o-r)+h*(s-2*o+r),_=c*t+l*n,x=c*e+l*r,w=c*i+l*a,k=c*o+l*s,C=90-180*L.atan2(v-y,m-b)/q;return{x:d,y:g,m:{x:v,y:m},n:{x:y,y:b},start:{x:_,y:x},end:{x:w,y:k},alpha:C}}function u(e,n,r,i,a,s,l,c){t.is(e,"array")||(e=[e,n,r,i,a,s,l,c]);var f=M.apply(null,e);return o(f.min.x,f.min.y,f.max.x-f.min.x,f.max.y-f.min.y)}function h(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function p(t,e){return t=o(t),e=o(e),h(e,t.x,t.y)||h(e,t.x2,t.y)||h(e,t.x,t.y2)||h(e,t.x2,t.y2)||h(t,e.x,e.y)||h(t,e.x2,e.y)||h(t,e.x,e.y2)||h(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)}function d(t,e,n,r,i){var o=-3*e+9*n-9*r+3*i,a=t*o+6*e-12*n+6*r;return t*a-3*e+3*n}function g(t,e,n,r,i,o,a,s,l){null==l&&(l=1),l=l>1?1:l<0?0:l;for(var c=l/2,f=12,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,g=0;g<f;g++){var v=c*u[g]+c,m=d(v,t,n,i,a),y=d(v,e,r,o,s),b=m*m+y*y;p+=h[g]*L.sqrt(b)}return c*p}function v(t,e,n,r,i,o,a,s,l){if(!(l<0||g(t,e,n,r,i,o,a,s)<l)){var c,f=1,u=f/2,h=f-u,p=.01;for(c=g(t,e,n,r,i,o,a,s,h);W(c-l)>p;)u/=2,h+=(c<l?1:-1)*u,c=g(t,e,n,r,i,o,a,s,h);return h}}function m(t,e,n,r,i,o,a,s){if(!(H(t,n)<V(i,a)||V(t,n)>H(i,a)||H(e,r)<V(o,s)||V(e,r)>H(o,s))){var l=(t*r-e*n)*(i-a)-(t-n)*(i*s-o*a),c=(t*r-e*n)*(o-s)-(e-r)*(i*s-o*a),f=(t-n)*(o-s)-(e-r)*(i-a);if(f){var u=l/f,h=c/f,p=+u.toFixed(2),d=+h.toFixed(2);if(!(p<+V(t,n).toFixed(2)||p>+H(t,n).toFixed(2)||p<+V(i,a).toFixed(2)||p>+H(i,a).toFixed(2)||d<+V(e,r).toFixed(2)||d>+H(e,r).toFixed(2)||d<+V(o,s).toFixed(2)||d>+H(o,s).toFixed(2)))return{x:u,y:h}}}}function y(t,e,n){var r=u(t),i=u(e);if(!p(r,i))return n?0:[];for(var o=g.apply(0,t),a=g.apply(0,e),s=~~(o/8),l=~~(a/8),c=[],h=[],d={},v=n?0:[],y=0;y<s+1;y++){var b=f.apply(0,t.concat(y/s));c.push({x:b.x,y:b.y,t:y/s})}for(y=0;y<l+1;y++)b=f.apply(0,e.concat(y/l)),h.push({x:b.x,y:b.y,t:y/l});for(y=0;y<s;y++)for(var _=0;_<l;_++){var x=c[y],w=c[y+1],k=h[_],C=h[_+1],T=W(w.x-x.x)<.001?"y":"x",j=W(C.x-k.x)<.001?"y":"x",$=m(x.x,x.y,w.x,w.y,k.x,k.y,C.x,C.y);if($){if(d[$.x.toFixed(4)]==$.y.toFixed(4))continue;d[$.x.toFixed(4)]=$.y.toFixed(4);var A=x.t+W(($[T]-x[T])/(w[T]-x[T]))*(w.t-x.t),S=k.t+W(($[j]-k[j])/(C[j]-k[j]))*(C.t-k.t);A>=0&&A<=1&&S>=0&&S<=1&&(n?v++:v.push({x:$.x,y:$.y,t1:A,t2:S}))}}return v}function b(t,e){return x(t,e)}function _(t,e){return x(t,e,1)}function x(t,e,n){t=E(t),e=E(e);for(var r,i,o,a,s,l,c,f,u,h,p=n?0:[],d=0,g=t.length;d<g;d++){var v=t[d];if("M"==v[0])r=s=v[1],i=l=v[2];else{"C"==v[0]?(u=[r,i].concat(v.slice(1)),r=u[6],i=u[7]):(u=[r,i,r,i,s,l,s,l],r=s,i=l);for(var m=0,b=e.length;m<b;m++){var _=e[m];if("M"==_[0])o=c=_[1],a=f=_[2];else{"C"==_[0]?(h=[o,a].concat(_.slice(1)),o=h[6],a=h[7]):(h=[o,a,o,a,c,f,c,f],o=c,a=f);var x=y(u,h,n);if(n)p+=x;else{for(var w=0,k=x.length;w<k;w++)x[w].segment1=d,x[w].segment2=m,x[w].bez1=u,x[w].bez2=h;p=p.concat(x)}}}}}return p}function w(t,e,n){var r=k(t);return h(r,e,n)&&x(t,[["M",e,n],["H",r.x2+10]],1)%2==1}function k(t){var e=i(t);if(e.bbox)return B(e.bbox);if(!t)return o();t=E(t);for(var n,r=0,a=0,s=[],l=[],c=0,f=t.length;c<f;c++)if(n=t[c],"M"==n[0])r=n[1],a=n[2],s.push(r),l.push(a);else{var u=M(r,a,n[1],n[2],n[3],n[4],n[5],n[6]);s=s.concat(u.min.x,u.max.x),l=l.concat(u.min.y,u.max.y),r=n[5],a=n[6]}var h=V.apply(0,s),p=V.apply(0,l),d=H.apply(0,s),g=H.apply(0,l),v=o(h,p,d-h,g-p);return e.bbox=B(v),v}function C(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.toString=a,o}function T(t,e,n,r,i){if(null==i&&null==r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!=i)var o=Math.PI/180,s=t+n*Math.cos(-r*o),l=t+n*Math.cos(-i*o),c=e+n*Math.sin(-r*o),f=e+n*Math.sin(-i*o),u=[["M",s,c],["A",n,n,0,+(i-r>180),0,l,f]];else u=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return u.toString=a,u}function j(e){var n=i(e),r=String.prototype.toLowerCase;if(n.rel)return s(n.rel);t.is(e,"array")&&t.is(e&&e[0],"array")||(e=t.parsePathString(e));var o=[],l=0,c=0,f=0,u=0,h=0;"M"==e[0][0]&&(l=e[0][1],c=e[0][2],f=l,u=c,h++,o.push(["M",l,c]));for(var p=h,d=e.length;p<d;p++){var g=o[p]=[],v=e[p];if(v[0]!=r.call(v[0]))switch(g[0]=r.call(v[0]),g[0]){case"a":g[1]=v[1],g[2]=v[2],g[3]=v[3],g[4]=v[4],g[5]=v[5],g[6]=+(v[6]-l).toFixed(3),g[7]=+(v[7]-c).toFixed(3);break;case"v":g[1]=+(v[1]-c).toFixed(3);break;case"m":f=v[1],u=v[2];default:for(var m=1,y=v.length;m<y;m++)g[m]=+(v[m]-(m%2?l:c)).toFixed(3)}else{g=o[p]=[],"m"==v[0]&&(f=v[1]+l,u=v[2]+c);for(var b=0,_=v.length;b<_;b++)o[p][b]=v[b]}var x=o[p].length;switch(o[p][0]){case"z":l=f,c=u;break;case"h":l+=+o[p][x-1];break;case"v":c+=+o[p][x-1];break;default:l+=+o[p][x-2],c+=+o[p][x-1]}}return o.toString=a,n.rel=s(o),o}function $(e){var n=i(e);if(n.abs)return s(n.abs);if(R(e,"array")&&R(e&&e[0],"array")||(e=t.parsePathString(e)),!e||!e.length)return[["M",0,0]];var r,o=[],l=0,c=0,f=0,u=0,h=0;
+"M"==e[0][0]&&(l=+e[0][1],c=+e[0][2],f=l,u=c,h++,o[0]=["M",l,c]);for(var p,d,g=3==e.length&&"M"==e[0][0]&&"R"==e[1][0].toUpperCase()&&"Z"==e[2][0].toUpperCase(),v=h,m=e.length;v<m;v++){if(o.push(p=[]),d=e[v],r=d[0],r!=r.toUpperCase())switch(p[0]=r.toUpperCase(),p[0]){case"A":p[1]=d[1],p[2]=d[2],p[3]=d[3],p[4]=d[4],p[5]=d[5],p[6]=+d[6]+l,p[7]=+d[7]+c;break;case"V":p[1]=+d[1]+c;break;case"H":p[1]=+d[1]+l;break;case"R":for(var y=[l,c].concat(d.slice(1)),b=2,_=y.length;b<_;b++)y[b]=+y[b]+l,y[++b]=+y[b]+c;o.pop(),o=o.concat(N(y,g));break;case"O":o.pop(),y=T(l,c,d[1],d[2]),y.push(y[0]),o=o.concat(y);break;case"U":o.pop(),o=o.concat(T(l,c,d[1],d[2],d[3])),p=["U"].concat(o[o.length-1].slice(-2));break;case"M":f=+d[1]+l,u=+d[2]+c;default:for(b=1,_=d.length;b<_;b++)p[b]=+d[b]+(b%2?l:c)}else if("R"==r)y=[l,c].concat(d.slice(1)),o.pop(),o=o.concat(N(y,g)),p=["R"].concat(d.slice(-2));else if("O"==r)o.pop(),y=T(l,c,d[1],d[2]),y.push(y[0]),o=o.concat(y);else if("U"==r)o.pop(),o=o.concat(T(l,c,d[1],d[2],d[3])),p=["U"].concat(o[o.length-1].slice(-2));else for(var x=0,w=d.length;x<w;x++)p[x]=d[x];if(r=r.toUpperCase(),"O"!=r)switch(p[0]){case"Z":l=+f,c=+u;break;case"H":l=p[1];break;case"V":c=p[1];break;case"M":f=p[p.length-2],u=p[p.length-1];default:l=p[p.length-2],c=p[p.length-1]}}return o.toString=a,n.abs=s(o),o}function A(t,e,n,r){return[t,e,n,r,n,r]}function S(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}function O(e,n,r,i,o,a,s,l,c,f){var u,h=120*q/180,p=q/180*(+o||0),d=[],g=t._.cacher(function(t,e,n){var r=t*L.cos(n)-e*L.sin(n),i=t*L.sin(n)+e*L.cos(n);return{x:r,y:i}});if(f)C=f[0],T=f[1],w=f[2],k=f[3];else{u=g(e,n,-p),e=u.x,n=u.y,u=g(l,c,-p),l=u.x,c=u.y;var v=(L.cos(q/180*o),L.sin(q/180*o),(e-l)/2),m=(n-c)/2,y=v*v/(r*r)+m*m/(i*i);y>1&&(y=L.sqrt(y),r*=y,i*=y);var b=r*r,_=i*i,x=(a==s?-1:1)*L.sqrt(W((b*_-b*m*m-_*v*v)/(b*m*m+_*v*v))),w=x*r*m/i+(e+l)/2,k=x*-i*v/r+(n+c)/2,C=L.asin(((n-k)/i).toFixed(9)),T=L.asin(((c-k)/i).toFixed(9));C=e<w?q-C:C,T=l<w?q-T:T,C<0&&(C=2*q+C),T<0&&(T=2*q+T),s&&C>T&&(C-=2*q),!s&&T>C&&(T-=2*q)}var j=T-C;if(W(j)>h){var $=T,A=l,S=c;T=C+h*(s&&T>C?1:-1),l=w+r*L.cos(T),c=k+i*L.sin(T),d=O(l,c,r,i,o,0,s,A,S,[T,$,w,k])}j=T-C;var M=L.cos(C),E=L.sin(C),P=L.cos(T),N=L.sin(T),F=L.tan(j/4),R=4/3*r*F,B=4/3*i*F,D=[e,n],z=[e+R*E,n-B*M],I=[l+R*N,c-B*P],V=[l,c];if(z[0]=2*D[0]-z[0],z[1]=2*D[1]-z[1],f)return[z,I,V].concat(d);d=[z,I,V].concat(d).join().split(",");for(var H=[],U=0,Z=d.length;U<Z;U++)H[U]=U%2?g(d[U-1],d[U],p).y:g(d[U],d[U+1],p).x;return H}function M(t,e,n,r,i,o,a,s){for(var l,c,f,u,h,p,d,g,v=[],m=[[],[]],y=0;y<2;++y)if(0==y?(c=6*t-12*n+6*i,l=-3*t+9*n-9*i+3*a,f=3*n-3*t):(c=6*e-12*r+6*o,l=-3*e+9*r-9*o+3*s,f=3*r-3*e),W(l)<1e-12){if(W(c)<1e-12)continue;u=-f/c,0<u&&u<1&&v.push(u)}else d=c*c-4*f*l,g=L.sqrt(d),d<0||(h=(-c+g)/(2*l),0<h&&h<1&&v.push(h),p=(-c-g)/(2*l),0<p&&p<1&&v.push(p));for(var b,_=v.length,x=_;_--;)u=v[_],b=1-u,m[0][_]=b*b*b*t+3*b*b*u*n+3*b*u*u*i+u*u*u*a,m[1][_]=b*b*b*e+3*b*b*u*r+3*b*u*u*o+u*u*u*s;return m[0][x]=t,m[1][x]=e,m[0][x+1]=a,m[1][x+1]=s,m[0].length=m[1].length=x+2,{min:{x:V.apply(0,m[0]),y:V.apply(0,m[1])},max:{x:H.apply(0,m[0]),y:H.apply(0,m[1])}}}function E(t,e){var n=!e&&i(t);if(!e&&n.curve)return s(n.curve);for(var r=$(t),o=e&&$(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},l={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},c=(function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(O.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i].concat(t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(S(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(S(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(A(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(A(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(A(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(A(e.x,e.y,e.X,e.Y))}return t}),f=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)h[e]="A",o&&(p[e]="A"),t.splice(e++,0,["C"].concat(n.splice(0,6)));t.splice(e,1),m=H(r.length,o&&o.length||0)}},u=function(t,e,n,i,a){t&&e&&"M"==t[a][0]&&"M"!=e[a][0]&&(e.splice(a,0,["M",i.x,i.y]),n.bx=0,n.by=0,n.x=t[a][1],n.y=t[a][2],m=H(r.length,o&&o.length||0))},h=[],p=[],d="",g="",v=0,m=H(r.length,o&&o.length||0);v<m;v++){r[v]&&(d=r[v][0]),"C"!=d&&(h[v]=d,v&&(g=h[v-1])),r[v]=c(r[v],a,g),"A"!=h[v]&&"C"==d&&(h[v]="C"),f(r,v),o&&(o[v]&&(d=o[v][0]),"C"!=d&&(p[v]=d,v&&(g=p[v-1])),o[v]=c(o[v],l,g),"A"!=p[v]&&"C"==d&&(p[v]="C"),f(o,v)),u(r,o,a,l,v),u(o,r,l,a,v);var y=r[v],b=o&&o[v],_=y.length,x=o&&b.length;a.x=y[_-2],a.y=y[_-1],a.bx=I(y[_-4])||a.x,a.by=I(y[_-3])||a.y,l.bx=o&&(I(b[x-4])||l.x),l.by=o&&(I(b[x-3])||l.y),l.x=o&&b[x-2],l.y=o&&b[x-1]}return o||(n.curve=s(r)),o?[r,o]:r}function P(t,e){if(!e)return t;var n,r,i,o,a,s,l;for(t=E(t),i=0,a=t.length;i<a;i++)for(l=t[i],o=1,s=l.length;o<s;o+=2)n=e.x(l[o],l[o+1]),r=e.y(l[o],l[o+1]),l[o]=n,l[o+1]=r;return t}function N(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4==r?o[3]={x:+t[0],y:+t[1]}:i-2==r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4==r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}var F=e.prototype,R=t.is,B=t._.clone,D="hasOwnProperty",z=/,?([a-z]),?/gi,I=parseFloat,L=Math,q=L.PI,V=L.min,H=L.max,U=L.pow,W=L.abs,Z=c(1),J=c(),G=c(0,1),X=t._unit2px,Y={path:function(t){return t.attr("path")},circle:function(t){var e=X(t);return T(e.cx,e.cy,e.r)},ellipse:function(t){var e=X(t);return T(e.cx||0,e.cy||0,e.rx,e.ry)},rect:function(t){var e=X(t);return C(e.x||0,e.y||0,e.width,e.height,e.rx,e.ry)},image:function(t){var e=X(t);return C(e.x||0,e.y||0,e.width,e.height)},line:function(t){return"M"+[t.attr("x1")||0,t.attr("y1")||0,t.attr("x2"),t.attr("y2")]},polyline:function(t){return"M"+t.attr("points")},polygon:function(t){return"M"+t.attr("points")+"z"},deflt:function(t){var e=t.node.getBBox();return C(e.x,e.y,e.width,e.height)}};t.path=i,t.path.getTotalLength=Z,t.path.getPointAtLength=J,t.path.getSubpath=function(t,e,n){if(this.getTotalLength(t)-n<1e-6)return G(t,e).end;var r=G(t,n,1);return e?G(r,e).end:r},F.getTotalLength=function(){if(this.node.getTotalLength)return this.node.getTotalLength()},F.getPointAtLength=function(t){return J(this.attr("d"),t)},F.getSubpath=function(e,n){return t.path.getSubpath(this.attr("d"),e,n)},t._.box=o,t.path.findDotsAtSegment=f,t.path.bezierBBox=u,t.path.isPointInsideBBox=h,t.closest=function(e,n,r,i){for(var a=100,s=o(e-a/2,n-a/2,a,a),l=[],c=r[0].hasOwnProperty("x")?function(t){return{x:r[t].x,y:r[t].y}}:function(t){return{x:r[t],y:i[t]}},f=0;a<=1e6&&!f;){for(var u=0,p=r.length;u<p;u++){var d=c(u);if(h(s,d.x,d.y)){f++,l.push(d);break}}f||(a*=2,s=o(e-a/2,n-a/2,a,a))}if(1e6!=a){var g,v=1/0;for(u=0,p=l.length;u<p;u++){var m=t.len(e,n,l[u].x,l[u].y);v>m&&(v=m,l[u].len=m,g=l[u])}return g}},t.path.isBBoxIntersect=p,t.path.intersection=b,t.path.intersectionNumber=_,t.path.isPointInside=w,t.path.getBBox=k,t.path.get=Y,t.path.toRelative=j,t.path.toAbsolute=$,t.path.toCubic=E,t.path.map=P,t.path.toString=a,t.path.clone=s}),r.plugin(function(t,r,i,o){var a=Math.max,s=Math.min,l=function(t){if(this.items=[],this.bindings={},this.length=0,this.type="set",t)for(var e=0,n=t.length;e<n;e++)t[e]&&(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},c=l.prototype;c.push=function(){for(var t,e,n=0,r=arguments.length;n<r;n++)t=arguments[n],t&&(e=this.items.length,this[e]=this.items[e]=t,this.length++);return this},c.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},c.forEach=function(t,e){for(var n=0,r=this.items.length;n<r;n++)if(t.call(e,this.items[n],n)===!1)return this;return this},c.animate=function(r,i,o,a){"function"!=typeof o||o.length||(a=o,o=n.linear),r instanceof t._.Animation&&(a=r.callback,o=r.easing,i=o.dur,r=r.attr);var s=arguments;if(t.is(r,"array")&&t.is(s[s.length-1],"array"))var l=!0;var c,f=function(){c?this.b=c:c=this.b},u=0,h=this,p=a&&function(){++u==h.length&&a.call(this)};return this.forEach(function(t,n){e.once("snap.animcreated."+t.id,f),l?s[n]&&t.animate.apply(t,s[n]):t.animate(r,i,o,p)})},c.remove=function(){for(;this.length;)this.pop().remove();return this},c.bind=function(t,e,n){var r={};if("function"==typeof e)this.bindings[t]=e;else{var i=n||t;this.bindings[t]=function(t){r[i]=t,e.attr(r)}}return this},c.attr=function(t){var e={};for(var n in t)this.bindings[n]?this.bindings[n](t[n]):e[n]=t[n];for(var r=0,i=this.items.length;r<i;r++)this.items[r].attr(e);return this},c.clear=function(){for(;this.length;)this.pop()},c.splice=function(t,e,n){t=t<0?a(this.length+t,0):t,e=a(0,s(this.length-t,e));var r,i=[],o=[],c=[];for(r=2;r<arguments.length;r++)c.push(arguments[r]);for(r=0;r<e;r++)o.push(this[t+r]);for(;r<this.length-t;r++)i.push(this[t+r]);var f=c.length;for(r=0;r<f+i.length;r++)this.items[t+r]=this[t+r]=r<f?c[r]:i[r-f];for(r=this.items.length=this.length-=e-f;this[r];)delete this[r++];return new l(o)},c.exclude=function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]==t)return this.splice(e,1),!0;return!1},c.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},c.getBBox=function(){for(var t=[],e=[],n=[],r=[],i=this.items.length;i--;)if(!this.items[i].removed){var o=this.items[i].getBBox();t.push(o.x),e.push(o.y),n.push(o.x+o.width),r.push(o.y+o.height)}return t=s.apply(0,t),e=s.apply(0,e),n=a.apply(0,n),r=a.apply(0,r),{x:t,y:e,x2:n,y2:r,width:n-t,height:r-e,cx:t+(n-t)/2,cy:e+(r-e)/2}},c.clone=function(t){t=new l;for(var e=0,n=this.items.length;e<n;e++)t.push(this.items[e].clone());return t},c.toString=function(){return"Snap‘s set"},c.type="set",t.Set=l,t.set=function(){var t=new l;return arguments.length&&t.push.apply(t,Array.prototype.slice.call(arguments,0)),t}}),r.plugin(function(t,n,r,i){function o(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}}function a(e,n,r){n=m(n).replace(/\.{3}|\u2026/g,e),e=t.parseTransformString(e)||[],n=t.parseTransformString(n)||[];for(var i,a,s,l,c=Math.max(e.length,n.length),f=[],p=[],d=0;d<c;d++){if(s=e[d]||o(n[d]),l=n[d]||o(s),s[0]!=l[0]||"r"==s[0].toLowerCase()&&(s[2]!=l[2]||s[3]!=l[3])||"s"==s[0].toLowerCase()&&(s[3]!=l[3]||s[4]!=l[4])){e=t._.transform2matrix(e,r()),n=t._.transform2matrix(n,r()),f=[["m",e.a,e.b,e.c,e.d,e.e,e.f]],p=[["m",n.a,n.b,n.c,n.d,n.e,n.f]];break}for(f[d]=[],p[d]=[],i=0,a=Math.max(s.length,l.length);i<a;i++)i in s&&(f[d][i]=s[i]),i in l&&(p[d][i]=l[i])}return{from:h(f),to:h(p),f:u(f)}}function s(t){return t}function l(t){return function(e){return+e.toFixed(3)+t}}function c(t){return t.join(" ")}function f(e){return t.rgb(e[0],e[1],e[2])}function u(t){var e,n,r,i,o,a,s=0,l=[];for(e=0,n=t.length;e<n;e++){for(o="[",a=['"'+t[e][0]+'"'],r=1,i=t[e].length;r<i;r++)a[r]="val["+s++ +"]";o+=a+"]",l[e]=o}return Function("val","return Snap.path.toString.call(["+l+"])")}function h(t){for(var e=[],n=0,r=t.length;n<r;n++)for(var i=1,o=t[n].length;i<o;i++)e.push(t[n][i]);return e}function p(t){return isFinite(parseFloat(t))}function d(e,n){return!(!t.is(e,"array")||!t.is(n,"array"))&&e.toString()==n.toString()}var g={},v=/[a-z]+$/i,m=String;g.stroke=g.fill="colour",n.prototype.equal=function(t,n){return e("snap.util.equal",this,t,n).firstDefined()},e.on("snap.util.equal",function(e,n){var r,i,o=m(this.attr(e)||""),y=this;if(p(o)&&p(n))return{from:parseFloat(o),to:parseFloat(n),f:s};if("colour"==g[e])return r=t.color(o),i=t.color(n),{from:[r.r,r.g,r.b,r.opacity],to:[i.r,i.g,i.b,i.opacity],f:f};if("viewBox"==e)return r=this.attr(e).vb.split(" ").map(Number),i=n.split(" ").map(Number),{from:r,to:i,f:c};if("transform"==e||"gradientTransform"==e||"patternTransform"==e)return n instanceof t.Matrix&&(n=n.toTransformString()),t._.rgTransform.test(n)||(n=t._.svgTransform2string(n)),a(o,n,function(){return y.getBBox(1)});if("d"==e||"path"==e)return r=t.path.toCubic(o,n),{from:h(r[0]),to:h(r[1]),f:u(r[0])};if("points"==e)return r=m(o).split(t._.separator),i=m(n).split(t._.separator),{from:r,to:i,f:function(t){return t}};var b=o.match(v),_=m(n).match(v);return b&&d(b,_)?{from:parseFloat(o),to:parseFloat(n),f:l(b)}:{from:this.asPX(e),to:this.asPX(e,n),f:s}})}),r.plugin(function(t,n,r,i){for(var o=n.prototype,a="hasOwnProperty",s=("createTouch"in i.doc),l=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],c={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},f=(function(t,e){var n="y"==t?"scrollTop":"scrollLeft",r=e&&e.node?e.node.ownerDocument:i.doc;return r[n in r.documentElement?"documentElement":"body"][n]}),u=function(){return this.originalEvent.preventDefault()},h=function(){return this.originalEvent.stopPropagation()},p=function(t,e,n,r){var i=s&&c[e]?c[e]:e,o=function(i){var o=f("y",r),l=f("x",r);if(s&&c[a](e))for(var p=0,d=i.targetTouches&&i.targetTouches.length;p<d;p++)if(i.targetTouches[p].target==t||t.contains(i.targetTouches[p].target)){var g=i;i=i.targetTouches[p],i.originalEvent=g,i.preventDefault=u,i.stopPropagation=h;break}var v=i.clientX+l,m=i.clientY+o;return n.call(r,i,v,m)};return e!==i&&t.addEventListener(e,o,!1),t.addEventListener(i,o,!1),function(){return e!==i&&t.removeEventListener(e,o,!1),t.removeEventListener(i,o,!1),!0}},d=[],g=function(t){for(var n,r=t.clientX,i=t.clientY,o=f("y"),a=f("x"),l=d.length;l--;){if(n=d[l],s){for(var c,u=t.touches&&t.touches.length;u--;)if(c=t.touches[u],c.identifier==n.el._drag.id||n.el.node.contains(c.target)){r=c.clientX,i=c.clientY,(t.originalEvent?t.originalEvent:t).preventDefault();break}}else t.preventDefault();var h=n.el.node;h.nextSibling,h.parentNode,h.style.display;r+=a,i+=o,e("snap.drag.move."+n.el.id,n.move_scope||n.el,r-n.el._drag.x,i-n.el._drag.y,r,i,t)}},v=function(n){t.unmousemove(g).unmouseup(v);for(var r,i=d.length;i--;)r=d[i],r.el._drag={},e("snap.drag.end."+r.el.id,r.end_scope||r.start_scope||r.move_scope||r.el,n),e.off("snap.drag.*."+r.el.id);d=[]},m=l.length;m--;)!function(e){t[e]=o[e]=function(n,r){if(t.is(n,"function"))this.events=this.events||[],this.events.push({name:e,f:n,unbind:p(this.node||document,e,n,r||this)});else for(var i=0,o=this.events.length;i<o;i++)if(this.events[i].name==e)try{this.events[i].f.call(this)}catch(t){}return this},t["un"+e]=o["un"+e]=function(t){for(var n=this.events||[],r=n.length;r--;)if(n[r].name==e&&(n[r].f==t||!t))return n[r].unbind(),n.splice(r,1),!n.length&&delete this.events,this;return this}}(l[m]);o.hover=function(t,e,n,r){return this.mouseover(t,n).mouseout(e,r||n)},o.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var y=[];o.drag=function(n,r,i,o,a,s){function l(l,c,u){(l.originalEvent||l).preventDefault(),f._drag.x=c,f._drag.y=u,f._drag.id=l.identifier,!d.length&&t.mousemove(g).mouseup(v),d.push({el:f,move_scope:o,start_scope:a,end_scope:s}),r&&e.on("snap.drag.start."+f.id,r),n&&e.on("snap.drag.move."+f.id,n),i&&e.on("snap.drag.end."+f.id,i),e("snap.drag.start."+f.id,a||o||f,c,u,l)}function c(t,n,r){e("snap.draginit."+f.id,f,t,n,r)}var f=this;if(!arguments.length){var u;return f.drag(function(t,e){this.attr({transform:u+(u?"T":"t")+[t,e]})},function(){u=this.transform().local})}return e.on("snap.draginit."+f.id,l),f._drag={},y.push({el:f,start:l,init:c}),f.mousedown(c),f},o.undrag=function(){for(var n=y.length;n--;)y[n].el==this&&(this.unmousedown(y[n].init),y.splice(n,1),e.unbind("snap.drag.*."+this.id),e.unbind("snap.draginit."+this.id));return!y.length&&t.unmousemove(g).unmouseup(v),this}}),r.plugin(function(t,n,r,i){var o=(n.prototype,r.prototype),a=/^\s*url\((.+)\)/,s=String,l=t._.$;t.filter={},o.filter=function(e){var r=this;"svg"!=r.type&&(r=r.paper);var i=t.parse(s(e)),o=t._.id(),a=(r.node.offsetWidth,r.node.offsetHeight,l("filter"));return l(a,{id:o,filterUnits:"userSpaceOnUse"}),a.appendChild(i.node),r.defs.appendChild(a),new n(a)},e.on("snap.util.getattr.filter",function(){e.stop();var n=l(this.node,"filter");if(n){var r=s(n).match(a);return r&&t.select(r[1])}}),e.on("snap.util.attr.filter",function(r){if(r instanceof n&&"filter"==r.type){e.stop();var i=r.node.id;i||(l(r.node,{id:r.id}),i=r.id),l(this.node,{filter:t.url(i)})}r&&"none"!=r||(e.stop(),this.node.removeAttribute("filter"))}),t.filter.blur=function(e,n){null==e&&(e=2);var r=null==n?e:[e,n];return t.format('<feGaussianBlur stdDeviation="{def}"/>',{def:r})},t.filter.blur.toString=function(){return this()},t.filter.shadow=function(e,n,r,i,o){return"string"==typeof r&&(i=r,o=i,r=4),"string"!=typeof i&&(o=i,i="#000"),i=i||"#000",null==r&&(r=4),null==o&&(o=1),null==e&&(e=0,n=2),null==n&&(n=e),i=t.color(i),t.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>',{color:i,dx:e,dy:n,blur:r,opacity:o})},t.filter.shadow.toString=function(){return this()},t.filter.grayscale=function(e){return null==e&&(e=1),t.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>',{a:.2126+.7874*(1-e),b:.7152-.7152*(1-e),c:.0722-.0722*(1-e),d:.2126-.2126*(1-e),e:.7152+.2848*(1-e),f:.0722-.0722*(1-e),g:.2126-.2126*(1-e),h:.0722+.9278*(1-e)})},t.filter.grayscale.toString=function(){return this()},t.filter.sepia=function(e){return null==e&&(e=1),t.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>',{a:.393+.607*(1-e),b:.769-.769*(1-e),c:.189-.189*(1-e),d:.349-.349*(1-e),e:.686+.314*(1-e),f:.168-.168*(1-e),g:.272-.272*(1-e),h:.534-.534*(1-e),i:.131+.869*(1-e)})},t.filter.sepia.toString=function(){return this()},t.filter.saturate=function(e){return null==e&&(e=1),t.format('<feColorMatrix type="saturate" values="{amount}"/>',{amount:1-e})},t.filter.saturate.toString=function(){return this()},t.filter.hueRotate=function(e){return e=e||0,t.format('<feColorMatrix type="hueRotate" values="{angle}"/>',{angle:e})},t.filter.hueRotate.toString=function(){return this()},t.filter.invert=function(e){return null==e&&(e=1),t.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>',{amount:e,amount2:1-e})},t.filter.invert.toString=function(){return this()},t.filter.brightness=function(e){return null==e&&(e=1),t.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>',{amount:e})},t.filter.brightness.toString=function(){return this()},t.filter.contrast=function(e){return null==e&&(e=1),t.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>',{amount:e,amount2:.5-e/2})},t.filter.contrast.toString=function(){return this()}}),r.plugin(function(t,e,n,r,i){var o=t._.box,a=t.is,s=/^[^a-z]*([tbmlrc])/i,l=function(){return"T"+this.dx+","+this.dy};e.prototype.getAlign=function(t,e){null==e&&a(t,"string")&&(e=t,t=null),t=t||this.paper;var n=t.getBBox?t.getBBox():o(t),r=this.getBBox(),i={};switch(e=e&&e.match(s),e=e?e[1].toLowerCase():"c"){case"t":i.dx=0,i.dy=n.y-r.y;break;case"b":i.dx=0,i.dy=n.y2-r.y2;break;case"m":i.dx=0,i.dy=n.cy-r.cy;break;case"l":i.dx=n.x-r.x,i.dy=0;break;case"r":i.dx=n.x2-r.x2,i.dy=0;break;default:i.dx=n.cx-r.cx,i.dy=0}return i.toString=l,i},e.prototype.align=function(t,e){return this.transform("..."+this.getAlign(t,e))}}),r})}).call(window)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.eventEmitter=e.generateId=void 0;var i=n(170),o=r(i),a=(0,o.default)({}),s=function(){var t=0,e="item_";return function(n){return n="string"==typeof n?n:e,t+=1,n+t}}();e.generateId=s,e.eventEmitter=a},function(t,e,n){var r=n(21).Pipe,i=function(){};i.prototype.setResult=function(t){return this.result=t,this.hasResult=!0,this},i.prototype.exit=function(){return this.exiting=!0,this},i.prototype.switchTo=function(t,e){return"string"==typeof t||t instanceof r?this.nextPipe=t:(this.next=t,e&&(this.nextPipe=e)),this},i.prototype.push=function(t,e){return t.parent=this,"undefined"!=typeof e&&(t.childName=e),t.root=this.root||this,t.options=t.options||this.options,this.children?(this.children[this.children.length-1].next=t,this.children.push(t)):(this.children=[t],this.nextAfterChildren=this.next||null,this.next=t),t.next=this,this},e.Context=i},function(t,e,n){var r=n(8).Context,i=n(18),o=function(t,e){this.left=t,this.right=e,this.pipe="diff"};o.prototype=new r,o.prototype.setResult=function(t){if(this.options.cloneDiffValues){var e="function"==typeof this.options.cloneDiffValues?this.options.cloneDiffValues:function(t){return JSON.parse(JSON.stringify(t),i)};"object"==typeof t[0]&&(t[0]=e(t[0])),"object"==typeof t[1]&&(t[1]=e(t[1]))}return r.prototype.setResult.apply(this,arguments)},e.DiffContext=o},function(t,e,n){var r=n(8).Context,i=function(t,e){this.left=t,this.delta=e,this.pipe="patch"};i.prototype=new r,e.PatchContext=i},function(t,e,n){var r=n(8).Context,i=function(t){this.delta=t,this.pipe="reverse"};i.prototype=new r,e.ReverseContext=i},function(t,e){e.isBrowser="undefined"!=typeof window},function(t,e,n){var r=n(4),i=r.BaseFormatter,o=function(){this.includeMoveDestinations=!1};o.prototype=new i,o.prototype.prepareContext=function(t){i.prototype.prepareContext.call(this,t),t.indent=function(t){this.indentLevel=(this.indentLevel||0)+("undefined"==typeof t?1:t),this.indentPad=new Array(this.indentLevel+1).join(" ")},t.row=function(e,n){t.out('<tr><td style="white-space: nowrap;"><pre class="jsondiffpatch-annotated-indent" style="display: inline-block">'),t.out(t.indentPad),t.out('</pre><pre style="display: inline-block">'),t.out(e),t.out('</pre></td><td class="jsondiffpatch-delta-note"><div>'),t.out(n),t.out("</div></td></tr>")}},o.prototype.typeFormattterErrorFormatter=function(t,e){t.row("",'<pre class="jsondiffpatch-error">'+e+"</pre>")},o.prototype.formatTextDiffString=function(t,e){var n=this.parseTextDiff(e);t.out('<ul class="jsondiffpatch-textdiff">');for(var r=0,i=n.length;r<i;r++){var o=n[r];t.out('<li><div class="jsondiffpatch-textdiff-location"><span class="jsondiffpatch-textdiff-line-number">'+o.location.line+'</span><span class="jsondiffpatch-textdiff-char">'+o.location.chr+'</span></div><div class="jsondiffpatch-textdiff-line">');for(var a=o.pieces,s=0,l=a.length;s<l;s++){var c=a[s];t.out('<span class="jsondiffpatch-textdiff-'+c.type+'">'+c.text+"</span>")}t.out("</div></li>")}t.out("</ul>")},o.prototype.rootBegin=function(t,e,n){t.out('<table class="jsondiffpatch-annotated-delta">'),"node"===e&&(t.row("{"),t.indent()),"array"===n&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")},o.prototype.rootEnd=function(t,e){"node"===e&&(t.indent(-1),t.row("}")),t.out("</table>")},o.prototype.nodeBegin=function(t,e,n,r,i){t.row("""+e+"": {"),"node"===r&&t.indent(),"array"===i&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")},o.prototype.nodeEnd=function(t,e,n,r,i,o){"node"===r&&t.indent(-1),t.row("}"+(o?"":","))},o.prototype.format_unchanged=function(){},o.prototype.format_movedestination=function(){},o.prototype.format_node=function(t,e,n){this.formatDeltaChildren(t,e,n)};var a=function(t){return'<pre style="display:inline-block">"'+t+""</pre>"},s={added:function(t,e,n,r){var i=" <pre>([newValue])</pre>";return"undefined"==typeof r?"new value"+i:"number"==typeof r?"insert at index "+r+i:"add property "+a(r)+i},modified:function(t,e,n,r){var i=" <pre>([previousValue, newValue])</pre>";return"undefined"==typeof r?"modify value"+i:"number"==typeof r?"modify at index "+r+i:"modify property "+a(r)+i},deleted:function(t,e,n,r){var i=" <pre>([previousValue, 0, 0])</pre>";return"undefined"==typeof r?"delete value"+i:"number"==typeof r?"remove index "+r+i:"delete property "+a(r)+i},moved:function(t,e,n,r){return'move from <span title="(position to remove at original state)">index '+r+'</span> to <span title="(position to insert at final state)">index '+t[1]+"</span>"},textdiff:function(t,e,n,r){var i="undefined"==typeof r?"":"number"==typeof r?" at index "+r:" at property "+a(r);return"text diff"+i+', format is <a href="https://code.google.com/p/google-diff-match-patch/wiki/Unidiff">a variation of Unidiff</a>'}},l=function(t,e){var n=this.getDeltaType(e),r=s[n],i=r&&r.apply(r,Array.prototype.slice.call(arguments,1)),o=JSON.stringify(e,null,2);"textdiff"===n&&(o=o.split("\\n").join('\\n"+\n "')),t.indent(),t.row(o,i),t.indent(-1)};o.prototype.format_added=l,o.prototype.format_modified=l,o.prototype.format_deleted=l,o.prototype.format_moved=l,o.prototype.format_textdiff=l,e.AnnotatedFormatter=o;var c;e.format=function(t,e){return c||(c=new o),c.format(t,e)}},function(t,e,n){function r(t){for(var e=t,n=[[/&/g,"&"],[/</g,"<"],[/>/g,">"],[/'/g,"'"],[/"/g,"""]],r=0;r<n.length;r++)e=e.replace(n[r][0],n[r][1]);return e}var i=n(4),o=i.BaseFormatter,a=function(){};a.prototype=new o,a.prototype.typeFormattterErrorFormatter=function(t,e){t.out('<pre class="jsondiffpatch-error">'+e+"</pre>")},a.prototype.formatValue=function(t,e){t.out("<pre>"+r(JSON.stringify(e,null,2))+"</pre>")},a.prototype.formatTextDiffString=function(t,e){var n=this.parseTextDiff(e);t.out('<ul class="jsondiffpatch-textdiff">');for(var i=0,o=n.length;i<o;i++){var a=n[i];t.out('<li><div class="jsondiffpatch-textdiff-location"><span class="jsondiffpatch-textdiff-line-number">'+a.location.line+'</span><span class="jsondiffpatch-textdiff-char">'+a.location.chr+'</span></div><div class="jsondiffpatch-textdiff-line">');for(var s=a.pieces,l=0,c=s.length;l<c;l++){var f=s[l];t.out('<span class="jsondiffpatch-textdiff-'+f.type+'">'+r(unescape(f.text))+"</span>")}t.out("</div></li>")}t.out("</ul>")};var s=function(t){t=t||document;var e=function(t){return t.textContent||t.innerText},n=function(t,e,n){for(var r=t.querySelectorAll(e),i=0,o=r.length;i<o;i++)n(r[i])},r=function(t,e){for(var n=0,r=t.children.length;n<r;n++)e(t.children[n],n)};n(t,".jsondiffpatch-arrow",function(t){var n=t.parentNode,i=t.children[0],o=i.children[1];i.style.display="none";var a,s=e(n.querySelector(".jsondiffpatch-moved-destination")),l=n.parentNode;if(r(l,function(t){t.getAttribute("data-key")===s&&(a=t)}),a)try{var c=a.offsetTop-n.offsetTop;i.setAttribute("height",Math.abs(c)+6),t.style.top=-8+(c>0?0:c)+"px";var f=c>0?"M30,0 Q-10,"+Math.round(c/2)+" 26,"+(c-4):"M30,"+-c+" Q-10,"+Math.round(-c/2)+" 26,4";o.setAttribute("d",f),i.style.display=""}catch(t){return}})};a.prototype.rootBegin=function(t,e,n){var r="jsondiffpatch-"+e+(n?" jsondiffpatch-child-node-type-"+n:"");t.out('<div class="jsondiffpatch-delta '+r+'">')},a.prototype.rootEnd=function(t){t.out("</div>"+(t.hasArrows?'<script type="text/javascript">setTimeout('+s.toString()+",10);</script>":""))},a.prototype.nodeBegin=function(t,e,n,r,i){var o="jsondiffpatch-"+r+(i?" jsondiffpatch-child-node-type-"+i:"");t.out('<li class="'+o+'" data-key="'+n+'"><div class="jsondiffpatch-property-name">'+n+"</div>")},a.prototype.nodeEnd=function(t){t.out("</li>")},a.prototype.format_unchanged=function(t,e,n){"undefined"!=typeof n&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,n),t.out("</div>"))},a.prototype.format_movedestination=function(t,e,n){"undefined"!=typeof n&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,n),t.out("</div>"))},a.prototype.format_node=function(t,e,n){var r="a"===e._t?"array":"object";t.out('<ul class="jsondiffpatch-node jsondiffpatch-node-type-'+r+'">'),this.formatDeltaChildren(t,e,n),t.out("</ul>")},a.prototype.format_added=function(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out("</div>")},a.prototype.format_modified=function(t,e){t.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">'),this.formatValue(t,e[0]),t.out('</div><div class="jsondiffpatch-value jsondiffpatch-right-value">'),this.formatValue(t,e[1]),t.out("</div>")},a.prototype.format_deleted=function(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out("</div>")},a.prototype.format_moved=function(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out('</div><div class="jsondiffpatch-moved-destination">'+e[1]+"</div>"),t.out('<div class="jsondiffpatch-arrow" style="position: relative; left: -34px;">\t <svg width="30" height="60" style="position: absolute; display: none;">\t <defs>\t <marker id="markerArrow" markerWidth="8" markerHeight="8" refx="2" refy="4"\t orient="auto" markerUnits="userSpaceOnUse">\t <path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />\t </marker>\t </defs>\t <path d="M30,0 Q-10,25 26,50" style="stroke: #88f; stroke-width: 2px; fill: none;\t stroke-opacity: 0.5; marker-end: url(#markerArrow);"></path>\t </svg>\t </div>'),t.hasArrows=!0},a.prototype.format_textdiff=function(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatTextDiffString(t,e[0]),t.out("</div>")};var l=function(t,e,n){var r=e||document.body,i="jsondiffpatch-unchanged-",o={showing:i+"showing",hiding:i+"hiding",visible:i+"visible",hidden:i+"hidden"},a=r.classList;if(a){if(!n)return a.remove(o.showing),a.remove(o.hiding),a.remove(o.visible),a.remove(o.hidden),void(t===!1&&a.add(o.hidden));t===!1?(a.remove(o.showing),a.add(o.visible),setTimeout(function(){a.add(o.hiding)},10)):(a.remove(o.hiding),a.add(o.showing),a.remove(o.hidden));var l=setInterval(function(){s(r)},100);setTimeout(function(){a.remove(o.showing),a.remove(o.hiding),t===!1?(a.add(o.hidden),a.remove(o.visible)):(a.add(o.visible),a.remove(o.hidden)),setTimeout(function(){a.remove(o.visible),clearInterval(l)},n+400)},n)}},c=function(t,e){return l(!1,t,e)};e.HtmlFormatter=a,e.showUnchanged=l,e.hideUnchanged=c;var f;e.format=function(t,e){return f||(f=new a),f.format(t,e)}},function(t,e,n){var r=n(12);if(e.base=n(4),e.html=n(14),e.annotated=n(13),e.jsonpatch=n(16),!r.isBrowser){var i="./console";e.console=n(177)(i)}},function(t,e,n){!function(){function t(){this.includeMoveDestinations=!1}function r(t){return t[t.length-1]}function i(t,e){return t.sort(e),t}function o(t){return i(t,function(t,e){var n=t.path.split("/"),i=e.path.split("/");return n.length!==i.length?n.length-i.length:h(r(n),r(i))})}function a(t,e){var n=[],r=[];return t.forEach(function(t){var i=e(t)?n:r;i.push(t)}),[n,r]}function s(t){var e=a(t,function(t){return"remove"===t.op}),n=e[0],r=e[1],i=o(n);return i.concat(r)}var l=n(4),c=l.BaseFormatter,f={added:"add",deleted:"remove",modified:"replace",moved:"moved",movedestination:"movedestination",unchanged:"unchanged",error:"error",textDiffLine:"textDiffLine"};t.prototype=new c,t.prototype.prepareContext=function(t){c.prototype.prepareContext.call(this,t),t.result=[],t.path=[],t.pushCurrentOp=function(t,e){var n={op:t,path:this.currentPath()};"undefined"!=typeof e&&(n.value=e),this.result.push(n)},t.currentPath=function(){return"/"+this.path.join("/");
+}},t.prototype.typeFormattterErrorFormatter=function(t,e){t.out("[ERROR]"+e)},t.prototype.rootBegin=function(){},t.prototype.rootEnd=function(){},t.prototype.nodeBegin=function(t,e,n){t.path.push(n)},t.prototype.nodeEnd=function(t){t.path.pop()},t.prototype.format_unchanged=function(t,e,n){"undefined"!=typeof n&&t.pushCurrentOp(f.unchanged,n)},t.prototype.format_movedestination=function(t,e,n){"undefined"!=typeof n&&t.pushCurrentOp(f.movedestination,n)},t.prototype.format_node=function(t,e,n){this.formatDeltaChildren(t,e,n)},t.prototype.format_added=function(t,e){t.pushCurrentOp(f.added,e[0])},t.prototype.format_modified=function(t,e){t.pushCurrentOp(f.modified,e[1])},t.prototype.format_deleted=function(t){t.pushCurrentOp(f.deleted)},t.prototype.format_moved=function(t,e){t.pushCurrentOp(f.moved,e[1])},t.prototype.format_textdiff=function(){throw"not implimented"},t.prototype.format=function(t,e){var n={};return this.prepareContext(n),this.recurse(n,t,e),n.result},e.JSONFormatter=t;var u,h=function(t,e){var n=parseInt(t,10),r=parseInt(e,10);return isNaN(n)||isNaN(r)?0:r-n},p=function(e,n){return u||(u=new t),s(u.format(e,n))};e.log=function(t,e){console.log(p(t,e))},e.format=p}()},function(t,e,n){t.exports=!n(23)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t,e){var n;return"string"==typeof e&&(n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d*))?(Z|([+\-])(\d{2}):(\d{2}))$/.exec(e))?new Date(Date.UTC(+n[1],+n[2]-1,+n[3],+n[4],+n[5],+n[6],+(n[7]||0))):e}},function(t,e,n){var r=n(101),i=n(4),o=i.BaseFormatter,a={added:r.green,deleted:r.red,movedestination:r.gray,moved:r.yellow,unchanged:r.gray,error:r.white.bgRed,textDiffLine:r.gray},s=function(){this.includeMoveDestinations=!1};s.prototype=new o,s.prototype.prepareContext=function(t){o.prototype.prepareContext.call(this,t),t.indent=function(t){this.indentLevel=(this.indentLevel||0)+("undefined"==typeof t?1:t),this.indentPad=new Array(this.indentLevel+1).join(" "),this.outLine()},t.outLine=function(){this.buffer.push("\n"+(this.indentPad||""))},t.out=function(){for(var t=0,e=arguments.length;t<e;t++){var n=arguments[t].split("\n"),r=n.join("\n"+(this.indentPad||""));this.color&&this.color[0]&&(r=this.color[0](r)),this.buffer.push(r)}},t.pushColor=function(t){this.color=this.color||[],this.color.unshift(t)},t.popColor=function(){this.color=this.color||[],this.color.shift()}},s.prototype.typeFormattterErrorFormatter=function(t,e){t.pushColor(a.error),t.out("[ERROR]"+e),t.popColor()},s.prototype.formatValue=function(t,e){t.out(JSON.stringify(e,null,2))},s.prototype.formatTextDiffString=function(t,e){var n=this.parseTextDiff(e);t.indent();for(var r=0,i=n.length;r<i;r++){var o=n[r];t.pushColor(a.textDiffLine),t.out(o.location.line+","+o.location.chr+" "),t.popColor();for(var s=o.pieces,l=0,c=s.length;l<c;l++){var f=s[l];t.pushColor(a[f.type]),t.out(f.text),t.popColor()}r<i-1&&t.outLine()}t.indent(-1)},s.prototype.rootBegin=function(t,e,n){t.pushColor(a[e]),"node"===e&&(t.out("array"===n?"[":"{"),t.indent())},s.prototype.rootEnd=function(t,e,n){"node"===e&&(t.indent(-1),t.out("array"===n?"]":"}")),t.popColor()},s.prototype.nodeBegin=function(t,e,n,r,i){t.pushColor(a[r]),t.out(n+": "),"node"===r&&(t.out("array"===i?"[":"{"),t.indent())},s.prototype.nodeEnd=function(t,e,n,r,i,o){"node"===r&&(t.indent(-1),t.out("array"===i?"]":"}"+(o?"":","))),o||t.outLine(),t.popColor()},s.prototype.format_unchanged=function(t,e,n){"undefined"!=typeof n&&this.formatValue(t,n)},s.prototype.format_movedestination=function(t,e,n){"undefined"!=typeof n&&this.formatValue(t,n)},s.prototype.format_node=function(t,e,n){this.formatDeltaChildren(t,e,n)},s.prototype.format_added=function(t,e){this.formatValue(t,e[0])},s.prototype.format_modified=function(t,e){t.pushColor(a.deleted),this.formatValue(t,e[0]),t.popColor(),t.out(" => "),t.pushColor(a.added),this.formatValue(t,e[1]),t.popColor()},s.prototype.format_deleted=function(t,e){this.formatValue(t,e[0])},s.prototype.format_moved=function(t,e){t.out("==> "+e[1])},s.prototype.format_textdiff=function(t,e){this.formatTextDiffString(t,e[0])},e.ConsoleFormatter=s;var l,c=function(t,e){return l||(l=new s),l.format(t,e)};e.log=function(t,e){console.log(c(t,e))},e.format=c},function(t,e,n){var r=n(12),i=n(28).DiffPatcher;e.DiffPatcher=i,e.create=function(t){return new i(t)},e.dateReviver=n(18);var o;if(e.diff=function(){return o||(o=new i),o.diff.apply(o,arguments)},e.patch=function(){return o||(o=new i),o.patch.apply(o,arguments)},e.unpatch=function(){return o||(o=new i),o.unpatch.apply(o,arguments)},e.reverse=function(){return o||(o=new i),o.reverse.apply(o,arguments)},r.isBrowser)e.homepage="{{package-homepage}}",e.version="{{package-version}}";else{var a="../package.json",s=n(50)(a);e.homepage=s.homepage,e.version=s.version;var l="./formatters",c=n(50)(l);e.formatters=c,e.console=c.console}},function(t,e){var n=function(t){this.name=t,this.filters=[]};n.prototype.process=function(t){if(!this.processor)throw new Error("add this pipe to a processor before using it");for(var e=this.debug,n=this.filters.length,r=t,i=0;i<n;i++){var o=this.filters[i];if(e&&this.log("filter: "+o.filterName),o(r),"object"==typeof r&&r.exiting){r.exiting=!1;break}}!r.next&&this.resultCheck&&this.resultCheck(r)},n.prototype.log=function(t){console.log("[jsondiffpatch] "+this.name+" pipe, "+t)},n.prototype.append=function(){return this.filters.push.apply(this.filters,arguments),this},n.prototype.prepend=function(){return this.filters.unshift.apply(this.filters,arguments),this},n.prototype.indexOf=function(t){if(!t)throw new Error("a filter name is required");for(var e=0;e<this.filters.length;e++){var n=this.filters[e];if(n.filterName===t)return e}throw new Error("filter not found: "+t)},n.prototype.list=function(){for(var t=[],e=0;e<this.filters.length;e++){var n=this.filters[e];t.push(n.filterName)}return t},n.prototype.after=function(t){var e=this.indexOf(t),n=Array.prototype.slice.call(arguments,1);if(!n.length)throw new Error("a filter is required");return n.unshift(e+1,0),Array.prototype.splice.apply(this.filters,n),this},n.prototype.before=function(t){var e=this.indexOf(t),n=Array.prototype.slice.call(arguments,1);if(!n.length)throw new Error("a filter is required");return n.unshift(e,0),Array.prototype.splice.apply(this.filters,n),this},n.prototype.clear=function(){return this.filters.length=0,this},n.prototype.shouldHaveResult=function(t){if(t===!1)return void(this.resultCheck=null);if(!this.resultCheck){var e=this;return this.resultCheck=function(t){if(!t.hasResult){console.log(t);var n=new Error(e.name+" failed");throw n.noResult=!0,n}},this}},e.Pipe=n},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return c.diff(t,e,n)}function o(t,e,n){var r=(0,l.generateOptions)(n,{ignoreWhitespace:!0});return c.diff(t,e,r)}e.__esModule=!0,e.lineDiff=void 0,e.diffLines=i,e.diffTrimmedLines=o;var a=n(5),s=r(a),l=n(49),c=e.lineDiff=new s.default;c.tokenize=function(t){var e=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?e[e.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),e.push(i))}return e}},function(t,e){function n(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}var r=-1,i=1,o=0;n.Diff,n.prototype.diff_main=function(t,e,n,r){"undefined"==typeof r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=r;if(null==t||null==e)throw new Error("Null input. (diff_main)");if(t==e)return t?[[o,t]]:[];"undefined"==typeof n&&(n=!0);var a=n,s=this.diff_commonPrefix(t,e),l=t.substring(0,s);t=t.substring(s),e=e.substring(s),s=this.diff_commonSuffix(t,e);var c=t.substring(t.length-s);t=t.substring(0,t.length-s),e=e.substring(0,e.length-s);var f=this.diff_compute_(t,e,a,i);return l&&f.unshift([o,l]),c&&f.push([o,c]),this.diff_cleanupMerge(f),f},n.prototype.diff_compute_=function(t,e,n,a){var s;if(!t)return[[i,e]];if(!e)return[[r,t]];var l=t.length>e.length?t:e,c=t.length>e.length?e:t,f=l.indexOf(c);if(f!=-1)return s=[[i,l.substring(0,f)],[o,c],[i,l.substring(f+c.length)]],t.length>e.length&&(s[0][0]=s[2][0]=r),s;if(1==c.length)return[[r,t],[i,e]];l=c=null;var u=this.diff_halfMatch_(t,e);if(u){var h=u[0],p=u[1],d=u[2],g=u[3],v=u[4],m=this.diff_main(h,d,n,a),y=this.diff_main(p,g,n,a);return m.concat([[o,v]],y)}return n&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,a):this.diff_bisect_(t,e,a)},n.prototype.diff_lineMode_=function(t,e,n){var a=this.diff_linesToChars_(t,e);t=a[0],e=a[1];var s=a[2],l=this.diff_bisect_(t,e,n);this.diff_charsToLines_(l,s),this.diff_cleanupSemantic(l),l.push([o,""]);for(var c=0,f=0,u=0,h="",p="";c<l.length;){switch(l[c][0]){case i:u++,p+=l[c][1];break;case r:f++,h+=l[c][1];break;case o:if(f>=1&&u>=1){var a=this.diff_main(h,p,!1,n);l.splice(c-f-u,f+u),c=c-f-u;for(var d=a.length-1;d>=0;d--)l.splice(c,0,a[d]);c+=a.length}u=0,f=0,h="",p=""}c++}return l.pop(),l},n.prototype.diff_bisect_=function(t,e,n){for(var o=t.length,a=e.length,s=Math.ceil((o+a)/2),l=s,c=2*s,f=new Array(c),u=new Array(c),h=0;h<c;h++)f[h]=-1,u[h]=-1;f[l+1]=0,u[l+1]=0;for(var p=o-a,d=p%2!=0,g=0,v=0,m=0,y=0,b=0;b<s&&!((new Date).getTime()>n);b++){for(var _=-b+g;_<=b-v;_+=2){var x,w=l+_;x=_==-b||_!=b&&f[w-1]<f[w+1]?f[w+1]:f[w-1]+1;for(var k=x-_;x<o&&k<a&&t.charAt(x)==e.charAt(k);)x++,k++;if(f[w]=x,x>o)v+=2;else if(k>a)g+=2;else if(d){var C=l+p-_;if(C>=0&&C<c&&u[C]!=-1){var T=o-u[C];if(x>=T)return this.diff_bisectSplit_(t,e,x,k,n)}}}for(var j=-b+m;j<=b-y;j+=2){var T,C=l+j;T=j==-b||j!=b&&u[C-1]<u[C+1]?u[C+1]:u[C-1]+1;for(var $=T-j;T<o&&$<a&&t.charAt(o-T-1)==e.charAt(a-$-1);)T++,$++;if(u[C]=T,T>o)y+=2;else if($>a)m+=2;else if(!d){var w=l+p-j;if(w>=0&&w<c&&f[w]!=-1){var x=f[w],k=l+x-w;if(T=o-T,x>=T)return this.diff_bisectSplit_(t,e,x,k,n)}}}}return[[r,t],[i,e]]},n.prototype.diff_bisectSplit_=function(t,e,n,r,i){var o=t.substring(0,n),a=e.substring(0,r),s=t.substring(n),l=e.substring(r),c=this.diff_main(o,a,!1,i),f=this.diff_main(s,l,!1,i);return c.concat(f)},n.prototype.diff_linesToChars_=function(t,e){function n(t){for(var e="",n=0,o=-1,a=r.length;o<t.length-1;){o=t.indexOf("\n",n),o==-1&&(o=t.length-1);var s=t.substring(n,o+1);n=o+1,(i.hasOwnProperty?i.hasOwnProperty(s):void 0!==i[s])?e+=String.fromCharCode(i[s]):(e+=String.fromCharCode(a),i[s]=a,r[a++]=s)}return e}var r=[],i={};r[0]="";var o=n(t),a=n(e);return[o,a,r]},n.prototype.diff_charsToLines_=function(t,e){for(var n=0;n<t.length;n++){for(var r=t[n][1],i=[],o=0;o<r.length;o++)i[o]=e[r.charCodeAt(o)];t[n][1]=i.join("")}},n.prototype.diff_commonPrefix=function(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,o=0;n<i;)t.substring(o,i)==e.substring(o,i)?(n=i,o=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(t,e){if(!t||!e||t.charAt(t.length-1)!=e.charAt(e.length-1))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,o=0;n<i;)t.substring(t.length-i,t.length-o)==e.substring(e.length-i,e.length-o)?(n=i,o=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(t,e){var n=t.length,r=e.length;if(0==n||0==r)return 0;n>r?t=t.substring(n-r):n<r&&(e=e.substring(0,n));var i=Math.min(n,r);if(t==e)return i;for(var o=0,a=1;;){var s=t.substring(i-a),l=e.indexOf(s);if(l==-1)return o;a+=l,0!=l&&t.substring(i-a)!=e.substring(0,a)||(o=a,a++)}},n.prototype.diff_halfMatch_=function(t,e){function n(t,e,n){for(var r,i,o,s,l=t.substring(n,n+Math.floor(t.length/4)),c=-1,f="";(c=e.indexOf(l,c+1))!=-1;){var u=a.diff_commonPrefix(t.substring(n),e.substring(c)),h=a.diff_commonSuffix(t.substring(0,n),e.substring(0,c));f.length<h+u&&(f=e.substring(c-h,c)+e.substring(c,c+u),r=t.substring(0,n-h),i=t.substring(n+u),o=e.substring(0,c-h),s=e.substring(c+u))}return 2*f.length>=t.length?[r,i,o,s,f]:null}if(this.Diff_Timeout<=0)return null;var r=t.length>e.length?t:e,i=t.length>e.length?e:t;if(r.length<4||2*i.length<r.length)return null;var o,a=this,s=n(r,i,Math.ceil(r.length/4)),l=n(r,i,Math.ceil(r.length/2));if(!s&&!l)return null;o=l?s&&s[4].length>l[4].length?s:l:s;var c,f,u,h;t.length>e.length?(c=o[0],f=o[1],u=o[2],h=o[3]):(u=o[0],h=o[1],c=o[2],f=o[3]);var p=o[4];return[c,f,u,h,p]},n.prototype.diff_cleanupSemantic=function(t){for(var e=!1,n=[],a=0,s=null,l=0,c=0,f=0,u=0,h=0;l<t.length;)t[l][0]==o?(n[a++]=l,c=u,f=h,u=0,h=0,s=t[l][1]):(t[l][0]==i?u+=t[l][1].length:h+=t[l][1].length,null!==s&&s.length<=Math.max(c,f)&&s.length<=Math.max(u,h)&&(t.splice(n[a-1],0,[r,s]),t[n[a-1]+1][0]=i,a--,a--,l=a>0?n[a-1]:-1,c=0,f=0,u=0,h=0,s=null,e=!0)),l++;for(e&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),l=1;l<t.length;){if(t[l-1][0]==r&&t[l][0]==i){var p=t[l-1][1],d=t[l][1],g=this.diff_commonOverlap_(p,d);(g>=p.length/2||g>=d.length/2)&&(t.splice(l,0,[o,d.substring(0,g)]),t[l-1][1]=p.substring(0,p.length-g),t[l+1][1]=d.substring(g),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 5;var o=0;return(t.charAt(t.length-1).match(n)||e.charAt(0).match(n))&&(o++,(t.charAt(t.length-1).match(r)||e.charAt(0).match(r))&&(o++,(t.charAt(t.length-1).match(i)||e.charAt(0).match(i))&&(o++,(t.match(a)||e.match(s))&&o++))),o}for(var n=/[^a-zA-Z0-9]/,r=/\s/,i=/[\r\n]/,a=/\n\r?\n$/,s=/^\r?\n\r?\n/,l=1;l<t.length-1;){if(t[l-1][0]==o&&t[l+1][0]==o){var c=t[l-1][1],f=t[l][1],u=t[l+1][1],h=this.diff_commonSuffix(c,f);if(h){var p=f.substring(f.length-h);c=c.substring(0,c.length-h),f=p+f.substring(0,f.length-h),u=p+u}for(var d=c,g=f,v=u,m=e(c,f)+e(f,u);f.charAt(0)===u.charAt(0);){c+=f.charAt(0),f=f.substring(1)+u.charAt(0),u=u.substring(1);var y=e(c,f)+e(f,u);y>=m&&(m=y,d=c,g=f,v=u)}t[l-1][1]!=d&&(d?t[l-1][1]=d:(t.splice(l-1,1),l--),t[l][1]=g,v?t[l+1][1]=v:(t.splice(l+1,1),l--))}l++}},n.prototype.diff_cleanupEfficiency=function(t){for(var e=!1,n=[],a=0,s="",l=0,c=!1,f=!1,u=!1,h=!1;l<t.length;)t[l][0]==o?(t[l][1].length<this.Diff_EditCost&&(u||h)?(n[a++]=l,c=u,f=h,s=t[l][1]):(a=0,s=""),u=h=!1):(t[l][0]==r?h=!0:u=!0,s&&(c&&f&&u&&h||s.length<this.Diff_EditCost/2&&c+f+u+h==3)&&(t.splice(n[a-1],0,[r,s]),t[n[a-1]+1][0]=i,a--,s="",c&&f?(u=h=!0,a=0):(a--,l=a>0?n[a-1]:-1,u=h=!1),e=!0)),l++;e&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push([o,""]);for(var e,n=0,a=0,s=0,l="",c="";n<t.length;)switch(t[n][0]){case i:s++,c+=t[n][1],n++;break;case r:a++,l+=t[n][1],n++;break;case o:a+s>1?(0!==a&&0!==s&&(e=this.diff_commonPrefix(c,l),0!==e&&(n-a-s>0&&t[n-a-s-1][0]==o?t[n-a-s-1][1]+=c.substring(0,e):(t.splice(0,0,[o,c.substring(0,e)]),n++),c=c.substring(e),l=l.substring(e)),e=this.diff_commonSuffix(c,l),0!==e&&(t[n][1]=c.substring(c.length-e)+t[n][1],c=c.substring(0,c.length-e),l=l.substring(0,l.length-e))),0===a?t.splice(n-a-s,a+s,[i,c]):0===s?t.splice(n-a-s,a+s,[r,l]):t.splice(n-a-s,a+s,[r,l],[i,c]),n=n-a-s+(a?1:0)+(s?1:0)+1):0!==n&&t[n-1][0]==o?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,s=0,a=0,l="",c=""}""===t[t.length-1][1]&&t.pop();var f=!1;for(n=1;n<t.length-1;)t[n-1][0]==o&&t[n+1][0]==o&&(t[n][1].substring(t[n][1].length-t[n-1][1].length)==t[n-1][1]?(t[n][1]=t[n-1][1]+t[n][1].substring(0,t[n][1].length-t[n-1][1].length),t[n+1][1]=t[n-1][1]+t[n+1][1],t.splice(n-1,1),f=!0):t[n][1].substring(0,t[n+1][1].length)==t[n+1][1]&&(t[n-1][1]+=t[n+1][1],t[n][1]=t[n][1].substring(t[n+1][1].length)+t[n+1][1],t.splice(n+1,1),f=!0)),n++;f&&this.diff_cleanupMerge(t)},n.prototype.diff_xIndex=function(t,e){var n,o=0,a=0,s=0,l=0;for(n=0;n<t.length&&(t[n][0]!==i&&(o+=t[n][1].length),t[n][0]!==r&&(a+=t[n][1].length),!(o>e));n++)s=o,l=a;return t.length!=n&&t[n][0]===r?l:l+(e-s)},n.prototype.diff_prettyHtml=function(t){for(var e=[],n=0,a=/&/g,s=/</g,l=/>/g,c=/\n/g,f=0;f<t.length;f++){var u=t[f][0],h=t[f][1],p=h.replace(a,"&").replace(s,"<").replace(l,">").replace(c,"¶<br>");switch(u){case i:e[f]='<ins style="background:#e6ffe6;">'+p+"</ins>";break;case r:e[f]='<del style="background:#ffe6e6;">'+p+"</del>";break;case o:e[f]="<span>"+p+"</span>"}u!==r&&(n+=h.length)}return e.join("")},n.prototype.diff_text1=function(t){for(var e=[],n=0;n<t.length;n++)t[n][0]!==i&&(e[n]=t[n][1]);return e.join("")},n.prototype.diff_text2=function(t){for(var e=[],n=0;n<t.length;n++)t[n][0]!==r&&(e[n]=t[n][1]);return e.join("")},n.prototype.diff_levenshtein=function(t){for(var e=0,n=0,a=0,s=0;s<t.length;s++){var l=t[s][0],c=t[s][1];switch(l){case i:n+=c.length;break;case r:a+=c.length;break;case o:e+=Math.max(n,a),n=0,a=0}}return e+=Math.max(n,a)},n.prototype.diff_toDelta=function(t){for(var e=[],n=0;n<t.length;n++)switch(t[n][0]){case i:e[n]="+"+encodeURI(t[n][1]);break;case r:e[n]="-"+t[n][1].length;break;case o:e[n]="="+t[n][1].length}return e.join("\t").replace(/%20/g," ")},n.prototype.diff_fromDelta=function(t,e){for(var n=[],a=0,s=0,l=e.split(/\t/g),c=0;c<l.length;c++){var f=l[c].substring(1);switch(l[c].charAt(0)){case"+":try{n[a++]=[i,decodeURI(f)]}catch(t){throw new Error("Illegal escape in diff_fromDelta: "+f)}break;case"-":case"=":var u=parseInt(f,10);if(isNaN(u)||u<0)throw new Error("Invalid number in diff_fromDelta: "+f);var h=t.substring(s,s+=u);"="==l[c].charAt(0)?n[a++]=[o,h]:n[a++]=[r,h];break;default:if(l[c])throw new Error("Invalid diff operation in diff_fromDelta: "+l[c])}}if(s!=t.length)throw new Error("Delta length ("+s+") does not equal source text length ("+t.length+").");return n},n.prototype.match_main=function(t,e,n){if(null==t||null==e||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,t.length)),t==e?0:t.length?t.substring(n,n+e.length)==e?n:this.match_bitap_(t,e,n):-1},n.prototype.match_bitap_=function(t,e,n){function r(t,r){var i=t/e.length,a=Math.abs(n-r);return o.Match_Distance?i+a/o.Match_Distance:a?1:i}if(e.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(e),o=this,a=this.Match_Threshold,s=t.indexOf(e,n);s!=-1&&(a=Math.min(r(0,s),a),s=t.lastIndexOf(e,n+e.length),s!=-1&&(a=Math.min(r(0,s),a)));var l=1<<e.length-1;s=-1;for(var c,f,u,h=e.length+t.length,p=0;p<e.length;p++){for(c=0,f=h;c<f;)r(p,n+f)<=a?c=f:h=f,f=Math.floor((h-c)/2+c);h=f;var d=Math.max(1,n-f+1),g=Math.min(n+f,t.length)+e.length,v=Array(g+2);v[g+1]=(1<<p)-1;for(var m=g;m>=d;m--){var y=i[t.charAt(m-1)];if(0===p?v[m]=(v[m+1]<<1|1)&y:v[m]=(v[m+1]<<1|1)&y|((u[m+1]|u[m])<<1|1)|u[m+1],v[m]&l){var b=r(p,m-1);if(b<=a){if(a=b,s=m-1,!(s>n))break;d=Math.max(1,2*n-s)}}}if(r(p+1,n)>a)break;u=v}return s},n.prototype.match_alphabet_=function(t){for(var e={},n=0;n<t.length;n++)e[t.charAt(n)]=0;for(var n=0;n<t.length;n++)e[t.charAt(n)]|=1<<t.length-n-1;return e},n.prototype.patch_addContext_=function(t,e){if(0!=e.length){for(var n=e.substring(t.start2,t.start2+t.length1),r=0;e.indexOf(n)!=e.lastIndexOf(n)&&n.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)r+=this.Patch_Margin,n=e.substring(t.start2-r,t.start2+t.length1+r);r+=this.Patch_Margin;var i=e.substring(t.start2-r,t.start2);i&&t.diffs.unshift([o,i]);var a=e.substring(t.start2+t.length1,t.start2+t.length1+r);a&&t.diffs.push([o,a]),t.start1-=i.length,t.start2-=i.length,t.length1+=i.length+a.length,t.length2+=i.length+a.length}},n.prototype.patch_make=function(t,e,a){var s,l;if("string"==typeof t&&"string"==typeof e&&"undefined"==typeof a)s=t,l=this.diff_main(s,e,!0),l.length>2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(t&&"object"==typeof t&&"undefined"==typeof e&&"undefined"==typeof a)l=t,s=this.diff_text1(l);else if("string"==typeof t&&e&&"object"==typeof e&&"undefined"==typeof a)s=t,l=e;else{if("string"!=typeof t||"string"!=typeof e||!a||"object"!=typeof a)throw new Error("Unknown call format to patch_make.");s=t,l=a}if(0===l.length)return[];for(var c=[],f=new n.patch_obj,u=0,h=0,p=0,d=s,g=s,v=0;v<l.length;v++){var m=l[v][0],y=l[v][1];switch(u||m===o||(f.start1=h,f.start2=p),m){case i:f.diffs[u++]=l[v],f.length2+=y.length,g=g.substring(0,p)+y+g.substring(p);break;case r:f.length1+=y.length,f.diffs[u++]=l[v],g=g.substring(0,p)+g.substring(p+y.length);break;case o:y.length<=2*this.Patch_Margin&&u&&l.length!=v+1?(f.diffs[u++]=l[v],f.length1+=y.length,f.length2+=y.length):y.length>=2*this.Patch_Margin&&u&&(this.patch_addContext_(f,d),c.push(f),f=new n.patch_obj,u=0,d=g,h=p)}m!==i&&(h+=y.length),m!==r&&(p+=y.length)}return u&&(this.patch_addContext_(f,d),c.push(f)),c},n.prototype.patch_deepCopy=function(t){for(var e=[],r=0;r<t.length;r++){var i=t[r],o=new n.patch_obj;o.diffs=[];for(var a=0;a<i.diffs.length;a++)o.diffs[a]=i.diffs[a].slice();o.start1=i.start1,o.start2=i.start2,o.length1=i.length1,o.length2=i.length2,e[r]=o}return e},n.prototype.patch_apply=function(t,e){if(0==t.length)return[e,[]];t=this.patch_deepCopy(t);var n=this.patch_addPadding(t);e=n+e+n,this.patch_splitMax(t);for(var a=0,s=[],l=0;l<t.length;l++){var c,f=t[l].start2+a,u=this.diff_text1(t[l].diffs),h=-1;if(u.length>this.Match_MaxBits?(c=this.match_main(e,u.substring(0,this.Match_MaxBits),f),c!=-1&&(h=this.match_main(e,u.substring(u.length-this.Match_MaxBits),f+u.length-this.Match_MaxBits),(h==-1||c>=h)&&(c=-1))):c=this.match_main(e,u,f),c==-1)s[l]=!1,a-=t[l].length2-t[l].length1;else{s[l]=!0,a=c-f;var p;if(p=h==-1?e.substring(c,c+u.length):e.substring(c,h+this.Match_MaxBits),u==p)e=e.substring(0,c)+this.diff_text2(t[l].diffs)+e.substring(c+u.length);else{var d=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(d)/u.length>this.Patch_DeleteThreshold)s[l]=!1;else{this.diff_cleanupSemanticLossless(d);for(var g,v=0,m=0;m<t[l].diffs.length;m++){var y=t[l].diffs[m];y[0]!==o&&(g=this.diff_xIndex(d,v)),y[0]===i?e=e.substring(0,c+g)+y[1]+e.substring(c+g):y[0]===r&&(e=e.substring(0,c+g)+e.substring(c+this.diff_xIndex(d,v+y[1].length))),y[0]!==r&&(v+=y[1].length)}}}}}return e=e.substring(n.length,e.length-n.length),[e,s]},n.prototype.patch_addPadding=function(t){for(var e=this.Patch_Margin,n="",r=1;r<=e;r++)n+=String.fromCharCode(r);for(var r=0;r<t.length;r++)t[r].start1+=e,t[r].start2+=e;var i=t[0],a=i.diffs;if(0==a.length||a[0][0]!=o)a.unshift([o,n]),i.start1-=e,i.start2-=e,i.length1+=e,i.length2+=e;else if(e>a[0][1].length){var s=e-a[0][1].length;a[0][1]=n.substring(a[0][1].length)+a[0][1],i.start1-=s,i.start2-=s,i.length1+=s,i.length2+=s}if(i=t[t.length-1],a=i.diffs,0==a.length||a[a.length-1][0]!=o)a.push([o,n]),i.length1+=e,i.length2+=e;else if(e>a[a.length-1][1].length){var s=e-a[a.length-1][1].length;a[a.length-1][1]+=n.substring(0,s),i.length1+=s,i.length2+=s}return n},n.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,a=0;a<t.length;a++)if(t[a].length1>e){var s=t[a];t.splice(a--,1);for(var l=s.start1,c=s.start2,f="";0!==s.diffs.length;){var u=new n.patch_obj,h=!0;for(u.start1=l-f.length,u.start2=c-f.length,""!==f&&(u.length1=u.length2=f.length,u.diffs.push([o,f]));0!==s.diffs.length&&u.length1<e-this.Patch_Margin;){var p=s.diffs[0][0],d=s.diffs[0][1];p===i?(u.length2+=d.length,c+=d.length,u.diffs.push(s.diffs.shift()),h=!1):p===r&&1==u.diffs.length&&u.diffs[0][0]==o&&d.length>2*e?(u.length1+=d.length,l+=d.length,h=!1,u.diffs.push([p,d]),s.diffs.shift()):(d=d.substring(0,e-u.length1-this.Patch_Margin),u.length1+=d.length,l+=d.length,p===o?(u.length2+=d.length,c+=d.length):h=!1,u.diffs.push([p,d]),d==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(d.length))}f=this.diff_text2(u.diffs),f=f.substring(f.length-this.Patch_Margin);var g=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);""!==g&&(u.length1+=g.length,u.length2+=g.length,0!==u.diffs.length&&u.diffs[u.diffs.length-1][0]===o?u.diffs[u.diffs.length-1][1]+=g:u.diffs.push([o,g])),h||t.splice(++a,0,u)}}},n.prototype.patch_toText=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=t[n];return e.join("")},n.prototype.patch_fromText=function(t){var e=[];if(!t)return e;for(var a=t.split("\n"),s=0,l=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<a.length;){var c=a[s].match(l);if(!c)throw new Error("Invalid patch string: "+a[s]);var f=new n.patch_obj;for(e.push(f),f.start1=parseInt(c[1],10),""===c[2]?(f.start1--,f.length1=1):"0"==c[2]?f.length1=0:(f.start1--,f.length1=parseInt(c[2],10)),f.start2=parseInt(c[3],10),""===c[4]?(f.start2--,f.length2=1):"0"==c[4]?f.length2=0:(f.start2--,f.length2=parseInt(c[4],10)),s++;s<a.length;){var u=a[s].charAt(0);try{var h=decodeURI(a[s].substring(1))}catch(t){throw new Error("Illegal escape in patch_fromText: "+h)}if("-"==u)f.diffs.push([r,h]);else if("+"==u)f.diffs.push([i,h]);else if(" "==u)f.diffs.push([o,h]);else{if("@"==u)break;if(""!==u)throw new Error('Invalid patch mode "'+u+'" in: '+h)}s++}}return e},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){var t,e;t=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1,e=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;for(var n,a=["@@ -"+t+" +"+e+" @@\n"],s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:n="+";break;case r:n="-";break;case o:n=" "}a[s+1]=n+encodeURI(this.diffs[s][1])+"\n"}return a.join("").replace(/%20/g," ")},this.diff_match_patch=n,this.DIFF_DELETE=r,this.DIFF_INSERT=i,this.DIFF_EQUAL=o},function(t,e,n){var r=n(35).Processor,i=n(21).Pipe,o=n(9).DiffContext,a=n(10).PatchContext,s=n(11).ReverseContext,l=n(34),c=n(32),f=n(29),u=n(30),h=n(33),p=function(t){this.processor=new r(t),this.processor.pipe(new i("diff").append(c.collectChildrenDiffFilter,l.diffFilter,u.diffFilter,h.diffFilter,c.objectsDiffFilter,f.diffFilter).shouldHaveResult()),this.processor.pipe(new i("patch").append(c.collectChildrenPatchFilter,f.collectChildrenPatchFilter,l.patchFilter,h.patchFilter,c.patchFilter,f.patchFilter).shouldHaveResult()),this.processor.pipe(new i("reverse").append(c.collectChildrenReverseFilter,f.collectChildrenReverseFilter,l.reverseFilter,h.reverseFilter,c.reverseFilter,f.reverseFilter).shouldHaveResult())};p.prototype.options=function(){return this.processor.options.apply(this.processor,arguments)},p.prototype.diff=function(t,e){return this.processor.process(new o(t,e))},p.prototype.patch=function(t,e){return this.processor.process(new a(t,e))},p.prototype.reverse=function(t){return this.processor.process(new s(t))},p.prototype.unpatch=function(t,e){return this.patch(t,this.reverse(e))},e.DiffPatcher=p},function(t,e,n){function r(t,e,n,r){for(var i=0;i<n;i++)for(var o=t[i],a=0;a<r;a++){var s=e[a];if(o===s)return!0}}function i(t,e,n,r,i){var o=t[n],a=e[r];if(o===a)return!0;if("object"!=typeof o||"object"!=typeof a)return!1;var s=i.objectHash;if(!s)return i.matchByPosition&&n===r;var l,c;return"number"==typeof n?(i.hashCache1=i.hashCache1||[],l=i.hashCache1[n],"undefined"==typeof l&&(i.hashCache1[n]=l=s(o,n))):l=s(o),"undefined"!=typeof l&&("number"==typeof r?(i.hashCache2=i.hashCache2||[],c=i.hashCache2[r],"undefined"==typeof c&&(i.hashCache2[r]=c=s(a,r))):c=s(a),"undefined"!=typeof c&&l===c)}var o=n(9).DiffContext,a=n(10).PatchContext,s=n(11).ReverseContext,l=n(31),c=3,f="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},u="function"==typeof Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=t.length,r=0;r<n;r++)if(t[r]===e)return r;return-1},h=function(t){if(t.leftIsArray){var e,n,a,s,f={objectHash:t.options&&t.options.objectHash,matchByPosition:t.options&&t.options.matchByPosition},h=0,p=0,d=t.left,g=t.right,v=d.length,m=g.length;for(v>0&&m>0&&!f.objectHash&&"boolean"!=typeof f.matchByPosition&&(f.matchByPosition=!r(d,g,v,m));h<v&&h<m&&i(d,g,h,h,f);)e=h,s=new o(t.left[e],t.right[e]),t.push(s,e),h++;for(;p+h<v&&p+h<m&&i(d,g,v-1-p,m-1-p,f);)n=v-1-p,a=m-1-p,s=new o(t.left[n],t.right[a]),t.push(s,a),p++;var y;if(h+p===v){if(v===m)return void t.setResult(void 0).exit();for(y=y||{_t:"a"},e=h;e<m-p;e++)y[e]=[g[e]];return void t.setResult(y).exit()}if(h+p===m){for(y=y||{_t:"a"},e=h;e<v-p;e++)y["_"+e]=[d[e],0,0];return void t.setResult(y).exit()}delete f.hashCache1,delete f.hashCache2;var b=d.slice(h,v-p),_=g.slice(h,m-p),x=l.get(b,_,i,f),w=[];for(y=y||{_t:"a"},e=h;e<v-p;e++)u(x.indices1,e-h)<0&&(y["_"+e]=[d[e],0,0],w.push(e));var k=!0;t.options&&t.options.arrays&&t.options.arrays.detectMove===!1&&(k=!1);var C=!1;t.options&&t.options.arrays&&t.options.arrays.includeValueOnMove&&(C=!0);var T=w.length;for(e=h;e<m-p;e++){var j=u(x.indices2,e-h);if(j<0){var $=!1;if(k&&T>0)for(var A=0;A<T;A++)if(n=w[A],i(b,_,n-h,e-h,f)){y["_"+n].splice(1,2,e,c),C||(y["_"+n][0]=""),a=e,s=new o(t.left[n],t.right[a]),t.push(s,a),w.splice(A,1),$=!0;break}$||(y[e]=[g[e]])}else n=x.indices1[j]+h,a=x.indices2[j]+h,s=new o(t.left[n],t.right[a]),t.push(s,a)}t.setResult(y).exit()}};h.filterName="arrays";var p={numerically:function(t,e){return t-e},numericallyBy:function(t){return function(e,n){return e[t]-n[t]}}},d=function(t){if(t.nested&&"a"===t.delta._t){var e,n,r=t.delta,i=t.left,o=[],s=[],l=[];for(e in r)if("_t"!==e)if("_"===e[0]){if(0!==r[e][2]&&r[e][2]!==c)throw new Error("only removal or move can be applied at original array indices, invalid diff type: "+r[e][2]);o.push(parseInt(e.slice(1),10))}else 1===r[e].length?s.push({index:parseInt(e,10),value:r[e][0]}):l.push({index:parseInt(e,10),delta:r[e]});for(o=o.sort(p.numerically),e=o.length-1;e>=0;e--){n=o[e];var f=r["_"+n],u=i.splice(n,1)[0];f[2]===c&&s.push({index:f[1],value:u})}s=s.sort(p.numericallyBy("index"));var h=s.length;for(e=0;e<h;e++){var d=s[e];i.splice(d.index,0,d.value)}var g,v=l.length;if(v>0)for(e=0;e<v;e++){var m=l[e];g=new a(t.left[m.index],m.delta),t.push(g,m.index)}return t.children?void t.exit():void t.setResult(t.left).exit()}};d.filterName="arrays";var g=function(t){if(t&&t.children&&"a"===t.delta._t){for(var e,n=t.children.length,r=0;r<n;r++)e=t.children[r],t.left[e.childName]=e.result;t.setResult(t.left).exit()}};g.filterName="arraysCollectChildren";var v=function(t){if(!t.nested)return void(t.delta[2]===c&&(t.newName="_"+t.delta[1],t.setResult([t.delta[0],parseInt(t.childName.substr(1),10),c]).exit()));if("a"===t.delta._t){var e,n;for(e in t.delta)"_t"!==e&&(n=new s(t.delta[e]),t.push(n,e));t.exit()}};v.filterName="arrays";var m=function(t,e,n){if("string"==typeof e&&"_"===e[0])return parseInt(e.substr(1),10);if(f(n)&&0===n[2])return"_"+e;var r=+e;for(var i in t){var o=t[i];if(f(o))if(o[2]===c){var a=parseInt(i.substr(1),10),s=o[1];if(s===+e)return a;a<=r&&s>r?r++:a>=r&&s<r&&r--}else if(0===o[2]){var l=parseInt(i.substr(1),10);l<=r&&r++}else 1===o.length&&i<=r&&r--}return r},y=function(t){if(t&&t.children&&"a"===t.delta._t){for(var e,n=t.children.length,r={_t:"a"},i=0;i<n;i++){e=t.children[i];var o=e.newName;"undefined"==typeof o&&(o=m(t.delta,e.childName,e.result)),r[o]!==e.result&&(r[o]=e.result)}t.setResult(r).exit()}};y.filterName="arraysCollectChildren",e.diffFilter=h,e.patchFilter=d,e.collectChildrenPatchFilter=g,e.reverseFilter=v,e.collectChildrenReverseFilter=y},function(t,e){var n=function(t){t.left instanceof Date?(t.right instanceof Date?t.left.getTime()!==t.right.getTime()?t.setResult([t.left,t.right]):t.setResult(void 0):t.setResult([t.left,t.right]),t.exit()):t.right instanceof Date&&t.setResult([t.left,t.right]).exit()};n.filterName="dates",e.diffFilter=n},function(t,e){var n=function(t,e,n,r){return t[n]===e[r]},r=function(t,e,n,r){var i,o,a=t.length,s=e.length,l=[a+1];for(i=0;i<a+1;i++)for(l[i]=[s+1],o=0;o<s+1;o++)l[i][o]=0;
+for(l.match=n,i=1;i<a+1;i++)for(o=1;o<s+1;o++)n(t,e,i-1,o-1,r)?l[i][o]=l[i-1][o-1]+1:l[i][o]=Math.max(l[i-1][o],l[i][o-1]);return l},i=function(t,e,n,r,o,a){if(0===r||0===o)return{sequence:[],indices1:[],indices2:[]};if(t.match(e,n,r-1,o-1,a)){var s=i(t,e,n,r-1,o-1,a);return s.sequence.push(e[r-1]),s.indices1.push(r-1),s.indices2.push(o-1),s}return t[r][o-1]>t[r-1][o]?i(t,e,n,r,o-1,a):i(t,e,n,r-1,o,a)},o=function(t,e,o,a){a=a||{};var s=r(t,e,o||n,a),l=i(s,t,e,t.length,e.length,a);return"string"==typeof t&&"string"==typeof e&&(l.sequence=l.sequence.join("")),l};e.get=o},function(t,e,n){var r=n(9).DiffContext,i=n(10).PatchContext,o=n(11).ReverseContext,a=function(t){if(t&&t.children){for(var e,n=t.children.length,r=t.result,i=0;i<n;i++)e=t.children[i],"undefined"!=typeof e.result&&(r=r||{},r[e.childName]=e.result);r&&t.leftIsArray&&(r._t="a"),t.setResult(r).exit()}};a.filterName="collectChildren";var s=function(t){if(!t.leftIsArray&&"object"===t.leftType){var e,n,i=t.options.propertyFilter;for(e in t.left)Object.prototype.hasOwnProperty.call(t.left,e)&&(i&&!i(e,t)||(n=new r(t.left[e],t.right[e]),t.push(n,e)));for(e in t.right)Object.prototype.hasOwnProperty.call(t.right,e)&&(i&&!i(e,t)||"undefined"==typeof t.left[e]&&(n=new r(void 0,t.right[e]),t.push(n,e)));return t.children&&0!==t.children.length?void t.exit():void t.setResult(void 0).exit()}};s.filterName="objects";var l=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new i(t.left[e],t.delta[e]),t.push(n,e);t.exit()}};l.filterName="objects";var c=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r=0;r<n;r++)e=t.children[r],Object.prototype.hasOwnProperty.call(t.left,e.childName)&&void 0===e.result?delete t.left[e.childName]:t.left[e.childName]!==e.result&&(t.left[e.childName]=e.result);t.setResult(t.left).exit()}};c.filterName="collectChildren";var f=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new o(t.delta[e]),t.push(n,e);t.exit()}};f.filterName="objects";var u=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r={},i=0;i<n;i++)e=t.children[i],r[e.childName]!==e.result&&(r[e.childName]=e.result);t.setResult(r).exit()}};u.filterName="collectChildren",e.collectChildrenDiffFilter=a,e.objectsDiffFilter=s,e.patchFilter=l,e.collectChildrenPatchFilter=c,e.reverseFilter=f,e.collectChildrenReverseFilter=u},function(t,e,n){var r=2,i=60,o=null,a=function(t){if(!o){var e;if("undefined"!=typeof diff_match_patch)e="function"==typeof diff_match_patch?new diff_match_patch:new diff_match_patch.diff_match_patch;else try{var r="diff_match_patch_uncompressed",i=n(176)("./"+r);e=new i.diff_match_patch}catch(t){e=null}if(!e){if(!t)return null;var a=new Error("text diff_match_patch library not found");throw a.diff_match_patch_not_found=!0,a}o={diff:function(t,n){return e.patch_toText(e.patch_make(t,n))},patch:function(t,n){for(var r=e.patch_apply(e.patch_fromText(n),t),i=0;i<r[1].length;i++)if(!r[1][i]){var o=new Error("text patch failed");o.textPatchFailed=!0}return r[0]}}}return o},s=function(t){if("string"===t.leftType){var e=t.options&&t.options.textDiff&&t.options.textDiff.minLength||i;if(t.left.length<e||t.right.length<e)return void t.setResult([t.left,t.right]).exit();var n=a();if(!n)return void t.setResult([t.left,t.right]).exit();var o=n.diff;t.setResult([o(t.left,t.right),0,r]).exit()}};s.filterName="texts";var l=function(t){if(!t.nested&&t.delta[2]===r){var e=a(!0).patch;t.setResult(e(t.left,t.delta[0])).exit()}};l.filterName="texts";var c=function(t){var e,n,r,i,o,a,s,l,c=null,f=/^@@ +\-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;for(r=t.split("\n"),e=0,n=r.length;e<n;e++){i=r[e];var u=i.slice(0,1);"@"===u?(c=f.exec(i),a=e,s=null,l=null,r[a]="@@ -"+c[3]+","+c[4]+" +"+c[1]+","+c[2]+" @@"):"+"===u?(s=e,r[e]="-"+r[e].slice(1),"+"===r[e-1].slice(0,1)&&(o=r[e],r[e]=r[e-1],r[e-1]=o)):"-"===u&&(l=e,r[e]="+"+r[e].slice(1))}return r.join("\n")},f=function(t){t.nested||t.delta[2]===r&&t.setResult([c(t.delta[0]),0,r]).exit()};f.filterName="texts",e.diffFilter=s,e.patchFilter=l,e.reverseFilter=f},function(t,e){var n="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},r=function(t){if(t.left===t.right)return void t.setResult(void 0).exit();if("undefined"==typeof t.left){if("function"==typeof t.right)throw new Error("functions are not supported");return void t.setResult([t.right]).exit()}if("undefined"==typeof t.right)return void t.setResult([t.left,0,0]).exit();if("function"==typeof t.left||"function"==typeof t.right)throw new Error("functions are not supported");return t.leftType=null===t.left?"null":typeof t.left,t.rightType=null===t.right?"null":typeof t.right,t.leftType!==t.rightType?void t.setResult([t.left,t.right]).exit():"boolean"===t.leftType||"number"===t.leftType?void t.setResult([t.left,t.right]).exit():("object"===t.leftType&&(t.leftIsArray=n(t.left)),"object"===t.rightType&&(t.rightIsArray=n(t.right)),t.leftIsArray!==t.rightIsArray?void t.setResult([t.left,t.right]).exit():void 0)};r.filterName="trivial";var i=function(t){return"undefined"==typeof t.delta?void t.setResult(t.left).exit():(t.nested=!n(t.delta),t.nested?void 0:1===t.delta.length?void t.setResult(t.delta[0]).exit():2===t.delta.length?void t.setResult(t.delta[1]).exit():3===t.delta.length&&0===t.delta[2]?void t.setResult(void 0).exit():void 0)};i.filterName="trivial";var o=function(t){return"undefined"==typeof t.delta?void t.setResult(t.delta).exit():(t.nested=!n(t.delta),t.nested?void 0:1===t.delta.length?void t.setResult([t.delta[0],0,0]).exit():2===t.delta.length?void t.setResult([t.delta[1],t.delta[0]]).exit():3===t.delta.length&&0===t.delta[2]?void t.setResult([t.delta[0]]).exit():void 0)};o.filterName="trivial",e.diffFilter=r,e.patchFilter=i,e.reverseFilter=o},function(t,e){var n=function(t){this.selfOptions=t||{},this.pipes={}};n.prototype.options=function(t){return t&&(this.selfOptions=t),this.selfOptions},n.prototype.pipe=function(t,e){if("string"==typeof t){if("undefined"==typeof e)return this.pipes[t];this.pipes[t]=e}if(t&&t.name){if(e=t,e.processor===this)return e;this.pipes[e.name]=e}return e.processor=this,e},n.prototype.process=function(t,e){var n=t;n.options=this.options();for(var r,i,o=e||t.pipe||"default";o;)"undefined"!=typeof n.nextAfterChildren&&(n.next=n.nextAfterChildren,n.nextAfterChildren=null),"string"==typeof o&&(o=this.pipe(o)),o.process(n),i=n,r=o,o=null,n&&n.next&&(n=n.next,o=i.nextPipe||n.pipe||r);return n.hasResult?n.result:void 0},e.Processor=n},function(t,e,n){var r,i;n(218),r=n(74);var o=n(201);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-2842cc86",t.exports=r},function(t,e,n){var r,i;n(214),r=n(78);var o=n(197);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-09005644",t.exports=r},function(t,e){"use strict";t.exports=function(){return/\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(7),a=function(){function t(e){r(this,t),this.zoomFactor=.1,this.paper=e.paper,this.MIN_SIZE=40,this.imageWidth=parseInt(this.paper.select(".main-image").attr("width")),this.imageHeight=parseInt(this.paper.select(".main-image").attr("height")),this.viewport={width:parseInt(this.paper.attr("width")),height:parseInt(this.paper.attr("height"))},this.scale=1,this.paper.attr({stroke:2,fill:"blue"}),this.disableDrag=!1,this.imgMinSize=Math.min(this.imageWidth,this.imageHeight),this.lastPosition=[],this.updateViewBox([0,0,this.imageWidth,this.imageHeight])}return i(t,[{key:"testShowCenter",value:function(t,e){this.center&&this.center.remove(),this.center=this.paper.rect(t-3,e-3,20,20),this.center.attr({fill:"red"})}},{key:"drawTestRectangle",value:function(t,e,n,r){var i=t-n/2,o=e-r/2;this.paper.rect(i,o,n,r)}},{key:"zoomIn",value:function(){if(9===this.scale)return void this.scale--;var t=this.currentViewBox[0]+this.currentViewBox[2]/2,e=this.currentViewBox[1]+this.currentViewBox[3]/2,n=this.zoomFactor*this.scale,r=this.imgMinSize-this.imgMinSize*n,i=r;this.currentViewBox[0]=t-r/2,this.currentViewBox[1]=e-i/2,this.currentViewBox[2]=r,this.currentViewBox[3]=i,this.scale++,this.updateViewBox()}},{key:"updateViewBox",value:function(t,e){if(e="boolean"!=typeof e||e,t&&4!=t.length)throw new Error("Provided currentViewBox is not valid!");if(t&&(this.currentViewBox=t),this.paper.attr({viewBox:this.currentViewBox}),!e)return!1;var n=this;o.eventEmitter.emit("zoomChanged",{updateFunction:function(t){n.updateViewBox(t,!1)},zoomFactor:this.getZoomFactor(),viewport:this.viewport,currentScale:this.scale,imageSize:{width:this.imageWidth,height:this.imageHeight},minSize:Math.min(this.imageWidth,this.imageHeight),currentViewBox:this.currentViewBox.slice()})}},{key:"getZoomFactor",value:function(){return{x:this.viewport.width/this.currentViewBox[2],y:this.viewport.height/this.currentViewBox[3]}}},{key:"onStart",value:function(t,e,n){this.lastPosition[0]=this.currentViewBox[0],this.lastPosition[1]=this.currentViewBox[1],"drawingHandler"===n.target.className.baseVal&&(this.disableDrag=!0)}},{key:"canDrag",value:function(){return!this.disableDrag}},{key:"onStop",value:function(){this.disableDrag=!1}},{key:"onDrag",value:function(t,e,n,r,i){if(!this.canDrag())return!0;var o=this.lastPosition[0]-t,a=this.lastPosition[1]-e;o+this.currentViewBox[2]>=this.viewport.width&&(o=this.viewport.width-this.currentViewBox[2]),a+this.currentViewBox[3]>=this.viewport.height&&(a=this.viewport.height-this.currentViewBox[3]),o<=0&&(o=0),a<=0&&(a=0),this.currentViewBox[0]=o,this.currentViewBox[1]=a,this.updateViewBox()}},{key:"reset",value:function(){this.scale=1,this.currentViewBox=[0,0,this.imageWidth,this.imageHeight],this.updateViewBox()}},{key:"zoomOut",value:function(){if(1==this.scale)return!1;var t=this.currentViewBox[0]+this.currentViewBox[2]/2,e=this.currentViewBox[1]+this.currentViewBox[3]/2,n=this.zoomFactor*(this.scale-1),r=this.imgMinSize-this.imgMinSize*n,i=r,o=t-r/2,a=e-i/2;this.currentViewBox[0]=o,this.currentViewBox[1]=a,this.currentViewBox[2]=r,this.currentViewBox[3]=i,this.updateViewBox(),this.scale--}}]),t}();e.default={enable_zoom:function(t){return new a(t)}}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={methods:{save:function(t){Object.assign(t,{fragment:this.toSVGPath()}),this.$parent.$emit("save",t)}}}},function(t,e,n){(function(t,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(6),a=i(o),s=n(189),l=i(s),c={placement:"auto",container:"body",trigger:"manual",html:!0,title:"",viewport:".cut-canvas",content:""};e.default={methods:{addTooltip:function(){var e=this,n=new Vue(l.default);this.originalAnnotation&&(n.originalTitle=this.originalAnnotation.title,n.originalDescription=this.originalAnnotation.description,n.originalTags=this.originalAnnotation.tags),n.$mount(t("<div>").get(0)),n.$on("close",function(){e.clear()}),n.$on("save",function(t){e.save(t)}),c.content=n.$el;var i=new a.default(this.getTooltipTarget()),o=r(i.node);o.popover(c).popover("show"),this.$on("drag:start",function(){o.popover("hide")}),this.$on("drag:end",function(){o.popover("show")}),o.on("shown.bs.popover",function(t){var e=o.data("bs.popover").$tip;e.find('input[name="title"]').focus()})},destroyTooltip:function(){var t=new a.default(this.getTooltipTarget()),e=r(t.node);e.data("bs.popover")&&e.popover("destroy")},hideTooltip:function(){var t=new a.default(this.getTooltipTarget()),e=r(t.node);e.data("bs.popover")&&e.popover("hide")},showTooltip:function(){var t=new a.default(this.getTooltipTarget()),e=r(t.node);e.data("bs.popover")&&e.popover("show")}}}}).call(e,n(1),n(1))},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(24),i=n(22),o=n(108),a=n(112),s="prototype",l=function(t,e,n){var c,f,u,h=t&l.F,p=t&l.G,d=t&l.S,g=t&l.P,v=t&l.B,m=t&l.W,y=p?i:i[e]||(i[e]={}),b=y[s],_=p?r:d?r[e]:(r[e]||{})[s];p&&(n=e);for(c in n)f=!h&&_&&void 0!==_[c],f&&c in y||(u=f?_[c]:n[c],y[c]=p&&"function"!=typeof _[c]?n[c]:v&&f?o(u,r):m&&_[c]==u?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[s]=t[s],e}(u):g&&"function"==typeof u?o(Function.call,u):u,g&&((y.virtual||(y.virtual={}))[c]=u,t&l.R&&b&&!b[c]&&a(b,c,u)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e,n){var r=n(107);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(105),i=n(113),o=n(125),a=Object.defineProperty;e.f=n(17)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(44),i=n(42);t.exports=function(t){return r(i(t))}},function(t,e){"use strict";function n(t){function e(){var t={};for(s.push(t);l<o.length;){var e=o[l];if(/^(\-\-\-|\+\+\+|@@)\s/.test(e))break;var a=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(e);a&&(t.index=a[1]),l++}for(n(t),n(t),t.hunks=[];l<o.length;){var c=o[l];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(c))break;if(/^@@/.test(c))t.hunks.push(r());else{if(c&&i.strict)throw new Error("Unknown line "+(l+1)+" "+JSON.stringify(c));l++}}}function n(t){var e=/^(---|\+\+\+)\s+([\S ]*)(?:\t(.*?)\s*)?$/,n=e.exec(o[l]);if(n){var r="---"===n[1]?"old":"new";t[r+"FileName"]=n[2],t[r+"Header"]=n[3],l++}}function r(){for(var t=l,e=o[l++],n=e.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),r={oldStart:+n[1],oldLines:+n[2]||1,newStart:+n[3],newLines:+n[4]||1,lines:[],linedelimiters:[]},s=0,c=0;l<o.length&&!(0===o[l].indexOf("--- ")&&l+2<o.length&&0===o[l+1].indexOf("+++ ")&&0===o[l+2].indexOf("@@"));l++){var f=o[l][0];if("+"!==f&&"-"!==f&&" "!==f&&"\\"!==f)break;r.lines.push(o[l]),r.linedelimiters.push(a[l]||"\n"),"+"===f?s++:"-"===f?c++:" "===f&&(s++,c++)}if(s||1!==r.newLines||(r.newLines=0),c||1!==r.oldLines||(r.oldLines=0),i.strict){if(s!==r.newLines)throw new Error("Added line count did not match for hunk at line "+(t+1));if(c!==r.oldLines)throw new Error("Removed line count did not match for hunk at line "+(t+1))}return r}for(var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=t.split(/\r\n|[\n\v\f\r\x85]/),a=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=[],l=0;l<o.length;)e();return s}e.__esModule=!0,e.parsePatch=n},function(t,e){"use strict";function n(t,e){if("function"==typeof t)e.callback=t;else if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}e.__esModule=!0,e.generateOptions=n},function(t,e,n){function r(t){return n(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./contexts/context":8,"./contexts/context.js":8,"./contexts/diff":9,"./contexts/diff.js":9,"./contexts/patch":10,"./contexts/patch.js":10,"./contexts/reverse":11,"./contexts/reverse.js":11,"./date-reviver":18,"./date-reviver.js":18,"./diffpatcher":28,"./diffpatcher.js":28,"./environment":12,"./environment.js":12,"./filters/arrays":29,"./filters/arrays.js":29,"./filters/dates":30,"./filters/dates.js":30,"./filters/lcs":31,"./filters/lcs.js":31,"./filters/nested":32,"./filters/nested.js":32,"./filters/texts":33,"./filters/texts.js":33,"./filters/trivial":34,"./filters/trivial.js":34,"./formatters/annotated":13,"./formatters/annotated.js":13,"./formatters/base":4,"./formatters/base.js":4,"./formatters/console":19,"./formatters/console.js":19,"./formatters/html":14,"./formatters/html.js":14,"./formatters/index":15,"./formatters/index.js":15,"./formatters/jsonpatch":16,"./formatters/jsonpatch.js":16,"./main":20,"./main-formatters":51,"./main-formatters.js":51,"./main-full":52,"./main-full.js":52,"./main.js":20,"./pipe":21,"./pipe.js":21,"./processor":35,"./processor.js":35};r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=50},function(t,e,n){t.exports=n(15)},function(t,e,n){var r=n(12);r.isBrowser&&(window.diff_match_patch=n(27)),t.exports=n(20)},function(t,e,n){var r;(function(t,i){(function(){function o(t,e){return t.set(e[0],e[1]),t}function a(t,e){return t.add(e),t}function s(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function l(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function c(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function f(t,e){for(var n=null==t?0:t.length;n--&&e(t[n],n,t)!==!1;);return t}function u(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function h(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function p(t,e){var n=null==t?0:t.length;return!!n&&C(t,e,0)>-1}function d(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function g(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function v(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function m(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function y(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function b(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function _(t){return t.split("")}function x(t){return t.match(Ie)||[]}function w(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function k(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function C(t,e,n){return e===e?Y(t,e,n):k(t,j,n)}function T(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function j(t){return t!==t}function $(t,e){var n=null==t?0:t.length;return n?E(t,e)/n:Nt}function A(t){return function(e){return null==e?it:e[t]}}function S(t){return function(e){return null==t?it:t[e]}}function O(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function M(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}function E(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);o!==it&&(n=n===it?o:n+o)}return n}function P(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function N(t,e){return g(e,function(e){return[e,t[e]]})}function F(t){return function(e){return t(e)}}function R(t,e){return g(e,function(e){return t[e]})}function B(t,e){return t.has(e)}function D(t,e){for(var n=-1,r=t.length;++n<r&&C(e,t[n],0)>-1;);return n}function z(t,e){for(var n=t.length;n--&&C(e,t[n],0)>-1;);return n}function I(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}function L(t){return"\\"+Yn[t]}function q(t,e){return null==t?it:t[e]}function V(t){return qn.test(t)}function H(t){return Vn.test(t)}function U(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}function W(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function Z(t,e){return function(n){return t(e(n))}}function J(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==ut||(t[n]=ut,o[i++]=n)}return o}function G(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function X(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}function Y(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function K(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}function Q(t){return V(t)?et(t):dr(t)}function tt(t){return V(t)?nt(t):_(t)}function et(t){for(var e=In.lastIndex=0;In.test(t);)++e;return e}function nt(t){return t.match(In)||[]}function rt(t){return t.match(Ln)||[]}var it,ot="4.16.6",at=200,st="Unsupported core-js use. Try https://github.com/es-shims.",lt="Expected a function",ct="__lodash_hash_undefined__",ft=500,ut="__lodash_placeholder__",ht=1,pt=2,dt=4,gt=8,vt=16,mt=32,yt=64,bt=128,_t=256,xt=512,wt=1,kt=2,Ct=30,Tt="...",jt=800,$t=16,At=1,St=2,Ot=3,Mt=1/0,Et=9007199254740991,Pt=1.7976931348623157e308,Nt=NaN,Ft=4294967295,Rt=Ft-1,Bt=Ft>>>1,Dt=[["ary",bt],["bind",ht],["bindKey",pt],["curry",gt],["curryRight",vt],["flip",xt],["partial",mt],["partialRight",yt],["rearg",_t]],zt="[object Arguments]",It="[object Array]",Lt="[object AsyncFunction]",qt="[object Boolean]",Vt="[object Date]",Ht="[object DOMException]",Ut="[object Error]",Wt="[object Function]",Zt="[object GeneratorFunction]",Jt="[object Map]",Gt="[object Number]",Xt="[object Null]",Yt="[object Object]",Kt="[object Promise]",Qt="[object Proxy]",te="[object RegExp]",ee="[object Set]",ne="[object String]",re="[object Symbol]",ie="[object Undefined]",oe="[object WeakMap]",ae="[object WeakSet]",se="[object ArrayBuffer]",le="[object DataView]",ce="[object Float32Array]",fe="[object Float64Array]",ue="[object Int8Array]",he="[object Int16Array]",pe="[object Int32Array]",de="[object Uint8Array]",ge="[object Uint8ClampedArray]",ve="[object Uint16Array]",me="[object Uint32Array]",ye=/\b__p \+= '';/g,be=/\b(__p \+=) '' \+/g,_e=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xe=/&(?:amp|lt|gt|quot|#39);/g,we=/[&<>"']/g,ke=RegExp(xe.source),Ce=RegExp(we.source),Te=/<%-([\s\S]+?)%>/g,je=/<%([\s\S]+?)%>/g,$e=/<%=([\s\S]+?)%>/g,Ae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Se=/^\w*$/,Oe=/^\./,Me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ee=/[\\^$.*+?()[\]{}|]/g,Pe=RegExp(Ee.source),Ne=/^\s+|\s+$/g,Fe=/^\s+/,Re=/\s+$/,Be=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,De=/\{\n\/\* \[wrapped with (.+)\] \*/,ze=/,? & /,Ie=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Le=/\\(\\)?/g,qe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ve=/\w*$/,He=/^[-+]0x[0-9a-f]+$/i,Ue=/^0b[01]+$/i,We=/^\[object .+?Constructor\]$/,Ze=/^0o[0-7]+$/i,Je=/^(?:0|[1-9]\d*)$/,Ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xe=/($^)/,Ye=/['\n\r\u2028\u2029\\]/g,Ke="\\ud800-\\udfff",Qe="\\u0300-\\u036f\\ufe20-\\ufe23",tn="\\u20d0-\\u20f0",en="\\u2700-\\u27bf",nn="a-z\\xdf-\\xf6\\xf8-\\xff",rn="\\xac\\xb1\\xd7\\xf7",on="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",an="\\u2000-\\u206f",sn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ln="A-Z\\xc0-\\xd6\\xd8-\\xde",cn="\\ufe0e\\ufe0f",fn=rn+on+an+sn,un="['’]",hn="["+Ke+"]",pn="["+fn+"]",dn="["+Qe+tn+"]",gn="\\d+",vn="["+en+"]",mn="["+nn+"]",yn="[^"+Ke+fn+gn+en+nn+ln+"]",bn="\\ud83c[\\udffb-\\udfff]",_n="(?:"+dn+"|"+bn+")",xn="[^"+Ke+"]",wn="(?:\\ud83c[\\udde6-\\uddff]){2}",kn="[\\ud800-\\udbff][\\udc00-\\udfff]",Cn="["+ln+"]",Tn="\\u200d",jn="(?:"+mn+"|"+yn+")",$n="(?:"+Cn+"|"+yn+")",An="(?:"+un+"(?:d|ll|m|re|s|t|ve))?",Sn="(?:"+un+"(?:D|LL|M|RE|S|T|VE))?",On=_n+"?",Mn="["+cn+"]?",En="(?:"+Tn+"(?:"+[xn,wn,kn].join("|")+")"+Mn+On+")*",Pn="\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",Nn="\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)",Fn=Mn+On+En,Rn="(?:"+[vn,wn,kn].join("|")+")"+Fn,Bn="(?:"+[xn+dn+"?",dn,wn,kn,hn].join("|")+")",Dn=RegExp(un,"g"),zn=RegExp(dn,"g"),In=RegExp(bn+"(?="+bn+")|"+Bn+Fn,"g"),Ln=RegExp([Cn+"?"+mn+"+"+An+"(?="+[pn,Cn,"$"].join("|")+")",$n+"+"+Sn+"(?="+[pn,Cn+jn,"$"].join("|")+")",Cn+"?"+jn+"+"+An,Cn+"+"+Sn,Nn,Pn,gn,Rn].join("|"),"g"),qn=RegExp("["+Tn+Ke+Qe+tn+cn+"]"),Vn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Hn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Un=-1,Wn={};Wn[ce]=Wn[fe]=Wn[ue]=Wn[he]=Wn[pe]=Wn[de]=Wn[ge]=Wn[ve]=Wn[me]=!0,Wn[zt]=Wn[It]=Wn[se]=Wn[qt]=Wn[le]=Wn[Vt]=Wn[Ut]=Wn[Wt]=Wn[Jt]=Wn[Gt]=Wn[Yt]=Wn[te]=Wn[ee]=Wn[ne]=Wn[oe]=!1;var Zn={};Zn[zt]=Zn[It]=Zn[se]=Zn[le]=Zn[qt]=Zn[Vt]=Zn[ce]=Zn[fe]=Zn[ue]=Zn[he]=Zn[pe]=Zn[Jt]=Zn[Gt]=Zn[Yt]=Zn[te]=Zn[ee]=Zn[ne]=Zn[re]=Zn[de]=Zn[ge]=Zn[ve]=Zn[me]=!0,Zn[Ut]=Zn[Wt]=Zn[oe]=!1;var Jn={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Gn={"&":"&","<":"<",">":">",'"':""","'":"'"},Xn={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Kn=parseFloat,Qn=parseInt,tr="object"==typeof t&&t&&t.Object===Object&&t,er="object"==typeof self&&self&&self.Object===Object&&self,nr=tr||er||Function("return this")(),rr="object"==typeof e&&e&&!e.nodeType&&e,ir=rr&&"object"==typeof i&&i&&!i.nodeType&&i,or=ir&&ir.exports===rr,ar=or&&tr.process,sr=function(){try{return ar&&ar.binding("util")}catch(t){}}(),lr=sr&&sr.isArrayBuffer,cr=sr&&sr.isDate,fr=sr&&sr.isMap,ur=sr&&sr.isRegExp,hr=sr&&sr.isSet,pr=sr&&sr.isTypedArray,dr=A("length"),gr=S(Jn),vr=S(Gn),mr=S(Xn),yr=function t(e){function n(t){if(rl(t)&&!gh(t)&&!(t instanceof _)){if(t instanceof i)return t;if(gf.call(t,"__wrapped__"))return ta(t)}return new i(t)}function r(){}function i(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=it}function _(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ft,this.__views__=[]}function S(){var t=new _(this.__wrapped__);return t.__actions__=Bi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Bi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Bi(this.__views__),t}function Y(){if(this.__filtered__){var t=new _(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function et(){var t=this.__wrapped__.value(),e=this.__dir__,n=gh(t),r=e<0,i=n?t.length:0,o=ko(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,f=this.__iteratees__,u=f.length,h=0,p=Uf(l,this.__takeCount__);if(!n||i<at||i==l&&p==l)return yi(t,this.__actions__);var d=[];t:for(;l--&&h<p;){c+=e;for(var g=-1,v=t[c];++g<u;){var m=f[g],y=m.iteratee,b=m.type,_=y(v);if(b==St)v=_;else if(!_){if(b==At)continue t;break t}}d[h++]=v}return d}function nt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ie(){this.__data__=eu?eu(null):{},this.size=0}function Ke(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Qe(t){var e=this.__data__;if(eu){var n=e[t];return n===ct?it:n}return gf.call(e,t)?e[t]:it}function tn(t){var e=this.__data__;return eu?e[t]!==it:gf.call(e,t)}function en(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=eu&&e===it?ct:e,this}function nn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function rn(){this.__data__=[],this.size=0}function on(t){var e=this.__data__,n=Mn(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Sf.call(e,n,1),--this.size,!0}function an(t){var e=this.__data__,n=Mn(e,t);return n<0?it:e[n][1]}function sn(t){return Mn(this.__data__,t)>-1}function ln(t,e){var n=this.__data__,r=Mn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function cn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function fn(){this.size=0,this.__data__={hash:new nt,map:new(Yf||nn),string:new nt}}function un(t){var e=bo(this,t).delete(t);return this.size-=e?1:0,e}function hn(t){return bo(this,t).get(t)}function pn(t){return bo(this,t).has(t)}function dn(t,e){var n=bo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new cn;++e<n;)this.add(t[e])}function vn(t){return this.__data__.set(t,ct),this}function mn(t){return this.__data__.has(t)}function yn(t){var e=this.__data__=new nn(t);this.size=e.size}function bn(){this.__data__=new nn,this.size=0}function _n(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function xn(t){return this.__data__.get(t)}function wn(t){return this.__data__.has(t)}function kn(t,e){var n=this.__data__;if(n instanceof nn){var r=n.__data__;if(!Yf||r.length<at-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new cn(r)}return n.set(t,e),this.size=n.size,this}function Cn(t,e){var n=gh(t),r=!n&&dh(t),i=!n&&!r&&mh(t),o=!n&&!r&&!i&&wh(t),a=n||r||i||o,s=a?P(t.length,lf):[],l=s.length;for(var c in t)!e&&!gf.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Mo(c,l))||s.push(c);return s}function Tn(t){var e=t.length;return e?t[Qr(0,e-1)]:it}function jn(t,e){return Xo(Bi(t),Rn(e,0,t.length))}function $n(t){return Xo(Bi(t))}function An(t,e,n,r){return t===it||Vs(t,hf[n])&&!gf.call(r,n)?e:t}function Sn(t,e,n){(n===it||Vs(t[e],n))&&(n!==it||e in t)||Nn(t,e,n)}function On(t,e,n){var r=t[e];gf.call(t,e)&&Vs(r,n)&&(n!==it||e in t)||Nn(t,e,n)}function Mn(t,e){for(var n=t.length;n--;)if(Vs(t[n][0],e))return n;return-1}function En(t,e,n,r){return pu(t,function(t,i,o){e(r,t,n(t),o)}),r}function Pn(t,e){return t&&Di(e,Dl(e),t)}function Nn(t,e,n){"__proto__"==e&&Pf?Pf(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Fn(t,e){for(var n=-1,r=e.length,i=tf(r),o=null==t;++n<r;)i[n]=o?it:Fl(t,e[n]);return i}function Rn(t,e,n){return t===t&&(n!==it&&(t=t<=n?t:n),e!==it&&(t=t>=e?t:e)),t}function Bn(t,e,n,r,i,o,a){var s;if(r&&(s=o?r(t,i,o,a):r(t)),s!==it)return s;if(!nl(t))return t;var l=gh(t);if(l){if(s=jo(t),!e)return Bi(t,s)}else{var f=Tu(t),u=f==Wt||f==Zt;if(mh(t))return Ti(t,e);if(f==Yt||f==zt||u&&!o){if(s=$o(u?{}:t),!e)return zi(t,Pn(s,t))}else{if(!Zn[f])return o?t:{};s=Ao(t,f,Bn,e)}}a||(a=new yn);var h=a.get(t);if(h)return h;a.set(t,s);var p=l?it:(n?po:Dl)(t);return c(p||t,function(i,o){
+p&&(o=i,i=t[o]),On(s,o,Bn(i,e,n,r,o,t,a))}),s}function In(t){var e=Dl(t);return function(n){return Ln(n,t,e)}}function Ln(t,e,n){var r=n.length;if(null==t)return!r;for(t=af(t);r--;){var i=n[r],o=e[i],a=t[i];if(a===it&&!(i in t)||!o(a))return!1}return!0}function qn(t,e,n){if("function"!=typeof t)throw new cf(lt);return Au(function(){t.apply(it,n)},e)}function Vn(t,e,n,r){var i=-1,o=p,a=!0,s=t.length,l=[],c=e.length;if(!s)return l;n&&(e=g(e,F(n))),r?(o=d,a=!1):e.length>=at&&(o=B,a=!1,e=new gn(e));t:for(;++i<s;){var f=t[i],u=null==n?f:n(f);if(f=r||0!==f?f:0,a&&u===u){for(var h=c;h--;)if(e[h]===u)continue t;l.push(f)}else o(e,u,r)||l.push(f)}return l}function Jn(t,e){var n=!0;return pu(t,function(t,r,i){return n=!!e(t,r,i)}),n}function Gn(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(null!=a&&(s===it?a===a&&!dl(a):n(a,s)))var s=a,l=o}return l}function Xn(t,e,n,r){var i=t.length;for(n=_l(n),n<0&&(n=-n>i?0:i+n),r=r===it||r>i?i:_l(r),r<0&&(r+=i),r=n>r?0:xl(r);n<r;)t[n++]=e;return t}function Yn(t,e){var n=[];return pu(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function tr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=Oo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?tr(s,e-1,n,r,i):v(i,s):r||(i[i.length]=s)}return i}function er(t,e){return t&&gu(t,e,Dl)}function rr(t,e){return t&&vu(t,e,Dl)}function ir(t,e){return h(e,function(e){return Qs(t[e])})}function ar(t,e){e=Po(e,t)?[e]:ki(e);for(var n=0,r=e.length;null!=t&&n<r;)t=t[Yo(e[n++])];return n&&n==r?t:it}function sr(t,e,n){var r=e(t);return gh(t)?r:v(r,n(t))}function dr(t){return null==t?t===it?ie:Xt:(t=af(t),Ef&&Ef in t?wo(t):Ho(t))}function yr(t,e){return t>e}function _r(t,e){return null!=t&&gf.call(t,e)}function xr(t,e){return null!=t&&e in af(t)}function wr(t,e,n){return t>=Uf(e,n)&&t<Hf(e,n)}function kr(t,e,n){for(var r=n?d:p,i=t[0].length,o=t.length,a=o,s=tf(o),l=1/0,c=[];a--;){var f=t[a];a&&e&&(f=g(f,F(e))),l=Uf(f.length,l),s[a]=!n&&(e||i>=120&&f.length>=120)?new gn(a&&f):it}f=t[0];var u=-1,h=s[0];t:for(;++u<i&&c.length<l;){var v=f[u],m=e?e(v):v;if(v=n||0!==v?v:0,!(h?B(h,m):r(c,m,n))){for(a=o;--a;){var y=s[a];if(!(y?B(y,m):r(t[a],m,n)))continue t}h&&h.push(m),c.push(v)}}return c}function Cr(t,e,n,r){return er(t,function(t,i,o){e(r,n(t),i,o)}),r}function Tr(t,e,n){Po(e,t)||(e=ki(e),t=Wo(t,e),e=ba(e));var r=null==t?t:t[Yo(e)];return null==r?it:s(r,t,n)}function jr(t){return rl(t)&&dr(t)==zt}function $r(t){return rl(t)&&dr(t)==se}function Ar(t){return rl(t)&&dr(t)==Vt}function Sr(t,e,n,r,i){return t===e||(null==t||null==e||!nl(t)&&!rl(e)?t!==t&&e!==e:Or(t,e,Sr,n,r,i))}function Or(t,e,n,r,i,o){var a=gh(t),s=gh(e),l=It,c=It;a||(l=Tu(t),l=l==zt?Yt:l),s||(c=Tu(e),c=c==zt?Yt:c);var f=l==Yt,u=c==Yt,h=l==c;if(h&&mh(t)){if(!mh(e))return!1;a=!0,f=!1}if(h&&!f)return o||(o=new yn),a||wh(t)?co(t,e,n,r,i,o):fo(t,e,l,n,r,i,o);if(!(i&kt)){var p=f&&gf.call(t,"__wrapped__"),d=u&&gf.call(e,"__wrapped__");if(p||d){var g=p?t.value():t,v=d?e.value():e;return o||(o=new yn),n(g,v,r,i,o)}}return!!h&&(o||(o=new yn),uo(t,e,n,r,i,o))}function Mr(t){return rl(t)&&Tu(t)==Jt}function Er(t,e,n,r){var i=n.length,o=i,a=!r;if(null==t)return!o;for(t=af(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],c=t[l],f=s[1];if(a&&s[2]){if(c===it&&!(l in t))return!1}else{var u=new yn;if(r)var h=r(c,f,l,t,e,u);if(!(h===it?Sr(f,c,r,wt|kt,u):h))return!1}}return!0}function Pr(t){if(!nl(t)||Ro(t))return!1;var e=Qs(t)?xf:We;return e.test(Ko(t))}function Nr(t){return rl(t)&&dr(t)==te}function Fr(t){return rl(t)&&Tu(t)==ee}function Rr(t){return rl(t)&&el(t.length)&&!!Wn[dr(t)]}function Br(t){return"function"==typeof t?t:null==t?Ac:"object"==typeof t?gh(t)?Vr(t[0],t[1]):qr(t):Rc(t)}function Dr(t){if(!Bo(t))return Vf(t);var e=[];for(var n in af(t))gf.call(t,n)&&"constructor"!=n&&e.push(n);return e}function zr(t){if(!nl(t))return Vo(t);var e=Bo(t),n=[];for(var r in t)("constructor"!=r||!e&&gf.call(t,r))&&n.push(r);return n}function Ir(t,e){return t<e}function Lr(t,e){var n=-1,r=Hs(t)?tf(t.length):[];return pu(t,function(t,i,o){r[++n]=e(t,i,o)}),r}function qr(t){var e=_o(t);return 1==e.length&&e[0][2]?zo(e[0][0],e[0][1]):function(n){return n===t||Er(n,t,e)}}function Vr(t,e){return Po(t)&&Do(e)?zo(Yo(t),e):function(n){var r=Fl(n,t);return r===it&&r===e?Bl(n,t):Sr(e,r,it,wt|kt)}}function Hr(t,e,n,r,i){t!==e&&gu(e,function(o,a){if(nl(o))i||(i=new yn),Ur(t,e,a,n,Hr,r,i);else{var s=r?r(t[a],o,a+"",t,e,i):it;s===it&&(s=o),Sn(t,a,s)}},zl)}function Ur(t,e,n,r,i,o,a){var s=t[n],l=e[n],c=a.get(l);if(c)return void Sn(t,n,c);var f=o?o(s,l,n+"",t,e,a):it,u=f===it;if(u){var h=gh(l),p=!h&&mh(l),d=!h&&!p&&wh(l);f=l,h||p||d?gh(s)?f=s:Us(s)?f=Bi(s):p?(u=!1,f=Ti(l,!0)):d?(u=!1,f=Ei(l,!0)):f=[]:ul(l)||dh(l)?(f=s,dh(s)?f=kl(s):(!nl(s)||r&&Qs(s))&&(f=$o(l))):u=!1}u&&(a.set(l,f),i(f,l,r,o,a),a.delete(l)),Sn(t,n,f)}function Wr(t,e){var n=t.length;if(n)return e+=e<0?n:0,Mo(e,n)?t[e]:it}function Zr(t,e,n){var r=-1;e=g(e.length?e:[Ac],F(yo()));var i=Lr(t,function(t,n,i){var o=g(e,function(e){return e(t)});return{criteria:o,index:++r,value:t}});return M(i,function(t,e){return Ni(t,e,n)})}function Jr(t,e){return t=af(t),Gr(t,e,function(e,n){return n in t})}function Gr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=t[a];n(s,a)&&Nn(o,a,s)}return o}function Xr(t){return function(e){return ar(e,t)}}function Yr(t,e,n,r){var i=r?T:C,o=-1,a=e.length,s=t;for(t===e&&(e=Bi(e)),n&&(s=g(t,F(n)));++o<a;)for(var l=0,c=e[o],f=n?n(c):c;(l=i(s,f,l,r))>-1;)s!==t&&Sf.call(s,l,1),Sf.call(t,l,1);return t}function Kr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;if(Mo(i))Sf.call(t,i,1);else if(Po(i,t))delete t[Yo(i)];else{var a=ki(i),s=Wo(t,a);null!=s&&delete s[Yo(ba(a))]}}}return t}function Qr(t,e){return t+Df(Jf()*(e-t+1))}function ti(t,e,n,r){for(var i=-1,o=Hf(Bf((e-t)/(n||1)),0),a=tf(o);o--;)a[r?o:++i]=t,t+=n;return a}function ei(t,e){var n="";if(!t||e<1||e>Et)return n;do e%2&&(n+=t),e=Df(e/2),e&&(t+=t);while(e);return n}function ni(t,e){return Su(Uo(t,e,Ac),t+"")}function ri(t){return Tn(Yl(t))}function ii(t,e){var n=Yl(t);return Xo(n,Rn(e,0,n.length))}function oi(t,e,n,r){if(!nl(t))return t;e=Po(e,t)?[e]:ki(e);for(var i=-1,o=e.length,a=o-1,s=t;null!=s&&++i<o;){var l=Yo(e[i]),c=n;if(i!=a){var f=s[l];c=r?r(f,l,s):it,c===it&&(c=nl(f)?f:Mo(e[i+1])?[]:{})}On(s,l,c),s=s[l]}return t}function ai(t){return Xo(Yl(t))}function si(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=tf(i);++r<i;)o[r]=t[r+e];return o}function li(t,e){var n;return pu(t,function(t,r,i){return n=e(t,r,i),!n}),!!n}function ci(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e===e&&i<=Bt){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!dl(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return fi(t,e,Ac,n)}function fi(t,e,n,r){e=n(e);for(var i=0,o=null==t?0:t.length,a=e!==e,s=null===e,l=dl(e),c=e===it;i<o;){var f=Df((i+o)/2),u=n(t[f]),h=u!==it,p=null===u,d=u===u,g=dl(u);if(a)var v=r||d;else v=c?d&&(r||h):s?d&&h&&(r||!p):l?d&&h&&!p&&(r||!g):!p&&!g&&(r?u<=e:u<e);v?i=f+1:o=f}return Uf(o,Rt)}function ui(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Vs(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function hi(t){return"number"==typeof t?t:dl(t)?Nt:+t}function pi(t){if("string"==typeof t)return t;if(gh(t))return g(t,pi)+"";if(dl(t))return uu?uu.call(t):"";var e=t+"";return"0"==e&&1/t==-Mt?"-0":e}function di(t,e,n){var r=-1,i=p,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=d;else if(o>=at){var c=e?null:xu(t);if(c)return G(c);a=!1,i=B,l=new gn}else l=e?[]:s;t:for(;++r<o;){var f=t[r],u=e?e(f):f;if(f=n||0!==f?f:0,a&&u===u){for(var h=l.length;h--;)if(l[h]===u)continue t;e&&l.push(u),s.push(f)}else i(l,u,n)||(l!==s&&l.push(u),s.push(f))}return s}function gi(t,e){e=Po(e,t)?[e]:ki(e),t=Wo(t,e);var n=Yo(ba(e));return!(null!=t&&gf.call(t,n))||delete t[n]}function vi(t,e,n,r){return oi(t,e,n(ar(t,e)),r)}function mi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?si(t,r?0:o,r?o+1:i):si(t,r?o+1:0,r?i:o)}function yi(t,e){var n=t;return n instanceof _&&(n=n.value()),m(e,function(t,e){return e.func.apply(e.thisArg,v([t],e.args))},n)}function bi(t,e,n){var r=t.length;if(r<2)return r?di(t[0]):[];for(var i=-1,o=tf(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=Vn(o[i]||a,t[s],e,n));return di(tr(o,1),e,n)}function _i(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:it;n(a,t[r],s)}return a}function xi(t){return Us(t)?t:[]}function wi(t){return"function"==typeof t?t:Ac}function ki(t){return gh(t)?t:Ou(t)}function Ci(t,e,n){var r=t.length;return n=n===it?r:n,!e&&n>=r?t:si(t,e,n)}function Ti(t,e){if(e)return t.slice();var n=t.length,r=Tf?Tf(n):new t.constructor(n);return t.copy(r),r}function ji(t){var e=new t.constructor(t.byteLength);return new Cf(e).set(new Cf(t)),e}function $i(t,e){var n=e?ji(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function Ai(t,e,n){var r=e?n(W(t),!0):W(t);return m(r,o,new t.constructor)}function Si(t){var e=new t.constructor(t.source,Ve.exec(t));return e.lastIndex=t.lastIndex,e}function Oi(t,e,n){var r=e?n(G(t),!0):G(t);return m(r,a,new t.constructor)}function Mi(t){return fu?af(fu.call(t)):{}}function Ei(t,e){var n=e?ji(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Pi(t,e){if(t!==e){var n=t!==it,r=null===t,i=t===t,o=dl(t),a=e!==it,s=null===e,l=e===e,c=dl(e);if(!s&&!c&&!o&&t>e||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t<e||c&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!l)return-1}return 0}function Ni(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var l=Pi(i[r],o[r]);if(l){if(r>=s)return l;var c=n[r];return l*("desc"==c?-1:1)}}return t.index-e.index}function Fi(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,l=e.length,c=Hf(o-a,0),f=tf(l+c),u=!r;++s<l;)f[s]=e[s];for(;++i<a;)(u||i<o)&&(f[n[i]]=t[i]);for(;c--;)f[s++]=t[i++];return f}function Ri(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,l=-1,c=e.length,f=Hf(o-s,0),u=tf(f+c),h=!r;++i<f;)u[i]=t[i];for(var p=i;++l<c;)u[p+l]=e[l];for(;++a<s;)(h||i<o)&&(u[p+n[a]]=t[i++]);return u}function Bi(t,e){var n=-1,r=t.length;for(e||(e=tf(r));++n<r;)e[n]=t[n];return e}function Di(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):it;l===it&&(l=t[s]),i?Nn(n,s,l):On(n,s,l)}return n}function zi(t,e){return Di(t,ku(t),e)}function Ii(t,e){return function(n,r){var i=gh(n)?l:En,o=e?e():{};return i(n,t,yo(r,2),o)}}function Li(t){return ni(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:it,a=i>2?n[2]:it;for(o=t.length>3&&"function"==typeof o?(i--,o):it,a&&Eo(n[0],n[1],a)&&(o=i<3?it:o,i=1),e=af(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e})}function qi(t,e){return function(n,r){if(null==n)return n;if(!Hs(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=af(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}function Vi(t){return function(e,n,r){for(var i=-1,o=af(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}function Hi(t,e,n){function r(){var e=this&&this!==nr&&this instanceof r?o:t;return e.apply(i?n:this,arguments)}var i=e&ht,o=Zi(t);return r}function Ui(t){return function(e){e=Tl(e);var n=V(e)?tt(e):it,r=n?n[0]:e.charAt(0),i=n?Ci(n,1).join(""):e.slice(1);return r[t]()+i}}function Wi(t){return function(e){return m(kc(rc(e).replace(Dn,"")),t,"")}}function Zi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=hu(t.prototype),r=t.apply(n,e);return nl(r)?r:n}}function Ji(t,e,n){function r(){for(var o=arguments.length,a=tf(o),l=o,c=mo(r);l--;)a[l]=arguments[l];var f=o<3&&a[0]!==c&&a[o-1]!==c?[]:J(a,c);if(o-=f.length,o<n)return oo(t,e,Yi,r.placeholder,it,a,f,it,it,n-o);var u=this&&this!==nr&&this instanceof r?i:t;return s(u,this,a)}var i=Zi(t);return r}function Gi(t){return function(e,n,r){var i=af(e);if(!Hs(e)){var o=yo(n,3);e=Dl(e),n=function(t){return o(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:it}}function Xi(t){return ho(function(e){var n=e.length,r=n,o=i.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new cf(lt);if(o&&!s&&"wrapper"==vo(a))var s=new i([],!0)}for(r=s?r:n;++r<n;){a=e[r];var l=vo(a),c="wrapper"==l?wu(a):it;s=c&&Fo(c[0])&&c[1]==(bt|gt|mt|_t)&&!c[4].length&&1==c[9]?s[vo(c[0])].apply(s,c[3]):1==a.length&&Fo(a)?s[l]():s.thru(a)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&gh(r)&&r.length>=at)return s.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}})}function Yi(t,e,n,r,i,o,a,s,l,c){function f(){for(var m=arguments.length,y=tf(m),b=m;b--;)y[b]=arguments[b];if(d)var _=mo(f),x=I(y,_);if(r&&(y=Fi(y,r,i,d)),o&&(y=Ri(y,o,a,d)),m-=x,d&&m<c){var w=J(y,_);return oo(t,e,Yi,f.placeholder,n,y,w,s,l,c-m)}var k=h?n:this,C=p?k[t]:t;return m=y.length,s?y=Zo(y,s):g&&m>1&&y.reverse(),u&&l<m&&(y.length=l),this&&this!==nr&&this instanceof f&&(C=v||Zi(C)),C.apply(k,y)}var u=e&bt,h=e&ht,p=e&pt,d=e&(gt|vt),g=e&xt,v=p?it:Zi(t);return f}function Ki(t,e){return function(n,r){return Cr(n,t,e(r),{})}}function Qi(t,e){return function(n,r){var i;if(n===it&&r===it)return e;if(n!==it&&(i=n),r!==it){if(i===it)return r;"string"==typeof n||"string"==typeof r?(n=pi(n),r=pi(r)):(n=hi(n),r=hi(r)),i=t(n,r)}return i}}function to(t){return ho(function(e){return e=g(e,F(yo())),ni(function(n){var r=this;return t(e,function(t){return s(t,r,n)})})})}function eo(t,e){e=e===it?" ":pi(e);var n=e.length;if(n<2)return n?ei(e,t):e;var r=ei(e,Bf(t/Q(e)));return V(e)?Ci(tt(r),0,t).join(""):r.slice(0,t)}function no(t,e,n,r){function i(){for(var e=-1,l=arguments.length,c=-1,f=r.length,u=tf(f+l),h=this&&this!==nr&&this instanceof i?a:t;++c<f;)u[c]=r[c];for(;l--;)u[c++]=arguments[++e];return s(h,o?n:this,u)}var o=e&ht,a=Zi(t);return i}function ro(t){return function(e,n,r){return r&&"number"!=typeof r&&Eo(e,n,r)&&(n=r=it),e=bl(e),n===it?(n=e,e=0):n=bl(n),r=r===it?e<n?1:-1:bl(r),ti(e,n,r,t)}}function io(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=wl(e),n=wl(n)),t(e,n)}}function oo(t,e,n,r,i,o,a,s,l,c){var f=e>,u=f?a:it,h=f?it:a,p=f?o:it,d=f?it:o;e|=f?mt:yt,e&=~(f?yt:mt),e&dt||(e&=~(ht|pt));var g=[t,e,i,p,u,d,h,s,l,c],v=n.apply(it,g);return Fo(t)&&$u(v,g),v.placeholder=r,Jo(v,t,e)}function ao(t){var e=of[t];return function(t,n){if(t=wl(t),n=Uf(_l(n),292)){var r=(Tl(t)+"e").split("e"),i=e(r[0]+"e"+(+r[1]+n));return r=(Tl(i)+"e").split("e"),+(r[0]+"e"+(+r[1]-n))}return e(t)}}function so(t){return function(e){var n=Tu(e);return n==Jt?W(e):n==ee?X(e):N(e,t(e))}}function lo(t,e,n,r,i,o,a,s){var l=e&pt;if(!l&&"function"!=typeof t)throw new cf(lt);var c=r?r.length:0;if(c||(e&=~(mt|yt),r=i=it),a=a===it?a:Hf(_l(a),0),s=s===it?s:_l(s),c-=i?i.length:0,e&yt){var f=r,u=i;r=i=it}var h=l?it:wu(t),p=[t,e,n,r,i,f,u,o,a,s];if(h&&Lo(p,h),t=p[0],e=p[1],n=p[2],r=p[3],i=p[4],s=p[9]=null==p[9]?l?0:t.length:Hf(p[9]-c,0),!s&&e&(gt|vt)&&(e&=~(gt|vt)),e&&e!=ht)d=e==gt||e==vt?Ji(t,e,s):e!=mt&&e!=(ht|mt)||i.length?Yi.apply(it,p):no(t,e,n,r);else var d=Hi(t,e,n);var g=h?mu:$u;return Jo(g(d,p),t,e)}function co(t,e,n,r,i,o){var a=i&kt,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var f=-1,u=!0,h=i&wt?new gn:it;for(o.set(t,e),o.set(e,t);++f<s;){var p=t[f],d=e[f];if(r)var g=a?r(d,p,f,e,t,o):r(p,d,f,t,e,o);if(g!==it){if(g)continue;u=!1;break}if(h){if(!b(e,function(t,e){if(!B(h,e)&&(p===t||n(p,t,r,i,o)))return h.push(e)})){u=!1;break}}else if(p!==d&&!n(p,d,r,i,o)){u=!1;break}}return o.delete(t),o.delete(e),u}function fo(t,e,n,r,i,o,a){switch(n){case le:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case se:return!(t.byteLength!=e.byteLength||!r(new Cf(t),new Cf(e)));case qt:case Vt:case Gt:return Vs(+t,+e);case Ut:return t.name==e.name&&t.message==e.message;case te:case ne:return t==e+"";case Jt:var s=W;case ee:var l=o&kt;if(s||(s=G),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;o|=wt,a.set(t,e);var f=co(s(t),s(e),r,i,o,a);return a.delete(t),f;case re:if(fu)return fu.call(t)==fu.call(e)}return!1}function uo(t,e,n,r,i,o){var a=i&kt,s=Dl(t),l=s.length,c=Dl(e),f=c.length;if(l!=f&&!a)return!1;for(var u=l;u--;){var h=s[u];if(!(a?h in e:gf.call(e,h)))return!1}var p=o.get(t);if(p&&o.get(e))return p==e;var d=!0;o.set(t,e),o.set(e,t);for(var g=a;++u<l;){h=s[u];var v=t[h],m=e[h];if(r)var y=a?r(m,v,h,e,t,o):r(v,m,h,t,e,o);if(!(y===it?v===m||n(v,m,r,i,o):y)){d=!1;break}g||(g="constructor"==h)}if(d&&!g){var b=t.constructor,_=e.constructor;b!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return o.delete(t),o.delete(e),d}function ho(t){return Su(Uo(t,it,ua),t+"")}function po(t){return sr(t,Dl,ku)}function go(t){return sr(t,zl,Cu)}function vo(t){for(var e=t.name+"",n=ru[e],r=gf.call(ru,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function mo(t){var e=gf.call(n,"placeholder")?n:t;return e.placeholder}function yo(){var t=n.iteratee||Sc;return t=t===Sc?Br:t,arguments.length?t(arguments[0],arguments[1]):t}function bo(t,e){var n=t.__data__;return No(e)?n["string"==typeof e?"string":"hash"]:n.map}function _o(t){for(var e=Dl(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Do(i)]}return e}function xo(t,e){var n=q(t,e);return Pr(n)?n:it}function wo(t){var e=gf.call(t,Ef),n=t[Ef];try{t[Ef]=it;var r=!0}catch(t){}var i=yf.call(t);return r&&(e?t[Ef]=n:delete t[Ef]),i}function ko(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Uf(e,t+a);break;case"takeRight":t=Hf(t,e-a)}}return{start:t,end:e}}function Co(t){var e=t.match(De);return e?e[1].split(ze):[]}function To(t,e,n){e=Po(e,t)?[e]:ki(e);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Yo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=null==t?0:t.length,!!i&&el(i)&&Mo(a,i)&&(gh(t)||dh(t)))}function jo(t){var e=t.length,n=t.constructor(e);return e&&"string"==typeof t[0]&&gf.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function $o(t){return"function"!=typeof t.constructor||Bo(t)?{}:hu(jf(t))}function Ao(t,e,n,r){var i=t.constructor;switch(e){case se:return ji(t);case qt:case Vt:return new i(+t);case le:return $i(t,r);case ce:case fe:case ue:case he:case pe:case de:case ge:case ve:case me:return Ei(t,r);case Jt:return Ai(t,r,n);case Gt:case ne:return new i(t);case te:return Si(t);case ee:return Oi(t,r,n);case re:return Mi(t)}}function So(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Be,"{\n/* [wrapped with "+e+"] */\n")}function Oo(t){return gh(t)||dh(t)||!!(Of&&t&&t[Of])}function Mo(t,e){return e=null==e?Et:e,!!e&&("number"==typeof t||Je.test(t))&&t>-1&&t%1==0&&t<e}function Eo(t,e,n){if(!nl(n))return!1;var r=typeof e;return!!("number"==r?Hs(n)&&Mo(e,n.length):"string"==r&&e in n)&&Vs(n[e],t)}function Po(t,e){if(gh(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!dl(t))||(Se.test(t)||!Ae.test(t)||null!=e&&t in af(e))}function No(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Fo(t){var e=vo(t),r=n[e];if("function"!=typeof r||!(e in _.prototype))return!1;if(t===r)return!0;var i=wu(r);return!!i&&t===i[0]}function Ro(t){return!!mf&&mf in t}function Bo(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||hf;return t===n}function Do(t){return t===t&&!nl(t)}function zo(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==it||t in af(n)))}}function Io(t){var e=Ss(t,function(t){return n.size===ft&&n.clear(),t}),n=e.cache;return e}function Lo(t,e){var n=t[1],r=e[1],i=n|r,o=i<(ht|pt|bt),a=r==bt&&n==gt||r==bt&&n==_t&&t[7].length<=e[8]||r==(bt|_t)&&e[7].length<=e[8]&&n==gt;if(!o&&!a)return t;r&ht&&(t[2]=e[2],i|=n&ht?0:dt);var s=e[3];if(s){var l=t[3];t[3]=l?Fi(l,s,e[4]):s,t[4]=l?J(t[3],ut):e[4]}return s=e[5],s&&(l=t[5],t[5]=l?Ri(l,s,e[6]):s,t[6]=l?J(t[5],ut):e[6]),s=e[7],s&&(t[7]=s),r&bt&&(t[8]=null==t[8]?e[8]:Uf(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}function qo(t,e,n,r,i,o){return nl(t)&&nl(e)&&(o.set(e,t),Hr(t,e,it,qo,o),o.delete(e)),t}function Vo(t){var e=[];if(null!=t)for(var n in af(t))e.push(n);return e}function Ho(t){return yf.call(t)}function Uo(t,e,n){return e=Hf(e===it?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Hf(r.length-e,0),a=tf(o);++i<o;)a[i]=r[e+i];i=-1;for(var l=tf(e+1);++i<e;)l[i]=r[i];return l[e]=n(a),s(t,this,l)}}function Wo(t,e){return 1==e.length?t:ar(t,si(e,0,-1))}function Zo(t,e){for(var n=t.length,r=Uf(e.length,n),i=Bi(t);r--;){var o=e[r];t[r]=Mo(o,n)?i[o]:it}return t}function Jo(t,e,n){var r=e+"";return Su(t,So(r,Qo(Co(r),n)))}function Go(t){var e=0,n=0;return function(){var r=Wf(),i=$t-(r-n);if(n=r,i>0){if(++e>=jt)return arguments[0]}else e=0;return t.apply(it,arguments)}}function Xo(t,e){var n=-1,r=t.length,i=r-1;for(e=e===it?r:e;++n<e;){var o=Qr(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}function Yo(t){if("string"==typeof t||dl(t))return t;var e=t+"";return"0"==e&&1/t==-Mt?"-0":e}function Ko(t){if(null!=t){try{return df.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Qo(t,e){return c(Dt,function(n){var r="_."+n[0];e&n[1]&&!p(t,r)&&t.push(r)}),t.sort()}function ta(t){if(t instanceof _)return t.clone();var e=new i(t.__wrapped__,t.__chain__);return e.__actions__=Bi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function ea(t,e,n){e=(n?Eo(t,e,n):e===it)?1:Hf(_l(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,a=tf(Bf(r/e));i<r;)a[o++]=si(t,i,i+=e);return a}function na(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i}function ra(){var t=arguments.length;if(!t)return[];for(var e=tf(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return v(gh(n)?Bi(n):[n],tr(e,1))}function ia(t,e,n){var r=null==t?0:t.length;return r?(e=n||e===it?1:_l(e),si(t,e<0?0:e,r)):[]}function oa(t,e,n){var r=null==t?0:t.length;return r?(e=n||e===it?1:_l(e),e=r-e,si(t,0,e<0?0:e)):[]}function aa(t,e){return t&&t.length?mi(t,yo(e,3),!0,!0):[]}function sa(t,e){return t&&t.length?mi(t,yo(e,3),!0):[]}function la(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Eo(t,e,n)&&(n=0,r=i),Xn(t,e,n,r)):[]}function ca(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:_l(n);return i<0&&(i=Hf(r+i,0)),k(t,yo(e,3),i)}function fa(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==it&&(i=_l(n),i=n<0?Hf(r+i,0):Uf(i,r-1)),k(t,yo(e,3),i,!0)}function ua(t){var e=null==t?0:t.length;return e?tr(t,1):[]}function ha(t){var e=null==t?0:t.length;return e?tr(t,Mt):[]}function pa(t,e){var n=null==t?0:t.length;return n?(e=e===it?1:_l(e),tr(t,e)):[]}function da(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r}function ga(t){return t&&t.length?t[0]:it}function va(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:_l(n);return i<0&&(i=Hf(r+i,0)),C(t,e,i)}function ma(t){var e=null==t?0:t.length;return e?si(t,0,-1):[]}function ya(t,e){return null==t?"":qf.call(t,e)}function ba(t){var e=null==t?0:t.length;return e?t[e-1]:it}function _a(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==it&&(i=_l(n),i=i<0?Hf(r+i,0):Uf(i,r-1)),e===e?K(t,e,i):k(t,j,i,!0)}function xa(t,e){return t&&t.length?Wr(t,_l(e)):it}function wa(t,e){return t&&t.length&&e&&e.length?Yr(t,e):t}function ka(t,e,n){return t&&t.length&&e&&e.length?Yr(t,e,yo(n,2)):t}function Ca(t,e,n){return t&&t.length&&e&&e.length?Yr(t,e,it,n):t}function Ta(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=yo(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Kr(t,i),n}function ja(t){return null==t?t:Gf.call(t)}function $a(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&Eo(t,e,n)?(e=0,n=r):(e=null==e?0:_l(e),n=n===it?r:_l(n)),si(t,e,n)):[]}function Aa(t,e){return ci(t,e)}function Sa(t,e,n){return fi(t,e,yo(n,2))}function Oa(t,e){var n=null==t?0:t.length;if(n){var r=ci(t,e);if(r<n&&Vs(t[r],e))return r}return-1}function Ma(t,e){return ci(t,e,!0)}function Ea(t,e,n){return fi(t,e,yo(n,2),!0)}function Pa(t,e){var n=null==t?0:t.length;if(n){var r=ci(t,e,!0)-1;if(Vs(t[r],e))return r}return-1}function Na(t){return t&&t.length?ui(t):[]}function Fa(t,e){return t&&t.length?ui(t,yo(e,2)):[]}function Ra(t){var e=null==t?0:t.length;return e?si(t,1,e):[]}function Ba(t,e,n){return t&&t.length?(e=n||e===it?1:_l(e),si(t,0,e<0?0:e)):[]}function Da(t,e,n){var r=null==t?0:t.length;return r?(e=n||e===it?1:_l(e),e=r-e,si(t,e<0?0:e,r)):[]}function za(t,e){return t&&t.length?mi(t,yo(e,3),!1,!0):[]}function Ia(t,e){return t&&t.length?mi(t,yo(e,3)):[]}function La(t){return t&&t.length?di(t):[]}function qa(t,e){return t&&t.length?di(t,yo(e,2)):[]}function Va(t,e){return e="function"==typeof e?e:it,t&&t.length?di(t,it,e):[]}function Ha(t){if(!t||!t.length)return[];var e=0;return t=h(t,function(t){if(Us(t))return e=Hf(t.length,e),!0}),P(e,function(e){return g(t,A(e))})}function Ua(t,e){if(!t||!t.length)return[];var n=Ha(t);return null==e?n:g(n,function(t){return s(e,it,t)})}function Wa(t,e){return _i(t||[],e||[],On)}function Za(t,e){return _i(t||[],e||[],oi)}function Ja(t){var e=n(t);return e.__chain__=!0,e}function Ga(t,e){return e(t),t}function Xa(t,e){return e(t)}function Ya(){return Ja(this)}function Ka(){return new i(this.value(),this.__chain__)}function Qa(){this.__values__===it&&(this.__values__=yl(this.value()));var t=this.__index__>=this.__values__.length,e=t?it:this.__values__[this.__index__++];return{done:t,value:e}}function ts(){return this}function es(t){for(var e,n=this;n instanceof r;){var i=ta(n);i.__index__=0,i.__values__=it,e?o.__wrapped__=i:e=i;var o=i;n=n.__wrapped__}return o.__wrapped__=t,e}function ns(){var t=this.__wrapped__;if(t instanceof _){var e=t;return this.__actions__.length&&(e=new _(this)),e=e.reverse(),e.__actions__.push({func:Xa,args:[ja],thisArg:it}),new i(e,this.__chain__)}return this.thru(ja)}function rs(){return yi(this.__wrapped__,this.__actions__)}function is(t,e,n){var r=gh(t)?u:Jn;return n&&Eo(t,e,n)&&(e=it),r(t,yo(e,3))}function os(t,e){var n=gh(t)?h:Yn;return n(t,yo(e,3))}function as(t,e){return tr(hs(t,e),1)}function ss(t,e){return tr(hs(t,e),Mt)}function ls(t,e,n){return n=n===it?1:_l(n),tr(hs(t,e),n)}function cs(t,e){var n=gh(t)?c:pu;return n(t,yo(e,3))}function fs(t,e){var n=gh(t)?f:du;return n(t,yo(e,3))}function us(t,e,n,r){t=Hs(t)?t:Yl(t),n=n&&!r?_l(n):0;var i=t.length;return n<0&&(n=Hf(i+n,0)),pl(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&C(t,e,n)>-1}function hs(t,e){var n=gh(t)?g:Lr;return n(t,yo(e,3))}function ps(t,e,n,r){return null==t?[]:(gh(e)||(e=null==e?[]:[e]),n=r?it:n,gh(n)||(n=null==n?[]:[n]),Zr(t,e,n))}function ds(t,e,n){var r=gh(t)?m:O,i=arguments.length<3;return r(t,yo(e,4),n,i,pu)}function gs(t,e,n){var r=gh(t)?y:O,i=arguments.length<3;return r(t,yo(e,4),n,i,du)}function vs(t,e){var n=gh(t)?h:Yn;return n(t,Os(yo(e,3)))}function ms(t){var e=gh(t)?Tn:ri;return e(t)}function ys(t,e,n){e=(n?Eo(t,e,n):e===it)?1:_l(e);var r=gh(t)?jn:ii;return r(t,e)}function bs(t){var e=gh(t)?$n:ai;return e(t)}function _s(t){if(null==t)return 0;if(Hs(t))return pl(t)?Q(t):t.length;var e=Tu(t);return e==Jt||e==ee?t.size:Dr(t).length}function xs(t,e,n){var r=gh(t)?b:li;return n&&Eo(t,e,n)&&(e=it),r(t,yo(e,3))}function ws(t,e){if("function"!=typeof e)throw new cf(lt);return t=_l(t),function(){if(--t<1)return e.apply(this,arguments)}}function ks(t,e,n){return e=n?it:e,e=t&&null==e?t.length:e,lo(t,bt,it,it,it,it,e)}function Cs(t,e){var n;if("function"!=typeof e)throw new cf(lt);return t=_l(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=it),n}}function Ts(t,e,n){e=n?it:e;var r=lo(t,gt,it,it,it,it,it,e);return r.placeholder=Ts.placeholder,r}function js(t,e,n){e=n?it:e;var r=lo(t,vt,it,it,it,it,it,e);return r.placeholder=js.placeholder,r}function $s(t,e,n){function r(e){var n=h,r=p;return h=p=it,y=e,g=t.apply(r,n)}function i(t){return y=t,v=Au(s,e),b?r(t):g}function o(t){var n=t-m,r=t-y,i=e-n;return _?Uf(i,d-r):i}function a(t){var n=t-m,r=t-y;return m===it||n>=e||n<0||_&&r>=d}function s(){var t=rh();return a(t)?l(t):void(v=Au(s,o(t)))}function l(t){return v=it,x&&h?r(t):(h=p=it,g)}function c(){v!==it&&_u(v),y=0,h=m=p=v=it}function f(){return v===it?g:l(rh())}function u(){var t=rh(),n=a(t);if(h=arguments,p=this,m=t,n){if(v===it)return i(m);if(_)return v=Au(s,e),r(m)}return v===it&&(v=Au(s,e)),g}var h,p,d,g,v,m,y=0,b=!1,_=!1,x=!0;if("function"!=typeof t)throw new cf(lt);return e=wl(e)||0,nl(n)&&(b=!!n.leading,_="maxWait"in n,d=_?Hf(wl(n.maxWait)||0,e):d,x="trailing"in n?!!n.trailing:x),u.cancel=c,u.flush=f,u}function As(t){return lo(t,xt)}function Ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new cf(lt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ss.Cache||cn),n}function Os(t){if("function"!=typeof t)throw new cf(lt);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Ms(t){return Cs(2,t)}function Es(t,e){if("function"!=typeof t)throw new cf(lt);return e=e===it?e:_l(e),ni(t,e)}function Ps(t,e){if("function"!=typeof t)throw new cf(lt);return e=e===it?0:Hf(_l(e),0),ni(function(n){var r=n[e],i=Ci(n,0,e);return r&&v(i,r),s(t,this,i)})}function Ns(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new cf(lt);return nl(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),$s(t,e,{leading:r,maxWait:e,trailing:i})}function Fs(t){return ks(t,1)}function Rs(t,e){return ch(wi(e),t)}function Bs(){if(!arguments.length)return[];var t=arguments[0];return gh(t)?t:[t]}function Ds(t){return Bn(t,!1,!0)}function zs(t,e){return e="function"==typeof e?e:it,Bn(t,!1,!0,e)}function Is(t){return Bn(t,!0,!0)}function Ls(t,e){return e="function"==typeof e?e:it,Bn(t,!0,!0,e)}function qs(t,e){return null==e||Ln(t,e,Dl(e))}function Vs(t,e){return t===e||t!==t&&e!==e}function Hs(t){return null!=t&&el(t.length)&&!Qs(t)}function Us(t){return rl(t)&&Hs(t)}function Ws(t){return t===!0||t===!1||rl(t)&&dr(t)==qt}function Zs(t){return rl(t)&&1===t.nodeType&&!ul(t)}function Js(t){if(null==t)return!0;if(Hs(t)&&(gh(t)||"string"==typeof t||"function"==typeof t.splice||mh(t)||wh(t)||dh(t)))return!t.length;var e=Tu(t);if(e==Jt||e==ee)return!t.size;if(Bo(t))return!Dr(t).length;for(var n in t)if(gf.call(t,n))return!1;return!0}function Gs(t,e){return Sr(t,e)}function Xs(t,e,n){n="function"==typeof n?n:it;var r=n?n(t,e):it;return r===it?Sr(t,e,n):!!r}function Ys(t){if(!rl(t))return!1;var e=dr(t);return e==Ut||e==Ht||"string"==typeof t.message&&"string"==typeof t.name&&!ul(t)}function Ks(t){return"number"==typeof t&&Lf(t)}function Qs(t){if(!nl(t))return!1;var e=dr(t);return e==Wt||e==Zt||e==Lt||e==Qt}function tl(t){return"number"==typeof t&&t==_l(t)}function el(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Et}function nl(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function rl(t){return null!=t&&"object"==typeof t}function il(t,e){return t===e||Er(t,e,_o(e))}function ol(t,e,n){return n="function"==typeof n?n:it,Er(t,e,_o(e),n)}function al(t){return fl(t)&&t!=+t}function sl(t){if(ju(t))throw new nf(st);return Pr(t)}function ll(t){return null===t}function cl(t){return null==t}function fl(t){return"number"==typeof t||rl(t)&&dr(t)==Gt}function ul(t){if(!rl(t)||dr(t)!=Yt)return!1;var e=jf(t);if(null===e)return!0;var n=gf.call(e,"constructor")&&e.constructor;
+return"function"==typeof n&&n instanceof n&&df.call(n)==bf}function hl(t){return tl(t)&&t>=-Et&&t<=Et}function pl(t){return"string"==typeof t||!gh(t)&&rl(t)&&dr(t)==ne}function dl(t){return"symbol"==typeof t||rl(t)&&dr(t)==re}function gl(t){return t===it}function vl(t){return rl(t)&&Tu(t)==oe}function ml(t){return rl(t)&&dr(t)==ae}function yl(t){if(!t)return[];if(Hs(t))return pl(t)?tt(t):Bi(t);if(Mf&&t[Mf])return U(t[Mf]());var e=Tu(t),n=e==Jt?W:e==ee?G:Yl;return n(t)}function bl(t){if(!t)return 0===t?t:0;if(t=wl(t),t===Mt||t===-Mt){var e=t<0?-1:1;return e*Pt}return t===t?t:0}function _l(t){var e=bl(t),n=e%1;return e===e?n?e-n:e:0}function xl(t){return t?Rn(_l(t),0,Ft):0}function wl(t){if("number"==typeof t)return t;if(dl(t))return Nt;if(nl(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=nl(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Ne,"");var n=Ue.test(t);return n||Ze.test(t)?Qn(t.slice(2),n?2:8):He.test(t)?Nt:+t}function kl(t){return Di(t,zl(t))}function Cl(t){return Rn(_l(t),-Et,Et)}function Tl(t){return null==t?"":pi(t)}function jl(t,e){var n=hu(t);return null==e?n:Pn(n,e)}function $l(t,e){return w(t,yo(e,3),er)}function Al(t,e){return w(t,yo(e,3),rr)}function Sl(t,e){return null==t?t:gu(t,yo(e,3),zl)}function Ol(t,e){return null==t?t:vu(t,yo(e,3),zl)}function Ml(t,e){return t&&er(t,yo(e,3))}function El(t,e){return t&&rr(t,yo(e,3))}function Pl(t){return null==t?[]:ir(t,Dl(t))}function Nl(t){return null==t?[]:ir(t,zl(t))}function Fl(t,e,n){var r=null==t?it:ar(t,e);return r===it?n:r}function Rl(t,e){return null!=t&&To(t,e,_r)}function Bl(t,e){return null!=t&&To(t,e,xr)}function Dl(t){return Hs(t)?Cn(t):Dr(t)}function zl(t){return Hs(t)?Cn(t,!0):zr(t)}function Il(t,e){var n={};return e=yo(e,3),er(t,function(t,r,i){Nn(n,e(t,r,i),t)}),n}function Ll(t,e){var n={};return e=yo(e,3),er(t,function(t,r,i){Nn(n,r,e(t,r,i))}),n}function ql(t,e){return Vl(t,Os(yo(e)))}function Vl(t,e){return null==t?{}:Gr(t,go(t),yo(e))}function Hl(t,e,n){e=Po(e,t)?[e]:ki(e);var r=-1,i=e.length;for(i||(t=it,i=1);++r<i;){var o=null==t?it:t[Yo(e[r])];o===it&&(r=i,o=n),t=Qs(o)?o.call(t):o}return t}function Ul(t,e,n){return null==t?t:oi(t,e,n)}function Wl(t,e,n,r){return r="function"==typeof r?r:it,null==t?t:oi(t,e,n,r)}function Zl(t,e,n){var r=gh(t),i=r||mh(t)||wh(t);if(e=yo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:nl(t)&&Qs(o)?hu(jf(t)):{}}return(i?c:er)(t,function(t,r,i){return e(n,t,r,i)}),n}function Jl(t,e){return null==t||gi(t,e)}function Gl(t,e,n){return null==t?t:vi(t,e,wi(n))}function Xl(t,e,n,r){return r="function"==typeof r?r:it,null==t?t:vi(t,e,wi(n),r)}function Yl(t){return null==t?[]:R(t,Dl(t))}function Kl(t){return null==t?[]:R(t,zl(t))}function Ql(t,e,n){return n===it&&(n=e,e=it),n!==it&&(n=wl(n),n=n===n?n:0),e!==it&&(e=wl(e),e=e===e?e:0),Rn(wl(t),e,n)}function tc(t,e,n){return e=bl(e),n===it?(n=e,e=0):n=bl(n),t=wl(t),wr(t,e,n)}function ec(t,e,n){if(n&&"boolean"!=typeof n&&Eo(t,e,n)&&(e=n=it),n===it&&("boolean"==typeof e?(n=e,e=it):"boolean"==typeof t&&(n=t,t=it)),t===it&&e===it?(t=0,e=1):(t=bl(t),e===it?(e=t,t=0):e=bl(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Jf();return Uf(t+i*(e-t+Kn("1e-"+((i+"").length-1))),e)}return Qr(t,e)}function nc(t){return Jh(Tl(t).toLowerCase())}function rc(t){return t=Tl(t),t&&t.replace(Ge,gr).replace(zn,"")}function ic(t,e,n){t=Tl(t),e=pi(e);var r=t.length;n=n===it?r:Rn(_l(n),0,r);var i=n;return n-=e.length,n>=0&&t.slice(n,i)==e}function oc(t){return t=Tl(t),t&&Ce.test(t)?t.replace(we,vr):t}function ac(t){return t=Tl(t),t&&Pe.test(t)?t.replace(Ee,"\\$&"):t}function sc(t,e,n){t=Tl(t),e=_l(e);var r=e?Q(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return eo(Df(i),n)+t+eo(Bf(i),n)}function lc(t,e,n){t=Tl(t),e=_l(e);var r=e?Q(t):0;return e&&r<e?t+eo(e-r,n):t}function cc(t,e,n){t=Tl(t),e=_l(e);var r=e?Q(t):0;return e&&r<e?eo(e-r,n)+t:t}function fc(t,e,n){return n||null==e?e=0:e&&(e=+e),Zf(Tl(t).replace(Fe,""),e||0)}function uc(t,e,n){return e=(n?Eo(t,e,n):e===it)?1:_l(e),ei(Tl(t),e)}function hc(){var t=arguments,e=Tl(t[0]);return t.length<3?e:e.replace(t[1],t[2])}function pc(t,e,n){return n&&"number"!=typeof n&&Eo(t,e,n)&&(e=n=it),(n=n===it?Ft:n>>>0)?(t=Tl(t),t&&("string"==typeof e||null!=e&&!_h(e))&&(e=pi(e),!e&&V(t))?Ci(tt(t),0,n):t.split(e,n)):[]}function dc(t,e,n){return t=Tl(t),n=Rn(_l(n),0,t.length),e=pi(e),t.slice(n,n+e.length)==e}function gc(t,e,r){var i=n.templateSettings;r&&Eo(t,e,r)&&(e=it),t=Tl(t),e=$h({},e,i,An);var o,a,s=$h({},e.imports,i.imports,An),l=Dl(s),c=R(s,l),f=0,u=e.interpolate||Xe,h="__p += '",p=sf((e.escape||Xe).source+"|"+u.source+"|"+(u===$e?qe:Xe).source+"|"+(e.evaluate||Xe).source+"|$","g"),d="//# sourceURL="+("sourceURL"in e?e.sourceURL:"lodash.templateSources["+ ++Un+"]")+"\n";t.replace(p,function(e,n,r,i,s,l){return r||(r=i),h+=t.slice(f,l).replace(Ye,L),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=l+e.length,e}),h+="';\n";var g=e.variable;g||(h="with (obj) {\n"+h+"\n}\n"),h=(a?h.replace(ye,""):h).replace(be,"$1").replace(_e,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var v=Gh(function(){return rf(l,d+"return "+h).apply(it,c)});if(v.source=h,Ys(v))throw v;return v}function vc(t){return Tl(t).toLowerCase()}function mc(t){return Tl(t).toUpperCase()}function yc(t,e,n){if(t=Tl(t),t&&(n||e===it))return t.replace(Ne,"");if(!t||!(e=pi(e)))return t;var r=tt(t),i=tt(e),o=D(r,i),a=z(r,i)+1;return Ci(r,o,a).join("")}function bc(t,e,n){if(t=Tl(t),t&&(n||e===it))return t.replace(Re,"");if(!t||!(e=pi(e)))return t;var r=tt(t),i=z(r,tt(e))+1;return Ci(r,0,i).join("")}function _c(t,e,n){if(t=Tl(t),t&&(n||e===it))return t.replace(Fe,"");if(!t||!(e=pi(e)))return t;var r=tt(t),i=D(r,tt(e));return Ci(r,i).join("")}function xc(t,e){var n=Ct,r=Tt;if(nl(e)){var i="separator"in e?e.separator:i;n="length"in e?_l(e.length):n,r="omission"in e?pi(e.omission):r}t=Tl(t);var o=t.length;if(V(t)){var a=tt(t);o=a.length}if(n>=o)return t;var s=n-Q(r);if(s<1)return r;var l=a?Ci(a,0,s).join(""):t.slice(0,s);if(i===it)return l+r;if(a&&(s+=l.length-s),_h(i)){if(t.slice(s).search(i)){var c,f=l;for(i.global||(i=sf(i.source,Tl(Ve.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var u=c.index;l=l.slice(0,u===it?s:u)}}else if(t.indexOf(pi(i),s)!=s){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+r}function wc(t){return t=Tl(t),t&&ke.test(t)?t.replace(xe,mr):t}function kc(t,e,n){return t=Tl(t),e=n?it:e,e===it?H(t)?rt(t):x(t):t.match(e)||[]}function Cc(t){var e=null==t?0:t.length,n=yo();return t=e?g(t,function(t){if("function"!=typeof t[1])throw new cf(lt);return[n(t[0]),t[1]]}):[],ni(function(n){for(var r=-1;++r<e;){var i=t[r];if(s(i[0],this,n))return s(i[1],this,n)}})}function Tc(t){return In(Bn(t,!0))}function jc(t){return function(){return t}}function $c(t,e){return null==t||t!==t?e:t}function Ac(t){return t}function Sc(t){return Br("function"==typeof t?t:Bn(t,!0))}function Oc(t){return qr(Bn(t,!0))}function Mc(t,e){return Vr(t,Bn(e,!0))}function Ec(t,e,n){var r=Dl(e),i=ir(e,r);null!=n||nl(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=ir(e,Dl(e)));var o=!(nl(n)&&"chain"in n&&!n.chain),a=Qs(t);return c(i,function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Bi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,v([this.value()],arguments))})}),t}function Pc(){return nr._===this&&(nr._=_f),this}function Nc(){}function Fc(t){return t=_l(t),ni(function(e){return Wr(e,t)})}function Rc(t){return Po(t)?A(Yo(t)):Xr(t)}function Bc(t){return function(e){return null==t?it:ar(t,e)}}function Dc(){return[]}function zc(){return!1}function Ic(){return{}}function Lc(){return""}function qc(){return!0}function Vc(t,e){if(t=_l(t),t<1||t>Et)return[];var n=Ft,r=Uf(t,Ft);e=yo(e),t-=Ft;for(var i=P(r,e);++n<t;)e(n);return i}function Hc(t){return gh(t)?g(t,Yo):dl(t)?[t]:Bi(Ou(t))}function Uc(t){var e=++vf;return Tl(t)+e}function Wc(t){return t&&t.length?Gn(t,Ac,yr):it}function Zc(t,e){return t&&t.length?Gn(t,yo(e,2),yr):it}function Jc(t){return $(t,Ac)}function Gc(t,e){return $(t,yo(e,2))}function Xc(t){return t&&t.length?Gn(t,Ac,Ir):it}function Yc(t,e){return t&&t.length?Gn(t,yo(e,2),Ir):it}function Kc(t){return t&&t.length?E(t,Ac):0}function Qc(t,e){return t&&t.length?E(t,yo(e,2)):0}e=null==e?nr:br.defaults(nr.Object(),e,br.pick(nr,Hn));var tf=e.Array,ef=e.Date,nf=e.Error,rf=e.Function,of=e.Math,af=e.Object,sf=e.RegExp,lf=e.String,cf=e.TypeError,ff=tf.prototype,uf=rf.prototype,hf=af.prototype,pf=e["__core-js_shared__"],df=uf.toString,gf=hf.hasOwnProperty,vf=0,mf=function(){var t=/[^.]+$/.exec(pf&&pf.keys&&pf.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),yf=hf.toString,bf=df.call(af),_f=nr._,xf=sf("^"+df.call(gf).replace(Ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wf=or?e.Buffer:it,kf=e.Symbol,Cf=e.Uint8Array,Tf=wf?wf.allocUnsafe:it,jf=Z(af.getPrototypeOf,af),$f=af.create,Af=hf.propertyIsEnumerable,Sf=ff.splice,Of=kf?kf.isConcatSpreadable:it,Mf=kf?kf.iterator:it,Ef=kf?kf.toStringTag:it,Pf=function(){try{var t=xo(af,"defineProperty");return t({},"",{}),t}catch(t){}}(),Nf=e.clearTimeout!==nr.clearTimeout&&e.clearTimeout,Ff=ef&&ef.now!==nr.Date.now&&ef.now,Rf=e.setTimeout!==nr.setTimeout&&e.setTimeout,Bf=of.ceil,Df=of.floor,zf=af.getOwnPropertySymbols,If=wf?wf.isBuffer:it,Lf=e.isFinite,qf=ff.join,Vf=Z(af.keys,af),Hf=of.max,Uf=of.min,Wf=ef.now,Zf=e.parseInt,Jf=of.random,Gf=ff.reverse,Xf=xo(e,"DataView"),Yf=xo(e,"Map"),Kf=xo(e,"Promise"),Qf=xo(e,"Set"),tu=xo(e,"WeakMap"),eu=xo(af,"create"),nu=tu&&new tu,ru={},iu=Ko(Xf),ou=Ko(Yf),au=Ko(Kf),su=Ko(Qf),lu=Ko(tu),cu=kf?kf.prototype:it,fu=cu?cu.valueOf:it,uu=cu?cu.toString:it,hu=function(){function t(){}return function(e){if(!nl(e))return{};if($f)return $f(e);t.prototype=e;var n=new t;return t.prototype=it,n}}();n.templateSettings={escape:Te,evaluate:je,interpolate:$e,variable:"",imports:{_:n}},n.prototype=r.prototype,n.prototype.constructor=n,i.prototype=hu(r.prototype),i.prototype.constructor=i,_.prototype=hu(r.prototype),_.prototype.constructor=_,nt.prototype.clear=Ie,nt.prototype.delete=Ke,nt.prototype.get=Qe,nt.prototype.has=tn,nt.prototype.set=en,nn.prototype.clear=rn,nn.prototype.delete=on,nn.prototype.get=an,nn.prototype.has=sn,nn.prototype.set=ln,cn.prototype.clear=fn,cn.prototype.delete=un,cn.prototype.get=hn,cn.prototype.has=pn,cn.prototype.set=dn,gn.prototype.add=gn.prototype.push=vn,gn.prototype.has=mn,yn.prototype.clear=bn,yn.prototype.delete=_n,yn.prototype.get=xn,yn.prototype.has=wn,yn.prototype.set=kn;var pu=qi(er),du=qi(rr,!0),gu=Vi(),vu=Vi(!0),mu=nu?function(t,e){return nu.set(t,e),t}:Ac,yu=Pf?function(t,e){return Pf(t,"toString",{configurable:!0,enumerable:!1,value:jc(e),writable:!0})}:Ac,bu=ni,_u=Nf||function(t){return nr.clearTimeout(t)},xu=Qf&&1/G(new Qf([,-0]))[1]==Mt?function(t){return new Qf(t)}:Nc,wu=nu?function(t){return nu.get(t)}:Nc,ku=zf?Z(zf,af):Dc,Cu=zf?function(t){for(var e=[];t;)v(e,ku(t)),t=jf(t);return e}:Dc,Tu=dr;(Xf&&Tu(new Xf(new ArrayBuffer(1)))!=le||Yf&&Tu(new Yf)!=Jt||Kf&&Tu(Kf.resolve())!=Kt||Qf&&Tu(new Qf)!=ee||tu&&Tu(new tu)!=oe)&&(Tu=function(t){var e=dr(t),n=e==Yt?t.constructor:it,r=n?Ko(n):"";if(r)switch(r){case iu:return le;case ou:return Jt;case au:return Kt;case su:return ee;case lu:return oe}return e});var ju=pf?Qs:zc,$u=Go(mu),Au=Rf||function(t,e){return nr.setTimeout(t,e)},Su=Go(yu),Ou=Io(function(t){t=Tl(t);var e=[];return Oe.test(t)&&e.push(""),t.replace(Me,function(t,n,r,i){e.push(r?i.replace(Le,"$1"):n||t)}),e}),Mu=ni(function(t,e){return Us(t)?Vn(t,tr(e,1,Us,!0)):[]}),Eu=ni(function(t,e){var n=ba(e);return Us(n)&&(n=it),Us(t)?Vn(t,tr(e,1,Us,!0),yo(n,2)):[]}),Pu=ni(function(t,e){var n=ba(e);return Us(n)&&(n=it),Us(t)?Vn(t,tr(e,1,Us,!0),it,n):[]}),Nu=ni(function(t){var e=g(t,xi);return e.length&&e[0]===t[0]?kr(e):[]}),Fu=ni(function(t){var e=ba(t),n=g(t,xi);return e===ba(n)?e=it:n.pop(),n.length&&n[0]===t[0]?kr(n,yo(e,2)):[]}),Ru=ni(function(t){var e=ba(t),n=g(t,xi);return e="function"==typeof e?e:it,e&&n.pop(),n.length&&n[0]===t[0]?kr(n,it,e):[]}),Bu=ni(wa),Du=ho(function(t,e){var n=null==t?0:t.length,r=Fn(t,e);return Kr(t,g(e,function(t){return Mo(t,n)?+t:t}).sort(Pi)),r}),zu=ni(function(t){return di(tr(t,1,Us,!0))}),Iu=ni(function(t){var e=ba(t);return Us(e)&&(e=it),di(tr(t,1,Us,!0),yo(e,2))}),Lu=ni(function(t){var e=ba(t);return e="function"==typeof e?e:it,di(tr(t,1,Us,!0),it,e)}),qu=ni(function(t,e){return Us(t)?Vn(t,e):[]}),Vu=ni(function(t){return bi(h(t,Us))}),Hu=ni(function(t){var e=ba(t);return Us(e)&&(e=it),bi(h(t,Us),yo(e,2))}),Uu=ni(function(t){var e=ba(t);return e="function"==typeof e?e:it,bi(h(t,Us),it,e)}),Wu=ni(Ha),Zu=ni(function(t){var e=t.length,n=e>1?t[e-1]:it;return n="function"==typeof n?(t.pop(),n):it,Ua(t,n)}),Ju=ho(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return Fn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof _&&Mo(n)?(r=r.slice(n,+n+(e?1:0)),r.__actions__.push({func:Xa,args:[o],thisArg:it}),new i(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(it),t})):this.thru(o)}),Gu=Ii(function(t,e,n){gf.call(t,n)?++t[n]:Nn(t,n,1)}),Xu=Gi(ca),Yu=Gi(fa),Ku=Ii(function(t,e,n){gf.call(t,n)?t[n].push(e):Nn(t,n,[e])}),Qu=ni(function(t,e,n){var r=-1,i="function"==typeof e,o=Po(e),a=Hs(t)?tf(t.length):[];return pu(t,function(t){var l=i?e:o&&null!=t?t[e]:it;a[++r]=l?s(l,t,n):Tr(t,e,n)}),a}),th=Ii(function(t,e,n){Nn(t,n,e)}),eh=Ii(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),nh=ni(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Eo(t,e[0],e[1])?e=[]:n>2&&Eo(e[0],e[1],e[2])&&(e=[e[0]]),Zr(t,tr(e,1),[])}),rh=Ff||function(){return nr.Date.now()},ih=ni(function(t,e,n){var r=ht;if(n.length){var i=J(n,mo(ih));r|=mt}return lo(t,r,e,n,i)}),oh=ni(function(t,e,n){var r=ht|pt;if(n.length){var i=J(n,mo(oh));r|=mt}return lo(e,r,t,n,i)}),ah=ni(function(t,e){return qn(t,1,e)}),sh=ni(function(t,e,n){return qn(t,wl(e)||0,n)});Ss.Cache=cn;var lh=bu(function(t,e){e=1==e.length&&gh(e[0])?g(e[0],F(yo())):g(tr(e,1),F(yo()));var n=e.length;return ni(function(r){for(var i=-1,o=Uf(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return s(t,this,r)})}),ch=ni(function(t,e){var n=J(e,mo(ch));return lo(t,mt,it,e,n)}),fh=ni(function(t,e){var n=J(e,mo(fh));return lo(t,yt,it,e,n)}),uh=ho(function(t,e){return lo(t,_t,it,it,it,e)}),hh=io(yr),ph=io(function(t,e){return t>=e}),dh=jr(function(){return arguments}())?jr:function(t){return rl(t)&&gf.call(t,"callee")&&!Af.call(t,"callee")},gh=tf.isArray,vh=lr?F(lr):$r,mh=If||zc,yh=cr?F(cr):Ar,bh=fr?F(fr):Mr,_h=ur?F(ur):Nr,xh=hr?F(hr):Fr,wh=pr?F(pr):Rr,kh=io(Ir),Ch=io(function(t,e){return t<=e}),Th=Li(function(t,e){if(Bo(e)||Hs(e))return void Di(e,Dl(e),t);for(var n in e)gf.call(e,n)&&On(t,n,e[n])}),jh=Li(function(t,e){Di(e,zl(e),t)}),$h=Li(function(t,e,n,r){Di(e,zl(e),t,r)}),Ah=Li(function(t,e,n,r){Di(e,Dl(e),t,r)}),Sh=ho(Fn),Oh=ni(function(t){return t.push(it,An),s($h,it,t)}),Mh=ni(function(t){return t.push(it,qo),s(Rh,it,t)}),Eh=Ki(function(t,e,n){t[e]=n},jc(Ac)),Ph=Ki(function(t,e,n){gf.call(t,e)?t[e].push(n):t[e]=[n]},yo),Nh=ni(Tr),Fh=Li(function(t,e,n){Hr(t,e,n)}),Rh=Li(function(t,e,n,r){Hr(t,e,n,r)}),Bh=ho(function(t,e){return null==t?{}:(e=g(e,Yo),Jr(t,Vn(go(t),e)))}),Dh=ho(function(t,e){return null==t?{}:Jr(t,g(e,Yo))}),zh=so(Dl),Ih=so(zl),Lh=Wi(function(t,e,n){return e=e.toLowerCase(),t+(n?nc(e):e)}),qh=Wi(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Vh=Wi(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),Hh=Ui("toLowerCase"),Uh=Wi(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Wh=Wi(function(t,e,n){return t+(n?" ":"")+Jh(e)}),Zh=Wi(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Jh=Ui("toUpperCase"),Gh=ni(function(t,e){try{return s(t,it,e)}catch(t){return Ys(t)?t:new nf(t)}}),Xh=ho(function(t,e){return c(e,function(e){e=Yo(e),Nn(t,e,ih(t[e],t))}),t}),Yh=Xi(),Kh=Xi(!0),Qh=ni(function(t,e){return function(n){return Tr(n,t,e)}}),tp=ni(function(t,e){return function(n){return Tr(t,n,e)}}),ep=to(g),np=to(u),rp=to(b),ip=ro(),op=ro(!0),ap=Qi(function(t,e){return t+e},0),sp=ao("ceil"),lp=Qi(function(t,e){return t/e},1),cp=ao("floor"),fp=Qi(function(t,e){return t*e},1),up=ao("round"),hp=Qi(function(t,e){return t-e},0);return n.after=ws,n.ary=ks,n.assign=Th,n.assignIn=jh,n.assignInWith=$h,n.assignWith=Ah,n.at=Sh,n.before=Cs,n.bind=ih,n.bindAll=Xh,n.bindKey=oh,n.castArray=Bs,n.chain=Ja,n.chunk=ea,n.compact=na,n.concat=ra,n.cond=Cc,n.conforms=Tc,n.constant=jc,n.countBy=Gu,n.create=jl,n.curry=Ts,n.curryRight=js,n.debounce=$s,n.defaults=Oh,n.defaultsDeep=Mh,n.defer=ah,n.delay=sh,n.difference=Mu,n.differenceBy=Eu,n.differenceWith=Pu,n.drop=ia,n.dropRight=oa,n.dropRightWhile=aa,n.dropWhile=sa,n.fill=la,n.filter=os,n.flatMap=as,n.flatMapDeep=ss,n.flatMapDepth=ls,n.flatten=ua,n.flattenDeep=ha,n.flattenDepth=pa,n.flip=As,n.flow=Yh,n.flowRight=Kh,n.fromPairs=da,n.functions=Pl,n.functionsIn=Nl,n.groupBy=Ku,n.initial=ma,n.intersection=Nu,n.intersectionBy=Fu,n.intersectionWith=Ru,n.invert=Eh,n.invertBy=Ph,n.invokeMap=Qu,n.iteratee=Sc,n.keyBy=th,n.keys=Dl,n.keysIn=zl,n.map=hs,n.mapKeys=Il,n.mapValues=Ll,n.matches=Oc,n.matchesProperty=Mc,n.memoize=Ss,n.merge=Fh,n.mergeWith=Rh,n.method=Qh,n.methodOf=tp,n.mixin=Ec,n.negate=Os,n.nthArg=Fc,n.omit=Bh,n.omitBy=ql,n.once=Ms,n.orderBy=ps,n.over=ep,n.overArgs=lh,n.overEvery=np,n.overSome=rp,n.partial=ch,n.partialRight=fh,n.partition=eh,n.pick=Dh,n.pickBy=Vl,n.property=Rc,n.propertyOf=Bc,n.pull=Bu,n.pullAll=wa,n.pullAllBy=ka,n.pullAllWith=Ca,n.pullAt=Du,n.range=ip,n.rangeRight=op,n.rearg=uh,n.reject=vs,n.remove=Ta,n.rest=Es,n.reverse=ja,n.sampleSize=ys,n.set=Ul,n.setWith=Wl,n.shuffle=bs,n.slice=$a,n.sortBy=nh,n.sortedUniq=Na,n.sortedUniqBy=Fa,n.split=pc,n.spread=Ps,n.tail=Ra,n.take=Ba,n.takeRight=Da,n.takeRightWhile=za,n.takeWhile=Ia,n.tap=Ga,n.throttle=Ns,n.thru=Xa,n.toArray=yl,n.toPairs=zh,n.toPairsIn=Ih,n.toPath=Hc,n.toPlainObject=kl,n.transform=Zl,n.unary=Fs,n.union=zu,n.unionBy=Iu,n.unionWith=Lu,n.uniq=La,n.uniqBy=qa,n.uniqWith=Va,n.unset=Jl,n.unzip=Ha,n.unzipWith=Ua,n.update=Gl,n.updateWith=Xl,n.values=Yl,n.valuesIn=Kl,n.without=qu,n.words=kc,n.wrap=Rs,n.xor=Vu,n.xorBy=Hu,n.xorWith=Uu,n.zip=Wu,n.zipObject=Wa,n.zipObjectDeep=Za,n.zipWith=Zu,n.entries=zh,n.entriesIn=Ih,n.extend=jh,n.extendWith=$h,Ec(n,n),n.add=ap,n.attempt=Gh,n.camelCase=Lh,n.capitalize=nc,n.ceil=sp,n.clamp=Ql,n.clone=Ds,n.cloneDeep=Is,n.cloneDeepWith=Ls,n.cloneWith=zs,n.conformsTo=qs,n.deburr=rc,n.defaultTo=$c,n.divide=lp,n.endsWith=ic,n.eq=Vs,n.escape=oc,n.escapeRegExp=ac,n.every=is,n.find=Xu,n.findIndex=ca,n.findKey=$l,n.findLast=Yu,n.findLastIndex=fa,n.findLastKey=Al,n.floor=cp,n.forEach=cs,n.forEachRight=fs,n.forIn=Sl,n.forInRight=Ol,n.forOwn=Ml,n.forOwnRight=El,n.get=Fl,n.gt=hh,n.gte=ph,n.has=Rl,n.hasIn=Bl,n.head=ga,n.identity=Ac,n.includes=us,n.indexOf=va,n.inRange=tc,n.invoke=Nh,n.isArguments=dh,n.isArray=gh,n.isArrayBuffer=vh,n.isArrayLike=Hs,n.isArrayLikeObject=Us,n.isBoolean=Ws,n.isBuffer=mh,n.isDate=yh,n.isElement=Zs,n.isEmpty=Js,n.isEqual=Gs,n.isEqualWith=Xs,n.isError=Ys,n.isFinite=Ks,n.isFunction=Qs,n.isInteger=tl,n.isLength=el,n.isMap=bh,n.isMatch=il,n.isMatchWith=ol,n.isNaN=al,n.isNative=sl,n.isNil=cl,n.isNull=ll,n.isNumber=fl,n.isObject=nl,n.isObjectLike=rl,n.isPlainObject=ul,n.isRegExp=_h,n.isSafeInteger=hl,n.isSet=xh,n.isString=pl,n.isSymbol=dl,n.isTypedArray=wh,n.isUndefined=gl,n.isWeakMap=vl,n.isWeakSet=ml,n.join=ya,n.kebabCase=qh,n.last=ba,n.lastIndexOf=_a,n.lowerCase=Vh,n.lowerFirst=Hh,n.lt=kh,n.lte=Ch,n.max=Wc,n.maxBy=Zc,n.mean=Jc,n.meanBy=Gc,n.min=Xc,n.minBy=Yc,n.stubArray=Dc,n.stubFalse=zc,n.stubObject=Ic,n.stubString=Lc,n.stubTrue=qc,n.multiply=fp,n.nth=xa,n.noConflict=Pc,n.noop=Nc,n.now=rh,n.pad=sc,n.padEnd=lc,n.padStart=cc,n.parseInt=fc,n.random=ec,n.reduce=ds,n.reduceRight=gs,n.repeat=uc,n.replace=hc,n.result=Hl,n.round=up,n.runInContext=t,n.sample=ms,n.size=_s,n.snakeCase=Uh,n.some=xs,n.sortedIndex=Aa,n.sortedIndexBy=Sa,n.sortedIndexOf=Oa,n.sortedLastIndex=Ma,n.sortedLastIndexBy=Ea,n.sortedLastIndexOf=Pa,n.startCase=Wh,n.startsWith=dc,n.subtract=hp,n.sum=Kc,n.sumBy=Qc,n.template=gc,n.times=Vc,n.toFinite=bl,n.toInteger=_l,n.toLength=xl,n.toLower=vc,n.toNumber=wl,n.toSafeInteger=Cl,n.toString=Tl,n.toUpper=mc,n.trim=yc,n.trimEnd=bc,n.trimStart=_c,n.truncate=xc,n.unescape=wc,n.uniqueId=Uc,n.upperCase=Zh,n.upperFirst=Jh,n.each=cs,n.eachRight=fs,n.first=ga,Ec(n,function(){var t={};return er(n,function(e,r){gf.call(n.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),n.VERSION=ot,c(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){n[t].placeholder=n}),c(["drop","take"],function(t,e){_.prototype[t]=function(n){var r=this.__filtered__;if(r&&!e)return new _(this);n=n===it?1:Hf(_l(n),0);var i=this.clone();return r?i.__takeCount__=Uf(n,i.__takeCount__):i.__views__.push({size:Uf(n,Ft),type:t+(i.__dir__<0?"Right":"")}),i},_.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),c(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==At||n==Ot;_.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:yo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),c(["head","last"],function(t,e){var n="take"+(e?"Right":"");_.prototype[t]=function(){return this[n](1).value()[0]}}),c(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");_.prototype[t]=function(){return this.__filtered__?new _(this):this[n](1)}}),_.prototype.compact=function(){return this.filter(Ac)},_.prototype.find=function(t){return this.filter(t).head()},_.prototype.findLast=function(t){return this.reverse().find(t)},_.prototype.invokeMap=ni(function(t,e){return"function"==typeof t?new _(this):this.map(function(n){return Tr(n,t,e)})}),_.prototype.reject=function(t){return this.filter(Os(yo(t)))},_.prototype.slice=function(t,e){t=_l(t);var n=this;return n.__filtered__&&(t>0||e<0)?new _(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==it&&(e=_l(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)},_.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},_.prototype.toArray=function(){return this.take(Ft)},er(_.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),a=n[o?"take"+("last"==e?"Right":""):e],s=o||/^find/.test(e);a&&(n.prototype[e]=function(){var e=this.__wrapped__,l=o?[1]:arguments,c=e instanceof _,f=l[0],u=c||gh(e),h=function(t){var e=a.apply(n,v([t],l));return o&&p?e[0]:e};u&&r&&"function"==typeof f&&1!=f.length&&(c=u=!1);var p=this.__chain__,d=!!this.__actions__.length,g=s&&!p,m=c&&!d;if(!s&&u){e=m?e:new _(this);var y=t.apply(e,l);return y.__actions__.push({func:Xa,args:[h],thisArg:it}),new i(y,p)}return g&&m?t.apply(this,l):(y=this.thru(h),g?o?y.value()[0]:y.value():y)})}),c(["pop","push","shift","sort","splice","unshift"],function(t){var e=ff[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);n.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var n=this.value();return e.apply(gh(n)?n:[],t)}return this[r](function(n){return e.apply(gh(n)?n:[],t)})}}),er(_.prototype,function(t,e){var r=n[e];if(r){var i=r.name+"",o=ru[i]||(ru[i]=[]);o.push({name:e,func:r})}}),ru[Yi(it,pt).name]=[{name:"wrapper",func:it}],_.prototype.clone=S,_.prototype.reverse=Y,_.prototype.value=et,n.prototype.at=Ju,n.prototype.chain=Ya,n.prototype.commit=Ka,n.prototype.next=Qa,n.prototype.plant=es,n.prototype.reverse=ns,n.prototype.toJSON=n.prototype.valueOf=n.prototype.value=rs,n.prototype.first=n.prototype.head,Mf&&(n.prototype[Mf]=ts),n},br=yr();nr._=br,r=function(){return br}.call(e,n,e,i),!(r!==it&&(i.exports=r))}).call(this)}).call(e,function(){return this}(),n(229)(t))},function(t,e,n){var r,i;n(225),r=n(62);var o=n(209);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-64c3b6ce",t.exports=r},function(t,e,n){var r,i;n(216),r=n(73);var o=n(199);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-1826f540",t.exports=r},function(t,e,n){var r,i;n(215),r=n(76);var o=n(198);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-163b42f5",t.exports=r},function(t,e,n){var r,i;r=n(79);var o=n(204);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(87),o=r(i),a=n(85),s=r(a),l=n(227);e.default={data:function(){return{items:[],query:"",current:-1,loading:!1,selectFirst:!1,queryParamName:"q"}},computed:{hasItems:function(){return this.items.length>0},isEmpty:function(){return!this.query},isDirty:function(){return!!this.query}},methods:{update:function(){var t=this;return this.query?void(this.minChars&&this.query.length<this.minChars||(this.loading=!0,this.fetch().then(function(e){if(t.query){var n=e.data;n=t.prepareResponseData?t.prepareResponseData(n):n,t.items=t.limit?n.slice(0,t.limit):n,t.current=-1,t.loading=!1,t.selectFirst&&t.down()}}))):this.reset()},fetch:function(){if(!this.$http)return l.util.warn("You need to install the `vue-resource` plugin",this);if(!this.src)return l.util.warn("You need to set the `src` property",this);var t=this.queryParamName?this.src:this.src+this.query,e=this.queryParamName?(0,s.default)((0,o.default)({},this.queryParamName,this.query),this.data):this.data;return this.$http.get(t,{params:e})},reset:function(){this.items=[],this.query="",this.loading=!1},setActive:function(t){this.current=t},activeClass:function(t){return{active:this.current===t}},hit:function(){this.current!==-1&&this.onHit(this.items[this.current])},up:function(){this.current>0?this.current--:this.current===-1?this.current=this.items.length-1:this.current=-1},down:function(){this.current<this.items.length-1?this.current++:this.current=-1},onHit:function(){l.util.warn("You need to implement the `onHit` method",this)}}}},function(t,e){"use strict";var n=t.exports,r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]};Object.keys(r).forEach(function(t){var e=r[t],i=n[t]={};i.open="["+e[0]+"m",i.close="["+e[1]+"m"})},function(t,e,n){(function(t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={data:function(){return{}},mounted:function(){t(".collection-container").hide(),t(".collection-description-complete").hide(),t("#show-main-collections").hide()},methods:{pickOtherCollection:function(e){t("#show-collection-"+e).hasClass("btn-primary")||(t("#main-panel").hide(),t("#show-main-collections").show(),t(".collection-container").removeClass("selected"),t(".collection-container:not(.selected)").hide(),t(".collection-description-complete").hide(),t(".collection-description").show(),t(".btn-collection").removeClass("btn-primary"),t("#show-collection-"+e).addClass("btn-primary"),t(".collection-container#collection-panel-"+e).show(),t(".collection-container#collection-panel-"+e).addClass("selected"))},showMainPanel:function(){t(".collection-container").removeClass("selected"),t(".btn-collection").removeClass("btn-primary"),t(".collection-container").hide(),t("#main-panel").show(),t("#show-main-collections").hide()},showCompleteDescription:function(e){t(".collection-description-complete").hide(),t("#collection-description-short-"+e).hide(),t("#collection-description-complete-"+e).show()},hideCompleteDescription:function(e){t(".collection-description-complete").hide(),t("#collection-description-short-"+e).show()}}}}).call(e,n(1))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(82),o=r(i),a=n(37),s=r(a),l=n(57),c=r(l);e.default={el:"#drawing-zone",MODE_RECT:"RECT",MODE_FREE:"FREE",ZOOM_IN:"in",ZOOM_OUT:"out",components:{typeahead:s.default,zoomview:c.default},data:{mode:"",isRect:!0,normalizePath:"",readOnly:!1,formView:!0,useClipPath:!1,transformMatrix:"",fragmentPath:"",canZoom:!0,displayMask:!1},mounted:function(){var t=this;this.initialDrawingMode=null,this.drawingComponent=o.default.init({wrapperId:"#iconolab-image-wrapper",actionWrapper:"#action-wrapper",readOnly:!1,onDrawingModeChange:function(e){t.setDrawingMode(e,!1)}}),this.$refs.zoomview.setZoomTarget(this.drawingComponent.getPaper()),this.showForm()},methods:{computeCentreredViewBox:function(){var t=this.$refs.zoomSvg,e=[],n=t.getAttribute("width"),r=t.getAttribute("height"),i=n/100,o=r/100,a=this.drawingComponent.getShapeBBox();return e=[(a.x-1)*i,(a.y-1)*o,(a.w+2)*i,(a.h+2)*o],e.join(" ")},computeZoomedViewBox:function(){var t=[],e=this.$refs.zoomSvg,n=this.drawingComponent.getShapeBBox(),r=e.getAttribute("width"),i=e.getAttribute("height"),o=r/100,a=i/100;n.x=n.x*o,n.y=n.y*a,n.w=n.w*o,n.h=n.h*a;var s=r/i;return n.w>n.h?(n.y=Math.max(0,n.y-(n.w*s-n.h)/2),n.h=n.w*s):(n.x=Math.max(0,n.x-(n.h/s-n.w)/2),n.w=n.h/s),t=[n.x,n.y,n.w,n.h],!!n&&t.join(" ")},zoom:function(t){var e=this.$refs.smallSvgWrapper;if(this.$options.ZOOM_OUT===t){var n=[0,0,e.getAttribute("width"),e.getAttribute("height")];e.setAttribute("viewBox",n.join(" ")),this.canZoom=!0}this.$options.ZOOM_IN===t&&(e.setAttribute("viewBox",this.computeCentreredViewBox()),this.canZoom=!1)},setDrawingMode:function(t,e){this.initialDrawingMode||(this.initialDrawingMode=t);var e="boolean"!=typeof e||e;this.mode=this.$options["MODE_"+t],this.isRect=this.mode===this.$options.MODE_RECT,e&&this.drawingComponent.setDrawingMode(this.mode)},cancel:function(){this.formView=!0;var t=this.$refs.currentPath.getAttribute("d");t.length&&this.initialDrawingMode&&(t+=";"+this.initialDrawingMode,this.drawingComponent.setPath(t))},highLightZone:function(){this.displayMask?this.displayMask=!1:this.displayMask=!0},displayEditedPath:function(){this.drawingComponent.getPath()},resetZoom:function(){this.zoom(this.$options.ZOOM_OUT)},showEditor:function(){this.formView=!1,this.resetZoom()},showForm:function(){this.normalizePath=this.drawingComponent.getPath();var t=this.$refs.smallImage;this.formView=!0;var e=t.getAttribute("width")/100,n=t.getAttribute("height")/100,r=[e,0,0,n,0,0].join(",");this.transformMatrix="matrix("+r+")",this.fragmentPath=this.normalizePath.split(";")[0]},clear:function(){this.drawingComponent.clear()}}}},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(192),s=r(a);e.default=(o={components:{modalpanel:s.default},mounted:function(){},props:["transform-matrix","image-path","image-height","image-width"],data:function(){return{diffText:"",tagMode:!1,textMode:!1,fragmentMode:!1,originalPath:"",modifiedPath:"",tags:[]}}},i(o,"mounted",function(){return!1}),i(o,"computed",{matrixTransform:function t(){var t="";return this.transformMatrix&&(t="matrix("+this.transformMatrix+")"),t}}),i(o,"methods",{setContent:function(t){this.$refs.modalcontent.appendChild(t)},switchMode:function(t){
+var e=["tagMode","textMode","fragmentMode"];this.tagMode=!1,this.textMode=!1,this.fragmentMode=!1,e.indexOf(t)!==-1&&(this[t]=!0)},showTagDiff:function(t,e){this.switchMode("tagMode");var n=iconolab.JsonDiff.diff(t,e),r=[];if(t.forEach(function(t,i){var t=JSON.parse(JSON.stringify(t)),o=n["_"+i],a=n[i];return o||a||r.push(t),Array.isArray(o)?(t.action="del",r.push(t),!0):a&&(a.tag_label||a.relevancy||a.accuracy)?(t.action=a.tag_label?"replace":"update",t.new_label=e[i].tag_label,t.new_accuracy=e[i].accuracy,t.new_relevancy=e[i].relevancy,r.push(t),!0):Array.isArray(a)?(t.action="add",r.push(e[i]),!0):void 0}),t.length<e.length){var i=e.slice(t.length);i.forEach(function(t,e){t.action="add",r.push(t)})}this.tags=r},showTextDiff:function(e,n){this.switchMode("textMode");for(var r=iconolab.JsDiff.diffWords(e,n),i=document.createDocumentFragment(),o=0;o<r.length;o++){if(r[o].added&&r[o+1]&&r[o+1].removed){var a=r[o];r[o]=r[o+1],r[o+1]=a}var s;r[o].removed?(s=document.createElement("del"),s.appendChild(document.createTextNode(r[o].value))):r[o].added?(s=document.createElement("ins"),s.appendChild(document.createTextNode(r[o].value))):s=document.createTextNode(r[o].value),i.appendChild(s)}this.diffText=t("<div>").append(i).html()},showFragmentDiff:function(t,e){this.switchMode("fragmentMode"),this.originalPath=t,this.modifiedPath=e},show:function(){this.$refs.panel.show()},hide:function(){this.$refs.panel.hide()}}),o)}).call(e,n(1))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(36),o=r(i),a=n(53),s=r(a),l={title:"",description:"",fragment:"",tags:[],readonly:!0};e.default={props:{action:String,annotation:{type:Object,default:function(){return null}}},components:{"tag-list":o.default},data:function(){return l},watch:{annotation:function(t){t?Object.assign(this,{title:t.title,description:t.description,fragment:t.fragment,tags:t.tags.slice(),readonly:!0}):this.reset()}},computed:{formAction:function(){if(this.annotation)return this.action.replace(":annotation_guid",this.annotation.annotation_guid)},serializedTags:function(){var t=this.tags.map(function(t){return{tag_input:"string"==typeof t.tag_link&&t.tag_link.length?t.tag_link:t.tag_label,tag_label:t.tag_label,accuracy:t.accuracy,relevancy:t.relevancy}});return JSON.stringify(t)},hasChanged:function(){return!!this.annotation&&(this.title!==this.annotation.title||this.description!==this.annotation.description||!s.default.isEqual(this.annotation.tags,this.tags))}},methods:{onTagsChange:function(t){this.tags=t},reset:function(){Object.assign(this,l)}}}},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),a=n(188),s=r(a),l=n(187),c=r(l),f=n(190),u=r(f);e.default={props:{image:String,thumbnail:String,annotation:{type:Object,default:null},tooltip:{type:Boolean,default:!1}},components:{shapeRect:s.default,shapeFree:c.default,zoomThumbnail:u.default},data:function(){return{paper:null,loaded:!1,mode:"rect",viewport:{width:0,height:0},viewBox:[0,0,0,0],zoomFactor:.1,scale:1,imgMinSize:0,imageWidth:0,imageHeight:0,readonly:!1}},computed:{canvasClass:function(){return{"canvas--rect":!this.readonly&&"rect"===this.mode,"canvas--free":!this.readonly&&"free"===this.mode}}},watch:{mode:function(t){this.reset(),"free"===t&&this.handleDrawFree(),"rect"===t&&this.handleDrawRect()},loaded:function(t){t&&(this.annotation?this.loadAnnotation():("free"===this.mode&&this.handleDrawFree(),"rect"===this.mode&&this.handleDrawRect()))},annotation:function(t){this.reset(),this.readonly=!!t,this.annotation&&this.loadAnnotation()},scale:function(t){var e=this,n=0;if(t>1&&(n=t-1),1===t)this.resetViewBox();else{var r=this.getCenter(),i=this.imgMinSize-this.imgMinSize*n,o=i,a=[r.x-i/2,r.y-o/2,i,o];this.hideTooltip(),this.animateViewBox(a,function(){return e.showTooltip()})}}},mounted:function(){var t=this,e=new Image;e.onload=function(n){t.paper=new o.default(t.$refs.svg),t.imgMinSize=Math.min(e.width,e.height),console.log("Image: %s x %s",e.width,e.height),setTimeout(function(){var n=t.paper.node.getBoundingClientRect();console.log("Viewport: %s x %s",n.width,n.height);var r=[0,0,e.width,e.height],i={width:n.width,height:n.height};Object.assign(t,{imageWidth:e.width,imageHeight:e.height,viewBox:r,viewport:i});var o=15*Math.min(r[2],r[3])/i.width;t.$refs.rect.handlerSize=o,t.$refs.free.handlerRadius=o/2,t.paper.attr({viewBox:t.viewBox}),t.loaded=!0},100)},e.src=this.image},methods:{hideTooltip:function(){"free"===this.mode&&this.$refs.free.hideTooltip(),"rect"===this.mode&&this.$refs.rect.hideTooltip()},showTooltip:function(){"free"===this.mode&&this.$refs.free.showTooltip(),"rect"===this.mode&&this.$refs.rect.showTooltip()},reset:function(){this.$refs.rect.clear(),this.$refs.free.clear(),this.removeEventHandlers(),this.resetZoom(),this.resetViewBox(),"free"===this.mode&&this.handleDrawFree(),"rect"===this.mode&&this.handleDrawRect()},removeEventHandlers:function(){this.paper.unmousedown(),this.paper.unmousemove(),this.paper.unmouseup(),this.paper.unclick()},loadAnnotation:function(){var t=this;if(this.annotation.fragment.length>0){var e=this.annotation.fragment.split(";"),n=e[0],r=e[1].toLowerCase();this.mode=r,this.$nextTick(function(){n=t.denormalizePath(n),"free"===r&&t.$refs.free.fromSVGPath(n,t.tooltip),"rect"===r&&t.$refs.rect.fromSVGPath(n,t.tooltip)})}},setMode:function(t){this.readonly||(this.mode=t)},getCenter:function(){return{x:this.viewBox[0]+this.viewBox[2]/2,y:this.viewBox[1]+this.viewBox[3]/2}},changeViewBox:function(t){var e=this.viewBox.slice();e[0]=t.x,e[1]=t.y,this.paper.attr({viewBox:e})},resetZoom:function(){this.scale=1,this.$refs.thumbnail.reset()},animateViewBox:function(t,e){var n=this,r=this.viewBox.slice();o.default.animate(r,t,function(t){return n.paper.attr({viewBox:t})},350,mina.easeinout,function(){n.viewBox=t,e&&e()})},resetViewBox:function(){this.animateViewBox([0,0,this.imageWidth,this.imageHeight])},zoomIn:function(){this.scale>=1.9||(this.scale=this.scale+1*this.zoomFactor)},zoomOut:function(){1!==this.scale&&(this.scale=this.scale-1*this.zoomFactor)},zoomOffset:function(){return{x:this.viewport.width/this.viewBox[2],y:this.viewport.height/this.viewBox[3]}},computeOffset:function(t){var e=this.$refs.image.getBoundingClientRect(),n=this.zoomOffset(),r=(t.clientX-e.left)/Math.min(n.x,n.y),i=(t.clientY-e.top)/Math.min(n.x,n.y);return{x:r,y:i}},computeHandlerSize:function(t){return 60*Math.min(this.viewBox[2],this.viewBox[3])/this.imageWidth},normalizePath:function(t){var e=100/this.imageWidth,n=100/this.imageHeight;if(isNaN(e)||isNaN(n))throw new Error("Ratio should be a number.");var r=o.default.matrix(e,0,0,n,0,0);return t=o.default.path.map(t,r).toString(),t.search(/[z|Z]/gi)===-1&&(t+=" Z"),t},denormalizePath:function(t){var e=this.imageWidth/100,n=this.imageHeight/100;if(isNaN(e)||isNaN(n))throw new Error("Ratio should be a number.");var r=o.default.matrix(e,0,0,n,0,0);return t=o.default.path.map(t,r).toString(),t.search(/[z|Z]/gi)===-1&&(t+=" Z"),t},toSVGPath:function(){"free"===this.mode&&this.$refs.free.toSVGPath(),"rect"===this.mode&&this.$refs.rect.toSVGPath()},handleDrawFree:function(){var e=this;this.removeEventHandlers();var n,r=function(t,e){n=null,this.$refs.free.addPoint(t,e)};this.paper.click(function(i){if(!n&&t(i.target).is("image")&&!e.$refs.free.closed){var o=e.computeOffset(i),a=o.x,s=o.y;n=setTimeout(r.bind(e,a,s),190)}})},handleDrawRect:function(){var t=this;this.removeEventHandlers();var e={x:0,y:0},n={x:0,y:0},r=!1;this.paper.mousedown(function(n){t.$refs.rect.width>0&&t.$refs.rect.height>0||(e=t.computeOffset(n),r=!0)}),this.paper.mousemove(function(i){if(r){var o,a;n=t.computeOffset(i);var s=Math.abs(n.x-e.x),l=Math.abs(e.y-n.y);n.y>e.y&&n.x>e.x&&(o=e.x,a=e.y),n.y<e.y&&n.x>e.x&&(o=n.x-s,a=n.y),n.y<e.y&&n.x<e.x&&(o=n.x,a=n.y),n.y>e.y&&n.x<e.x&&(o=n.x,a=n.y-l),o&&a&&Object.assign(t.$refs.rect,{x:o,y:a,width:s,height:l})}}),this.paper.mouseup(function(e){if(r){if(r=!1,0===t.$refs.rect.width&&0===t.$refs.rect.height){var n=t.computeOffset(e),i=t.imgMinSize/4;Object.assign(t.$refs.rect,{x:n.x-i/2,y:n.y-i/2,width:i,height:i})}t.$nextTick(function(){t.$refs.rect.addResizeHandlers(),t.$refs.rect.addTooltip()})}})}}}}).call(e,n(1))},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:["comment","username","email","date"],computed:{dateFormatted:function(){var t=new Date(this.date),e=t.getDate(),n=t.getMonth()+1,r=t.getFullYear();return e+"/"+n+"/"+r}}}},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(185),o=r(i);e.default={props:["annotation","fetch"],components:{Comment:o.default},data:function(){return{comments:[]}},computed:{commentsURL:function(){return this.fetch.replace(":annotation_guid",this.annotation.annotation_guid)}},watch:{annotation:function(e){var n=this;e?t.getJSON(this.commentsURL).then(function(t){return n.comments=t}):this.comments=[]}}}}).call(e,n(1))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),a=n(41),s=r(a),l=n(40),c=r(l);e.default={mixins:[s.default,c.default],props:["paper","original-annotation","readonly"],data:function(){return{path:"",closed:!1,points:[],handlerRadius:30}},mounted:function(){},watch:{closed:function(t){t&&(this.path+=" Z")},points:function(t){var e="M";if(!(t.length<=1)){e+=t[0].x+","+t[0].y;for(var n=0;n<t.length;n++)if(0!=n){var r=t[n],i="L"+r.x+","+r.y;e+=" "+i}this.closed&&(e+=" Z"),this.path=e}}},methods:{addPoint:function(t,e){var n=this;this.points.push({x:t,y:e}),this.$nextTick(function(){var t=n.$refs.handlers[n.$refs.handlers.length-1];n.addResizeHandler(t)})},clear:function(){this.destroyTooltip(),Object.assign(this,{points:[],closed:!1,path:""})},getTooltipTarget:function(){return this.$refs.path},fromSVGPath:function(t,e){var n=this,r=o.default.parsePathString(t),i=[];r.map(function(t){"Z"!==t[0]&&i.push({x:t[1],y:t[2]})}),this.points=i,this.closed=!0,this.$nextTick(function(){n.addResizeHandlers(),e&&setTimeout(function(){return n.addTooltip()},250)})},toSVGPath:function(){return this.$parent.normalizePath(this.path)+";FREE"},addResizeHandler:function(t){var e=this,n=this,r=new o.default(t),i=!1;r.click(function(t){var n=parseInt(r.attr("data-key"),10);0===n&&e.points.length>2&&(e.closed=!0,e.$nextTick(function(){setTimeout(function(){return e.addTooltip()},250)}))}),r.dblclick(function(t){var n=new o.default(t.target),r=parseInt(n.attr("data-key"),10);e.points.splice(r,1)});var a={onMove:function(t,e,r,o,a){i=!0;var s=n.$parent.computeOffset(a);this.attr({cx:s.x,cy:s.y});var l=parseInt(this.attr("data-key"),10);n.points.splice(l,1,{x:s.x,y:s.y})},onStart:function(){return e.hideTooltip()},onEnd:function(t){i&&(i=!1,n.showTooltip())}};r.drag(a.onMove,a.onStart,a.onEnd)},addResizeHandlers:function(){var t=this;this.$refs.handlers.forEach(function(e){return t.addResizeHandler(e)})}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),a=n(41),s=r(a),l=n(40),c=r(l);e.default={mixins:[s.default,c.default],props:["paper","original-annotation","tooltip","readonly"],data:function(){return{transform:"translate(0, 0)",isResizing:!1,x:0,y:0,width:0,height:0,handlerSize:60}},computed:{showResizeHandlers:function(){return!this.readonly&&this.width>0&&this.height>0}},mounted:function(){var t=this,e={onMove:function(e,n){if(!t.isResizing&&!t.readonly){var r=this.transform().diffMatrix.invert();r.e=r.f=0;var i=r.x(e,n),o=r.y(e,n),a=this.data("origTransform")+(this.data("origTransform")?"T":"t")+[i,o];this.transform(a)}},onStart:function(){t.readonly||(this.data("origTransform",this.transform().local),t.$emit("drag:start"))},onEnd:function(){return t.$emit("drag:end")}},n=new o.default(this.$refs.g);n.drag(e.onMove,e.onStart,e.onEnd)},watch:{x:function(t,e){this.transform="translate("+this.x+", "+this.y+")"},y:function(t,e){this.transform="translate("+this.x+", "+this.y+")"}},methods:{clear:function(){var t=new o.default(this.$refs.shape),e=new o.default(this.$refs.topLeft),n=new o.default(this.$refs.bottomRight);t.node.removeAttribute("transform"),e.node.removeAttribute("transform"),n.node.removeAttribute("transform"),this.destroyTooltip(),Object.assign(this,{transform:"translate(0, 0)",x:0,y:0,width:0,height:0})},getTooltipTarget:function(){return this.$refs.shape},addResizeHandlers:function(){var t=this,e=new o.default(this.$refs.shape),n=new o.default(this.$refs.topLeft),r=new o.default(this.$refs.bottomRight),i={onMove:function(t,i){var o=this.transform().diffMatrix.invert();o.e=o.f=0;var a=o.x(t,i),s=o.y(t,i);this.transform("t"+[a,s]+this.data("origTransform"));var l=r.getBBox().x-n.getBBox().x,c=r.getBBox().y-n.getBBox().y,f={width:l,height:c};this===n&&(f.transform=e.data("origTransform")+(e.data("origTransform")?"T":"t")+[a,s]),e.attr(f)},onStart:function(){t.isResizing=!0,e.data("origTransform",e.transform().local),this.data("origTransform",this.transform().local)},onEnd:function(){t.isResizing=!1}};n.drag(i.onMove,i.onStart,i.onEnd),r.drag(i.onMove,i.onStart,i.onEnd)},fromSVGPath:function(t,e){var n=this,r=o.default.path.getBBox(t);Object.assign(this,{x:r.x,y:r.y,width:r.width,height:r.height}),this.$nextTick(function(){n.addResizeHandlers(),e&&setTimeout(function(){return n.addTooltip()},250)})},toSVGPath:function(){var t,e=new o.default(this.$refs.shape),n=e.getBBox(),r=e.transform();if(r.global.length){var i=e.node.getAttribute("x"),a=e.node.getAttribute("y"),s=r.totalMatrix,l=this.paper.rect(s.x(i,a),s.y(i,a),n.width,n.height);t=l.getBBox().path,l.remove()}else t=e.getBBox().path;var c=o.default.path.toAbsolute(t).toString();return this.$parent.normalizePath(c)+";RECT"}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(36),o=r(i);e.default={props:["original-title","original-description","original-tags"],components:{"tag-list":o.default},data:function(){return{title:"",description:"",tags:[],error:!1}},computed:{titleFormGroup:function(){return{"has-error":this.error}}},mounted:function(){var t=this;this.originalTitle&&(this.title=this.originalTitle),this.originalDescription&&(this.description=this.originalDescription),this.$on("error",function(e){e.title&&(t.error=!0)})},methods:{close:function(t){t.preventDefault(),this.$emit("close")},save:function(t){return t.preventDefault(),this.error=!1,0===this.title.trim().length?void this.$emit("error",{title:!0}):void this.$emit("save",{title:this.title,description:this.description,tags:this.$refs.taglist.tags})}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e.default={props:["image","viewport","viewBox","imageWidth","imageHeight"],data:function(){return{thumbnailWidth:0,thumbnailHeight:0,loaded:!1}},computed:{x:function(){return this.viewBox[0]*this.getRatioX()},y:function(){return this.viewBox[1]*this.getRatioY()},width:function(){return this.viewBox[2]*this.getRatioX()},height:function(){return this.viewBox[3]*this.getRatioY()}},methods:{reset:function(){var t=new o.default(this.$refs.handler);t.node.removeAttribute("transform")},getRatioX:function(){return 0===this.imageWidth?0:this.thumbnailWidth/this.imageWidth},getRatioY:function(){return 0===this.imageHeight?0:this.thumbnailHeight/this.imageHeight}},mounted:function(){var t=this,e=new o.default(this.$refs.svg),n=new o.default(this.$refs.handler),r=new Image;r.onload=function(i){var o=t;e.attr({viewBox:[0,0,r.width,r.height]}),Object.assign(t,{thumbnailWidth:r.width,thumbnailHeight:r.height,loaded:!0});var a={onMove:function(t,e,n,r){var i=this.transform().diffMatrix.invert();i.e=i.f=0;var a=i.x(t,e),s=i.y(t,e),l=this.data("origTransform")+(this.data("origTransform")?"T":"t")+[a,s];this.transform(l),o.$emit("change",{x:this.getBBox().x*(o.imageWidth/o.thumbnailWidth),y:this.getBBox().y*(o.imageHeight/o.thumbnailHeight)})},onStart:function(){this.data("origTransform",this.transform().local),o.$emit("dragstart")},onEnd:function(){o.$emit("dragend")}};n.drag(a.onMove,a.onStart,a.onEnd)},r.src=this.image}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(37),o=r(i),a=n(54),s=r(a);e.default={data:function(){return{}},components:{Typeahead:o.default,diffviewer:s.default},mounted:function(){this.targetKeyMap={title:"proposal-title",desc:"proposal-description",frag:"proposal-fragment"},this.targetFieldTypeMap={title:"input",desc:"input",frag:"frag"},this.originalValues={title:"",desc:"",frag:""}},methods:{pickProposition:function(t,e,n){var r="",i=document.getElementById(e),o=this.$refs[this.targetKeyMap[n]],a=this.targetFieldTypeMap[n];if(!a)throw new Error("A target type must be provided...");if("input"===a&&(r=o.value,o.value=i.value),"frag"===a){r=o.getAttribute("d");var s=i.getAttribute("d");o.getAttribute("data-path-type");o.setAttribute("d",s);var l=i.getAttribute("data-path-type");l=l||"FREE";var c=this.$refs["fragment-field"];c.value=s+";"+l}this.preserveOriginalValue(n,r)},pickTag:function(t,e){var n=this.$refs[e],r=this.$refs["proposal-tags"];this.preserveOriginalValue("proposal-tags",r.tags),r.setTags(n.tags,!0)},preserveOriginalValue:function(t,e){this.originalValues[t]||(this.originalValues[t]=e)},showDiffviewer:function(t,e,n){var r=document.getElementById(e),i=this.$refs[this.targetKeyMap[n]],o=this.targetFieldTypeMap[n],a=this.$refs[t];if(!a)throw new Error("The DiffViewer can't be found for "+n);if("input"===o&&a.showTextDiff(r.value,i.value),"tag"===n){var s=this.$refs[e],l=this.$refs["proposal-tags"];0!==s.tags.length&&0!==l.tags.length&&a.showTagDiff(s.tags,l.tags)}if("frag"===n){var c=i.getAttribute("d"),f=r.getAttribute("d");a.showFragmentDiff(c,f)}a.show()},hightlightSource:function(t){t.className+="highlight"},save:function(){alert("this is it ... ")}}}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:["close-with-escape"],data:function(){return{display:!1}},methods:{close:function(){this.display=!1},show:function(){this.display=!0}}}},function(t,e,n){(function(t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:["original-value"],data:function(){return{value:this.originalValue}},watch:{originalValue:function(t){this.value=t}},mounted:function(){this.originalValue&&(this.value=this.originalValue)},methods:{animate:function(){var t,e=0,n=1,r=function r(){return 5===this.value&&(n=-1),1===this.value&&(n=1),this.value+=n,10===++e?(clearTimeout(t),void(null===this.originalValue&&(this.value=null))):void(t=setTimeout(r.bind(this),100))};r.apply(this)},onMouseEnter:function(e){var n=t(e.target).data("value");this.$refs.buttons.forEach(function(e){t(e).data("value")<=n?t(e).addClass("btn--highlight"):t(e).removeClass("btn--highlight")})},onMouseLeave:function(e){var n=this;this.value?this.$refs.buttons.forEach(function(e){t(e).data("value")<=n.value?t(e).addClass("btn--highlight"):t(e).removeClass("btn--highlight")}):this.$refs.buttons.forEach(function(e){t(e).removeClass("btn--highlight")})},onClick:function(e){var n=parseInt(t(e.target).data("value"));this.value=n,this.$emit("change",{value:n})}}}}).call(e,n(1))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(193),o=r(i),a=n(56),s=r(a),l=n(53),c=r(l);e.default={props:{originalTags:{type:Array,default:function(){return[]}},readonly:{type:Boolean,default:!1}},data:function(){return{tags:c.default.cloneDeep(this.originalTags)}},components:{typeahead:s.default,"tag-list-item":o.default},watch:{originalTags:function(t){this.tags=c.default.cloneDeep(this.originalTags),this.hideAll()},tags:function(t){this.$emit("change",{tags:t})}},mounted:function(){var t=this;this.$refs.typeahead.$on("selected",function(e){t.tags.push(e)})},methods:{hideAll:function(){this.$refs.items&&this.$refs.items.forEach(function(t){return t.hide()})},replaceItemAt:function(t,e){var n=this.tags[t];Object.assign(n,e),this.tags.splice(t,1,n)},removeItemAt:function(t){this.tags.$remove(this.tags[t])}}}},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(55),o=r(i),a=n(56),s=r(a);e.default={props:["index","label","accuracy","relevancy","readonly"],components:{typeahead:s.default,"color-buttons":o.default},data:function(){return{isNew:!0}},computed:{accuracyTitle:function(){return"Fiabilité : "+this.accuracy},relevancyTitle:function(){return"Pertinence : "+this.relevancy}},watch:{accuracy:function(t){this.isNew&&this.isComplete()&&(this.isNew=!1,this.hide())},relevancy:function(t){this.isNew&&this.isComplete()&&(this.isNew=!1,this.hide())}},mounted:function(){this.isNew=!this.accuracy&&!this.relevancy,this.$refs.accuracy.value=this.accuracy,this.$refs.relevancy.value=this.relevancy,t(this.$el).find(".collapse").collapse({toggle:!1}),this.isNew&&(this.$parent.hideAll(),this.show(),this.$refs.accuracy.animate())},methods:{isComplete:function(){return this.accuracy&&this.relevancy},onChange:function(t,e){var n={};n[t]=e,this.$parent.replaceItemAt(this.index,n)},show:function(){t(this.$el).find(".collapse").collapse("show")},hide:function(){t(this.$el).find(".collapse").collapse("hide")},toggle:function(e){e.preventDefault(),this.readonly||(this.$parent.hideAll(),t(this.$el).find(".collapse").collapse("toggle"))},remove:function(t){t.preventDefault(),t.stopPropagation(),this.readonly||this.$parent.removeItemAt(this.index)}}}}).call(e,n(1))},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(58),o=r(i),a="https://lookup.dbpedia.org/api/search/PrefixSearch?MaxHits=5",s="https://fr.wikipedia.org/w/api.php",l={reset:o.default.methods.reset},c=function(e,n){var r=t.Deferred();t.getJSON(e,n).done(function(t){var e={};e.data=t,r.resolve(e)}).fail(r.reject);return r.promise()};e.default={mixins:[o.default],props:{placeholder:String,readonly:{type:Boolean,default:!1}},data:function(){return{src:a,limit:7,minChars:2,showAddButton:!1,datasource:"wikipedia",selectedTags:"[]",items:[],queryParamName:"QueryString"}},methods:{checkQuery:function(){0===this.query.length&&this.reset()},fetch:function(){if("wikipedia"===this.datasource)return this.fetchWikiPedia();var t={};return t[this.queryParamName]=this.query,c(this.src,query)},fetchWikiPedia:function(){this.src=s;var e={action:"opensearch",format:"json",search:this.query},n=t.Deferred();return t.ajax({url:this.src,data:e,dataType:"jsonp",success:function(t){var e={};e.data=t,n.resolve(e)}}),n.promise()},reset:function(){this.showAddButton=!1,l.reset.call(this)},prepareWikipediaResponse:function(t){var e=[];if(4!==t.length)return e;var n=t[1],r=t[3];return n.length===r.length?(n.map(function(t,n){var i={};i.tag_label=t;var o=r[n];o=o.replace("https://fr.wikipedia.org/wiki/","http://fr.dbpedia.org/resource/"),i.tag_link=decodeURI(o),i.accuracy=null,i.relevancy=null,e.push(i)}),e):void 0},prepareResponseData:function(t){var e="string"==typeof t?JSON.parse(t):t;return"wikipedia"===this.datasource&&(e=this.prepareWikipediaResponse(e)),Array.isArray(e)&&!e.length&&(this.showAddButton=!0),e},onHit:function(t){this.$emit("selected",t),this.reset()}}}}).call(e,n(1))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7);e.default={data:function(){return{tags:[],readOnly:!1}},methods:{removeTag:function(t){this.tags.$remove(t),this.normalizeSelectedTags()},reset:function(){this.tags=[],this.normalizeSelectedTags()},tagAlreadyExists:function(t){var e=!1,n=this.tags.find(function(e){if(e.tag_link){if(e.tag_link===t.tag_link)return!0}else if(e.tag_label===t.tag_label)return!0});if(n){var r=this.$refs[n.id][0];r.style.border="1px solid red",setTimeout(function(){r.style.border=""},1e3),e=!0}return e},setTags:function(t){Array.isArray(t)||new Error("setTags expects an array!");var e=this;t.map(function(t){e.addTag(t)})},addTag:function(t){return!this.tagAlreadyExists(t)&&void(t&&t.hasOwnProperty("tag_label")&&(t.id||(t.id=(0,r.generateId)("tag_")),this.tags.push(t),this.normalizeSelectedTags()))},normalizeSelectedTags:function(){var t=[];this.tags.map(function(e){var n={};n.tag_input="string"==typeof e.tag_link&&e.tag_link.length?e.tag_link:e.tag_label,n.accuracy=e.accuracy,n.relevancy=e.relevancy,t.push(n)}),this.$parent.$data.selectedTags=JSON.stringify(t)},updateAccuracy:function(t,e){e.accuracy=t.target.value,this.normalizeSelectedTags()},updatePertinence:function(t,e){e.relevancy=t.target.value,this.normalizeSelectedTags()}}}},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(58),o=r(i),a=n(194),s=r(a),l="https://lookup.dbpedia.org/api/search/PrefixSearch?MaxHits=5",c="https://fr.wikipedia.org/w/api.php",f={reset:o.default.methods.reset},u=function(e,n){var r=t.Deferred();t.getJSON(e,n).done(function(t){var e={};e.data=t,r.resolve(e)}).fail(r.reject);return r.promise()};e.default={mixins:[o.default],components:{taglist:s.default},props:["tags","read-only"],mounted:function(){this.taglist=this.$refs.taglist,this.taglist.readOnly=this.readOnly,this.setTags(this.tags)},data:function(){return{src:l,limit:7,minChars:2,showAddButton:!1,datasource:"wikipedia",selectedTags:"[]",items:[],queryParamName:"QueryString",placeholder:"..."}},methods:{setTags:function(t,e){t=Array.isArray(t)?t:[],e="boolean"==typeof e&&e,e&&this.taglist.reset(),this.taglist.setTags(t)},checkQuery:function(){0===this.query.length&&this.reset()},fetch:function(){if("wikipedia"===this.datasource)return this.fetchWikiPedia();var t={};return t[this.queryParamName]=this.query,u(this.src,query)},fetchWikiPedia:function(){this.src=c;var e={action:"opensearch",format:"json",search:this.query},n=t.Deferred();return t.ajax({url:this.src,data:e,dataType:"jsonp",success:function(t){var e={};e.data=t,n.resolve(e)}}),n.promise()},reset:function(){this.showAddButton=!1,f.reset.call(this)},prepareWikipediaResponse:function(t){var e=[];if(4!==t.length)return e;var n=t[1],r=t[3];return n.length===r.length?(n.map(function(t,n){var i={};i.tag_label=t;var o=r[n];o=o.replace("https://fr.wikipedia.org/wiki/","http://fr.dbpedia.org/resource/"),i.tag_link=decodeURI(o),i.accuracy=1,i.relevancy=1,e.push(i)}),e):void 0},prepareResponseData:function(t){var e="string"==typeof t?JSON.parse(t):t;return"wikipedia"===this.datasource&&(e=this.prepareWikipediaResponse(e)),Array.isArray(e)&&!e.length&&(this.showAddButton=!0),e},addTag:function(){if(this.hasItems)return!1;var t={tag_label:this.query,accuracy:1,relevancy:1};this.$refs.taglist.addTag(t),this.reset()},onHit:function(t){this.$refs.taglist.addTag(t),this.reset()}}}}).call(e,n(1))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(7),o=n(39),a=r(o),s=n(6),l=r(s);e.default={props:["image-url","image-width","image-height","zoomTarget","main-image-id"],mounted:function(){this.root=new l.default(this.$refs["root-svg"]),this.handler=this.root.select("#zoom-handler"),this.image=this.root.select("#small-image"),this.root.attr({width:101,height:101});var t=parseInt(this.image.attr("width")),e=parseInt(this.image.attr("height"));this.root.attr({viewBox:[0,0,t,e]}),this.imgMinSize=Math.min(t,e),this.handlerSize=20,this.handler.attr({width:this.handlerSize,height:this.handlerSize}),this.currentViewBox=null,this.currentViewport=null,this.updateFunction=null;var n=document.getElementById("zoomTarget");n&&this.setZoomTarget(n),this.handleEvents()},data:function(){return{showHandler:!1}},methods:{setZoomTarget:function(t){if(t.hasOwnProperty("type")&&"svg"===t.type)this.paper=t;else{this.paper=new l.default(t);var e=this.paper.select("#"+this.mainImageId);if(!e)throw new Error("A main image wasn't found.")}this.zoomHandler=a.default.enable_zoom(this.paper)},incraseDrawingZoom:function(){this.zoomHandler.zoomIn()},resetDrawingZoom:function(){this.zoomHandler.reset()},decreaseDrawingZoom:function(){this.zoomHandler.zoomOut()},handleEvents:function(){i.eventEmitter.on("zoomChanged",this.handleZoomChanged.bind(this));var t=this;this.handler.drag(function(e,n){var r=this.getBBox(),i=this.data("startPosition").x,o=this.data("startPosition").y,a=parseInt(t.image.attr("width")),s=parseInt(t.image.attr("height")),l=i+e,c=o+n;l+r.w>=a&&(l=a-r.w),c+r.h>=s&&(c=s-r.h),l=l<0?0:l,c=c<0?0:c;var f="T"+[l,c];this.attr("transform",f),t.notifyMove(this.getBBox().x,this.getBBox().y)},function(){this.data("startPosition",{x:this.getBBox().x,y:this.getBBox().y}),this.data("origTransform",this.transform().local)},function(){})},moveHandlerToCenter:function(t,e){cx=cx?cx:this.width/2,cy=cy?cy:this.height/2;var n=cx-this.handler.getBBox().w/2,r=cy-this.handler.getBBox().h/2;this.handler.transform("T"+[n,r])},notifyMove:function(t,e){if(i.eventEmitter.emit("moveZoomHandler",{x:t,y:e,viewport:{width:this.image.attr("width"),height:this.image.attr("height")}}),!this.currentViewBox||!this.currentViewport||"function"!=typeof this.updateFunction)return!1;var n=this.currentImageSize.width/this.image.attr("width"),r=this.currentImageSize.height/this.image.attr("height"),o=t*n,a=e*r;this.currentViewBox[0]=o,this.currentViewBox[1]=a,this.updateFunction(this.currentViewBox)},handleZoomChanged:function(t){if(1===t.currentScale)return void(this.showHandler=!1);this.showHandler=!0,this.currentViewport=t.viewport,this.currentViewBox=t.currentViewBox,this.currentImageSize=t.imageSize,this.updateFunction=t.updateFunction;var e=t.currentViewBox[2]*this.imgMinSize/t.minSize;this.handler.attr("width",e),this.handler.attr("height",e);var n=t.currentViewBox[0]*this.image.attr("width")/t.imageSize.width,r=t.currentViewBox[1]*this.image.attr("height")/t.imageSize.height;this.handler.transform("T"+[n,r])}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(182),o=r(i);e.default={init:function(){return new Vue(o.default)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),i=function(t,e,n,r){this.paper=t,this.shape=e,this.handlers=[],this.viewPort=n,this.viewBox=r,this.isResizing=!1,this.currentPosition={},this.HANDLER_SIZE=8,this.SHAPE_MIN_SIZE=20,this.states={},this.noop=function(){},this.init()};i.prototype={init:function(){this.showHandlers()},computeHandlerSize:function(){return this.HANDLER_SIZE*Math.min(this.viewBox[2],this.viewBox[3])/this.viewPort.width},showHandlers:function(){var t=this.shape.getBBox(),e=t.x-this.computeHandlerSize()/2,n=t.y-this.computeHandlerSize()/2,r=this.paper.rect(e,n,this.computeHandlerSize(),this.computeHandlerSize()).attr({fill:"red"});r.addClass("drawingHandler"),this.shape.addClass("drawingHandler");var i={position:"t_r",handler:r};this.handlers.push(i),this.shapesGroup=this.paper.g(this.shape,r),this.attachEvents()},updateShapePositions:function(t,e,n){var r=t.handler.getBBox(),i=this.shape.data("origBbox"),o=(r.x+this.computeHandlerSize()/2,r.y+this.computeHandlerSize()/2,e>0?i.width-e:i.width+Math.abs(e)),a=n>0?i.height-n:i.height+Math.abs(n),s=this.shape.data("origTransform")+(this.shape.data("origTransform")?"T":"t")+[e,n];this.shape.attr({transform:s,width:o,height:a})},dragEvents:{onStart:function(t,e,n,r){this.startPosition={x:r.clientX,y:r.clientY},this.isResizing=!0,this.currentPosition={},t.handler.data("origTransform",t.handler.transform().local),
+this.shape.data("origBbox",this.shape.getBBox()),this.shape.data("origBounding",this.shape.node.getBoundingClientRect()),this.shape.data("origTransform",this.shape.transform().local)},onMove:function(t,e,n,r,i,o){var a,s,l=t.handler.transform().diffMatrix.invert();l.e=l.f=0,a=l.x(e,n),s=l.y(e,n),this.currentPosition.x=o.clientX,this.currentPosition.y=o.clientY,this.checkBondaries(e,n)&&(t.handler.transform("t"+[a,s]+t.handler.data("origTransform")),this.updateShapePositions(t,a,s))},onStop:function(){this.isResizing=!1,this.startPosition={},this.currentPosition={}}},checkBondaries:function(t,e){var n=!0,r=this.shape.data("origBounding");this.shape.node.getBoundingClientRect();return r.width-t<=this.SHAPE_MIN_SIZE&&(n=!1),r.height-e<=this.SHAPE_MIN_SIZE&&(n=!1),n},destroy:function(){this.handlers.map(function(t){t.handler.remove()}),delete this},getZoomFactor:function(){return{x:this.viewPort.width/this.viewBox[2],y:this.viewPort.height/this.viewBox[3]}},attachEvents:function(){var t=this;this.handlers.map(function(e){e.handler.drag(t.dragEvents.onMove.bind(t,e),t.dragEvents.onStart.bind(t,e),t.dragEvents.onStop.bind(t,e))}),r.eventEmitter.on("cutout:clear",function(){t.destroy()}),this.shapesGroup.drag(function(e,n){if(!t.isResizing){var r=this.transform().diffMatrix.invert();r.e=r.f=0;var i=r.x(e,n),o=r.y(e,n),a=this.data("origTransform")+(this.data("origTransform")?"T":"t")+[i,o];this.transform(a)}},function(){this.data("origTransform",this.transform().local)},this.noop)}};e.default={enable_resizer:function(t,e,n,r){new i(t,e,n,r)}}},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i),a=n(81),s=r(a),l=n(7),c=n(39);r(c);o.default.plugin(function(t,e,n,r){var i=e.prototype;i.toBack=function(){this.prependTo(this.paper)},i.toFront=function(){this.appendTo(this.paper)}}),Element.prototype.getTransformedXY=function(t,e){var n=this.transform().globalMatrix;return{x:n.x(t,e),y:n.y(t,e)}};var f=null,u=null,h=[],p={X:100,Y:100},d={x:1,y:1},g={width:850,height:850},v=[],m=!1,y=null,b=null,_=!1,x=null,w="#ff00ff",k="red",C="orange",T="#FF0000",j=8,$=!1,A=!0,S=!1,O=!0,M="RECT",E=M,P="FREE",N=[M,P],F=null,R=function(){var t=0,e="item_";return function(n){return n="string"==typeof n?n:e,t+=1,n+t}}(),B=function(t){if(m)return void f.path(t).attr({stroke:"red",opacity:.6});var e=o.default.path.getBBox(t);x=f.rect(e.x,e.y,e.width,e.height),x.attr({fill:C,stroke:k,opacity:.6}),b=x,_=!1,S=!0,s.default.enable_resizer(f,b,g,v)},D=function(t){if(m)return void f.path(t).attr({stroke:"orange",fill:"orange",opacity:.5});var e=o.default.parsePathString(t);e.map(function(t){"Z"!==t[0]?J(f,t[1],t[2],h):(S=!0,z(f,L))})},z=function(t,e){var n="M";if(!(h.length<=1)){n+=h[0].x+","+h[0].y;for(var r=0;r<h.length;r++)if(0!=r){var i=h[r],o="L"+i.x+","+i.y;n+=" "+o}n+=S?" Z":"",b&&b.remove(),b=t.path(n),b.attr({stroke:k,"vector-effect":"non-scaling-stroke","stroke-width":3,fill:"white",opacity:.1}),h.map(function(t){H();t.handler&&t.handler.toFront()}),"function"==typeof e&&S&&e(),!e&&S&&I()}},I=function(){b.attr({fill:C,strokeWidth:1,opacity:.6})},L=function(){O=!1,I()},q=function(t,e,n){t.isFirst&&h.length>2&&(S=!0)},V=function(t,e,n){var r=h.indexOf(t);return r!==-1&&(h[r].x=e,h[r].y=n,!0)},H=function(){v.length||(v=[0,0,parseInt(u.width()),parseInt(u.height())]);var t=j*Math.min(v[2],v[3])/850;return t},U=function(t,e,n,r,i){$=!0;var o,a,s=this.transform().diffMatrix.invert();s.e=s.f=0,o=s.x(t,e),a=s.y(t,e);var l=this.data("origTransform")+(this.data("origTransform")?"T":"t")+[o,a];this.attr({transform:l});var c=this.getBBox(),f=V(this.data("point"),c.x+H()/2,c.y+H()/2);f&&z(this.paper)},W=function(t,e){t.handler.click(q.bind(this,t,e)),t.handler.hover(function(){t.handler.attr({fill:"yellow"})},function(){var e=t.isFirst?T:"";t.handler.attr({fill:e})}),t.handler.drag(U,function(){this.data("origTransform",this.transform().local)},function(){return!$||($=!1,void(A=!1))})},Z=function(t,e){var n,r=H(),i=e.x-r/2,o=e.y-r/2;return n=t.rect(i,o,r,r),n.addClass("drawingHandler"),e.handler=n,e.handler.data("point",e),0===h.length&&(e.isFirst=!0),W(e,t),e.handler.attr({fill:0===h.length?T:"",opacity:.9,stroke:w}),e},J=function(t,e,n,r){var i={x:e,y:n,id:R()};return S?void z(t,L):A?(i=Z(t,i),r.push(i),void z(t)):(A=!0,!1)},G=function(t){if(m)return!1;var e={},n={},r=function(t){var e=t.target||t.srcElement,n=e.getBoundingClientRect(),r=(t.clientX-n.left)/Math.min(d.x,d.y),i=(t.clientY-n.top)/Math.min(d.x,d.y);return{x:r,y:i}};t.mousedown(function(t){if(E!==P&&!S){var n=r(t);e.x=n.x,e.y=n.y,_=!0}}),t.mousemove(function(i){if(E!==P&&_){var o,a,s=r(i);n.x=s.x,n.y=s.y,x&&x.remove();var l=Math.abs(n.x-e.x),c=Math.abs(e.y-n.y);n.y>e.y&&n.x>e.x&&(o=e.x,a=e.y),n.y<e.y&&n.x>e.x&&(o=n.x-l,a=n.y),n.y<e.y&&n.x<e.x&&(o=n.x,a=n.y),n.y>e.y&&n.x<e.x&&(o=n.x,a=n.y-c),o&&a&&(x=t.rect(o,a,l,c),x.attr({fill:C,stroke:k,opacity:.6}))}}),t.mouseup(function(){return!(E===P||S||!x)&&(b=x,s.default.enable_resizer(t,x,g,v),_=!1,void(S=!0))})},X=function(e){if(!m){var n=null,r=!1;e.dblclick(function(t){return E===M||(r=!0,n&&(n=clearTimeout(n),r=!1,S=!0,h.length>2&&z(e,L)),!1)});var i=function(t){var e=t.target||t.srcElement,n=e.getBoundingClientRect(),r=(t.clientX-n.left)/Math.min(d.x,d.y),i=(t.clientY-n.top)/Math.min(d.x,d.y);return{x:r,y:i}},o=function(t,i){if(!r){if(E===M)return!0;if(!O)return!0;J(e,t,i,h),n=null,r=!1}};e.click(function(e){if(!n&&t(e.target).is(u)){var r=i(e),a=r.x,s=r.y;n=setTimeout(o.bind(this,a,s),190)}})}},Y=function(){l.eventEmitter.on("zoomChanged",function(t){d=t.zoomFactor,v=t.currentViewBox;var e=K.getPath();K.clear(),K.setPath(e)})},K={getPaper:function(){return f},setPath:function(t){var e=t.split(";");N.indexOf(e[1])===-1&&(e[1]="FREE"),this.setDrawingMode(e[1]);var n=e[0];if(n.length){var r=u.attr("width")/p.X,i=u.attr("height")/p.Y;(isNaN(r)||isNaN(i))&&new Error("Ratio should be a number.");var a=o.default.matrix(r,0,0,i,0,0),s=o.default.path.map(n,a).toString();s.search(/[z|Z]/gi)===-1&&(s+="Z"),e.length>=2&&(e[1]===M&&B(s),e[1]===P&&D(s))}},setDrawingMode:function(t){N.indexOf(t)!==-1&&(E=t),"function"==typeof F&&F(E),this.clear()},clear:function(){h.map(function(t){t.handler&&t.handler.remove()}),b&&b.remove(),l.eventEmitter.emit("cutout:clear"),h=[],y=null,b=null,$=!1,A=!0,S=!1,O=!0},getShapeBBox:function(){var t=this.getPath();return o.default.path.getBBox(t)},getShape:function(){return this.getPath()},getPath:function(){var t="";if(b)if(E===M){var e=b.getBBox(),n=b.transform();if(n.global.length){var r=b.node.getAttribute("x"),i=b.node.getAttribute("y"),a=n.totalMatrix,s=f.rect(a.x(r,i),a.y(r,i),e.width,e.height);l=s.getBBox().path,s.remove()}else var l=b.getBBox().path;t=o.default.path.toAbsolute(l).toString()}else t=b.attr("d");var c=p.X/u.attr("width"),h=p.Y/u.attr("height");if((isNaN(c)||isNaN(h))&&new Error("ratio should be a number."),!t.length)return t=E===M?";RECT":";FREE";var d=o.default.matrix(c,0,0,h,0,0);t=o.default.path.map(t,d).toString();var g=E===M?";RECT":";FREE";return t.search(/[z|Z]/gi)===-1&&(t+=" Z"),t+=g}};e.default={init:function(e){u=t(e.wrapperId).find(".main-image").eq(0);var n=t(e.wrapperId).find(".cut-canvas").eq(0),r=t(e.wrapperId).find(".image-path").eq(0);if("function"==typeof e.onDrawingModeChange&&(F=e.onDrawingModeChange),!u.length)throw new Error("The main image Can't be found ...");if(!n.length){var n=t('<svg version="1.1"></svg>').addClass("cut-canvas");t(e.wrapperId).append(n),n.append(u)}if(n.css({marginLeft:"auto",marginRight:"auto",width:g.width,height:g.height}),"boolean"==typeof e.readOnly&&e.readOnly===!0&&(m=!0),f=new o.default(n.get(0)),r.length){t(n).append(r);var i=r.attr("d");K.setPath(i),r.remove()}return Y(),X(f),G(f),K}}}).call(e,n(1))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(184),o=r(i),a=n(183),s=r(a),l=n(186),c=r(l);e.default={Canvas:o.default,AnnotationForm:s.default,CommentList:c.default}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}n(172),n(173),n(171);var i=n(212),o=(r(i),n(37)),a=r(o),s=n(80),l=r(s),c=n(57),f=r(c),u=n(191),h=r(u),p=n(181),d=r(p),g=n(54),v=r(g),m=n(20),y=r(m),b=n(83),_=r(b),x=n(55),w=r(x),k=n(36),C=r(k),T=n(152);Vue.config.ignoredElements=["mask"];var j={Cutout:l.default,JsDiff:T,JsonDiff:y.default,CollectionSelector:d.default,VueComponents:{Typeahead:a.default,MergeTool:h.default,Zoomview:f.default,DiffViewer:v.default,Editor:_.default,ColorButtons:w.default,TagList:C.default}};Vue.component("color-buttons",w.default),Vue.component("image-annotator",_.default.Canvas),Vue.component("annotation",_.default.Annotation),Vue.component("annotation-form",_.default.AnnotationForm),Vue.component("comment-list",_.default.CommentList),window.iconolab||(window.iconolab=j)},function(t,e,n){t.exports={default:n(102),__esModule:!0}},function(t,e,n){t.exports={default:n(103),__esModule:!0}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(86),o=r(i);e.default=function(t,e,n){return e in t?(0,o.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},,,,,,,,,,,,,,function(t,e,n){"use strict";function r(t){var e=function t(){return i.apply(t,arguments)};return e._styles=t,e.__proto__=d,e}function i(){var t=arguments,e=t.length,n=0!==e&&String(arguments[0]);if(e>1)for(var r=1;r<e;r++)n+=" "+t[r];if(!h.enabled||!n)return n;for(var i=this._styles,o=0;o<i.length;o++){var a=s[i[o]];n=a.open+n.replace(a.closeRe,a.open)+a.close}return n}function o(){var t={};return Object.keys(p).forEach(function(e){t[e]={get:function(){return r([e])}}}),t}var a=n(169),s=n(59),l=n(179),c=n(175),f=n(180),u=Object.defineProperties,h=t.exports,p=function(){var t={};return s.grey=s.gray,Object.keys(s).forEach(function(e){s[e].closeRe=new RegExp(a(s[e].close),"g"),t[e]={get:function(){return r(this._styles.concat(e))}}}),t}(),d=u(function(){},p);u(h,o()),h.styles=s,h.hasColor=c,h.stripColor=l,h.supportsColor=f,void 0===h.enabled&&(h.enabled=h.supportsColor)},function(t,e,n){n(127),t.exports=n(22).Object.assign},function(t,e,n){n(128);var r=n(22).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(25);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(47),i=n(123),o=n(122);t.exports=function(t){return function(e,n,a){var s,l=r(e),c=i(l.length),f=o(a,c);if(t&&n!=n){for(;c>f;)if(s=l[f++],s!=s)return!0}else for(;c>f;f++)if((t||f in l)&&l[f]===n)return t||f||0;return!t&&-1}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(104);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(25),i=n(24).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(45),i=n(119);t.exports=n(17)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=!n(17)&&!n(23)(function(){return 7!=Object.defineProperty(n(109)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(117),i=n(115),o=n(118),a=n(124),s=n(44),l=Object.assign;t.exports=!l||n(23)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=l({},t)[n]||Object.keys(l({},e)).join("")!=r})?function(t,e){for(var n=a(t),l=arguments.length,c=1,f=i.f,u=o.f;l>c;)for(var h,p=s(arguments[c++]),d=f?r(p).concat(f(p)):r(p),g=d.length,v=0;g>v;)u.call(p,h=d[v++])&&(n[h]=p[h]);return n}:l},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(111),i=n(47),o=n(106)(!1),a=n(120)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),l=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;e.length>l;)r(s,n=e[l++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(116),i=n(110);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(121)("keys"),i=n(126);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(24),i="__core-js_shared__",o=r[i]||(r[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){var r=n(46),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(46),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(42);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(25);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(43);r(r.S+r.F,"Object",{assign:n(114)})},function(t,e,n){var r=n(43);r(r.S+r.F*!n(17),"Object",{defineProperty:n(45).f})},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".popover{min-width:300px}.popover-content .form-group{margin-bottom:10px}.popover-content .form-group label{font-size:12px}.popover-content .taglist{margin:10px 0 15px}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,"Typeahead[data-v-09005644]{position:relative}.selected-tags[data-v-09005644]{border:1px solid red;width:200px!important}.selected-tags select[data-v-09005644]{display:inline-block}.Typeahead__input[data-v-09005644]{width:100%;font-size:14px;color:#2c3e50;line-height:1.42857143;box-shadow:inset 0 1px 4px rgba(0,0,0,.4);-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;font-weight:300;padding:12px 26px;border:none;border-radius:22px;letter-spacing:1px;box-sizing:border-box}.Typeahead__input[data-v-09005644]:focus{border-color:#4fc08d;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px #4fc08d}.tag-item[data-v-09005644]{border:1px solid red}.fa-times[data-v-09005644]{cursor:pointer}ul[data-v-09005644]{padding:0;margin-top:8px;min-width:100%;background-color:#fff;list-style:none;border-radius:4px;box-shadow:0 0 10px rgba(0,0,0,.25);z-index:1000}li[data-v-09005644]{padding:10px 16px;border-bottom:1px solid #ccc;cursor:pointer}li[data-v-09005644]:first-child{border-radius:4px 4px 0 0}li[data-v-09005644]:last-child{border-radius:0 0 4px 4px;border-bottom:0}span[data-v-09005644]{display:block;color:#2c3e50}.active[data-v-09005644]{background-color:#3aa373}.active span[data-v-09005644]{color:#fff}.name[data-v-09005644]{font-weight:700;font-size:18px}.screen-name[data-v-09005644]{font-style:italic}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,"Typeahead[data-v-163b42f5]{position:relative}.selected-tags[data-v-163b42f5]{border:1px solid red;width:200px!important}.selected-tags select[data-v-163b42f5]{display:inline-block}.Typeahead__input[data-v-163b42f5]{width:100%;font-size:14px;color:#2c3e50;line-height:1.42857143;box-shadow:inset 0 1px 4px rgba(0,0,0,.4);-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;font-weight:300;padding:12px 26px;border:none;border-radius:22px;letter-spacing:1px;box-sizing:border-box}.Typeahead__input[data-v-163b42f5]:focus{border-color:#4fc08d;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px #4fc08d}.tag-item[data-v-163b42f5]{border:1px solid red}.fa-times[data-v-163b42f5]{cursor:pointer}ul[data-v-163b42f5]{padding:0;margin-top:8px;min-width:100%;background-color:#fff;list-style:none;border-radius:4px;box-shadow:0 0 10px rgba(0,0,0,.25);z-index:1000}li[data-v-163b42f5]{padding:10px 16px;border-bottom:1px solid #ccc;cursor:pointer}li[data-v-163b42f5]:first-child{border-radius:4px 4px 0 0}li[data-v-163b42f5]:last-child{border-radius:0 0 4px 4px;border-bottom:0}span[data-v-163b42f5]{display:block;color:#2c3e50}.active[data-v-163b42f5]{background-color:#3aa373}.active span[data-v-163b42f5]{color:#fff}.name[data-v-163b42f5]{font-weight:700;font-size:18px}.screen-name[data-v-163b42f5]{font-style:italic}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,'.btn-group[data-v-1826f540]{margin-bottom:10px}.btn--highlight[data-v-1826f540]{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn--highlight[data-value="1"][data-v-1826f540]{background-color:#fc5f62}.btn--highlight[data-value="2"][data-v-1826f540]{background-color:#f7c136}.btn--highlight[data-value="3"][data-v-1826f540]{background-color:#f7e53b}.btn--highlight[data-value="4"][data-v-1826f540]{background-color:#ebf63d}.btn--highlight[data-value="5"][data-v-1826f540]{background-color:#b9e78b}',""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".alert[data-v-21ad04a8]{padding:10px;font-size:12px}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".alert[data-v-2842cc86]{padding:10px;font-size:12px}.tag-list[data-v-2842cc86]{margin-bottom:15px}.tag-list-item[data-v-2842cc86]:first-of-type{border-top-left-radius:4px;border-top-right-radius:4px}.tag-list-item[data-v-2842cc86]:last-of-type{border-bottom-left-radius:4px;border-bottom-right-radius:4px}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".move-handler[data-v-2cdf3ca8]{cursor:-webkit-grab;cursor:grab}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,'.tag-item-btn[data-v-2ceb798e]{float:left;position:relative}.tag-item-btn button[data-v-2ceb798e]{border:none;background-color:transparent}.tag-item-accuracy .fa[data-v-2ceb798e],.tag-item-relevancy .fa[data-v-2ceb798e]{position:absolute;left:50%;top:-50%;transform:translate(-50%,-50%)}.tag-item-btn[data-value="1"][data-v-2ceb798e]{background-color:#fc5f62}.tag-item-btn[data-value="2"][data-v-2ceb798e]{background-color:#f7c136}.tag-item-btn[data-value="3"][data-v-2ceb798e]{background-color:#f7e53b}.tag-item-btn[data-value="4"][data-v-2ceb798e]{background-color:#ebf63d}.tag-item-btn[data-value="5"][data-v-2ceb798e]{background-color:#b9e78b}.tag-title[data-v-2ceb798e]{padding:5px 5px 5px 10px;font-size:12px;max-width:140px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.tag-item-form[data-v-2ceb798e]{padding:15px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap}.tag-item-form label[data-v-2ceb798e],.tag-item-form small[data-v-2ceb798e]{display:block;margin-bottom:5px}.tag-container[data-v-2ceb798e]{border:1px solid #ccc;border-bottom:none}.tag-item[data-v-2ceb798e],.tag-list .tag-container[data-v-2ceb798e]:last-of-type{border-bottom:1px solid #ccc}.tag-item[data-v-2ceb798e]{cursor:pointer;display:flex;justify-content:space-between;align-items:center}.tag-item[data-v-2ceb798e]:hover{background-color:#f5f5f5}',""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".zoom[data-v-45428799]{position:relative}.zoomer[data-v-45428799]{position:absolute;bottom:15px;right:15px}.cut-canvas[data-v-45428799]{width:100%;height:600px}.canvas--rect[data-v-45428799]:hover{cursor:crosshair}.canvas--free[data-v-45428799]:hover{cursor:pointer}.mode-controls .btn>svg[data-v-45428799]{margin-top:4px}.mode-controls .btn-primary>svg[data-v-45428799]{fill:#fff}.controls[data-v-45428799]{position:absolute;transform:translateX(-50%);left:50%;bottom:15px;display:flex;align-items:center}.controls>[data-v-45428799]{background-color:rgba(34,34,34,.9)}.controls .btn[data-v-45428799]{background-color:transparent;color:#ccc;fill:#ccc;float:left}.controls .btn.active[data-v-45428799],.controls .btn[data-v-45428799]:active{color:#fff;fill:#fff;background-color:#111}.controls .btn[data-v-45428799]:hover{background-color:#222}.controls .controls-left[data-v-45428799]{border-top-left-radius:4px;border-bottom-left-radius:4px}.controls .controls-center[data-v-45428799]{border-radius:4px;padding:8px 8px 4px}.controls .controls-right[data-v-45428799]{border-top-right-radius:4px;border-bottom-right-radius:4px}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".shape[data-v-506fb618]{fill:#bdc3c7;stroke:#000;opacity:.6}.shape--draggable[data-v-506fb618]:hover{cursor:move}.handler-top-left[data-v-506fb618]:hover{cursor:nw-resize}.handler-bottom-right[data-v-506fb618]:hover{cursor:se-resize}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,"form[data-v-51ceff58]{margin-bottom:20px;clear:both}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".comment[data-v-52ae02ee]{font-size:12px;padding:5px 0;border-bottom:1px solid #ccc}.comment-footer[data-v-52ae02ee]{margin-top:5px;color:#ccc}.comment-date[data-v-52ae02ee]{float:right}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".diff-viewer-wrapper[data-v-64c3b6ce]{margin-top:5px}.diff-panel[data-v-64c3b6ce]{border:1px solid gray;width:300px;heigth:250px}del[data-v-64c3b6ce]{text-decoration:none;color:#b30000;background:#fadad7}ins[data-v-64c3b6ce]{background:#eaf2c2;color:#406619;text-decoration:none}",""])},function(t,e,n){e=t.exports=n(2)(),e.push([t.id,".handler[data-v-a8fd4508]{fill:#fff;stroke:#000;opacity:.9}.handler--first[data-v-a8fd4508]{fill:#ff0}",""])},function(t,e,n){"use strict";var r,i=n(156),o=n(163),a=n(159),s=n(166);r=t.exports=function(t,e){var n,r,a,l,c;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(n=a=!0,r=!1):(n=s.call(t,"c"),r=s.call(t,"e"),a=s.call(t,"w")),c={value:e,configurable:n,enumerable:r,writable:a},l?i(o(l),c):c},r.gs=function(t,e,n){var r,l,c,f;return"string"!=typeof t?(c=n,n=e,e=t,t=null):c=arguments[3],null==e?e=void 0:a(e)?null==n?n=void 0:a(n)||(c=n,n=void 0):(c=e,e=n=void 0),null==t?(r=!0,l=!1):(r=s.call(t,"c"),l=s.call(t,"e")),f={get:e,set:n,configurable:r,enumerable:l},c?i(o(c),f):f}},function(t,e){"use strict";function n(t){for(var e=[],n=void 0,r=void 0,i=0;i<t.length;i++)n=t[i],r=n.added?1:n.removed?-1:0,e.push([r,n.value]);return e}e.__esModule=!0,e.convertChangesToDMP=n},function(t,e){"use strict";function n(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];i.added?e.push("<ins>"):i.removed&&e.push("<del>"),e.push(r(i.value)),i.added?e.push("</ins>"):i.removed&&e.push("</del>")}return e.join("")}function r(t){var e=t;return e=e.replace(/&/g,"&"),e=e.replace(/</g,"<"),e=e.replace(/>/g,">"),e=e.replace(/"/g,""")}e.__esModule=!0,e.convertChangesToXML=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return s.diff(t,e,n)}e.__esModule=!0,e.arrayDiff=void 0,e.diffArrays=i;var o=n(5),a=r(o),s=e.arrayDiff=new a.default;s.tokenize=s.join=function(t){return t.slice()}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return s.diff(t,e,n)}e.__esModule=!0,e.characterDiff=void 0,e.diffChars=i;var o=n(5),a=r(o),s=e.characterDiff=new a.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return s.diff(t,e,n)}e.__esModule=!0,e.cssDiff=void 0,e.diffCss=i;var o=n(5),a=r(o),s=e.cssDiff=new a.default;s.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return u.diff(t,e,n)}function o(t,e,n){e=e||[],n=n||[];var r=void 0;for(r=0;r<e.length;r+=1)if(e[r]===t)return n[r];var i=void 0;if("[object Array]"===f.call(t)){for(e.push(t),i=new Array(t.length),n.push(i),r=0;r<t.length;r+=1)i[r]=o(t[r],e,n);return e.pop(),n.pop(),i}if(t&&t.toJSON&&(t=t.toJSON()),"object"===("undefined"==typeof t?"undefined":a(t))&&null!==t){e.push(t),i={},n.push(i);var s=[],l=void 0;for(l in t)t.hasOwnProperty(l)&&s.push(l);for(s.sort(),r=0;r<s.length;r+=1)l=s[r],i[l]=o(t[l],e,n);e.pop(),n.pop()}else i=t;return i}e.__esModule=!0,e.jsonDiff=void 0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.diffJson=i,e.canonicalize=o;var s=n(5),l=r(s),c=n(26),f=Object.prototype.toString,u=e.jsonDiff=new l.default;u.useLongestToken=!0,u.tokenize=c.lineDiff.tokenize,u.castInput=function(t){var e=this.options.undefinedReplacement;return"string"==typeof t?t:JSON.stringify(o(t),function(t,n){return"undefined"==typeof n?e:n}," ")},u.equals=function(t,e){return l.default.prototype.equals(t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return s.diff(t,e,n)}e.__esModule=!0,e.sentenceDiff=void 0,e.diffSentences=i;var o=n(5),a=r(o),s=e.sentenceDiff=new a.default;s.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){var r=(0,l.generateOptions)(n,{ignoreWhitespace:!0});return u.diff(t,e,r)}function o(t,e,n){return u.diff(t,e,n)}e.__esModule=!0,e.wordDiff=void 0,e.diffWords=i,e.diffWordsWithSpace=o;var a=n(5),s=r(a),l=n(49),c=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,f=/\S/,u=e.wordDiff=new s.default;u.equals=function(t,e){return t===e||this.options.ignoreWhitespace&&!f.test(t)&&!f.test(e)},u.tokenize=function(t){for(var e=t.split(/(\s+|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&c.test(e[n])&&c.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.canonicalize=e.convertChangesToXML=e.convertChangesToDMP=e.parsePatch=e.applyPatches=e.applyPatch=e.createPatch=e.createTwoFilesPatch=e.structuredPatch=e.diffArrays=e.diffJson=e.diffCss=e.diffSentences=e.diffTrimmedLines=e.diffLines=e.diffWordsWithSpace=e.diffWords=e.diffChars=e.Diff=void 0;var i=n(5),o=r(i),a=n(147),s=n(151),l=n(26),c=n(150),f=n(148),u=n(149),h=n(146),p=n(153),d=n(48),g=n(154),v=n(144),m=n(145);e.Diff=o.default,e.diffChars=a.diffChars,e.diffWords=s.diffWords,e.diffWordsWithSpace=s.diffWordsWithSpace,e.diffLines=l.diffLines,e.diffTrimmedLines=l.diffTrimmedLines,e.diffSentences=c.diffSentences,e.diffCss=f.diffCss,e.diffJson=u.diffJson,e.diffArrays=h.diffArrays,e.structuredPatch=g.structuredPatch,e.createTwoFilesPatch=g.createTwoFilesPatch,e.createPatch=g.createPatch,e.applyPatch=p.applyPatch,e.applyPatches=p.applyPatches,e.parsePatch=d.parsePatch,e.convertChangesToDMP=v.convertChangesToDMP,e.convertChangesToXML=m.convertChangesToXML,e.canonicalize=u.canonicalize},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){function n(t,e){for(var n=0;n<t.lines.length;n++){var r=t.lines[n],o=r[0],a=r.substr(1);if(" "===o||"-"===o){if(!c(e+1,i[e],o,a)&&(f++,f>u))return!1;e++}}return!0}var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if("string"==typeof e&&(e=(0,a.parsePatch)(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}for(var i=t.split(/\r\n|[\n\v\f\r\x85]/),o=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=e.hunks,c=r.compareLine||function(t,e,n,r){return e===r},f=0,u=r.fuzzFactor||0,h=0,p=0,d=void 0,g=void 0,v=0;v<s.length;v++){for(var m=s[v],y=i.length-m.oldLines,b=0,_=p+m.oldStart-1,x=(0,l.default)(_,h,y);void 0!==b;b=x())if(n(m,_+b)){m.offset=p+=b;break}if(void 0===b)return!1;h=m.offset+m.oldStart+m.oldLines}for(var w=0;w<s.length;w++){var k=s[w],C=k.offset+k.newStart-1;0==k.newLines&&C++;for(var T=0;T<k.lines.length;T++){var j=k.lines[T],$=j[0],A=j.substr(1),S=k.linedelimiters[T];if(" "===$)C++;else if("-"===$)i.splice(C,1),o.splice(C,1);else if("+"===$)i.splice(C,0,A),o.splice(C,0,S),C++;else if("\\"===$){var O=k.lines[T-1]?k.lines[T-1][0]:null;"+"===O?d=!0:"-"===O&&(g=!0)}}}if(d)for(;!i[i.length-1];)i.pop(),o.pop();else g&&(i.push(""),o.push("\n"));for(var M=0;M<i.length-1;M++)i[M]=i[M]+o[M];return i.join("")}function o(t,e){function n(){var o=t[r++];return o?void e.loadFile(o,function(t,r){if(t)return e.complete(t);var a=i(r,o,e);e.patched(o,a,function(t){return t?e.complete(t):void n()})}):e.complete()}"string"==typeof t&&(t=(0,a.parsePatch)(t));var r=0;n()}e.__esModule=!0,e.applyPatch=i,e.applyPatches=o;var a=n(48),s=n(155),l=r(s)},function(t,e,n){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function i(t,e,n,i,o,a,l){function c(t){return t.map(function(t){return" "+t})}l||(l={}),"undefined"==typeof l.context&&(l.context=4);var f=(0,s.diffLines)(n,i,l);f.push({value:"",lines:[]});for(var u=[],h=0,p=0,d=[],g=1,v=1,m=function(t){var e=f[t],o=e.lines||e.value.replace(/\n$/,"").split("\n");if(e.lines=o,e.added||e.removed){var a;if(!h){var s=f[t-1];h=g,p=v,s&&(d=l.context>0?c(s.lines.slice(-l.context)):[],h-=d.length,p-=d.length)}(a=d).push.apply(a,r(o.map(function(t){return(e.added?"+":"-")+t}))),e.added?v+=o.length:g+=o.length}else{if(h)if(o.length<=2*l.context&&t<f.length-2){var m;(m=d).push.apply(m,r(c(o)))}else{var y,b=Math.min(o.length,l.context);(y=d).push.apply(y,r(c(o.slice(0,b))));var _={oldStart:h,oldLines:g-h+b,newStart:p,newLines:v-p+b,lines:d};if(t>=f.length-2&&o.length<=l.context){var x=/\n$/.test(n),w=/\n$/.test(i);0!=o.length||x?x&&w||d.push("\\ No newline at end of file"):d.splice(_.oldLines,0,"\\ No newline at end of file")}u.push(_),h=0,p=0,d=[]}g+=o.length,v+=o.length}},y=0;y<f.length;y++)m(y);return{oldFileName:t,newFileName:e,oldHeader:o,newHeader:a,hunks:u}}function o(t,e,n,r,o,a,s){var l=i(t,e,n,r,o,a,s),c=[];t==e&&c.push("Index: "+t),c.push("==================================================================="),c.push("--- "+l.oldFileName+("undefined"==typeof l.oldHeader?"":"\t"+l.oldHeader)),c.push("+++ "+l.newFileName+("undefined"==typeof l.newHeader?"":"\t"+l.newHeader));for(var f=0;f<l.hunks.length;f++){var u=l.hunks[f];c.push("@@ -"+u.oldStart+","+u.oldLines+" +"+u.newStart+","+u.newLines+" @@"),c.push.apply(c,u.lines)}return c.join("\n")+"\n"}function a(t,e,n,r,i,a){return o(t,t,e,n,r,i,a)}e.__esModule=!0,e.structuredPatch=i,e.createTwoFilesPatch=o,e.createPatch=a;var s=n(26)},function(t,e){"use strict";e.__esModule=!0,e.default=function(t,e,n){var r=!0,i=!1,o=!1,a=1;return function s(){if(r&&!o){if(i?a++:r=!1,t+a<=n)return a;o=!0}if(!i)return o||(r=!0),e<=t-a?-a++:(i=!0,s())}}},function(t,e,n){"use strict";t.exports=n(157)()?Object.assign:n(158)},function(t,e){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var r=n(160),i=n(165),o=Math.max;t.exports=function(t,e){var n,a,s,l=o(arguments.length,2);for(t=Object(i(t)),s=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},a=1;a<l;++a)e=arguments[a],r(e).forEach(s);if(void 0!==n)throw n;return t}},function(t,e){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,n){"use strict";t.exports=n(161)()?Object.keys:n(162)},function(t,e){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e){"use strict";var n=Object.keys;t.exports=function(t){return n(null==t?t:Object(t))}},function(t,e){"use strict";var n=Array.prototype.forEach,r=Object.create,i=function(t,e){var n;for(n in t)e[n]=t[n];
+};t.exports=function(t){var e=r(null);return n.call(arguments,function(t){null!=t&&i(Object(t),e)}),e}},function(t,e){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e){"use strict";t.exports=function(t){if(null==t)throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){"use strict";t.exports=n(167)()?String.prototype.contains:n(168)},function(t,e){"use strict";var n="razdwatrzy";t.exports=function(){return"function"==typeof n.contains&&(n.contains("dwa")===!0&&n.contains("foo")===!1)}},function(t,e){"use strict";var n=String.prototype.indexOf;t.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e){"use strict";var n=/[|\\{}()[\]^$+*?.]/g;t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(n,"\\$&")}},function(t,e,n){"use strict";var r,i,o,a,s,l,c,f=n(143),u=n(164),h=Function.prototype.apply,p=Function.prototype.call,d=Object.create,g=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var n;return u(e),m.call(this,"__ee__")?n=this.__ee__:(n=y.value=d(null),g(this,"__ee__",y),y.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},i=function(t,e){var n,i;return u(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},o=function(t,e){var n,r,i,o;if(u(e),!m.call(this,"__ee__"))return this;if(n=this.__ee__,!n[t])return this;if(r=n[t],"object"==typeof r)for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},a=function(t){var e,n,r,i,o;if(m.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)h.call(r,this,o)}else switch(arguments.length){case 1:p.call(i,this);break;case 2:p.call(i,this,arguments[1]);break;case 3:p.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];h.call(i,this,o)}},s={on:r,once:i,off:o,emit:a},l={on:f(r),once:f(i),off:f(o),emit:f(a)},c=v({},l),t.exports=e=function(t){return null==t?d(c):v(Object(t),l)},e.methods=s},function(t,e,n){(function(e){t.exports=e.$=n(1)}).call(e,function(){return this}())},function(t,e,n){(function(e){t.exports=e.Vue=n(228)}).call(e,function(){return this}())},function(t,e,n){(function(e){t.exports=e.jQuery=n(1)}).call(e,function(){return this}())},function(t,e){t.exports={navbar:"navbar",btn:"btn",caret:"caret",dropup:"dropup",label:"label",table:"table","table-bordered":"table-bordered",glyphicon:"glyphicon","glyphicon-asterisk":"glyphicon-asterisk","glyphicon-plus":"glyphicon-plus","glyphicon-euro":"glyphicon-euro","glyphicon-eur":"glyphicon-eur","glyphicon-minus":"glyphicon-minus","glyphicon-cloud":"glyphicon-cloud","glyphicon-envelope":"glyphicon-envelope","glyphicon-pencil":"glyphicon-pencil","glyphicon-glass":"glyphicon-glass","glyphicon-music":"glyphicon-music","glyphicon-search":"glyphicon-search","glyphicon-heart":"glyphicon-heart","glyphicon-star":"glyphicon-star","glyphicon-star-empty":"glyphicon-star-empty","glyphicon-user":"glyphicon-user","glyphicon-film":"glyphicon-film","glyphicon-th-large":"glyphicon-th-large","glyphicon-th":"glyphicon-th","glyphicon-th-list":"glyphicon-th-list","glyphicon-ok":"glyphicon-ok","glyphicon-remove":"glyphicon-remove","glyphicon-zoom-in":"glyphicon-zoom-in","glyphicon-zoom-out":"glyphicon-zoom-out","glyphicon-off":"glyphicon-off","glyphicon-signal":"glyphicon-signal","glyphicon-cog":"glyphicon-cog","glyphicon-trash":"glyphicon-trash","glyphicon-home":"glyphicon-home","glyphicon-file":"glyphicon-file","glyphicon-time":"glyphicon-time","glyphicon-road":"glyphicon-road","glyphicon-download-alt":"glyphicon-download-alt","glyphicon-download":"glyphicon-download","glyphicon-upload":"glyphicon-upload","glyphicon-inbox":"glyphicon-inbox","glyphicon-play-circle":"glyphicon-play-circle","glyphicon-repeat":"glyphicon-repeat","glyphicon-refresh":"glyphicon-refresh","glyphicon-list-alt":"glyphicon-list-alt","glyphicon-lock":"glyphicon-lock","glyphicon-flag":"glyphicon-flag","glyphicon-headphones":"glyphicon-headphones","glyphicon-volume-off":"glyphicon-volume-off","glyphicon-volume-down":"glyphicon-volume-down","glyphicon-volume-up":"glyphicon-volume-up","glyphicon-qrcode":"glyphicon-qrcode","glyphicon-barcode":"glyphicon-barcode","glyphicon-tag":"glyphicon-tag","glyphicon-tags":"glyphicon-tags","glyphicon-book":"glyphicon-book","glyphicon-bookmark":"glyphicon-bookmark","glyphicon-print":"glyphicon-print","glyphicon-camera":"glyphicon-camera","glyphicon-font":"glyphicon-font","glyphicon-bold":"glyphicon-bold","glyphicon-italic":"glyphicon-italic","glyphicon-text-height":"glyphicon-text-height","glyphicon-text-width":"glyphicon-text-width","glyphicon-align-left":"glyphicon-align-left","glyphicon-align-center":"glyphicon-align-center","glyphicon-align-right":"glyphicon-align-right","glyphicon-align-justify":"glyphicon-align-justify","glyphicon-list":"glyphicon-list","glyphicon-indent-left":"glyphicon-indent-left","glyphicon-indent-right":"glyphicon-indent-right","glyphicon-facetime-video":"glyphicon-facetime-video","glyphicon-picture":"glyphicon-picture","glyphicon-map-marker":"glyphicon-map-marker","glyphicon-adjust":"glyphicon-adjust","glyphicon-tint":"glyphicon-tint","glyphicon-edit":"glyphicon-edit","glyphicon-share":"glyphicon-share","glyphicon-check":"glyphicon-check","glyphicon-move":"glyphicon-move","glyphicon-step-backward":"glyphicon-step-backward","glyphicon-fast-backward":"glyphicon-fast-backward","glyphicon-backward":"glyphicon-backward","glyphicon-play":"glyphicon-play","glyphicon-pause":"glyphicon-pause","glyphicon-stop":"glyphicon-stop","glyphicon-forward":"glyphicon-forward","glyphicon-fast-forward":"glyphicon-fast-forward","glyphicon-step-forward":"glyphicon-step-forward","glyphicon-eject":"glyphicon-eject","glyphicon-chevron-left":"glyphicon-chevron-left","glyphicon-chevron-right":"glyphicon-chevron-right","glyphicon-plus-sign":"glyphicon-plus-sign","glyphicon-minus-sign":"glyphicon-minus-sign","glyphicon-remove-sign":"glyphicon-remove-sign","glyphicon-ok-sign":"glyphicon-ok-sign","glyphicon-question-sign":"glyphicon-question-sign","glyphicon-info-sign":"glyphicon-info-sign","glyphicon-screenshot":"glyphicon-screenshot","glyphicon-remove-circle":"glyphicon-remove-circle","glyphicon-ok-circle":"glyphicon-ok-circle","glyphicon-ban-circle":"glyphicon-ban-circle","glyphicon-arrow-left":"glyphicon-arrow-left","glyphicon-arrow-right":"glyphicon-arrow-right","glyphicon-arrow-up":"glyphicon-arrow-up","glyphicon-arrow-down":"glyphicon-arrow-down","glyphicon-share-alt":"glyphicon-share-alt","glyphicon-resize-full":"glyphicon-resize-full","glyphicon-resize-small":"glyphicon-resize-small","glyphicon-exclamation-sign":"glyphicon-exclamation-sign","glyphicon-gift":"glyphicon-gift","glyphicon-leaf":"glyphicon-leaf","glyphicon-fire":"glyphicon-fire","glyphicon-eye-open":"glyphicon-eye-open","glyphicon-eye-close":"glyphicon-eye-close","glyphicon-warning-sign":"glyphicon-warning-sign","glyphicon-plane":"glyphicon-plane","glyphicon-calendar":"glyphicon-calendar","glyphicon-random":"glyphicon-random","glyphicon-comment":"glyphicon-comment","glyphicon-magnet":"glyphicon-magnet","glyphicon-chevron-up":"glyphicon-chevron-up","glyphicon-chevron-down":"glyphicon-chevron-down","glyphicon-retweet":"glyphicon-retweet","glyphicon-shopping-cart":"glyphicon-shopping-cart","glyphicon-folder-close":"glyphicon-folder-close","glyphicon-folder-open":"glyphicon-folder-open","glyphicon-resize-vertical":"glyphicon-resize-vertical","glyphicon-resize-horizontal":"glyphicon-resize-horizontal","glyphicon-hdd":"glyphicon-hdd","glyphicon-bullhorn":"glyphicon-bullhorn","glyphicon-bell":"glyphicon-bell","glyphicon-certificate":"glyphicon-certificate","glyphicon-thumbs-up":"glyphicon-thumbs-up","glyphicon-thumbs-down":"glyphicon-thumbs-down","glyphicon-hand-right":"glyphicon-hand-right","glyphicon-hand-left":"glyphicon-hand-left","glyphicon-hand-up":"glyphicon-hand-up","glyphicon-hand-down":"glyphicon-hand-down","glyphicon-circle-arrow-right":"glyphicon-circle-arrow-right","glyphicon-circle-arrow-left":"glyphicon-circle-arrow-left","glyphicon-circle-arrow-up":"glyphicon-circle-arrow-up","glyphicon-circle-arrow-down":"glyphicon-circle-arrow-down","glyphicon-globe":"glyphicon-globe","glyphicon-wrench":"glyphicon-wrench","glyphicon-tasks":"glyphicon-tasks","glyphicon-filter":"glyphicon-filter","glyphicon-briefcase":"glyphicon-briefcase","glyphicon-fullscreen":"glyphicon-fullscreen","glyphicon-dashboard":"glyphicon-dashboard","glyphicon-paperclip":"glyphicon-paperclip","glyphicon-heart-empty":"glyphicon-heart-empty","glyphicon-link":"glyphicon-link","glyphicon-phone":"glyphicon-phone","glyphicon-pushpin":"glyphicon-pushpin","glyphicon-usd":"glyphicon-usd","glyphicon-gbp":"glyphicon-gbp","glyphicon-sort":"glyphicon-sort","glyphicon-sort-by-alphabet":"glyphicon-sort-by-alphabet","glyphicon-sort-by-alphabet-alt":"glyphicon-sort-by-alphabet-alt","glyphicon-sort-by-order":"glyphicon-sort-by-order","glyphicon-sort-by-order-alt":"glyphicon-sort-by-order-alt","glyphicon-sort-by-attributes":"glyphicon-sort-by-attributes","glyphicon-sort-by-attributes-alt":"glyphicon-sort-by-attributes-alt","glyphicon-unchecked":"glyphicon-unchecked","glyphicon-expand":"glyphicon-expand","glyphicon-collapse-down":"glyphicon-collapse-down","glyphicon-collapse-up":"glyphicon-collapse-up","glyphicon-log-in":"glyphicon-log-in","glyphicon-flash":"glyphicon-flash","glyphicon-log-out":"glyphicon-log-out","glyphicon-new-window":"glyphicon-new-window","glyphicon-record":"glyphicon-record","glyphicon-save":"glyphicon-save","glyphicon-open":"glyphicon-open","glyphicon-saved":"glyphicon-saved","glyphicon-import":"glyphicon-import","glyphicon-export":"glyphicon-export","glyphicon-send":"glyphicon-send","glyphicon-floppy-disk":"glyphicon-floppy-disk","glyphicon-floppy-saved":"glyphicon-floppy-saved","glyphicon-floppy-remove":"glyphicon-floppy-remove","glyphicon-floppy-save":"glyphicon-floppy-save","glyphicon-floppy-open":"glyphicon-floppy-open","glyphicon-credit-card":"glyphicon-credit-card","glyphicon-transfer":"glyphicon-transfer","glyphicon-cutlery":"glyphicon-cutlery","glyphicon-header":"glyphicon-header","glyphicon-compressed":"glyphicon-compressed","glyphicon-earphone":"glyphicon-earphone","glyphicon-phone-alt":"glyphicon-phone-alt","glyphicon-tower":"glyphicon-tower","glyphicon-stats":"glyphicon-stats","glyphicon-sd-video":"glyphicon-sd-video","glyphicon-hd-video":"glyphicon-hd-video","glyphicon-subtitles":"glyphicon-subtitles","glyphicon-sound-stereo":"glyphicon-sound-stereo","glyphicon-sound-dolby":"glyphicon-sound-dolby","glyphicon-sound-5-1":"glyphicon-sound-5-1","glyphicon-sound-6-1":"glyphicon-sound-6-1","glyphicon-sound-7-1":"glyphicon-sound-7-1","glyphicon-copyright-mark":"glyphicon-copyright-mark","glyphicon-registration-mark":"glyphicon-registration-mark","glyphicon-cloud-download":"glyphicon-cloud-download","glyphicon-cloud-upload":"glyphicon-cloud-upload","glyphicon-tree-conifer":"glyphicon-tree-conifer","glyphicon-tree-deciduous":"glyphicon-tree-deciduous","glyphicon-cd":"glyphicon-cd","glyphicon-save-file":"glyphicon-save-file","glyphicon-open-file":"glyphicon-open-file","glyphicon-level-up":"glyphicon-level-up","glyphicon-copy":"glyphicon-copy","glyphicon-paste":"glyphicon-paste","glyphicon-alert":"glyphicon-alert","glyphicon-equalizer":"glyphicon-equalizer","glyphicon-king":"glyphicon-king","glyphicon-queen":"glyphicon-queen","glyphicon-pawn":"glyphicon-pawn","glyphicon-bishop":"glyphicon-bishop","glyphicon-knight":"glyphicon-knight","glyphicon-baby-formula":"glyphicon-baby-formula","glyphicon-tent":"glyphicon-tent","glyphicon-blackboard":"glyphicon-blackboard","glyphicon-bed":"glyphicon-bed","glyphicon-apple":"glyphicon-apple","glyphicon-erase":"glyphicon-erase","glyphicon-hourglass":"glyphicon-hourglass","glyphicon-lamp":"glyphicon-lamp","glyphicon-duplicate":"glyphicon-duplicate","glyphicon-piggy-bank":"glyphicon-piggy-bank","glyphicon-scissors":"glyphicon-scissors","glyphicon-bitcoin":"glyphicon-bitcoin","glyphicon-btc":"glyphicon-btc","glyphicon-xbt":"glyphicon-xbt","glyphicon-yen":"glyphicon-yen","glyphicon-jpy":"glyphicon-jpy","glyphicon-ruble":"glyphicon-ruble","glyphicon-rub":"glyphicon-rub","glyphicon-scale":"glyphicon-scale","glyphicon-ice-lolly":"glyphicon-ice-lolly","glyphicon-ice-lolly-tasted":"glyphicon-ice-lolly-tasted","glyphicon-education":"glyphicon-education","glyphicon-option-horizontal":"glyphicon-option-horizontal","glyphicon-option-vertical":"glyphicon-option-vertical","glyphicon-menu-hamburger":"glyphicon-menu-hamburger","glyphicon-modal-window":"glyphicon-modal-window","glyphicon-oil":"glyphicon-oil","glyphicon-grain":"glyphicon-grain","glyphicon-sunglasses":"glyphicon-sunglasses","glyphicon-text-size":"glyphicon-text-size","glyphicon-text-color":"glyphicon-text-color","glyphicon-text-background":"glyphicon-text-background","glyphicon-object-align-top":"glyphicon-object-align-top","glyphicon-object-align-bottom":"glyphicon-object-align-bottom","glyphicon-object-align-horizontal":"glyphicon-object-align-horizontal","glyphicon-object-align-left":"glyphicon-object-align-left","glyphicon-object-align-vertical":"glyphicon-object-align-vertical","glyphicon-object-align-right":"glyphicon-object-align-right","glyphicon-triangle-right":"glyphicon-triangle-right","glyphicon-triangle-left":"glyphicon-triangle-left","glyphicon-triangle-bottom":"glyphicon-triangle-bottom","glyphicon-triangle-top":"glyphicon-triangle-top","glyphicon-console":"glyphicon-console","glyphicon-superscript":"glyphicon-superscript","glyphicon-subscript":"glyphicon-subscript","glyphicon-menu-left":"glyphicon-menu-left","glyphicon-menu-right":"glyphicon-menu-right","glyphicon-menu-down":"glyphicon-menu-down","glyphicon-menu-up":"glyphicon-menu-up","img-responsive":"img-responsive","img-rounded":"img-rounded","img-thumbnail":"img-thumbnail","img-circle":"img-circle","sr-only":"sr-only","sr-only-focusable":"sr-only-focusable",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",small:"small",lead:"lead",mark:"mark","text-left":"text-left","text-right":"text-right","text-center":"text-center","text-justify":"text-justify","text-nowrap":"text-nowrap","text-lowercase":"text-lowercase","text-uppercase":"text-uppercase",initialism:"initialism","text-capitalize":"text-capitalize","text-muted":"text-muted","text-primary":"text-primary","text-success":"text-success","text-info":"text-info","text-warning":"text-warning","text-danger":"text-danger","bg-primary":"bg-primary","bg-success":"bg-success","bg-info":"bg-info","bg-warning":"bg-warning","bg-danger":"bg-danger","page-header":"page-header","list-unstyled":"list-unstyled","list-inline":"list-inline","dl-horizontal":"dl-horizontal","blockquote-reverse":"blockquote-reverse","pull-right":"pull-right","pre-scrollable":"pre-scrollable",container:"container","container-fluid":"container-fluid",row:"row","col-xs-1":"col-xs-1","col-sm-1":"col-sm-1","col-md-1":"col-md-1","col-lg-1":"col-lg-1","col-xs-2":"col-xs-2","col-sm-2":"col-sm-2","col-md-2":"col-md-2","col-lg-2":"col-lg-2","col-xs-3":"col-xs-3","col-sm-3":"col-sm-3","col-md-3":"col-md-3","col-lg-3":"col-lg-3","col-xs-4":"col-xs-4","col-sm-4":"col-sm-4","col-md-4":"col-md-4","col-lg-4":"col-lg-4","col-xs-5":"col-xs-5","col-sm-5":"col-sm-5","col-md-5":"col-md-5","col-lg-5":"col-lg-5","col-xs-6":"col-xs-6","col-sm-6":"col-sm-6","col-md-6":"col-md-6","col-lg-6":"col-lg-6","col-xs-7":"col-xs-7","col-sm-7":"col-sm-7","col-md-7":"col-md-7","col-lg-7":"col-lg-7","col-xs-8":"col-xs-8","col-sm-8":"col-sm-8","col-md-8":"col-md-8","col-lg-8":"col-lg-8","col-xs-9":"col-xs-9","col-sm-9":"col-sm-9","col-md-9":"col-md-9","col-lg-9":"col-lg-9","col-xs-10":"col-xs-10","col-sm-10":"col-sm-10","col-md-10":"col-md-10","col-lg-10":"col-lg-10","col-xs-11":"col-xs-11","col-sm-11":"col-sm-11","col-md-11":"col-md-11","col-lg-11":"col-lg-11","col-xs-12":"col-xs-12","col-sm-12":"col-sm-12","col-md-12":"col-md-12","col-lg-12":"col-lg-12","col-xs-pull-0":"col-xs-pull-0","col-xs-pull-1":"col-xs-pull-1","col-xs-pull-2":"col-xs-pull-2","col-xs-pull-3":"col-xs-pull-3","col-xs-pull-4":"col-xs-pull-4","col-xs-pull-5":"col-xs-pull-5","col-xs-pull-6":"col-xs-pull-6","col-xs-pull-7":"col-xs-pull-7","col-xs-pull-8":"col-xs-pull-8","col-xs-pull-9":"col-xs-pull-9","col-xs-pull-10":"col-xs-pull-10","col-xs-pull-11":"col-xs-pull-11","col-xs-pull-12":"col-xs-pull-12","col-xs-push-0":"col-xs-push-0","col-xs-push-1":"col-xs-push-1","col-xs-push-2":"col-xs-push-2","col-xs-push-3":"col-xs-push-3","col-xs-push-4":"col-xs-push-4","col-xs-push-5":"col-xs-push-5","col-xs-push-6":"col-xs-push-6","col-xs-push-7":"col-xs-push-7","col-xs-push-8":"col-xs-push-8","col-xs-push-9":"col-xs-push-9","col-xs-push-10":"col-xs-push-10","col-xs-push-11":"col-xs-push-11","col-xs-push-12":"col-xs-push-12","col-xs-offset-0":"col-xs-offset-0","col-xs-offset-1":"col-xs-offset-1","col-xs-offset-2":"col-xs-offset-2","col-xs-offset-3":"col-xs-offset-3","col-xs-offset-4":"col-xs-offset-4","col-xs-offset-5":"col-xs-offset-5","col-xs-offset-6":"col-xs-offset-6","col-xs-offset-7":"col-xs-offset-7","col-xs-offset-8":"col-xs-offset-8","col-xs-offset-9":"col-xs-offset-9","col-xs-offset-10":"col-xs-offset-10","col-xs-offset-11":"col-xs-offset-11","col-xs-offset-12":"col-xs-offset-12","col-sm-pull-0":"col-sm-pull-0","col-sm-pull-1":"col-sm-pull-1","col-sm-pull-2":"col-sm-pull-2","col-sm-pull-3":"col-sm-pull-3","col-sm-pull-4":"col-sm-pull-4","col-sm-pull-5":"col-sm-pull-5","col-sm-pull-6":"col-sm-pull-6","col-sm-pull-7":"col-sm-pull-7","col-sm-pull-8":"col-sm-pull-8","col-sm-pull-9":"col-sm-pull-9","col-sm-pull-10":"col-sm-pull-10","col-sm-pull-11":"col-sm-pull-11","col-sm-pull-12":"col-sm-pull-12","col-sm-push-0":"col-sm-push-0","col-sm-push-1":"col-sm-push-1","col-sm-push-2":"col-sm-push-2","col-sm-push-3":"col-sm-push-3","col-sm-push-4":"col-sm-push-4","col-sm-push-5":"col-sm-push-5","col-sm-push-6":"col-sm-push-6","col-sm-push-7":"col-sm-push-7","col-sm-push-8":"col-sm-push-8","col-sm-push-9":"col-sm-push-9","col-sm-push-10":"col-sm-push-10","col-sm-push-11":"col-sm-push-11","col-sm-push-12":"col-sm-push-12","col-sm-offset-0":"col-sm-offset-0","col-sm-offset-1":"col-sm-offset-1","col-sm-offset-2":"col-sm-offset-2","col-sm-offset-3":"col-sm-offset-3","col-sm-offset-4":"col-sm-offset-4","col-sm-offset-5":"col-sm-offset-5","col-sm-offset-6":"col-sm-offset-6","col-sm-offset-7":"col-sm-offset-7","col-sm-offset-8":"col-sm-offset-8","col-sm-offset-9":"col-sm-offset-9","col-sm-offset-10":"col-sm-offset-10","col-sm-offset-11":"col-sm-offset-11","col-sm-offset-12":"col-sm-offset-12","col-md-pull-0":"col-md-pull-0","col-md-pull-1":"col-md-pull-1","col-md-pull-2":"col-md-pull-2","col-md-pull-3":"col-md-pull-3","col-md-pull-4":"col-md-pull-4","col-md-pull-5":"col-md-pull-5","col-md-pull-6":"col-md-pull-6","col-md-pull-7":"col-md-pull-7","col-md-pull-8":"col-md-pull-8","col-md-pull-9":"col-md-pull-9","col-md-pull-10":"col-md-pull-10","col-md-pull-11":"col-md-pull-11","col-md-pull-12":"col-md-pull-12","col-md-push-0":"col-md-push-0","col-md-push-1":"col-md-push-1","col-md-push-2":"col-md-push-2","col-md-push-3":"col-md-push-3","col-md-push-4":"col-md-push-4","col-md-push-5":"col-md-push-5","col-md-push-6":"col-md-push-6","col-md-push-7":"col-md-push-7","col-md-push-8":"col-md-push-8","col-md-push-9":"col-md-push-9","col-md-push-10":"col-md-push-10","col-md-push-11":"col-md-push-11","col-md-push-12":"col-md-push-12","col-md-offset-0":"col-md-offset-0","col-md-offset-1":"col-md-offset-1","col-md-offset-2":"col-md-offset-2","col-md-offset-3":"col-md-offset-3","col-md-offset-4":"col-md-offset-4","col-md-offset-5":"col-md-offset-5","col-md-offset-6":"col-md-offset-6","col-md-offset-7":"col-md-offset-7","col-md-offset-8":"col-md-offset-8","col-md-offset-9":"col-md-offset-9","col-md-offset-10":"col-md-offset-10","col-md-offset-11":"col-md-offset-11","col-md-offset-12":"col-md-offset-12","col-lg-pull-0":"col-lg-pull-0","col-lg-pull-1":"col-lg-pull-1","col-lg-pull-2":"col-lg-pull-2","col-lg-pull-3":"col-lg-pull-3","col-lg-pull-4":"col-lg-pull-4","col-lg-pull-5":"col-lg-pull-5","col-lg-pull-6":"col-lg-pull-6","col-lg-pull-7":"col-lg-pull-7","col-lg-pull-8":"col-lg-pull-8","col-lg-pull-9":"col-lg-pull-9","col-lg-pull-10":"col-lg-pull-10","col-lg-pull-11":"col-lg-pull-11","col-lg-pull-12":"col-lg-pull-12","col-lg-push-0":"col-lg-push-0","col-lg-push-1":"col-lg-push-1","col-lg-push-2":"col-lg-push-2","col-lg-push-3":"col-lg-push-3","col-lg-push-4":"col-lg-push-4","col-lg-push-5":"col-lg-push-5","col-lg-push-6":"col-lg-push-6","col-lg-push-7":"col-lg-push-7","col-lg-push-8":"col-lg-push-8","col-lg-push-9":"col-lg-push-9","col-lg-push-10":"col-lg-push-10","col-lg-push-11":"col-lg-push-11","col-lg-push-12":"col-lg-push-12","col-lg-offset-0":"col-lg-offset-0","col-lg-offset-1":"col-lg-offset-1","col-lg-offset-2":"col-lg-offset-2","col-lg-offset-3":"col-lg-offset-3","col-lg-offset-4":"col-lg-offset-4","col-lg-offset-5":"col-lg-offset-5","col-lg-offset-6":"col-lg-offset-6","col-lg-offset-7":"col-lg-offset-7","col-lg-offset-8":"col-lg-offset-8","col-lg-offset-9":"col-lg-offset-9","col-lg-offset-10":"col-lg-offset-10","col-lg-offset-11":"col-lg-offset-11","col-lg-offset-12":"col-lg-offset-12","table-condensed":"table-condensed","table-striped":"table-striped","table-hover":"table-hover",active:"active",success:"success",info:"info",warning:"warning",danger:"danger","table-responsive":"table-responsive","form-control":"form-control","input-sm":"input-sm","input-group-sm":"input-group-sm","input-group-addon":"input-group-addon","input-group-btn":"input-group-btn","input-lg":"input-lg","input-group-lg":"input-group-lg","form-group":"form-group",radio:"radio",checkbox:"checkbox","radio-inline":"radio-inline","checkbox-inline":"checkbox-inline",disabled:"disabled","form-control-static":"form-control-static","form-group-sm":"form-group-sm","form-group-lg":"form-group-lg","has-feedback":"has-feedback","form-control-feedback":"form-control-feedback","has-success":"has-success","help-block":"help-block","control-label":"control-label","has-warning":"has-warning","has-error":"has-error","form-inline":"form-inline","input-group":"input-group","form-horizontal":"form-horizontal",focus:"focus","btn-default":"btn-default",open:"open","dropdown-toggle":"dropdown-toggle",badge:"badge","btn-primary":"btn-primary","btn-success":"btn-success","btn-info":"btn-info","btn-warning":"btn-warning","btn-danger":"btn-danger","btn-link":"btn-link","btn-lg":"btn-lg","btn-group-lg":"btn-group-lg","btn-sm":"btn-sm","btn-group-sm":"btn-group-sm","btn-xs":"btn-xs","btn-group-xs":"btn-group-xs","btn-block":"btn-block",fade:"fade",in:"in",collapse:"collapse",collapsing:"collapsing",dropdown:"dropdown","dropdown-menu":"dropdown-menu",divider:"divider","dropdown-menu-right":"dropdown-menu-right","dropdown-menu-left":"dropdown-menu-left","dropdown-header":"dropdown-header","dropdown-backdrop":"dropdown-backdrop","navbar-fixed-bottom":"navbar-fixed-bottom","navbar-right":"navbar-right","btn-group":"btn-group","btn-group-vertical":"btn-group-vertical","btn-toolbar":"btn-toolbar","btn-group-justified":"btn-group-justified",nav:"nav","nav-divider":"nav-divider","nav-tabs":"nav-tabs","nav-pills":"nav-pills","nav-stacked":"nav-stacked","nav-justified":"nav-justified","nav-tabs-justified":"nav-tabs-justified","tab-content":"tab-content","tab-pane":"tab-pane","navbar-header":"navbar-header","navbar-collapse":"navbar-collapse","navbar-fixed-top":"navbar-fixed-top","navbar-static-top":"navbar-static-top","navbar-brand":"navbar-brand","navbar-toggle":"navbar-toggle","icon-bar":"icon-bar","navbar-nav":"navbar-nav","navbar-form":"navbar-form","navbar-btn":"navbar-btn","navbar-text":"navbar-text","navbar-left":"navbar-left","navbar-default":"navbar-default","navbar-link":"navbar-link","navbar-inverse":"navbar-inverse",breadcrumb:"breadcrumb",pagination:"pagination","pagination-lg":"pagination-lg","pagination-sm":"pagination-sm",pager:"pager",next:"next",previous:"previous","label-default":"label-default","label-primary":"label-primary","label-success":"label-success","label-info":"label-info","label-warning":"label-warning","label-danger":"label-danger","list-group-item":"list-group-item",jumbotron:"jumbotron",thumbnail:"thumbnail",caption:"caption",alert:"alert","alert-link":"alert-link","alert-dismissable":"alert-dismissable","alert-dismissible":"alert-dismissible",close:"close","alert-success":"alert-success","alert-info":"alert-info","alert-warning":"alert-warning","alert-danger":"alert-danger",progress:"progress","progress-bar":"progress-bar","progress-striped":"progress-striped","progress-bar-striped":"progress-bar-striped","progress-bar-stripes":"progress-bar-stripes","progress-bar-success":"progress-bar-success","progress-bar-info":"progress-bar-info","progress-bar-warning":"progress-bar-warning","progress-bar-danger":"progress-bar-danger",media:"media","media-body":"media-body","media-object":"media-object","media-right":"media-right","media-left":"media-left","pull-left":"pull-left","media-middle":"media-middle","media-bottom":"media-bottom","media-heading":"media-heading","media-list":"media-list","list-group":"list-group","list-group-item-heading":"list-group-item-heading","list-group-item-text":"list-group-item-text","list-group-item-success":"list-group-item-success","list-group-item-info":"list-group-item-info","list-group-item-warning":"list-group-item-warning","list-group-item-danger":"list-group-item-danger",panel:"panel","panel-body":"panel-body","panel-heading":"panel-heading","panel-title":"panel-title","panel-footer":"panel-footer","panel-collapse":"panel-collapse","panel-group":"panel-group","panel-default":"panel-default","panel-primary":"panel-primary","panel-success":"panel-success","panel-info":"panel-info","panel-warning":"panel-warning","panel-danger":"panel-danger","embed-responsive":"embed-responsive","embed-responsive-item":"embed-responsive-item","embed-responsive-16by9":"embed-responsive-16by9","embed-responsive-4by3":"embed-responsive-4by3",well:"well","well-lg":"well-lg","well-sm":"well-sm","modal-open":"modal-open",modal:"modal","modal-dialog":"modal-dialog","modal-content":"modal-content","modal-backdrop":"modal-backdrop","modal-header":"modal-header","modal-title":"modal-title","modal-body":"modal-body","modal-footer":"modal-footer","modal-scrollbar-measure":"modal-scrollbar-measure","modal-sm":"modal-sm","modal-lg":"modal-lg",tooltip:"tooltip",top:"top",right:"right",bottom:"bottom",left:"left","tooltip-inner":"tooltip-inner","tooltip-arrow":"tooltip-arrow","top-left":"top-left","top-right":"top-right","bottom-left":"bottom-left","bottom-right":"bottom-right",popover:"popover","popover-title":"popover-title","popover-content":"popover-content",arrow:"arrow",carousel:"carousel","carousel-inner":"carousel-inner",item:"item",prev:"prev","carousel-control":"carousel-control","icon-prev":"icon-prev","icon-next":"icon-next","carousel-indicators":"carousel-indicators","carousel-caption":"carousel-caption",clearfix:"clearfix","center-block":"center-block",hide:"hide",show:"show",invisible:"invisible","text-hide":"text-hide",hidden:"hidden",affix:"affix","visible-xs":"visible-xs","visible-sm":"visible-sm","visible-md":"visible-md","visible-lg":"visible-lg","visible-xs-block":"visible-xs-block","visible-xs-inline":"visible-xs-inline","visible-xs-inline-block":"visible-xs-inline-block","visible-sm-block":"visible-sm-block","visible-sm-inline":"visible-sm-inline","visible-sm-inline-block":"visible-sm-inline-block","visible-md-block":"visible-md-block","visible-md-inline":"visible-md-inline","visible-md-inline-block":"visible-md-inline-block","visible-lg-block":"visible-lg-block","visible-lg-inline":"visible-lg-inline","visible-lg-inline-block":"visible-lg-inline-block","hidden-xs":"hidden-xs","hidden-sm":"hidden-sm","hidden-md":"hidden-md","hidden-lg":"hidden-lg","visible-print":"visible-print","visible-print-block":"visible-print-block","visible-print-inline":"visible-print-inline","visible-print-inline-block":"visible-print-inline-block","hidden-print":"hidden-print",fa:"fa","fa-lg":"fa-lg","fa-2x":"fa-2x","fa-3x":"fa-3x","fa-4x":"fa-4x","fa-5x":"fa-5x","fa-fw":"fa-fw","fa-ul":"fa-ul","fa-li":"fa-li","fa-border":"fa-border","fa-pull-left":"fa-pull-left","fa-pull-right":"fa-pull-right","fa-spin":"fa-spin","fa-pulse":"fa-pulse","fa-rotate-90":"fa-rotate-90","fa-rotate-180":"fa-rotate-180","fa-rotate-270":"fa-rotate-270","fa-flip-horizontal":"fa-flip-horizontal","fa-flip-vertical":"fa-flip-vertical","fa-stack":"fa-stack","fa-stack-1x":"fa-stack-1x","fa-stack-2x":"fa-stack-2x","fa-inverse":"fa-inverse","fa-glass":"fa-glass","fa-music":"fa-music","fa-search":"fa-search","fa-envelope-o":"fa-envelope-o","fa-heart":"fa-heart","fa-star":"fa-star","fa-star-o":"fa-star-o","fa-user":"fa-user","fa-film":"fa-film","fa-th-large":"fa-th-large","fa-th":"fa-th","fa-th-list":"fa-th-list","fa-check":"fa-check","fa-remove":"fa-remove","fa-close":"fa-close","fa-times":"fa-times","fa-search-plus":"fa-search-plus","fa-search-minus":"fa-search-minus","fa-power-off":"fa-power-off","fa-signal":"fa-signal","fa-gear":"fa-gear","fa-cog":"fa-cog","fa-trash-o":"fa-trash-o","fa-home":"fa-home","fa-file-o":"fa-file-o","fa-clock-o":"fa-clock-o","fa-road":"fa-road","fa-download":"fa-download","fa-arrow-circle-o-down":"fa-arrow-circle-o-down","fa-arrow-circle-o-up":"fa-arrow-circle-o-up","fa-inbox":"fa-inbox","fa-play-circle-o":"fa-play-circle-o","fa-rotate-right":"fa-rotate-right","fa-repeat":"fa-repeat","fa-refresh":"fa-refresh","fa-list-alt":"fa-list-alt","fa-lock":"fa-lock","fa-flag":"fa-flag","fa-headphones":"fa-headphones","fa-volume-off":"fa-volume-off","fa-volume-down":"fa-volume-down","fa-volume-up":"fa-volume-up","fa-qrcode":"fa-qrcode","fa-barcode":"fa-barcode","fa-tag":"fa-tag","fa-tags":"fa-tags","fa-book":"fa-book","fa-bookmark":"fa-bookmark","fa-print":"fa-print","fa-camera":"fa-camera","fa-font":"fa-font","fa-bold":"fa-bold","fa-italic":"fa-italic","fa-text-height":"fa-text-height","fa-text-width":"fa-text-width","fa-align-left":"fa-align-left","fa-align-center":"fa-align-center","fa-align-right":"fa-align-right","fa-align-justify":"fa-align-justify","fa-list":"fa-list","fa-dedent":"fa-dedent","fa-outdent":"fa-outdent","fa-indent":"fa-indent","fa-video-camera":"fa-video-camera","fa-photo":"fa-photo","fa-image":"fa-image","fa-picture-o":"fa-picture-o","fa-pencil":"fa-pencil","fa-map-marker":"fa-map-marker","fa-adjust":"fa-adjust","fa-tint":"fa-tint","fa-edit":"fa-edit","fa-pencil-square-o":"fa-pencil-square-o","fa-share-square-o":"fa-share-square-o","fa-check-square-o":"fa-check-square-o","fa-arrows":"fa-arrows","fa-step-backward":"fa-step-backward","fa-fast-backward":"fa-fast-backward","fa-backward":"fa-backward","fa-play":"fa-play","fa-pause":"fa-pause","fa-stop":"fa-stop","fa-forward":"fa-forward","fa-fast-forward":"fa-fast-forward","fa-step-forward":"fa-step-forward","fa-eject":"fa-eject","fa-chevron-left":"fa-chevron-left","fa-chevron-right":"fa-chevron-right","fa-plus-circle":"fa-plus-circle","fa-minus-circle":"fa-minus-circle","fa-times-circle":"fa-times-circle","fa-check-circle":"fa-check-circle","fa-question-circle":"fa-question-circle","fa-info-circle":"fa-info-circle","fa-crosshairs":"fa-crosshairs","fa-times-circle-o":"fa-times-circle-o","fa-check-circle-o":"fa-check-circle-o","fa-ban":"fa-ban","fa-arrow-left":"fa-arrow-left","fa-arrow-right":"fa-arrow-right","fa-arrow-up":"fa-arrow-up","fa-arrow-down":"fa-arrow-down","fa-mail-forward":"fa-mail-forward","fa-share":"fa-share","fa-expand":"fa-expand","fa-compress":"fa-compress",
+"fa-plus":"fa-plus","fa-minus":"fa-minus","fa-asterisk":"fa-asterisk","fa-exclamation-circle":"fa-exclamation-circle","fa-gift":"fa-gift","fa-leaf":"fa-leaf","fa-fire":"fa-fire","fa-eye":"fa-eye","fa-eye-slash":"fa-eye-slash","fa-warning":"fa-warning","fa-exclamation-triangle":"fa-exclamation-triangle","fa-plane":"fa-plane","fa-calendar":"fa-calendar","fa-random":"fa-random","fa-comment":"fa-comment","fa-magnet":"fa-magnet","fa-chevron-up":"fa-chevron-up","fa-chevron-down":"fa-chevron-down","fa-retweet":"fa-retweet","fa-shopping-cart":"fa-shopping-cart","fa-folder":"fa-folder","fa-folder-open":"fa-folder-open","fa-arrows-v":"fa-arrows-v","fa-arrows-h":"fa-arrows-h","fa-bar-chart-o":"fa-bar-chart-o","fa-bar-chart":"fa-bar-chart","fa-twitter-square":"fa-twitter-square","fa-facebook-square":"fa-facebook-square","fa-camera-retro":"fa-camera-retro","fa-key":"fa-key","fa-gears":"fa-gears","fa-cogs":"fa-cogs","fa-comments":"fa-comments","fa-thumbs-o-up":"fa-thumbs-o-up","fa-thumbs-o-down":"fa-thumbs-o-down","fa-star-half":"fa-star-half","fa-heart-o":"fa-heart-o","fa-sign-out":"fa-sign-out","fa-linkedin-square":"fa-linkedin-square","fa-thumb-tack":"fa-thumb-tack","fa-external-link":"fa-external-link","fa-sign-in":"fa-sign-in","fa-trophy":"fa-trophy","fa-github-square":"fa-github-square","fa-upload":"fa-upload","fa-lemon-o":"fa-lemon-o","fa-phone":"fa-phone","fa-square-o":"fa-square-o","fa-bookmark-o":"fa-bookmark-o","fa-phone-square":"fa-phone-square","fa-twitter":"fa-twitter","fa-facebook-f":"fa-facebook-f","fa-facebook":"fa-facebook","fa-github":"fa-github","fa-unlock":"fa-unlock","fa-credit-card":"fa-credit-card","fa-feed":"fa-feed","fa-rss":"fa-rss","fa-hdd-o":"fa-hdd-o","fa-bullhorn":"fa-bullhorn","fa-bell":"fa-bell","fa-certificate":"fa-certificate","fa-hand-o-right":"fa-hand-o-right","fa-hand-o-left":"fa-hand-o-left","fa-hand-o-up":"fa-hand-o-up","fa-hand-o-down":"fa-hand-o-down","fa-arrow-circle-left":"fa-arrow-circle-left","fa-arrow-circle-right":"fa-arrow-circle-right","fa-arrow-circle-up":"fa-arrow-circle-up","fa-arrow-circle-down":"fa-arrow-circle-down","fa-globe":"fa-globe","fa-wrench":"fa-wrench","fa-tasks":"fa-tasks","fa-filter":"fa-filter","fa-briefcase":"fa-briefcase","fa-arrows-alt":"fa-arrows-alt","fa-group":"fa-group","fa-users":"fa-users","fa-chain":"fa-chain","fa-link":"fa-link","fa-cloud":"fa-cloud","fa-flask":"fa-flask","fa-cut":"fa-cut","fa-scissors":"fa-scissors","fa-copy":"fa-copy","fa-files-o":"fa-files-o","fa-paperclip":"fa-paperclip","fa-save":"fa-save","fa-floppy-o":"fa-floppy-o","fa-square":"fa-square","fa-navicon":"fa-navicon","fa-reorder":"fa-reorder","fa-bars":"fa-bars","fa-list-ul":"fa-list-ul","fa-list-ol":"fa-list-ol","fa-strikethrough":"fa-strikethrough","fa-underline":"fa-underline","fa-table":"fa-table","fa-magic":"fa-magic","fa-truck":"fa-truck","fa-pinterest":"fa-pinterest","fa-pinterest-square":"fa-pinterest-square","fa-google-plus-square":"fa-google-plus-square","fa-google-plus":"fa-google-plus","fa-money":"fa-money","fa-caret-down":"fa-caret-down","fa-caret-up":"fa-caret-up","fa-caret-left":"fa-caret-left","fa-caret-right":"fa-caret-right","fa-columns":"fa-columns","fa-unsorted":"fa-unsorted","fa-sort":"fa-sort","fa-sort-down":"fa-sort-down","fa-sort-desc":"fa-sort-desc","fa-sort-up":"fa-sort-up","fa-sort-asc":"fa-sort-asc","fa-envelope":"fa-envelope","fa-linkedin":"fa-linkedin","fa-rotate-left":"fa-rotate-left","fa-undo":"fa-undo","fa-legal":"fa-legal","fa-gavel":"fa-gavel","fa-dashboard":"fa-dashboard","fa-tachometer":"fa-tachometer","fa-comment-o":"fa-comment-o","fa-comments-o":"fa-comments-o","fa-flash":"fa-flash","fa-bolt":"fa-bolt","fa-sitemap":"fa-sitemap","fa-umbrella":"fa-umbrella","fa-paste":"fa-paste","fa-clipboard":"fa-clipboard","fa-lightbulb-o":"fa-lightbulb-o","fa-exchange":"fa-exchange","fa-cloud-download":"fa-cloud-download","fa-cloud-upload":"fa-cloud-upload","fa-user-md":"fa-user-md","fa-stethoscope":"fa-stethoscope","fa-suitcase":"fa-suitcase","fa-bell-o":"fa-bell-o","fa-coffee":"fa-coffee","fa-cutlery":"fa-cutlery","fa-file-text-o":"fa-file-text-o","fa-building-o":"fa-building-o","fa-hospital-o":"fa-hospital-o","fa-ambulance":"fa-ambulance","fa-medkit":"fa-medkit","fa-fighter-jet":"fa-fighter-jet","fa-beer":"fa-beer","fa-h-square":"fa-h-square","fa-plus-square":"fa-plus-square","fa-angle-double-left":"fa-angle-double-left","fa-angle-double-right":"fa-angle-double-right","fa-angle-double-up":"fa-angle-double-up","fa-angle-double-down":"fa-angle-double-down","fa-angle-left":"fa-angle-left","fa-angle-right":"fa-angle-right","fa-angle-up":"fa-angle-up","fa-angle-down":"fa-angle-down","fa-desktop":"fa-desktop","fa-laptop":"fa-laptop","fa-tablet":"fa-tablet","fa-mobile-phone":"fa-mobile-phone","fa-mobile":"fa-mobile","fa-circle-o":"fa-circle-o","fa-quote-left":"fa-quote-left","fa-quote-right":"fa-quote-right","fa-spinner":"fa-spinner","fa-circle":"fa-circle","fa-mail-reply":"fa-mail-reply","fa-reply":"fa-reply","fa-github-alt":"fa-github-alt","fa-folder-o":"fa-folder-o","fa-folder-open-o":"fa-folder-open-o","fa-smile-o":"fa-smile-o","fa-frown-o":"fa-frown-o","fa-meh-o":"fa-meh-o","fa-gamepad":"fa-gamepad","fa-keyboard-o":"fa-keyboard-o","fa-flag-o":"fa-flag-o","fa-flag-checkered":"fa-flag-checkered","fa-terminal":"fa-terminal","fa-code":"fa-code","fa-mail-reply-all":"fa-mail-reply-all","fa-reply-all":"fa-reply-all","fa-star-half-empty":"fa-star-half-empty","fa-star-half-full":"fa-star-half-full","fa-star-half-o":"fa-star-half-o","fa-location-arrow":"fa-location-arrow","fa-crop":"fa-crop","fa-code-fork":"fa-code-fork","fa-unlink":"fa-unlink","fa-chain-broken":"fa-chain-broken","fa-question":"fa-question","fa-info":"fa-info","fa-exclamation":"fa-exclamation","fa-superscript":"fa-superscript","fa-subscript":"fa-subscript","fa-eraser":"fa-eraser","fa-puzzle-piece":"fa-puzzle-piece","fa-microphone":"fa-microphone","fa-microphone-slash":"fa-microphone-slash","fa-shield":"fa-shield","fa-calendar-o":"fa-calendar-o","fa-fire-extinguisher":"fa-fire-extinguisher","fa-rocket":"fa-rocket","fa-maxcdn":"fa-maxcdn","fa-chevron-circle-left":"fa-chevron-circle-left","fa-chevron-circle-right":"fa-chevron-circle-right","fa-chevron-circle-up":"fa-chevron-circle-up","fa-chevron-circle-down":"fa-chevron-circle-down","fa-html5":"fa-html5","fa-css3":"fa-css3","fa-anchor":"fa-anchor","fa-unlock-alt":"fa-unlock-alt","fa-bullseye":"fa-bullseye","fa-ellipsis-h":"fa-ellipsis-h","fa-ellipsis-v":"fa-ellipsis-v","fa-rss-square":"fa-rss-square","fa-play-circle":"fa-play-circle","fa-ticket":"fa-ticket","fa-minus-square":"fa-minus-square","fa-minus-square-o":"fa-minus-square-o","fa-level-up":"fa-level-up","fa-level-down":"fa-level-down","fa-check-square":"fa-check-square","fa-pencil-square":"fa-pencil-square","fa-external-link-square":"fa-external-link-square","fa-share-square":"fa-share-square","fa-compass":"fa-compass","fa-toggle-down":"fa-toggle-down","fa-caret-square-o-down":"fa-caret-square-o-down","fa-toggle-up":"fa-toggle-up","fa-caret-square-o-up":"fa-caret-square-o-up","fa-toggle-right":"fa-toggle-right","fa-caret-square-o-right":"fa-caret-square-o-right","fa-euro":"fa-euro","fa-eur":"fa-eur","fa-gbp":"fa-gbp","fa-dollar":"fa-dollar","fa-usd":"fa-usd","fa-rupee":"fa-rupee","fa-inr":"fa-inr","fa-cny":"fa-cny","fa-rmb":"fa-rmb","fa-yen":"fa-yen","fa-jpy":"fa-jpy","fa-ruble":"fa-ruble","fa-rouble":"fa-rouble","fa-rub":"fa-rub","fa-won":"fa-won","fa-krw":"fa-krw","fa-bitcoin":"fa-bitcoin","fa-btc":"fa-btc","fa-file":"fa-file","fa-file-text":"fa-file-text","fa-sort-alpha-asc":"fa-sort-alpha-asc","fa-sort-alpha-desc":"fa-sort-alpha-desc","fa-sort-amount-asc":"fa-sort-amount-asc","fa-sort-amount-desc":"fa-sort-amount-desc","fa-sort-numeric-asc":"fa-sort-numeric-asc","fa-sort-numeric-desc":"fa-sort-numeric-desc","fa-thumbs-up":"fa-thumbs-up","fa-thumbs-down":"fa-thumbs-down","fa-youtube-square":"fa-youtube-square","fa-youtube":"fa-youtube","fa-xing":"fa-xing","fa-xing-square":"fa-xing-square","fa-youtube-play":"fa-youtube-play","fa-dropbox":"fa-dropbox","fa-stack-overflow":"fa-stack-overflow","fa-instagram":"fa-instagram","fa-flickr":"fa-flickr","fa-adn":"fa-adn","fa-bitbucket":"fa-bitbucket","fa-bitbucket-square":"fa-bitbucket-square","fa-tumblr":"fa-tumblr","fa-tumblr-square":"fa-tumblr-square","fa-long-arrow-down":"fa-long-arrow-down","fa-long-arrow-up":"fa-long-arrow-up","fa-long-arrow-left":"fa-long-arrow-left","fa-long-arrow-right":"fa-long-arrow-right","fa-apple":"fa-apple","fa-windows":"fa-windows","fa-android":"fa-android","fa-linux":"fa-linux","fa-dribbble":"fa-dribbble","fa-skype":"fa-skype","fa-foursquare":"fa-foursquare","fa-trello":"fa-trello","fa-female":"fa-female","fa-male":"fa-male","fa-gittip":"fa-gittip","fa-gratipay":"fa-gratipay","fa-sun-o":"fa-sun-o","fa-moon-o":"fa-moon-o","fa-archive":"fa-archive","fa-bug":"fa-bug","fa-vk":"fa-vk","fa-weibo":"fa-weibo","fa-renren":"fa-renren","fa-pagelines":"fa-pagelines","fa-stack-exchange":"fa-stack-exchange","fa-arrow-circle-o-right":"fa-arrow-circle-o-right","fa-arrow-circle-o-left":"fa-arrow-circle-o-left","fa-toggle-left":"fa-toggle-left","fa-caret-square-o-left":"fa-caret-square-o-left","fa-dot-circle-o":"fa-dot-circle-o","fa-wheelchair":"fa-wheelchair","fa-vimeo-square":"fa-vimeo-square","fa-turkish-lira":"fa-turkish-lira","fa-try":"fa-try","fa-plus-square-o":"fa-plus-square-o","fa-space-shuttle":"fa-space-shuttle","fa-slack":"fa-slack","fa-envelope-square":"fa-envelope-square","fa-wordpress":"fa-wordpress","fa-openid":"fa-openid","fa-institution":"fa-institution","fa-bank":"fa-bank","fa-university":"fa-university","fa-mortar-board":"fa-mortar-board","fa-graduation-cap":"fa-graduation-cap","fa-yahoo":"fa-yahoo","fa-google":"fa-google","fa-reddit":"fa-reddit","fa-reddit-square":"fa-reddit-square","fa-stumbleupon-circle":"fa-stumbleupon-circle","fa-stumbleupon":"fa-stumbleupon","fa-delicious":"fa-delicious","fa-digg":"fa-digg","fa-pied-piper-pp":"fa-pied-piper-pp","fa-pied-piper-alt":"fa-pied-piper-alt","fa-drupal":"fa-drupal","fa-joomla":"fa-joomla","fa-language":"fa-language","fa-fax":"fa-fax","fa-building":"fa-building","fa-child":"fa-child","fa-paw":"fa-paw","fa-spoon":"fa-spoon","fa-cube":"fa-cube","fa-cubes":"fa-cubes","fa-behance":"fa-behance","fa-behance-square":"fa-behance-square","fa-steam":"fa-steam","fa-steam-square":"fa-steam-square","fa-recycle":"fa-recycle","fa-automobile":"fa-automobile","fa-car":"fa-car","fa-cab":"fa-cab","fa-taxi":"fa-taxi","fa-tree":"fa-tree","fa-spotify":"fa-spotify","fa-deviantart":"fa-deviantart","fa-soundcloud":"fa-soundcloud","fa-database":"fa-database","fa-file-pdf-o":"fa-file-pdf-o","fa-file-word-o":"fa-file-word-o","fa-file-excel-o":"fa-file-excel-o","fa-file-powerpoint-o":"fa-file-powerpoint-o","fa-file-photo-o":"fa-file-photo-o","fa-file-picture-o":"fa-file-picture-o","fa-file-image-o":"fa-file-image-o","fa-file-zip-o":"fa-file-zip-o","fa-file-archive-o":"fa-file-archive-o","fa-file-sound-o":"fa-file-sound-o","fa-file-audio-o":"fa-file-audio-o","fa-file-movie-o":"fa-file-movie-o","fa-file-video-o":"fa-file-video-o","fa-file-code-o":"fa-file-code-o","fa-vine":"fa-vine","fa-codepen":"fa-codepen","fa-jsfiddle":"fa-jsfiddle","fa-life-bouy":"fa-life-bouy","fa-life-buoy":"fa-life-buoy","fa-life-saver":"fa-life-saver","fa-support":"fa-support","fa-life-ring":"fa-life-ring","fa-circle-o-notch":"fa-circle-o-notch","fa-ra":"fa-ra","fa-resistance":"fa-resistance","fa-rebel":"fa-rebel","fa-ge":"fa-ge","fa-empire":"fa-empire","fa-git-square":"fa-git-square","fa-git":"fa-git","fa-y-combinator-square":"fa-y-combinator-square","fa-yc-square":"fa-yc-square","fa-hacker-news":"fa-hacker-news","fa-tencent-weibo":"fa-tencent-weibo","fa-qq":"fa-qq","fa-wechat":"fa-wechat","fa-weixin":"fa-weixin","fa-send":"fa-send","fa-paper-plane":"fa-paper-plane","fa-send-o":"fa-send-o","fa-paper-plane-o":"fa-paper-plane-o","fa-history":"fa-history","fa-circle-thin":"fa-circle-thin","fa-header":"fa-header","fa-paragraph":"fa-paragraph","fa-sliders":"fa-sliders","fa-share-alt":"fa-share-alt","fa-share-alt-square":"fa-share-alt-square","fa-bomb":"fa-bomb","fa-soccer-ball-o":"fa-soccer-ball-o","fa-futbol-o":"fa-futbol-o","fa-tty":"fa-tty","fa-binoculars":"fa-binoculars","fa-plug":"fa-plug","fa-slideshare":"fa-slideshare","fa-twitch":"fa-twitch","fa-yelp":"fa-yelp","fa-newspaper-o":"fa-newspaper-o","fa-wifi":"fa-wifi","fa-calculator":"fa-calculator","fa-paypal":"fa-paypal","fa-google-wallet":"fa-google-wallet","fa-cc-visa":"fa-cc-visa","fa-cc-mastercard":"fa-cc-mastercard","fa-cc-discover":"fa-cc-discover","fa-cc-amex":"fa-cc-amex","fa-cc-paypal":"fa-cc-paypal","fa-cc-stripe":"fa-cc-stripe","fa-bell-slash":"fa-bell-slash","fa-bell-slash-o":"fa-bell-slash-o","fa-trash":"fa-trash","fa-copyright":"fa-copyright","fa-at":"fa-at","fa-eyedropper":"fa-eyedropper","fa-paint-brush":"fa-paint-brush","fa-birthday-cake":"fa-birthday-cake","fa-area-chart":"fa-area-chart","fa-pie-chart":"fa-pie-chart","fa-line-chart":"fa-line-chart","fa-lastfm":"fa-lastfm","fa-lastfm-square":"fa-lastfm-square","fa-toggle-off":"fa-toggle-off","fa-toggle-on":"fa-toggle-on","fa-bicycle":"fa-bicycle","fa-bus":"fa-bus","fa-ioxhost":"fa-ioxhost","fa-angellist":"fa-angellist","fa-cc":"fa-cc","fa-shekel":"fa-shekel","fa-sheqel":"fa-sheqel","fa-ils":"fa-ils","fa-meanpath":"fa-meanpath","fa-buysellads":"fa-buysellads","fa-connectdevelop":"fa-connectdevelop","fa-dashcube":"fa-dashcube","fa-forumbee":"fa-forumbee","fa-leanpub":"fa-leanpub","fa-sellsy":"fa-sellsy","fa-shirtsinbulk":"fa-shirtsinbulk","fa-simplybuilt":"fa-simplybuilt","fa-skyatlas":"fa-skyatlas","fa-cart-plus":"fa-cart-plus","fa-cart-arrow-down":"fa-cart-arrow-down","fa-diamond":"fa-diamond","fa-ship":"fa-ship","fa-user-secret":"fa-user-secret","fa-motorcycle":"fa-motorcycle","fa-street-view":"fa-street-view","fa-heartbeat":"fa-heartbeat","fa-venus":"fa-venus","fa-mars":"fa-mars","fa-mercury":"fa-mercury","fa-intersex":"fa-intersex","fa-transgender":"fa-transgender","fa-transgender-alt":"fa-transgender-alt","fa-venus-double":"fa-venus-double","fa-mars-double":"fa-mars-double","fa-venus-mars":"fa-venus-mars","fa-mars-stroke":"fa-mars-stroke","fa-mars-stroke-v":"fa-mars-stroke-v","fa-mars-stroke-h":"fa-mars-stroke-h","fa-neuter":"fa-neuter","fa-genderless":"fa-genderless","fa-facebook-official":"fa-facebook-official","fa-pinterest-p":"fa-pinterest-p","fa-whatsapp":"fa-whatsapp","fa-server":"fa-server","fa-user-plus":"fa-user-plus","fa-user-times":"fa-user-times","fa-hotel":"fa-hotel","fa-bed":"fa-bed","fa-viacoin":"fa-viacoin","fa-train":"fa-train","fa-subway":"fa-subway","fa-medium":"fa-medium","fa-yc":"fa-yc","fa-y-combinator":"fa-y-combinator","fa-optin-monster":"fa-optin-monster","fa-opencart":"fa-opencart","fa-expeditedssl":"fa-expeditedssl","fa-battery-4":"fa-battery-4","fa-battery":"fa-battery","fa-battery-full":"fa-battery-full","fa-battery-3":"fa-battery-3","fa-battery-three-quarters":"fa-battery-three-quarters","fa-battery-2":"fa-battery-2","fa-battery-half":"fa-battery-half","fa-battery-1":"fa-battery-1","fa-battery-quarter":"fa-battery-quarter","fa-battery-0":"fa-battery-0","fa-battery-empty":"fa-battery-empty","fa-mouse-pointer":"fa-mouse-pointer","fa-i-cursor":"fa-i-cursor","fa-object-group":"fa-object-group","fa-object-ungroup":"fa-object-ungroup","fa-sticky-note":"fa-sticky-note","fa-sticky-note-o":"fa-sticky-note-o","fa-cc-jcb":"fa-cc-jcb","fa-cc-diners-club":"fa-cc-diners-club","fa-clone":"fa-clone","fa-balance-scale":"fa-balance-scale","fa-hourglass-o":"fa-hourglass-o","fa-hourglass-1":"fa-hourglass-1","fa-hourglass-start":"fa-hourglass-start","fa-hourglass-2":"fa-hourglass-2","fa-hourglass-half":"fa-hourglass-half","fa-hourglass-3":"fa-hourglass-3","fa-hourglass-end":"fa-hourglass-end","fa-hourglass":"fa-hourglass","fa-hand-grab-o":"fa-hand-grab-o","fa-hand-rock-o":"fa-hand-rock-o","fa-hand-stop-o":"fa-hand-stop-o","fa-hand-paper-o":"fa-hand-paper-o","fa-hand-scissors-o":"fa-hand-scissors-o","fa-hand-lizard-o":"fa-hand-lizard-o","fa-hand-spock-o":"fa-hand-spock-o","fa-hand-pointer-o":"fa-hand-pointer-o","fa-hand-peace-o":"fa-hand-peace-o","fa-trademark":"fa-trademark","fa-registered":"fa-registered","fa-creative-commons":"fa-creative-commons","fa-gg":"fa-gg","fa-gg-circle":"fa-gg-circle","fa-tripadvisor":"fa-tripadvisor","fa-odnoklassniki":"fa-odnoklassniki","fa-odnoklassniki-square":"fa-odnoklassniki-square","fa-get-pocket":"fa-get-pocket","fa-wikipedia-w":"fa-wikipedia-w","fa-safari":"fa-safari","fa-chrome":"fa-chrome","fa-firefox":"fa-firefox","fa-opera":"fa-opera","fa-internet-explorer":"fa-internet-explorer","fa-tv":"fa-tv","fa-television":"fa-television","fa-contao":"fa-contao","fa-500px":"fa-500px","fa-amazon":"fa-amazon","fa-calendar-plus-o":"fa-calendar-plus-o","fa-calendar-minus-o":"fa-calendar-minus-o","fa-calendar-times-o":"fa-calendar-times-o","fa-calendar-check-o":"fa-calendar-check-o","fa-industry":"fa-industry","fa-map-pin":"fa-map-pin","fa-map-signs":"fa-map-signs","fa-map-o":"fa-map-o","fa-map":"fa-map","fa-commenting":"fa-commenting","fa-commenting-o":"fa-commenting-o","fa-houzz":"fa-houzz","fa-vimeo":"fa-vimeo","fa-black-tie":"fa-black-tie","fa-fonticons":"fa-fonticons","fa-reddit-alien":"fa-reddit-alien","fa-edge":"fa-edge","fa-credit-card-alt":"fa-credit-card-alt","fa-codiepie":"fa-codiepie","fa-modx":"fa-modx","fa-fort-awesome":"fa-fort-awesome","fa-usb":"fa-usb","fa-product-hunt":"fa-product-hunt","fa-mixcloud":"fa-mixcloud","fa-scribd":"fa-scribd","fa-pause-circle":"fa-pause-circle","fa-pause-circle-o":"fa-pause-circle-o","fa-stop-circle":"fa-stop-circle","fa-stop-circle-o":"fa-stop-circle-o","fa-shopping-bag":"fa-shopping-bag","fa-shopping-basket":"fa-shopping-basket","fa-hashtag":"fa-hashtag","fa-bluetooth":"fa-bluetooth","fa-bluetooth-b":"fa-bluetooth-b","fa-percent":"fa-percent","fa-gitlab":"fa-gitlab","fa-wpbeginner":"fa-wpbeginner","fa-wpforms":"fa-wpforms","fa-envira":"fa-envira","fa-universal-access":"fa-universal-access","fa-wheelchair-alt":"fa-wheelchair-alt","fa-question-circle-o":"fa-question-circle-o","fa-blind":"fa-blind","fa-audio-description":"fa-audio-description","fa-volume-control-phone":"fa-volume-control-phone","fa-braille":"fa-braille","fa-assistive-listening-systems":"fa-assistive-listening-systems","fa-asl-interpreting":"fa-asl-interpreting","fa-american-sign-language-interpreting":"fa-american-sign-language-interpreting","fa-deafness":"fa-deafness","fa-hard-of-hearing":"fa-hard-of-hearing","fa-deaf":"fa-deaf","fa-glide":"fa-glide","fa-glide-g":"fa-glide-g","fa-signing":"fa-signing","fa-sign-language":"fa-sign-language","fa-low-vision":"fa-low-vision","fa-viadeo":"fa-viadeo","fa-viadeo-square":"fa-viadeo-square","fa-snapchat":"fa-snapchat","fa-snapchat-ghost":"fa-snapchat-ghost","fa-snapchat-square":"fa-snapchat-square","fa-pied-piper":"fa-pied-piper","fa-first-order":"fa-first-order","fa-yoast":"fa-yoast","fa-themeisle":"fa-themeisle","fa-google-plus-circle":"fa-google-plus-circle","fa-google-plus-official":"fa-google-plus-official","fa-fa":"fa-fa","fa-font-awesome":"fa-font-awesome","fa-handshake-o":"fa-handshake-o","fa-envelope-open":"fa-envelope-open","fa-envelope-open-o":"fa-envelope-open-o","fa-linode":"fa-linode","fa-address-book":"fa-address-book","fa-address-book-o":"fa-address-book-o","fa-vcard":"fa-vcard","fa-address-card":"fa-address-card","fa-vcard-o":"fa-vcard-o","fa-address-card-o":"fa-address-card-o","fa-user-circle":"fa-user-circle","fa-user-circle-o":"fa-user-circle-o","fa-user-o":"fa-user-o","fa-id-badge":"fa-id-badge","fa-drivers-license":"fa-drivers-license","fa-id-card":"fa-id-card","fa-drivers-license-o":"fa-drivers-license-o","fa-id-card-o":"fa-id-card-o","fa-quora":"fa-quora","fa-free-code-camp":"fa-free-code-camp","fa-telegram":"fa-telegram","fa-thermometer-4":"fa-thermometer-4","fa-thermometer":"fa-thermometer","fa-thermometer-full":"fa-thermometer-full","fa-thermometer-3":"fa-thermometer-3","fa-thermometer-three-quarters":"fa-thermometer-three-quarters","fa-thermometer-2":"fa-thermometer-2","fa-thermometer-half":"fa-thermometer-half","fa-thermometer-1":"fa-thermometer-1","fa-thermometer-quarter":"fa-thermometer-quarter","fa-thermometer-0":"fa-thermometer-0","fa-thermometer-empty":"fa-thermometer-empty","fa-shower":"fa-shower","fa-bathtub":"fa-bathtub","fa-s15":"fa-s15","fa-bath":"fa-bath","fa-podcast":"fa-podcast","fa-window-maximize":"fa-window-maximize","fa-window-minimize":"fa-window-minimize","fa-window-restore":"fa-window-restore","fa-times-rectangle":"fa-times-rectangle","fa-window-close":"fa-window-close","fa-times-rectangle-o":"fa-times-rectangle-o","fa-window-close-o":"fa-window-close-o","fa-bandcamp":"fa-bandcamp","fa-grav":"fa-grav","fa-etsy":"fa-etsy","fa-imdb":"fa-imdb","fa-ravelry":"fa-ravelry","fa-eercast":"fa-eercast","fa-microchip":"fa-microchip","fa-snowflake-o":"fa-snowflake-o","fa-superpowers":"fa-superpowers","fa-wpexplorer":"fa-wpexplorer","fa-meetup":"fa-meetup",topnav:"topnav",topsearch:"topsearch","item-grid":"item-grid","item-grid-item":"item-grid-item","main-image":"main-image","item-image-container":"item-image-container",drawingModeBtn:"drawingModeBtn","form-drawing":"form-drawing","form-drawing-wrapper":"form-drawing-wrapper",selected:"selected",showPointer:"showPointer","zoom-action-list":"zoom-action-list","zoomTarget-wrapper":"zoomTarget-wrapper",zoomTarget:"zoomTarget","cut-canvas":"cut-canvas","no-padding":"no-padding","annotation-content":"annotation-content",highlight:"highlight","revision-proposal":"revision-proposal","collection-home-btn":"collection-home-btn","img-stats-dt":"img-stats-dt","img-stats-dd":"img-stats-dd","revision-link":"revision-link","item-image-thumbnail":"item-image-thumbnail","annotation-comments":"annotation-comments","comment-reply-link":"comment-reply-link","comment-subtext":"comment-subtext","comment-metacategories":"comment-metacategories","comment-separator":"comment-separator","pagination-shortcut":"pagination-shortcut","badge-error":"badge-error","badge-warning":"badge-warning","badge-success":"badge-success","badge-info":"badge-info","badge-inverse":"badge-inverse","notif-badge":"notif-badge","show-all-notifications":"show-all-notifications","annotation-panel":"annotation-panel","annotation-detail":"annotation-detail","stats-annotation-userpage":"stats-annotation-userpage","image-detail":"image-detail","large-image-detail":"large-image-detail","no-user-annotation":"no-user-annotation","dt-annotation":"dt-annotation","userpage-annotation-btn":"userpage-annotation-btn","collection-title":"collection-title","collection-summary":"collection-summary","collection-container":"collection-container","tab-selector":"tab-selector","image-list-wrapper":"image-list-wrapper","image-list-li":"image-list-li","image-list-image-container":"image-list-image-container","object-info":"object-info","collection-home-item-btn":"collection-home-item-btn","collection-home-tab":"collection-home-tab","diff-viewer-wrapper":"diff-viewer-wrapper","diff-panel":"diff-panel","close-btn":"close-btn","partners-icons":"partners-icons","footer-link":"footer-link","footer-info":"footer-info","legals-dl":"legals-dl","show-complete-link":"show-complete-link","hide-complete-link":"hide-complete-link","description-col":"description-col","annotation-navigator":"annotation-navigator","annotation-navigator-list":"annotation-navigator-list","list-group-item-footer":"list-group-item-footer","annotation-navigator-canvas":"annotation-navigator-canvas","annotation-navigator-panel":"annotation-navigator-panel"}},function(t,e,n){"use strict";var r=n(38),i=new RegExp(r().source);t.exports=i.test.bind(i)},function(t,e,n){function r(t){return n(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./diff_match_patch_uncompressed":27,"./diff_match_patch_uncompressed.js":27};r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=176},function(t,e,n){function r(t){return n(i(t))}function i(t){return o[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var o={"./annotated":13,"./annotated.js":13,"./base":4,"./base.js":4,"./console":19,"./console.js":19,"./html":14,"./html.js":14,"./index":15,"./index.js":15,"./jsonpatch":16,"./jsonpatch.js":16};r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=177},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function o(t){if(u===clearTimeout)return clearTimeout(t);if((u===r||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(t);try{return u(t)}catch(e){try{return u.call(null,t)}catch(e){return u.call(this,t)}}}function a(){g&&p&&(g=!1,p.length?d=p.concat(d):v=-1,d.length&&s())}function s(){if(!g){var t=i(a);g=!0;for(var e=d.length;e;){for(p=d,d=[];++v<e;)p&&p[v].run();v=-1,e=d.length}p=null,g=!1,o(t)}}function l(t,e){this.fun=t,this.array=e}function c(){}var f,u,h=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(t){f=n}try{u="function"==typeof clearTimeout?clearTimeout:r}catch(t){u=r}}();var p,d=[],g=!1,v=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new l(t,e)),1!==d.length||g||i(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(38)();t.exports=function(t){return"string"==typeof t?t.replace(r,""):t}},function(t,e,n){(function(e){"use strict";t.exports=function(){return e.argv.indexOf("--no-color")===-1&&(e.argv.indexOf("--color")!==-1||!(e.stdout&&!e.stdout.isTTY)&&("win32"===e.platform||("COLORTERM"in{NODE_ENV:"production"}||"dumb"!=={NODE_ENV:"production"}.TERM&&!!/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test({NODE_ENV:"production"}.TERM))))}()}).call(e,n(178))},function(t,e,n){var r,i;r=n(60),i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),t.exports=r},function(t,e,n){var r,i;r=n(61),i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),t.exports=r},function(t,e,n){var r,i;n(223),r=n(63);var o=n(207);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-51ceff58",t.exports=r},function(t,e,n){var r,i;n(221),r=n(64);var o=n(205);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-45428799",t.exports=r},function(t,e,n){var r,i;n(224),r=n(65);var o=n(208);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-52ae02ee",t.exports=r},function(t,e,n){var r,i;n(217),r=n(66);var o=n(200);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-21ad04a8",t.exports=r},function(t,e,n){var r,i;n(226),r=n(67);var o=n(211);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-a8fd4508",t.exports=r},function(t,e,n){var r,i;n(222),r=n(68);var o=n(206);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-506fb618",t.exports=r},function(t,e,n){var r,i;n(213),r=n(69);var o=n(196);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},function(t,e,n){var r,i;n(219),r=n(70);var o=n(202);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-2cdf3ca8",t.exports=r},function(t,e,n){var r,i;r=n(71),i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),t.exports=r},function(t,e,n){var r,i;r=n(72);var o=n(195);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},function(t,e,n){var r,i;n(220),r=n(75);var o=n(203);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-2ceb798e",t.exports=r},function(t,e,n){var r,i;r=n(77);var o=n(210);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.display,expression:"display"}],staticClass:"modal-mask diff-panel"},[n("p",{staticClass:"pull-right close-btn",on:{click:t.close}},[n("i",{staticClass:"fa fa-close"})]),t._v(" "),t._t("header"),t._v(" "),t._t("content"),t._v(" "),t._t("footer")],2)},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",[n("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"},on:{click:t.close}},[n("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])]),t._v(" "),n("div",{staticClass:"form-group",class:t.titleFormGroup,staticStyle:{clear:"both"}},[n("label",{staticClass:"control-label"},[t._v("Titre")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.title,expression:"title"}],staticClass:"form-control input-sm",attrs:{name:"title",type:"text",placeholder:"Donnez un titre court"},domProps:{value:t._s(t.title)},on:{input:function(e){e.target.composing||(t.title=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"control-label"},[t._v("Description")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.description,expression:"description"}],staticClass:"form-control input-sm",attrs:{name:"description",placeholder:"Décrivez ce que vous voyez"},domProps:{value:t._s(t.description)},on:{input:function(e){e.target.composing||(t.description=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"control-label"},[t._v("Mots-clé")]),t._v(" "),n("tag-list",{ref:"taglist",attrs:{"original-tags":t.originalTags}})],1),t._v(" "),n("button",{staticClass:"btn btn-block btn-sm btn-primary",on:{click:t.save}},[t._v("Valider")])])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("taglist",{ref:"taglist"}),t._v(" "),n("input",{directives:[{name:"show",rawName:"v-show",value:!t.readOnly,expression:"!readOnly"},{name:"model",rawName:"v-model",value:t.query,expression:"query"}],staticClass:"form-control",attrs:{type:"text",placeholder:t.placeholder,
+autocomplete:"off"},domProps:{value:t._s(t.query)},on:{keyup:[function(e){8===e.keyCode&&t.checkQuery(e)},t.update],keydown:[function(e){t._k(e.keyCode,"down",40)||t.down(e)},function(e){t._k(e.keyCode,"up",38)||t.up(e)},function(e){t._k(e.keyCode,"enter",13)||t.hit(e)},function(e){t._k(e.keyCode,"esc",27)||t.reset(e)}],input:function(e){e.target.composing||(t.query=e.target.value)}}}),t._v(" "),n("a",{directives:[{name:"show",rawName:"v-show",value:t.showAddButton,expression:"showAddButton"}],on:{click:t.addTag}},[n("i",{staticClass:"fa fa-plus"}),t._v(" Créer ce tag")]),t._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:t.hasItems||!t.readOnly,expression:"hasItems || !readOnly"}]},t._l(t.items,function(e,r){return n("li",{class:t.activeClass(r),on:{mousedown:t.hit,mousemove:function(e){t.setActive(r)}}},[n("span",{domProps:{textContent:t._s(e.tag_label)}})])})),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.selectedTags,expression:"selectedTags"}],attrs:{name:"tags",type:"hidden"},domProps:{value:t._s(t.selectedTags)},on:{input:function(e){e.target.composing||(t.selectedTags=e.target.value)}}})],1)},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],staticClass:"form-control input-sm",attrs:{type:"text",disabled:t.readonly,placeholder:t.placeholder,autocomplete:"off"},domProps:{value:t._s(t.query)},on:{keydown:[function(e){t._k(e.keyCode,"down",40)||t.down(e)},function(e){t._k(e.keyCode,"up",38)||t.up(e)},function(e){t._k(e.keyCode,"enter",13)||t.hit(e)},function(e){t._k(e.keyCode,"esc",27)||t.reset(e)}],blur:t.reset,input:[function(e){e.target.composing||(t.query=e.target.value)},t.update]}}),t._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:t.hasItems,expression:"hasItems"}]},t._l(t.items,function(e,r){return n("li",{class:t.activeClass(r),on:{mousedown:t.hit,mousemove:function(e){t.setActive(r)}}},[n("span",{domProps:{textContent:t._s(e.tag_label)}})])}))])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"btn-group",attrs:{"data-toggle":"buttons"}},t._l(5,function(e){return n("label",{ref:"buttons",refInFor:!0,staticClass:"btn btn-default",class:{"btn--highlight":t.value&&e<=t.value},attrs:{"data-value":e},on:{mouseenter:t.onMouseEnter,mouseleave:t.onMouseLeave,click:t.onClick}},[n("input",{attrs:{type:"radio",name:"options",autocomplete:"off"}}),t._v(" "),n("span",{staticClass:"sr-only"},[t._v(t._s(e))])])}))])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.annotation,expression:"annotation"}]},[n("label",{staticClass:"small text-muted"},[t._v("Commentaires")]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:0===t.comments.length,expression:"comments.length === 0"}],staticClass:"alert alert-info"},[t._v("Pas de commentaire pour le moment.")]),t._v(" "),t._l(t.comments,function(t){return n("comment",{attrs:{comment:t.comment,username:t.user_name,date:t.submit_date}})})],2)},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:0===t.tags.length,expression:"tags.length === 0"}],staticClass:"alert alert-info"},[t._v("Pas de mots-clé pour le moment")]),t._v(" "),n("div",{staticClass:"tag-list"},t._l(t.tags,function(e,r){return n("tag-list-item",{directives:[{name:"show",rawName:"v-show",value:t.tags.length>0,expression:"tags.length > 0"}],ref:"items",refInFor:!0,staticClass:"tag-list-item",attrs:{label:e.tag_label,index:r,accuracy:e.accuracy,relevancy:e.relevancy,readonly:t.readonly}})})),t._v(" "),n("typeahead",{directives:[{name:"show",rawName:"v-show",value:!t.readonly,expression:"!readonly"}],ref:"typeahead",attrs:{placeholder:"Rechercher un mot-clé"}})],1)},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("svg",{ref:"svg",attrs:{width:t.thumbnailWidth,height:t.thumbnailHeight}},[n("image",{attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0",width:t.thumbnailWidth,height:t.thumbnailHeight,"xlink:href":t.image}}),t._v(" "),n("rect",{ref:"handler",staticClass:"move-handler",staticStyle:{fill:"black",opacity:"0.4"},attrs:{x:t.x,y:t.y,width:t.width,height:t.height}})])])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"tag-container"},[n("div",{staticClass:"tag-item",on:{click:t.toggle}},[n("span",{staticClass:"tag-title"},[t._v(t._s(t.label))]),t._v(" "),n("div",{staticClass:"tag-item-buttons"},[n("div",{staticClass:"tag-item-btn tag-item-accuracy",attrs:{"data-value":t.accuracy}},[n("button",{staticClass:"btn btn-default",attrs:{title:t.accuracyTitle}},[t._v(t._s(t.accuracy||"?"))]),t._v(" "),0===t.index?n("i",{staticClass:"fa fa-exclamation-triangle text-muted",attrs:{"aria-hidden":"true",title:"Fiabilité"}}):t._e()]),t._v(" "),n("div",{staticClass:"tag-item-btn tag-item-relevancy",attrs:{"data-value":t.relevancy}},[n("button",{staticClass:"btn btn-default",attrs:{title:t.relevancyTitle}},[t._v(t._s(t.relevancy||"?"))]),t._v(" "),0===t.index?n("i",{staticClass:"fa fa-crosshairs text-muted",attrs:{"aria-hidden":"true",title:"Pertinence"}}):t._e()]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.readonly,expression:"!readonly"}],staticClass:"tag-item-btn tag-item-delete"},[n("button",{staticClass:"btn btn-default",on:{click:t.remove}},[n("i",{staticClass:"fa fa-times",attrs:{"aria-hidden":"true"}})])])])]),t._v(" "),n("div",{staticClass:"collapse"},[n("div",{staticClass:"tag-item-form"},[n("div",[n("label",{staticClass:"small"},[t._v("Fiabilité")]),t._v(" "),n("small",[t._v("Êtes-vous sûr de votre mot-clé ?")]),t._v(" "),n("color-buttons",{ref:"accuracy",attrs:{"original-value":t.accuracy},on:{change:function(e){t.onChange("accuracy",e.value)}}})],1),t._v(" "),n("div",[n("label",{staticClass:"small"},[t._v("Pertinence")]),t._v(" "),n("small",[t._v("Votre mot-clé est-il indispensable à la compréhension ?")]),t._v(" "),n("color-buttons",{ref:"relevancy",attrs:{"original-value":t.relevancy},on:{change:function(e){t.onChange("relevancy",e.value)}}})],1)])])])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"zoomview-wrapper"},[t._m(0),t._v(" "),n("svg",{ref:"root-svg"},[n("image",{attrs:{id:"small-image",x:"0",y:"0","xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":t.imageUrl,width:t.imageWidth,height:t.imageHeight}}),t._v(" "),n("rect",{directives:[{name:"show",rawName:"v-show",value:t.showHandler,expression:"showHandler"}],ref:"handler",staticStyle:{fill:"black",opacity:"0.4"},attrs:{id:"zoom-handler",x:"0",y:"0"}})]),t._v(" "),n("ul",{staticClass:"form-drawing-wrapper zoom-action-list list-inline"},[n("li",{staticClass:"small showPointer",on:{click:t.incraseDrawingZoom}},[n("i",{staticClass:"fa fa-search-plus"})]),t._v(" "),n("li",{staticClass:"small showPointer",on:{click:t.resetDrawingZoom}},[n("i",{staticClass:"fa fa-square"})]),t._v(" "),n("li",{staticClass:"small showPointer",on:{click:t.decreaseDrawingZoom}},[n("i",{staticClass:"fa fa-search-minus"})])])])},staticRenderFns:[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",{staticClass:"form-drawing pullright"},[n("strong",[t._v("Zoom")])])}]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"zoom"},[n("div",[n("svg",{ref:"svg",staticClass:"cut-canvas",class:t.canvasClass,attrs:{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[t.loaded?n("image",{ref:"image",attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":t.image,x:"0",y:"0",width:t.imageWidth,height:t.imageHeight}}):t._e(),t._v(" "),n("shape-rect",{directives:[{name:"show",rawName:"v-show",value:t.loaded&&"rect"==t.mode,expression:"loaded && mode == 'rect'"}],ref:"rect",attrs:{paper:t.paper,"original-annotation":t.annotation,readonly:t.readonly}}),t._v(" "),n("shape-free",{directives:[{name:"show",rawName:"v-show",value:t.loaded&&"free"==t.mode,expression:"loaded && mode == 'free'"}],ref:"free",attrs:{paper:t.paper,"original-annotation":t.annotation,readonly:t.readonly}})],1)]),t._v(" "),n("div",{staticClass:"zoomer"}),t._v(" "),n("div",{staticClass:"controls"},[n("div",{staticClass:"controls-left"},[n("button",{staticClass:"btn",class:{active:"rect"===t.mode,disabled:t.readonly},attrs:{type:"button"},on:{click:function(e){t.setMode("rect")}}},[n("svg",{attrs:{width:"14",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 512 512","enable-background":"new 0 0 512 512","xml:space":"preserve"}},[n("g",[n("rect",{attrs:{x:"352",y:"432",width:"64",height:"48"}}),n("polygon",{attrs:{points:"416,352 416,96 176,96 176,160 352,160 352,352 160,352 160,32 96,32 96,96 32,96 32,160 96,160 96,416 480,416 480,352"}})]),n("text",{attrs:{x:"0",y:"527",fill:"#000000","font-size":"5px","font-weight":"bold","font-family":"'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif"}},[t._v("Created by Bluetip Design")]),n("text",{attrs:{x:"0",y:"532",fill:"#000000","font-size":"5px","font-weight":"bold","font-family":"'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif"}},[t._v("from the Noun Project")])])]),t._v(" "),n("button",{staticClass:"btn",class:{active:"free"===t.mode,disabled:t.readonly},attrs:{type:"button"},on:{click:function(e){t.setMode("free")}}},[n("svg",{attrs:{width:"14",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 30 30","xml:space":"preserve"}},[n("g",{attrs:{transform:"translate(-450 -380)"}},[n("g",{attrs:{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[n("path",{attrs:{d:"M453,395c0,2.209,1.79,4,4,4c1.307,0,2.455-0.635,3.186-1.604l7.121,4.069C467.11,401.938,467,402.456,467,403 c0,2.209,1.79,4,4,4c2.209,0,4-1.791,4-4s-1.791-4-4-4c-1.307,0-2.455,0.635-3.186,1.604l-7.121-4.069 c0.196-0.473,0.307-0.99,0.307-1.534s-0.11-1.062-0.307-1.534l7.121-4.069c0.73,0.969,1.879,1.604,3.186,1.604 c2.209,0,4-1.791,4-4s-1.791-4-4-4c-2.21,0-4,1.791-4,4c0,0.544,0.11,1.062,0.307,1.534l-7.121,4.069 c-0.73-0.969-1.879-1.604-3.186-1.604C454.79,391,453,392.791,453,395z M471,400c1.654,0,3,1.346,3,3s-1.346,3-3,3s-3-1.346-3-3 S469.346,400,471,400z M471,384c1.654,0,3,1.346,3,3s-1.346,3-3,3s-3-1.346-3-3S469.346,384,471,384z M460,395 c0,1.654-1.346,3-3,3s-3-1.346-3-3s1.346-3,3-3S460,393.346,460,395z"}})])]),n("text",{attrs:{x:"0",y:"45",fill:"#000000","font-size":"5px","font-weight":"bold","font-family":"'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif"}},[t._v("Created by Hea Poh Lin")]),n("text",{attrs:{x:"0",y:"50",fill:"#000000","font-size":"5px","font-weight":"bold","font-family":"'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif"}},[t._v("from the Noun Project")])])])]),t._v(" "),n("zoom-thumbnail",{ref:"thumbnail",staticClass:"controls-center",attrs:{image:t.thumbnail,viewport:t.viewport,viewBox:t.viewBox,imageWidth:t.imageWidth,imageHeight:t.imageHeight},on:{change:function(e){t.changeViewBox(e)},dragstart:t.hideTooltip,dragend:t.showTooltip}}),t._v(" "),n("div",{staticClass:"controls-right"},[n("button",{staticClass:"btn",class:{disabled:1===t.scale},attrs:{type:"button"},on:{click:t.zoomOut}},[n("i",{staticClass:"fa fa-minus",attrs:{"aria-hidden":"true"}})]),t._v(" "),n("button",{staticClass:"btn",class:{disabled:t.scale>=1.9},attrs:{type:"button"},on:{click:t.zoomIn}},[n("i",{staticClass:"fa fa-plus",attrs:{"aria-hidden":"true"}})])])],1)])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("g",{ref:"g",attrs:{transform:t.transform}},[n("rect",{ref:"shape",staticClass:"shape",class:{"shape--draggable":!t.readonly},attrs:{x:"0",y:"0",width:t.width,height:t.height,"stroke-width":t.handlerSize/5,"stroke-dasharray":t.handlerSize/5+","+t.handlerSize/5}}),t._v(" "),n("rect",{directives:[{name:"show",rawName:"v-show",value:t.showResizeHandlers,expression:"showResizeHandlers"}],ref:"topLeft",staticClass:"handler-rect handler-top-left",attrs:{x:t.handlerSize/2*-1,y:t.handlerSize/2*-1,width:t.handlerSize,height:t.handlerSize,fill:"#ffffff",stroke:"#000000","stroke-width":t.handlerSize/5}}),t._v(" "),n("rect",{directives:[{name:"show",rawName:"v-show",value:t.showResizeHandlers,expression:"showResizeHandlers"}],ref:"bottomRight",staticClass:"handler-rect handler-bottom-right",attrs:{x:t.width-t.handlerSize/2,y:t.height-t.handlerSize/2,width:t.handlerSize,height:t.handlerSize,fill:"#ffffff",stroke:"#000000","stroke-width":t.handlerSize/5}})])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.annotation?n("button",{staticClass:"btn btn-xs pull-right",class:{"btn-primary":t.readonly,"btn-warning":!t.readonly},on:{click:function(e){t.readonly=!t.readonly}}},[t.readonly?n("i",{staticClass:"fa fa-edit"}):t._e(),t._v(" "),t.readonly?n("span",[t._v("Modifier")]):t._e(),t._v(" "),t.readonly?t._e():n("i",{staticClass:"fa fa-ban"}),t._v(" "),t.readonly?t._e():n("span",[t._v("Annuler")])]):t._e(),t._v(" "),t.annotation?t._e():n("div",{staticClass:"alert alert-warning text-center"},[t._v("\n Aucune annotation sélectionnée.\n ")]),t._v(" "),n("form",{attrs:{action:t.formAction,method:"post"}},[t._t("default"),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.fragment,expression:"fragment"}],attrs:{type:"hidden",name:"fragment"},domProps:{value:t._s(t.fragment)},on:{input:function(e){e.target.composing||(t.fragment=e.target.value)}}}),t._v(" "),t.annotation?n("div",{staticClass:"form-group form-group-sm"},[n("label",{staticClass:"small text-muted"},[t._v("Titre")]),t._v(" "),t.readonly?t._e():n("input",{directives:[{name:"model",rawName:"v-model",value:t.title,expression:"title"}],staticClass:"form-control",attrs:{type:"text",name:"title"},domProps:{value:t._s(t.title)},on:{input:function(e){e.target.composing||(t.title=e.target.value)}}}),t._v(" "),t.readonly?n("p",{class:{"text-muted":!t.title}},[t._v(t._s(t.title||"Pas de titre"))]):t._e()]):t._e(),t._v(" "),t.annotation?n("div",{staticClass:"form-group form-group-sm"},[n("label",{staticClass:"small text-muted"},[t._v("Description")]),t._v(" "),t.readonly?t._e():n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.description,expression:"description"}],staticClass:"form-control",attrs:{name:"description",placeholder:"Décrivez ce que vous voyez"},domProps:{value:t._s(t.description)},on:{input:function(e){e.target.composing||(t.description=e.target.value)}}}),t._v(" "),t.readonly?n("p",{class:{"text-muted":!t.description}},[t._v(t._s(t.description||"Pas de description"))]):t._e()]):t._e(),t._v(" "),t.annotation?n("div",{staticClass:"form-group form-group-sm"},[n("label",{staticClass:"small text-muted"},[t._v("Mots-clé")]),t._v(" "),n("tag-list",{ref:"taglist",attrs:{"original-tags":t.annotation.tags,readonly:t.readonly},on:{change:function(e){t.onTagsChange(e.tags)}}}),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.serializedTags,expression:"serializedTags"}],attrs:{type:"hidden",name:"tags"},domProps:{value:t._s(t.serializedTags)},on:{input:function(e){e.target.composing||(t.serializedTags=e.target.value)}}})],1):t._e(),t._v(" "),t.annotation&&!t.readonly?n("button",{staticClass:"btn btn-block btn-sm btn-primary",class:{disabled:!t.hasChanged},attrs:{type:"submit"}},[t._v("Enregistrer une nouvelle version")]):t._e()],2)])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"comment"},[t._v("\n "+t._s(t.comment)+"\n "),n("div",{staticClass:"comment-footer"},[n("span",{staticClass:"comment-author"},[t._v(t._s(t.username))]),t._v(" "),n("span",{staticClass:"comment-date"},[t._v(t._s(t.dateFormatted))])])])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"diff-viewer-wrapper col-md-12"},[n("modalpanel",{ref:"panel"},[n("h5",{slot:"header"},[t._v("Comparer les deux versions:")]),t._v(" "),n("div",{slot:"content"},[n("div",{ref:"modalcontent"},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.fragmentMode,expression:"fragmentMode"}]},[n("svg",[n("image",{attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink",href:t.imagePath,x:"0",y:"0",width:t.imageWidth,height:t.imageHeight}}),t._v(" "),n("g",{attrs:{transform:t.matrixTransform}},[n("path",{attrs:{d:t.originalPath,fill:"red",stroke:"blue",opacity:"0.3"}}),t._v(" "),n("path",{attrs:{d:t.modifiedPath,fill:"blue",stroke:"red",opacity:"0.3"}})])])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.textMode,expression:"textMode"}]},[n("div",{domProps:{innerHTML:t._s(t.diffText)}})]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.tagMode,expression:"tagMode"}]},[n("ul",t._l(t.tags,function(e,r){return n("li",[e.action?t._e():[n("li",[n("span",[t._v(t._s(e.tag_label))]),t._v(" | précision : "+t._s(e.accuracy)+" \n\t\t\t\t\t\t\t\t\t- \n\t\t\t\t\t\t\t\t\tpertinence : "+t._s(e.relevancy)+"\n\t\t\t\t\t\t\t\t")])],t._v(" "),"replace"==e.action?[n("del",[t._v("--")]),t._v(" "),n("del",[t._v(t._s(e.tag_label))]),t._v(" a été remplacé par\n\t\t\t\t\t\t\t\t"),n("ins",[t._v("++")]),t._v(" "),n("strong",[n("ins",[t._v(t._s(e.new_label))])]),t._v(" \n\t\t\t\t\t\t\t\tfiabilité : "),n("ins",[t._v(t._s(e.new_accuracy))]),t._v(" - \n\t\t\t\t\t\t\t\tpertinence: "),n("ins",[t._v(t._s(e.new_relevancy))])]:t._e(),t._v(" "),"add"==e.action?[n("li",[n("ins",[t._v("++")]),t._v(" "),n("ins",[t._v(t._s(e.tag_label))]),t._v("\n\t\t\t\t\t\t\t\t\tfiabilité : "),n("ins",[t._v(t._s(e.accuracy))]),t._v(" - \n\t\t\t\t\t\t\t\t\tpertinence : "),n("ins",[t._v(t._s(e.relevancy))])])]:t._e(),t._v(" "),"del"==e.action?[n("li",[n("del",[t._v("--")]),t._v(" "),n("del",[t._v(t._s(e.tag_label))]),t._v(" a été effacé")])]:t._e(),t._v(" "),"update"==e.action?[n("li",[n("strong",[t._v(t._s(e.tag_label))]),t._v(" "),e.accuracy!=e.new_accuracy?[t._v("\n\t\t\t\t\t\t\t\t\t\tfiabilité: "),n("del",[t._v(t._s(e.accuracy))]),t._v(" "),n("ins",[t._v(t._s(e.new_accuracy))]),t._v(" -\t\n\t\t\t\t\t\t\t\t\t")]:t._e(),t._v(" "),e.accuracy==e.new_accuracy?[t._v("\n\t\t\t\t\t\t\t\t\t\tfiabilité: "+t._s(e.accuracy)+" -\n\t\t\t\t\t\t\t\t\t")]:t._e(),t._v(" "),e.relevancy!=e.new_relevancy?[t._v("\n\t\t\t\t\t\t\t\t\t\tpertinence: "),n("del",[t._v(t._s(e.relevancy))]),t._v(" "),n("ins",[t._v(t._s(e.new_relevancy))])]:t._e(),t._v(" "),e.relevancy==e.new_relevancy?[t._v("\n\t\t\t\t\t\t\t\t\t\tpertinence: "+t._s(e.relevancy)+"\t\n\t\t\t\t\t\t\t\t\t")]:t._e()],2)]:t._e()],2)}))])])])])],1)},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("ul",{directives:[{name:"show",rawName:"v-show",value:!t.readOnly,expression:"!readOnly"}],staticClass:"tags-wrapper list-unstyled"},t._l(t.tags,function(e,r){return n("li",{ref:e.id,refInFor:!0,staticClass:"tag-item"},[n("i",{staticClass:"fa fa-tag"}),t._v(" "),n("strong",[n("span",{domProps:{textContent:t._s(e.tag_label)}})]),t._v("\n\n\t\t\tFiabilité: \t"),n("select",{on:{change:function(n){t.updateAccuracy(n,e)}}},t._l([1,2,3,4,5],function(r,i){return n("option",{domProps:{selected:e.accuracy==r,value:r}},[t._v(t._s(r))])})),t._v("\n\n\t\t\tPertinence: "),n("select",{on:{change:function(n){t.updatePertinence(n,e)}}},t._l([1,2,3,4,5],function(r,i){return n("option",{domProps:{selected:e.relevancy==r,value:r}},[t._v(t._s(r))])})),t._v(" "),n("a",{on:{click:function(n){t.removeTag(e)}}},[n("i",{staticClass:"fa fa-trash"})])])})),t._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:t.readOnly,expression:"readOnly"}],staticClass:"list-inline"},t._l(t.tags,function(e,r){return n("li",[n("i",{staticClass:"fa fa-tag"}),t._v(" "),n("span",{staticClass:"label label-info"},[t._v(t._s(e.tag_label))]),t._v("\n\t\t\t | fiabilité "),n("span",{staticClass:"badge"},[t._v(t._s(e.accuracy))]),t._v("\n\t\t\t | pertinence "),n("span",{staticClass:"badge"},[t._v(t._s(e.relevancy))])])}))])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("g",[n("path",{ref:"path",staticStyle:{opacity:"0.6"},attrs:{d:t.path,stroke:"#000000",fill:"#bdc3c7","stroke-width":t.handlerRadius/2,"stroke-dasharray":t.handlerRadius/3+","+t.handlerRadius/3}}),t._v(" "),t._l(t.points,function(e,r){return n("circle",{directives:[{name:"show",rawName:"v-show",value:!t.readonly,expression:"!readonly"}],key:r,ref:"handlers",refInFor:!0,class:{handler:!0,"handler--first":0===r&&!t.closed},attrs:{"data-key":r,cx:e.x,cy:e.y,r:t.handlerRadius,"stroke-width":t.handlerRadius/2}})})],2)},staticRenderFns:[]}},function(t,e){/*!
* vue-resource v0.9.3
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
-
- 'use strict';
-
- /**
- * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
- */
-
- var RESOLVED = 0;
- var REJECTED = 1;
- var PENDING = 2;
-
- function Promise$2(executor) {
-
- this.state = PENDING;
- this.value = undefined;
- this.deferred = [];
-
- var promise = this;
-
- try {
- executor(function (x) {
- promise.resolve(x);
- }, function (r) {
- promise.reject(r);
- });
- } catch (e) {
- promise.reject(e);
- }
- }
-
- Promise$2.reject = function (r) {
- return new Promise$2(function (resolve, reject) {
- reject(r);
- });
- };
-
- Promise$2.resolve = function (x) {
- return new Promise$2(function (resolve, reject) {
- resolve(x);
- });
- };
-
- Promise$2.all = function all(iterable) {
- return new Promise$2(function (resolve, reject) {
- var count = 0,
- result = [];
-
- if (iterable.length === 0) {
- resolve(result);
- }
-
- function resolver(i) {
- return function (x) {
- result[i] = x;
- count += 1;
-
- if (count === iterable.length) {
- resolve(result);
- }
- };
- }
-
- for (var i = 0; i < iterable.length; i += 1) {
- Promise$2.resolve(iterable[i]).then(resolver(i), reject);
- }
- });
- };
-
- Promise$2.race = function race(iterable) {
- return new Promise$2(function (resolve, reject) {
- for (var i = 0; i < iterable.length; i += 1) {
- Promise$2.resolve(iterable[i]).then(resolve, reject);
- }
- });
- };
-
- var p$1 = Promise$2.prototype;
-
- p$1.resolve = function resolve(x) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (x === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- var called = false;
-
- try {
- var then = x && x['then'];
-
- if (x !== null && typeof x === 'object' && typeof then === 'function') {
- then.call(x, function (x) {
- if (!called) {
- promise.resolve(x);
- }
- called = true;
- }, function (r) {
- if (!called) {
- promise.reject(r);
- }
- called = true;
- });
- return;
- }
- } catch (e) {
- if (!called) {
- promise.reject(e);
- }
- return;
- }
-
- promise.state = RESOLVED;
- promise.value = x;
- promise.notify();
- }
- };
-
- p$1.reject = function reject(reason) {
- var promise = this;
-
- if (promise.state === PENDING) {
- if (reason === promise) {
- throw new TypeError('Promise settled with itself.');
- }
-
- promise.state = REJECTED;
- promise.value = reason;
- promise.notify();
- }
- };
-
- p$1.notify = function notify() {
- var promise = this;
-
- nextTick(function () {
- if (promise.state !== PENDING) {
- while (promise.deferred.length) {
- var deferred = promise.deferred.shift(),
- onResolved = deferred[0],
- onRejected = deferred[1],
- resolve = deferred[2],
- reject = deferred[3];
-
- try {
- if (promise.state === RESOLVED) {
- if (typeof onResolved === 'function') {
- resolve(onResolved.call(undefined, promise.value));
- } else {
- resolve(promise.value);
- }
- } else if (promise.state === REJECTED) {
- if (typeof onRejected === 'function') {
- resolve(onRejected.call(undefined, promise.value));
- } else {
- reject(promise.value);
- }
- }
- } catch (e) {
- reject(e);
- }
- }
- }
- });
- };
-
- p$1.then = function then(onResolved, onRejected) {
- var promise = this;
-
- return new Promise$2(function (resolve, reject) {
- promise.deferred.push([onResolved, onRejected, resolve, reject]);
- promise.notify();
- });
- };
-
- p$1.catch = function (onRejected) {
- return this.then(undefined, onRejected);
- };
-
- var PromiseObj = window.Promise || Promise$2;
-
- function Promise$1(executor, context) {
-
- if (executor instanceof PromiseObj) {
- this.promise = executor;
- } else {
- this.promise = new PromiseObj(executor.bind(context));
- }
-
- this.context = context;
- }
-
- Promise$1.all = function (iterable, context) {
- return new Promise$1(PromiseObj.all(iterable), context);
- };
-
- Promise$1.resolve = function (value, context) {
- return new Promise$1(PromiseObj.resolve(value), context);
- };
-
- Promise$1.reject = function (reason, context) {
- return new Promise$1(PromiseObj.reject(reason), context);
- };
-
- Promise$1.race = function (iterable, context) {
- return new Promise$1(PromiseObj.race(iterable), context);
- };
-
- var p = Promise$1.prototype;
-
- p.bind = function (context) {
- this.context = context;
- return this;
- };
-
- p.then = function (fulfilled, rejected) {
-
- if (fulfilled && fulfilled.bind && this.context) {
- fulfilled = fulfilled.bind(this.context);
- }
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new Promise$1(this.promise.then(fulfilled, rejected), this.context);
- };
-
- p.catch = function (rejected) {
-
- if (rejected && rejected.bind && this.context) {
- rejected = rejected.bind(this.context);
- }
-
- return new Promise$1(this.promise.catch(rejected), this.context);
- };
-
- p.finally = function (callback) {
-
- return this.then(function (value) {
- callback.call(this);
- return value;
- }, function (reason) {
- callback.call(this);
- return PromiseObj.reject(reason);
- });
- };
-
- var debug = false;
- var util = {};
- var array = [];
- function Util (Vue) {
- util = Vue.util;
- debug = Vue.config.debug || !Vue.config.silent;
- }
-
- function warn(msg) {
- if (typeof console !== 'undefined' && debug) {
- console.warn('[VueResource warn]: ' + msg);
- }
- }
-
- function error(msg) {
- if (typeof console !== 'undefined') {
- console.error(msg);
- }
- }
-
- function nextTick(cb, ctx) {
- return util.nextTick(cb, ctx);
- }
-
- function trim(str) {
- return str.replace(/^\s*|\s*$/g, '');
- }
-
- var isArray = Array.isArray;
-
- function isString(val) {
- return typeof val === 'string';
- }
-
- function isBoolean(val) {
- return val === true || val === false;
- }
-
- function isFunction(val) {
- return typeof val === 'function';
- }
-
- function isObject(obj) {
- return obj !== null && typeof obj === 'object';
- }
-
- function isPlainObject(obj) {
- return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
- }
-
- function isFormData(obj) {
- return typeof FormData !== 'undefined' && obj instanceof FormData;
- }
-
- function when(value, fulfilled, rejected) {
-
- var promise = Promise$1.resolve(value);
-
- if (arguments.length < 2) {
- return promise;
- }
-
- return promise.then(fulfilled, rejected);
- }
-
- function options(fn, obj, opts) {
-
- opts = opts || {};
-
- if (isFunction(opts)) {
- opts = opts.call(obj);
- }
-
- return merge(fn.bind({ $vm: obj, $options: opts }), fn, { $options: opts });
- }
-
- function each(obj, iterator) {
-
- var i, key;
-
- if (typeof obj.length == 'number') {
- for (i = 0; i < obj.length; i++) {
- iterator.call(obj[i], obj[i], i);
- }
- } else if (isObject(obj)) {
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- iterator.call(obj[key], obj[key], key);
- }
- }
- }
-
- return obj;
- }
-
- var assign = Object.assign || _assign;
-
- function merge(target) {
-
- var args = array.slice.call(arguments, 1);
-
- args.forEach(function (source) {
- _merge(target, source, true);
- });
-
- return target;
- }
-
- function defaults(target) {
-
- var args = array.slice.call(arguments, 1);
-
- args.forEach(function (source) {
-
- for (var key in source) {
- if (target[key] === undefined) {
- target[key] = source[key];
- }
- }
- });
-
- return target;
- }
-
- function _assign(target) {
-
- var args = array.slice.call(arguments, 1);
-
- args.forEach(function (source) {
- _merge(target, source);
- });
-
- return target;
- }
-
- function _merge(target, source, deep) {
- for (var key in source) {
- if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
- if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
- target[key] = {};
- }
- if (isArray(source[key]) && !isArray(target[key])) {
- target[key] = [];
- }
- _merge(target[key], source[key], deep);
- } else if (source[key] !== undefined) {
- target[key] = source[key];
- }
- }
- }
-
- function root (options, next) {
-
- var url = next(options);
-
- if (isString(options.root) && !url.match(/^(https?:)?\//)) {
- url = options.root + '/' + url;
- }
-
- return url;
- }
-
- function query (options, next) {
-
- var urlParams = Object.keys(Url.options.params),
- query = {},
- url = next(options);
-
- each(options.params, function (value, key) {
- if (urlParams.indexOf(key) === -1) {
- query[key] = value;
- }
- });
-
- query = Url.params(query);
-
- if (query) {
- url += (url.indexOf('?') == -1 ? '?' : '&') + query;
- }
-
- return url;
- }
-
- /**
- * URL Template v2.0.6 (https://github.com/bramstein/url-template)
- */
-
- function expand(url, params, variables) {
-
- var tmpl = parse(url),
- expanded = tmpl.expand(params);
-
- if (variables) {
- variables.push.apply(variables, tmpl.vars);
- }
-
- return expanded;
- }
-
- function parse(template) {
-
- var operators = ['+', '#', '.', '/', ';', '?', '&'],
- variables = [];
-
- return {
- vars: variables,
- expand: function (context) {
- return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
- if (expression) {
-
- var operator = null,
- values = [];
-
- if (operators.indexOf(expression.charAt(0)) !== -1) {
- operator = expression.charAt(0);
- expression = expression.substr(1);
- }
-
- expression.split(/,/g).forEach(function (variable) {
- var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
- values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
- variables.push(tmp[1]);
- });
-
- if (operator && operator !== '+') {
-
- var separator = ',';
-
- if (operator === '?') {
- separator = '&';
- } else if (operator !== '#') {
- separator = operator;
- }
-
- return (values.length !== 0 ? operator : '') + values.join(separator);
- } else {
- return values.join(',');
- }
- } else {
- return encodeReserved(literal);
- }
- });
- }
- };
- }
-
- function getValues(context, operator, key, modifier) {
-
- var value = context[key],
- result = [];
-
- if (isDefined(value) && value !== '') {
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
- value = value.toString();
-
- if (modifier && modifier !== '*') {
- value = value.substring(0, parseInt(modifier, 10));
- }
-
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- } else {
- if (modifier === '*') {
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function (value) {
- result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
- });
- } else {
- Object.keys(value).forEach(function (k) {
- if (isDefined(value[k])) {
- result.push(encodeValue(operator, value[k], k));
- }
- });
- }
- } else {
- var tmp = [];
-
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function (value) {
- tmp.push(encodeValue(operator, value));
- });
- } else {
- Object.keys(value).forEach(function (k) {
- if (isDefined(value[k])) {
- tmp.push(encodeURIComponent(k));
- tmp.push(encodeValue(operator, value[k].toString()));
- }
- });
- }
-
- if (isKeyOperator(operator)) {
- result.push(encodeURIComponent(key) + '=' + tmp.join(','));
- } else if (tmp.length !== 0) {
- result.push(tmp.join(','));
- }
- }
- }
- } else {
- if (operator === ';') {
- result.push(encodeURIComponent(key));
- } else if (value === '' && (operator === '&' || operator === '?')) {
- result.push(encodeURIComponent(key) + '=');
- } else if (value === '') {
- result.push('');
- }
- }
-
- return result;
- }
-
- function isDefined(value) {
- return value !== undefined && value !== null;
- }
-
- function isKeyOperator(operator) {
- return operator === ';' || operator === '&' || operator === '?';
- }
-
- function encodeValue(operator, value, key) {
-
- value = operator === '+' || operator === '#' ? encodeReserved(value) : encodeURIComponent(value);
-
- if (key) {
- return encodeURIComponent(key) + '=' + value;
- } else {
- return value;
- }
- }
-
- function encodeReserved(str) {
- return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
- if (!/%[0-9A-Fa-f]/.test(part)) {
- part = encodeURI(part);
- }
- return part;
- }).join('');
- }
-
- function template (options) {
-
- var variables = [],
- url = expand(options.url, options.params, variables);
-
- variables.forEach(function (key) {
- delete options.params[key];
- });
-
- return url;
- }
-
- /**
- * Service for URL templating.
- */
-
- var ie = document.documentMode;
- var el = document.createElement('a');
-
- function Url(url, params) {
-
- var self = this || {},
- options = url,
- transform;
-
- if (isString(url)) {
- options = { url: url, params: params };
- }
-
- options = merge({}, Url.options, self.$options, options);
-
- Url.transforms.forEach(function (handler) {
- transform = factory(handler, transform, self.$vm);
- });
-
- return transform(options);
- }
-
- /**
- * Url options.
- */
-
- Url.options = {
- url: '',
- root: null,
- params: {}
- };
-
- /**
- * Url transforms.
- */
-
- Url.transforms = [template, query, root];
-
- /**
- * Encodes a Url parameter string.
- *
- * @param {Object} obj
- */
-
- Url.params = function (obj) {
-
- var params = [],
- escape = encodeURIComponent;
-
- params.add = function (key, value) {
-
- if (isFunction(value)) {
- value = value();
- }
-
- if (value === null) {
- value = '';
- }
-
- this.push(escape(key) + '=' + escape(value));
- };
-
- serialize(params, obj);
-
- return params.join('&').replace(/%20/g, '+');
- };
-
- /**
- * Parse a URL and return its components.
- *
- * @param {String} url
- */
-
- Url.parse = function (url) {
-
- if (ie) {
- el.href = url;
- url = el.href;
- }
-
- el.href = url;
-
- return {
- href: el.href,
- protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
- port: el.port,
- host: el.host,
- hostname: el.hostname,
- pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
- search: el.search ? el.search.replace(/^\?/, '') : '',
- hash: el.hash ? el.hash.replace(/^#/, '') : ''
- };
- };
-
- function factory(handler, next, vm) {
- return function (options) {
- return handler.call(vm, options, next);
- };
- }
-
- function serialize(params, obj, scope) {
-
- var array = isArray(obj),
- plain = isPlainObject(obj),
- hash;
-
- each(obj, function (value, key) {
-
- hash = isObject(value) || isArray(value);
-
- if (scope) {
- key = scope + '[' + (plain || hash ? key : '') + ']';
- }
-
- if (!scope && array) {
- params.add(value.name, value.value);
- } else if (hash) {
- serialize(params, value, key);
- } else {
- params.add(key, value);
- }
- });
- }
-
- function xdrClient (request) {
- return new Promise$1(function (resolve) {
-
- var xdr = new XDomainRequest(),
- handler = function (event) {
-
- var response = request.respondWith(xdr.responseText, {
- status: xdr.status,
- statusText: xdr.statusText
- });
-
- resolve(response);
- };
-
- request.abort = function () {
- return xdr.abort();
- };
-
- xdr.open(request.method, request.getUrl(), true);
- xdr.timeout = 0;
- xdr.onload = handler;
- xdr.onerror = handler;
- xdr.ontimeout = function () {};
- xdr.onprogress = function () {};
- xdr.send(request.getBody());
- });
- }
-
- var ORIGIN_URL = Url.parse(location.href);
- var SUPPORTS_CORS = 'withCredentials' in new XMLHttpRequest();
-
- function cors (request, next) {
-
- if (!isBoolean(request.crossOrigin) && crossOrigin(request)) {
- request.crossOrigin = true;
- }
-
- if (request.crossOrigin) {
-
- if (!SUPPORTS_CORS) {
- request.client = xdrClient;
- }
-
- delete request.emulateHTTP;
- }
-
- next();
- }
-
- function crossOrigin(request) {
-
- var requestUrl = Url.parse(Url(request));
-
- return requestUrl.protocol !== ORIGIN_URL.protocol || requestUrl.host !== ORIGIN_URL.host;
- }
-
- function body (request, next) {
-
- if (request.emulateJSON && isPlainObject(request.body)) {
- request.body = Url.params(request.body);
- request.headers['Content-Type'] = 'application/x-www-form-urlencoded';
- }
-
- if (isFormData(request.body)) {
- delete request.headers['Content-Type'];
- }
-
- if (isPlainObject(request.body)) {
- request.body = JSON.stringify(request.body);
- }
-
- next(function (response) {
-
- var contentType = response.headers['Content-Type'];
-
- if (isString(contentType) && contentType.indexOf('application/json') === 0) {
-
- try {
- response.data = response.json();
- } catch (e) {
- response.data = null;
- }
- } else {
- response.data = response.text();
- }
- });
- }
-
- function jsonpClient (request) {
- return new Promise$1(function (resolve) {
-
- var name = request.jsonp || 'callback',
- callback = '_jsonp' + Math.random().toString(36).substr(2),
- body = null,
- handler,
- script;
-
- handler = function (event) {
-
- var status = 0;
-
- if (event.type === 'load' && body !== null) {
- status = 200;
- } else if (event.type === 'error') {
- status = 404;
- }
-
- resolve(request.respondWith(body, { status: status }));
-
- delete window[callback];
- document.body.removeChild(script);
- };
-
- request.params[name] = callback;
-
- window[callback] = function (result) {
- body = JSON.stringify(result);
- };
-
- script = document.createElement('script');
- script.src = request.getUrl();
- script.type = 'text/javascript';
- script.async = true;
- script.onload = handler;
- script.onerror = handler;
-
- document.body.appendChild(script);
- });
- }
-
- function jsonp (request, next) {
-
- if (request.method == 'JSONP') {
- request.client = jsonpClient;
- }
-
- next(function (response) {
-
- if (request.method == 'JSONP') {
- response.data = response.json();
- }
- });
- }
-
- function before (request, next) {
-
- if (isFunction(request.before)) {
- request.before.call(this, request);
- }
-
- next();
- }
-
- /**
- * HTTP method override Interceptor.
- */
-
- function method (request, next) {
-
- if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
- request.headers['X-HTTP-Method-Override'] = request.method;
- request.method = 'POST';
- }
-
- next();
- }
-
- function header (request, next) {
-
- request.method = request.method.toUpperCase();
- request.headers = assign({}, Http.headers.common, !request.crossOrigin ? Http.headers.custom : {}, Http.headers[request.method.toLowerCase()], request.headers);
-
- next();
- }
-
- /**
- * Timeout Interceptor.
- */
-
- function timeout (request, next) {
-
- var timeout;
-
- if (request.timeout) {
- timeout = setTimeout(function () {
- request.abort();
- }, request.timeout);
- }
-
- next(function (response) {
-
- clearTimeout(timeout);
- });
- }
-
- function xhrClient (request) {
- return new Promise$1(function (resolve) {
-
- var xhr = new XMLHttpRequest(),
- handler = function (event) {
-
- var response = request.respondWith('response' in xhr ? xhr.response : xhr.responseText, {
- status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
- statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText),
- headers: parseHeaders(xhr.getAllResponseHeaders())
- });
-
- resolve(response);
- };
-
- request.abort = function () {
- return xhr.abort();
- };
-
- xhr.open(request.method, request.getUrl(), true);
- xhr.timeout = 0;
- xhr.onload = handler;
- xhr.onerror = handler;
-
- if (request.progress) {
- if (request.method === 'GET') {
- xhr.addEventListener('progress', request.progress);
- } else if (/^(POST|PUT)$/i.test(request.method)) {
- xhr.upload.addEventListener('progress', request.progress);
- }
- }
-
- if (request.credentials === true) {
- xhr.withCredentials = true;
- }
-
- each(request.headers || {}, function (value, header) {
- xhr.setRequestHeader(header, value);
- });
-
- xhr.send(request.getBody());
- });
- }
-
- function parseHeaders(str) {
-
- var headers = {},
- value,
- name,
- i;
-
- each(trim(str).split('\n'), function (row) {
-
- i = row.indexOf(':');
- name = trim(row.slice(0, i));
- value = trim(row.slice(i + 1));
-
- if (headers[name]) {
-
- if (isArray(headers[name])) {
- headers[name].push(value);
- } else {
- headers[name] = [headers[name], value];
- }
- } else {
-
- headers[name] = value;
- }
- });
-
- return headers;
- }
-
- function Client (context) {
-
- var reqHandlers = [sendRequest],
- resHandlers = [],
- handler;
-
- if (!isObject(context)) {
- context = null;
- }
-
- function Client(request) {
- return new Promise$1(function (resolve) {
-
- function exec() {
-
- handler = reqHandlers.pop();
-
- if (isFunction(handler)) {
- handler.call(context, request, next);
- } else {
- warn('Invalid interceptor of type ' + typeof handler + ', must be a function');
- next();
- }
- }
-
- function next(response) {
-
- if (isFunction(response)) {
-
- resHandlers.unshift(response);
- } else if (isObject(response)) {
-
- resHandlers.forEach(function (handler) {
- response = when(response, function (response) {
- return handler.call(context, response) || response;
- });
- });
-
- when(response, resolve);
-
- return;
- }
-
- exec();
- }
-
- exec();
- }, context);
- }
-
- Client.use = function (handler) {
- reqHandlers.push(handler);
- };
-
- return Client;
- }
-
- function sendRequest(request, resolve) {
-
- var client = request.client || xhrClient;
-
- resolve(client(request));
- }
-
- var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- };
-
- /**
- * HTTP Response.
- */
-
- var Response = function () {
- function Response(body, _ref) {
- var url = _ref.url;
- var headers = _ref.headers;
- var status = _ref.status;
- var statusText = _ref.statusText;
- classCallCheck(this, Response);
-
-
- this.url = url;
- this.body = body;
- this.headers = headers || {};
- this.status = status || 0;
- this.statusText = statusText || '';
- this.ok = status >= 200 && status < 300;
- }
-
- Response.prototype.text = function text() {
- return this.body;
- };
-
- Response.prototype.blob = function blob() {
- return new Blob([this.body]);
- };
-
- Response.prototype.json = function json() {
- return JSON.parse(this.body);
- };
-
- return Response;
- }();
-
- var Request = function () {
- function Request(options) {
- classCallCheck(this, Request);
-
-
- this.method = 'GET';
- this.body = null;
- this.params = {};
- this.headers = {};
-
- assign(this, options);
- }
-
- Request.prototype.getUrl = function getUrl() {
- return Url(this);
- };
-
- Request.prototype.getBody = function getBody() {
- return this.body;
- };
-
- Request.prototype.respondWith = function respondWith(body, options) {
- return new Response(body, assign(options || {}, { url: this.getUrl() }));
- };
-
- return Request;
- }();
-
- /**
- * Service for sending network requests.
- */
-
- var CUSTOM_HEADERS = { 'X-Requested-With': 'XMLHttpRequest' };
- var COMMON_HEADERS = { 'Accept': 'application/json, text/plain, */*' };
- var JSON_CONTENT_TYPE = { 'Content-Type': 'application/json;charset=utf-8' };
-
- function Http(options) {
-
- var self = this || {},
- client = Client(self.$vm);
-
- defaults(options || {}, self.$options, Http.options);
-
- Http.interceptors.forEach(function (handler) {
- client.use(handler);
- });
-
- return client(new Request(options)).then(function (response) {
-
- return response.ok ? response : Promise$1.reject(response);
- }, function (response) {
-
- if (response instanceof Error) {
- error(response);
- }
-
- return Promise$1.reject(response);
- });
- }
-
- Http.options = {};
-
- Http.headers = {
- put: JSON_CONTENT_TYPE,
- post: JSON_CONTENT_TYPE,
- patch: JSON_CONTENT_TYPE,
- delete: JSON_CONTENT_TYPE,
- custom: CUSTOM_HEADERS,
- common: COMMON_HEADERS
- };
-
- Http.interceptors = [before, timeout, method, body, jsonp, header, cors];
-
- ['get', 'delete', 'head', 'jsonp'].forEach(function (method) {
-
- Http[method] = function (url, options) {
- return this(assign(options || {}, { url: url, method: method }));
- };
- });
-
- ['post', 'put', 'patch'].forEach(function (method) {
-
- Http[method] = function (url, body, options) {
- return this(assign(options || {}, { url: url, method: method, body: body }));
- };
- });
-
- function Resource(url, params, actions, options) {
-
- var self = this || {},
- resource = {};
-
- actions = assign({}, Resource.actions, actions);
-
- each(actions, function (action, name) {
-
- action = merge({ url: url, params: params || {} }, options, action);
-
- resource[name] = function () {
- return (self.$http || Http)(opts(action, arguments));
- };
- });
-
- return resource;
- }
-
- function opts(action, args) {
-
- var options = assign({}, action),
- params = {},
- body;
-
- switch (args.length) {
-
- case 2:
-
- params = args[0];
- body = args[1];
-
- break;
-
- case 1:
-
- if (/^(POST|PUT|PATCH)$/i.test(options.method)) {
- body = args[0];
- } else {
- params = args[0];
- }
-
- break;
-
- case 0:
-
- break;
-
- default:
-
- throw 'Expected up to 4 arguments [params, body], got ' + args.length + ' arguments';
- }
-
- options.body = body;
- options.params = assign({}, options.params, params);
-
- return options;
- }
-
- Resource.actions = {
-
- get: { method: 'GET' },
- save: { method: 'POST' },
- query: { method: 'GET' },
- update: { method: 'PUT' },
- remove: { method: 'DELETE' },
- delete: { method: 'DELETE' }
-
- };
-
- function plugin(Vue) {
-
- if (plugin.installed) {
- return;
- }
-
- Util(Vue);
-
- Vue.url = Url;
- Vue.http = Http;
- Vue.resource = Resource;
- Vue.Promise = Promise$1;
-
- Object.defineProperties(Vue.prototype, {
-
- $url: {
- get: function () {
- return options(Vue.url, this, this.$options.url);
- }
- },
-
- $http: {
- get: function () {
- return options(Vue.http, this, this.$options.http);
- }
- },
-
- $resource: {
- get: function () {
- return Vue.resource.bind(this);
- }
- },
-
- $promise: {
- get: function () {
- var _this = this;
-
- return function (executor) {
- return new Vue.Promise(executor, _this);
- };
- }
- }
-
- });
- }
-
- if (typeof window !== 'undefined' && window.Vue) {
- window.Vue.use(plugin);
- }
-
- module.exports = plugin;
-
-/***/ },
-/* 8 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* styles */
- __webpack_require__(9)
-
- /* script */
- __vue_exports__ = __webpack_require__(13)
-
- /* template */
- var __vue_template__ = __webpack_require__(77)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/typeahead/Typeahead.vue"
- __vue_options__.render = __vue_template__.render
- __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
- __vue_options__._scopeId = "data-v-09005644"
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-09005644", __vue_options__)
- } else {
- hotAPI.reload("data-v-09005644", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] Typeahead.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 9 */
-/***/ function(module, exports, __webpack_require__) {
-
- // style-loader: Adds some css to the DOM by adding a <style> tag
-
- // load the styles
- var content = __webpack_require__(10);
- if(typeof content === 'string') content = [[module.id, content, '']];
- // add the styles to the DOM
- var update = __webpack_require__(12)(content, {});
- if(content.locals) module.exports = content.locals;
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!./../../../../../node_modules/css-loader/index.js?sourceMap!./../../../../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-09005644&scoped=true!./style.css", function() {
- var newContent = require("!!./../../../../../node_modules/css-loader/index.js?sourceMap!./../../../../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-09005644&scoped=true!./style.css");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
-
-/***/ },
-/* 10 */
-/***/ function(module, exports, __webpack_require__) {
-
- exports = module.exports = __webpack_require__(11)();
- // imports
-
-
- // module
- exports.push([module.id, "\nTypeahead[data-v-09005644] {\n position: relative;\n}\n.selected-tags[data-v-09005644] { border: 1px solid red; width: 200px !important;\n}\n.selected-tags select[data-v-09005644] {display: inline-block;\n}\n.Typeahead__input[data-v-09005644] {\n width: 100%;\n font-size: 14px;\n color: #2c3e50;\n line-height: 1.42857143;\n box-shadow: inset 0 1px 4px rgba(0,0,0,.4);\n -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;\n font-weight: 300;\n padding: 12px 26px;\n border: none;\n border-radius: 22px;\n letter-spacing: 1px;\n box-sizing: border-box;\n}\n.Typeahead__input[data-v-09005644]:focus {\n border-color: #4fc08d;\n outline: 0;\n box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px #4fc08d;\n}\n.tag-item[data-v-09005644] {border: 1px solid red;\n}\n.fa-times[data-v-09005644] {\n cursor: pointer;\n}\nul[data-v-09005644] {\n /*position: absolute;*/\n padding: 0;\n margin-top: 8px;\n min-width: 100%;\n background-color: #fff;\n list-style: none;\n border-radius: 4px;\n box-shadow: 0 0 10px rgba(0,0,0, 0.25);\n z-index: 1000;\n}\nli[data-v-09005644] {\n padding: 10px 16px;\n border-bottom: 1px solid #ccc;\n cursor: pointer;\n}\nli[data-v-09005644]:first-child {\n border-radius: 4px 4px 0 0;\n}\nli[data-v-09005644]:last-child {\n border-radius: 0 0 4px 4px;\n border-bottom: 0;\n}\nspan[data-v-09005644] {\n display: block;\n color: #2c3e50;\n}\n.active[data-v-09005644] {\n background-color: #3aa373;\n}\n.active span[data-v-09005644] {\n color: white;\n}\n.name[data-v-09005644] {\n font-weight: 700;\n font-size: 18px;\n}\n.screen-name[data-v-09005644] {\n font-style: italic;\n}", "", {"version":3,"sources":["/./src_js/iconolab-bundle/src/components/typeahead/style.css"],"names":[],"mappings":";AAAA;EACE,mBAAmB;CACpB;AACD,kCAAiB,sBAAsB,CAAC,wBAAwB;CAAE;AAClE,wCAAuB,sBAAsB;CAAC;AAE9C;EACE,YAAY;EACZ,gBAAgB;EAChB,eAAe;EACf,wBAAwB;EACxB,2CAA2C;EAC3C,sFAAsF;EACtF,sEAAsE;EACtE,iBAAiB;EACjB,mBAAmB;EACnB,aAAa;EACb,oBAAoB;EACpB,oBAAoB;EACpB,uBAAuB;CACxB;AACD;EACE,sBAAsB;EACtB,WAAW;EACX,6DAA6D;CAC9D;AACD,4BAAW,sBAAsB;CAAC;AAClC;EACE,gBAAgB;CACjB;AAED;EACE,uBAAuB;EACvB,WAAW;EACX,gBAAgB;EAChB,gBAAgB;EAChB,uBAAuB;EACvB,iBAAiB;EACjB,mBAAmB;EACnB,uCAAuC;EACvC,cAAc;CACf;AACD;EACE,mBAAmB;EACnB,8BAA8B;EAC9B,gBAAgB;CACjB;AACD;EACE,2BAA2B;CAC5B;AACD;EACE,2BAA2B;EAC3B,iBAAiB;CAClB;AACD;EACE,eAAe;EACf,eAAe;CAChB;AACD;EACE,0BAA0B;CAC3B;AACD;EACE,aAAa;CACd;AACD;EACE,iBAAiB;EACjB,gBAAgB;CACjB;AACD;EACE,mBAAmB;CACpB","file":"style.css","sourcesContent":["Typeahead {\n position: relative;\n}\n.selected-tags { border: 1px solid red; width: 200px !important; }\n.selected-tags select {display: inline-block;}\n\n.Typeahead__input {\n width: 100%;\n font-size: 14px;\n color: #2c3e50;\n line-height: 1.42857143;\n box-shadow: inset 0 1px 4px rgba(0,0,0,.4);\n -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;\n font-weight: 300;\n padding: 12px 26px;\n border: none;\n border-radius: 22px;\n letter-spacing: 1px;\n box-sizing: border-box;\n}\n.Typeahead__input:focus {\n border-color: #4fc08d;\n outline: 0;\n box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px #4fc08d;\n}\n.tag-item {border: 1px solid red;}\n.fa-times {\n cursor: pointer;\n}\n\nul {\n /*position: absolute;*/\n padding: 0;\n margin-top: 8px;\n min-width: 100%;\n background-color: #fff;\n list-style: none;\n border-radius: 4px;\n box-shadow: 0 0 10px rgba(0,0,0, 0.25);\n z-index: 1000;\n}\nli {\n padding: 10px 16px;\n border-bottom: 1px solid #ccc;\n cursor: pointer;\n}\nli:first-child {\n border-radius: 4px 4px 0 0;\n}\nli:last-child {\n border-radius: 0 0 4px 4px;\n border-bottom: 0;\n}\nspan {\n display: block;\n color: #2c3e50;\n}\n.active {\n background-color: #3aa373;\n}\n.active span {\n color: white;\n}\n.name {\n font-weight: 700;\n font-size: 18px;\n}\n.screen-name {\n font-style: italic;\n}"],"sourceRoot":"webpack://"}]);
-
- // exports
-
-
-/***/ },
-/* 11 */
-/***/ function(module, exports) {
-
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
- // css base code, injected by the css-loader
- module.exports = function() {
- var list = [];
-
- // return the list of modules as css string
- list.toString = function toString() {
- var result = [];
- for(var i = 0; i < this.length; i++) {
- var item = this[i];
- if(item[2]) {
- result.push("@media " + item[2] + "{" + item[1] + "}");
- } else {
- result.push(item[1]);
- }
- }
- return result.join("");
- };
-
- // import a list of modules into the list
- list.i = function(modules, mediaQuery) {
- if(typeof modules === "string")
- modules = [[null, modules, ""]];
- var alreadyImportedModules = {};
- for(var i = 0; i < this.length; i++) {
- var id = this[i][0];
- if(typeof id === "number")
- alreadyImportedModules[id] = true;
- }
- for(i = 0; i < modules.length; i++) {
- var item = modules[i];
- // skip already imported module
- // this implementation is not 100% perfect for weird media query combinations
- // when a module is imported multiple times with different media queries.
- // I hope this will never occur (Hey this way we have smaller bundles)
- if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
- if(mediaQuery && !item[2]) {
- item[2] = mediaQuery;
- } else if(mediaQuery) {
- item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
- }
- list.push(item);
- }
- }
- };
- return list;
- };
-
-
-/***/ },
-/* 12 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
- var stylesInDom = {},
- memoize = function(fn) {
- var memo;
- return function () {
- if (typeof memo === "undefined") memo = fn.apply(this, arguments);
- return memo;
- };
- },
- isOldIE = memoize(function() {
- return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
- }),
- getHeadElement = memoize(function () {
- return document.head || document.getElementsByTagName("head")[0];
- }),
- singletonElement = null,
- singletonCounter = 0,
- styleElementsInsertedAtTop = [];
-
- module.exports = function(list, options) {
- if(false) {
- if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
- }
-
- options = options || {};
- // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
- // tags it will allow on a page
- if (typeof options.singleton === "undefined") options.singleton = isOldIE();
-
- // By default, add <style> tags to the bottom of <head>.
- if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
-
- var styles = listToStyles(list);
- addStylesToDom(styles, options);
-
- return function update(newList) {
- var mayRemove = [];
- for(var i = 0; i < styles.length; i++) {
- var item = styles[i];
- var domStyle = stylesInDom[item.id];
- domStyle.refs--;
- mayRemove.push(domStyle);
- }
- if(newList) {
- var newStyles = listToStyles(newList);
- addStylesToDom(newStyles, options);
- }
- for(var i = 0; i < mayRemove.length; i++) {
- var domStyle = mayRemove[i];
- if(domStyle.refs === 0) {
- for(var j = 0; j < domStyle.parts.length; j++)
- domStyle.parts[j]();
- delete stylesInDom[domStyle.id];
- }
- }
- };
- }
-
- function addStylesToDom(styles, options) {
- for(var i = 0; i < styles.length; i++) {
- var item = styles[i];
- var domStyle = stylesInDom[item.id];
- if(domStyle) {
- domStyle.refs++;
- for(var j = 0; j < domStyle.parts.length; j++) {
- domStyle.parts[j](item.parts[j]);
- }
- for(; j < item.parts.length; j++) {
- domStyle.parts.push(addStyle(item.parts[j], options));
- }
- } else {
- var parts = [];
- for(var j = 0; j < item.parts.length; j++) {
- parts.push(addStyle(item.parts[j], options));
- }
- stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
- }
- }
- }
-
- function listToStyles(list) {
- var styles = [];
- var newStyles = {};
- for(var i = 0; i < list.length; i++) {
- var item = list[i];
- var id = item[0];
- var css = item[1];
- var media = item[2];
- var sourceMap = item[3];
- var part = {css: css, media: media, sourceMap: sourceMap};
- if(!newStyles[id])
- styles.push(newStyles[id] = {id: id, parts: [part]});
- else
- newStyles[id].parts.push(part);
- }
- return styles;
- }
-
- function insertStyleElement(options, styleElement) {
- var head = getHeadElement();
- var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
- if (options.insertAt === "top") {
- if(!lastStyleElementInsertedAtTop) {
- head.insertBefore(styleElement, head.firstChild);
- } else if(lastStyleElementInsertedAtTop.nextSibling) {
- head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
- } else {
- head.appendChild(styleElement);
- }
- styleElementsInsertedAtTop.push(styleElement);
- } else if (options.insertAt === "bottom") {
- head.appendChild(styleElement);
- } else {
- throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
- }
- }
-
- function removeStyleElement(styleElement) {
- styleElement.parentNode.removeChild(styleElement);
- var idx = styleElementsInsertedAtTop.indexOf(styleElement);
- if(idx >= 0) {
- styleElementsInsertedAtTop.splice(idx, 1);
- }
- }
-
- function createStyleElement(options) {
- var styleElement = document.createElement("style");
- styleElement.type = "text/css";
- insertStyleElement(options, styleElement);
- return styleElement;
- }
-
- function addStyle(obj, options) {
- var styleElement, update, remove;
-
- if (options.singleton) {
- var styleIndex = singletonCounter++;
- styleElement = singletonElement || (singletonElement = createStyleElement(options));
- update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
- remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
- } else {
- styleElement = createStyleElement(options);
- update = applyToTag.bind(null, styleElement);
- remove = function() {
- removeStyleElement(styleElement);
- };
- }
-
- update(obj);
-
- return function updateStyle(newObj) {
- if(newObj) {
- if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
- return;
- update(obj = newObj);
- } else {
- remove();
- }
- };
- }
-
- var replaceText = (function () {
- var textStore = [];
-
- return function (index, replacement) {
- textStore[index] = replacement;
- return textStore.filter(Boolean).join('\n');
- };
- })();
-
- function applyToSingletonTag(styleElement, index, remove, obj) {
- var css = remove ? "" : obj.css;
-
- if (styleElement.styleSheet) {
- styleElement.styleSheet.cssText = replaceText(index, css);
- } else {
- var cssNode = document.createTextNode(css);
- var childNodes = styleElement.childNodes;
- if (childNodes[index]) styleElement.removeChild(childNodes[index]);
- if (childNodes.length) {
- styleElement.insertBefore(cssNode, childNodes[index]);
- } else {
- styleElement.appendChild(cssNode);
- }
- }
- }
-
- function applyToTag(styleElement, obj) {
- var css = obj.css;
- var media = obj.media;
- var sourceMap = obj.sourceMap;
-
- if (media) {
- styleElement.setAttribute("media", media);
- }
-
- if (sourceMap) {
- // https://developer.chrome.com/devtools/docs/javascript-debugging
- // this makes source maps inside style tags work properly in Chrome
- css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */';
- // http://stackoverflow.com/a/26603875
- css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
- }
-
- if (styleElement.styleSheet) {
- styleElement.styleSheet.cssText = css;
- } else {
- while(styleElement.firstChild) {
- styleElement.removeChild(styleElement.firstChild);
- }
- styleElement.appendChild(document.createTextNode(css));
- }
- }
-
-
-/***/ },
-/* 13 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _vueTypeahead = __webpack_require__(14);
-
- var _vueTypeahead2 = _interopRequireDefault(_vueTypeahead);
-
- var _Taglist = __webpack_require__(58);
-
- var _Taglist2 = _interopRequireDefault(_Taglist);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- //
- //
- //
-
- var autoCompletePath = "https://lookup.dbpedia.org/api/search/PrefixSearch?MaxHits=5";
- var wikipediaPath = "https://fr.wikipedia.org/w/api.php";
- var parentsMethods = {
- reset: _vueTypeahead2.default.methods.reset
- };
-
- var get = function get(url, data) {
- var dfd = jQuery.Deferred();
- var promise = jQuery.getJSON(url, data).done(function (response) {
- var envelope = {};
- envelope.data = response;
- dfd.resolve(envelope);
- }).fail(dfd.reject);
- return dfd.promise();
- };
-
- exports.default = {
- mixins: [_vueTypeahead2.default],
- components: { 'taglist': _Taglist2.default },
-
- props: ['tags', 'read-only'],
-
- mounted: function mounted() {
- this.taglist = this.$refs.taglist;
- this.taglist.readOnly = this.readOnly;
- this.setTags(this.tags);
- },
- data: function data() {
- return {
- src: autoCompletePath,
- limit: 7,
- minChars: 2,
- showAddButton: false,
- datasource: "wikipedia",
- selectedTags: "[]",
- items: [],
- queryParamName: "QueryString"
-
- };
- },
-
-
- methods: {
- setTags: function setTags(tags, reset) {
- tags = Array.isArray(tags) ? tags : [];
- reset = typeof reset === "boolean" ? reset : false;
- if (reset) {
- this.taglist.reset();
- }
- this.taglist.setTags(tags);
- },
- checkQuery: function checkQuery() {
- if (this.query.length === 0) {
- this.reset();
- }
- },
- fetch: function fetch() {
- if (this.datasource === "wikipedia") {
- return this.fetchWikiPedia();
- } else {
- var request = {};
- request[this.queryParamName] = this.query;
- return get(this.src, query);
- }
- },
- fetchWikiPedia: function fetchWikiPedia() {
- this.src = wikipediaPath;
- var self = this;
- var request = {
- 'action': 'opensearch',
- 'format': 'json',
- 'search': this.query
- };
-
- /* make request */
- var dfd = jQuery.Deferred();
- jQuery.ajax({
- url: this.src,
- data: request,
- dataType: "jsonp",
- success: function success(response) {
- var envelope = {};
- envelope.data = response;
- dfd.resolve(envelope);
- }
- });
- return dfd.promise();
- },
- reset: function reset() {
- this.showAddButton = false;
- parentsMethods.reset.call(this);
- },
- prepareWikipediaResponse: function prepareWikipediaResponse(data) {
- var results = [];
- if (data.length !== 4) {
- return results;
- }
- var labelsList = data[1];
- var urlsList = data[3];
-
- if (labelsList.length !== urlsList.length) {
- return;
- }
-
- labelsList.map(function (item, index) {
- var tagItem = {};
- tagItem.tag_label = item;
- var link = urlsList[index];
- link = link.replace("https://fr.wikipedia.org/wiki/", "http://fr.dbpedia.org/resource/");
- tagItem.tag_link = decodeURI(link);
- tagItem.accuracy = 1;
- tagItem.relevancy = 1;
- results.push(tagItem);
- });
-
- return results;
- },
- prepareResponseData: function prepareResponseData(data) {
- var responseData = typeof data === 'string' ? JSON.parse(data) : data;
-
- if (this.datasource === "wikipedia") {
- responseData = this.prepareWikipediaResponse(responseData);
- }
-
- if (Array.isArray(responseData) && !responseData.length) {
- this.showAddButton = true;
- }
- return responseData;
- },
- addTag: function addTag() {
- if (this.hasItems) {
- return false;
- }
- var tag = { tag_label: this.query, accuracy: 1, relevancy: 1 };
- this.$refs.taglist.addTag(tag);
- this.reset();
- },
- onHit: function onHit(selected) {
- this.$refs.taglist.addTag(selected);
- this.reset();
- }
- }
-
- };
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
-
-/***/ },
-/* 14 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _defineProperty2 = __webpack_require__(15);
-
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
-
- var _assign = __webpack_require__(34);
-
- var _assign2 = _interopRequireDefault(_assign);
-
- var _vue = __webpack_require__(56);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- exports.default = {
- data: function data() {
- return {
- items: [],
- query: '',
- current: -1,
- loading: false,
- selectFirst: false,
- queryParamName: 'q'
- };
- },
-
-
- computed: {
- hasItems: function hasItems() {
- return this.items.length > 0;
- },
- isEmpty: function isEmpty() {
- return !this.query;
- },
- isDirty: function isDirty() {
- return !!this.query;
- }
- },
-
- methods: {
- update: function update() {
- var _this = this;
-
- if (!this.query) {
- return this.reset();
- }
-
- if (this.minChars && this.query.length < this.minChars) {
- return;
- }
-
- this.loading = true;
-
- this.fetch().then(function (response) {
- if (_this.query) {
- var data = response.data;
- data = _this.prepareResponseData ? _this.prepareResponseData(data) : data;
- _this.items = _this.limit ? data.slice(0, _this.limit) : data;
- _this.current = -1;
- _this.loading = false;
-
- if (_this.selectFirst) {
- _this.down();
- }
- }
- });
- },
- fetch: function fetch() {
- if (!this.$http) {
- return _vue.util.warn('You need to install the `vue-resource` plugin', this);
- }
-
- if (!this.src) {
- return _vue.util.warn('You need to set the `src` property', this);
- }
-
- var src = this.queryParamName ? this.src : this.src + this.query;
-
- var params = this.queryParamName ? (0, _assign2.default)((0, _defineProperty3.default)({}, this.queryParamName, this.query), this.data) : this.data;
-
- return this.$http.get(src, { params: params });
- },
- reset: function reset() {
- this.items = [];
- this.query = '';
- this.loading = false;
- },
- setActive: function setActive(index) {
- this.current = index;
- },
- activeClass: function activeClass(index) {
- return {
- active: this.current === index
- };
- },
- hit: function hit() {
- if (this.current !== -1) {
- this.onHit(this.items[this.current]);
- }
- },
- up: function up() {
- if (this.current > 0) {
- this.current--;
- } else if (this.current === -1) {
- this.current = this.items.length - 1;
- } else {
- this.current = -1;
- }
- },
- down: function down() {
- if (this.current < this.items.length - 1) {
- this.current++;
- } else {
- this.current = -1;
- }
- },
- onHit: function onHit() {
- _vue.util.warn('You need to implement the `onHit` method', this);
- }
- }
- };
-
-
-/***/ },
-/* 15 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
-
- exports.__esModule = true;
-
- var _defineProperty = __webpack_require__(16);
-
- var _defineProperty2 = _interopRequireDefault(_defineProperty);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- exports.default = function (obj, key, value) {
- if (key in obj) {
- (0, _defineProperty2.default)(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- };
-
-/***/ },
-/* 16 */
-/***/ function(module, exports, __webpack_require__) {
-
- module.exports = { "default": __webpack_require__(17), __esModule: true };
-
-/***/ },
-/* 17 */
-/***/ function(module, exports, __webpack_require__) {
-
- __webpack_require__(18);
- var $Object = __webpack_require__(21).Object;
- module.exports = function defineProperty(it, key, desc){
- return $Object.defineProperty(it, key, desc);
- };
-
-/***/ },
-/* 18 */
-/***/ function(module, exports, __webpack_require__) {
-
- var $export = __webpack_require__(19);
- // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
- $export($export.S + $export.F * !__webpack_require__(29), 'Object', {defineProperty: __webpack_require__(25).f});
-
-/***/ },
-/* 19 */
-/***/ function(module, exports, __webpack_require__) {
-
- var global = __webpack_require__(20)
- , core = __webpack_require__(21)
- , ctx = __webpack_require__(22)
- , hide = __webpack_require__(24)
- , PROTOTYPE = 'prototype';
-
- var $export = function(type, name, source){
- var IS_FORCED = type & $export.F
- , IS_GLOBAL = type & $export.G
- , IS_STATIC = type & $export.S
- , IS_PROTO = type & $export.P
- , IS_BIND = type & $export.B
- , IS_WRAP = type & $export.W
- , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
- , expProto = exports[PROTOTYPE]
- , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
- , key, own, out;
- if(IS_GLOBAL)source = name;
- for(key in source){
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- if(own && key in exports)continue;
- // export native or passed
- out = own ? target[key] : source[key];
- // prevent global pollution for namespaces
- exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
- // bind timers to global for call from export context
- : IS_BIND && own ? ctx(out, global)
- // wrap global constructors for prevent change them in library
- : IS_WRAP && target[key] == out ? (function(C){
- var F = function(a, b, c){
- if(this instanceof C){
- switch(arguments.length){
- case 0: return new C;
- case 1: return new C(a);
- case 2: return new C(a, b);
- } return new C(a, b, c);
- } return C.apply(this, arguments);
- };
- F[PROTOTYPE] = C[PROTOTYPE];
- return F;
- // make static versions for prototype methods
- })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
- // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
- if(IS_PROTO){
- (exports.virtual || (exports.virtual = {}))[key] = out;
- // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
- if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
- }
- }
- };
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- $export.U = 64; // safe
- $export.R = 128; // real proto method for `library`
- module.exports = $export;
-
-/***/ },
-/* 20 */
-/***/ function(module, exports) {
-
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
- if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
-
-/***/ },
-/* 21 */
-/***/ function(module, exports) {
-
- var core = module.exports = {version: '2.4.0'};
- if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
-
-/***/ },
-/* 22 */
-/***/ function(module, exports, __webpack_require__) {
-
- // optional / simple context binding
- var aFunction = __webpack_require__(23);
- module.exports = function(fn, that, length){
- aFunction(fn);
- if(that === undefined)return fn;
- switch(length){
- case 1: return function(a){
- return fn.call(that, a);
- };
- case 2: return function(a, b){
- return fn.call(that, a, b);
- };
- case 3: return function(a, b, c){
- return fn.call(that, a, b, c);
- };
- }
- return function(/* ...args */){
- return fn.apply(that, arguments);
- };
- };
-
-/***/ },
-/* 23 */
-/***/ function(module, exports) {
-
- module.exports = function(it){
- if(typeof it != 'function')throw TypeError(it + ' is not a function!');
- return it;
- };
-
-/***/ },
-/* 24 */
-/***/ function(module, exports, __webpack_require__) {
-
- var dP = __webpack_require__(25)
- , createDesc = __webpack_require__(33);
- module.exports = __webpack_require__(29) ? function(object, key, value){
- return dP.f(object, key, createDesc(1, value));
- } : function(object, key, value){
- object[key] = value;
- return object;
- };
-
-/***/ },
-/* 25 */
-/***/ function(module, exports, __webpack_require__) {
-
- var anObject = __webpack_require__(26)
- , IE8_DOM_DEFINE = __webpack_require__(28)
- , toPrimitive = __webpack_require__(32)
- , dP = Object.defineProperty;
-
- exports.f = __webpack_require__(29) ? Object.defineProperty : function defineProperty(O, P, Attributes){
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if(IE8_DOM_DEFINE)try {
- return dP(O, P, Attributes);
- } catch(e){ /* empty */ }
- if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
- if('value' in Attributes)O[P] = Attributes.value;
- return O;
- };
-
-/***/ },
-/* 26 */
-/***/ function(module, exports, __webpack_require__) {
-
- var isObject = __webpack_require__(27);
- module.exports = function(it){
- if(!isObject(it))throw TypeError(it + ' is not an object!');
- return it;
- };
-
-/***/ },
-/* 27 */
-/***/ function(module, exports) {
-
- module.exports = function(it){
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
-
-/***/ },
-/* 28 */
-/***/ function(module, exports, __webpack_require__) {
-
- module.exports = !__webpack_require__(29) && !__webpack_require__(30)(function(){
- return Object.defineProperty(__webpack_require__(31)('div'), 'a', {get: function(){ return 7; }}).a != 7;
- });
-
-/***/ },
-/* 29 */
-/***/ function(module, exports, __webpack_require__) {
-
- // Thank's IE8 for his funny defineProperty
- module.exports = !__webpack_require__(30)(function(){
- return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
- });
-
-/***/ },
-/* 30 */
-/***/ function(module, exports) {
-
- module.exports = function(exec){
- try {
- return !!exec();
- } catch(e){
- return true;
- }
- };
-
-/***/ },
-/* 31 */
-/***/ function(module, exports, __webpack_require__) {
-
- var isObject = __webpack_require__(27)
- , document = __webpack_require__(20).document
- // in old IE typeof document.createElement is 'object'
- , is = isObject(document) && isObject(document.createElement);
- module.exports = function(it){
- return is ? document.createElement(it) : {};
- };
-
-/***/ },
-/* 32 */
-/***/ function(module, exports, __webpack_require__) {
-
- // 7.1.1 ToPrimitive(input [, PreferredType])
- var isObject = __webpack_require__(27);
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- module.exports = function(it, S){
- if(!isObject(it))return it;
- var fn, val;
- if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
- if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
- if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
- throw TypeError("Can't convert object to primitive value");
- };
-
-/***/ },
-/* 33 */
-/***/ function(module, exports) {
-
- module.exports = function(bitmap, value){
- return {
- enumerable : !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable : !(bitmap & 4),
- value : value
- };
- };
-
-/***/ },
-/* 34 */
-/***/ function(module, exports, __webpack_require__) {
-
- module.exports = { "default": __webpack_require__(35), __esModule: true };
-
-/***/ },
-/* 35 */
-/***/ function(module, exports, __webpack_require__) {
-
- __webpack_require__(36);
- module.exports = __webpack_require__(21).Object.assign;
-
-/***/ },
-/* 36 */
-/***/ function(module, exports, __webpack_require__) {
-
- // 19.1.3.1 Object.assign(target, source)
- var $export = __webpack_require__(19);
-
- $export($export.S + $export.F, 'Object', {assign: __webpack_require__(37)});
-
-/***/ },
-/* 37 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- // 19.1.2.1 Object.assign(target, source, ...)
- var getKeys = __webpack_require__(38)
- , gOPS = __webpack_require__(53)
- , pIE = __webpack_require__(54)
- , toObject = __webpack_require__(55)
- , IObject = __webpack_require__(42)
- , $assign = Object.assign;
-
- // should work with symbols and should have deterministic property order (V8 bug)
- module.exports = !$assign || __webpack_require__(30)(function(){
- var A = {}
- , B = {}
- , S = Symbol()
- , K = 'abcdefghijklmnopqrst';
- A[S] = 7;
- K.split('').forEach(function(k){ B[k] = k; });
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
- }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
- var T = toObject(target)
- , aLen = arguments.length
- , index = 1
- , getSymbols = gOPS.f
- , isEnum = pIE.f;
- while(aLen > index){
- var S = IObject(arguments[index++])
- , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
- , length = keys.length
- , j = 0
- , key;
- while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
- } return T;
- } : $assign;
-
-/***/ },
-/* 38 */
-/***/ function(module, exports, __webpack_require__) {
-
- // 19.1.2.14 / 15.2.3.14 Object.keys(O)
- var $keys = __webpack_require__(39)
- , enumBugKeys = __webpack_require__(52);
-
- module.exports = Object.keys || function keys(O){
- return $keys(O, enumBugKeys);
- };
-
-/***/ },
-/* 39 */
-/***/ function(module, exports, __webpack_require__) {
-
- var has = __webpack_require__(40)
- , toIObject = __webpack_require__(41)
- , arrayIndexOf = __webpack_require__(45)(false)
- , IE_PROTO = __webpack_require__(49)('IE_PROTO');
-
- module.exports = function(object, names){
- var O = toIObject(object)
- , i = 0
- , result = []
- , key;
- for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while(names.length > i)if(has(O, key = names[i++])){
- ~arrayIndexOf(result, key) || result.push(key);
- }
- return result;
- };
-
-/***/ },
-/* 40 */
-/***/ function(module, exports) {
-
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function(it, key){
- return hasOwnProperty.call(it, key);
- };
-
-/***/ },
-/* 41 */
-/***/ function(module, exports, __webpack_require__) {
-
- // to indexed object, toObject with fallback for non-array-like ES3 strings
- var IObject = __webpack_require__(42)
- , defined = __webpack_require__(44);
- module.exports = function(it){
- return IObject(defined(it));
- };
-
-/***/ },
-/* 42 */
-/***/ function(module, exports, __webpack_require__) {
-
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- var cof = __webpack_require__(43);
- module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
- return cof(it) == 'String' ? it.split('') : Object(it);
- };
-
-/***/ },
-/* 43 */
-/***/ function(module, exports) {
-
- var toString = {}.toString;
-
- module.exports = function(it){
- return toString.call(it).slice(8, -1);
- };
-
-/***/ },
-/* 44 */
-/***/ function(module, exports) {
-
- // 7.2.1 RequireObjectCoercible(argument)
- module.exports = function(it){
- if(it == undefined)throw TypeError("Can't call method on " + it);
- return it;
- };
-
-/***/ },
-/* 45 */
-/***/ function(module, exports, __webpack_require__) {
-
- // false -> Array#indexOf
- // true -> Array#includes
- var toIObject = __webpack_require__(41)
- , toLength = __webpack_require__(46)
- , toIndex = __webpack_require__(48);
- module.exports = function(IS_INCLUDES){
- return function($this, el, fromIndex){
- var O = toIObject($this)
- , length = toLength(O.length)
- , index = toIndex(fromIndex, length)
- , value;
- // Array#includes uses SameValueZero equality algorithm
- if(IS_INCLUDES && el != el)while(length > index){
- value = O[index++];
- if(value != value)return true;
- // Array#toIndex ignores holes, Array#includes - not
- } else for(;length > index; index++)if(IS_INCLUDES || index in O){
- if(O[index] === el)return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
-
-/***/ },
-/* 46 */
-/***/ function(module, exports, __webpack_require__) {
-
- // 7.1.15 ToLength
- var toInteger = __webpack_require__(47)
- , min = Math.min;
- module.exports = function(it){
- return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
- };
-
-/***/ },
-/* 47 */
-/***/ function(module, exports) {
-
- // 7.1.4 ToInteger
- var ceil = Math.ceil
- , floor = Math.floor;
- module.exports = function(it){
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
- };
-
-/***/ },
-/* 48 */
-/***/ function(module, exports, __webpack_require__) {
-
- var toInteger = __webpack_require__(47)
- , max = Math.max
- , min = Math.min;
- module.exports = function(index, length){
- index = toInteger(index);
- return index < 0 ? max(index + length, 0) : min(index, length);
- };
-
-/***/ },
-/* 49 */
-/***/ function(module, exports, __webpack_require__) {
-
- var shared = __webpack_require__(50)('keys')
- , uid = __webpack_require__(51);
- module.exports = function(key){
- return shared[key] || (shared[key] = uid(key));
- };
-
-/***/ },
-/* 50 */
-/***/ function(module, exports, __webpack_require__) {
-
- var global = __webpack_require__(20)
- , SHARED = '__core-js_shared__'
- , store = global[SHARED] || (global[SHARED] = {});
- module.exports = function(key){
- return store[key] || (store[key] = {});
- };
-
-/***/ },
-/* 51 */
-/***/ function(module, exports) {
-
- var id = 0
- , px = Math.random();
- module.exports = function(key){
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
- };
-
-/***/ },
-/* 52 */
-/***/ function(module, exports) {
-
- // IE 8- don't enum bug keys
- module.exports = (
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
- ).split(',');
-
-/***/ },
-/* 53 */
-/***/ function(module, exports) {
-
- exports.f = Object.getOwnPropertySymbols;
-
-/***/ },
-/* 54 */
-/***/ function(module, exports) {
-
- exports.f = {}.propertyIsEnumerable;
-
-/***/ },
-/* 55 */
-/***/ function(module, exports, __webpack_require__) {
-
- // 7.1.13 ToObject(argument)
- var defined = __webpack_require__(44);
- module.exports = function(it){
- return Object(defined(it));
- };
-
-/***/ },
-/* 56 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(process, jQuery) {/*!
+"use strict";function n(t){this.state=et,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(t){e.reject(t)}}function r(t,e){t instanceof rt?this.promise=t:this.promise=new rt(t.bind(e)),this.context=e}function i(t){at=t.util,ot=t.config.debug||!t.config.silent}function o(t){"undefined"!=typeof console&&ot&&console.warn("[VueResource warn]: "+t)}function a(t){"undefined"!=typeof console&&console.error(t)}function s(t,e){return at.nextTick(t,e)}function l(t){return t.replace(/^\s*|\s*$/g,"")}function c(t){return"string"==typeof t}function f(t){return t===!0||t===!1}function u(t){return"function"==typeof t}function h(t){return null!==t&&"object"==typeof t}function p(t){return h(t)&&Object.getPrototypeOf(t)==Object.prototype}function d(t){return"undefined"!=typeof FormData&&t instanceof FormData}function g(t,e,n){var i=r.resolve(t);return arguments.length<2?i:i.then(e,n)}function v(t,e,n){return n=n||{},u(n)&&(n=n.call(e)),y(t.bind({$vm:e,$options:n}),t,{$options:n})}function m(t,e){var n,r;if("number"==typeof t.length)for(n=0;n<t.length;n++)e.call(t[n],t[n],n);else if(h(t))for(r in t)t.hasOwnProperty(r)&&e.call(t[r],t[r],r);return t}function y(t){var e=st.slice.call(arguments,1);return e.forEach(function(e){x(t,e,!0)}),t}function b(t){var e=st.slice.call(arguments,1);return e.forEach(function(e){for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t}function _(t){var e=st.slice.call(arguments,1);return e.forEach(function(e){x(t,e)}),t}function x(t,e,n){for(var r in e)n&&(p(e[r])||lt(e[r]))?(p(e[r])&&!p(t[r])&&(t[r]={}),lt(e[r])&&!lt(t[r])&&(t[r]=[]),x(t[r],e[r],n)):void 0!==e[r]&&(t[r]=e[r])}function w(t,e){var n=e(t);return c(t.root)&&!n.match(/^(https?:)?\//)&&(n=t.root+"/"+n),n}function k(t,e){var n=Object.keys(E.options.params),r={},i=e(t);return m(t.params,function(t,e){n.indexOf(e)===-1&&(r[e]=t)}),r=E.params(r),r&&(i+=(i.indexOf("?")==-1?"?":"&")+r),i}function C(t,e,n){var r=T(t),i=r.expand(e);return n&&n.push.apply(n,r.vars),i}function T(t){var e=["+","#",".","/",";","?","&"],n=[];return{vars:n,expand:function(r){return t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(t,i,o){if(i){var a=null,s=[];if(e.indexOf(i.charAt(0))!==-1&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(t){var e=/([^:\*]*)(?::(\d+)|(\*))?/.exec(t);s.push.apply(s,j(r,a,e[1],e[2]||e[3])),n.push(e[1])}),a&&"+"!==a){var l=",";return"?"===a?l="&":"#"!==a&&(l=a),(0!==s.length?a:"")+s.join(l)}return s.join(",")}return O(o)})}}}function j(t,e,n,r){var i=t[n],o=[];if($(i)&&""!==i)if("string"==typeof i||"number"==typeof i||"boolean"==typeof i)i=i.toString(),r&&"*"!==r&&(i=i.substring(0,parseInt(r,10))),o.push(S(e,i,A(e)?n:null));else if("*"===r)Array.isArray(i)?i.filter($).forEach(function(t){o.push(S(e,t,A(e)?n:null))}):Object.keys(i).forEach(function(t){$(i[t])&&o.push(S(e,i[t],t))});else{var a=[];Array.isArray(i)?i.filter($).forEach(function(t){a.push(S(e,t))}):Object.keys(i).forEach(function(t){$(i[t])&&(a.push(encodeURIComponent(t)),a.push(S(e,i[t].toString())))}),A(e)?o.push(encodeURIComponent(n)+"="+a.join(",")):0!==a.length&&o.push(a.join(","))}else";"===e?o.push(encodeURIComponent(n)):""!==i||"&"!==e&&"?"!==e?""===i&&o.push(""):o.push(encodeURIComponent(n)+"=");return o}function $(t){return void 0!==t&&null!==t}function A(t){return";"===t||"&"===t||"?"===t}function S(t,e,n){return e="+"===t||"#"===t?O(e):encodeURIComponent(e),n?encodeURIComponent(n)+"="+e:e}function O(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t)),t}).join("")}function M(t){var e=[],n=C(t.url,t.params,e);return e.forEach(function(e){delete t.params[e]}),n}function E(t,e){var n,r=this||{},i=t;return c(t)&&(i={url:t,params:e}),i=y({},E.options,r.$options,i),E.transforms.forEach(function(t){n=P(t,n,r.$vm)}),n(i)}function P(t,e,n){return function(r){return t.call(n,r,e)}}function N(t,e,n){var r,i=lt(e),o=p(e);m(e,function(e,a){r=h(e)||lt(e),n&&(a=n+"["+(o||r?a:"")+"]"),!n&&i?t.add(e.name,e.value):r?N(t,e,a):t.add(a,e)})}function F(t){return new r(function(e){var n=new XDomainRequest,r=function(r){var i=t.respondWith(n.responseText,{status:n.status,statusText:n.statusText});e(i)};t.abort=function(){return n.abort()},n.open(t.method,t.getUrl(),!0),n.timeout=0,n.onload=r,n.onerror=r,n.ontimeout=function(){},n.onprogress=function(){},n.send(t.getBody())})}function R(t,e){!f(t.crossOrigin)&&B(t)&&(t.crossOrigin=!0),t.crossOrigin&&(pt||(t.client=F),delete t.emulateHTTP),e()}function B(t){var e=E.parse(E(t));return e.protocol!==ht.protocol||e.host!==ht.host}function D(t,e){t.emulateJSON&&p(t.body)&&(t.body=E.params(t.body),t.headers["Content-Type"]="application/x-www-form-urlencoded"),d(t.body)&&delete t.headers["Content-Type"],p(t.body)&&(t.body=JSON.stringify(t.body)),e(function(t){var e=t.headers["Content-Type"];if(c(e)&&0===e.indexOf("application/json"))try{t.data=t.json()}catch(e){t.data=null}else t.data=t.text()})}function z(t){return new r(function(e){var n,r,i=t.jsonp||"callback",o="_jsonp"+Math.random().toString(36).substr(2),a=null;n=function(n){var i=0;"load"===n.type&&null!==a?i=200:"error"===n.type&&(i=404),e(t.respondWith(a,{status:i})),delete window[o],document.body.removeChild(r)},t.params[i]=o,window[o]=function(t){a=JSON.stringify(t)},r=document.createElement("script"),r.src=t.getUrl(),r.type="text/javascript",r.async=!0,r.onload=n,r.onerror=n,document.body.appendChild(r)})}function I(t,e){"JSONP"==t.method&&(t.client=z),e(function(e){"JSONP"==t.method&&(e.data=e.json())})}function L(t,e){u(t.before)&&t.before.call(this,t),e()}function q(t,e){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers["X-HTTP-Method-Override"]=t.method,t.method="POST"),e()}function V(t,e){t.method=t.method.toUpperCase(),t.headers=ct({},G.headers.common,t.crossOrigin?{}:G.headers.custom,G.headers[t.method.toLowerCase()],t.headers),e()}function H(t,e){var n;t.timeout&&(n=setTimeout(function(){t.abort()},t.timeout)),e(function(t){clearTimeout(n)})}function U(t){return new r(function(e){var n=new XMLHttpRequest,r=function(r){var i=t.respondWith("response"in n?n.response:n.responseText,{status:1223===n.status?204:n.status,statusText:1223===n.status?"No Content":l(n.statusText),headers:W(n.getAllResponseHeaders())});e(i)};t.abort=function(){return n.abort()},n.open(t.method,t.getUrl(),!0),n.timeout=0,n.onload=r,n.onerror=r,t.progress&&("GET"===t.method?n.addEventListener("progress",t.progress):/^(POST|PUT)$/i.test(t.method)&&n.upload.addEventListener("progress",t.progress)),t.credentials===!0&&(n.withCredentials=!0),m(t.headers||{},function(t,e){n.setRequestHeader(e,t)}),n.send(t.getBody())})}function W(t){var e,n,r,i={};return m(l(t).split("\n"),function(t){r=t.indexOf(":"),n=l(t.slice(0,r)),e=l(t.slice(r+1)),i[n]?lt(i[n])?i[n].push(e):i[n]=[i[n],e]:i[n]=e}),i}function Z(t){function e(e){return new r(function(r){function s(){n=i.pop(),u(n)?n.call(t,e,l):(o("Invalid interceptor of type "+typeof n+", must be a function"),l())}function l(e){if(u(e))a.unshift(e);else if(h(e))return a.forEach(function(n){e=g(e,function(e){return n.call(t,e)||e})}),void g(e,r);s()}s()},t)}var n,i=[J],a=[];return h(t)||(t=null),e.use=function(t){i.push(t)},e}function J(t,e){var n=t.client||U;e(n(t))}function G(t){var e=this||{},n=Z(e.$vm);return b(t||{},e.$options,G.options),G.interceptors.forEach(function(t){n.use(t)}),n(new vt(t)).then(function(t){return t.ok?t:r.reject(t)},function(t){return t instanceof Error&&a(t),r.reject(t)})}function X(t,e,n,r){var i=this||{},o={};return n=ct({},X.actions,n),m(n,function(n,a){n=y({url:t,params:e||{}},r,n),o[a]=function(){return(i.$http||G)(Y(n,arguments))}}),o}function Y(t,e){var n,r=ct({},t),i={};switch(e.length){case 2:i=e[0],n=e[1];break;case 1:/^(POST|PUT|PATCH)$/i.test(r.method)?n=e[0]:i=e[0];break;case 0:break;default:throw"Expected up to 4 arguments [params, body], got "+e.length+" arguments"}return r.body=n,r.params=ct({},r.params,i),r}function K(t){K.installed||(i(t),t.url=E,t.http=G,t.resource=X,t.Promise=r,Object.defineProperties(t.prototype,{$url:{get:function(){return v(t.url,this,this.$options.url)}},$http:{get:function(){return v(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){var e=this;return function(n){return new t.Promise(n,e)}}}}))}var Q=0,tt=1,et=2;n.reject=function(t){return new n(function(e,n){n(t)})},n.resolve=function(t){return new n(function(e,n){e(t)})},n.all=function(t){return new n(function(e,r){function i(n){return function(r){a[n]=r,o+=1,o===t.length&&e(a)}}var o=0,a=[];0===t.length&&e(a);for(var s=0;s<t.length;s+=1)n.resolve(t[s]).then(i(s),r)})},n.race=function(t){return new n(function(e,r){for(var i=0;i<t.length;i+=1)n.resolve(t[i]).then(e,r)})};var nt=n.prototype;nt.resolve=function(t){var e=this;if(e.state===et){if(t===e)throw new TypeError("Promise settled with itself.");var n=!1;try{var r=t&&t.then;if(null!==t&&"object"==typeof t&&"function"==typeof r)return void r.call(t,function(t){n||e.resolve(t),n=!0},function(t){n||e.reject(t),n=!0})}catch(t){return void(n||e.reject(t))}e.state=Q,e.value=t,e.notify()}},nt.reject=function(t){var e=this;if(e.state===et){if(t===e)throw new TypeError("Promise settled with itself.");e.state=tt,e.value=t,e.notify()}},nt.notify=function(){var t=this;s(function(){if(t.state!==et)for(;t.deferred.length;){var e=t.deferred.shift(),n=e[0],r=e[1],i=e[2],o=e[3];try{t.state===Q?i("function"==typeof n?n.call(void 0,t.value):t.value):t.state===tt&&("function"==typeof r?i(r.call(void 0,t.value)):o(t.value))}catch(t){o(t)}}})},nt.then=function(t,e){var r=this;return new n(function(n,i){r.deferred.push([t,e,n,i]),r.notify()})},nt.catch=function(t){return this.then(void 0,t)};var rt=window.Promise||n;r.all=function(t,e){return new r(rt.all(t),e)},r.resolve=function(t,e){return new r(rt.resolve(t),e)},r.reject=function(t,e){return new r(rt.reject(t),e)},r.race=function(t,e){return new r(rt.race(t),e)};var it=r.prototype;it.bind=function(t){return this.context=t,this},it.then=function(t,e){return t&&t.bind&&this.context&&(t=t.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),new r(this.promise.then(t,e),this.context)},it.catch=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),new r(this.promise.catch(t),this.context)},it.finally=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),rt.reject(e)})};var ot=!1,at={},st=[],lt=Array.isArray,ct=Object.assign||_,ft=document.documentMode,ut=document.createElement("a");E.options={url:"",root:null,params:{}},E.transforms=[M,k,w],E.params=function(t){var e=[],n=encodeURIComponent;return e.add=function(t,e){u(e)&&(e=e()),null===e&&(e=""),this.push(n(t)+"="+n(e))},N(e,t),e.join("&").replace(/%20/g,"+")},E.parse=function(t){return ft&&(ut.href=t,t=ut.href),ut.href=t,{href:ut.href,protocol:ut.protocol?ut.protocol.replace(/:$/,""):"",port:ut.port,host:ut.host,hostname:ut.hostname,pathname:"/"===ut.pathname.charAt(0)?ut.pathname:"/"+ut.pathname,search:ut.search?ut.search.replace(/^\?/,""):"",hash:ut.hash?ut.hash.replace(/^#/,""):""}};var ht=E.parse(location.href),pt="withCredentials"in new XMLHttpRequest,dt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},gt=function(){function t(e,n){var r=n.url,i=n.headers,o=n.status,a=n.statusText;dt(this,t),this.url=r,this.body=e,this.headers=i||{},this.status=o||0,this.statusText=a||"",this.ok=o>=200&&o<300}return t.prototype.text=function(){return this.body},t.prototype.blob=function(){return new Blob([this.body])},t.prototype.json=function(){return JSON.parse(this.body)},t}(),vt=function(){function t(e){dt(this,t),this.method="GET",this.body=null,this.params={},this.headers={},ct(this,e)}return t.prototype.getUrl=function(){return E(this)},t.prototype.getBody=function(){return this.body},t.prototype.respondWith=function(t,e){return new gt(t,ct(e||{},{url:this.getUrl()}))},t}(),mt={"X-Requested-With":"XMLHttpRequest"},yt={Accept:"application/json, text/plain, */*"},bt={"Content-Type":"application/json;charset=utf-8"};G.options={},G.headers={put:bt,post:bt,patch:bt,delete:bt,custom:mt,common:yt},G.interceptors=[L,H,q,D,I,V,R],["get","delete","head","jsonp"].forEach(function(t){G[t]=function(e,n){return this(ct(n||{},{url:e,method:t}))}}),["post","put","patch"].forEach(function(t){G[t]=function(e,n,r){return this(ct(r||{},{url:e,method:t,body:n}))}}),X.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeof window&&window.Vue&&window.Vue.use(K),t.exports=K},function(t,e,n){var r=n(129);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(130);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(131);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(132);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(133);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(134);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(135);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(136);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(137);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(138);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(139);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(140);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(141);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){var r=n(142);"string"==typeof r&&(r=[[t.id,r,""]]);n(3)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){(function(e){/*!
* Vue.js v1.0.28
* (c) 2016 Evan You
* Released under the MIT License.
*/
- 'use strict';
-
- function set(obj, key, val) {
- if (hasOwn(obj, key)) {
- obj[key] = val;
- return;
- }
- if (obj._isVue) {
- set(obj._data, key, val);
- return;
- }
- var ob = obj.__ob__;
- if (!ob) {
- obj[key] = val;
- return;
- }
- ob.convert(key, val);
- ob.dep.notify();
- if (ob.vms) {
- var i = ob.vms.length;
- while (i--) {
- var vm = ob.vms[i];
- vm._proxy(key);
- vm._digest();
- }
- }
- return val;
- }
-
- /**
- * Delete a property and trigger change if necessary.
- *
- * @param {Object} obj
- * @param {String} key
- */
-
- function del(obj, key) {
- if (!hasOwn(obj, key)) {
- return;
- }
- delete obj[key];
- var ob = obj.__ob__;
- if (!ob) {
- if (obj._isVue) {
- delete obj._data[key];
- obj._digest();
- }
- return;
- }
- ob.dep.notify();
- if (ob.vms) {
- var i = ob.vms.length;
- while (i--) {
- var vm = ob.vms[i];
- vm._unproxy(key);
- vm._digest();
- }
- }
- }
-
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- /**
- * Check whether the object has the property.
- *
- * @param {Object} obj
- * @param {String} key
- * @return {Boolean}
- */
-
- function hasOwn(obj, key) {
- return hasOwnProperty.call(obj, key);
- }
-
- /**
- * Check if an expression is a literal value.
- *
- * @param {String} exp
- * @return {Boolean}
- */
-
- var literalValueRE = /^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/;
-
- function isLiteral(exp) {
- return literalValueRE.test(exp);
- }
-
- /**
- * Check if a string starts with $ or _
- *
- * @param {String} str
- * @return {Boolean}
- */
-
- function isReserved(str) {
- var c = (str + '').charCodeAt(0);
- return c === 0x24 || c === 0x5F;
- }
-
- /**
- * Guard text output, make sure undefined outputs
- * empty string
- *
- * @param {*} value
- * @return {String}
- */
-
- function _toString(value) {
- return value == null ? '' : value.toString();
- }
-
- /**
- * Check and convert possible numeric strings to numbers
- * before setting back to data
- *
- * @param {*} value
- * @return {*|Number}
- */
-
- function toNumber(value) {
- if (typeof value !== 'string') {
- return value;
- } else {
- var parsed = Number(value);
- return isNaN(parsed) ? value : parsed;
- }
- }
-
- /**
- * Convert string boolean literals into real booleans.
- *
- * @param {*} value
- * @return {*|Boolean}
- */
-
- function toBoolean(value) {
- return value === 'true' ? true : value === 'false' ? false : value;
- }
-
- /**
- * Strip quotes from a string
- *
- * @param {String} str
- * @return {String | false}
- */
-
- function stripQuotes(str) {
- var a = str.charCodeAt(0);
- var b = str.charCodeAt(str.length - 1);
- return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str;
- }
-
- /**
- * Camelize a hyphen-delimited string.
- *
- * @param {String} str
- * @return {String}
- */
-
- var camelizeRE = /-(\w)/g;
-
- function camelize(str) {
- return str.replace(camelizeRE, toUpper);
- }
-
- function toUpper(_, c) {
- return c ? c.toUpperCase() : '';
- }
-
- /**
- * Hyphenate a camelCase string.
- *
- * @param {String} str
- * @return {String}
- */
-
- var hyphenateRE = /([^-])([A-Z])/g;
-
- function hyphenate(str) {
- return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
- }
-
- /**
- * Converts hyphen/underscore/slash delimitered names into
- * camelized classNames.
- *
- * e.g. my-component => MyComponent
- * some_else => SomeElse
- * some/comp => SomeComp
- *
- * @param {String} str
- * @return {String}
- */
-
- var classifyRE = /(?:^|[-_\/])(\w)/g;
-
- function classify(str) {
- return str.replace(classifyRE, toUpper);
- }
-
- /**
- * Simple bind, faster than native
- *
- * @param {Function} fn
- * @param {Object} ctx
- * @return {Function}
- */
-
- function bind(fn, ctx) {
- return function (a) {
- var l = arguments.length;
- return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);
- };
- }
-
- /**
- * Convert an Array-like object to a real Array.
- *
- * @param {Array-like} list
- * @param {Number} [start] - start index
- * @return {Array}
- */
-
- function toArray(list, start) {
- start = start || 0;
- var i = list.length - start;
- var ret = new Array(i);
- while (i--) {
- ret[i] = list[i + start];
- }
- return ret;
- }
-
- /**
- * Mix properties into target object.
- *
- * @param {Object} to
- * @param {Object} from
- */
-
- function extend(to, from) {
- var keys = Object.keys(from);
- var i = keys.length;
- while (i--) {
- to[keys[i]] = from[keys[i]];
- }
- return to;
- }
-
- /**
- * Quick object check - this is primarily used to tell
- * Objects from primitive values when we know the value
- * is a JSON-compliant type.
- *
- * @param {*} obj
- * @return {Boolean}
- */
-
- function isObject(obj) {
- return obj !== null && typeof obj === 'object';
- }
-
- /**
- * Strict object type check. Only returns true
- * for plain JavaScript objects.
- *
- * @param {*} obj
- * @return {Boolean}
- */
-
- var toString = Object.prototype.toString;
- var OBJECT_STRING = '[object Object]';
-
- function isPlainObject(obj) {
- return toString.call(obj) === OBJECT_STRING;
- }
-
- /**
- * Array type check.
- *
- * @param {*} obj
- * @return {Boolean}
- */
-
- var isArray = Array.isArray;
-
- /**
- * Define a property.
- *
- * @param {Object} obj
- * @param {String} key
- * @param {*} val
- * @param {Boolean} [enumerable]
- */
-
- function def(obj, key, val, enumerable) {
- Object.defineProperty(obj, key, {
- value: val,
- enumerable: !!enumerable,
- writable: true,
- configurable: true
- });
- }
-
- /**
- * Debounce a function so it only gets called after the
- * input stops arriving after the given wait period.
- *
- * @param {Function} func
- * @param {Number} wait
- * @return {Function} - the debounced function
- */
-
- function _debounce(func, wait) {
- var timeout, args, context, timestamp, result;
- var later = function later() {
- var last = Date.now() - timestamp;
- if (last < wait && last >= 0) {
- timeout = setTimeout(later, wait - last);
- } else {
- timeout = null;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- }
- };
- return function () {
- context = this;
- args = arguments;
- timestamp = Date.now();
- if (!timeout) {
- timeout = setTimeout(later, wait);
- }
- return result;
- };
- }
-
- /**
- * Manual indexOf because it's slightly faster than
- * native.
- *
- * @param {Array} arr
- * @param {*} obj
- */
-
- function indexOf(arr, obj) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === obj) return i;
- }
- return -1;
- }
-
- /**
- * Make a cancellable version of an async callback.
- *
- * @param {Function} fn
- * @return {Function}
- */
-
- function cancellable(fn) {
- var cb = function cb() {
- if (!cb.cancelled) {
- return fn.apply(this, arguments);
- }
- };
- cb.cancel = function () {
- cb.cancelled = true;
- };
- return cb;
- }
-
- /**
- * Check if two values are loosely equal - that is,
- * if they are plain objects, do they have the same shape?
- *
- * @param {*} a
- * @param {*} b
- * @return {Boolean}
- */
-
- function looseEqual(a, b) {
- /* eslint-disable eqeqeq */
- return a == b || (isObject(a) && isObject(b) ? JSON.stringify(a) === JSON.stringify(b) : false);
- /* eslint-enable eqeqeq */
- }
-
- var hasProto = ('__proto__' in {});
-
- // Browser environment sniffing
- var inBrowser = typeof window !== 'undefined' && Object.prototype.toString.call(window) !== '[object Object]';
-
- // detect devtools
- var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
-
- // UA sniffing for working around browser-specific quirks
- var UA = inBrowser && window.navigator.userAgent.toLowerCase();
- var isIE = UA && UA.indexOf('trident') > 0;
- var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
- var isAndroid = UA && UA.indexOf('android') > 0;
- var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
-
- var transitionProp = undefined;
- var transitionEndEvent = undefined;
- var animationProp = undefined;
- var animationEndEvent = undefined;
-
- // Transition property/event sniffing
- if (inBrowser && !isIE9) {
- var isWebkitTrans = window.ontransitionend === undefined && window.onwebkittransitionend !== undefined;
- var isWebkitAnim = window.onanimationend === undefined && window.onwebkitanimationend !== undefined;
- transitionProp = isWebkitTrans ? 'WebkitTransition' : 'transition';
- transitionEndEvent = isWebkitTrans ? 'webkitTransitionEnd' : 'transitionend';
- animationProp = isWebkitAnim ? 'WebkitAnimation' : 'animation';
- animationEndEvent = isWebkitAnim ? 'webkitAnimationEnd' : 'animationend';
- }
-
- /* istanbul ignore next */
- function isNative(Ctor) {
- return (/native code/.test(Ctor.toString())
- );
- }
-
- /**
- * Defer a task to execute it asynchronously. Ideally this
- * should be executed as a microtask, so we leverage
- * MutationObserver if it's available, and fallback to
- * setTimeout(0).
- *
- * @param {Function} cb
- * @param {Object} ctx
- */
-
- var nextTick = (function () {
- var callbacks = [];
- var pending = false;
- var timerFunc = undefined;
-
- function nextTickHandler() {
- pending = false;
- var copies = callbacks.slice(0);
- callbacks.length = 0;
- for (var i = 0; i < copies.length; i++) {
- copies[i]();
- }
- }
-
- // the nextTick behavior leverages the microtask queue, which can be accessed
- // via either native Promise.then or MutationObserver.
- // MutationObserver has wider support, however it is seriously bugged in
- // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
- // completely stops working after triggering a few times... so, if native
- // Promise is available, we will use it:
- /* istanbul ignore if */
- if (typeof Promise !== 'undefined' && isNative(Promise)) {
- var p = Promise.resolve();
- var noop = function noop() {};
- timerFunc = function () {
- p.then(nextTickHandler);
- // in problematic UIWebViews, Promise.then doesn't completely break, but
- // it can get stuck in a weird state where callbacks are pushed into the
- // microtask queue but the queue isn't being flushed, until the browser
- // needs to do some other work, e.g. handle a timer. Therefore we can
- // "force" the microtask queue to be flushed by adding an empty timer.
- if (isIOS) setTimeout(noop);
- };
- } else if (typeof MutationObserver !== 'undefined') {
- // use MutationObserver where native Promise is not available,
- // e.g. IE11, iOS7, Android 4.4
- var counter = 1;
- var observer = new MutationObserver(nextTickHandler);
- var textNode = document.createTextNode(String(counter));
- observer.observe(textNode, {
- characterData: true
- });
- timerFunc = function () {
- counter = (counter + 1) % 2;
- textNode.data = String(counter);
- };
- } else {
- // fallback to setTimeout
- /* istanbul ignore next */
- timerFunc = setTimeout;
- }
-
- return function (cb, ctx) {
- var func = ctx ? function () {
- cb.call(ctx);
- } : cb;
- callbacks.push(func);
- if (pending) return;
- pending = true;
- timerFunc(nextTickHandler, 0);
- };
- })();
-
- var _Set = undefined;
- /* istanbul ignore if */
- if (typeof Set !== 'undefined' && isNative(Set)) {
- // use native Set when available.
- _Set = Set;
- } else {
- // a non-standard Set polyfill that only works with primitive keys.
- _Set = function () {
- this.set = Object.create(null);
- };
- _Set.prototype.has = function (key) {
- return this.set[key] !== undefined;
- };
- _Set.prototype.add = function (key) {
- this.set[key] = 1;
- };
- _Set.prototype.clear = function () {
- this.set = Object.create(null);
- };
- }
-
- function Cache(limit) {
- this.size = 0;
- this.limit = limit;
- this.head = this.tail = undefined;
- this._keymap = Object.create(null);
- }
-
- var p = Cache.prototype;
-
- /**
- * Put <value> into the cache associated with <key>.
- * Returns the entry which was removed to make room for
- * the new entry. Otherwise undefined is returned.
- * (i.e. if there was enough room already).
- *
- * @param {String} key
- * @param {*} value
- * @return {Entry|undefined}
- */
-
- p.put = function (key, value) {
- var removed;
-
- var entry = this.get(key, true);
- if (!entry) {
- if (this.size === this.limit) {
- removed = this.shift();
- }
- entry = {
- key: key
- };
- this._keymap[key] = entry;
- if (this.tail) {
- this.tail.newer = entry;
- entry.older = this.tail;
- } else {
- this.head = entry;
- }
- this.tail = entry;
- this.size++;
- }
- entry.value = value;
-
- return removed;
- };
-
- /**
- * Purge the least recently used (oldest) entry from the
- * cache. Returns the removed entry or undefined if the
- * cache was empty.
- */
-
- p.shift = function () {
- var entry = this.head;
- if (entry) {
- this.head = this.head.newer;
- this.head.older = undefined;
- entry.newer = entry.older = undefined;
- this._keymap[entry.key] = undefined;
- this.size--;
- }
- return entry;
- };
-
- /**
- * Get and register recent use of <key>. Returns the value
- * associated with <key> or undefined if not in cache.
- *
- * @param {String} key
- * @param {Boolean} returnEntry
- * @return {Entry|*}
- */
-
- p.get = function (key, returnEntry) {
- var entry = this._keymap[key];
- if (entry === undefined) return;
- if (entry === this.tail) {
- return returnEntry ? entry : entry.value;
- }
- // HEAD--------------TAIL
- // <.older .newer>
- // <--- add direction --
- // A B C <D> E
- if (entry.newer) {
- if (entry === this.head) {
- this.head = entry.newer;
- }
- entry.newer.older = entry.older; // C <-- E.
- }
- if (entry.older) {
- entry.older.newer = entry.newer; // C. --> E
- }
- entry.newer = undefined; // D --x
- entry.older = this.tail; // D. --> E
- if (this.tail) {
- this.tail.newer = entry; // E. <-- D
- }
- this.tail = entry;
- return returnEntry ? entry : entry.value;
- };
-
- var cache$1 = new Cache(1000);
- var reservedArgRE = /^in$|^-?\d+/;
-
- /**
- * Parser state
- */
-
- var str;
- var dir;
- var len;
- var index;
- var chr;
- var state;
- var startState = 0;
- var filterState = 1;
- var filterNameState = 2;
- var filterArgState = 3;
-
- var doubleChr = 0x22;
- var singleChr = 0x27;
- var pipeChr = 0x7C;
- var escapeChr = 0x5C;
- var spaceChr = 0x20;
-
- var expStartChr = { 0x5B: 1, 0x7B: 1, 0x28: 1 };
- var expChrPair = { 0x5B: 0x5D, 0x7B: 0x7D, 0x28: 0x29 };
-
- function peek() {
- return str.charCodeAt(index + 1);
- }
-
- function next() {
- return str.charCodeAt(++index);
- }
-
- function eof() {
- return index >= len;
- }
-
- function eatSpace() {
- while (peek() === spaceChr) {
- next();
- }
- }
-
- function isStringStart(chr) {
- return chr === doubleChr || chr === singleChr;
- }
-
- function isExpStart(chr) {
- return expStartChr[chr];
- }
-
- function isExpEnd(start, chr) {
- return expChrPair[start] === chr;
- }
-
- function parseString() {
- var stringQuote = next();
- var chr;
- while (!eof()) {
- chr = next();
- // escape char
- if (chr === escapeChr) {
- next();
- } else if (chr === stringQuote) {
- break;
- }
- }
- }
-
- function parseSpecialExp(chr) {
- var inExp = 0;
- var startChr = chr;
-
- while (!eof()) {
- chr = peek();
- if (isStringStart(chr)) {
- parseString();
- continue;
- }
-
- if (startChr === chr) {
- inExp++;
- }
- if (isExpEnd(startChr, chr)) {
- inExp--;
- }
-
- next();
-
- if (inExp === 0) {
- break;
- }
- }
- }
-
- /**
- * syntax:
- * expression | filterName [arg arg [| filterName arg arg]]
- */
-
- function parseExpression() {
- var start = index;
- while (!eof()) {
- chr = peek();
- if (isStringStart(chr)) {
- parseString();
- } else if (isExpStart(chr)) {
- parseSpecialExp(chr);
- } else if (chr === pipeChr) {
- next();
- chr = peek();
- if (chr === pipeChr) {
- next();
- } else {
- if (state === startState || state === filterArgState) {
- state = filterState;
- }
- break;
- }
- } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {
- eatSpace();
- break;
- } else {
- if (state === filterState) {
- state = filterNameState;
- }
- next();
- }
- }
-
- return str.slice(start + 1, index) || null;
- }
-
- function parseFilterList() {
- var filters = [];
- while (!eof()) {
- filters.push(parseFilter());
- }
- return filters;
- }
-
- function parseFilter() {
- var filter = {};
- var args;
-
- state = filterState;
- filter.name = parseExpression().trim();
-
- state = filterArgState;
- args = parseFilterArguments();
-
- if (args.length) {
- filter.args = args;
- }
- return filter;
- }
-
- function parseFilterArguments() {
- var args = [];
- while (!eof() && state !== filterState) {
- var arg = parseExpression();
- if (!arg) {
- break;
- }
- args.push(processFilterArg(arg));
- }
-
- return args;
- }
-
- /**
- * Check if an argument is dynamic and strip quotes.
- *
- * @param {String} arg
- * @return {Object}
- */
-
- function processFilterArg(arg) {
- if (reservedArgRE.test(arg)) {
- return {
- value: toNumber(arg),
- dynamic: false
- };
- } else {
- var stripped = stripQuotes(arg);
- var dynamic = stripped === arg;
- return {
- value: dynamic ? arg : stripped,
- dynamic: dynamic
- };
- }
- }
-
- /**
- * Parse a directive value and extract the expression
- * and its filters into a descriptor.
- *
- * Example:
- *
- * "a + 1 | uppercase" will yield:
- * {
- * expression: 'a + 1',
- * filters: [
- * { name: 'uppercase', args: null }
- * ]
- * }
- *
- * @param {String} s
- * @return {Object}
- */
-
- function parseDirective(s) {
- var hit = cache$1.get(s);
- if (hit) {
- return hit;
- }
-
- // reset parser state
- str = s;
- dir = {};
- len = str.length;
- index = -1;
- chr = '';
- state = startState;
-
- var filters;
-
- if (str.indexOf('|') < 0) {
- dir.expression = str.trim();
- } else {
- dir.expression = parseExpression().trim();
- filters = parseFilterList();
- if (filters.length) {
- dir.filters = filters;
- }
- }
-
- cache$1.put(s, dir);
- return dir;
- }
-
- var directive = Object.freeze({
- parseDirective: parseDirective
- });
-
- var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
- var cache = undefined;
- var tagRE = undefined;
- var htmlRE = undefined;
- /**
- * Escape a string so it can be used in a RegExp
- * constructor.
- *
- * @param {String} str
- */
-
- function escapeRegex(str) {
- return str.replace(regexEscapeRE, '\\$&');
- }
-
- function compileRegex() {
- var open = escapeRegex(config.delimiters[0]);
- var close = escapeRegex(config.delimiters[1]);
- var unsafeOpen = escapeRegex(config.unsafeDelimiters[0]);
- var unsafeClose = escapeRegex(config.unsafeDelimiters[1]);
- tagRE = new RegExp(unsafeOpen + '((?:.|\\n)+?)' + unsafeClose + '|' + open + '((?:.|\\n)+?)' + close, 'g');
- htmlRE = new RegExp('^' + unsafeOpen + '((?:.|\\n)+?)' + unsafeClose + '$');
- // reset cache
- cache = new Cache(1000);
- }
-
- /**
- * Parse a template text string into an array of tokens.
- *
- * @param {String} text
- * @return {Array<Object> | null}
- * - {String} type
- * - {String} value
- * - {Boolean} [html]
- * - {Boolean} [oneTime]
- */
-
- function parseText(text) {
- if (!cache) {
- compileRegex();
- }
- var hit = cache.get(text);
- if (hit) {
- return hit;
- }
- if (!tagRE.test(text)) {
- return null;
- }
- var tokens = [];
- var lastIndex = tagRE.lastIndex = 0;
- var match, index, html, value, first, oneTime;
- /* eslint-disable no-cond-assign */
- while (match = tagRE.exec(text)) {
- /* eslint-enable no-cond-assign */
- index = match.index;
- // push text token
- if (index > lastIndex) {
- tokens.push({
- value: text.slice(lastIndex, index)
- });
- }
- // tag token
- html = htmlRE.test(match[0]);
- value = html ? match[1] : match[2];
- first = value.charCodeAt(0);
- oneTime = first === 42; // *
- value = oneTime ? value.slice(1) : value;
- tokens.push({
- tag: true,
- value: value.trim(),
- html: html,
- oneTime: oneTime
- });
- lastIndex = index + match[0].length;
- }
- if (lastIndex < text.length) {
- tokens.push({
- value: text.slice(lastIndex)
- });
- }
- cache.put(text, tokens);
- return tokens;
- }
-
- /**
- * Format a list of tokens into an expression.
- * e.g. tokens parsed from 'a {{b}} c' can be serialized
- * into one single expression as '"a " + b + " c"'.
- *
- * @param {Array} tokens
- * @param {Vue} [vm]
- * @return {String}
- */
-
- function tokensToExp(tokens, vm) {
- if (tokens.length > 1) {
- return tokens.map(function (token) {
- return formatToken(token, vm);
- }).join('+');
- } else {
- return formatToken(tokens[0], vm, true);
- }
- }
-
- /**
- * Format a single token.
- *
- * @param {Object} token
- * @param {Vue} [vm]
- * @param {Boolean} [single]
- * @return {String}
- */
-
- function formatToken(token, vm, single) {
- return token.tag ? token.oneTime && vm ? '"' + vm.$eval(token.value) + '"' : inlineFilters(token.value, single) : '"' + token.value + '"';
- }
-
- /**
- * For an attribute with multiple interpolation tags,
- * e.g. attr="some-{{thing | filter}}", in order to combine
- * the whole thing into a single watchable expression, we
- * have to inline those filters. This function does exactly
- * that. This is a bit hacky but it avoids heavy changes
- * to directive parser and watcher mechanism.
- *
- * @param {String} exp
- * @param {Boolean} single
- * @return {String}
- */
-
- var filterRE = /[^|]\|[^|]/;
- function inlineFilters(exp, single) {
- if (!filterRE.test(exp)) {
- return single ? exp : '(' + exp + ')';
- } else {
- var dir = parseDirective(exp);
- if (!dir.filters) {
- return '(' + exp + ')';
- } else {
- return 'this._applyFilters(' + dir.expression + // value
- ',null,' + // oldValue (null for read)
- JSON.stringify(dir.filters) + // filter descriptors
- ',false)'; // write?
- }
- }
- }
-
- var text = Object.freeze({
- compileRegex: compileRegex,
- parseText: parseText,
- tokensToExp: tokensToExp
- });
-
- var delimiters = ['{{', '}}'];
- var unsafeDelimiters = ['{{{', '}}}'];
-
- var config = Object.defineProperties({
-
- /**
- * Whether to print debug messages.
- * Also enables stack trace for warnings.
- *
- * @type {Boolean}
- */
-
- debug: false,
-
- /**
- * Whether to suppress warnings.
- *
- * @type {Boolean}
- */
-
- silent: false,
-
- /**
- * Whether to use async rendering.
- */
-
- async: true,
-
- /**
- * Whether to warn against errors caught when evaluating
- * expressions.
- */
-
- warnExpressionErrors: true,
-
- /**
- * Whether to allow devtools inspection.
- * Disabled by default in production builds.
- */
-
- devtools: process.env.NODE_ENV !== 'production',
-
- /**
- * Internal flag to indicate the delimiters have been
- * changed.
- *
- * @type {Boolean}
- */
-
- _delimitersChanged: true,
-
- /**
- * List of asset types that a component can own.
- *
- * @type {Array}
- */
-
- _assetTypes: ['component', 'directive', 'elementDirective', 'filter', 'transition', 'partial'],
-
- /**
- * prop binding modes
- */
-
- _propBindingModes: {
- ONE_WAY: 0,
- TWO_WAY: 1,
- ONE_TIME: 2
- },
-
- /**
- * Max circular updates allowed in a batcher flush cycle.
- */
-
- _maxUpdateCount: 100
-
- }, {
- delimiters: { /**
- * Interpolation delimiters. Changing these would trigger
- * the text parser to re-compile the regular expressions.
- *
- * @type {Array<String>}
- */
-
- get: function get() {
- return delimiters;
- },
- set: function set(val) {
- delimiters = val;
- compileRegex();
- },
- configurable: true,
- enumerable: true
- },
- unsafeDelimiters: {
- get: function get() {
- return unsafeDelimiters;
- },
- set: function set(val) {
- unsafeDelimiters = val;
- compileRegex();
- },
- configurable: true,
- enumerable: true
- }
- });
-
- var warn = undefined;
- var formatComponentName = undefined;
-
- if (process.env.NODE_ENV !== 'production') {
- (function () {
- var hasConsole = typeof console !== 'undefined';
-
- warn = function (msg, vm) {
- if (hasConsole && !config.silent) {
- console.error('[Vue warn]: ' + msg + (vm ? formatComponentName(vm) : ''));
- }
- };
-
- formatComponentName = function (vm) {
- var name = vm._isVue ? vm.$options.name : vm.name;
- return name ? ' (found in component: <' + hyphenate(name) + '>)' : '';
- };
- })();
- }
-
- /**
- * Append with transition.
- *
- * @param {Element} el
- * @param {Element} target
- * @param {Vue} vm
- * @param {Function} [cb]
- */
-
- function appendWithTransition(el, target, vm, cb) {
- applyTransition(el, 1, function () {
- target.appendChild(el);
- }, vm, cb);
- }
-
- /**
- * InsertBefore with transition.
- *
- * @param {Element} el
- * @param {Element} target
- * @param {Vue} vm
- * @param {Function} [cb]
- */
-
- function beforeWithTransition(el, target, vm, cb) {
- applyTransition(el, 1, function () {
- before(el, target);
- }, vm, cb);
- }
-
- /**
- * Remove with transition.
- *
- * @param {Element} el
- * @param {Vue} vm
- * @param {Function} [cb]
- */
-
- function removeWithTransition(el, vm, cb) {
- applyTransition(el, -1, function () {
- remove(el);
- }, vm, cb);
- }
-
- /**
- * Apply transitions with an operation callback.
- *
- * @param {Element} el
- * @param {Number} direction
- * 1: enter
- * -1: leave
- * @param {Function} op - the actual DOM operation
- * @param {Vue} vm
- * @param {Function} [cb]
- */
-
- function applyTransition(el, direction, op, vm, cb) {
- var transition = el.__v_trans;
- if (!transition ||
- // skip if there are no js hooks and CSS transition is
- // not supported
- !transition.hooks && !transitionEndEvent ||
- // skip transitions for initial compile
- !vm._isCompiled ||
- // if the vm is being manipulated by a parent directive
- // during the parent's compilation phase, skip the
- // animation.
- vm.$parent && !vm.$parent._isCompiled) {
- op();
- if (cb) cb();
- return;
- }
- var action = direction > 0 ? 'enter' : 'leave';
- transition[action](op, cb);
- }
-
- var transition = Object.freeze({
- appendWithTransition: appendWithTransition,
- beforeWithTransition: beforeWithTransition,
- removeWithTransition: removeWithTransition,
- applyTransition: applyTransition
- });
-
- /**
- * Query an element selector if it's not an element already.
- *
- * @param {String|Element} el
- * @return {Element}
- */
-
- function query(el) {
- if (typeof el === 'string') {
- var selector = el;
- el = document.querySelector(el);
- if (!el) {
- process.env.NODE_ENV !== 'production' && warn('Cannot find element: ' + selector);
- }
- }
- return el;
- }
-
- /**
- * Check if a node is in the document.
- * Note: document.documentElement.contains should work here
- * but always returns false for comment nodes in phantomjs,
- * making unit tests difficult. This is fixed by doing the
- * contains() check on the node's parentNode instead of
- * the node itself.
- *
- * @param {Node} node
- * @return {Boolean}
- */
-
- function inDoc(node) {
- if (!node) return false;
- var doc = node.ownerDocument.documentElement;
- var parent = node.parentNode;
- return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent));
- }
-
- /**
- * Get and remove an attribute from a node.
- *
- * @param {Node} node
- * @param {String} _attr
- */
-
- function getAttr(node, _attr) {
- var val = node.getAttribute(_attr);
- if (val !== null) {
- node.removeAttribute(_attr);
- }
- return val;
- }
-
- /**
- * Get an attribute with colon or v-bind: prefix.
- *
- * @param {Node} node
- * @param {String} name
- * @return {String|null}
- */
-
- function getBindAttr(node, name) {
- var val = getAttr(node, ':' + name);
- if (val === null) {
- val = getAttr(node, 'v-bind:' + name);
- }
- return val;
- }
-
- /**
- * Check the presence of a bind attribute.
- *
- * @param {Node} node
- * @param {String} name
- * @return {Boolean}
- */
-
- function hasBindAttr(node, name) {
- return node.hasAttribute(name) || node.hasAttribute(':' + name) || node.hasAttribute('v-bind:' + name);
- }
-
- /**
- * Insert el before target
- *
- * @param {Element} el
- * @param {Element} target
- */
-
- function before(el, target) {
- target.parentNode.insertBefore(el, target);
- }
-
- /**
- * Insert el after target
- *
- * @param {Element} el
- * @param {Element} target
- */
-
- function after(el, target) {
- if (target.nextSibling) {
- before(el, target.nextSibling);
- } else {
- target.parentNode.appendChild(el);
- }
- }
-
- /**
- * Remove el from DOM
- *
- * @param {Element} el
- */
-
- function remove(el) {
- el.parentNode.removeChild(el);
- }
-
- /**
- * Prepend el to target
- *
- * @param {Element} el
- * @param {Element} target
- */
-
- function prepend(el, target) {
- if (target.firstChild) {
- before(el, target.firstChild);
- } else {
- target.appendChild(el);
- }
- }
-
- /**
- * Replace target with el
- *
- * @param {Element} target
- * @param {Element} el
- */
-
- function replace(target, el) {
- var parent = target.parentNode;
- if (parent) {
- parent.replaceChild(el, target);
- }
- }
-
- /**
- * Add event listener shorthand.
- *
- * @param {Element} el
- * @param {String} event
- * @param {Function} cb
- * @param {Boolean} [useCapture]
- */
-
- function on(el, event, cb, useCapture) {
- el.addEventListener(event, cb, useCapture);
- }
-
- /**
- * Remove event listener shorthand.
- *
- * @param {Element} el
- * @param {String} event
- * @param {Function} cb
- */
-
- function off(el, event, cb) {
- el.removeEventListener(event, cb);
- }
-
- /**
- * For IE9 compat: when both class and :class are present
- * getAttribute('class') returns wrong value...
- *
- * @param {Element} el
- * @return {String}
- */
-
- function getClass(el) {
- var classname = el.className;
- if (typeof classname === 'object') {
- classname = classname.baseVal || '';
- }
- return classname;
- }
-
- /**
- * In IE9, setAttribute('class') will result in empty class
- * if the element also has the :class attribute; However in
- * PhantomJS, setting `className` does not work on SVG elements...
- * So we have to do a conditional check here.
- *
- * @param {Element} el
- * @param {String} cls
- */
-
- function setClass(el, cls) {
- /* istanbul ignore if */
- if (isIE9 && !/svg$/.test(el.namespaceURI)) {
- el.className = cls;
- } else {
- el.setAttribute('class', cls);
- }
- }
-
- /**
- * Add class with compatibility for IE & SVG
- *
- * @param {Element} el
- * @param {String} cls
- */
-
- function addClass(el, cls) {
- if (el.classList) {
- el.classList.add(cls);
- } else {
- var cur = ' ' + getClass(el) + ' ';
- if (cur.indexOf(' ' + cls + ' ') < 0) {
- setClass(el, (cur + cls).trim());
- }
- }
- }
-
- /**
- * Remove class with compatibility for IE & SVG
- *
- * @param {Element} el
- * @param {String} cls
- */
-
- function removeClass(el, cls) {
- if (el.classList) {
- el.classList.remove(cls);
- } else {
- var cur = ' ' + getClass(el) + ' ';
- var tar = ' ' + cls + ' ';
- while (cur.indexOf(tar) >= 0) {
- cur = cur.replace(tar, ' ');
- }
- setClass(el, cur.trim());
- }
- if (!el.className) {
- el.removeAttribute('class');
- }
- }
-
- /**
- * Extract raw content inside an element into a temporary
- * container div
- *
- * @param {Element} el
- * @param {Boolean} asFragment
- * @return {Element|DocumentFragment}
- */
-
- function extractContent(el, asFragment) {
- var child;
- var rawContent;
- /* istanbul ignore if */
- if (isTemplate(el) && isFragment(el.content)) {
- el = el.content;
- }
- if (el.hasChildNodes()) {
- trimNode(el);
- rawContent = asFragment ? document.createDocumentFragment() : document.createElement('div');
- /* eslint-disable no-cond-assign */
- while (child = el.firstChild) {
- /* eslint-enable no-cond-assign */
- rawContent.appendChild(child);
- }
- }
- return rawContent;
- }
-
- /**
- * Trim possible empty head/tail text and comment
- * nodes inside a parent.
- *
- * @param {Node} node
- */
-
- function trimNode(node) {
- var child;
- /* eslint-disable no-sequences */
- while ((child = node.firstChild, isTrimmable(child))) {
- node.removeChild(child);
- }
- while ((child = node.lastChild, isTrimmable(child))) {
- node.removeChild(child);
- }
- /* eslint-enable no-sequences */
- }
-
- function isTrimmable(node) {
- return node && (node.nodeType === 3 && !node.data.trim() || node.nodeType === 8);
- }
-
- /**
- * Check if an element is a template tag.
- * Note if the template appears inside an SVG its tagName
- * will be in lowercase.
- *
- * @param {Element} el
- */
-
- function isTemplate(el) {
- return el.tagName && el.tagName.toLowerCase() === 'template';
- }
-
- /**
- * Create an "anchor" for performing dom insertion/removals.
- * This is used in a number of scenarios:
- * - fragment instance
- * - v-html
- * - v-if
- * - v-for
- * - component
- *
- * @param {String} content
- * @param {Boolean} persist - IE trashes empty textNodes on
- * cloneNode(true), so in certain
- * cases the anchor needs to be
- * non-empty to be persisted in
- * templates.
- * @return {Comment|Text}
- */
-
- function createAnchor(content, persist) {
- var anchor = config.debug ? document.createComment(content) : document.createTextNode(persist ? ' ' : '');
- anchor.__v_anchor = true;
- return anchor;
- }
-
- /**
- * Find a component ref attribute that starts with $.
- *
- * @param {Element} node
- * @return {String|undefined}
- */
-
- var refRE = /^v-ref:/;
-
- function findRef(node) {
- if (node.hasAttributes()) {
- var attrs = node.attributes;
- for (var i = 0, l = attrs.length; i < l; i++) {
- var name = attrs[i].name;
- if (refRE.test(name)) {
- return camelize(name.replace(refRE, ''));
- }
- }
- }
- }
-
- /**
- * Map a function to a range of nodes .
- *
- * @param {Node} node
- * @param {Node} end
- * @param {Function} op
- */
-
- function mapNodeRange(node, end, op) {
- var next;
- while (node !== end) {
- next = node.nextSibling;
- op(node);
- node = next;
- }
- op(end);
- }
-
- /**
- * Remove a range of nodes with transition, store
- * the nodes in a fragment with correct ordering,
- * and call callback when done.
- *
- * @param {Node} start
- * @param {Node} end
- * @param {Vue} vm
- * @param {DocumentFragment} frag
- * @param {Function} cb
- */
-
- function removeNodeRange(start, end, vm, frag, cb) {
- var done = false;
- var removed = 0;
- var nodes = [];
- mapNodeRange(start, end, function (node) {
- if (node === end) done = true;
- nodes.push(node);
- removeWithTransition(node, vm, onRemoved);
- });
- function onRemoved() {
- removed++;
- if (done && removed >= nodes.length) {
- for (var i = 0; i < nodes.length; i++) {
- frag.appendChild(nodes[i]);
- }
- cb && cb();
- }
- }
- }
-
- /**
- * Check if a node is a DocumentFragment.
- *
- * @param {Node} node
- * @return {Boolean}
- */
-
- function isFragment(node) {
- return node && node.nodeType === 11;
- }
-
- /**
- * Get outerHTML of elements, taking care
- * of SVG elements in IE as well.
- *
- * @param {Element} el
- * @return {String}
- */
-
- function getOuterHTML(el) {
- if (el.outerHTML) {
- return el.outerHTML;
- } else {
- var container = document.createElement('div');
- container.appendChild(el.cloneNode(true));
- return container.innerHTML;
- }
- }
-
- var commonTagRE = /^(div|p|span|img|a|b|i|br|ul|ol|li|h1|h2|h3|h4|h5|h6|code|pre|table|th|td|tr|form|label|input|select|option|nav|article|section|header|footer)$/i;
- var reservedTagRE = /^(slot|partial|component)$/i;
-
- var isUnknownElement = undefined;
- if (process.env.NODE_ENV !== 'production') {
- isUnknownElement = function (el, tag) {
- if (tag.indexOf('-') > -1) {
- // http://stackoverflow.com/a/28210364/1070244
- return el.constructor === window.HTMLUnknownElement || el.constructor === window.HTMLElement;
- } else {
- return (/HTMLUnknownElement/.test(el.toString()) &&
- // Chrome returns unknown for several HTML5 elements.
- // https://code.google.com/p/chromium/issues/detail?id=540526
- // Firefox returns unknown for some "Interactive elements."
- !/^(data|time|rtc|rb|details|dialog|summary)$/.test(tag)
- );
- }
- };
- }
-
- /**
- * Check if an element is a component, if yes return its
- * component id.
- *
- * @param {Element} el
- * @param {Object} options
- * @return {Object|undefined}
- */
-
- function checkComponentAttr(el, options) {
- var tag = el.tagName.toLowerCase();
- var hasAttrs = el.hasAttributes();
- if (!commonTagRE.test(tag) && !reservedTagRE.test(tag)) {
- if (resolveAsset(options, 'components', tag)) {
- return { id: tag };
- } else {
- var is = hasAttrs && getIsBinding(el, options);
- if (is) {
- return is;
- } else if (process.env.NODE_ENV !== 'production') {
- var expectedTag = options._componentNameMap && options._componentNameMap[tag];
- if (expectedTag) {
- warn('Unknown custom element: <' + tag + '> - ' + 'did you mean <' + expectedTag + '>? ' + 'HTML is case-insensitive, remember to use kebab-case in templates.');
- } else if (isUnknownElement(el, tag)) {
- warn('Unknown custom element: <' + tag + '> - did you ' + 'register the component correctly? For recursive components, ' + 'make sure to provide the "name" option.');
- }
- }
- }
- } else if (hasAttrs) {
- return getIsBinding(el, options);
- }
- }
-
- /**
- * Get "is" binding from an element.
- *
- * @param {Element} el
- * @param {Object} options
- * @return {Object|undefined}
- */
-
- function getIsBinding(el, options) {
- // dynamic syntax
- var exp = el.getAttribute('is');
- if (exp != null) {
- if (resolveAsset(options, 'components', exp)) {
- el.removeAttribute('is');
- return { id: exp };
- }
- } else {
- exp = getBindAttr(el, 'is');
- if (exp != null) {
- return { id: exp, dynamic: true };
- }
- }
- }
-
- /**
- * Option overwriting strategies are functions that handle
- * how to merge a parent option value and a child option
- * value into the final value.
- *
- * All strategy functions follow the same signature:
- *
- * @param {*} parentVal
- * @param {*} childVal
- * @param {Vue} [vm]
- */
-
- var strats = config.optionMergeStrategies = Object.create(null);
-
- /**
- * Helper that recursively merges two data objects together.
- */
-
- function mergeData(to, from) {
- var key, toVal, fromVal;
- for (key in from) {
- toVal = to[key];
- fromVal = from[key];
- if (!hasOwn(to, key)) {
- set(to, key, fromVal);
- } else if (isObject(toVal) && isObject(fromVal)) {
- mergeData(toVal, fromVal);
- }
- }
- return to;
- }
-
- /**
- * Data
- */
-
- strats.data = function (parentVal, childVal, vm) {
- if (!vm) {
- // in a Vue.extend merge, both should be functions
- if (!childVal) {
- return parentVal;
- }
- if (typeof childVal !== 'function') {
- process.env.NODE_ENV !== 'production' && warn('The "data" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', vm);
- return parentVal;
- }
- if (!parentVal) {
- return childVal;
- }
- // when parentVal & childVal are both present,
- // we need to return a function that returns the
- // merged result of both functions... no need to
- // check if parentVal is a function here because
- // it has to be a function to pass previous merges.
- return function mergedDataFn() {
- return mergeData(childVal.call(this), parentVal.call(this));
- };
- } else if (parentVal || childVal) {
- return function mergedInstanceDataFn() {
- // instance merge
- var instanceData = typeof childVal === 'function' ? childVal.call(vm) : childVal;
- var defaultData = typeof parentVal === 'function' ? parentVal.call(vm) : undefined;
- if (instanceData) {
- return mergeData(instanceData, defaultData);
- } else {
- return defaultData;
- }
- };
- }
- };
-
- /**
- * El
- */
-
- strats.el = function (parentVal, childVal, vm) {
- if (!vm && childVal && typeof childVal !== 'function') {
- process.env.NODE_ENV !== 'production' && warn('The "el" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', vm);
- return;
- }
- var ret = childVal || parentVal;
- // invoke the element factory if this is instance merge
- return vm && typeof ret === 'function' ? ret.call(vm) : ret;
- };
-
- /**
- * Hooks and param attributes are merged as arrays.
- */
-
- strats.init = strats.created = strats.ready = strats.attached = strats.detached = strats.beforeCompile = strats.compiled = strats.beforeDestroy = strats.destroyed = strats.activate = function (parentVal, childVal) {
- return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;
- };
-
- /**
- * Assets
- *
- * When a vm is present (instance creation), we need to do
- * a three-way merge between constructor options, instance
- * options and parent options.
- */
-
- function mergeAssets(parentVal, childVal) {
- var res = Object.create(parentVal || null);
- return childVal ? extend(res, guardArrayAssets(childVal)) : res;
- }
-
- config._assetTypes.forEach(function (type) {
- strats[type + 's'] = mergeAssets;
- });
-
- /**
- * Events & Watchers.
- *
- * Events & watchers hashes should not overwrite one
- * another, so we merge them as arrays.
- */
-
- strats.watch = strats.events = function (parentVal, childVal) {
- if (!childVal) return parentVal;
- if (!parentVal) return childVal;
- var ret = {};
- extend(ret, parentVal);
- for (var key in childVal) {
- var parent = ret[key];
- var child = childVal[key];
- if (parent && !isArray(parent)) {
- parent = [parent];
- }
- ret[key] = parent ? parent.concat(child) : [child];
- }
- return ret;
- };
-
- /**
- * Other object hashes.
- */
-
- strats.props = strats.methods = strats.computed = function (parentVal, childVal) {
- if (!childVal) return parentVal;
- if (!parentVal) return childVal;
- var ret = Object.create(null);
- extend(ret, parentVal);
- extend(ret, childVal);
- return ret;
- };
-
- /**
- * Default strategy.
- */
-
- var defaultStrat = function defaultStrat(parentVal, childVal) {
- return childVal === undefined ? parentVal : childVal;
- };
-
- /**
- * Make sure component options get converted to actual
- * constructors.
- *
- * @param {Object} options
- */
-
- function guardComponents(options) {
- if (options.components) {
- var components = options.components = guardArrayAssets(options.components);
- var ids = Object.keys(components);
- var def;
- if (process.env.NODE_ENV !== 'production') {
- var map = options._componentNameMap = {};
- }
- for (var i = 0, l = ids.length; i < l; i++) {
- var key = ids[i];
- if (commonTagRE.test(key) || reservedTagRE.test(key)) {
- process.env.NODE_ENV !== 'production' && warn('Do not use built-in or reserved HTML elements as component ' + 'id: ' + key);
- continue;
- }
- // record a all lowercase <-> kebab-case mapping for
- // possible custom element case error warning
- if (process.env.NODE_ENV !== 'production') {
- map[key.replace(/-/g, '').toLowerCase()] = hyphenate(key);
- }
- def = components[key];
- if (isPlainObject(def)) {
- components[key] = Vue.extend(def);
- }
- }
- }
- }
-
- /**
- * Ensure all props option syntax are normalized into the
- * Object-based format.
- *
- * @param {Object} options
- */
-
- function guardProps(options) {
- var props = options.props;
- var i, val;
- if (isArray(props)) {
- options.props = {};
- i = props.length;
- while (i--) {
- val = props[i];
- if (typeof val === 'string') {
- options.props[val] = null;
- } else if (val.name) {
- options.props[val.name] = val;
- }
- }
- } else if (isPlainObject(props)) {
- var keys = Object.keys(props);
- i = keys.length;
- while (i--) {
- val = props[keys[i]];
- if (typeof val === 'function') {
- props[keys[i]] = { type: val };
- }
- }
- }
- }
-
- /**
- * Guard an Array-format assets option and converted it
- * into the key-value Object format.
- *
- * @param {Object|Array} assets
- * @return {Object}
- */
-
- function guardArrayAssets(assets) {
- if (isArray(assets)) {
- var res = {};
- var i = assets.length;
- var asset;
- while (i--) {
- asset = assets[i];
- var id = typeof asset === 'function' ? asset.options && asset.options.name || asset.id : asset.name || asset.id;
- if (!id) {
- process.env.NODE_ENV !== 'production' && warn('Array-syntax assets must provide a "name" or "id" field.');
- } else {
- res[id] = asset;
- }
- }
- return res;
- }
- return assets;
- }
-
- /**
- * Merge two option objects into a new one.
- * Core utility used in both instantiation and inheritance.
- *
- * @param {Object} parent
- * @param {Object} child
- * @param {Vue} [vm] - if vm is present, indicates this is
- * an instantiation merge.
- */
-
- function mergeOptions(parent, child, vm) {
- guardComponents(child);
- guardProps(child);
- if (process.env.NODE_ENV !== 'production') {
- if (child.propsData && !vm) {
- warn('propsData can only be used as an instantiation option.');
- }
- }
- var options = {};
- var key;
- if (child['extends']) {
- parent = typeof child['extends'] === 'function' ? mergeOptions(parent, child['extends'].options, vm) : mergeOptions(parent, child['extends'], vm);
- }
- if (child.mixins) {
- for (var i = 0, l = child.mixins.length; i < l; i++) {
- var mixin = child.mixins[i];
- var mixinOptions = mixin.prototype instanceof Vue ? mixin.options : mixin;
- parent = mergeOptions(parent, mixinOptions, vm);
- }
- }
- for (key in parent) {
- mergeField(key);
- }
- for (key in child) {
- if (!hasOwn(parent, key)) {
- mergeField(key);
- }
- }
- function mergeField(key) {
- var strat = strats[key] || defaultStrat;
- options[key] = strat(parent[key], child[key], vm, key);
- }
- return options;
- }
-
- /**
- * Resolve an asset.
- * This function is used because child instances need access
- * to assets defined in its ancestor chain.
- *
- * @param {Object} options
- * @param {String} type
- * @param {String} id
- * @param {Boolean} warnMissing
- * @return {Object|Function}
- */
-
- function resolveAsset(options, type, id, warnMissing) {
- /* istanbul ignore if */
- if (typeof id !== 'string') {
- return;
- }
- var assets = options[type];
- var camelizedId;
- var res = assets[id] ||
- // camelCase ID
- assets[camelizedId = camelize(id)] ||
- // Pascal Case ID
- assets[camelizedId.charAt(0).toUpperCase() + camelizedId.slice(1)];
- if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
- warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id, options);
- }
- return res;
- }
-
- var uid$1 = 0;
-
- /**
- * A dep is an observable that can have multiple
- * directives subscribing to it.
- *
- * @constructor
- */
- function Dep() {
- this.id = uid$1++;
- this.subs = [];
- }
-
- // the current target watcher being evaluated.
- // this is globally unique because there could be only one
- // watcher being evaluated at any time.
- Dep.target = null;
-
- /**
- * Add a directive subscriber.
- *
- * @param {Directive} sub
- */
-
- Dep.prototype.addSub = function (sub) {
- this.subs.push(sub);
- };
-
- /**
- * Remove a directive subscriber.
- *
- * @param {Directive} sub
- */
-
- Dep.prototype.removeSub = function (sub) {
- this.subs.$remove(sub);
- };
-
- /**
- * Add self as a dependency to the target watcher.
- */
-
- Dep.prototype.depend = function () {
- Dep.target.addDep(this);
- };
-
- /**
- * Notify all subscribers of a new value.
- */
-
- Dep.prototype.notify = function () {
- // stablize the subscriber list first
- var subs = toArray(this.subs);
- for (var i = 0, l = subs.length; i < l; i++) {
- subs[i].update();
- }
- };
-
- var arrayProto = Array.prototype;
- var arrayMethods = Object.create(arrayProto)
-
- /**
- * Intercept mutating methods and emit events
- */
-
- ;['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'].forEach(function (method) {
- // cache original method
- var original = arrayProto[method];
- def(arrayMethods, method, function mutator() {
- // avoid leaking arguments:
- // http://jsperf.com/closure-with-arguments
- var i = arguments.length;
- var args = new Array(i);
- while (i--) {
- args[i] = arguments[i];
- }
- var result = original.apply(this, args);
- var ob = this.__ob__;
- var inserted;
- switch (method) {
- case 'push':
- inserted = args;
- break;
- case 'unshift':
- inserted = args;
- break;
- case 'splice':
- inserted = args.slice(2);
- break;
- }
- if (inserted) ob.observeArray(inserted);
- // notify change
- ob.dep.notify();
- return result;
- });
- });
-
- /**
- * Swap the element at the given index with a new value
- * and emits corresponding event.
- *
- * @param {Number} index
- * @param {*} val
- * @return {*} - replaced element
- */
-
- def(arrayProto, '$set', function $set(index, val) {
- if (index >= this.length) {
- this.length = Number(index) + 1;
- }
- return this.splice(index, 1, val)[0];
- });
-
- /**
- * Convenience method to remove the element at given index or target element reference.
- *
- * @param {*} item
- */
-
- def(arrayProto, '$remove', function $remove(item) {
- /* istanbul ignore if */
- if (!this.length) return;
- var index = indexOf(this, item);
- if (index > -1) {
- return this.splice(index, 1);
- }
- });
-
- var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
-
- /**
- * By default, when a reactive property is set, the new value is
- * also converted to become reactive. However in certain cases, e.g.
- * v-for scope alias and props, we don't want to force conversion
- * because the value may be a nested value under a frozen data structure.
- *
- * So whenever we want to set a reactive property without forcing
- * conversion on the new value, we wrap that call inside this function.
- */
-
- var shouldConvert = true;
-
- function withoutConversion(fn) {
- shouldConvert = false;
- fn();
- shouldConvert = true;
- }
-
- /**
- * Observer class that are attached to each observed
- * object. Once attached, the observer converts target
- * object's property keys into getter/setters that
- * collect dependencies and dispatches updates.
- *
- * @param {Array|Object} value
- * @constructor
- */
-
- function Observer(value) {
- this.value = value;
- this.dep = new Dep();
- def(value, '__ob__', this);
- if (isArray(value)) {
- var augment = hasProto ? protoAugment : copyAugment;
- augment(value, arrayMethods, arrayKeys);
- this.observeArray(value);
- } else {
- this.walk(value);
- }
- }
-
- // Instance methods
-
- /**
- * Walk through each property and convert them into
- * getter/setters. This method should only be called when
- * value type is Object.
- *
- * @param {Object} obj
- */
-
- Observer.prototype.walk = function (obj) {
- var keys = Object.keys(obj);
- for (var i = 0, l = keys.length; i < l; i++) {
- this.convert(keys[i], obj[keys[i]]);
- }
- };
-
- /**
- * Observe a list of Array items.
- *
- * @param {Array} items
- */
-
- Observer.prototype.observeArray = function (items) {
- for (var i = 0, l = items.length; i < l; i++) {
- observe(items[i]);
- }
- };
-
- /**
- * Convert a property into getter/setter so we can emit
- * the events when the property is accessed/changed.
- *
- * @param {String} key
- * @param {*} val
- */
-
- Observer.prototype.convert = function (key, val) {
- defineReactive(this.value, key, val);
- };
-
- /**
- * Add an owner vm, so that when $set/$delete mutations
- * happen we can notify owner vms to proxy the keys and
- * digest the watchers. This is only called when the object
- * is observed as an instance's root $data.
- *
- * @param {Vue} vm
- */
-
- Observer.prototype.addVm = function (vm) {
- (this.vms || (this.vms = [])).push(vm);
- };
-
- /**
- * Remove an owner vm. This is called when the object is
- * swapped out as an instance's $data object.
- *
- * @param {Vue} vm
- */
-
- Observer.prototype.removeVm = function (vm) {
- this.vms.$remove(vm);
- };
-
- // helpers
-
- /**
- * Augment an target Object or Array by intercepting
- * the prototype chain using __proto__
- *
- * @param {Object|Array} target
- * @param {Object} src
- */
-
- function protoAugment(target, src) {
- /* eslint-disable no-proto */
- target.__proto__ = src;
- /* eslint-enable no-proto */
- }
-
- /**
- * Augment an target Object or Array by defining
- * hidden properties.
- *
- * @param {Object|Array} target
- * @param {Object} proto
- */
-
- function copyAugment(target, src, keys) {
- for (var i = 0, l = keys.length; i < l; i++) {
- var key = keys[i];
- def(target, key, src[key]);
- }
- }
-
- /**
- * Attempt to create an observer instance for a value,
- * returns the new observer if successfully observed,
- * or the existing observer if the value already has one.
- *
- * @param {*} value
- * @param {Vue} [vm]
- * @return {Observer|undefined}
- * @static
- */
-
- function observe(value, vm) {
- if (!value || typeof value !== 'object') {
- return;
- }
- var ob;
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
- ob = value.__ob__;
- } else if (shouldConvert && (isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {
- ob = new Observer(value);
- }
- if (ob && vm) {
- ob.addVm(vm);
- }
- return ob;
- }
-
- /**
- * Define a reactive property on an Object.
- *
- * @param {Object} obj
- * @param {String} key
- * @param {*} val
- */
-
- function defineReactive(obj, key, val) {
- var dep = new Dep();
-
- var property = Object.getOwnPropertyDescriptor(obj, key);
- if (property && property.configurable === false) {
- return;
- }
-
- // cater for pre-defined getter/setters
- var getter = property && property.get;
- var setter = property && property.set;
-
- var childOb = observe(val);
- Object.defineProperty(obj, key, {
- enumerable: true,
- configurable: true,
- get: function reactiveGetter() {
- var value = getter ? getter.call(obj) : val;
- if (Dep.target) {
- dep.depend();
- if (childOb) {
- childOb.dep.depend();
- }
- if (isArray(value)) {
- for (var e, i = 0, l = value.length; i < l; i++) {
- e = value[i];
- e && e.__ob__ && e.__ob__.dep.depend();
- }
- }
- }
- return value;
- },
- set: function reactiveSetter(newVal) {
- var value = getter ? getter.call(obj) : val;
- if (newVal === value) {
- return;
- }
- if (setter) {
- setter.call(obj, newVal);
- } else {
- val = newVal;
- }
- childOb = observe(newVal);
- dep.notify();
- }
- });
- }
-
-
-
- var util = Object.freeze({
- defineReactive: defineReactive,
- set: set,
- del: del,
- hasOwn: hasOwn,
- isLiteral: isLiteral,
- isReserved: isReserved,
- _toString: _toString,
- toNumber: toNumber,
- toBoolean: toBoolean,
- stripQuotes: stripQuotes,
- camelize: camelize,
- hyphenate: hyphenate,
- classify: classify,
- bind: bind,
- toArray: toArray,
- extend: extend,
- isObject: isObject,
- isPlainObject: isPlainObject,
- def: def,
- debounce: _debounce,
- indexOf: indexOf,
- cancellable: cancellable,
- looseEqual: looseEqual,
- isArray: isArray,
- hasProto: hasProto,
- inBrowser: inBrowser,
- devtools: devtools,
- isIE: isIE,
- isIE9: isIE9,
- isAndroid: isAndroid,
- isIOS: isIOS,
- get transitionProp () { return transitionProp; },
- get transitionEndEvent () { return transitionEndEvent; },
- get animationProp () { return animationProp; },
- get animationEndEvent () { return animationEndEvent; },
- nextTick: nextTick,
- get _Set () { return _Set; },
- query: query,
- inDoc: inDoc,
- getAttr: getAttr,
- getBindAttr: getBindAttr,
- hasBindAttr: hasBindAttr,
- before: before,
- after: after,
- remove: remove,
- prepend: prepend,
- replace: replace,
- on: on,
- off: off,
- setClass: setClass,
- addClass: addClass,
- removeClass: removeClass,
- extractContent: extractContent,
- trimNode: trimNode,
- isTemplate: isTemplate,
- createAnchor: createAnchor,
- findRef: findRef,
- mapNodeRange: mapNodeRange,
- removeNodeRange: removeNodeRange,
- isFragment: isFragment,
- getOuterHTML: getOuterHTML,
- mergeOptions: mergeOptions,
- resolveAsset: resolveAsset,
- checkComponentAttr: checkComponentAttr,
- commonTagRE: commonTagRE,
- reservedTagRE: reservedTagRE,
- get warn () { return warn; }
- });
-
- var uid = 0;
-
- function initMixin (Vue) {
- /**
- * The main init sequence. This is called for every
- * instance, including ones that are created from extended
- * constructors.
- *
- * @param {Object} options - this options object should be
- * the result of merging class
- * options and the options passed
- * in to the constructor.
- */
-
- Vue.prototype._init = function (options) {
- options = options || {};
-
- this.$el = null;
- this.$parent = options.parent;
- this.$root = this.$parent ? this.$parent.$root : this;
- this.$children = [];
- this.$refs = {}; // child vm references
- this.$els = {}; // element references
- this._watchers = []; // all watchers as an array
- this._directives = []; // all directives
-
- // a uid
- this._uid = uid++;
-
- // a flag to avoid this being observed
- this._isVue = true;
-
- // events bookkeeping
- this._events = {}; // registered callbacks
- this._eventsCount = {}; // for $broadcast optimization
-
- // fragment instance properties
- this._isFragment = false;
- this._fragment = // @type {DocumentFragment}
- this._fragmentStart = // @type {Text|Comment}
- this._fragmentEnd = null; // @type {Text|Comment}
-
- // lifecycle state
- this._isCompiled = this._isDestroyed = this._isReady = this._isAttached = this._isBeingDestroyed = this._vForRemoving = false;
- this._unlinkFn = null;
-
- // context:
- // if this is a transcluded component, context
- // will be the common parent vm of this instance
- // and its host.
- this._context = options._context || this.$parent;
-
- // scope:
- // if this is inside an inline v-for, the scope
- // will be the intermediate scope created for this
- // repeat fragment. this is used for linking props
- // and container directives.
- this._scope = options._scope;
-
- // fragment:
- // if this instance is compiled inside a Fragment, it
- // needs to register itself as a child of that fragment
- // for attach/detach to work properly.
- this._frag = options._frag;
- if (this._frag) {
- this._frag.children.push(this);
- }
-
- // push self into parent / transclusion host
- if (this.$parent) {
- this.$parent.$children.push(this);
- }
-
- // merge options.
- options = this.$options = mergeOptions(this.constructor.options, options, this);
-
- // set ref
- this._updateRef();
-
- // initialize data as empty object.
- // it will be filled up in _initData().
- this._data = {};
-
- // call init hook
- this._callHook('init');
-
- // initialize data observation and scope inheritance.
- this._initState();
-
- // setup event system and option events.
- this._initEvents();
-
- // call created hook
- this._callHook('created');
-
- // if `el` option is passed, start compilation.
- if (options.el) {
- this.$mount(options.el);
- }
- };
- }
-
- var pathCache = new Cache(1000);
-
- // actions
- var APPEND = 0;
- var PUSH = 1;
- var INC_SUB_PATH_DEPTH = 2;
- var PUSH_SUB_PATH = 3;
-
- // states
- var BEFORE_PATH = 0;
- var IN_PATH = 1;
- var BEFORE_IDENT = 2;
- var IN_IDENT = 3;
- var IN_SUB_PATH = 4;
- var IN_SINGLE_QUOTE = 5;
- var IN_DOUBLE_QUOTE = 6;
- var AFTER_PATH = 7;
- var ERROR = 8;
-
- var pathStateMachine = [];
-
- pathStateMachine[BEFORE_PATH] = {
- 'ws': [BEFORE_PATH],
- 'ident': [IN_IDENT, APPEND],
- '[': [IN_SUB_PATH],
- 'eof': [AFTER_PATH]
- };
-
- pathStateMachine[IN_PATH] = {
- 'ws': [IN_PATH],
- '.': [BEFORE_IDENT],
- '[': [IN_SUB_PATH],
- 'eof': [AFTER_PATH]
- };
-
- pathStateMachine[BEFORE_IDENT] = {
- 'ws': [BEFORE_IDENT],
- 'ident': [IN_IDENT, APPEND]
- };
-
- pathStateMachine[IN_IDENT] = {
- 'ident': [IN_IDENT, APPEND],
- '0': [IN_IDENT, APPEND],
- 'number': [IN_IDENT, APPEND],
- 'ws': [IN_PATH, PUSH],
- '.': [BEFORE_IDENT, PUSH],
- '[': [IN_SUB_PATH, PUSH],
- 'eof': [AFTER_PATH, PUSH]
- };
-
- pathStateMachine[IN_SUB_PATH] = {
- "'": [IN_SINGLE_QUOTE, APPEND],
- '"': [IN_DOUBLE_QUOTE, APPEND],
- '[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH],
- ']': [IN_PATH, PUSH_SUB_PATH],
- 'eof': ERROR,
- 'else': [IN_SUB_PATH, APPEND]
- };
-
- pathStateMachine[IN_SINGLE_QUOTE] = {
- "'": [IN_SUB_PATH, APPEND],
- 'eof': ERROR,
- 'else': [IN_SINGLE_QUOTE, APPEND]
- };
-
- pathStateMachine[IN_DOUBLE_QUOTE] = {
- '"': [IN_SUB_PATH, APPEND],
- 'eof': ERROR,
- 'else': [IN_DOUBLE_QUOTE, APPEND]
- };
-
- /**
- * Determine the type of a character in a keypath.
- *
- * @param {Char} ch
- * @return {String} type
- */
-
- function getPathCharType(ch) {
- if (ch === undefined) {
- return 'eof';
- }
-
- var code = ch.charCodeAt(0);
-
- switch (code) {
- case 0x5B: // [
- case 0x5D: // ]
- case 0x2E: // .
- case 0x22: // "
- case 0x27: // '
- case 0x30:
- // 0
- return ch;
-
- case 0x5F: // _
- case 0x24:
- // $
- return 'ident';
-
- case 0x20: // Space
- case 0x09: // Tab
- case 0x0A: // Newline
- case 0x0D: // Return
- case 0xA0: // No-break space
- case 0xFEFF: // Byte Order Mark
- case 0x2028: // Line Separator
- case 0x2029:
- // Paragraph Separator
- return 'ws';
- }
-
- // a-z, A-Z
- if (code >= 0x61 && code <= 0x7A || code >= 0x41 && code <= 0x5A) {
- return 'ident';
- }
-
- // 1-9
- if (code >= 0x31 && code <= 0x39) {
- return 'number';
- }
-
- return 'else';
- }
-
- /**
- * Format a subPath, return its plain form if it is
- * a literal string or number. Otherwise prepend the
- * dynamic indicator (*).
- *
- * @param {String} path
- * @return {String}
- */
-
- function formatSubPath(path) {
- var trimmed = path.trim();
- // invalid leading 0
- if (path.charAt(0) === '0' && isNaN(path)) {
- return false;
- }
- return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed;
- }
-
- /**
- * Parse a string path into an array of segments
- *
- * @param {String} path
- * @return {Array|undefined}
- */
-
- function parse(path) {
- var keys = [];
- var index = -1;
- var mode = BEFORE_PATH;
- var subPathDepth = 0;
- var c, newChar, key, type, transition, action, typeMap;
-
- var actions = [];
-
- actions[PUSH] = function () {
- if (key !== undefined) {
- keys.push(key);
- key = undefined;
- }
- };
-
- actions[APPEND] = function () {
- if (key === undefined) {
- key = newChar;
- } else {
- key += newChar;
- }
- };
-
- actions[INC_SUB_PATH_DEPTH] = function () {
- actions[APPEND]();
- subPathDepth++;
- };
-
- actions[PUSH_SUB_PATH] = function () {
- if (subPathDepth > 0) {
- subPathDepth--;
- mode = IN_SUB_PATH;
- actions[APPEND]();
- } else {
- subPathDepth = 0;
- key = formatSubPath(key);
- if (key === false) {
- return false;
- } else {
- actions[PUSH]();
- }
- }
- };
-
- function maybeUnescapeQuote() {
- var nextChar = path[index + 1];
- if (mode === IN_SINGLE_QUOTE && nextChar === "'" || mode === IN_DOUBLE_QUOTE && nextChar === '"') {
- index++;
- newChar = '\\' + nextChar;
- actions[APPEND]();
- return true;
- }
- }
-
- while (mode != null) {
- index++;
- c = path[index];
-
- if (c === '\\' && maybeUnescapeQuote()) {
- continue;
- }
-
- type = getPathCharType(c);
- typeMap = pathStateMachine[mode];
- transition = typeMap[type] || typeMap['else'] || ERROR;
-
- if (transition === ERROR) {
- return; // parse error
- }
-
- mode = transition[0];
- action = actions[transition[1]];
- if (action) {
- newChar = transition[2];
- newChar = newChar === undefined ? c : newChar;
- if (action() === false) {
- return;
- }
- }
-
- if (mode === AFTER_PATH) {
- keys.raw = path;
- return keys;
- }
- }
- }
-
- /**
- * External parse that check for a cache hit first
- *
- * @param {String} path
- * @return {Array|undefined}
- */
-
- function parsePath(path) {
- var hit = pathCache.get(path);
- if (!hit) {
- hit = parse(path);
- if (hit) {
- pathCache.put(path, hit);
- }
- }
- return hit;
- }
-
- /**
- * Get from an object from a path string
- *
- * @param {Object} obj
- * @param {String} path
- */
-
- function getPath(obj, path) {
- return parseExpression$1(path).get(obj);
- }
-
- /**
- * Warn against setting non-existent root path on a vm.
- */
-
- var warnNonExistent;
- if (process.env.NODE_ENV !== 'production') {
- warnNonExistent = function (path, vm) {
- warn('You are setting a non-existent path "' + path.raw + '" ' + 'on a vm instance. Consider pre-initializing the property ' + 'with the "data" option for more reliable reactivity ' + 'and better performance.', vm);
- };
- }
-
- /**
- * Set on an object from a path
- *
- * @param {Object} obj
- * @param {String | Array} path
- * @param {*} val
- */
-
- function setPath(obj, path, val) {
- var original = obj;
- if (typeof path === 'string') {
- path = parse(path);
- }
- if (!path || !isObject(obj)) {
- return false;
- }
- var last, key;
- for (var i = 0, l = path.length; i < l; i++) {
- last = obj;
- key = path[i];
- if (key.charAt(0) === '*') {
- key = parseExpression$1(key.slice(1)).get.call(original, original);
- }
- if (i < l - 1) {
- obj = obj[key];
- if (!isObject(obj)) {
- obj = {};
- if (process.env.NODE_ENV !== 'production' && last._isVue) {
- warnNonExistent(path, last);
- }
- set(last, key, obj);
- }
- } else {
- if (isArray(obj)) {
- obj.$set(key, val);
- } else if (key in obj) {
- obj[key] = val;
- } else {
- if (process.env.NODE_ENV !== 'production' && obj._isVue) {
- warnNonExistent(path, obj);
- }
- set(obj, key, val);
- }
- }
- }
- return true;
- }
-
- var path = Object.freeze({
- parsePath: parsePath,
- getPath: getPath,
- setPath: setPath
- });
-
- var expressionCache = new Cache(1000);
-
- var allowedKeywords = 'Math,Date,this,true,false,null,undefined,Infinity,NaN,' + 'isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,' + 'encodeURIComponent,parseInt,parseFloat';
- var allowedKeywordsRE = new RegExp('^(' + allowedKeywords.replace(/,/g, '\\b|') + '\\b)');
-
- // keywords that don't make sense inside expressions
- var improperKeywords = 'break,case,class,catch,const,continue,debugger,default,' + 'delete,do,else,export,extends,finally,for,function,if,' + 'import,in,instanceof,let,return,super,switch,throw,try,' + 'var,while,with,yield,enum,await,implements,package,' + 'protected,static,interface,private,public';
- var improperKeywordsRE = new RegExp('^(' + improperKeywords.replace(/,/g, '\\b|') + '\\b)');
-
- var wsRE = /\s/g;
- var newlineRE = /\n/g;
- var saveRE = /[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\"']|\\.)*`|`(?:[^`\\]|\\.)*`)|new |typeof |void /g;
- var restoreRE = /"(\d+)"/g;
- var pathTestRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/;
- var identRE = /[^\w$\.](?:[A-Za-z_$][\w$]*)/g;
- var literalValueRE$1 = /^(?:true|false|null|undefined|Infinity|NaN)$/;
-
- function noop() {}
-
- /**
- * Save / Rewrite / Restore
- *
- * When rewriting paths found in an expression, it is
- * possible for the same letter sequences to be found in
- * strings and Object literal property keys. Therefore we
- * remove and store these parts in a temporary array, and
- * restore them after the path rewrite.
- */
-
- var saved = [];
-
- /**
- * Save replacer
- *
- * The save regex can match two possible cases:
- * 1. An opening object literal
- * 2. A string
- * If matched as a plain string, we need to escape its
- * newlines, since the string needs to be preserved when
- * generating the function body.
- *
- * @param {String} str
- * @param {String} isString - str if matched as a string
- * @return {String} - placeholder with index
- */
-
- function save(str, isString) {
- var i = saved.length;
- saved[i] = isString ? str.replace(newlineRE, '\\n') : str;
- return '"' + i + '"';
- }
-
- /**
- * Path rewrite replacer
- *
- * @param {String} raw
- * @return {String}
- */
-
- function rewrite(raw) {
- var c = raw.charAt(0);
- var path = raw.slice(1);
- if (allowedKeywordsRE.test(path)) {
- return raw;
- } else {
- path = path.indexOf('"') > -1 ? path.replace(restoreRE, restore) : path;
- return c + 'scope.' + path;
- }
- }
-
- /**
- * Restore replacer
- *
- * @param {String} str
- * @param {String} i - matched save index
- * @return {String}
- */
-
- function restore(str, i) {
- return saved[i];
- }
-
- /**
- * Rewrite an expression, prefixing all path accessors with
- * `scope.` and generate getter/setter functions.
- *
- * @param {String} exp
- * @return {Function}
- */
-
- function compileGetter(exp) {
- if (improperKeywordsRE.test(exp)) {
- process.env.NODE_ENV !== 'production' && warn('Avoid using reserved keywords in expression: ' + exp);
- }
- // reset state
- saved.length = 0;
- // save strings and object literal keys
- var body = exp.replace(saveRE, save).replace(wsRE, '');
- // rewrite all paths
- // pad 1 space here because the regex matches 1 extra char
- body = (' ' + body).replace(identRE, rewrite).replace(restoreRE, restore);
- return makeGetterFn(body);
- }
-
- /**
- * Build a getter function. Requires eval.
- *
- * We isolate the try/catch so it doesn't affect the
- * optimization of the parse function when it is not called.
- *
- * @param {String} body
- * @return {Function|undefined}
- */
-
- function makeGetterFn(body) {
- try {
- /* eslint-disable no-new-func */
- return new Function('scope', 'return ' + body + ';');
- /* eslint-enable no-new-func */
- } catch (e) {
- if (process.env.NODE_ENV !== 'production') {
- /* istanbul ignore if */
- if (e.toString().match(/unsafe-eval|CSP/)) {
- warn('It seems you are using the default build of Vue.js in an environment ' + 'with Content Security Policy that prohibits unsafe-eval. ' + 'Use the CSP-compliant build instead: ' + 'http://vuejs.org/guide/installation.html#CSP-compliant-build');
- } else {
- warn('Invalid expression. ' + 'Generated function body: ' + body);
- }
- }
- return noop;
- }
- }
-
- /**
- * Compile a setter function for the expression.
- *
- * @param {String} exp
- * @return {Function|undefined}
- */
-
- function compileSetter(exp) {
- var path = parsePath(exp);
- if (path) {
- return function (scope, val) {
- setPath(scope, path, val);
- };
- } else {
- process.env.NODE_ENV !== 'production' && warn('Invalid setter expression: ' + exp);
- }
- }
-
- /**
- * Parse an expression into re-written getter/setters.
- *
- * @param {String} exp
- * @param {Boolean} needSet
- * @return {Function}
- */
-
- function parseExpression$1(exp, needSet) {
- exp = exp.trim();
- // try cache
- var hit = expressionCache.get(exp);
- if (hit) {
- if (needSet && !hit.set) {
- hit.set = compileSetter(hit.exp);
- }
- return hit;
- }
- var res = { exp: exp };
- res.get = isSimplePath(exp) && exp.indexOf('[') < 0
- // optimized super simple getter
- ? makeGetterFn('scope.' + exp)
- // dynamic getter
- : compileGetter(exp);
- if (needSet) {
- res.set = compileSetter(exp);
- }
- expressionCache.put(exp, res);
- return res;
- }
-
- /**
- * Check if an expression is a simple path.
- *
- * @param {String} exp
- * @return {Boolean}
- */
-
- function isSimplePath(exp) {
- return pathTestRE.test(exp) &&
- // don't treat literal values as paths
- !literalValueRE$1.test(exp) &&
- // Math constants e.g. Math.PI, Math.E etc.
- exp.slice(0, 5) !== 'Math.';
- }
-
- var expression = Object.freeze({
- parseExpression: parseExpression$1,
- isSimplePath: isSimplePath
- });
-
- // we have two separate queues: one for directive updates
- // and one for user watcher registered via $watch().
- // we want to guarantee directive updates to be called
- // before user watchers so that when user watchers are
- // triggered, the DOM would have already been in updated
- // state.
-
- var queue = [];
- var userQueue = [];
- var has = {};
- var circular = {};
- var waiting = false;
-
- /**
- * Reset the batcher's state.
- */
-
- function resetBatcherState() {
- queue.length = 0;
- userQueue.length = 0;
- has = {};
- circular = {};
- waiting = false;
- }
-
- /**
- * Flush both queues and run the watchers.
- */
-
- function flushBatcherQueue() {
- var _again = true;
-
- _function: while (_again) {
- _again = false;
-
- runBatcherQueue(queue);
- runBatcherQueue(userQueue);
- // user watchers triggered more watchers,
- // keep flushing until it depletes
- if (queue.length) {
- _again = true;
- continue _function;
- }
- // dev tool hook
- /* istanbul ignore if */
- if (devtools && config.devtools) {
- devtools.emit('flush');
- }
- resetBatcherState();
- }
- }
-
- /**
- * Run the watchers in a single queue.
- *
- * @param {Array} queue
- */
-
- function runBatcherQueue(queue) {
- // do not cache length because more watchers might be pushed
- // as we run existing watchers
- for (var i = 0; i < queue.length; i++) {
- var watcher = queue[i];
- var id = watcher.id;
- has[id] = null;
- watcher.run();
- // in dev build, check and stop circular updates.
- if (process.env.NODE_ENV !== 'production' && has[id] != null) {
- circular[id] = (circular[id] || 0) + 1;
- if (circular[id] > config._maxUpdateCount) {
- warn('You may have an infinite update loop for watcher ' + 'with expression "' + watcher.expression + '"', watcher.vm);
- break;
- }
- }
- }
- queue.length = 0;
- }
-
- /**
- * Push a watcher into the watcher queue.
- * Jobs with duplicate IDs will be skipped unless it's
- * pushed when the queue is being flushed.
- *
- * @param {Watcher} watcher
- * properties:
- * - {Number} id
- * - {Function} run
- */
-
- function pushWatcher(watcher) {
- var id = watcher.id;
- if (has[id] == null) {
- // push watcher into appropriate queue
- var q = watcher.user ? userQueue : queue;
- has[id] = q.length;
- q.push(watcher);
- // queue the flush
- if (!waiting) {
- waiting = true;
- nextTick(flushBatcherQueue);
- }
- }
- }
-
- var uid$2 = 0;
-
- /**
- * A watcher parses an expression, collects dependencies,
- * and fires callback when the expression value changes.
- * This is used for both the $watch() api and directives.
- *
- * @param {Vue} vm
- * @param {String|Function} expOrFn
- * @param {Function} cb
- * @param {Object} options
- * - {Array} filters
- * - {Boolean} twoWay
- * - {Boolean} deep
- * - {Boolean} user
- * - {Boolean} sync
- * - {Boolean} lazy
- * - {Function} [preProcess]
- * - {Function} [postProcess]
- * @constructor
- */
- function Watcher(vm, expOrFn, cb, options) {
- // mix in options
- if (options) {
- extend(this, options);
- }
- var isFn = typeof expOrFn === 'function';
- this.vm = vm;
- vm._watchers.push(this);
- this.expression = expOrFn;
- this.cb = cb;
- this.id = ++uid$2; // uid for batching
- this.active = true;
- this.dirty = this.lazy; // for lazy watchers
- this.deps = [];
- this.newDeps = [];
- this.depIds = new _Set();
- this.newDepIds = new _Set();
- this.prevError = null; // for async error stacks
- // parse expression for getter/setter
- if (isFn) {
- this.getter = expOrFn;
- this.setter = undefined;
- } else {
- var res = parseExpression$1(expOrFn, this.twoWay);
- this.getter = res.get;
- this.setter = res.set;
- }
- this.value = this.lazy ? undefined : this.get();
- // state for avoiding false triggers for deep and Array
- // watchers during vm._digest()
- this.queued = this.shallow = false;
- }
-
- /**
- * Evaluate the getter, and re-collect dependencies.
- */
-
- Watcher.prototype.get = function () {
- this.beforeGet();
- var scope = this.scope || this.vm;
- var value;
- try {
- value = this.getter.call(scope, scope);
- } catch (e) {
- if (process.env.NODE_ENV !== 'production' && config.warnExpressionErrors) {
- warn('Error when evaluating expression ' + '"' + this.expression + '": ' + e.toString(), this.vm);
- }
- }
- // "touch" every property so they are all tracked as
- // dependencies for deep watching
- if (this.deep) {
- traverse(value);
- }
- if (this.preProcess) {
- value = this.preProcess(value);
- }
- if (this.filters) {
- value = scope._applyFilters(value, null, this.filters, false);
- }
- if (this.postProcess) {
- value = this.postProcess(value);
- }
- this.afterGet();
- return value;
- };
-
- /**
- * Set the corresponding value with the setter.
- *
- * @param {*} value
- */
-
- Watcher.prototype.set = function (value) {
- var scope = this.scope || this.vm;
- if (this.filters) {
- value = scope._applyFilters(value, this.value, this.filters, true);
- }
- try {
- this.setter.call(scope, scope, value);
- } catch (e) {
- if (process.env.NODE_ENV !== 'production' && config.warnExpressionErrors) {
- warn('Error when evaluating setter ' + '"' + this.expression + '": ' + e.toString(), this.vm);
- }
- }
- // two-way sync for v-for alias
- var forContext = scope.$forContext;
- if (forContext && forContext.alias === this.expression) {
- if (forContext.filters) {
- process.env.NODE_ENV !== 'production' && warn('It seems you are using two-way binding on ' + 'a v-for alias (' + this.expression + '), and the ' + 'v-for has filters. This will not work properly. ' + 'Either remove the filters or use an array of ' + 'objects and bind to object properties instead.', this.vm);
- return;
- }
- forContext._withLock(function () {
- if (scope.$key) {
- // original is an object
- forContext.rawValue[scope.$key] = value;
- } else {
- forContext.rawValue.$set(scope.$index, value);
- }
- });
- }
- };
-
- /**
- * Prepare for dependency collection.
- */
-
- Watcher.prototype.beforeGet = function () {
- Dep.target = this;
- };
-
- /**
- * Add a dependency to this directive.
- *
- * @param {Dep} dep
- */
-
- Watcher.prototype.addDep = function (dep) {
- var id = dep.id;
- if (!this.newDepIds.has(id)) {
- this.newDepIds.add(id);
- this.newDeps.push(dep);
- if (!this.depIds.has(id)) {
- dep.addSub(this);
- }
- }
- };
-
- /**
- * Clean up for dependency collection.
- */
-
- Watcher.prototype.afterGet = function () {
- Dep.target = null;
- var i = this.deps.length;
- while (i--) {
- var dep = this.deps[i];
- if (!this.newDepIds.has(dep.id)) {
- dep.removeSub(this);
- }
- }
- var tmp = this.depIds;
- this.depIds = this.newDepIds;
- this.newDepIds = tmp;
- this.newDepIds.clear();
- tmp = this.deps;
- this.deps = this.newDeps;
- this.newDeps = tmp;
- this.newDeps.length = 0;
- };
-
- /**
- * Subscriber interface.
- * Will be called when a dependency changes.
- *
- * @param {Boolean} shallow
- */
-
- Watcher.prototype.update = function (shallow) {
- if (this.lazy) {
- this.dirty = true;
- } else if (this.sync || !config.async) {
- this.run();
- } else {
- // if queued, only overwrite shallow with non-shallow,
- // but not the other way around.
- this.shallow = this.queued ? shallow ? this.shallow : false : !!shallow;
- this.queued = true;
- // record before-push error stack in debug mode
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.debug) {
- this.prevError = new Error('[vue] async stack trace');
- }
- pushWatcher(this);
- }
- };
-
- /**
- * Batcher job interface.
- * Will be called by the batcher.
- */
-
- Watcher.prototype.run = function () {
- if (this.active) {
- var value = this.get();
- if (value !== this.value ||
- // Deep watchers and watchers on Object/Arrays should fire even
- // when the value is the same, because the value may
- // have mutated; but only do so if this is a
- // non-shallow update (caused by a vm digest).
- (isObject(value) || this.deep) && !this.shallow) {
- // set new value
- var oldValue = this.value;
- this.value = value;
- // in debug + async mode, when a watcher callbacks
- // throws, we also throw the saved before-push error
- // so the full cross-tick stack trace is available.
- var prevError = this.prevError;
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && config.debug && prevError) {
- this.prevError = null;
- try {
- this.cb.call(this.vm, value, oldValue);
- } catch (e) {
- nextTick(function () {
- throw prevError;
- }, 0);
- throw e;
- }
- } else {
- this.cb.call(this.vm, value, oldValue);
- }
- }
- this.queued = this.shallow = false;
- }
- };
-
- /**
- * Evaluate the value of the watcher.
- * This only gets called for lazy watchers.
- */
-
- Watcher.prototype.evaluate = function () {
- // avoid overwriting another watcher that is being
- // collected.
- var current = Dep.target;
- this.value = this.get();
- this.dirty = false;
- Dep.target = current;
- };
-
- /**
- * Depend on all deps collected by this watcher.
- */
-
- Watcher.prototype.depend = function () {
- var i = this.deps.length;
- while (i--) {
- this.deps[i].depend();
- }
- };
-
- /**
- * Remove self from all dependencies' subcriber list.
- */
-
- Watcher.prototype.teardown = function () {
- if (this.active) {
- // remove self from vm's watcher list
- // this is a somewhat expensive operation so we skip it
- // if the vm is being destroyed or is performing a v-for
- // re-render (the watcher list is then filtered by v-for).
- if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {
- this.vm._watchers.$remove(this);
- }
- var i = this.deps.length;
- while (i--) {
- this.deps[i].removeSub(this);
- }
- this.active = false;
- this.vm = this.cb = this.value = null;
- }
- };
-
- /**
- * Recrusively traverse an object to evoke all converted
- * getters, so that every nested property inside the object
- * is collected as a "deep" dependency.
- *
- * @param {*} val
- */
-
- var seenObjects = new _Set();
- function traverse(val, seen) {
- var i = undefined,
- keys = undefined;
- if (!seen) {
- seen = seenObjects;
- seen.clear();
- }
- var isA = isArray(val);
- var isO = isObject(val);
- if ((isA || isO) && Object.isExtensible(val)) {
- if (val.__ob__) {
- var depId = val.__ob__.dep.id;
- if (seen.has(depId)) {
- return;
- } else {
- seen.add(depId);
- }
- }
- if (isA) {
- i = val.length;
- while (i--) traverse(val[i], seen);
- } else if (isO) {
- keys = Object.keys(val);
- i = keys.length;
- while (i--) traverse(val[keys[i]], seen);
- }
- }
- }
-
- var text$1 = {
-
- bind: function bind() {
- this.attr = this.el.nodeType === 3 ? 'data' : 'textContent';
- },
-
- update: function update(value) {
- this.el[this.attr] = _toString(value);
- }
- };
-
- var templateCache = new Cache(1000);
- var idSelectorCache = new Cache(1000);
-
- var map = {
- efault: [0, '', ''],
- legend: [1, '<fieldset>', '</fieldset>'],
- tr: [2, '<table><tbody>', '</tbody></table>'],
- col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>']
- };
-
- map.td = map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
-
- map.option = map.optgroup = [1, '<select multiple="multiple">', '</select>'];
-
- map.thead = map.tbody = map.colgroup = map.caption = map.tfoot = [1, '<table>', '</table>'];
-
- map.g = map.defs = map.symbol = map.use = map.image = map.text = map.circle = map.ellipse = map.line = map.path = map.polygon = map.polyline = map.rect = [1, '<svg ' + 'xmlns="http://www.w3.org/2000/svg" ' + 'xmlns:xlink="http://www.w3.org/1999/xlink" ' + 'xmlns:ev="http://www.w3.org/2001/xml-events"' + 'version="1.1">', '</svg>'];
-
- /**
- * Check if a node is a supported template node with a
- * DocumentFragment content.
- *
- * @param {Node} node
- * @return {Boolean}
- */
-
- function isRealTemplate(node) {
- return isTemplate(node) && isFragment(node.content);
- }
-
- var tagRE$1 = /<([\w:-]+)/;
- var entityRE = /&#?\w+?;/;
- var commentRE = /<!--/;
-
- /**
- * Convert a string template to a DocumentFragment.
- * Determines correct wrapping by tag types. Wrapping
- * strategy found in jQuery & component/domify.
- *
- * @param {String} templateString
- * @param {Boolean} raw
- * @return {DocumentFragment}
- */
-
- function stringToFragment(templateString, raw) {
- // try a cache hit first
- var cacheKey = raw ? templateString : templateString.trim();
- var hit = templateCache.get(cacheKey);
- if (hit) {
- return hit;
- }
-
- var frag = document.createDocumentFragment();
- var tagMatch = templateString.match(tagRE$1);
- var entityMatch = entityRE.test(templateString);
- var commentMatch = commentRE.test(templateString);
-
- if (!tagMatch && !entityMatch && !commentMatch) {
- // text only, return a single text node.
- frag.appendChild(document.createTextNode(templateString));
- } else {
- var tag = tagMatch && tagMatch[1];
- var wrap = map[tag] || map.efault;
- var depth = wrap[0];
- var prefix = wrap[1];
- var suffix = wrap[2];
- var node = document.createElement('div');
-
- node.innerHTML = prefix + templateString + suffix;
- while (depth--) {
- node = node.lastChild;
- }
-
- var child;
- /* eslint-disable no-cond-assign */
- while (child = node.firstChild) {
- /* eslint-enable no-cond-assign */
- frag.appendChild(child);
- }
- }
- if (!raw) {
- trimNode(frag);
- }
- templateCache.put(cacheKey, frag);
- return frag;
- }
-
- /**
- * Convert a template node to a DocumentFragment.
- *
- * @param {Node} node
- * @return {DocumentFragment}
- */
-
- function nodeToFragment(node) {
- // if its a template tag and the browser supports it,
- // its content is already a document fragment. However, iOS Safari has
- // bug when using directly cloned template content with touch
- // events and can cause crashes when the nodes are removed from DOM, so we
- // have to treat template elements as string templates. (#2805)
- /* istanbul ignore if */
- if (isRealTemplate(node)) {
- return stringToFragment(node.innerHTML);
- }
- // script template
- if (node.tagName === 'SCRIPT') {
- return stringToFragment(node.textContent);
- }
- // normal node, clone it to avoid mutating the original
- var clonedNode = cloneNode(node);
- var frag = document.createDocumentFragment();
- var child;
- /* eslint-disable no-cond-assign */
- while (child = clonedNode.firstChild) {
- /* eslint-enable no-cond-assign */
- frag.appendChild(child);
- }
- trimNode(frag);
- return frag;
- }
-
- // Test for the presence of the Safari template cloning bug
- // https://bugs.webkit.org/showug.cgi?id=137755
- var hasBrokenTemplate = (function () {
- /* istanbul ignore else */
- if (inBrowser) {
- var a = document.createElement('div');
- a.innerHTML = '<template>1</template>';
- return !a.cloneNode(true).firstChild.innerHTML;
- } else {
- return false;
- }
- })();
-
- // Test for IE10/11 textarea placeholder clone bug
- var hasTextareaCloneBug = (function () {
- /* istanbul ignore else */
- if (inBrowser) {
- var t = document.createElement('textarea');
- t.placeholder = 't';
- return t.cloneNode(true).value === 't';
- } else {
- return false;
- }
- })();
-
- /**
- * 1. Deal with Safari cloning nested <template> bug by
- * manually cloning all template instances.
- * 2. Deal with IE10/11 textarea placeholder bug by setting
- * the correct value after cloning.
- *
- * @param {Element|DocumentFragment} node
- * @return {Element|DocumentFragment}
- */
-
- function cloneNode(node) {
- /* istanbul ignore if */
- if (!node.querySelectorAll) {
- return node.cloneNode();
- }
- var res = node.cloneNode(true);
- var i, original, cloned;
- /* istanbul ignore if */
- if (hasBrokenTemplate) {
- var tempClone = res;
- if (isRealTemplate(node)) {
- node = node.content;
- tempClone = res.content;
- }
- original = node.querySelectorAll('template');
- if (original.length) {
- cloned = tempClone.querySelectorAll('template');
- i = cloned.length;
- while (i--) {
- cloned[i].parentNode.replaceChild(cloneNode(original[i]), cloned[i]);
- }
- }
- }
- /* istanbul ignore if */
- if (hasTextareaCloneBug) {
- if (node.tagName === 'TEXTAREA') {
- res.value = node.value;
- } else {
- original = node.querySelectorAll('textarea');
- if (original.length) {
- cloned = res.querySelectorAll('textarea');
- i = cloned.length;
- while (i--) {
- cloned[i].value = original[i].value;
- }
- }
- }
- }
- return res;
- }
-
- /**
- * Process the template option and normalizes it into a
- * a DocumentFragment that can be used as a partial or a
- * instance template.
- *
- * @param {*} template
- * Possible values include:
- * - DocumentFragment object
- * - Node object of type Template
- * - id selector: '#some-template-id'
- * - template string: '<div><span>{{msg}}</span></div>'
- * @param {Boolean} shouldClone
- * @param {Boolean} raw
- * inline HTML interpolation. Do not check for id
- * selector and keep whitespace in the string.
- * @return {DocumentFragment|undefined}
- */
-
- function parseTemplate(template, shouldClone, raw) {
- var node, frag;
-
- // if the template is already a document fragment,
- // do nothing
- if (isFragment(template)) {
- trimNode(template);
- return shouldClone ? cloneNode(template) : template;
- }
-
- if (typeof template === 'string') {
- // id selector
- if (!raw && template.charAt(0) === '#') {
- // id selector can be cached too
- frag = idSelectorCache.get(template);
- if (!frag) {
- node = document.getElementById(template.slice(1));
- if (node) {
- frag = nodeToFragment(node);
- // save selector to cache
- idSelectorCache.put(template, frag);
- }
- }
- } else {
- // normal string template
- frag = stringToFragment(template, raw);
- }
- } else if (template.nodeType) {
- // a direct node
- frag = nodeToFragment(template);
- }
-
- return frag && shouldClone ? cloneNode(frag) : frag;
- }
-
- var template = Object.freeze({
- cloneNode: cloneNode,
- parseTemplate: parseTemplate
- });
-
- var html = {
-
- bind: function bind() {
- // a comment node means this is a binding for
- // {{{ inline unescaped html }}}
- if (this.el.nodeType === 8) {
- // hold nodes
- this.nodes = [];
- // replace the placeholder with proper anchor
- this.anchor = createAnchor('v-html');
- replace(this.el, this.anchor);
- }
- },
-
- update: function update(value) {
- value = _toString(value);
- if (this.nodes) {
- this.swap(value);
- } else {
- this.el.innerHTML = value;
- }
- },
-
- swap: function swap(value) {
- // remove old nodes
- var i = this.nodes.length;
- while (i--) {
- remove(this.nodes[i]);
- }
- // convert new value to a fragment
- // do not attempt to retrieve from id selector
- var frag = parseTemplate(value, true, true);
- // save a reference to these nodes so we can remove later
- this.nodes = toArray(frag.childNodes);
- before(frag, this.anchor);
- }
- };
-
- /**
- * Abstraction for a partially-compiled fragment.
- * Can optionally compile content with a child scope.
- *
- * @param {Function} linker
- * @param {Vue} vm
- * @param {DocumentFragment} frag
- * @param {Vue} [host]
- * @param {Object} [scope]
- * @param {Fragment} [parentFrag]
- */
- function Fragment(linker, vm, frag, host, scope, parentFrag) {
- this.children = [];
- this.childFrags = [];
- this.vm = vm;
- this.scope = scope;
- this.inserted = false;
- this.parentFrag = parentFrag;
- if (parentFrag) {
- parentFrag.childFrags.push(this);
- }
- this.unlink = linker(vm, frag, host, scope, this);
- var single = this.single = frag.childNodes.length === 1 &&
- // do not go single mode if the only node is an anchor
- !frag.childNodes[0].__v_anchor;
- if (single) {
- this.node = frag.childNodes[0];
- this.before = singleBefore;
- this.remove = singleRemove;
- } else {
- this.node = createAnchor('fragment-start');
- this.end = createAnchor('fragment-end');
- this.frag = frag;
- prepend(this.node, frag);
- frag.appendChild(this.end);
- this.before = multiBefore;
- this.remove = multiRemove;
- }
- this.node.__v_frag = this;
- }
-
- /**
- * Call attach/detach for all components contained within
- * this fragment. Also do so recursively for all child
- * fragments.
- *
- * @param {Function} hook
- */
-
- Fragment.prototype.callHook = function (hook) {
- var i, l;
- for (i = 0, l = this.childFrags.length; i < l; i++) {
- this.childFrags[i].callHook(hook);
- }
- for (i = 0, l = this.children.length; i < l; i++) {
- hook(this.children[i]);
- }
- };
-
- /**
- * Insert fragment before target, single node version
- *
- * @param {Node} target
- * @param {Boolean} withTransition
- */
-
- function singleBefore(target, withTransition) {
- this.inserted = true;
- var method = withTransition !== false ? beforeWithTransition : before;
- method(this.node, target, this.vm);
- if (inDoc(this.node)) {
- this.callHook(attach);
- }
- }
-
- /**
- * Remove fragment, single node version
- */
-
- function singleRemove() {
- this.inserted = false;
- var shouldCallRemove = inDoc(this.node);
- var self = this;
- this.beforeRemove();
- removeWithTransition(this.node, this.vm, function () {
- if (shouldCallRemove) {
- self.callHook(detach);
- }
- self.destroy();
- });
- }
-
- /**
- * Insert fragment before target, multi-nodes version
- *
- * @param {Node} target
- * @param {Boolean} withTransition
- */
-
- function multiBefore(target, withTransition) {
- this.inserted = true;
- var vm = this.vm;
- var method = withTransition !== false ? beforeWithTransition : before;
- mapNodeRange(this.node, this.end, function (node) {
- method(node, target, vm);
- });
- if (inDoc(this.node)) {
- this.callHook(attach);
- }
- }
-
- /**
- * Remove fragment, multi-nodes version
- */
-
- function multiRemove() {
- this.inserted = false;
- var self = this;
- var shouldCallRemove = inDoc(this.node);
- this.beforeRemove();
- removeNodeRange(this.node, this.end, this.vm, this.frag, function () {
- if (shouldCallRemove) {
- self.callHook(detach);
- }
- self.destroy();
- });
- }
-
- /**
- * Prepare the fragment for removal.
- */
-
- Fragment.prototype.beforeRemove = function () {
- var i, l;
- for (i = 0, l = this.childFrags.length; i < l; i++) {
- // call the same method recursively on child
- // fragments, depth-first
- this.childFrags[i].beforeRemove(false);
- }
- for (i = 0, l = this.children.length; i < l; i++) {
- // Call destroy for all contained instances,
- // with remove:false and defer:true.
- // Defer is necessary because we need to
- // keep the children to call detach hooks
- // on them.
- this.children[i].$destroy(false, true);
- }
- var dirs = this.unlink.dirs;
- for (i = 0, l = dirs.length; i < l; i++) {
- // disable the watchers on all the directives
- // so that the rendered content stays the same
- // during removal.
- dirs[i]._watcher && dirs[i]._watcher.teardown();
- }
- };
-
- /**
- * Destroy the fragment.
- */
-
- Fragment.prototype.destroy = function () {
- if (this.parentFrag) {
- this.parentFrag.childFrags.$remove(this);
- }
- this.node.__v_frag = null;
- this.unlink();
- };
-
- /**
- * Call attach hook for a Vue instance.
- *
- * @param {Vue} child
- */
-
- function attach(child) {
- if (!child._isAttached && inDoc(child.$el)) {
- child._callHook('attached');
- }
- }
-
- /**
- * Call detach hook for a Vue instance.
- *
- * @param {Vue} child
- */
-
- function detach(child) {
- if (child._isAttached && !inDoc(child.$el)) {
- child._callHook('detached');
- }
- }
-
- var linkerCache = new Cache(5000);
-
- /**
- * A factory that can be used to create instances of a
- * fragment. Caches the compiled linker if possible.
- *
- * @param {Vue} vm
- * @param {Element|String} el
- */
- function FragmentFactory(vm, el) {
- this.vm = vm;
- var template;
- var isString = typeof el === 'string';
- if (isString || isTemplate(el) && !el.hasAttribute('v-if')) {
- template = parseTemplate(el, true);
- } else {
- template = document.createDocumentFragment();
- template.appendChild(el);
- }
- this.template = template;
- // linker can be cached, but only for components
- var linker;
- var cid = vm.constructor.cid;
- if (cid > 0) {
- var cacheId = cid + (isString ? el : getOuterHTML(el));
- linker = linkerCache.get(cacheId);
- if (!linker) {
- linker = compile(template, vm.$options, true);
- linkerCache.put(cacheId, linker);
- }
- } else {
- linker = compile(template, vm.$options, true);
- }
- this.linker = linker;
- }
-
- /**
- * Create a fragment instance with given host and scope.
- *
- * @param {Vue} host
- * @param {Object} scope
- * @param {Fragment} parentFrag
- */
-
- FragmentFactory.prototype.create = function (host, scope, parentFrag) {
- var frag = cloneNode(this.template);
- return new Fragment(this.linker, this.vm, frag, host, scope, parentFrag);
- };
-
- var ON = 700;
- var MODEL = 800;
- var BIND = 850;
- var TRANSITION = 1100;
- var EL = 1500;
- var COMPONENT = 1500;
- var PARTIAL = 1750;
- var IF = 2100;
- var FOR = 2200;
- var SLOT = 2300;
-
- var uid$3 = 0;
-
- var vFor = {
-
- priority: FOR,
- terminal: true,
-
- params: ['track-by', 'stagger', 'enter-stagger', 'leave-stagger'],
-
- bind: function bind() {
- if (process.env.NODE_ENV !== 'production' && this.el.hasAttribute('v-if')) {
- warn('<' + this.el.tagName.toLowerCase() + ' v-for="' + this.expression + '" v-if="' + this.el.getAttribute('v-if') + '">: ' + 'Using v-if and v-for on the same element is not recommended - ' + 'consider filtering the source Array instead.', this.vm);
- }
-
- // support "item in/of items" syntax
- var inMatch = this.expression.match(/(.*) (?:in|of) (.*)/);
- if (inMatch) {
- var itMatch = inMatch[1].match(/\((.*),(.*)\)/);
- if (itMatch) {
- this.iterator = itMatch[1].trim();
- this.alias = itMatch[2].trim();
- } else {
- this.alias = inMatch[1].trim();
- }
- this.expression = inMatch[2];
- }
-
- if (!this.alias) {
- process.env.NODE_ENV !== 'production' && warn('Invalid v-for expression "' + this.descriptor.raw + '": ' + 'alias is required.', this.vm);
- return;
- }
-
- // uid as a cache identifier
- this.id = '__v-for__' + ++uid$3;
-
- // check if this is an option list,
- // so that we know if we need to update the <select>'s
- // v-model when the option list has changed.
- // because v-model has a lower priority than v-for,
- // the v-model is not bound here yet, so we have to
- // retrive it in the actual updateModel() function.
- var tag = this.el.tagName;
- this.isOption = (tag === 'OPTION' || tag === 'OPTGROUP') && this.el.parentNode.tagName === 'SELECT';
-
- // setup anchor nodes
- this.start = createAnchor('v-for-start');
- this.end = createAnchor('v-for-end');
- replace(this.el, this.end);
- before(this.start, this.end);
-
- // cache
- this.cache = Object.create(null);
-
- // fragment factory
- this.factory = new FragmentFactory(this.vm, this.el);
- },
-
- update: function update(data) {
- this.diff(data);
- this.updateRef();
- this.updateModel();
- },
-
- /**
- * Diff, based on new data and old data, determine the
- * minimum amount of DOM manipulations needed to make the
- * DOM reflect the new data Array.
- *
- * The algorithm diffs the new data Array by storing a
- * hidden reference to an owner vm instance on previously
- * seen data. This allows us to achieve O(n) which is
- * better than a levenshtein distance based algorithm,
- * which is O(m * n).
- *
- * @param {Array} data
- */
-
- diff: function diff(data) {
- // check if the Array was converted from an Object
- var item = data[0];
- var convertedFromObject = this.fromObject = isObject(item) && hasOwn(item, '$key') && hasOwn(item, '$value');
-
- var trackByKey = this.params.trackBy;
- var oldFrags = this.frags;
- var frags = this.frags = new Array(data.length);
- var alias = this.alias;
- var iterator = this.iterator;
- var start = this.start;
- var end = this.end;
- var inDocument = inDoc(start);
- var init = !oldFrags;
- var i, l, frag, key, value, primitive;
-
- // First pass, go through the new Array and fill up
- // the new frags array. If a piece of data has a cached
- // instance for it, we reuse it. Otherwise build a new
- // instance.
- for (i = 0, l = data.length; i < l; i++) {
- item = data[i];
- key = convertedFromObject ? item.$key : null;
- value = convertedFromObject ? item.$value : item;
- primitive = !isObject(value);
- frag = !init && this.getCachedFrag(value, i, key);
- if (frag) {
- // reusable fragment
- frag.reused = true;
- // update $index
- frag.scope.$index = i;
- // update $key
- if (key) {
- frag.scope.$key = key;
- }
- // update iterator
- if (iterator) {
- frag.scope[iterator] = key !== null ? key : i;
- }
- // update data for track-by, object repeat &
- // primitive values.
- if (trackByKey || convertedFromObject || primitive) {
- withoutConversion(function () {
- frag.scope[alias] = value;
- });
- }
- } else {
- // new instance
- frag = this.create(value, alias, i, key);
- frag.fresh = !init;
- }
- frags[i] = frag;
- if (init) {
- frag.before(end);
- }
- }
-
- // we're done for the initial render.
- if (init) {
- return;
- }
-
- // Second pass, go through the old fragments and
- // destroy those who are not reused (and remove them
- // from cache)
- var removalIndex = 0;
- var totalRemoved = oldFrags.length - frags.length;
- // when removing a large number of fragments, watcher removal
- // turns out to be a perf bottleneck, so we batch the watcher
- // removals into a single filter call!
- this.vm._vForRemoving = true;
- for (i = 0, l = oldFrags.length; i < l; i++) {
- frag = oldFrags[i];
- if (!frag.reused) {
- this.deleteCachedFrag(frag);
- this.remove(frag, removalIndex++, totalRemoved, inDocument);
- }
- }
- this.vm._vForRemoving = false;
- if (removalIndex) {
- this.vm._watchers = this.vm._watchers.filter(function (w) {
- return w.active;
- });
- }
-
- // Final pass, move/insert new fragments into the
- // right place.
- var targetPrev, prevEl, currentPrev;
- var insertionIndex = 0;
- for (i = 0, l = frags.length; i < l; i++) {
- frag = frags[i];
- // this is the frag that we should be after
- targetPrev = frags[i - 1];
- prevEl = targetPrev ? targetPrev.staggerCb ? targetPrev.staggerAnchor : targetPrev.end || targetPrev.node : start;
- if (frag.reused && !frag.staggerCb) {
- currentPrev = findPrevFrag(frag, start, this.id);
- if (currentPrev !== targetPrev && (!currentPrev ||
- // optimization for moving a single item.
- // thanks to suggestions by @livoras in #1807
- findPrevFrag(currentPrev, start, this.id) !== targetPrev)) {
- this.move(frag, prevEl);
- }
- } else {
- // new instance, or still in stagger.
- // insert with updated stagger index.
- this.insert(frag, insertionIndex++, prevEl, inDocument);
- }
- frag.reused = frag.fresh = false;
- }
- },
-
- /**
- * Create a new fragment instance.
- *
- * @param {*} value
- * @param {String} alias
- * @param {Number} index
- * @param {String} [key]
- * @return {Fragment}
- */
-
- create: function create(value, alias, index, key) {
- var host = this._host;
- // create iteration scope
- var parentScope = this._scope || this.vm;
- var scope = Object.create(parentScope);
- // ref holder for the scope
- scope.$refs = Object.create(parentScope.$refs);
- scope.$els = Object.create(parentScope.$els);
- // make sure point $parent to parent scope
- scope.$parent = parentScope;
- // for two-way binding on alias
- scope.$forContext = this;
- // define scope properties
- // important: define the scope alias without forced conversion
- // so that frozen data structures remain non-reactive.
- withoutConversion(function () {
- defineReactive(scope, alias, value);
- });
- defineReactive(scope, '$index', index);
- if (key) {
- defineReactive(scope, '$key', key);
- } else if (scope.$key) {
- // avoid accidental fallback
- def(scope, '$key', null);
- }
- if (this.iterator) {
- defineReactive(scope, this.iterator, key !== null ? key : index);
- }
- var frag = this.factory.create(host, scope, this._frag);
- frag.forId = this.id;
- this.cacheFrag(value, frag, index, key);
- return frag;
- },
-
- /**
- * Update the v-ref on owner vm.
- */
-
- updateRef: function updateRef() {
- var ref = this.descriptor.ref;
- if (!ref) return;
- var hash = (this._scope || this.vm).$refs;
- var refs;
- if (!this.fromObject) {
- refs = this.frags.map(findVmFromFrag);
- } else {
- refs = {};
- this.frags.forEach(function (frag) {
- refs[frag.scope.$key] = findVmFromFrag(frag);
- });
- }
- hash[ref] = refs;
- },
-
- /**
- * For option lists, update the containing v-model on
- * parent <select>.
- */
-
- updateModel: function updateModel() {
- if (this.isOption) {
- var parent = this.start.parentNode;
- var model = parent && parent.__v_model;
- if (model) {
- model.forceUpdate();
- }
- }
- },
-
- /**
- * Insert a fragment. Handles staggering.
- *
- * @param {Fragment} frag
- * @param {Number} index
- * @param {Node} prevEl
- * @param {Boolean} inDocument
- */
-
- insert: function insert(frag, index, prevEl, inDocument) {
- if (frag.staggerCb) {
- frag.staggerCb.cancel();
- frag.staggerCb = null;
- }
- var staggerAmount = this.getStagger(frag, index, null, 'enter');
- if (inDocument && staggerAmount) {
- // create an anchor and insert it synchronously,
- // so that we can resolve the correct order without
- // worrying about some elements not inserted yet
- var anchor = frag.staggerAnchor;
- if (!anchor) {
- anchor = frag.staggerAnchor = createAnchor('stagger-anchor');
- anchor.__v_frag = frag;
- }
- after(anchor, prevEl);
- var op = frag.staggerCb = cancellable(function () {
- frag.staggerCb = null;
- frag.before(anchor);
- remove(anchor);
- });
- setTimeout(op, staggerAmount);
- } else {
- var target = prevEl.nextSibling;
- /* istanbul ignore if */
- if (!target) {
- // reset end anchor position in case the position was messed up
- // by an external drag-n-drop library.
- after(this.end, prevEl);
- target = this.end;
- }
- frag.before(target);
- }
- },
-
- /**
- * Remove a fragment. Handles staggering.
- *
- * @param {Fragment} frag
- * @param {Number} index
- * @param {Number} total
- * @param {Boolean} inDocument
- */
-
- remove: function remove(frag, index, total, inDocument) {
- if (frag.staggerCb) {
- frag.staggerCb.cancel();
- frag.staggerCb = null;
- // it's not possible for the same frag to be removed
- // twice, so if we have a pending stagger callback,
- // it means this frag is queued for enter but removed
- // before its transition started. Since it is already
- // destroyed, we can just leave it in detached state.
- return;
- }
- var staggerAmount = this.getStagger(frag, index, total, 'leave');
- if (inDocument && staggerAmount) {
- var op = frag.staggerCb = cancellable(function () {
- frag.staggerCb = null;
- frag.remove();
- });
- setTimeout(op, staggerAmount);
- } else {
- frag.remove();
- }
- },
-
- /**
- * Move a fragment to a new position.
- * Force no transition.
- *
- * @param {Fragment} frag
- * @param {Node} prevEl
- */
-
- move: function move(frag, prevEl) {
- // fix a common issue with Sortable:
- // if prevEl doesn't have nextSibling, this means it's
- // been dragged after the end anchor. Just re-position
- // the end anchor to the end of the container.
- /* istanbul ignore if */
- if (!prevEl.nextSibling) {
- this.end.parentNode.appendChild(this.end);
- }
- frag.before(prevEl.nextSibling, false);
- },
-
- /**
- * Cache a fragment using track-by or the object key.
- *
- * @param {*} value
- * @param {Fragment} frag
- * @param {Number} index
- * @param {String} [key]
- */
-
- cacheFrag: function cacheFrag(value, frag, index, key) {
- var trackByKey = this.params.trackBy;
- var cache = this.cache;
- var primitive = !isObject(value);
- var id;
- if (key || trackByKey || primitive) {
- id = getTrackByKey(index, key, value, trackByKey);
- if (!cache[id]) {
- cache[id] = frag;
- } else if (trackByKey !== '$index') {
- process.env.NODE_ENV !== 'production' && this.warnDuplicate(value);
- }
- } else {
- id = this.id;
- if (hasOwn(value, id)) {
- if (value[id] === null) {
- value[id] = frag;
- } else {
- process.env.NODE_ENV !== 'production' && this.warnDuplicate(value);
- }
- } else if (Object.isExtensible(value)) {
- def(value, id, frag);
- } else if (process.env.NODE_ENV !== 'production') {
- warn('Frozen v-for objects cannot be automatically tracked, make sure to ' + 'provide a track-by key.');
- }
- }
- frag.raw = value;
- },
-
- /**
- * Get a cached fragment from the value/index/key
- *
- * @param {*} value
- * @param {Number} index
- * @param {String} key
- * @return {Fragment}
- */
-
- getCachedFrag: function getCachedFrag(value, index, key) {
- var trackByKey = this.params.trackBy;
- var primitive = !isObject(value);
- var frag;
- if (key || trackByKey || primitive) {
- var id = getTrackByKey(index, key, value, trackByKey);
- frag = this.cache[id];
- } else {
- frag = value[this.id];
- }
- if (frag && (frag.reused || frag.fresh)) {
- process.env.NODE_ENV !== 'production' && this.warnDuplicate(value);
- }
- return frag;
- },
-
- /**
- * Delete a fragment from cache.
- *
- * @param {Fragment} frag
- */
-
- deleteCachedFrag: function deleteCachedFrag(frag) {
- var value = frag.raw;
- var trackByKey = this.params.trackBy;
- var scope = frag.scope;
- var index = scope.$index;
- // fix #948: avoid accidentally fall through to
- // a parent repeater which happens to have $key.
- var key = hasOwn(scope, '$key') && scope.$key;
- var primitive = !isObject(value);
- if (trackByKey || key || primitive) {
- var id = getTrackByKey(index, key, value, trackByKey);
- this.cache[id] = null;
- } else {
- value[this.id] = null;
- frag.raw = null;
- }
- },
-
- /**
- * Get the stagger amount for an insertion/removal.
- *
- * @param {Fragment} frag
- * @param {Number} index
- * @param {Number} total
- * @param {String} type
- */
-
- getStagger: function getStagger(frag, index, total, type) {
- type = type + 'Stagger';
- var trans = frag.node.__v_trans;
- var hooks = trans && trans.hooks;
- var hook = hooks && (hooks[type] || hooks.stagger);
- return hook ? hook.call(frag, index, total) : index * parseInt(this.params[type] || this.params.stagger, 10);
- },
-
- /**
- * Pre-process the value before piping it through the
- * filters. This is passed to and called by the watcher.
- */
-
- _preProcess: function _preProcess(value) {
- // regardless of type, store the un-filtered raw value.
- this.rawValue = value;
- return value;
- },
-
- /**
- * Post-process the value after it has been piped through
- * the filters. This is passed to and called by the watcher.
- *
- * It is necessary for this to be called during the
- * watcher's dependency collection phase because we want
- * the v-for to update when the source Object is mutated.
- */
-
- _postProcess: function _postProcess(value) {
- if (isArray(value)) {
- return value;
- } else if (isPlainObject(value)) {
- // convert plain object to array.
- var keys = Object.keys(value);
- var i = keys.length;
- var res = new Array(i);
- var key;
- while (i--) {
- key = keys[i];
- res[i] = {
- $key: key,
- $value: value[key]
- };
- }
- return res;
- } else {
- if (typeof value === 'number' && !isNaN(value)) {
- value = range(value);
- }
- return value || [];
- }
- },
-
- unbind: function unbind() {
- if (this.descriptor.ref) {
- (this._scope || this.vm).$refs[this.descriptor.ref] = null;
- }
- if (this.frags) {
- var i = this.frags.length;
- var frag;
- while (i--) {
- frag = this.frags[i];
- this.deleteCachedFrag(frag);
- frag.destroy();
- }
- }
- }
- };
-
- /**
- * Helper to find the previous element that is a fragment
- * anchor. This is necessary because a destroyed frag's
- * element could still be lingering in the DOM before its
- * leaving transition finishes, but its inserted flag
- * should have been set to false so we can skip them.
- *
- * If this is a block repeat, we want to make sure we only
- * return frag that is bound to this v-for. (see #929)
- *
- * @param {Fragment} frag
- * @param {Comment|Text} anchor
- * @param {String} id
- * @return {Fragment}
- */
-
- function findPrevFrag(frag, anchor, id) {
- var el = frag.node.previousSibling;
- /* istanbul ignore if */
- if (!el) return;
- frag = el.__v_frag;
- while ((!frag || frag.forId !== id || !frag.inserted) && el !== anchor) {
- el = el.previousSibling;
- /* istanbul ignore if */
- if (!el) return;
- frag = el.__v_frag;
- }
- return frag;
- }
-
- /**
- * Create a range array from given number.
- *
- * @param {Number} n
- * @return {Array}
- */
-
- function range(n) {
- var i = -1;
- var ret = new Array(Math.floor(n));
- while (++i < n) {
- ret[i] = i;
- }
- return ret;
- }
-
- /**
- * Get the track by key for an item.
- *
- * @param {Number} index
- * @param {String} key
- * @param {*} value
- * @param {String} [trackByKey]
- */
-
- function getTrackByKey(index, key, value, trackByKey) {
- return trackByKey ? trackByKey === '$index' ? index : trackByKey.charAt(0).match(/\w/) ? getPath(value, trackByKey) : value[trackByKey] : key || value;
- }
-
- if (process.env.NODE_ENV !== 'production') {
- vFor.warnDuplicate = function (value) {
- warn('Duplicate value found in v-for="' + this.descriptor.raw + '": ' + JSON.stringify(value) + '. Use track-by="$index" if ' + 'you are expecting duplicate values.', this.vm);
- };
- }
-
- /**
- * Find a vm from a fragment.
- *
- * @param {Fragment} frag
- * @return {Vue|undefined}
- */
-
- function findVmFromFrag(frag) {
- var node = frag.node;
- // handle multi-node frag
- if (frag.end) {
- while (!node.__vue__ && node !== frag.end && node.nextSibling) {
- node = node.nextSibling;
- }
- }
- return node.__vue__;
- }
-
- var vIf = {
-
- priority: IF,
- terminal: true,
-
- bind: function bind() {
- var el = this.el;
- if (!el.__vue__) {
- // check else block
- var next = el.nextElementSibling;
- if (next && getAttr(next, 'v-else') !== null) {
- remove(next);
- this.elseEl = next;
- }
- // check main block
- this.anchor = createAnchor('v-if');
- replace(el, this.anchor);
- } else {
- process.env.NODE_ENV !== 'production' && warn('v-if="' + this.expression + '" cannot be ' + 'used on an instance root element.', this.vm);
- this.invalid = true;
- }
- },
-
- update: function update(value) {
- if (this.invalid) return;
- if (value) {
- if (!this.frag) {
- this.insert();
- }
- } else {
- this.remove();
- }
- },
-
- insert: function insert() {
- if (this.elseFrag) {
- this.elseFrag.remove();
- this.elseFrag = null;
- }
- // lazy init factory
- if (!this.factory) {
- this.factory = new FragmentFactory(this.vm, this.el);
- }
- this.frag = this.factory.create(this._host, this._scope, this._frag);
- this.frag.before(this.anchor);
- },
-
- remove: function remove() {
- if (this.frag) {
- this.frag.remove();
- this.frag = null;
- }
- if (this.elseEl && !this.elseFrag) {
- if (!this.elseFactory) {
- this.elseFactory = new FragmentFactory(this.elseEl._context || this.vm, this.elseEl);
- }
- this.elseFrag = this.elseFactory.create(this._host, this._scope, this._frag);
- this.elseFrag.before(this.anchor);
- }
- },
-
- unbind: function unbind() {
- if (this.frag) {
- this.frag.destroy();
- }
- if (this.elseFrag) {
- this.elseFrag.destroy();
- }
- }
- };
-
- var show = {
-
- bind: function bind() {
- // check else block
- var next = this.el.nextElementSibling;
- if (next && getAttr(next, 'v-else') !== null) {
- this.elseEl = next;
- }
- },
-
- update: function update(value) {
- this.apply(this.el, value);
- if (this.elseEl) {
- this.apply(this.elseEl, !value);
- }
- },
-
- apply: function apply(el, value) {
- if (inDoc(el)) {
- applyTransition(el, value ? 1 : -1, toggle, this.vm);
- } else {
- toggle();
- }
- function toggle() {
- el.style.display = value ? '' : 'none';
- }
- }
- };
-
- var text$2 = {
-
- bind: function bind() {
- var self = this;
- var el = this.el;
- var isRange = el.type === 'range';
- var lazy = this.params.lazy;
- var number = this.params.number;
- var debounce = this.params.debounce;
-
- // handle composition events.
- // http://blog.evanyou.me/2014/01/03/composition-event/
- // skip this for Android because it handles composition
- // events quite differently. Android doesn't trigger
- // composition events for language input methods e.g.
- // Chinese, but instead triggers them for spelling
- // suggestions... (see Discussion/#162)
- var composing = false;
- if (!isAndroid && !isRange) {
- this.on('compositionstart', function () {
- composing = true;
- });
- this.on('compositionend', function () {
- composing = false;
- // in IE11 the "compositionend" event fires AFTER
- // the "input" event, so the input handler is blocked
- // at the end... have to call it here.
- //
- // #1327: in lazy mode this is unecessary.
- if (!lazy) {
- self.listener();
- }
- });
- }
-
- // prevent messing with the input when user is typing,
- // and force update on blur.
- this.focused = false;
- if (!isRange && !lazy) {
- this.on('focus', function () {
- self.focused = true;
- });
- this.on('blur', function () {
- self.focused = false;
- // do not sync value after fragment removal (#2017)
- if (!self._frag || self._frag.inserted) {
- self.rawListener();
- }
- });
- }
-
- // Now attach the main listener
- this.listener = this.rawListener = function () {
- if (composing || !self._bound) {
- return;
- }
- var val = number || isRange ? toNumber(el.value) : el.value;
- self.set(val);
- // force update on next tick to avoid lock & same value
- // also only update when user is not typing
- nextTick(function () {
- if (self._bound && !self.focused) {
- self.update(self._watcher.value);
- }
- });
- };
-
- // apply debounce
- if (debounce) {
- this.listener = _debounce(this.listener, debounce);
- }
-
- // Support jQuery events, since jQuery.trigger() doesn't
- // trigger native events in some cases and some plugins
- // rely on $.trigger()
- //
- // We want to make sure if a listener is attached using
- // jQuery, it is also removed with jQuery, that's why
- // we do the check for each directive instance and
- // store that check result on itself. This also allows
- // easier test coverage control by unsetting the global
- // jQuery variable in tests.
- this.hasjQuery = typeof jQuery === 'function';
- if (this.hasjQuery) {
- var method = jQuery.fn.on ? 'on' : 'bind';
- jQuery(el)[method]('change', this.rawListener);
- if (!lazy) {
- jQuery(el)[method]('input', this.listener);
- }
- } else {
- this.on('change', this.rawListener);
- if (!lazy) {
- this.on('input', this.listener);
- }
- }
-
- // IE9 doesn't fire input event on backspace/del/cut
- if (!lazy && isIE9) {
- this.on('cut', function () {
- nextTick(self.listener);
- });
- this.on('keyup', function (e) {
- if (e.keyCode === 46 || e.keyCode === 8) {
- self.listener();
- }
- });
- }
-
- // set initial value if present
- if (el.hasAttribute('value') || el.tagName === 'TEXTAREA' && el.value.trim()) {
- this.afterBind = this.listener;
- }
- },
-
- update: function update(value) {
- // #3029 only update when the value changes. This prevent
- // browsers from overwriting values like selectionStart
- value = _toString(value);
- if (value !== this.el.value) this.el.value = value;
- },
-
- unbind: function unbind() {
- var el = this.el;
- if (this.hasjQuery) {
- var method = jQuery.fn.off ? 'off' : 'unbind';
- jQuery(el)[method]('change', this.listener);
- jQuery(el)[method]('input', this.listener);
- }
- }
- };
-
- var radio = {
-
- bind: function bind() {
- var self = this;
- var el = this.el;
-
- this.getValue = function () {
- // value overwrite via v-bind:value
- if (el.hasOwnProperty('_value')) {
- return el._value;
- }
- var val = el.value;
- if (self.params.number) {
- val = toNumber(val);
- }
- return val;
- };
-
- this.listener = function () {
- self.set(self.getValue());
- };
- this.on('change', this.listener);
-
- if (el.hasAttribute('checked')) {
- this.afterBind = this.listener;
- }
- },
-
- update: function update(value) {
- this.el.checked = looseEqual(value, this.getValue());
- }
- };
-
- var select = {
-
- bind: function bind() {
- var _this = this;
-
- var self = this;
- var el = this.el;
-
- // method to force update DOM using latest value.
- this.forceUpdate = function () {
- if (self._watcher) {
- self.update(self._watcher.get());
- }
- };
-
- // check if this is a multiple select
- var multiple = this.multiple = el.hasAttribute('multiple');
-
- // attach listener
- this.listener = function () {
- var value = getValue(el, multiple);
- value = self.params.number ? isArray(value) ? value.map(toNumber) : toNumber(value) : value;
- self.set(value);
- };
- this.on('change', this.listener);
-
- // if has initial value, set afterBind
- var initValue = getValue(el, multiple, true);
- if (multiple && initValue.length || !multiple && initValue !== null) {
- this.afterBind = this.listener;
- }
-
- // All major browsers except Firefox resets
- // selectedIndex with value -1 to 0 when the element
- // is appended to a new parent, therefore we have to
- // force a DOM update whenever that happens...
- this.vm.$on('hook:attached', function () {
- nextTick(_this.forceUpdate);
- });
- if (!inDoc(el)) {
- nextTick(this.forceUpdate);
- }
- },
-
- update: function update(value) {
- var el = this.el;
- el.selectedIndex = -1;
- var multi = this.multiple && isArray(value);
- var options = el.options;
- var i = options.length;
- var op, val;
- while (i--) {
- op = options[i];
- val = op.hasOwnProperty('_value') ? op._value : op.value;
- /* eslint-disable eqeqeq */
- op.selected = multi ? indexOf$1(value, val) > -1 : looseEqual(value, val);
- /* eslint-enable eqeqeq */
- }
- },
-
- unbind: function unbind() {
- /* istanbul ignore next */
- this.vm.$off('hook:attached', this.forceUpdate);
- }
- };
-
- /**
- * Get select value
- *
- * @param {SelectElement} el
- * @param {Boolean} multi
- * @param {Boolean} init
- * @return {Array|*}
- */
-
- function getValue(el, multi, init) {
- var res = multi ? [] : null;
- var op, val, selected;
- for (var i = 0, l = el.options.length; i < l; i++) {
- op = el.options[i];
- selected = init ? op.hasAttribute('selected') : op.selected;
- if (selected) {
- val = op.hasOwnProperty('_value') ? op._value : op.value;
- if (multi) {
- res.push(val);
- } else {
- return val;
- }
- }
- }
- return res;
- }
-
- /**
- * Native Array.indexOf uses strict equal, but in this
- * case we need to match string/numbers with custom equal.
- *
- * @param {Array} arr
- * @param {*} val
- */
-
- function indexOf$1(arr, val) {
- var i = arr.length;
- while (i--) {
- if (looseEqual(arr[i], val)) {
- return i;
- }
- }
- return -1;
- }
-
- var checkbox = {
-
- bind: function bind() {
- var self = this;
- var el = this.el;
-
- this.getValue = function () {
- return el.hasOwnProperty('_value') ? el._value : self.params.number ? toNumber(el.value) : el.value;
- };
-
- function getBooleanValue() {
- var val = el.checked;
- if (val && el.hasOwnProperty('_trueValue')) {
- return el._trueValue;
- }
- if (!val && el.hasOwnProperty('_falseValue')) {
- return el._falseValue;
- }
- return val;
- }
-
- this.listener = function () {
- var model = self._watcher.get();
- if (isArray(model)) {
- var val = self.getValue();
- var i = indexOf(model, val);
- if (el.checked) {
- if (i < 0) {
- self.set(model.concat(val));
- }
- } else if (i > -1) {
- self.set(model.slice(0, i).concat(model.slice(i + 1)));
- }
- } else {
- self.set(getBooleanValue());
- }
- };
-
- this.on('change', this.listener);
- if (el.hasAttribute('checked')) {
- this.afterBind = this.listener;
- }
- },
-
- update: function update(value) {
- var el = this.el;
- if (isArray(value)) {
- el.checked = indexOf(value, this.getValue()) > -1;
- } else {
- if (el.hasOwnProperty('_trueValue')) {
- el.checked = looseEqual(value, el._trueValue);
- } else {
- el.checked = !!value;
- }
- }
- }
- };
-
- var handlers = {
- text: text$2,
- radio: radio,
- select: select,
- checkbox: checkbox
- };
-
- var model = {
-
- priority: MODEL,
- twoWay: true,
- handlers: handlers,
- params: ['lazy', 'number', 'debounce'],
-
- /**
- * Possible elements:
- * <select>
- * <textarea>
- * <input type="*">
- * - text
- * - checkbox
- * - radio
- * - number
- */
-
- bind: function bind() {
- // friendly warning...
- this.checkFilters();
- if (this.hasRead && !this.hasWrite) {
- process.env.NODE_ENV !== 'production' && warn('It seems you are using a read-only filter with ' + 'v-model="' + this.descriptor.raw + '". ' + 'You might want to use a two-way filter to ensure correct behavior.', this.vm);
- }
- var el = this.el;
- var tag = el.tagName;
- var handler;
- if (tag === 'INPUT') {
- handler = handlers[el.type] || handlers.text;
- } else if (tag === 'SELECT') {
- handler = handlers.select;
- } else if (tag === 'TEXTAREA') {
- handler = handlers.text;
- } else {
- process.env.NODE_ENV !== 'production' && warn('v-model does not support element type: ' + tag, this.vm);
- return;
- }
- el.__v_model = this;
- handler.bind.call(this);
- this.update = handler.update;
- this._unbind = handler.unbind;
- },
-
- /**
- * Check read/write filter stats.
- */
-
- checkFilters: function checkFilters() {
- var filters = this.filters;
- if (!filters) return;
- var i = filters.length;
- while (i--) {
- var filter = resolveAsset(this.vm.$options, 'filters', filters[i].name);
- if (typeof filter === 'function' || filter.read) {
- this.hasRead = true;
- }
- if (filter.write) {
- this.hasWrite = true;
- }
- }
- },
-
- unbind: function unbind() {
- this.el.__v_model = null;
- this._unbind && this._unbind();
- }
- };
-
- // keyCode aliases
- var keyCodes = {
- esc: 27,
- tab: 9,
- enter: 13,
- space: 32,
- 'delete': [8, 46],
- up: 38,
- left: 37,
- right: 39,
- down: 40
- };
-
- function keyFilter(handler, keys) {
- var codes = keys.map(function (key) {
- var charCode = key.charCodeAt(0);
- if (charCode > 47 && charCode < 58) {
- return parseInt(key, 10);
- }
- if (key.length === 1) {
- charCode = key.toUpperCase().charCodeAt(0);
- if (charCode > 64 && charCode < 91) {
- return charCode;
- }
- }
- return keyCodes[key];
- });
- codes = [].concat.apply([], codes);
- return function keyHandler(e) {
- if (codes.indexOf(e.keyCode) > -1) {
- return handler.call(this, e);
- }
- };
- }
-
- function stopFilter(handler) {
- return function stopHandler(e) {
- e.stopPropagation();
- return handler.call(this, e);
- };
- }
-
- function preventFilter(handler) {
- return function preventHandler(e) {
- e.preventDefault();
- return handler.call(this, e);
- };
- }
-
- function selfFilter(handler) {
- return function selfHandler(e) {
- if (e.target === e.currentTarget) {
- return handler.call(this, e);
- }
- };
- }
-
- var on$1 = {
-
- priority: ON,
- acceptStatement: true,
- keyCodes: keyCodes,
-
- bind: function bind() {
- // deal with iframes
- if (this.el.tagName === 'IFRAME' && this.arg !== 'load') {
- var self = this;
- this.iframeBind = function () {
- on(self.el.contentWindow, self.arg, self.handler, self.modifiers.capture);
- };
- this.on('load', this.iframeBind);
- }
- },
-
- update: function update(handler) {
- // stub a noop for v-on with no value,
- // e.g. @mousedown.prevent
- if (!this.descriptor.raw) {
- handler = function () {};
- }
-
- if (typeof handler !== 'function') {
- process.env.NODE_ENV !== 'production' && warn('v-on:' + this.arg + '="' + this.expression + '" expects a function value, ' + 'got ' + handler, this.vm);
- return;
- }
-
- // apply modifiers
- if (this.modifiers.stop) {
- handler = stopFilter(handler);
- }
- if (this.modifiers.prevent) {
- handler = preventFilter(handler);
- }
- if (this.modifiers.self) {
- handler = selfFilter(handler);
- }
- // key filter
- var keys = Object.keys(this.modifiers).filter(function (key) {
- return key !== 'stop' && key !== 'prevent' && key !== 'self' && key !== 'capture';
- });
- if (keys.length) {
- handler = keyFilter(handler, keys);
- }
-
- this.reset();
- this.handler = handler;
-
- if (this.iframeBind) {
- this.iframeBind();
- } else {
- on(this.el, this.arg, this.handler, this.modifiers.capture);
- }
- },
-
- reset: function reset() {
- var el = this.iframeBind ? this.el.contentWindow : this.el;
- if (this.handler) {
- off(el, this.arg, this.handler);
- }
- },
-
- unbind: function unbind() {
- this.reset();
- }
- };
-
- var prefixes = ['-webkit-', '-moz-', '-ms-'];
- var camelPrefixes = ['Webkit', 'Moz', 'ms'];
- var importantRE = /!important;?$/;
- var propCache = Object.create(null);
-
- var testEl = null;
-
- var style = {
-
- deep: true,
-
- update: function update(value) {
- if (typeof value === 'string') {
- this.el.style.cssText = value;
- } else if (isArray(value)) {
- this.handleObject(value.reduce(extend, {}));
- } else {
- this.handleObject(value || {});
- }
- },
-
- handleObject: function handleObject(value) {
- // cache object styles so that only changed props
- // are actually updated.
- var cache = this.cache || (this.cache = {});
- var name, val;
- for (name in cache) {
- if (!(name in value)) {
- this.handleSingle(name, null);
- delete cache[name];
- }
- }
- for (name in value) {
- val = value[name];
- if (val !== cache[name]) {
- cache[name] = val;
- this.handleSingle(name, val);
- }
- }
- },
-
- handleSingle: function handleSingle(prop, value) {
- prop = normalize(prop);
- if (!prop) return; // unsupported prop
- // cast possible numbers/booleans into strings
- if (value != null) value += '';
- if (value) {
- var isImportant = importantRE.test(value) ? 'important' : '';
- if (isImportant) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- warn('It\'s probably a bad idea to use !important with inline rules. ' + 'This feature will be deprecated in a future version of Vue.');
- }
- value = value.replace(importantRE, '').trim();
- this.el.style.setProperty(prop.kebab, value, isImportant);
- } else {
- this.el.style[prop.camel] = value;
- }
- } else {
- this.el.style[prop.camel] = '';
- }
- }
-
- };
-
- /**
- * Normalize a CSS property name.
- * - cache result
- * - auto prefix
- * - camelCase -> dash-case
- *
- * @param {String} prop
- * @return {String}
- */
-
- function normalize(prop) {
- if (propCache[prop]) {
- return propCache[prop];
- }
- var res = prefix(prop);
- propCache[prop] = propCache[res] = res;
- return res;
- }
-
- /**
- * Auto detect the appropriate prefix for a CSS property.
- * https://gist.github.com/paulirish/523692
- *
- * @param {String} prop
- * @return {String}
- */
-
- function prefix(prop) {
- prop = hyphenate(prop);
- var camel = camelize(prop);
- var upper = camel.charAt(0).toUpperCase() + camel.slice(1);
- if (!testEl) {
- testEl = document.createElement('div');
- }
- var i = prefixes.length;
- var prefixed;
- if (camel !== 'filter' && camel in testEl.style) {
- return {
- kebab: prop,
- camel: camel
- };
- }
- while (i--) {
- prefixed = camelPrefixes[i] + upper;
- if (prefixed in testEl.style) {
- return {
- kebab: prefixes[i] + prop,
- camel: prefixed
- };
- }
- }
- }
-
- // xlink
- var xlinkNS = 'http://www.w3.org/1999/xlink';
- var xlinkRE = /^xlink:/;
-
- // check for attributes that prohibit interpolations
- var disallowedInterpAttrRE = /^v-|^:|^@|^(?:is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/;
- // these attributes should also set their corresponding properties
- // because they only affect the initial state of the element
- var attrWithPropsRE = /^(?:value|checked|selected|muted)$/;
- // these attributes expect enumrated values of "true" or "false"
- // but are not boolean attributes
- var enumeratedAttrRE = /^(?:draggable|contenteditable|spellcheck)$/;
-
- // these attributes should set a hidden property for
- // binding v-model to object values
- var modelProps = {
- value: '_value',
- 'true-value': '_trueValue',
- 'false-value': '_falseValue'
- };
-
- var bind$1 = {
-
- priority: BIND,
-
- bind: function bind() {
- var attr = this.arg;
- var tag = this.el.tagName;
- // should be deep watch on object mode
- if (!attr) {
- this.deep = true;
- }
- // handle interpolation bindings
- var descriptor = this.descriptor;
- var tokens = descriptor.interp;
- if (tokens) {
- // handle interpolations with one-time tokens
- if (descriptor.hasOneTime) {
- this.expression = tokensToExp(tokens, this._scope || this.vm);
- }
-
- // only allow binding on native attributes
- if (disallowedInterpAttrRE.test(attr) || attr === 'name' && (tag === 'PARTIAL' || tag === 'SLOT')) {
- process.env.NODE_ENV !== 'production' && warn(attr + '="' + descriptor.raw + '": ' + 'attribute interpolation is not allowed in Vue.js ' + 'directives and special attributes.', this.vm);
- this.el.removeAttribute(attr);
- this.invalid = true;
- }
-
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- var raw = attr + '="' + descriptor.raw + '": ';
- // warn src
- if (attr === 'src') {
- warn(raw + 'interpolation in "src" attribute will cause ' + 'a 404 request. Use v-bind:src instead.', this.vm);
- }
-
- // warn style
- if (attr === 'style') {
- warn(raw + 'interpolation in "style" attribute will cause ' + 'the attribute to be discarded in Internet Explorer. ' + 'Use v-bind:style instead.', this.vm);
- }
- }
- }
- },
-
- update: function update(value) {
- if (this.invalid) {
- return;
- }
- var attr = this.arg;
- if (this.arg) {
- this.handleSingle(attr, value);
- } else {
- this.handleObject(value || {});
- }
- },
-
- // share object handler with v-bind:class
- handleObject: style.handleObject,
-
- handleSingle: function handleSingle(attr, value) {
- var el = this.el;
- var interp = this.descriptor.interp;
- if (this.modifiers.camel) {
- attr = camelize(attr);
- }
- if (!interp && attrWithPropsRE.test(attr) && attr in el) {
- var attrValue = attr === 'value' ? value == null // IE9 will set input.value to "null" for null...
- ? '' : value : value;
-
- if (el[attr] !== attrValue) {
- el[attr] = attrValue;
- }
- }
- // set model props
- var modelProp = modelProps[attr];
- if (!interp && modelProp) {
- el[modelProp] = value;
- // update v-model if present
- var model = el.__v_model;
- if (model) {
- model.listener();
- }
- }
- // do not set value attribute for textarea
- if (attr === 'value' && el.tagName === 'TEXTAREA') {
- el.removeAttribute(attr);
- return;
- }
- // update attribute
- if (enumeratedAttrRE.test(attr)) {
- el.setAttribute(attr, value ? 'true' : 'false');
- } else if (value != null && value !== false) {
- if (attr === 'class') {
- // handle edge case #1960:
- // class interpolation should not overwrite Vue transition class
- if (el.__v_trans) {
- value += ' ' + el.__v_trans.id + '-transition';
- }
- setClass(el, value);
- } else if (xlinkRE.test(attr)) {
- el.setAttributeNS(xlinkNS, attr, value === true ? '' : value);
- } else {
- el.setAttribute(attr, value === true ? '' : value);
- }
- } else {
- el.removeAttribute(attr);
- }
- }
- };
-
- var el = {
-
- priority: EL,
-
- bind: function bind() {
- /* istanbul ignore if */
- if (!this.arg) {
- return;
- }
- var id = this.id = camelize(this.arg);
- var refs = (this._scope || this.vm).$els;
- if (hasOwn(refs, id)) {
- refs[id] = this.el;
- } else {
- defineReactive(refs, id, this.el);
- }
- },
-
- unbind: function unbind() {
- var refs = (this._scope || this.vm).$els;
- if (refs[this.id] === this.el) {
- refs[this.id] = null;
- }
- }
- };
-
- var ref = {
- bind: function bind() {
- process.env.NODE_ENV !== 'production' && warn('v-ref:' + this.arg + ' must be used on a child ' + 'component. Found on <' + this.el.tagName.toLowerCase() + '>.', this.vm);
- }
- };
-
- var cloak = {
- bind: function bind() {
- var el = this.el;
- this.vm.$once('pre-hook:compiled', function () {
- el.removeAttribute('v-cloak');
- });
- }
- };
-
- // logic control
- // two-way binding
- // event handling
- // attributes
- // ref & el
- // cloak
- // must export plain object
- var directives = {
- text: text$1,
- html: html,
- 'for': vFor,
- 'if': vIf,
- show: show,
- model: model,
- on: on$1,
- bind: bind$1,
- el: el,
- ref: ref,
- cloak: cloak
- };
-
- var vClass = {
-
- deep: true,
-
- update: function update(value) {
- if (!value) {
- this.cleanup();
- } else if (typeof value === 'string') {
- this.setClass(value.trim().split(/\s+/));
- } else {
- this.setClass(normalize$1(value));
- }
- },
-
- setClass: function setClass(value) {
- this.cleanup(value);
- for (var i = 0, l = value.length; i < l; i++) {
- var val = value[i];
- if (val) {
- apply(this.el, val, addClass);
- }
- }
- this.prevKeys = value;
- },
-
- cleanup: function cleanup(value) {
- var prevKeys = this.prevKeys;
- if (!prevKeys) return;
- var i = prevKeys.length;
- while (i--) {
- var key = prevKeys[i];
- if (!value || value.indexOf(key) < 0) {
- apply(this.el, key, removeClass);
- }
- }
- }
- };
-
- /**
- * Normalize objects and arrays (potentially containing objects)
- * into array of strings.
- *
- * @param {Object|Array<String|Object>} value
- * @return {Array<String>}
- */
-
- function normalize$1(value) {
- var res = [];
- if (isArray(value)) {
- for (var i = 0, l = value.length; i < l; i++) {
- var _key = value[i];
- if (_key) {
- if (typeof _key === 'string') {
- res.push(_key);
- } else {
- for (var k in _key) {
- if (_key[k]) res.push(k);
- }
- }
- }
- }
- } else if (isObject(value)) {
- for (var key in value) {
- if (value[key]) res.push(key);
- }
- }
- return res;
- }
-
- /**
- * Add or remove a class/classes on an element
- *
- * @param {Element} el
- * @param {String} key The class name. This may or may not
- * contain a space character, in such a
- * case we'll deal with multiple class
- * names at once.
- * @param {Function} fn
- */
-
- function apply(el, key, fn) {
- key = key.trim();
- if (key.indexOf(' ') === -1) {
- fn(el, key);
- return;
- }
- // The key contains one or more space characters.
- // Since a class name doesn't accept such characters, we
- // treat it as multiple classes.
- var keys = key.split(/\s+/);
- for (var i = 0, l = keys.length; i < l; i++) {
- fn(el, keys[i]);
- }
- }
-
- var component = {
-
- priority: COMPONENT,
-
- params: ['keep-alive', 'transition-mode', 'inline-template'],
-
- /**
- * Setup. Two possible usages:
- *
- * - static:
- * <comp> or <div v-component="comp">
- *
- * - dynamic:
- * <component :is="view">
- */
-
- bind: function bind() {
- if (!this.el.__vue__) {
- // keep-alive cache
- this.keepAlive = this.params.keepAlive;
- if (this.keepAlive) {
- this.cache = {};
- }
- // check inline-template
- if (this.params.inlineTemplate) {
- // extract inline template as a DocumentFragment
- this.inlineTemplate = extractContent(this.el, true);
- }
- // component resolution related state
- this.pendingComponentCb = this.Component = null;
- // transition related state
- this.pendingRemovals = 0;
- this.pendingRemovalCb = null;
- // create a ref anchor
- this.anchor = createAnchor('v-component');
- replace(this.el, this.anchor);
- // remove is attribute.
- // this is removed during compilation, but because compilation is
- // cached, when the component is used elsewhere this attribute
- // will remain at link time.
- this.el.removeAttribute('is');
- this.el.removeAttribute(':is');
- // remove ref, same as above
- if (this.descriptor.ref) {
- this.el.removeAttribute('v-ref:' + hyphenate(this.descriptor.ref));
- }
- // if static, build right now.
- if (this.literal) {
- this.setComponent(this.expression);
- }
- } else {
- process.env.NODE_ENV !== 'production' && warn('cannot mount component "' + this.expression + '" ' + 'on already mounted element: ' + this.el);
- }
- },
-
- /**
- * Public update, called by the watcher in the dynamic
- * literal scenario, e.g. <component :is="view">
- */
-
- update: function update(value) {
- if (!this.literal) {
- this.setComponent(value);
- }
- },
-
- /**
- * Switch dynamic components. May resolve the component
- * asynchronously, and perform transition based on
- * specified transition mode. Accepts a few additional
- * arguments specifically for vue-router.
- *
- * The callback is called when the full transition is
- * finished.
- *
- * @param {String} value
- * @param {Function} [cb]
- */
-
- setComponent: function setComponent(value, cb) {
- this.invalidatePending();
- if (!value) {
- // just remove current
- this.unbuild(true);
- this.remove(this.childVM, cb);
- this.childVM = null;
- } else {
- var self = this;
- this.resolveComponent(value, function () {
- self.mountComponent(cb);
- });
- }
- },
-
- /**
- * Resolve the component constructor to use when creating
- * the child vm.
- *
- * @param {String|Function} value
- * @param {Function} cb
- */
-
- resolveComponent: function resolveComponent(value, cb) {
- var self = this;
- this.pendingComponentCb = cancellable(function (Component) {
- self.ComponentName = Component.options.name || (typeof value === 'string' ? value : null);
- self.Component = Component;
- cb();
- });
- this.vm._resolveComponent(value, this.pendingComponentCb);
- },
-
- /**
- * Create a new instance using the current constructor and
- * replace the existing instance. This method doesn't care
- * whether the new component and the old one are actually
- * the same.
- *
- * @param {Function} [cb]
- */
-
- mountComponent: function mountComponent(cb) {
- // actual mount
- this.unbuild(true);
- var self = this;
- var activateHooks = this.Component.options.activate;
- var cached = this.getCached();
- var newComponent = this.build();
- if (activateHooks && !cached) {
- this.waitingFor = newComponent;
- callActivateHooks(activateHooks, newComponent, function () {
- if (self.waitingFor !== newComponent) {
- return;
- }
- self.waitingFor = null;
- self.transition(newComponent, cb);
- });
- } else {
- // update ref for kept-alive component
- if (cached) {
- newComponent._updateRef();
- }
- this.transition(newComponent, cb);
- }
- },
-
- /**
- * When the component changes or unbinds before an async
- * constructor is resolved, we need to invalidate its
- * pending callback.
- */
-
- invalidatePending: function invalidatePending() {
- if (this.pendingComponentCb) {
- this.pendingComponentCb.cancel();
- this.pendingComponentCb = null;
- }
- },
-
- /**
- * Instantiate/insert a new child vm.
- * If keep alive and has cached instance, insert that
- * instance; otherwise build a new one and cache it.
- *
- * @param {Object} [extraOptions]
- * @return {Vue} - the created instance
- */
-
- build: function build(extraOptions) {
- var cached = this.getCached();
- if (cached) {
- return cached;
- }
- if (this.Component) {
- // default options
- var options = {
- name: this.ComponentName,
- el: cloneNode(this.el),
- template: this.inlineTemplate,
- // make sure to add the child with correct parent
- // if this is a transcluded component, its parent
- // should be the transclusion host.
- parent: this._host || this.vm,
- // if no inline-template, then the compiled
- // linker can be cached for better performance.
- _linkerCachable: !this.inlineTemplate,
- _ref: this.descriptor.ref,
- _asComponent: true,
- _isRouterView: this._isRouterView,
- // if this is a transcluded component, context
- // will be the common parent vm of this instance
- // and its host.
- _context: this.vm,
- // if this is inside an inline v-for, the scope
- // will be the intermediate scope created for this
- // repeat fragment. this is used for linking props
- // and container directives.
- _scope: this._scope,
- // pass in the owner fragment of this component.
- // this is necessary so that the fragment can keep
- // track of its contained components in order to
- // call attach/detach hooks for them.
- _frag: this._frag
- };
- // extra options
- // in 1.0.0 this is used by vue-router only
- /* istanbul ignore if */
- if (extraOptions) {
- extend(options, extraOptions);
- }
- var child = new this.Component(options);
- if (this.keepAlive) {
- this.cache[this.Component.cid] = child;
- }
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production' && this.el.hasAttribute('transition') && child._isFragment) {
- warn('Transitions will not work on a fragment instance. ' + 'Template: ' + child.$options.template, child);
- }
- return child;
- }
- },
-
- /**
- * Try to get a cached instance of the current component.
- *
- * @return {Vue|undefined}
- */
-
- getCached: function getCached() {
- return this.keepAlive && this.cache[this.Component.cid];
- },
-
- /**
- * Teardown the current child, but defers cleanup so
- * that we can separate the destroy and removal steps.
- *
- * @param {Boolean} defer
- */
-
- unbuild: function unbuild(defer) {
- if (this.waitingFor) {
- if (!this.keepAlive) {
- this.waitingFor.$destroy();
- }
- this.waitingFor = null;
- }
- var child = this.childVM;
- if (!child || this.keepAlive) {
- if (child) {
- // remove ref
- child._inactive = true;
- child._updateRef(true);
- }
- return;
- }
- // the sole purpose of `deferCleanup` is so that we can
- // "deactivate" the vm right now and perform DOM removal
- // later.
- child.$destroy(false, defer);
- },
-
- /**
- * Remove current destroyed child and manually do
- * the cleanup after removal.
- *
- * @param {Function} cb
- */
-
- remove: function remove(child, cb) {
- var keepAlive = this.keepAlive;
- if (child) {
- // we may have a component switch when a previous
- // component is still being transitioned out.
- // we want to trigger only one lastest insertion cb
- // when the existing transition finishes. (#1119)
- this.pendingRemovals++;
- this.pendingRemovalCb = cb;
- var self = this;
- child.$remove(function () {
- self.pendingRemovals--;
- if (!keepAlive) child._cleanup();
- if (!self.pendingRemovals && self.pendingRemovalCb) {
- self.pendingRemovalCb();
- self.pendingRemovalCb = null;
- }
- });
- } else if (cb) {
- cb();
- }
- },
-
- /**
- * Actually swap the components, depending on the
- * transition mode. Defaults to simultaneous.
- *
- * @param {Vue} target
- * @param {Function} [cb]
- */
-
- transition: function transition(target, cb) {
- var self = this;
- var current = this.childVM;
- // for devtool inspection
- if (current) current._inactive = true;
- target._inactive = false;
- this.childVM = target;
- switch (self.params.transitionMode) {
- case 'in-out':
- target.$before(self.anchor, function () {
- self.remove(current, cb);
- });
- break;
- case 'out-in':
- self.remove(current, function () {
- target.$before(self.anchor, cb);
- });
- break;
- default:
- self.remove(current);
- target.$before(self.anchor, cb);
- }
- },
-
- /**
- * Unbind.
- */
-
- unbind: function unbind() {
- this.invalidatePending();
- // Do not defer cleanup when unbinding
- this.unbuild();
- // destroy all keep-alive cached instances
- if (this.cache) {
- for (var key in this.cache) {
- this.cache[key].$destroy();
- }
- this.cache = null;
- }
- }
- };
-
- /**
- * Call activate hooks in order (asynchronous)
- *
- * @param {Array} hooks
- * @param {Vue} vm
- * @param {Function} cb
- */
-
- function callActivateHooks(hooks, vm, cb) {
- var total = hooks.length;
- var called = 0;
- hooks[0].call(vm, next);
- function next() {
- if (++called >= total) {
- cb();
- } else {
- hooks[called].call(vm, next);
- }
- }
- }
-
- var propBindingModes = config._propBindingModes;
- var empty = {};
-
- // regexes
- var identRE$1 = /^[$_a-zA-Z]+[\w$]*$/;
- var settablePathRE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\[[^\[\]]+\])*$/;
-
- /**
- * Compile props on a root element and return
- * a props link function.
- *
- * @param {Element|DocumentFragment} el
- * @param {Array} propOptions
- * @param {Vue} vm
- * @return {Function} propsLinkFn
- */
-
- function compileProps(el, propOptions, vm) {
- var props = [];
- var propsData = vm.$options.propsData;
- var names = Object.keys(propOptions);
- var i = names.length;
- var options, name, attr, value, path, parsed, prop;
- while (i--) {
- name = names[i];
- options = propOptions[name] || empty;
-
- if (process.env.NODE_ENV !== 'production' && name === '$data') {
- warn('Do not use $data as prop.', vm);
- continue;
- }
-
- // props could contain dashes, which will be
- // interpreted as minus calculations by the parser
- // so we need to camelize the path here
- path = camelize(name);
- if (!identRE$1.test(path)) {
- process.env.NODE_ENV !== 'production' && warn('Invalid prop key: "' + name + '". Prop keys ' + 'must be valid identifiers.', vm);
- continue;
- }
-
- prop = {
- name: name,
- path: path,
- options: options,
- mode: propBindingModes.ONE_WAY,
- raw: null
- };
-
- attr = hyphenate(name);
- // first check dynamic version
- if ((value = getBindAttr(el, attr)) === null) {
- if ((value = getBindAttr(el, attr + '.sync')) !== null) {
- prop.mode = propBindingModes.TWO_WAY;
- } else if ((value = getBindAttr(el, attr + '.once')) !== null) {
- prop.mode = propBindingModes.ONE_TIME;
- }
- }
- if (value !== null) {
- // has dynamic binding!
- prop.raw = value;
- parsed = parseDirective(value);
- value = parsed.expression;
- prop.filters = parsed.filters;
- // check binding type
- if (isLiteral(value) && !parsed.filters) {
- // for expressions containing literal numbers and
- // booleans, there's no need to setup a prop binding,
- // so we can optimize them as a one-time set.
- prop.optimizedLiteral = true;
- } else {
- prop.dynamic = true;
- // check non-settable path for two-way bindings
- if (process.env.NODE_ENV !== 'production' && prop.mode === propBindingModes.TWO_WAY && !settablePathRE.test(value)) {
- prop.mode = propBindingModes.ONE_WAY;
- warn('Cannot bind two-way prop with non-settable ' + 'parent path: ' + value, vm);
- }
- }
- prop.parentPath = value;
-
- // warn required two-way
- if (process.env.NODE_ENV !== 'production' && options.twoWay && prop.mode !== propBindingModes.TWO_WAY) {
- warn('Prop "' + name + '" expects a two-way binding type.', vm);
- }
- } else if ((value = getAttr(el, attr)) !== null) {
- // has literal binding!
- prop.raw = value;
- } else if (propsData && (value = propsData[name] || propsData[path]) !== null) {
- // has propsData
- prop.raw = value;
- } else if (process.env.NODE_ENV !== 'production') {
- // check possible camelCase prop usage
- var lowerCaseName = path.toLowerCase();
- value = /[A-Z\-]/.test(name) && (el.getAttribute(lowerCaseName) || el.getAttribute(':' + lowerCaseName) || el.getAttribute('v-bind:' + lowerCaseName) || el.getAttribute(':' + lowerCaseName + '.once') || el.getAttribute('v-bind:' + lowerCaseName + '.once') || el.getAttribute(':' + lowerCaseName + '.sync') || el.getAttribute('v-bind:' + lowerCaseName + '.sync'));
- if (value) {
- warn('Possible usage error for prop `' + lowerCaseName + '` - ' + 'did you mean `' + attr + '`? HTML is case-insensitive, remember to use ' + 'kebab-case for props in templates.', vm);
- } else if (options.required && (!propsData || !(name in propsData) && !(path in propsData))) {
- // warn missing required
- warn('Missing required prop: ' + name, vm);
- }
- }
- // push prop
- props.push(prop);
- }
- return makePropsLinkFn(props);
- }
-
- /**
- * Build a function that applies props to a vm.
- *
- * @param {Array} props
- * @return {Function} propsLinkFn
- */
-
- function makePropsLinkFn(props) {
- return function propsLinkFn(vm, scope) {
- // store resolved props info
- vm._props = {};
- var inlineProps = vm.$options.propsData;
- var i = props.length;
- var prop, path, options, value, raw;
- while (i--) {
- prop = props[i];
- raw = prop.raw;
- path = prop.path;
- options = prop.options;
- vm._props[path] = prop;
- if (inlineProps && hasOwn(inlineProps, path)) {
- initProp(vm, prop, inlineProps[path]);
- }if (raw === null) {
- // initialize absent prop
- initProp(vm, prop, undefined);
- } else if (prop.dynamic) {
- // dynamic prop
- if (prop.mode === propBindingModes.ONE_TIME) {
- // one time binding
- value = (scope || vm._context || vm).$get(prop.parentPath);
- initProp(vm, prop, value);
- } else {
- if (vm._context) {
- // dynamic binding
- vm._bindDir({
- name: 'prop',
- def: propDef,
- prop: prop
- }, null, null, scope); // el, host, scope
- } else {
- // root instance
- initProp(vm, prop, vm.$get(prop.parentPath));
- }
- }
- } else if (prop.optimizedLiteral) {
- // optimized literal, cast it and just set once
- var stripped = stripQuotes(raw);
- value = stripped === raw ? toBoolean(toNumber(raw)) : stripped;
- initProp(vm, prop, value);
- } else {
- // string literal, but we need to cater for
- // Boolean props with no value, or with same
- // literal value (e.g. disabled="disabled")
- // see https://github.com/vuejs/vue-loader/issues/182
- value = options.type === Boolean && (raw === '' || raw === hyphenate(prop.name)) ? true : raw;
- initProp(vm, prop, value);
- }
- }
- };
- }
-
- /**
- * Process a prop with a rawValue, applying necessary coersions,
- * default values & assertions and call the given callback with
- * processed value.
- *
- * @param {Vue} vm
- * @param {Object} prop
- * @param {*} rawValue
- * @param {Function} fn
- */
-
- function processPropValue(vm, prop, rawValue, fn) {
- var isSimple = prop.dynamic && isSimplePath(prop.parentPath);
- var value = rawValue;
- if (value === undefined) {
- value = getPropDefaultValue(vm, prop);
- }
- value = coerceProp(prop, value, vm);
- var coerced = value !== rawValue;
- if (!assertProp(prop, value, vm)) {
- value = undefined;
- }
- if (isSimple && !coerced) {
- withoutConversion(function () {
- fn(value);
- });
- } else {
- fn(value);
- }
- }
-
- /**
- * Set a prop's initial value on a vm and its data object.
- *
- * @param {Vue} vm
- * @param {Object} prop
- * @param {*} value
- */
-
- function initProp(vm, prop, value) {
- processPropValue(vm, prop, value, function (value) {
- defineReactive(vm, prop.path, value);
- });
- }
-
- /**
- * Update a prop's value on a vm.
- *
- * @param {Vue} vm
- * @param {Object} prop
- * @param {*} value
- */
-
- function updateProp(vm, prop, value) {
- processPropValue(vm, prop, value, function (value) {
- vm[prop.path] = value;
- });
- }
-
- /**
- * Get the default value of a prop.
- *
- * @param {Vue} vm
- * @param {Object} prop
- * @return {*}
- */
-
- function getPropDefaultValue(vm, prop) {
- // no default, return undefined
- var options = prop.options;
- if (!hasOwn(options, 'default')) {
- // absent boolean value defaults to false
- return options.type === Boolean ? false : undefined;
- }
- var def = options['default'];
- // warn against non-factory defaults for Object & Array
- if (isObject(def)) {
- process.env.NODE_ENV !== 'production' && warn('Invalid default value for prop "' + prop.name + '": ' + 'Props with type Object/Array must use a factory function ' + 'to return the default value.', vm);
- }
- // call factory function for non-Function types
- return typeof def === 'function' && options.type !== Function ? def.call(vm) : def;
- }
-
- /**
- * Assert whether a prop is valid.
- *
- * @param {Object} prop
- * @param {*} value
- * @param {Vue} vm
- */
-
- function assertProp(prop, value, vm) {
- if (!prop.options.required && ( // non-required
- prop.raw === null || // abscent
- value == null) // null or undefined
- ) {
- return true;
- }
- var options = prop.options;
- var type = options.type;
- var valid = !type;
- var expectedTypes = [];
- if (type) {
- if (!isArray(type)) {
- type = [type];
- }
- for (var i = 0; i < type.length && !valid; i++) {
- var assertedType = assertType(value, type[i]);
- expectedTypes.push(assertedType.expectedType);
- valid = assertedType.valid;
- }
- }
- if (!valid) {
- if (process.env.NODE_ENV !== 'production') {
- warn('Invalid prop: type check failed for prop "' + prop.name + '".' + ' Expected ' + expectedTypes.map(formatType).join(', ') + ', got ' + formatValue(value) + '.', vm);
- }
- return false;
- }
- var validator = options.validator;
- if (validator) {
- if (!validator(value)) {
- process.env.NODE_ENV !== 'production' && warn('Invalid prop: custom validator check failed for prop "' + prop.name + '".', vm);
- return false;
- }
- }
- return true;
- }
-
- /**
- * Force parsing value with coerce option.
- *
- * @param {*} value
- * @param {Object} options
- * @return {*}
- */
-
- function coerceProp(prop, value, vm) {
- var coerce = prop.options.coerce;
- if (!coerce) {
- return value;
- }
- if (typeof coerce === 'function') {
- return coerce(value);
- } else {
- process.env.NODE_ENV !== 'production' && warn('Invalid coerce for prop "' + prop.name + '": expected function, got ' + typeof coerce + '.', vm);
- return value;
- }
- }
-
- /**
- * Assert the type of a value
- *
- * @param {*} value
- * @param {Function} type
- * @return {Object}
- */
-
- function assertType(value, type) {
- var valid;
- var expectedType;
- if (type === String) {
- expectedType = 'string';
- valid = typeof value === expectedType;
- } else if (type === Number) {
- expectedType = 'number';
- valid = typeof value === expectedType;
- } else if (type === Boolean) {
- expectedType = 'boolean';
- valid = typeof value === expectedType;
- } else if (type === Function) {
- expectedType = 'function';
- valid = typeof value === expectedType;
- } else if (type === Object) {
- expectedType = 'object';
- valid = isPlainObject(value);
- } else if (type === Array) {
- expectedType = 'array';
- valid = isArray(value);
- } else {
- valid = value instanceof type;
- }
- return {
- valid: valid,
- expectedType: expectedType
- };
- }
-
- /**
- * Format type for output
- *
- * @param {String} type
- * @return {String}
- */
-
- function formatType(type) {
- return type ? type.charAt(0).toUpperCase() + type.slice(1) : 'custom type';
- }
-
- /**
- * Format value
- *
- * @param {*} value
- * @return {String}
- */
-
- function formatValue(val) {
- return Object.prototype.toString.call(val).slice(8, -1);
- }
-
- var bindingModes = config._propBindingModes;
-
- var propDef = {
-
- bind: function bind() {
- var child = this.vm;
- var parent = child._context;
- // passed in from compiler directly
- var prop = this.descriptor.prop;
- var childKey = prop.path;
- var parentKey = prop.parentPath;
- var twoWay = prop.mode === bindingModes.TWO_WAY;
-
- var parentWatcher = this.parentWatcher = new Watcher(parent, parentKey, function (val) {
- updateProp(child, prop, val);
- }, {
- twoWay: twoWay,
- filters: prop.filters,
- // important: props need to be observed on the
- // v-for scope if present
- scope: this._scope
- });
-
- // set the child initial value.
- initProp(child, prop, parentWatcher.value);
-
- // setup two-way binding
- if (twoWay) {
- // important: defer the child watcher creation until
- // the created hook (after data observation)
- var self = this;
- child.$once('pre-hook:created', function () {
- self.childWatcher = new Watcher(child, childKey, function (val) {
- parentWatcher.set(val);
- }, {
- // ensure sync upward before parent sync down.
- // this is necessary in cases e.g. the child
- // mutates a prop array, then replaces it. (#1683)
- sync: true
- });
- });
- }
- },
-
- unbind: function unbind() {
- this.parentWatcher.teardown();
- if (this.childWatcher) {
- this.childWatcher.teardown();
- }
- }
- };
-
- var queue$1 = [];
- var queued = false;
-
- /**
- * Push a job into the queue.
- *
- * @param {Function} job
- */
-
- function pushJob(job) {
- queue$1.push(job);
- if (!queued) {
- queued = true;
- nextTick(flush);
- }
- }
-
- /**
- * Flush the queue, and do one forced reflow before
- * triggering transitions.
- */
-
- function flush() {
- // Force layout
- var f = document.documentElement.offsetHeight;
- for (var i = 0; i < queue$1.length; i++) {
- queue$1[i]();
- }
- queue$1 = [];
- queued = false;
- // dummy return, so js linters don't complain about
- // unused variable f
- return f;
- }
-
- var TYPE_TRANSITION = 'transition';
- var TYPE_ANIMATION = 'animation';
- var transDurationProp = transitionProp + 'Duration';
- var animDurationProp = animationProp + 'Duration';
-
- /**
- * If a just-entered element is applied the
- * leave class while its enter transition hasn't started yet,
- * and the transitioned property has the same value for both
- * enter/leave, then the leave transition will be skipped and
- * the transitionend event never fires. This function ensures
- * its callback to be called after a transition has started
- * by waiting for double raf.
- *
- * It falls back to setTimeout on devices that support CSS
- * transitions but not raf (e.g. Android 4.2 browser) - since
- * these environments are usually slow, we are giving it a
- * relatively large timeout.
- */
-
- var raf = inBrowser && window.requestAnimationFrame;
- var waitForTransitionStart = raf
- /* istanbul ignore next */
- ? function (fn) {
- raf(function () {
- raf(fn);
- });
- } : function (fn) {
- setTimeout(fn, 50);
- };
-
- /**
- * A Transition object that encapsulates the state and logic
- * of the transition.
- *
- * @param {Element} el
- * @param {String} id
- * @param {Object} hooks
- * @param {Vue} vm
- */
- function Transition(el, id, hooks, vm) {
- this.id = id;
- this.el = el;
- this.enterClass = hooks && hooks.enterClass || id + '-enter';
- this.leaveClass = hooks && hooks.leaveClass || id + '-leave';
- this.hooks = hooks;
- this.vm = vm;
- // async state
- this.pendingCssEvent = this.pendingCssCb = this.cancel = this.pendingJsCb = this.op = this.cb = null;
- this.justEntered = false;
- this.entered = this.left = false;
- this.typeCache = {};
- // check css transition type
- this.type = hooks && hooks.type;
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- if (this.type && this.type !== TYPE_TRANSITION && this.type !== TYPE_ANIMATION) {
- warn('invalid CSS transition type for transition="' + this.id + '": ' + this.type, vm);
- }
- }
- // bind
- var self = this;['enterNextTick', 'enterDone', 'leaveNextTick', 'leaveDone'].forEach(function (m) {
- self[m] = bind(self[m], self);
- });
- }
-
- var p$1 = Transition.prototype;
-
- /**
- * Start an entering transition.
- *
- * 1. enter transition triggered
- * 2. call beforeEnter hook
- * 3. add enter class
- * 4. insert/show element
- * 5. call enter hook (with possible explicit js callback)
- * 6. reflow
- * 7. based on transition type:
- * - transition:
- * remove class now, wait for transitionend,
- * then done if there's no explicit js callback.
- * - animation:
- * wait for animationend, remove class,
- * then done if there's no explicit js callback.
- * - no css transition:
- * done now if there's no explicit js callback.
- * 8. wait for either done or js callback, then call
- * afterEnter hook.
- *
- * @param {Function} op - insert/show the element
- * @param {Function} [cb]
- */
-
- p$1.enter = function (op, cb) {
- this.cancelPending();
- this.callHook('beforeEnter');
- this.cb = cb;
- addClass(this.el, this.enterClass);
- op();
- this.entered = false;
- this.callHookWithCb('enter');
- if (this.entered) {
- return; // user called done synchronously.
- }
- this.cancel = this.hooks && this.hooks.enterCancelled;
- pushJob(this.enterNextTick);
- };
-
- /**
- * The "nextTick" phase of an entering transition, which is
- * to be pushed into a queue and executed after a reflow so
- * that removing the class can trigger a CSS transition.
- */
-
- p$1.enterNextTick = function () {
- var _this = this;
-
- // prevent transition skipping
- this.justEntered = true;
- waitForTransitionStart(function () {
- _this.justEntered = false;
- });
- var enterDone = this.enterDone;
- var type = this.getCssTransitionType(this.enterClass);
- if (!this.pendingJsCb) {
- if (type === TYPE_TRANSITION) {
- // trigger transition by removing enter class now
- removeClass(this.el, this.enterClass);
- this.setupCssCb(transitionEndEvent, enterDone);
- } else if (type === TYPE_ANIMATION) {
- this.setupCssCb(animationEndEvent, enterDone);
- } else {
- enterDone();
- }
- } else if (type === TYPE_TRANSITION) {
- removeClass(this.el, this.enterClass);
- }
- };
-
- /**
- * The "cleanup" phase of an entering transition.
- */
-
- p$1.enterDone = function () {
- this.entered = true;
- this.cancel = this.pendingJsCb = null;
- removeClass(this.el, this.enterClass);
- this.callHook('afterEnter');
- if (this.cb) this.cb();
- };
-
- /**
- * Start a leaving transition.
- *
- * 1. leave transition triggered.
- * 2. call beforeLeave hook
- * 3. add leave class (trigger css transition)
- * 4. call leave hook (with possible explicit js callback)
- * 5. reflow if no explicit js callback is provided
- * 6. based on transition type:
- * - transition or animation:
- * wait for end event, remove class, then done if
- * there's no explicit js callback.
- * - no css transition:
- * done if there's no explicit js callback.
- * 7. wait for either done or js callback, then call
- * afterLeave hook.
- *
- * @param {Function} op - remove/hide the element
- * @param {Function} [cb]
- */
-
- p$1.leave = function (op, cb) {
- this.cancelPending();
- this.callHook('beforeLeave');
- this.op = op;
- this.cb = cb;
- addClass(this.el, this.leaveClass);
- this.left = false;
- this.callHookWithCb('leave');
- if (this.left) {
- return; // user called done synchronously.
- }
- this.cancel = this.hooks && this.hooks.leaveCancelled;
- // only need to handle leaveDone if
- // 1. the transition is already done (synchronously called
- // by the user, which causes this.op set to null)
- // 2. there's no explicit js callback
- if (this.op && !this.pendingJsCb) {
- // if a CSS transition leaves immediately after enter,
- // the transitionend event never fires. therefore we
- // detect such cases and end the leave immediately.
- if (this.justEntered) {
- this.leaveDone();
- } else {
- pushJob(this.leaveNextTick);
- }
- }
- };
-
- /**
- * The "nextTick" phase of a leaving transition.
- */
-
- p$1.leaveNextTick = function () {
- var type = this.getCssTransitionType(this.leaveClass);
- if (type) {
- var event = type === TYPE_TRANSITION ? transitionEndEvent : animationEndEvent;
- this.setupCssCb(event, this.leaveDone);
- } else {
- this.leaveDone();
- }
- };
-
- /**
- * The "cleanup" phase of a leaving transition.
- */
-
- p$1.leaveDone = function () {
- this.left = true;
- this.cancel = this.pendingJsCb = null;
- this.op();
- removeClass(this.el, this.leaveClass);
- this.callHook('afterLeave');
- if (this.cb) this.cb();
- this.op = null;
- };
-
- /**
- * Cancel any pending callbacks from a previously running
- * but not finished transition.
- */
-
- p$1.cancelPending = function () {
- this.op = this.cb = null;
- var hasPending = false;
- if (this.pendingCssCb) {
- hasPending = true;
- off(this.el, this.pendingCssEvent, this.pendingCssCb);
- this.pendingCssEvent = this.pendingCssCb = null;
- }
- if (this.pendingJsCb) {
- hasPending = true;
- this.pendingJsCb.cancel();
- this.pendingJsCb = null;
- }
- if (hasPending) {
- removeClass(this.el, this.enterClass);
- removeClass(this.el, this.leaveClass);
- }
- if (this.cancel) {
- this.cancel.call(this.vm, this.el);
- this.cancel = null;
- }
- };
-
- /**
- * Call a user-provided synchronous hook function.
- *
- * @param {String} type
- */
-
- p$1.callHook = function (type) {
- if (this.hooks && this.hooks[type]) {
- this.hooks[type].call(this.vm, this.el);
- }
- };
-
- /**
- * Call a user-provided, potentially-async hook function.
- * We check for the length of arguments to see if the hook
- * expects a `done` callback. If true, the transition's end
- * will be determined by when the user calls that callback;
- * otherwise, the end is determined by the CSS transition or
- * animation.
- *
- * @param {String} type
- */
-
- p$1.callHookWithCb = function (type) {
- var hook = this.hooks && this.hooks[type];
- if (hook) {
- if (hook.length > 1) {
- this.pendingJsCb = cancellable(this[type + 'Done']);
- }
- hook.call(this.vm, this.el, this.pendingJsCb);
- }
- };
-
- /**
- * Get an element's transition type based on the
- * calculated styles.
- *
- * @param {String} className
- * @return {Number}
- */
-
- p$1.getCssTransitionType = function (className) {
- /* istanbul ignore if */
- if (!transitionEndEvent ||
- // skip CSS transitions if page is not visible -
- // this solves the issue of transitionend events not
- // firing until the page is visible again.
- // pageVisibility API is supported in IE10+, same as
- // CSS transitions.
- document.hidden ||
- // explicit js-only transition
- this.hooks && this.hooks.css === false ||
- // element is hidden
- isHidden(this.el)) {
- return;
- }
- var type = this.type || this.typeCache[className];
- if (type) return type;
- var inlineStyles = this.el.style;
- var computedStyles = window.getComputedStyle(this.el);
- var transDuration = inlineStyles[transDurationProp] || computedStyles[transDurationProp];
- if (transDuration && transDuration !== '0s') {
- type = TYPE_TRANSITION;
- } else {
- var animDuration = inlineStyles[animDurationProp] || computedStyles[animDurationProp];
- if (animDuration && animDuration !== '0s') {
- type = TYPE_ANIMATION;
- }
- }
- if (type) {
- this.typeCache[className] = type;
- }
- return type;
- };
-
- /**
- * Setup a CSS transitionend/animationend callback.
- *
- * @param {String} event
- * @param {Function} cb
- */
-
- p$1.setupCssCb = function (event, cb) {
- this.pendingCssEvent = event;
- var self = this;
- var el = this.el;
- var onEnd = this.pendingCssCb = function (e) {
- if (e.target === el) {
- off(el, event, onEnd);
- self.pendingCssEvent = self.pendingCssCb = null;
- if (!self.pendingJsCb && cb) {
- cb();
- }
- }
- };
- on(el, event, onEnd);
- };
-
- /**
- * Check if an element is hidden - in that case we can just
- * skip the transition alltogether.
- *
- * @param {Element} el
- * @return {Boolean}
- */
-
- function isHidden(el) {
- if (/svg$/.test(el.namespaceURI)) {
- // SVG elements do not have offset(Width|Height)
- // so we need to check the client rect
- var rect = el.getBoundingClientRect();
- return !(rect.width || rect.height);
- } else {
- return !(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
- }
- }
-
- var transition$1 = {
-
- priority: TRANSITION,
-
- update: function update(id, oldId) {
- var el = this.el;
- // resolve on owner vm
- var hooks = resolveAsset(this.vm.$options, 'transitions', id);
- id = id || 'v';
- oldId = oldId || 'v';
- el.__v_trans = new Transition(el, id, hooks, this.vm);
- removeClass(el, oldId + '-transition');
- addClass(el, id + '-transition');
- }
- };
-
- var internalDirectives = {
- style: style,
- 'class': vClass,
- component: component,
- prop: propDef,
- transition: transition$1
- };
-
- // special binding prefixes
- var bindRE = /^v-bind:|^:/;
- var onRE = /^v-on:|^@/;
- var dirAttrRE = /^v-([^:]+)(?:$|:(.*)$)/;
- var modifierRE = /\.[^\.]+/g;
- var transitionRE = /^(v-bind:|:)?transition$/;
-
- // default directive priority
- var DEFAULT_PRIORITY = 1000;
- var DEFAULT_TERMINAL_PRIORITY = 2000;
-
- /**
- * Compile a template and return a reusable composite link
- * function, which recursively contains more link functions
- * inside. This top level compile function would normally
- * be called on instance root nodes, but can also be used
- * for partial compilation if the partial argument is true.
- *
- * The returned composite link function, when called, will
- * return an unlink function that tearsdown all directives
- * created during the linking phase.
- *
- * @param {Element|DocumentFragment} el
- * @param {Object} options
- * @param {Boolean} partial
- * @return {Function}
- */
-
- function compile(el, options, partial) {
- // link function for the node itself.
- var nodeLinkFn = partial || !options._asComponent ? compileNode(el, options) : null;
- // link function for the childNodes
- var childLinkFn = !(nodeLinkFn && nodeLinkFn.terminal) && !isScript(el) && el.hasChildNodes() ? compileNodeList(el.childNodes, options) : null;
-
- /**
- * A composite linker function to be called on a already
- * compiled piece of DOM, which instantiates all directive
- * instances.
- *
- * @param {Vue} vm
- * @param {Element|DocumentFragment} el
- * @param {Vue} [host] - host vm of transcluded content
- * @param {Object} [scope] - v-for scope
- * @param {Fragment} [frag] - link context fragment
- * @return {Function|undefined}
- */
-
- return function compositeLinkFn(vm, el, host, scope, frag) {
- // cache childNodes before linking parent, fix #657
- var childNodes = toArray(el.childNodes);
- // link
- var dirs = linkAndCapture(function compositeLinkCapturer() {
- if (nodeLinkFn) nodeLinkFn(vm, el, host, scope, frag);
- if (childLinkFn) childLinkFn(vm, childNodes, host, scope, frag);
- }, vm);
- return makeUnlinkFn(vm, dirs);
- };
- }
-
- /**
- * Apply a linker to a vm/element pair and capture the
- * directives created during the process.
- *
- * @param {Function} linker
- * @param {Vue} vm
- */
-
- function linkAndCapture(linker, vm) {
- /* istanbul ignore if */
- if (process.env.NODE_ENV === 'production') {
- // reset directives before every capture in production
- // mode, so that when unlinking we don't need to splice
- // them out (which turns out to be a perf hit).
- // they are kept in development mode because they are
- // useful for Vue's own tests.
- vm._directives = [];
- }
- var originalDirCount = vm._directives.length;
- linker();
- var dirs = vm._directives.slice(originalDirCount);
- sortDirectives(dirs);
- for (var i = 0, l = dirs.length; i < l; i++) {
- dirs[i]._bind();
- }
- return dirs;
- }
-
- /**
- * sort directives by priority (stable sort)
- *
- * @param {Array} dirs
- */
- function sortDirectives(dirs) {
- if (dirs.length === 0) return;
-
- var groupedMap = {};
- var i, j, k, l;
- var index = 0;
- var priorities = [];
- for (i = 0, j = dirs.length; i < j; i++) {
- var dir = dirs[i];
- var priority = dir.descriptor.def.priority || DEFAULT_PRIORITY;
- var array = groupedMap[priority];
- if (!array) {
- array = groupedMap[priority] = [];
- priorities.push(priority);
- }
- array.push(dir);
- }
-
- priorities.sort(function (a, b) {
- return a > b ? -1 : a === b ? 0 : 1;
- });
- for (i = 0, j = priorities.length; i < j; i++) {
- var group = groupedMap[priorities[i]];
- for (k = 0, l = group.length; k < l; k++) {
- dirs[index++] = group[k];
- }
- }
- }
-
- /**
- * Linker functions return an unlink function that
- * tearsdown all directives instances generated during
- * the process.
- *
- * We create unlink functions with only the necessary
- * information to avoid retaining additional closures.
- *
- * @param {Vue} vm
- * @param {Array} dirs
- * @param {Vue} [context]
- * @param {Array} [contextDirs]
- * @return {Function}
- */
-
- function makeUnlinkFn(vm, dirs, context, contextDirs) {
- function unlink(destroying) {
- teardownDirs(vm, dirs, destroying);
- if (context && contextDirs) {
- teardownDirs(context, contextDirs);
- }
- }
- // expose linked directives
- unlink.dirs = dirs;
- return unlink;
- }
-
- /**
- * Teardown partial linked directives.
- *
- * @param {Vue} vm
- * @param {Array} dirs
- * @param {Boolean} destroying
- */
-
- function teardownDirs(vm, dirs, destroying) {
- var i = dirs.length;
- while (i--) {
- dirs[i]._teardown();
- if (process.env.NODE_ENV !== 'production' && !destroying) {
- vm._directives.$remove(dirs[i]);
- }
- }
- }
-
- /**
- * Compile link props on an instance.
- *
- * @param {Vue} vm
- * @param {Element} el
- * @param {Object} props
- * @param {Object} [scope]
- * @return {Function}
- */
-
- function compileAndLinkProps(vm, el, props, scope) {
- var propsLinkFn = compileProps(el, props, vm);
- var propDirs = linkAndCapture(function () {
- propsLinkFn(vm, scope);
- }, vm);
- return makeUnlinkFn(vm, propDirs);
- }
-
- /**
- * Compile the root element of an instance.
- *
- * 1. attrs on context container (context scope)
- * 2. attrs on the component template root node, if
- * replace:true (child scope)
- *
- * If this is a fragment instance, we only need to compile 1.
- *
- * @param {Element} el
- * @param {Object} options
- * @param {Object} contextOptions
- * @return {Function}
- */
-
- function compileRoot(el, options, contextOptions) {
- var containerAttrs = options._containerAttrs;
- var replacerAttrs = options._replacerAttrs;
- var contextLinkFn, replacerLinkFn;
-
- // only need to compile other attributes for
- // non-fragment instances
- if (el.nodeType !== 11) {
- // for components, container and replacer need to be
- // compiled separately and linked in different scopes.
- if (options._asComponent) {
- // 2. container attributes
- if (containerAttrs && contextOptions) {
- contextLinkFn = compileDirectives(containerAttrs, contextOptions);
- }
- if (replacerAttrs) {
- // 3. replacer attributes
- replacerLinkFn = compileDirectives(replacerAttrs, options);
- }
- } else {
- // non-component, just compile as a normal element.
- replacerLinkFn = compileDirectives(el.attributes, options);
- }
- } else if (process.env.NODE_ENV !== 'production' && containerAttrs) {
- // warn container directives for fragment instances
- var names = containerAttrs.filter(function (attr) {
- // allow vue-loader/vueify scoped css attributes
- return attr.name.indexOf('_v-') < 0 &&
- // allow event listeners
- !onRE.test(attr.name) &&
- // allow slots
- attr.name !== 'slot';
- }).map(function (attr) {
- return '"' + attr.name + '"';
- });
- if (names.length) {
- var plural = names.length > 1;
-
- var componentName = options.el.tagName.toLowerCase();
- if (componentName === 'component' && options.name) {
- componentName += ':' + options.name;
- }
-
- warn('Attribute' + (plural ? 's ' : ' ') + names.join(', ') + (plural ? ' are' : ' is') + ' ignored on component ' + '<' + componentName + '> because ' + 'the component is a fragment instance: ' + 'http://vuejs.org/guide/components.html#Fragment-Instance');
- }
- }
-
- options._containerAttrs = options._replacerAttrs = null;
- return function rootLinkFn(vm, el, scope) {
- // link context scope dirs
- var context = vm._context;
- var contextDirs;
- if (context && contextLinkFn) {
- contextDirs = linkAndCapture(function () {
- contextLinkFn(context, el, null, scope);
- }, context);
- }
-
- // link self
- var selfDirs = linkAndCapture(function () {
- if (replacerLinkFn) replacerLinkFn(vm, el);
- }, vm);
-
- // return the unlink function that tearsdown context
- // container directives.
- return makeUnlinkFn(vm, selfDirs, context, contextDirs);
- };
- }
-
- /**
- * Compile a node and return a nodeLinkFn based on the
- * node type.
- *
- * @param {Node} node
- * @param {Object} options
- * @return {Function|null}
- */
-
- function compileNode(node, options) {
- var type = node.nodeType;
- if (type === 1 && !isScript(node)) {
- return compileElement(node, options);
- } else if (type === 3 && node.data.trim()) {
- return compileTextNode(node, options);
- } else {
- return null;
- }
- }
-
- /**
- * Compile an element and return a nodeLinkFn.
- *
- * @param {Element} el
- * @param {Object} options
- * @return {Function|null}
- */
-
- function compileElement(el, options) {
- // preprocess textareas.
- // textarea treats its text content as the initial value.
- // just bind it as an attr directive for value.
- if (el.tagName === 'TEXTAREA') {
- // a textarea which has v-pre attr should skip complie.
- if (getAttr(el, 'v-pre') !== null) {
- return skip;
- }
- var tokens = parseText(el.value);
- if (tokens) {
- el.setAttribute(':value', tokensToExp(tokens));
- el.value = '';
- }
- }
- var linkFn;
- var hasAttrs = el.hasAttributes();
- var attrs = hasAttrs && toArray(el.attributes);
- // check terminal directives (for & if)
- if (hasAttrs) {
- linkFn = checkTerminalDirectives(el, attrs, options);
- }
- // check element directives
- if (!linkFn) {
- linkFn = checkElementDirectives(el, options);
- }
- // check component
- if (!linkFn) {
- linkFn = checkComponent(el, options);
- }
- // normal directives
- if (!linkFn && hasAttrs) {
- linkFn = compileDirectives(attrs, options);
- }
- return linkFn;
- }
-
- /**
- * Compile a textNode and return a nodeLinkFn.
- *
- * @param {TextNode} node
- * @param {Object} options
- * @return {Function|null} textNodeLinkFn
- */
-
- function compileTextNode(node, options) {
- // skip marked text nodes
- if (node._skip) {
- return removeText;
- }
-
- var tokens = parseText(node.wholeText);
- if (!tokens) {
- return null;
- }
-
- // mark adjacent text nodes as skipped,
- // because we are using node.wholeText to compile
- // all adjacent text nodes together. This fixes
- // issues in IE where sometimes it splits up a single
- // text node into multiple ones.
- var next = node.nextSibling;
- while (next && next.nodeType === 3) {
- next._skip = true;
- next = next.nextSibling;
- }
-
- var frag = document.createDocumentFragment();
- var el, token;
- for (var i = 0, l = tokens.length; i < l; i++) {
- token = tokens[i];
- el = token.tag ? processTextToken(token, options) : document.createTextNode(token.value);
- frag.appendChild(el);
- }
- return makeTextNodeLinkFn(tokens, frag, options);
- }
-
- /**
- * Linker for an skipped text node.
- *
- * @param {Vue} vm
- * @param {Text} node
- */
-
- function removeText(vm, node) {
- remove(node);
- }
-
- /**
- * Process a single text token.
- *
- * @param {Object} token
- * @param {Object} options
- * @return {Node}
- */
-
- function processTextToken(token, options) {
- var el;
- if (token.oneTime) {
- el = document.createTextNode(token.value);
- } else {
- if (token.html) {
- el = document.createComment('v-html');
- setTokenType('html');
- } else {
- // IE will clean up empty textNodes during
- // frag.cloneNode(true), so we have to give it
- // something here...
- el = document.createTextNode(' ');
- setTokenType('text');
- }
- }
- function setTokenType(type) {
- if (token.descriptor) return;
- var parsed = parseDirective(token.value);
- token.descriptor = {
- name: type,
- def: directives[type],
- expression: parsed.expression,
- filters: parsed.filters
- };
- }
- return el;
- }
-
- /**
- * Build a function that processes a textNode.
- *
- * @param {Array<Object>} tokens
- * @param {DocumentFragment} frag
- */
-
- function makeTextNodeLinkFn(tokens, frag) {
- return function textNodeLinkFn(vm, el, host, scope) {
- var fragClone = frag.cloneNode(true);
- var childNodes = toArray(fragClone.childNodes);
- var token, value, node;
- for (var i = 0, l = tokens.length; i < l; i++) {
- token = tokens[i];
- value = token.value;
- if (token.tag) {
- node = childNodes[i];
- if (token.oneTime) {
- value = (scope || vm).$eval(value);
- if (token.html) {
- replace(node, parseTemplate(value, true));
- } else {
- node.data = _toString(value);
- }
- } else {
- vm._bindDir(token.descriptor, node, host, scope);
- }
- }
- }
- replace(el, fragClone);
- };
- }
-
- /**
- * Compile a node list and return a childLinkFn.
- *
- * @param {NodeList} nodeList
- * @param {Object} options
- * @return {Function|undefined}
- */
-
- function compileNodeList(nodeList, options) {
- var linkFns = [];
- var nodeLinkFn, childLinkFn, node;
- for (var i = 0, l = nodeList.length; i < l; i++) {
- node = nodeList[i];
- nodeLinkFn = compileNode(node, options);
- childLinkFn = !(nodeLinkFn && nodeLinkFn.terminal) && node.tagName !== 'SCRIPT' && node.hasChildNodes() ? compileNodeList(node.childNodes, options) : null;
- linkFns.push(nodeLinkFn, childLinkFn);
- }
- return linkFns.length ? makeChildLinkFn(linkFns) : null;
- }
-
- /**
- * Make a child link function for a node's childNodes.
- *
- * @param {Array<Function>} linkFns
- * @return {Function} childLinkFn
- */
-
- function makeChildLinkFn(linkFns) {
- return function childLinkFn(vm, nodes, host, scope, frag) {
- var node, nodeLinkFn, childrenLinkFn;
- for (var i = 0, n = 0, l = linkFns.length; i < l; n++) {
- node = nodes[n];
- nodeLinkFn = linkFns[i++];
- childrenLinkFn = linkFns[i++];
- // cache childNodes before linking parent, fix #657
- var childNodes = toArray(node.childNodes);
- if (nodeLinkFn) {
- nodeLinkFn(vm, node, host, scope, frag);
- }
- if (childrenLinkFn) {
- childrenLinkFn(vm, childNodes, host, scope, frag);
- }
- }
- };
- }
-
- /**
- * Check for element directives (custom elements that should
- * be resovled as terminal directives).
- *
- * @param {Element} el
- * @param {Object} options
- */
-
- function checkElementDirectives(el, options) {
- var tag = el.tagName.toLowerCase();
- if (commonTagRE.test(tag)) {
- return;
- }
- var def = resolveAsset(options, 'elementDirectives', tag);
- if (def) {
- return makeTerminalNodeLinkFn(el, tag, '', options, def);
- }
- }
-
- /**
- * Check if an element is a component. If yes, return
- * a component link function.
- *
- * @param {Element} el
- * @param {Object} options
- * @return {Function|undefined}
- */
-
- function checkComponent(el, options) {
- var component = checkComponentAttr(el, options);
- if (component) {
- var ref = findRef(el);
- var descriptor = {
- name: 'component',
- ref: ref,
- expression: component.id,
- def: internalDirectives.component,
- modifiers: {
- literal: !component.dynamic
- }
- };
- var componentLinkFn = function componentLinkFn(vm, el, host, scope, frag) {
- if (ref) {
- defineReactive((scope || vm).$refs, ref, null);
- }
- vm._bindDir(descriptor, el, host, scope, frag);
- };
- componentLinkFn.terminal = true;
- return componentLinkFn;
- }
- }
-
- /**
- * Check an element for terminal directives in fixed order.
- * If it finds one, return a terminal link function.
- *
- * @param {Element} el
- * @param {Array} attrs
- * @param {Object} options
- * @return {Function} terminalLinkFn
- */
-
- function checkTerminalDirectives(el, attrs, options) {
- // skip v-pre
- if (getAttr(el, 'v-pre') !== null) {
- return skip;
- }
- // skip v-else block, but only if following v-if
- if (el.hasAttribute('v-else')) {
- var prev = el.previousElementSibling;
- if (prev && prev.hasAttribute('v-if')) {
- return skip;
- }
- }
-
- var attr, name, value, modifiers, matched, dirName, rawName, arg, def, termDef;
- for (var i = 0, j = attrs.length; i < j; i++) {
- attr = attrs[i];
- name = attr.name.replace(modifierRE, '');
- if (matched = name.match(dirAttrRE)) {
- def = resolveAsset(options, 'directives', matched[1]);
- if (def && def.terminal) {
- if (!termDef || (def.priority || DEFAULT_TERMINAL_PRIORITY) > termDef.priority) {
- termDef = def;
- rawName = attr.name;
- modifiers = parseModifiers(attr.name);
- value = attr.value;
- dirName = matched[1];
- arg = matched[2];
- }
- }
- }
- }
-
- if (termDef) {
- return makeTerminalNodeLinkFn(el, dirName, value, options, termDef, rawName, arg, modifiers);
- }
- }
-
- function skip() {}
- skip.terminal = true;
-
- /**
- * Build a node link function for a terminal directive.
- * A terminal link function terminates the current
- * compilation recursion and handles compilation of the
- * subtree in the directive.
- *
- * @param {Element} el
- * @param {String} dirName
- * @param {String} value
- * @param {Object} options
- * @param {Object} def
- * @param {String} [rawName]
- * @param {String} [arg]
- * @param {Object} [modifiers]
- * @return {Function} terminalLinkFn
- */
-
- function makeTerminalNodeLinkFn(el, dirName, value, options, def, rawName, arg, modifiers) {
- var parsed = parseDirective(value);
- var descriptor = {
- name: dirName,
- arg: arg,
- expression: parsed.expression,
- filters: parsed.filters,
- raw: value,
- attr: rawName,
- modifiers: modifiers,
- def: def
- };
- // check ref for v-for, v-if and router-view
- if (dirName === 'for' || dirName === 'router-view') {
- descriptor.ref = findRef(el);
- }
- var fn = function terminalNodeLinkFn(vm, el, host, scope, frag) {
- if (descriptor.ref) {
- defineReactive((scope || vm).$refs, descriptor.ref, null);
- }
- vm._bindDir(descriptor, el, host, scope, frag);
- };
- fn.terminal = true;
- return fn;
- }
-
- /**
- * Compile the directives on an element and return a linker.
- *
- * @param {Array|NamedNodeMap} attrs
- * @param {Object} options
- * @return {Function}
- */
-
- function compileDirectives(attrs, options) {
- var i = attrs.length;
- var dirs = [];
- var attr, name, value, rawName, rawValue, dirName, arg, modifiers, dirDef, tokens, matched;
- while (i--) {
- attr = attrs[i];
- name = rawName = attr.name;
- value = rawValue = attr.value;
- tokens = parseText(value);
- // reset arg
- arg = null;
- // check modifiers
- modifiers = parseModifiers(name);
- name = name.replace(modifierRE, '');
-
- // attribute interpolations
- if (tokens) {
- value = tokensToExp(tokens);
- arg = name;
- pushDir('bind', directives.bind, tokens);
- // warn against mixing mustaches with v-bind
- if (process.env.NODE_ENV !== 'production') {
- if (name === 'class' && Array.prototype.some.call(attrs, function (attr) {
- return attr.name === ':class' || attr.name === 'v-bind:class';
- })) {
- warn('class="' + rawValue + '": Do not mix mustache interpolation ' + 'and v-bind for "class" on the same element. Use one or the other.', options);
- }
- }
- } else
-
- // special attribute: transition
- if (transitionRE.test(name)) {
- modifiers.literal = !bindRE.test(name);
- pushDir('transition', internalDirectives.transition);
- } else
-
- // event handlers
- if (onRE.test(name)) {
- arg = name.replace(onRE, '');
- pushDir('on', directives.on);
- } else
-
- // attribute bindings
- if (bindRE.test(name)) {
- dirName = name.replace(bindRE, '');
- if (dirName === 'style' || dirName === 'class') {
- pushDir(dirName, internalDirectives[dirName]);
- } else {
- arg = dirName;
- pushDir('bind', directives.bind);
- }
- } else
-
- // normal directives
- if (matched = name.match(dirAttrRE)) {
- dirName = matched[1];
- arg = matched[2];
-
- // skip v-else (when used with v-show)
- if (dirName === 'else') {
- continue;
- }
-
- dirDef = resolveAsset(options, 'directives', dirName, true);
- if (dirDef) {
- pushDir(dirName, dirDef);
- }
- }
- }
-
- /**
- * Push a directive.
- *
- * @param {String} dirName
- * @param {Object|Function} def
- * @param {Array} [interpTokens]
- */
-
- function pushDir(dirName, def, interpTokens) {
- var hasOneTimeToken = interpTokens && hasOneTime(interpTokens);
- var parsed = !hasOneTimeToken && parseDirective(value);
- dirs.push({
- name: dirName,
- attr: rawName,
- raw: rawValue,
- def: def,
- arg: arg,
- modifiers: modifiers,
- // conversion from interpolation strings with one-time token
- // to expression is differed until directive bind time so that we
- // have access to the actual vm context for one-time bindings.
- expression: parsed && parsed.expression,
- filters: parsed && parsed.filters,
- interp: interpTokens,
- hasOneTime: hasOneTimeToken
- });
- }
-
- if (dirs.length) {
- return makeNodeLinkFn(dirs);
- }
- }
-
- /**
- * Parse modifiers from directive attribute name.
- *
- * @param {String} name
- * @return {Object}
- */
-
- function parseModifiers(name) {
- var res = Object.create(null);
- var match = name.match(modifierRE);
- if (match) {
- var i = match.length;
- while (i--) {
- res[match[i].slice(1)] = true;
- }
- }
- return res;
- }
-
- /**
- * Build a link function for all directives on a single node.
- *
- * @param {Array} directives
- * @return {Function} directivesLinkFn
- */
-
- function makeNodeLinkFn(directives) {
- return function nodeLinkFn(vm, el, host, scope, frag) {
- // reverse apply because it's sorted low to high
- var i = directives.length;
- while (i--) {
- vm._bindDir(directives[i], el, host, scope, frag);
- }
- };
- }
-
- /**
- * Check if an interpolation string contains one-time tokens.
- *
- * @param {Array} tokens
- * @return {Boolean}
- */
-
- function hasOneTime(tokens) {
- var i = tokens.length;
- while (i--) {
- if (tokens[i].oneTime) return true;
- }
- }
-
- function isScript(el) {
- return el.tagName === 'SCRIPT' && (!el.hasAttribute('type') || el.getAttribute('type') === 'text/javascript');
- }
-
- var specialCharRE = /[^\w\-:\.]/;
-
- /**
- * Process an element or a DocumentFragment based on a
- * instance option object. This allows us to transclude
- * a template node/fragment before the instance is created,
- * so the processed fragment can then be cloned and reused
- * in v-for.
- *
- * @param {Element} el
- * @param {Object} options
- * @return {Element|DocumentFragment}
- */
-
- function transclude(el, options) {
- // extract container attributes to pass them down
- // to compiler, because they need to be compiled in
- // parent scope. we are mutating the options object here
- // assuming the same object will be used for compile
- // right after this.
- if (options) {
- options._containerAttrs = extractAttrs(el);
- }
- // for template tags, what we want is its content as
- // a documentFragment (for fragment instances)
- if (isTemplate(el)) {
- el = parseTemplate(el);
- }
- if (options) {
- if (options._asComponent && !options.template) {
- options.template = '<slot></slot>';
- }
- if (options.template) {
- options._content = extractContent(el);
- el = transcludeTemplate(el, options);
- }
- }
- if (isFragment(el)) {
- // anchors for fragment instance
- // passing in `persist: true` to avoid them being
- // discarded by IE during template cloning
- prepend(createAnchor('v-start', true), el);
- el.appendChild(createAnchor('v-end', true));
- }
- return el;
- }
-
- /**
- * Process the template option.
- * If the replace option is true this will swap the $el.
- *
- * @param {Element} el
- * @param {Object} options
- * @return {Element|DocumentFragment}
- */
-
- function transcludeTemplate(el, options) {
- var template = options.template;
- var frag = parseTemplate(template, true);
- if (frag) {
- var replacer = frag.firstChild;
- if (!replacer) {
- return frag;
- }
- var tag = replacer.tagName && replacer.tagName.toLowerCase();
- if (options.replace) {
- /* istanbul ignore if */
- if (el === document.body) {
- process.env.NODE_ENV !== 'production' && warn('You are mounting an instance with a template to ' + '<body>. This will replace <body> entirely. You ' + 'should probably use `replace: false` here.');
- }
- // there are many cases where the instance must
- // become a fragment instance: basically anything that
- // can create more than 1 root nodes.
- if (
- // multi-children template
- frag.childNodes.length > 1 ||
- // non-element template
- replacer.nodeType !== 1 ||
- // single nested component
- tag === 'component' || resolveAsset(options, 'components', tag) || hasBindAttr(replacer, 'is') ||
- // element directive
- resolveAsset(options, 'elementDirectives', tag) ||
- // for block
- replacer.hasAttribute('v-for') ||
- // if block
- replacer.hasAttribute('v-if')) {
- return frag;
- } else {
- options._replacerAttrs = extractAttrs(replacer);
- mergeAttrs(el, replacer);
- return replacer;
- }
- } else {
- el.appendChild(frag);
- return el;
- }
- } else {
- process.env.NODE_ENV !== 'production' && warn('Invalid template option: ' + template);
- }
- }
-
- /**
- * Helper to extract a component container's attributes
- * into a plain object array.
- *
- * @param {Element} el
- * @return {Array}
- */
-
- function extractAttrs(el) {
- if (el.nodeType === 1 && el.hasAttributes()) {
- return toArray(el.attributes);
- }
- }
-
- /**
- * Merge the attributes of two elements, and make sure
- * the class names are merged properly.
- *
- * @param {Element} from
- * @param {Element} to
- */
-
- function mergeAttrs(from, to) {
- var attrs = from.attributes;
- var i = attrs.length;
- var name, value;
- while (i--) {
- name = attrs[i].name;
- value = attrs[i].value;
- if (!to.hasAttribute(name) && !specialCharRE.test(name)) {
- to.setAttribute(name, value);
- } else if (name === 'class' && !parseText(value) && (value = value.trim())) {
- value.split(/\s+/).forEach(function (cls) {
- addClass(to, cls);
- });
- }
- }
- }
-
- /**
- * Scan and determine slot content distribution.
- * We do this during transclusion instead at compile time so that
- * the distribution is decoupled from the compilation order of
- * the slots.
- *
- * @param {Element|DocumentFragment} template
- * @param {Element} content
- * @param {Vue} vm
- */
-
- function resolveSlots(vm, content) {
- if (!content) {
- return;
- }
- var contents = vm._slotContents = Object.create(null);
- var el, name;
- for (var i = 0, l = content.children.length; i < l; i++) {
- el = content.children[i];
- /* eslint-disable no-cond-assign */
- if (name = el.getAttribute('slot')) {
- (contents[name] || (contents[name] = [])).push(el);
- }
- /* eslint-enable no-cond-assign */
- if (process.env.NODE_ENV !== 'production' && getBindAttr(el, 'slot')) {
- warn('The "slot" attribute must be static.', vm.$parent);
- }
- }
- for (name in contents) {
- contents[name] = extractFragment(contents[name], content);
- }
- if (content.hasChildNodes()) {
- var nodes = content.childNodes;
- if (nodes.length === 1 && nodes[0].nodeType === 3 && !nodes[0].data.trim()) {
- return;
- }
- contents['default'] = extractFragment(content.childNodes, content);
- }
- }
-
- /**
- * Extract qualified content nodes from a node list.
- *
- * @param {NodeList} nodes
- * @return {DocumentFragment}
- */
-
- function extractFragment(nodes, parent) {
- var frag = document.createDocumentFragment();
- nodes = toArray(nodes);
- for (var i = 0, l = nodes.length; i < l; i++) {
- var node = nodes[i];
- if (isTemplate(node) && !node.hasAttribute('v-if') && !node.hasAttribute('v-for')) {
- parent.removeChild(node);
- node = parseTemplate(node, true);
- }
- frag.appendChild(node);
- }
- return frag;
- }
-
-
-
- var compiler = Object.freeze({
- compile: compile,
- compileAndLinkProps: compileAndLinkProps,
- compileRoot: compileRoot,
- transclude: transclude,
- resolveSlots: resolveSlots
- });
-
- function stateMixin (Vue) {
- /**
- * Accessor for `$data` property, since setting $data
- * requires observing the new object and updating
- * proxied properties.
- */
-
- Object.defineProperty(Vue.prototype, '$data', {
- get: function get() {
- return this._data;
- },
- set: function set(newData) {
- if (newData !== this._data) {
- this._setData(newData);
- }
- }
- });
-
- /**
- * Setup the scope of an instance, which contains:
- * - observed data
- * - computed properties
- * - user methods
- * - meta properties
- */
-
- Vue.prototype._initState = function () {
- this._initProps();
- this._initMeta();
- this._initMethods();
- this._initData();
- this._initComputed();
- };
-
- /**
- * Initialize props.
- */
-
- Vue.prototype._initProps = function () {
- var options = this.$options;
- var el = options.el;
- var props = options.props;
- if (props && !el) {
- process.env.NODE_ENV !== 'production' && warn('Props will not be compiled if no `el` option is ' + 'provided at instantiation.', this);
- }
- // make sure to convert string selectors into element now
- el = options.el = query(el);
- this._propsUnlinkFn = el && el.nodeType === 1 && props
- // props must be linked in proper scope if inside v-for
- ? compileAndLinkProps(this, el, props, this._scope) : null;
- };
-
- /**
- * Initialize the data.
- */
-
- Vue.prototype._initData = function () {
- var dataFn = this.$options.data;
- var data = this._data = dataFn ? dataFn() : {};
- if (!isPlainObject(data)) {
- data = {};
- process.env.NODE_ENV !== 'production' && warn('data functions should return an object.', this);
- }
- var props = this._props;
- // proxy data on instance
- var keys = Object.keys(data);
- var i, key;
- i = keys.length;
- while (i--) {
- key = keys[i];
- // there are two scenarios where we can proxy a data key:
- // 1. it's not already defined as a prop
- // 2. it's provided via a instantiation option AND there are no
- // template prop present
- if (!props || !hasOwn(props, key)) {
- this._proxy(key);
- } else if (process.env.NODE_ENV !== 'production') {
- warn('Data field "' + key + '" is already defined ' + 'as a prop. To provide default value for a prop, use the "default" ' + 'prop option; if you want to pass prop values to an instantiation ' + 'call, use the "propsData" option.', this);
- }
- }
- // observe data
- observe(data, this);
- };
-
- /**
- * Swap the instance's $data. Called in $data's setter.
- *
- * @param {Object} newData
- */
-
- Vue.prototype._setData = function (newData) {
- newData = newData || {};
- var oldData = this._data;
- this._data = newData;
- var keys, key, i;
- // unproxy keys not present in new data
- keys = Object.keys(oldData);
- i = keys.length;
- while (i--) {
- key = keys[i];
- if (!(key in newData)) {
- this._unproxy(key);
- }
- }
- // proxy keys not already proxied,
- // and trigger change for changed values
- keys = Object.keys(newData);
- i = keys.length;
- while (i--) {
- key = keys[i];
- if (!hasOwn(this, key)) {
- // new property
- this._proxy(key);
- }
- }
- oldData.__ob__.removeVm(this);
- observe(newData, this);
- this._digest();
- };
-
- /**
- * Proxy a property, so that
- * vm.prop === vm._data.prop
- *
- * @param {String} key
- */
-
- Vue.prototype._proxy = function (key) {
- if (!isReserved(key)) {
- // need to store ref to self here
- // because these getter/setters might
- // be called by child scopes via
- // prototype inheritance.
- var self = this;
- Object.defineProperty(self, key, {
- configurable: true,
- enumerable: true,
- get: function proxyGetter() {
- return self._data[key];
- },
- set: function proxySetter(val) {
- self._data[key] = val;
- }
- });
- }
- };
-
- /**
- * Unproxy a property.
- *
- * @param {String} key
- */
-
- Vue.prototype._unproxy = function (key) {
- if (!isReserved(key)) {
- delete this[key];
- }
- };
-
- /**
- * Force update on every watcher in scope.
- */
-
- Vue.prototype._digest = function () {
- for (var i = 0, l = this._watchers.length; i < l; i++) {
- this._watchers[i].update(true); // shallow updates
- }
- };
-
- /**
- * Setup computed properties. They are essentially
- * special getter/setters
- */
-
- function noop() {}
- Vue.prototype._initComputed = function () {
- var computed = this.$options.computed;
- if (computed) {
- for (var key in computed) {
- var userDef = computed[key];
- var def = {
- enumerable: true,
- configurable: true
- };
- if (typeof userDef === 'function') {
- def.get = makeComputedGetter(userDef, this);
- def.set = noop;
- } else {
- def.get = userDef.get ? userDef.cache !== false ? makeComputedGetter(userDef.get, this) : bind(userDef.get, this) : noop;
- def.set = userDef.set ? bind(userDef.set, this) : noop;
- }
- Object.defineProperty(this, key, def);
- }
- }
- };
-
- function makeComputedGetter(getter, owner) {
- var watcher = new Watcher(owner, getter, null, {
- lazy: true
- });
- return function computedGetter() {
- if (watcher.dirty) {
- watcher.evaluate();
- }
- if (Dep.target) {
- watcher.depend();
- }
- return watcher.value;
- };
- }
-
- /**
- * Setup instance methods. Methods must be bound to the
- * instance since they might be passed down as a prop to
- * child components.
- */
-
- Vue.prototype._initMethods = function () {
- var methods = this.$options.methods;
- if (methods) {
- for (var key in methods) {
- this[key] = bind(methods[key], this);
- }
- }
- };
-
- /**
- * Initialize meta information like $index, $key & $value.
- */
-
- Vue.prototype._initMeta = function () {
- var metas = this.$options._meta;
- if (metas) {
- for (var key in metas) {
- defineReactive(this, key, metas[key]);
- }
- }
- };
- }
-
- var eventRE = /^v-on:|^@/;
-
- function eventsMixin (Vue) {
- /**
- * Setup the instance's option events & watchers.
- * If the value is a string, we pull it from the
- * instance's methods by name.
- */
-
- Vue.prototype._initEvents = function () {
- var options = this.$options;
- if (options._asComponent) {
- registerComponentEvents(this, options.el);
- }
- registerCallbacks(this, '$on', options.events);
- registerCallbacks(this, '$watch', options.watch);
- };
-
- /**
- * Register v-on events on a child component
- *
- * @param {Vue} vm
- * @param {Element} el
- */
-
- function registerComponentEvents(vm, el) {
- var attrs = el.attributes;
- var name, value, handler;
- for (var i = 0, l = attrs.length; i < l; i++) {
- name = attrs[i].name;
- if (eventRE.test(name)) {
- name = name.replace(eventRE, '');
- // force the expression into a statement so that
- // it always dynamically resolves the method to call (#2670)
- // kinda ugly hack, but does the job.
- value = attrs[i].value;
- if (isSimplePath(value)) {
- value += '.apply(this, $arguments)';
- }
- handler = (vm._scope || vm._context).$eval(value, true);
- handler._fromParent = true;
- vm.$on(name.replace(eventRE), handler);
- }
- }
- }
-
- /**
- * Register callbacks for option events and watchers.
- *
- * @param {Vue} vm
- * @param {String} action
- * @param {Object} hash
- */
-
- function registerCallbacks(vm, action, hash) {
- if (!hash) return;
- var handlers, key, i, j;
- for (key in hash) {
- handlers = hash[key];
- if (isArray(handlers)) {
- for (i = 0, j = handlers.length; i < j; i++) {
- register(vm, action, key, handlers[i]);
- }
- } else {
- register(vm, action, key, handlers);
- }
- }
- }
-
- /**
- * Helper to register an event/watch callback.
- *
- * @param {Vue} vm
- * @param {String} action
- * @param {String} key
- * @param {Function|String|Object} handler
- * @param {Object} [options]
- */
-
- function register(vm, action, key, handler, options) {
- var type = typeof handler;
- if (type === 'function') {
- vm[action](key, handler, options);
- } else if (type === 'string') {
- var methods = vm.$options.methods;
- var method = methods && methods[handler];
- if (method) {
- vm[action](key, method, options);
- } else {
- process.env.NODE_ENV !== 'production' && warn('Unknown method: "' + handler + '" when ' + 'registering callback for ' + action + ': "' + key + '".', vm);
- }
- } else if (handler && type === 'object') {
- register(vm, action, key, handler.handler, handler);
- }
- }
-
- /**
- * Setup recursive attached/detached calls
- */
-
- Vue.prototype._initDOMHooks = function () {
- this.$on('hook:attached', onAttached);
- this.$on('hook:detached', onDetached);
- };
-
- /**
- * Callback to recursively call attached hook on children
- */
-
- function onAttached() {
- if (!this._isAttached) {
- this._isAttached = true;
- this.$children.forEach(callAttach);
- }
- }
-
- /**
- * Iterator to call attached hook
- *
- * @param {Vue} child
- */
-
- function callAttach(child) {
- if (!child._isAttached && inDoc(child.$el)) {
- child._callHook('attached');
- }
- }
-
- /**
- * Callback to recursively call detached hook on children
- */
-
- function onDetached() {
- if (this._isAttached) {
- this._isAttached = false;
- this.$children.forEach(callDetach);
- }
- }
-
- /**
- * Iterator to call detached hook
- *
- * @param {Vue} child
- */
-
- function callDetach(child) {
- if (child._isAttached && !inDoc(child.$el)) {
- child._callHook('detached');
- }
- }
-
- /**
- * Trigger all handlers for a hook
- *
- * @param {String} hook
- */
-
- Vue.prototype._callHook = function (hook) {
- this.$emit('pre-hook:' + hook);
- var handlers = this.$options[hook];
- if (handlers) {
- for (var i = 0, j = handlers.length; i < j; i++) {
- handlers[i].call(this);
- }
- }
- this.$emit('hook:' + hook);
- };
- }
-
- function noop$1() {}
-
- /**
- * A directive links a DOM element with a piece of data,
- * which is the result of evaluating an expression.
- * It registers a watcher with the expression and calls
- * the DOM update function when a change is triggered.
- *
- * @param {Object} descriptor
- * - {String} name
- * - {Object} def
- * - {String} expression
- * - {Array<Object>} [filters]
- * - {Object} [modifiers]
- * - {Boolean} literal
- * - {String} attr
- * - {String} arg
- * - {String} raw
- * - {String} [ref]
- * - {Array<Object>} [interp]
- * - {Boolean} [hasOneTime]
- * @param {Vue} vm
- * @param {Node} el
- * @param {Vue} [host] - transclusion host component
- * @param {Object} [scope] - v-for scope
- * @param {Fragment} [frag] - owner fragment
- * @constructor
- */
- function Directive(descriptor, vm, el, host, scope, frag) {
- this.vm = vm;
- this.el = el;
- // copy descriptor properties
- this.descriptor = descriptor;
- this.name = descriptor.name;
- this.expression = descriptor.expression;
- this.arg = descriptor.arg;
- this.modifiers = descriptor.modifiers;
- this.filters = descriptor.filters;
- this.literal = this.modifiers && this.modifiers.literal;
- // private
- this._locked = false;
- this._bound = false;
- this._listeners = null;
- // link context
- this._host = host;
- this._scope = scope;
- this._frag = frag;
- // store directives on node in dev mode
- if (process.env.NODE_ENV !== 'production' && this.el) {
- this.el._vue_directives = this.el._vue_directives || [];
- this.el._vue_directives.push(this);
- }
- }
-
- /**
- * Initialize the directive, mixin definition properties,
- * setup the watcher, call definition bind() and update()
- * if present.
- */
-
- Directive.prototype._bind = function () {
- var name = this.name;
- var descriptor = this.descriptor;
-
- // remove attribute
- if ((name !== 'cloak' || this.vm._isCompiled) && this.el && this.el.removeAttribute) {
- var attr = descriptor.attr || 'v-' + name;
- this.el.removeAttribute(attr);
- }
-
- // copy def properties
- var def = descriptor.def;
- if (typeof def === 'function') {
- this.update = def;
- } else {
- extend(this, def);
- }
-
- // setup directive params
- this._setupParams();
-
- // initial bind
- if (this.bind) {
- this.bind();
- }
- this._bound = true;
-
- if (this.literal) {
- this.update && this.update(descriptor.raw);
- } else if ((this.expression || this.modifiers) && (this.update || this.twoWay) && !this._checkStatement()) {
- // wrapped updater for context
- var dir = this;
- if (this.update) {
- this._update = function (val, oldVal) {
- if (!dir._locked) {
- dir.update(val, oldVal);
- }
- };
- } else {
- this._update = noop$1;
- }
- var preProcess = this._preProcess ? bind(this._preProcess, this) : null;
- var postProcess = this._postProcess ? bind(this._postProcess, this) : null;
- var watcher = this._watcher = new Watcher(this.vm, this.expression, this._update, // callback
- {
- filters: this.filters,
- twoWay: this.twoWay,
- deep: this.deep,
- preProcess: preProcess,
- postProcess: postProcess,
- scope: this._scope
- });
- // v-model with inital inline value need to sync back to
- // model instead of update to DOM on init. They would
- // set the afterBind hook to indicate that.
- if (this.afterBind) {
- this.afterBind();
- } else if (this.update) {
- this.update(watcher.value);
- }
- }
- };
-
- /**
- * Setup all param attributes, e.g. track-by,
- * transition-mode, etc...
- */
-
- Directive.prototype._setupParams = function () {
- if (!this.params) {
- return;
- }
- var params = this.params;
- // swap the params array with a fresh object.
- this.params = Object.create(null);
- var i = params.length;
- var key, val, mappedKey;
- while (i--) {
- key = hyphenate(params[i]);
- mappedKey = camelize(key);
- val = getBindAttr(this.el, key);
- if (val != null) {
- // dynamic
- this._setupParamWatcher(mappedKey, val);
- } else {
- // static
- val = getAttr(this.el, key);
- if (val != null) {
- this.params[mappedKey] = val === '' ? true : val;
- }
- }
- }
- };
-
- /**
- * Setup a watcher for a dynamic param.
- *
- * @param {String} key
- * @param {String} expression
- */
-
- Directive.prototype._setupParamWatcher = function (key, expression) {
- var self = this;
- var called = false;
- var unwatch = (this._scope || this.vm).$watch(expression, function (val, oldVal) {
- self.params[key] = val;
- // since we are in immediate mode,
- // only call the param change callbacks if this is not the first update.
- if (called) {
- var cb = self.paramWatchers && self.paramWatchers[key];
- if (cb) {
- cb.call(self, val, oldVal);
- }
- } else {
- called = true;
- }
- }, {
- immediate: true,
- user: false
- });(this._paramUnwatchFns || (this._paramUnwatchFns = [])).push(unwatch);
- };
-
- /**
- * Check if the directive is a function caller
- * and if the expression is a callable one. If both true,
- * we wrap up the expression and use it as the event
- * handler.
- *
- * e.g. on-click="a++"
- *
- * @return {Boolean}
- */
-
- Directive.prototype._checkStatement = function () {
- var expression = this.expression;
- if (expression && this.acceptStatement && !isSimplePath(expression)) {
- var fn = parseExpression$1(expression).get;
- var scope = this._scope || this.vm;
- var handler = function handler(e) {
- scope.$event = e;
- fn.call(scope, scope);
- scope.$event = null;
- };
- if (this.filters) {
- handler = scope._applyFilters(handler, null, this.filters);
- }
- this.update(handler);
- return true;
- }
- };
-
- /**
- * Set the corresponding value with the setter.
- * This should only be used in two-way directives
- * e.g. v-model.
- *
- * @param {*} value
- * @public
- */
-
- Directive.prototype.set = function (value) {
- /* istanbul ignore else */
- if (this.twoWay) {
- this._withLock(function () {
- this._watcher.set(value);
- });
- } else if (process.env.NODE_ENV !== 'production') {
- warn('Directive.set() can only be used inside twoWay' + 'directives.');
- }
- };
-
- /**
- * Execute a function while preventing that function from
- * triggering updates on this directive instance.
- *
- * @param {Function} fn
- */
-
- Directive.prototype._withLock = function (fn) {
- var self = this;
- self._locked = true;
- fn.call(self);
- nextTick(function () {
- self._locked = false;
- });
- };
-
- /**
- * Convenience method that attaches a DOM event listener
- * to the directive element and autometically tears it down
- * during unbind.
- *
- * @param {String} event
- * @param {Function} handler
- * @param {Boolean} [useCapture]
- */
-
- Directive.prototype.on = function (event, handler, useCapture) {
- on(this.el, event, handler, useCapture);(this._listeners || (this._listeners = [])).push([event, handler]);
- };
-
- /**
- * Teardown the watcher and call unbind.
- */
-
- Directive.prototype._teardown = function () {
- if (this._bound) {
- this._bound = false;
- if (this.unbind) {
- this.unbind();
- }
- if (this._watcher) {
- this._watcher.teardown();
- }
- var listeners = this._listeners;
- var i;
- if (listeners) {
- i = listeners.length;
- while (i--) {
- off(this.el, listeners[i][0], listeners[i][1]);
- }
- }
- var unwatchFns = this._paramUnwatchFns;
- if (unwatchFns) {
- i = unwatchFns.length;
- while (i--) {
- unwatchFns[i]();
- }
- }
- if (process.env.NODE_ENV !== 'production' && this.el) {
- this.el._vue_directives.$remove(this);
- }
- this.vm = this.el = this._watcher = this._listeners = null;
- }
- };
-
- function lifecycleMixin (Vue) {
- /**
- * Update v-ref for component.
- *
- * @param {Boolean} remove
- */
-
- Vue.prototype._updateRef = function (remove) {
- var ref = this.$options._ref;
- if (ref) {
- var refs = (this._scope || this._context).$refs;
- if (remove) {
- if (refs[ref] === this) {
- refs[ref] = null;
- }
- } else {
- refs[ref] = this;
- }
- }
- };
-
- /**
- * Transclude, compile and link element.
- *
- * If a pre-compiled linker is available, that means the
- * passed in element will be pre-transcluded and compiled
- * as well - all we need to do is to call the linker.
- *
- * Otherwise we need to call transclude/compile/link here.
- *
- * @param {Element} el
- */
-
- Vue.prototype._compile = function (el) {
- var options = this.$options;
-
- // transclude and init element
- // transclude can potentially replace original
- // so we need to keep reference; this step also injects
- // the template and caches the original attributes
- // on the container node and replacer node.
- var original = el;
- el = transclude(el, options);
- this._initElement(el);
-
- // handle v-pre on root node (#2026)
- if (el.nodeType === 1 && getAttr(el, 'v-pre') !== null) {
- return;
- }
-
- // root is always compiled per-instance, because
- // container attrs and props can be different every time.
- var contextOptions = this._context && this._context.$options;
- var rootLinker = compileRoot(el, options, contextOptions);
-
- // resolve slot distribution
- resolveSlots(this, options._content);
-
- // compile and link the rest
- var contentLinkFn;
- var ctor = this.constructor;
- // component compilation can be cached
- // as long as it's not using inline-template
- if (options._linkerCachable) {
- contentLinkFn = ctor.linker;
- if (!contentLinkFn) {
- contentLinkFn = ctor.linker = compile(el, options);
- }
- }
-
- // link phase
- // make sure to link root with prop scope!
- var rootUnlinkFn = rootLinker(this, el, this._scope);
- var contentUnlinkFn = contentLinkFn ? contentLinkFn(this, el) : compile(el, options)(this, el);
-
- // register composite unlink function
- // to be called during instance destruction
- this._unlinkFn = function () {
- rootUnlinkFn();
- // passing destroying: true to avoid searching and
- // splicing the directives
- contentUnlinkFn(true);
- };
-
- // finally replace original
- if (options.replace) {
- replace(original, el);
- }
-
- this._isCompiled = true;
- this._callHook('compiled');
- };
-
- /**
- * Initialize instance element. Called in the public
- * $mount() method.
- *
- * @param {Element} el
- */
-
- Vue.prototype._initElement = function (el) {
- if (isFragment(el)) {
- this._isFragment = true;
- this.$el = this._fragmentStart = el.firstChild;
- this._fragmentEnd = el.lastChild;
- // set persisted text anchors to empty
- if (this._fragmentStart.nodeType === 3) {
- this._fragmentStart.data = this._fragmentEnd.data = '';
- }
- this._fragment = el;
- } else {
- this.$el = el;
- }
- this.$el.__vue__ = this;
- this._callHook('beforeCompile');
- };
-
- /**
- * Create and bind a directive to an element.
- *
- * @param {Object} descriptor - parsed directive descriptor
- * @param {Node} node - target node
- * @param {Vue} [host] - transclusion host component
- * @param {Object} [scope] - v-for scope
- * @param {Fragment} [frag] - owner fragment
- */
-
- Vue.prototype._bindDir = function (descriptor, node, host, scope, frag) {
- this._directives.push(new Directive(descriptor, this, node, host, scope, frag));
- };
-
- /**
- * Teardown an instance, unobserves the data, unbind all the
- * directives, turn off all the event listeners, etc.
- *
- * @param {Boolean} remove - whether to remove the DOM node.
- * @param {Boolean} deferCleanup - if true, defer cleanup to
- * be called later
- */
-
- Vue.prototype._destroy = function (remove, deferCleanup) {
- if (this._isBeingDestroyed) {
- if (!deferCleanup) {
- this._cleanup();
- }
- return;
- }
-
- var destroyReady;
- var pendingRemoval;
-
- var self = this;
- // Cleanup should be called either synchronously or asynchronoysly as
- // callback of this.$remove(), or if remove and deferCleanup are false.
- // In any case it should be called after all other removing, unbinding and
- // turning of is done
- var cleanupIfPossible = function cleanupIfPossible() {
- if (destroyReady && !pendingRemoval && !deferCleanup) {
- self._cleanup();
- }
- };
-
- // remove DOM element
- if (remove && this.$el) {
- pendingRemoval = true;
- this.$remove(function () {
- pendingRemoval = false;
- cleanupIfPossible();
- });
- }
-
- this._callHook('beforeDestroy');
- this._isBeingDestroyed = true;
- var i;
- // remove self from parent. only necessary
- // if parent is not being destroyed as well.
- var parent = this.$parent;
- if (parent && !parent._isBeingDestroyed) {
- parent.$children.$remove(this);
- // unregister ref (remove: true)
- this._updateRef(true);
- }
- // destroy all children.
- i = this.$children.length;
- while (i--) {
- this.$children[i].$destroy();
- }
- // teardown props
- if (this._propsUnlinkFn) {
- this._propsUnlinkFn();
- }
- // teardown all directives. this also tearsdown all
- // directive-owned watchers.
- if (this._unlinkFn) {
- this._unlinkFn();
- }
- i = this._watchers.length;
- while (i--) {
- this._watchers[i].teardown();
- }
- // remove reference to self on $el
- if (this.$el) {
- this.$el.__vue__ = null;
- }
-
- destroyReady = true;
- cleanupIfPossible();
- };
-
- /**
- * Clean up to ensure garbage collection.
- * This is called after the leave transition if there
- * is any.
- */
-
- Vue.prototype._cleanup = function () {
- if (this._isDestroyed) {
- return;
- }
- // remove self from owner fragment
- // do it in cleanup so that we can call $destroy with
- // defer right when a fragment is about to be removed.
- if (this._frag) {
- this._frag.children.$remove(this);
- }
- // remove reference from data ob
- // frozen object may not have observer.
- if (this._data && this._data.__ob__) {
- this._data.__ob__.removeVm(this);
- }
- // Clean up references to private properties and other
- // instances. preserve reference to _data so that proxy
- // accessors still work. The only potential side effect
- // here is that mutating the instance after it's destroyed
- // may affect the state of other components that are still
- // observing the same object, but that seems to be a
- // reasonable responsibility for the user rather than
- // always throwing an error on them.
- this.$el = this.$parent = this.$root = this.$children = this._watchers = this._context = this._scope = this._directives = null;
- // call the last hook...
- this._isDestroyed = true;
- this._callHook('destroyed');
- // turn off all instance listeners.
- this.$off();
- };
- }
-
- function miscMixin (Vue) {
- /**
- * Apply a list of filter (descriptors) to a value.
- * Using plain for loops here because this will be called in
- * the getter of any watcher with filters so it is very
- * performance sensitive.
- *
- * @param {*} value
- * @param {*} [oldValue]
- * @param {Array} filters
- * @param {Boolean} write
- * @return {*}
- */
-
- Vue.prototype._applyFilters = function (value, oldValue, filters, write) {
- var filter, fn, args, arg, offset, i, l, j, k;
- for (i = 0, l = filters.length; i < l; i++) {
- filter = filters[write ? l - i - 1 : i];
- fn = resolveAsset(this.$options, 'filters', filter.name, true);
- if (!fn) continue;
- fn = write ? fn.write : fn.read || fn;
- if (typeof fn !== 'function') continue;
- args = write ? [value, oldValue] : [value];
- offset = write ? 2 : 1;
- if (filter.args) {
- for (j = 0, k = filter.args.length; j < k; j++) {
- arg = filter.args[j];
- args[j + offset] = arg.dynamic ? this.$get(arg.value) : arg.value;
- }
- }
- value = fn.apply(this, args);
- }
- return value;
- };
-
- /**
- * Resolve a component, depending on whether the component
- * is defined normally or using an async factory function.
- * Resolves synchronously if already resolved, otherwise
- * resolves asynchronously and caches the resolved
- * constructor on the factory.
- *
- * @param {String|Function} value
- * @param {Function} cb
- */
-
- Vue.prototype._resolveComponent = function (value, cb) {
- var factory;
- if (typeof value === 'function') {
- factory = value;
- } else {
- factory = resolveAsset(this.$options, 'components', value, true);
- }
- /* istanbul ignore if */
- if (!factory) {
- return;
- }
- // async component factory
- if (!factory.options) {
- if (factory.resolved) {
- // cached
- cb(factory.resolved);
- } else if (factory.requested) {
- // pool callbacks
- factory.pendingCallbacks.push(cb);
- } else {
- factory.requested = true;
- var cbs = factory.pendingCallbacks = [cb];
- factory.call(this, function resolve(res) {
- if (isPlainObject(res)) {
- res = Vue.extend(res);
- }
- // cache resolved
- factory.resolved = res;
- // invoke callbacks
- for (var i = 0, l = cbs.length; i < l; i++) {
- cbs[i](res);
- }
- }, function reject(reason) {
- process.env.NODE_ENV !== 'production' && warn('Failed to resolve async component' + (typeof value === 'string' ? ': ' + value : '') + '. ' + (reason ? '\nReason: ' + reason : ''));
- });
- }
- } else {
- // normal component
- cb(factory);
- }
- };
- }
-
- var filterRE$1 = /[^|]\|[^|]/;
-
- function dataAPI (Vue) {
- /**
- * Get the value from an expression on this vm.
- *
- * @param {String} exp
- * @param {Boolean} [asStatement]
- * @return {*}
- */
-
- Vue.prototype.$get = function (exp, asStatement) {
- var res = parseExpression$1(exp);
- if (res) {
- if (asStatement) {
- var self = this;
- return function statementHandler() {
- self.$arguments = toArray(arguments);
- var result = res.get.call(self, self);
- self.$arguments = null;
- return result;
- };
- } else {
- try {
- return res.get.call(this, this);
- } catch (e) {}
- }
- }
- };
-
- /**
- * Set the value from an expression on this vm.
- * The expression must be a valid left-hand
- * expression in an assignment.
- *
- * @param {String} exp
- * @param {*} val
- */
-
- Vue.prototype.$set = function (exp, val) {
- var res = parseExpression$1(exp, true);
- if (res && res.set) {
- res.set.call(this, this, val);
- }
- };
-
- /**
- * Delete a property on the VM
- *
- * @param {String} key
- */
-
- Vue.prototype.$delete = function (key) {
- del(this._data, key);
- };
-
- /**
- * Watch an expression, trigger callback when its
- * value changes.
- *
- * @param {String|Function} expOrFn
- * @param {Function} cb
- * @param {Object} [options]
- * - {Boolean} deep
- * - {Boolean} immediate
- * @return {Function} - unwatchFn
- */
-
- Vue.prototype.$watch = function (expOrFn, cb, options) {
- var vm = this;
- var parsed;
- if (typeof expOrFn === 'string') {
- parsed = parseDirective(expOrFn);
- expOrFn = parsed.expression;
- }
- var watcher = new Watcher(vm, expOrFn, cb, {
- deep: options && options.deep,
- sync: options && options.sync,
- filters: parsed && parsed.filters,
- user: !options || options.user !== false
- });
- if (options && options.immediate) {
- cb.call(vm, watcher.value);
- }
- return function unwatchFn() {
- watcher.teardown();
- };
- };
-
- /**
- * Evaluate a text directive, including filters.
- *
- * @param {String} text
- * @param {Boolean} [asStatement]
- * @return {String}
- */
-
- Vue.prototype.$eval = function (text, asStatement) {
- // check for filters.
- if (filterRE$1.test(text)) {
- var dir = parseDirective(text);
- // the filter regex check might give false positive
- // for pipes inside strings, so it's possible that
- // we don't get any filters here
- var val = this.$get(dir.expression, asStatement);
- return dir.filters ? this._applyFilters(val, null, dir.filters) : val;
- } else {
- // no filter
- return this.$get(text, asStatement);
- }
- };
-
- /**
- * Interpolate a piece of template text.
- *
- * @param {String} text
- * @return {String}
- */
-
- Vue.prototype.$interpolate = function (text) {
- var tokens = parseText(text);
- var vm = this;
- if (tokens) {
- if (tokens.length === 1) {
- return vm.$eval(tokens[0].value) + '';
- } else {
- return tokens.map(function (token) {
- return token.tag ? vm.$eval(token.value) : token.value;
- }).join('');
- }
- } else {
- return text;
- }
- };
-
- /**
- * Log instance data as a plain JS object
- * so that it is easier to inspect in console.
- * This method assumes console is available.
- *
- * @param {String} [path]
- */
-
- Vue.prototype.$log = function (path) {
- var data = path ? getPath(this._data, path) : this._data;
- if (data) {
- data = clean(data);
- }
- // include computed fields
- if (!path) {
- var key;
- for (key in this.$options.computed) {
- data[key] = clean(this[key]);
- }
- if (this._props) {
- for (key in this._props) {
- data[key] = clean(this[key]);
- }
- }
- }
- console.log(data);
- };
-
- /**
- * "clean" a getter/setter converted object into a plain
- * object copy.
- *
- * @param {Object} - obj
- * @return {Object}
- */
-
- function clean(obj) {
- return JSON.parse(JSON.stringify(obj));
- }
- }
-
- function domAPI (Vue) {
- /**
- * Convenience on-instance nextTick. The callback is
- * auto-bound to the instance, and this avoids component
- * modules having to rely on the global Vue.
- *
- * @param {Function} fn
- */
-
- Vue.prototype.$nextTick = function (fn) {
- nextTick(fn, this);
- };
-
- /**
- * Append instance to target
- *
- * @param {Node} target
- * @param {Function} [cb]
- * @param {Boolean} [withTransition] - defaults to true
- */
-
- Vue.prototype.$appendTo = function (target, cb, withTransition) {
- return insert(this, target, cb, withTransition, append, appendWithTransition);
- };
-
- /**
- * Prepend instance to target
- *
- * @param {Node} target
- * @param {Function} [cb]
- * @param {Boolean} [withTransition] - defaults to true
- */
-
- Vue.prototype.$prependTo = function (target, cb, withTransition) {
- target = query(target);
- if (target.hasChildNodes()) {
- this.$before(target.firstChild, cb, withTransition);
- } else {
- this.$appendTo(target, cb, withTransition);
- }
- return this;
- };
-
- /**
- * Insert instance before target
- *
- * @param {Node} target
- * @param {Function} [cb]
- * @param {Boolean} [withTransition] - defaults to true
- */
-
- Vue.prototype.$before = function (target, cb, withTransition) {
- return insert(this, target, cb, withTransition, beforeWithCb, beforeWithTransition);
- };
-
- /**
- * Insert instance after target
- *
- * @param {Node} target
- * @param {Function} [cb]
- * @param {Boolean} [withTransition] - defaults to true
- */
-
- Vue.prototype.$after = function (target, cb, withTransition) {
- target = query(target);
- if (target.nextSibling) {
- this.$before(target.nextSibling, cb, withTransition);
- } else {
- this.$appendTo(target.parentNode, cb, withTransition);
- }
- return this;
- };
-
- /**
- * Remove instance from DOM
- *
- * @param {Function} [cb]
- * @param {Boolean} [withTransition] - defaults to true
- */
-
- Vue.prototype.$remove = function (cb, withTransition) {
- if (!this.$el.parentNode) {
- return cb && cb();
- }
- var inDocument = this._isAttached && inDoc(this.$el);
- // if we are not in document, no need to check
- // for transitions
- if (!inDocument) withTransition = false;
- var self = this;
- var realCb = function realCb() {
- if (inDocument) self._callHook('detached');
- if (cb) cb();
- };
- if (this._isFragment) {
- removeNodeRange(this._fragmentStart, this._fragmentEnd, this, this._fragment, realCb);
- } else {
- var op = withTransition === false ? removeWithCb : removeWithTransition;
- op(this.$el, this, realCb);
- }
- return this;
- };
-
- /**
- * Shared DOM insertion function.
- *
- * @param {Vue} vm
- * @param {Element} target
- * @param {Function} [cb]
- * @param {Boolean} [withTransition]
- * @param {Function} op1 - op for non-transition insert
- * @param {Function} op2 - op for transition insert
- * @return vm
- */
-
- function insert(vm, target, cb, withTransition, op1, op2) {
- target = query(target);
- var targetIsDetached = !inDoc(target);
- var op = withTransition === false || targetIsDetached ? op1 : op2;
- var shouldCallHook = !targetIsDetached && !vm._isAttached && !inDoc(vm.$el);
- if (vm._isFragment) {
- mapNodeRange(vm._fragmentStart, vm._fragmentEnd, function (node) {
- op(node, target, vm);
- });
- cb && cb();
- } else {
- op(vm.$el, target, vm, cb);
- }
- if (shouldCallHook) {
- vm._callHook('attached');
- }
- return vm;
- }
-
- /**
- * Check for selectors
- *
- * @param {String|Element} el
- */
-
- function query(el) {
- return typeof el === 'string' ? document.querySelector(el) : el;
- }
-
- /**
- * Append operation that takes a callback.
- *
- * @param {Node} el
- * @param {Node} target
- * @param {Vue} vm - unused
- * @param {Function} [cb]
- */
-
- function append(el, target, vm, cb) {
- target.appendChild(el);
- if (cb) cb();
- }
-
- /**
- * InsertBefore operation that takes a callback.
- *
- * @param {Node} el
- * @param {Node} target
- * @param {Vue} vm - unused
- * @param {Function} [cb]
- */
-
- function beforeWithCb(el, target, vm, cb) {
- before(el, target);
- if (cb) cb();
- }
-
- /**
- * Remove operation that takes a callback.
- *
- * @param {Node} el
- * @param {Vue} vm - unused
- * @param {Function} [cb]
- */
-
- function removeWithCb(el, vm, cb) {
- remove(el);
- if (cb) cb();
- }
- }
-
- function eventsAPI (Vue) {
- /**
- * Listen on the given `event` with `fn`.
- *
- * @param {String} event
- * @param {Function} fn
- */
-
- Vue.prototype.$on = function (event, fn) {
- (this._events[event] || (this._events[event] = [])).push(fn);
- modifyListenerCount(this, event, 1);
- return this;
- };
-
- /**
- * Adds an `event` listener that will be invoked a single
- * time then automatically removed.
- *
- * @param {String} event
- * @param {Function} fn
- */
-
- Vue.prototype.$once = function (event, fn) {
- var self = this;
- function on() {
- self.$off(event, on);
- fn.apply(this, arguments);
- }
- on.fn = fn;
- this.$on(event, on);
- return this;
- };
-
- /**
- * Remove the given callback for `event` or all
- * registered callbacks.
- *
- * @param {String} event
- * @param {Function} fn
- */
-
- Vue.prototype.$off = function (event, fn) {
- var cbs;
- // all
- if (!arguments.length) {
- if (this.$parent) {
- for (event in this._events) {
- cbs = this._events[event];
- if (cbs) {
- modifyListenerCount(this, event, -cbs.length);
- }
- }
- }
- this._events = {};
- return this;
- }
- // specific event
- cbs = this._events[event];
- if (!cbs) {
- return this;
- }
- if (arguments.length === 1) {
- modifyListenerCount(this, event, -cbs.length);
- this._events[event] = null;
- return this;
- }
- // specific handler
- var cb;
- var i = cbs.length;
- while (i--) {
- cb = cbs[i];
- if (cb === fn || cb.fn === fn) {
- modifyListenerCount(this, event, -1);
- cbs.splice(i, 1);
- break;
- }
- }
- return this;
- };
-
- /**
- * Trigger an event on self.
- *
- * @param {String|Object} event
- * @return {Boolean} shouldPropagate
- */
-
- Vue.prototype.$emit = function (event) {
- var isSource = typeof event === 'string';
- event = isSource ? event : event.name;
- var cbs = this._events[event];
- var shouldPropagate = isSource || !cbs;
- if (cbs) {
- cbs = cbs.length > 1 ? toArray(cbs) : cbs;
- // this is a somewhat hacky solution to the question raised
- // in #2102: for an inline component listener like <comp @test="doThis">,
- // the propagation handling is somewhat broken. Therefore we
- // need to treat these inline callbacks differently.
- var hasParentCbs = isSource && cbs.some(function (cb) {
- return cb._fromParent;
- });
- if (hasParentCbs) {
- shouldPropagate = false;
- }
- var args = toArray(arguments, 1);
- for (var i = 0, l = cbs.length; i < l; i++) {
- var cb = cbs[i];
- var res = cb.apply(this, args);
- if (res === true && (!hasParentCbs || cb._fromParent)) {
- shouldPropagate = true;
- }
- }
- }
- return shouldPropagate;
- };
-
- /**
- * Recursively broadcast an event to all children instances.
- *
- * @param {String|Object} event
- * @param {...*} additional arguments
- */
-
- Vue.prototype.$broadcast = function (event) {
- var isSource = typeof event === 'string';
- event = isSource ? event : event.name;
- // if no child has registered for this event,
- // then there's no need to broadcast.
- if (!this._eventsCount[event]) return;
- var children = this.$children;
- var args = toArray(arguments);
- if (isSource) {
- // use object event to indicate non-source emit
- // on children
- args[0] = { name: event, source: this };
- }
- for (var i = 0, l = children.length; i < l; i++) {
- var child = children[i];
- var shouldPropagate = child.$emit.apply(child, args);
- if (shouldPropagate) {
- child.$broadcast.apply(child, args);
- }
- }
- return this;
- };
-
- /**
- * Recursively propagate an event up the parent chain.
- *
- * @param {String} event
- * @param {...*} additional arguments
- */
-
- Vue.prototype.$dispatch = function (event) {
- var shouldPropagate = this.$emit.apply(this, arguments);
- if (!shouldPropagate) return;
- var parent = this.$parent;
- var args = toArray(arguments);
- // use object event to indicate non-source emit
- // on parents
- args[0] = { name: event, source: this };
- while (parent) {
- shouldPropagate = parent.$emit.apply(parent, args);
- parent = shouldPropagate ? parent.$parent : null;
- }
- return this;
- };
-
- /**
- * Modify the listener counts on all parents.
- * This bookkeeping allows $broadcast to return early when
- * no child has listened to a certain event.
- *
- * @param {Vue} vm
- * @param {String} event
- * @param {Number} count
- */
-
- var hookRE = /^hook:/;
- function modifyListenerCount(vm, event, count) {
- var parent = vm.$parent;
- // hooks do not get broadcasted so no need
- // to do bookkeeping for them
- if (!parent || !count || hookRE.test(event)) return;
- while (parent) {
- parent._eventsCount[event] = (parent._eventsCount[event] || 0) + count;
- parent = parent.$parent;
- }
- }
- }
-
- function lifecycleAPI (Vue) {
- /**
- * Set instance target element and kick off the compilation
- * process. The passed in `el` can be a selector string, an
- * existing Element, or a DocumentFragment (for block
- * instances).
- *
- * @param {Element|DocumentFragment|string} el
- * @public
- */
-
- Vue.prototype.$mount = function (el) {
- if (this._isCompiled) {
- process.env.NODE_ENV !== 'production' && warn('$mount() should be called only once.', this);
- return;
- }
- el = query(el);
- if (!el) {
- el = document.createElement('div');
- }
- this._compile(el);
- this._initDOMHooks();
- if (inDoc(this.$el)) {
- this._callHook('attached');
- ready.call(this);
- } else {
- this.$once('hook:attached', ready);
- }
- return this;
- };
-
- /**
- * Mark an instance as ready.
- */
-
- function ready() {
- this._isAttached = true;
- this._isReady = true;
- this._callHook('ready');
- }
-
- /**
- * Teardown the instance, simply delegate to the internal
- * _destroy.
- *
- * @param {Boolean} remove
- * @param {Boolean} deferCleanup
- */
-
- Vue.prototype.$destroy = function (remove, deferCleanup) {
- this._destroy(remove, deferCleanup);
- };
-
- /**
- * Partially compile a piece of DOM and return a
- * decompile function.
- *
- * @param {Element|DocumentFragment} el
- * @param {Vue} [host]
- * @param {Object} [scope]
- * @param {Fragment} [frag]
- * @return {Function}
- */
-
- Vue.prototype.$compile = function (el, host, scope, frag) {
- return compile(el, this.$options, true)(this, el, host, scope, frag);
- };
- }
-
- /**
- * The exposed Vue constructor.
- *
- * API conventions:
- * - public API methods/properties are prefixed with `$`
- * - internal methods/properties are prefixed with `_`
- * - non-prefixed properties are assumed to be proxied user
- * data.
- *
- * @constructor
- * @param {Object} [options]
- * @public
- */
-
- function Vue(options) {
- this._init(options);
- }
-
- // install internals
- initMixin(Vue);
- stateMixin(Vue);
- eventsMixin(Vue);
- lifecycleMixin(Vue);
- miscMixin(Vue);
-
- // install instance APIs
- dataAPI(Vue);
- domAPI(Vue);
- eventsAPI(Vue);
- lifecycleAPI(Vue);
-
- var slot = {
-
- priority: SLOT,
- params: ['name'],
-
- bind: function bind() {
- // this was resolved during component transclusion
- var name = this.params.name || 'default';
- var content = this.vm._slotContents && this.vm._slotContents[name];
- if (!content || !content.hasChildNodes()) {
- this.fallback();
- } else {
- this.compile(content.cloneNode(true), this.vm._context, this.vm);
- }
- },
-
- compile: function compile(content, context, host) {
- if (content && context) {
- if (this.el.hasChildNodes() && content.childNodes.length === 1 && content.childNodes[0].nodeType === 1 && content.childNodes[0].hasAttribute('v-if')) {
- // if the inserted slot has v-if
- // inject fallback content as the v-else
- var elseBlock = document.createElement('template');
- elseBlock.setAttribute('v-else', '');
- elseBlock.innerHTML = this.el.innerHTML;
- // the else block should be compiled in child scope
- elseBlock._context = this.vm;
- content.appendChild(elseBlock);
- }
- var scope = host ? host._scope : this._scope;
- this.unlink = context.$compile(content, host, scope, this._frag);
- }
- if (content) {
- replace(this.el, content);
- } else {
- remove(this.el);
- }
- },
-
- fallback: function fallback() {
- this.compile(extractContent(this.el, true), this.vm);
- },
-
- unbind: function unbind() {
- if (this.unlink) {
- this.unlink();
- }
- }
- };
-
- var partial = {
-
- priority: PARTIAL,
-
- params: ['name'],
-
- // watch changes to name for dynamic partials
- paramWatchers: {
- name: function name(value) {
- vIf.remove.call(this);
- if (value) {
- this.insert(value);
- }
- }
- },
-
- bind: function bind() {
- this.anchor = createAnchor('v-partial');
- replace(this.el, this.anchor);
- this.insert(this.params.name);
- },
-
- insert: function insert(id) {
- var partial = resolveAsset(this.vm.$options, 'partials', id, true);
- if (partial) {
- this.factory = new FragmentFactory(this.vm, partial);
- vIf.insert.call(this);
- }
- },
-
- unbind: function unbind() {
- if (this.frag) {
- this.frag.destroy();
- }
- }
- };
-
- var elementDirectives = {
- slot: slot,
- partial: partial
- };
-
- var convertArray = vFor._postProcess;
-
- /**
- * Limit filter for arrays
- *
- * @param {Number} n
- * @param {Number} offset (Decimal expected)
- */
-
- function limitBy(arr, n, offset) {
- offset = offset ? parseInt(offset, 10) : 0;
- n = toNumber(n);
- return typeof n === 'number' ? arr.slice(offset, offset + n) : arr;
- }
-
- /**
- * Filter filter for arrays
- *
- * @param {String} search
- * @param {String} [delimiter]
- * @param {String} ...dataKeys
- */
-
- function filterBy(arr, search, delimiter) {
- arr = convertArray(arr);
- if (search == null) {
- return arr;
- }
- if (typeof search === 'function') {
- return arr.filter(search);
- }
- // cast to lowercase string
- search = ('' + search).toLowerCase();
- // allow optional `in` delimiter
- // because why not
- var n = delimiter === 'in' ? 3 : 2;
- // extract and flatten keys
- var keys = Array.prototype.concat.apply([], toArray(arguments, n));
- var res = [];
- var item, key, val, j;
- for (var i = 0, l = arr.length; i < l; i++) {
- item = arr[i];
- val = item && item.$value || item;
- j = keys.length;
- if (j) {
- while (j--) {
- key = keys[j];
- if (key === '$key' && contains(item.$key, search) || contains(getPath(val, key), search)) {
- res.push(item);
- break;
- }
- }
- } else if (contains(item, search)) {
- res.push(item);
- }
- }
- return res;
- }
-
- /**
- * Order filter for arrays
- *
- * @param {String|Array<String>|Function} ...sortKeys
- * @param {Number} [order]
- */
-
- function orderBy(arr) {
- var comparator = null;
- var sortKeys = undefined;
- arr = convertArray(arr);
-
- // determine order (last argument)
- var args = toArray(arguments, 1);
- var order = args[args.length - 1];
- if (typeof order === 'number') {
- order = order < 0 ? -1 : 1;
- args = args.length > 1 ? args.slice(0, -1) : args;
- } else {
- order = 1;
- }
-
- // determine sortKeys & comparator
- var firstArg = args[0];
- if (!firstArg) {
- return arr;
- } else if (typeof firstArg === 'function') {
- // custom comparator
- comparator = function (a, b) {
- return firstArg(a, b) * order;
- };
- } else {
- // string keys. flatten first
- sortKeys = Array.prototype.concat.apply([], args);
- comparator = function (a, b, i) {
- i = i || 0;
- return i >= sortKeys.length - 1 ? baseCompare(a, b, i) : baseCompare(a, b, i) || comparator(a, b, i + 1);
- };
- }
-
- function baseCompare(a, b, sortKeyIndex) {
- var sortKey = sortKeys[sortKeyIndex];
- if (sortKey) {
- if (sortKey !== '$key') {
- if (isObject(a) && '$value' in a) a = a.$value;
- if (isObject(b) && '$value' in b) b = b.$value;
- }
- a = isObject(a) ? getPath(a, sortKey) : a;
- b = isObject(b) ? getPath(b, sortKey) : b;
- }
- return a === b ? 0 : a > b ? order : -order;
- }
-
- // sort on a copy to avoid mutating original array
- return arr.slice().sort(comparator);
- }
-
- /**
- * String contain helper
- *
- * @param {*} val
- * @param {String} search
+"use strict";function n(t,e,r){if(i(t,e))return void(t[e]=r);if(t._isVue)return void n(t._data,e,r);var o=t.__ob__;if(!o)return void(t[e]=r);if(o.convert(e,r),o.dep.notify(),o.vms)for(var a=o.vms.length;a--;){var s=o.vms[a];s._proxy(e),s._digest()}return r}function r(t,e){if(i(t,e)){delete t[e];var n=t.__ob__;if(!n)return void(t._isVue&&(delete t._data[e],t._digest()));if(n.dep.notify(),n.vms)for(var r=n.vms.length;r--;){var o=n.vms[r];o._unproxy(e),o._digest()}}}function i(t,e){return Vn.call(t,e)}function o(t){return Hn.test(t)}function a(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function s(t){return null==t?"":t.toString()}function l(t){if("string"!=typeof t)return t;var e=Number(t);return isNaN(e)?t:e}function c(t){return"true"===t||"false"!==t&&t}function f(t){var e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e!==n||34!==e&&39!==e?t:t.slice(1,-1)}function u(t){return t.replace(Un,h)}function h(t,e){return e?e.toUpperCase():""}function p(t){return t.replace(Wn,"$1-$2").replace(Wn,"$1-$2").toLowerCase()}function d(t){return t.replace(Zn,h)}function g(t,e){return function(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}}function v(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function m(t,e){for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}function y(t){return null!==t&&"object"==typeof t}function b(t){return Jn.call(t)===Gn}function _(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function x(t,e){var n,r,i,o,a,s=function s(){var l=Date.now()-o;l<e&&l>=0?n=setTimeout(s,e-l):(n=null,a=t.apply(i,r),n||(i=r=null))};return function(){return i=this,r=arguments,o=Date.now(),n||(n=setTimeout(s,e)),a}}function w(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function k(t){var e=function e(){if(!e.cancelled)return t.apply(this,arguments)};return e.cancel=function(){e.cancelled=!0},e}function C(t,e){return t==e||!(!y(t)||!y(e))&&JSON.stringify(t)===JSON.stringify(e)}function T(t){return/native code/.test(t.toString())}function j(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap=Object.create(null)}function $(){return dr.charCodeAt(mr+1)}function A(){return dr.charCodeAt(++mr)}function S(){return mr>=vr}function O(){for(;$()===Or;)A()}function M(t){return t===jr||t===$r}function E(t){return Mr[t]}function P(t,e){return Er[t]===e}function N(){for(var t,e=A();!S();)if(t=A(),t===Sr)A();else if(t===e)break}function F(t){for(var e=0,n=t;!S();)if(t=$(),M(t))N();else if(n===t&&e++,P(n,t)&&e--,A(),0===e)break}function R(){for(var t=mr;!S();)if(yr=$(),M(yr))N();else if(E(yr))F(yr);else if(yr===Ar){if(A(),yr=$(),yr!==Ar){br!==wr&&br!==Tr||(br=kr);break}A()}else{if(yr===Or&&(br===Cr||br===Tr)){O();break}br===kr&&(br=Cr),A()}return dr.slice(t+1,mr)||null}function B(){for(var t=[];!S();)t.push(D());return t}function D(){var t,e={};return br=kr,e.name=R().trim(),br=Tr,t=z(),t.length&&(e.args=t),e}function z(){for(var t=[];!S()&&br!==kr;){var e=R();if(!e)break;t.push(I(e))}return t}function I(t){if(xr.test(t))return{value:l(t),dynamic:!1};var e=f(t),n=e===t;return{value:n?t:e,dynamic:n}}function L(t){var e=_r.get(t);if(e)return e;dr=t,gr={},vr=dr.length,mr=-1,yr="",br=wr;var n;return dr.indexOf("|")<0?gr.expression=dr.trim():(gr.expression=R().trim(),n=B(),n.length&&(gr.filters=n)),_r.put(t,gr),gr}function q(t){return t.replace(Nr,"\\$&")}function V(){var t=q(qr.delimiters[0]),e=q(qr.delimiters[1]),n=q(qr.unsafeDelimiters[0]),r=q(qr.unsafeDelimiters[1]);Rr=new RegExp(n+"((?:.|\\n)+?)"+r+"|"+t+"((?:.|\\n)+?)"+e,"g"),Br=new RegExp("^"+n+"((?:.|\\n)+?)"+r+"$"),Fr=new j(1e3)}function H(t){Fr||V();var e=Fr.get(t);if(e)return e;if(!Rr.test(t))return null;for(var n,r,i,o,a,s,l=[],c=Rr.lastIndex=0;n=Rr.exec(t);)r=n.index,r>c&&l.push({value:t.slice(c,r)}),i=Br.test(n[0]),o=i?n[1]:n[2],a=o.charCodeAt(0),s=42===a,o=s?o.slice(1):o,l.push({tag:!0,value:o.trim(),html:i,oneTime:s}),c=r+n[0].length;return c<t.length&&l.push({value:t.slice(c)}),Fr.put(t,l),l}function U(t,e){return t.length>1?t.map(function(t){return W(t,e)}).join("+"):W(t[0],e,!0)}function W(t,e,n){return t.tag?t.oneTime&&e?'"'+e.$eval(t.value)+'"':Z(t.value,n):'"'+t.value+'"'}function Z(t,e){if(Dr.test(t)){var n=L(t);return n.filters?"this._applyFilters("+n.expression+",null,"+JSON.stringify(n.filters)+",false)":"("+t+")"}return e?t:"("+t+")"}function J(t,e,n,r){Y(t,1,function(){e.appendChild(t)},n,r)}function G(t,e,n,r){Y(t,1,function(){rt(t,e)},n,r)}function X(t,e,n){Y(t,-1,function(){ot(t)},e,n)}function Y(t,e,n,r,i){var o=t.__v_trans;if(!o||!o.hooks&&!ar||!r._isCompiled||r.$parent&&!r.$parent._isCompiled)return n(),void(i&&i());var a=e>0?"enter":"leave";o[a](n,i)}function K(t){if("string"==typeof t){t=document.querySelector(t)}return t}function Q(t){if(!t)return!1;var e=t.ownerDocument.documentElement,n=t.parentNode;return e===t||e===n||!(!n||1!==n.nodeType||!e.contains(n))}function tt(t,e){var n=t.getAttribute(e);return null!==n&&t.removeAttribute(e),n}function et(t,e){var n=tt(t,":"+e);return null===n&&(n=tt(t,"v-bind:"+e)),n}function nt(t,e){return t.hasAttribute(e)||t.hasAttribute(":"+e)||t.hasAttribute("v-bind:"+e)}function rt(t,e){e.parentNode.insertBefore(t,e)}function it(t,e){e.nextSibling?rt(t,e.nextSibling):e.parentNode.appendChild(t)}function ot(t){t.parentNode.removeChild(t)}function at(t,e){e.firstChild?rt(t,e.firstChild):e.appendChild(t)}function st(t,e){var n=t.parentNode;n&&n.replaceChild(e,t)}function lt(t,e,n,r){t.addEventListener(e,n,r)}function ct(t,e,n){t.removeEventListener(e,n)}function ft(t){var e=t.className;return"object"==typeof e&&(e=e.baseVal||""),e}function ut(t,e){nr&&!/svg$/.test(t.namespaceURI)?t.className=e:t.setAttribute("class",e)}function ht(t,e){if(t.classList)t.classList.add(e);else{var n=" "+ft(t)+" ";n.indexOf(" "+e+" ")<0&&ut(t,(n+e).trim())}}function pt(t,e){if(t.classList)t.classList.remove(e);else{for(var n=" "+ft(t)+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");ut(t,n.trim())}t.className||t.removeAttribute("class")}function dt(t,e){var n,r;if(mt(t)&&wt(t.content)&&(t=t.content),t.hasChildNodes())for(gt(t),r=e?document.createDocumentFragment():document.createElement("div");n=t.firstChild;)r.appendChild(n);return r}function gt(t){for(var e;e=t.firstChild,vt(e);)t.removeChild(e);for(;e=t.lastChild,vt(e);)t.removeChild(e)}function vt(t){return t&&(3===t.nodeType&&!t.data.trim()||8===t.nodeType)}function mt(t){return t.tagName&&"template"===t.tagName.toLowerCase()}function yt(t,e){var n=qr.debug?document.createComment(t):document.createTextNode(e?" ":"");return n.__v_anchor=!0,n}function bt(t){if(t.hasAttributes())for(var e=t.attributes,n=0,r=e.length;n<r;n++){var i=e[n].name;if(Ur.test(i))return u(i.replace(Ur,""))}}function _t(t,e,n){for(var r;t!==e;)r=t.nextSibling,n(t),t=r;n(e)}function xt(t,e,n,r,i){function o(){if(s++,a&&s>=l.length){for(var t=0;t<l.length;t++)r.appendChild(l[t]);i&&i()}}var a=!1,s=0,l=[];_t(t,e,function(t){t===e&&(a=!0),l.push(t),X(t,n,o)})}function wt(t){return t&&11===t.nodeType}function kt(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}function Ct(t,e){var n=t.tagName.toLowerCase(),r=t.hasAttributes();if(Wr.test(n)||Zr.test(n)){if(r)return Tt(t,e)}else{if(Et(e,"components",n))return{id:n};var i=r&&Tt(t,e);if(i)return i}}function Tt(t,e){var n=t.getAttribute("is");if(null!=n){if(Et(e,"components",n))return t.removeAttribute("is"),{id:n}}else if(n=et(t,"is"),null!=n)return{id:n,dynamic:!0}}function jt(t,e){var r,o,a;for(r in e)o=t[r],a=e[r],i(t,r)?y(o)&&y(a)&&jt(o,a):n(t,r,a);return t}function $t(t,e){var n=Object.create(t||null);return e?m(n,Ot(e)):n}function At(t){if(t.components)for(var e,n=t.components=Ot(t.components),r=Object.keys(n),i=0,o=r.length;i<o;i++){var a=r[i];Wr.test(a)||Zr.test(a)||(e=n[a],b(e)&&(n[a]=Bn.extend(e)))}}function St(t){var e,n,r=t.props;if(Xn(r))for(t.props={},e=r.length;e--;)n=r[e],"string"==typeof n?t.props[n]=null:n.name&&(t.props[n.name]=n);else if(b(r)){var i=Object.keys(r);for(e=i.length;e--;)n=r[i[e]],"function"==typeof n&&(r[i[e]]={type:n})}}function Ot(t){if(Xn(t)){for(var e,n={},r=t.length;r--;){e=t[r];var i="function"==typeof e?e.options&&e.options.name||e.id:e.name||e.id;i&&(n[i]=e)}return n}return t}function Mt(t,e,n){function r(r){var i=Jr[r]||Gr;a[r]=i(t[r],e[r],n,r)}At(e),St(e);var o,a={};if(e.extends&&(t="function"==typeof e.extends?Mt(t,e.extends.options,n):Mt(t,e.extends,n)),e.mixins)for(var s=0,l=e.mixins.length;s<l;s++){var c=e.mixins[s],f=c.prototype instanceof Bn?c.options:c;t=Mt(t,f,n)}for(o in t)r(o);for(o in e)i(t,o)||r(o);return a}function Et(t,e,n,r){if("string"==typeof n){var i,o=t[e],a=o[n]||o[i=u(n)]||o[i.charAt(0).toUpperCase()+i.slice(1)];return a}}function Pt(){this.id=Xr++,this.subs=[]}function Nt(t){ti=!1,t(),ti=!0}function Ft(t){if(this.value=t,this.dep=new Pt,_(t,"__ob__",this),Xn(t)){var e=Yn?Rt:Bt;e(t,Kr,Qr),this.observeArray(t)}else this.walk(t)}function Rt(t,e){t.__proto__=e}function Bt(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];_(t,o,e[o])}}function Dt(t,e){if(t&&"object"==typeof t){var n;return i(t,"__ob__")&&t.__ob__ instanceof Ft?n=t.__ob__:ti&&(Xn(t)||b(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new Ft(t)),n&&e&&n.addVm(e),n}}function zt(t,e,n){var r=new Pt,i=Object.getOwnPropertyDescriptor(t,e);if(!i||i.configurable!==!1){var o=i&&i.get,a=i&&i.set,s=Dt(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=o?o.call(t):n;if(Pt.target&&(r.depend(),s&&s.dep.depend(),Xn(e)))for(var i,a=0,l=e.length;a<l;a++)i=e[a],i&&i.__ob__&&i.__ob__.dep.depend();return e},set:function(e){var i=o?o.call(t):n;e!==i&&(a?a.call(t,e):n=e,s=Dt(e),r.notify())}})}}function It(t){t.prototype._init=function(t){t=t||{},this.$el=null,this.$parent=t.parent,this.$root=this.$parent?this.$parent.$root:this,this.$children=[],this.$refs={},this.$els={},this._watchers=[],this._directives=[],this._uid=ni++,this._isVue=!0,this._events={},this._eventsCount={},this._isFragment=!1,this._fragment=this._fragmentStart=this._fragmentEnd=null,this._isCompiled=this._isDestroyed=this._isReady=this._isAttached=this._isBeingDestroyed=this._vForRemoving=!1,this._unlinkFn=null,this._context=t._context||this.$parent,this._scope=t._scope,this._frag=t._frag,this._frag&&this._frag.children.push(this),this.$parent&&this.$parent.$children.push(this),t=this.$options=Mt(this.constructor.options,t,this),this._updateRef(),this._data={},this._callHook("init"),this._initState(),this._initEvents(),this._callHook("created"),t.el&&this.$mount(t.el)}}function Lt(t){if(void 0===t)return"eof";var e=t.charCodeAt(0);switch(e){case 91:case 93:case 46:case 34:case 39:case 48:return t;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return e>=97&&e<=122||e>=65&&e<=90?"ident":e>=49&&e<=57?"number":"else"}function qt(t){var e=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(o(e)?f(e):"*"+e)}function Vt(t){function e(){var e=t[f+1];if(u===pi&&"'"===e||u===di&&'"'===e)return f++,r="\\"+e,p[ii](),!0}var n,r,i,o,a,s,l,c=[],f=-1,u=li,h=0,p=[];for(p[oi]=function(){void 0!==i&&(c.push(i),i=void 0)},p[ii]=function(){void 0===i?i=r:i+=r},p[ai]=function(){p[ii](),h++},p[si]=function(){if(h>0)h--,u=hi,p[ii]();else{if(h=0,i=qt(i),i===!1)return!1;p[oi]()}};null!=u;)if(f++,n=t[f],"\\"!==n||!e()){if(o=Lt(n),l=mi[u],a=l[o]||l.else||vi,a===vi)return;if(u=a[0],s=p[a[1]],s&&(r=a[2],r=void 0===r?n:r,s()===!1))return;if(u===gi)return c.raw=t,c}}function Ht(t){var e=ri.get(t);return e||(e=Vt(t),e&&ri.put(t,e)),e}function Ut(t,e){return te(e).get(t)}function Wt(t,e,r){var i=t;if("string"==typeof e&&(e=Vt(e)),!e||!y(t))return!1;for(var o,a,s=0,l=e.length;s<l;s++)o=t,a=e[s],"*"===a.charAt(0)&&(a=te(a.slice(1)).get.call(i,i)),s<l-1?(t=t[a],y(t)||(t={},n(o,a,t))):Xn(t)?t.$set(a,r):a in t?t[a]=r:n(t,a,r);return!0}function Zt(){}function Jt(t,e){var n=Mi.length;return Mi[n]=e?t.replace(Ti,"\\n"):t,'"'+n+'"'}function Gt(t){var e=t.charAt(0),n=t.slice(1);return xi.test(n)?t:(n=n.indexOf('"')>-1?n.replace($i,Xt):n,e+"scope."+n)}function Xt(t,e){return Mi[e]}function Yt(t){ki.test(t),Mi.length=0;var e=t.replace(ji,Jt).replace(Ci,"");return e=(" "+e).replace(Si,Gt).replace($i,Xt),Kt(e)}function Kt(t){try{return new Function("scope","return "+t+";")}catch(t){return Zt}}function Qt(t){var e=Ht(t);if(e)return function(t,n){Wt(t,e,n)}}function te(t,e){t=t.trim();var n=bi.get(t);if(n)return e&&!n.set&&(n.set=Qt(n.exp)),n;var r={exp:t};return r.get=ee(t)&&t.indexOf("[")<0?Kt("scope."+t):Yt(t),e&&(r.set=Qt(t)),bi.put(t,r),r}function ee(t){return Ai.test(t)&&!Oi.test(t)&&"Math."!==t.slice(0,5)}function ne(){Pi.length=0,Ni.length=0,Fi={},Ri={},Bi=!1}function re(){for(var t=!0;t;)t=!1,ie(Pi),ie(Ni),Pi.length?t=!0:(Qn&&qr.devtools&&Qn.emit("flush"),ne())}function ie(t){for(var e=0;e<t.length;e++){var n=t[e],r=n.id;Fi[r]=null,n.run()}t.length=0}function oe(t){var e=t.id;if(null==Fi[e]){var n=t.user?Ni:Pi;Fi[e]=n.length,n.push(t),Bi||(Bi=!0,ur(re))}}function ae(t,e,n,r){r&&m(this,r);var i="function"==typeof e;if(this.vm=t,t._watchers.push(this),this.expression=e,this.cb=n,this.id=++Di,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new hr,this.newDepIds=new hr,this.prevError=null,i)this.getter=e,this.setter=void 0;else{var o=te(e,this.twoWay);this.getter=o.get,this.setter=o.set}this.value=this.lazy?void 0:this.get(),this.queued=this.shallow=!1}function se(t,e){var n=void 0,r=void 0;e||(e=zi,e.clear());var i=Xn(t),o=y(t);if((i||o)&&Object.isExtensible(t)){if(t.__ob__){var a=t.__ob__.dep.id;if(e.has(a))return;e.add(a)}if(i)for(n=t.length;n--;)se(t[n],e);else if(o)for(r=Object.keys(t),n=r.length;n--;)se(t[r[n]],e)}}function le(t){return mt(t)&&wt(t.content)}function ce(t,e){var n=e?t:t.trim(),r=Li.get(n);if(r)return r;var i=document.createDocumentFragment(),o=t.match(Hi),a=Ui.test(t),s=Wi.test(t);if(o||a||s){var l=o&&o[1],c=Vi[l]||Vi.efault,f=c[0],u=c[1],h=c[2],p=document.createElement("div");for(p.innerHTML=u+t+h;f--;)p=p.lastChild;for(var d;d=p.firstChild;)i.appendChild(d)}else i.appendChild(document.createTextNode(t));return e||gt(i),Li.put(n,i),i}function fe(t){if(le(t))return ce(t.innerHTML);if("SCRIPT"===t.tagName)return ce(t.textContent);for(var e,n=ue(t),r=document.createDocumentFragment();e=n.firstChild;)r.appendChild(e);return gt(r),r}function ue(t){if(!t.querySelectorAll)return t.cloneNode();var e,n,r,i=t.cloneNode(!0);if(Zi){var o=i;if(le(t)&&(t=t.content,o=i.content),n=t.querySelectorAll("template"),n.length)for(r=o.querySelectorAll("template"),e=r.length;e--;)r[e].parentNode.replaceChild(ue(n[e]),r[e])}if(Ji)if("TEXTAREA"===t.tagName)i.value=t.value;else if(n=t.querySelectorAll("textarea"),n.length)for(r=i.querySelectorAll("textarea"),e=r.length;e--;)r[e].value=n[e].value;return i}function he(t,e,n){var r,i;return wt(t)?(gt(t),e?ue(t):t):("string"==typeof t?n||"#"!==t.charAt(0)?i=ce(t,n):(i=qi.get(t),i||(r=document.getElementById(t.slice(1)),r&&(i=fe(r),qi.put(t,i)))):t.nodeType&&(i=fe(t)),i&&e?ue(i):i)}function pe(t,e,n,r,i,o){this.children=[],this.childFrags=[],this.vm=e,this.scope=i,this.inserted=!1,this.parentFrag=o,o&&o.childFrags.push(this),this.unlink=t(e,n,r,i,this);var a=this.single=1===n.childNodes.length&&!n.childNodes[0].__v_anchor;a?(this.node=n.childNodes[0],this.before=de,this.remove=ge):(this.node=yt("fragment-start"),this.end=yt("fragment-end"),this.frag=n,at(this.node,n),n.appendChild(this.end),this.before=ve,this.remove=me),this.node.__v_frag=this}function de(t,e){this.inserted=!0;var n=e!==!1?G:rt;n(this.node,t,this.vm),Q(this.node)&&this.callHook(ye)}function ge(){this.inserted=!1;var t=Q(this.node),e=this;this.beforeRemove(),X(this.node,this.vm,function(){t&&e.callHook(be),e.destroy()})}function ve(t,e){this.inserted=!0;var n=this.vm,r=e!==!1?G:rt;_t(this.node,this.end,function(e){r(e,t,n)}),Q(this.node)&&this.callHook(ye)}function me(){this.inserted=!1;var t=this,e=Q(this.node);this.beforeRemove(),xt(this.node,this.end,this.vm,this.frag,function(){e&&t.callHook(be),t.destroy()})}function ye(t){!t._isAttached&&Q(t.$el)&&t._callHook("attached")}function be(t){t._isAttached&&!Q(t.$el)&&t._callHook("detached")}function _e(t,e){this.vm=t;var n,r="string"==typeof e;r||mt(e)&&!e.hasAttribute("v-if")?n=he(e,!0):(n=document.createDocumentFragment(),n.appendChild(e)),this.template=n;var i,o=t.constructor.cid;if(o>0){var a=o+(r?e:kt(e));i=Yi.get(a),i||(i=Ge(n,t.$options,!0),Yi.put(a,i))}else i=Ge(n,t.$options,!0);this.linker=i}function xe(t,e,n){var r=t.node.previousSibling;if(r){for(t=r.__v_frag;!(t&&t.forId===n&&t.inserted||r===e);){if(r=r.previousSibling,!r)return;t=r.__v_frag}return t}}function we(t){for(var e=-1,n=new Array(Math.floor(t));++e<t;)n[e]=e;return n}function ke(t,e,n,r){return r?"$index"===r?t:r.charAt(0).match(/\w/)?Ut(n,r):n[r]:e||n}function Ce(t){var e=t.node;if(t.end)for(;!e.__vue__&&e!==t.end&&e.nextSibling;)e=e.nextSibling;return e.__vue__}function Te(t,e,n){for(var r,i,o,a=e?[]:null,s=0,l=t.options.length;s<l;s++)if(r=t.options[s],o=n?r.hasAttribute("selected"):r.selected){if(i=r.hasOwnProperty("_value")?r._value:r.value,!e)return i;a.push(i)}return a}function je(t,e){for(var n=t.length;n--;)if(C(t[n],e))return n;return-1}function $e(t,e){var n=e.map(function(t){var e=t.charCodeAt(0);return e>47&&e<58?parseInt(t,10):1===t.length&&(e=t.toUpperCase().charCodeAt(0),e>64&&e<91)?e:bo[t]});return n=[].concat.apply([],n),function(e){if(n.indexOf(e.keyCode)>-1)return t.call(this,e)}}function Ae(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function Se(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Oe(t){return function(e){if(e.target===e.currentTarget)return t.call(this,e)}}function Me(t){if(Co[t])return Co[t];var e=Ee(t);return Co[t]=Co[e]=e,e}function Ee(t){t=p(t);var e=u(t),n=e.charAt(0).toUpperCase()+e.slice(1);To||(To=document.createElement("div"));var r,i=xo.length;if("filter"!==e&&e in To.style)return{kebab:t,camel:e};for(;i--;)if(r=wo[i]+n,r in To.style)return{kebab:xo[i]+t,camel:r}}function Pe(t){var e=[];if(Xn(t))for(var n=0,r=t.length;n<r;n++){var i=t[n];if(i)if("string"==typeof i)e.push(i);else for(var o in i)i[o]&&e.push(o)}else if(y(t))for(var a in t)t[a]&&e.push(a);return e}function Ne(t,e,n){if(e=e.trim(),e.indexOf(" ")===-1)return void n(t,e);for(var r=e.split(/\s+/),i=0,o=r.length;i<o;i++)n(t,r[i])}function Fe(t,e,n){function r(){++o>=i?n():t[o].call(e,r)}var i=t.length,o=0;t[0].call(e,r)}function Re(t,e,n){for(var r,i,a,s,l,c,f,h=[],d=n.$options.propsData,g=Object.keys(e),v=g.length;v--;)if(i=g[v],r=e[i]||Lo,l=u(i),qo.test(l)){if(f={name:i,path:l,options:r,mode:Io.ONE_WAY,raw:null},a=p(i),null===(s=et(t,a))&&(null!==(s=et(t,a+".sync"))?f.mode=Io.TWO_WAY:null!==(s=et(t,a+".once"))&&(f.mode=Io.ONE_TIME)),null!==s)f.raw=s,c=L(s),s=c.expression,f.filters=c.filters,o(s)&&!c.filters?f.optimizedLiteral=!0:f.dynamic=!0,f.parentPath=s;else if(null!==(s=tt(t,a)))f.raw=s;else if(d&&null!==(s=d[i]||d[l]))f.raw=s;else;h.push(f)}return Be(h)}function Be(t){return function(e,n){e._props={};for(var r,o,a,s,u,h=e.$options.propsData,d=t.length;d--;)if(r=t[d],u=r.raw,o=r.path,a=r.options,e._props[o]=r,h&&i(h,o)&&ze(e,r,h[o]),null===u)ze(e,r,void 0);else if(r.dynamic)r.mode===Io.ONE_TIME?(s=(n||e._context||e).$get(r.parentPath),ze(e,r,s)):e._context?e._bindDir({name:"prop",def:Ho,prop:r},null,null,n):ze(e,r,e.$get(r.parentPath));else if(r.optimizedLiteral){var g=f(u);s=g===u?c(l(u)):g,ze(e,r,s)}else s=a.type===Boolean&&(""===u||u===p(r.name))||u,ze(e,r,s)}}function De(t,e,n,r){var i=e.dynamic&&ee(e.parentPath),o=n;void 0===o&&(o=Le(t,e)),o=Ve(e,o,t);var a=o!==n;qe(e,o,t)||(o=void 0),i&&!a?Nt(function(){r(o)}):r(o)}function ze(t,e,n){De(t,e,n,function(n){zt(t,e.path,n)})}function Ie(t,e,n){De(t,e,n,function(n){t[e.path]=n})}function Le(t,e){var n=e.options;if(!i(n,"default"))return n.type!==Boolean&&void 0;var r=n.default;return y(r),"function"==typeof r&&n.type!==Function?r.call(t):r}function qe(t,e,n){if(!t.options.required&&(null===t.raw||null==e))return!0;var r=t.options,i=r.type,o=!i,a=[];if(i){Xn(i)||(i=[i]);for(var s=0;s<i.length&&!o;s++){var l=He(e,i[s]);a.push(l.expectedType),o=l.valid}}if(!o)return!1;var c=r.validator;return!(c&&!c(e))}function Ve(t,e,n){var r=t.options.coerce;return r&&"function"==typeof r?r(e):e}function He(t,e){var n,r;return e===String?(r="string",n=typeof t===r):e===Number?(r="number",n=typeof t===r):e===Boolean?(r="boolean",n=typeof t===r):e===Function?(r="function",n=typeof t===r):e===Object?(r="object",n=b(t)):e===Array?(r="array",n=Xn(t)):n=t instanceof e,{valid:n,expectedType:r}}function Ue(t){Uo.push(t),Wo||(Wo=!0,ur(We))}function We(){for(var t=document.documentElement.offsetHeight,e=0;e<Uo.length;e++)Uo[e]();return Uo=[],Wo=!1,t}function Ze(t,e,n,r){this.id=e,this.el=t,this.enterClass=n&&n.enterClass||e+"-enter",this.leaveClass=n&&n.leaveClass||e+"-leave",this.hooks=n,this.vm=r,this.pendingCssEvent=this.pendingCssCb=this.cancel=this.pendingJsCb=this.op=this.cb=null,this.justEntered=!1,this.entered=this.left=!1,this.typeCache={},this.type=n&&n.type;var i=this;["enterNextTick","enterDone","leaveNextTick","leaveDone"].forEach(function(t){i[t]=g(i[t],i)})}function Je(t){if(/svg$/.test(t.namespaceURI)){var e=t.getBoundingClientRect();return!(e.width||e.height)}return!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function Ge(t,e,n){var r=n||!e._asComponent?nn(t,e):null,i=r&&r.terminal||_n(t)||!t.hasChildNodes()?null:cn(t.childNodes,e);return function(t,e,n,o,a){var s=v(e.childNodes),l=Xe(function(){r&&r(t,e,n,o,a),i&&i(t,s,n,o,a)},t);return Ke(t,l)}}function Xe(t,e){e._directives=[];var n=e._directives.length;t();var r=e._directives.slice(n);Ye(r);for(var i=0,o=r.length;i<o;i++)r[i]._bind();return r}function Ye(t){if(0!==t.length){var e,n,r,i,o={},a=0,s=[];for(e=0,n=t.length;e<n;e++){var l=t[e],c=l.descriptor.def.priority||sa,f=o[c];f||(f=o[c]=[],s.push(c)),f.push(l)}for(s.sort(function(t,e){return t>e?-1:t===e?0:1}),e=0,n=s.length;e<n;e++){var u=o[s[e]];for(r=0,i=u.length;r<i;r++)t[a++]=u[r]}}}function Ke(t,e,n,r){function i(i){Qe(t,e,i),n&&r&&Qe(n,r)}return i.dirs=e,i}function Qe(t,e,n){for(var r=e.length;r--;)e[r]._teardown()}function tn(t,e,n,r){var i=Re(e,n,t),o=Xe(function(){i(t,r)},t);return Ke(t,o)}function en(t,e,n){var r,i,o=e._containerAttrs,a=e._replacerAttrs;if(11!==t.nodeType)e._asComponent?(o&&n&&(r=vn(o,n)),a&&(i=vn(a,e))):i=vn(t.attributes,e);else;return e._containerAttrs=e._replacerAttrs=null,function(t,e,n){var o,a=t._context;a&&r&&(o=Xe(function(){r(a,e,null,n)},a));var s=Xe(function(){i&&i(t,e)},t);return Ke(t,s,a,o)}}function nn(t,e){var n=t.nodeType;return 1!==n||_n(t)?3===n&&t.data.trim()?on(t,e):null:rn(t,e)}function rn(t,e){if("TEXTAREA"===t.tagName){if(null!==tt(t,"v-pre"))return dn;var n=H(t.value);n&&(t.setAttribute(":value",U(n)),t.value="")}var r,i=t.hasAttributes(),o=i&&v(t.attributes);return i&&(r=pn(t,o,e)),r||(r=un(t,e)),r||(r=hn(t,e)),!r&&i&&(r=vn(o,e)),r}function on(t,e){if(t._skip)return an;var n=H(t.wholeText);if(!n)return null;for(var r=t.nextSibling;r&&3===r.nodeType;)r._skip=!0,r=r.nextSibling;for(var i,o,a=document.createDocumentFragment(),s=0,l=n.length;s<l;s++)o=n[s],i=o.tag?sn(o,e):document.createTextNode(o.value),a.appendChild(i);return ln(n,a,e)}function an(t,e){ot(e)}function sn(t,e){function n(e){if(!t.descriptor){var n=L(t.value);t.descriptor={name:e,def:Bo[e],expression:n.expression,filters:n.filters}}}var r;return t.oneTime?r=document.createTextNode(t.value):t.html?(r=document.createComment("v-html"),n("html")):(r=document.createTextNode(" "),n("text")),r}function ln(t,e){return function(n,r,i,o){for(var a,l,c,f=e.cloneNode(!0),u=v(f.childNodes),h=0,p=t.length;h<p;h++)a=t[h],l=a.value,a.tag&&(c=u[h],a.oneTime?(l=(o||n).$eval(l),a.html?st(c,he(l,!0)):c.data=s(l)):n._bindDir(a.descriptor,c,i,o));st(r,f)}}function cn(t,e){for(var n,r,i,o=[],a=0,s=t.length;a<s;a++)i=t[a],n=nn(i,e),r=n&&n.terminal||"SCRIPT"===i.tagName||!i.hasChildNodes()?null:cn(i.childNodes,e),o.push(n,r);return o.length?fn(o):null}function fn(t){return function(e,n,r,i,o){for(var a,s,l,c=0,f=0,u=t.length;c<u;f++){a=n[f],s=t[c++],l=t[c++];var h=v(a.childNodes);s&&s(e,a,r,i,o),l&&l(e,h,r,i,o)}}}function un(t,e){var n=t.tagName.toLowerCase();if(!Wr.test(n)){var r=Et(e,"elementDirectives",n);return r?gn(t,n,"",e,r):void 0}}function hn(t,e){var n=Ct(t,e);if(n){var r=bt(t),i={name:"component",ref:r,expression:n.id,def:ea.component,modifiers:{literal:!n.dynamic}},o=function(t,e,n,o,a){r&&zt((o||t).$refs,r,null),t._bindDir(i,e,n,o,a)};return o.terminal=!0,o}}function pn(t,e,n){if(null!==tt(t,"v-pre"))return dn;if(t.hasAttribute("v-else")){var r=t.previousElementSibling;if(r&&r.hasAttribute("v-if"))return dn}for(var i,o,a,s,l,c,f,u,h,p,d=0,g=e.length;d<g;d++)i=e[d],o=i.name.replace(oa,""),(l=o.match(ia))&&(h=Et(n,"directives",l[1]),h&&h.terminal&&(!p||(h.priority||la)>p.priority)&&(p=h,f=i.name,s=mn(i.name),a=i.value,c=l[1],u=l[2]));return p?gn(t,c,a,n,p,f,u,s):void 0}function dn(){}function gn(t,e,n,r,i,o,a,s){var l=L(n),c={name:e,arg:a,expression:l.expression,filters:l.filters,raw:n,attr:o,modifiers:s,def:i};"for"!==e&&"router-view"!==e||(c.ref=bt(t));var f=function(t,e,n,r,i){c.ref&&zt((r||t).$refs,c.ref,null),t._bindDir(c,e,n,r,i)};return f.terminal=!0,f}function vn(t,e){function n(t,e,n){var r=n&&bn(n),i=!r&&L(o);g.push({name:t,attr:a,raw:s,def:e,arg:c,modifiers:f,expression:i&&i.expression,filters:i&&i.filters,interp:n,hasOneTime:r})}for(var r,i,o,a,s,l,c,f,u,h,p,d=t.length,g=[];d--;)if(r=t[d],i=a=r.name,o=s=r.value,h=H(o),c=null,f=mn(i),i=i.replace(oa,""),h)o=U(h),c=i,n("bind",Bo.bind,h);else if(aa.test(i))f.literal=!na.test(i),n("transition",ea.transition);else if(ra.test(i))c=i.replace(ra,""),n("on",Bo.on);else if(na.test(i))l=i.replace(na,""),"style"===l||"class"===l?n(l,ea[l]):(c=l,n("bind",Bo.bind));else if(p=i.match(ia)){if(l=p[1],c=p[2],"else"===l)continue;u=Et(e,"directives",l,!0),u&&n(l,u)}if(g.length)return yn(g)}function mn(t){var e=Object.create(null),n=t.match(oa);if(n)for(var r=n.length;r--;)e[n[r].slice(1)]=!0;return e}function yn(t){return function(e,n,r,i,o){for(var a=t.length;a--;)e._bindDir(t[a],n,r,i,o)}}function bn(t){for(var e=t.length;e--;)if(t[e].oneTime)return!0}function _n(t){return"SCRIPT"===t.tagName&&(!t.hasAttribute("type")||"text/javascript"===t.getAttribute("type"))}function xn(t,e){return e&&(e._containerAttrs=kn(t)),mt(t)&&(t=he(t)),e&&(e._asComponent&&!e.template&&(e.template="<slot></slot>"),e.template&&(e._content=dt(t),t=wn(t,e))),wt(t)&&(at(yt("v-start",!0),t),t.appendChild(yt("v-end",!0))),t}function wn(t,e){var n=e.template,r=he(n,!0);if(r){var i=r.firstChild;if(!i)return r;var o=i.tagName&&i.tagName.toLowerCase();return e.replace?(t===document.body,r.childNodes.length>1||1!==i.nodeType||"component"===o||Et(e,"components",o)||nt(i,"is")||Et(e,"elementDirectives",o)||i.hasAttribute("v-for")||i.hasAttribute("v-if")?r:(e._replacerAttrs=kn(i),Cn(t,i),i)):(t.appendChild(r),t)}}function kn(t){if(1===t.nodeType&&t.hasAttributes())return v(t.attributes)}function Cn(t,e){for(var n,r,i=t.attributes,o=i.length;o--;)n=i[o].name,r=i[o].value,e.hasAttribute(n)||ca.test(n)?"class"===n&&!H(r)&&(r=r.trim())&&r.split(/\s+/).forEach(function(t){ht(e,t)}):e.setAttribute(n,r)}function Tn(t,e){if(e){for(var n,r,i=t._slotContents=Object.create(null),o=0,a=e.children.length;o<a;o++)n=e.children[o],(r=n.getAttribute("slot"))&&(i[r]||(i[r]=[])).push(n);for(r in i)i[r]=jn(i[r],e);if(e.hasChildNodes()){var s=e.childNodes;if(1===s.length&&3===s[0].nodeType&&!s[0].data.trim())return;i.default=jn(e.childNodes,e)}}}function jn(t,e){var n=document.createDocumentFragment();t=v(t);for(var r=0,i=t.length;r<i;r++){var o=t[r];!mt(o)||o.hasAttribute("v-if")||o.hasAttribute("v-for")||(e.removeChild(o),o=he(o,!0)),n.appendChild(o)}return n}function $n(t){function e(){}function n(t,e){var n=new ae(e,t,null,{lazy:!0});return function(){return n.dirty&&n.evaluate(),Pt.target&&n.depend(),n.value}}Object.defineProperty(t.prototype,"$data",{get:function(){return this._data},set:function(t){t!==this._data&&this._setData(t)}}),t.prototype._initState=function(){this._initProps(),this._initMeta(),this._initMethods(),this._initData(),this._initComputed()},t.prototype._initProps=function(){var t=this.$options,e=t.el,n=t.props;e=t.el=K(e),this._propsUnlinkFn=e&&1===e.nodeType&&n?tn(this,e,n,this._scope):null},t.prototype._initData=function(){var t=this.$options.data,e=this._data=t?t():{};b(e)||(e={});var n,r,o=this._props,a=Object.keys(e);for(n=a.length;n--;)r=a[n],o&&i(o,r)||this._proxy(r);Dt(e,this)},t.prototype._setData=function(t){t=t||{};var e=this._data;this._data=t;var n,r,o;for(n=Object.keys(e),o=n.length;o--;)r=n[o],r in t||this._unproxy(r);for(n=Object.keys(t),o=n.length;o--;)r=n[o],i(this,r)||this._proxy(r);e.__ob__.removeVm(this),Dt(t,this),this._digest()},t.prototype._proxy=function(t){if(!a(t)){var e=this;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return e._data[t]},set:function(n){e._data[t]=n}})}},t.prototype._unproxy=function(t){a(t)||delete this[t]},t.prototype._digest=function(){for(var t=0,e=this._watchers.length;t<e;t++)this._watchers[t].update(!0)},t.prototype._initComputed=function(){var t=this.$options.computed;if(t)for(var r in t){var i=t[r],o={enumerable:!0,configurable:!0};"function"==typeof i?(o.get=n(i,this),o.set=e):(o.get=i.get?i.cache!==!1?n(i.get,this):g(i.get,this):e,o.set=i.set?g(i.set,this):e),Object.defineProperty(this,r,o)}},t.prototype._initMethods=function(){var t=this.$options.methods;if(t)for(var e in t)this[e]=g(t[e],this)},t.prototype._initMeta=function(){var t=this.$options._meta;if(t)for(var e in t)zt(this,e,t[e])}}function An(t){function e(t,e){for(var n,r,i,o=e.attributes,a=0,s=o.length;a<s;a++)n=o[a].name,ua.test(n)&&(n=n.replace(ua,""),r=o[a].value,ee(r)&&(r+=".apply(this, $arguments)"),i=(t._scope||t._context).$eval(r,!0),i._fromParent=!0,t.$on(n.replace(ua),i))}function n(t,e,n){if(n){var i,o,a,s;for(o in n)if(i=n[o],Xn(i))for(a=0,s=i.length;a<s;a++)r(t,e,o,i[a]);else r(t,e,o,i)}}function r(t,e,n,i,o){var a=typeof i;if("function"===a)t[e](n,i,o);else if("string"===a){var s=t.$options.methods,l=s&&s[i];l&&t[e](n,l,o)}else i&&"object"===a&&r(t,e,n,i.handler,i)}function i(){this._isAttached||(this._isAttached=!0,this.$children.forEach(o))}function o(t){!t._isAttached&&Q(t.$el)&&t._callHook("attached")}function a(){this._isAttached&&(this._isAttached=!1,this.$children.forEach(s))}function s(t){t._isAttached&&!Q(t.$el)&&t._callHook("detached")}t.prototype._initEvents=function(){var t=this.$options;t._asComponent&&e(this,t.el),n(this,"$on",t.events),n(this,"$watch",t.watch)},t.prototype._initDOMHooks=function(){this.$on("hook:attached",i),this.$on("hook:detached",a)},t.prototype._callHook=function(t){this.$emit("pre-hook:"+t);var e=this.$options[t];if(e)for(var n=0,r=e.length;n<r;n++)e[n].call(this);this.$emit("hook:"+t)}}function Sn(){}function On(t,e,n,r,i,o){this.vm=e,this.el=n,this.descriptor=t,this.name=t.name,this.expression=t.expression,this.arg=t.arg,this.modifiers=t.modifiers,this.filters=t.filters,this.literal=this.modifiers&&this.modifiers.literal,this._locked=!1,this._bound=!1,this._listeners=null,this._host=r,this._scope=i,this._frag=o}function Mn(t){t.prototype._updateRef=function(t){var e=this.$options._ref;if(e){var n=(this._scope||this._context).$refs;t?n[e]===this&&(n[e]=null):n[e]=this}},t.prototype._compile=function(t){var e=this.$options,n=t;if(t=xn(t,e),this._initElement(t),1!==t.nodeType||null===tt(t,"v-pre")){var r=this._context&&this._context.$options,i=en(t,e,r);Tn(this,e._content);var o,a=this.constructor;e._linkerCachable&&(o=a.linker,o||(o=a.linker=Ge(t,e)));var s=i(this,t,this._scope),l=o?o(this,t):Ge(t,e)(this,t);this._unlinkFn=function(){s(),l(!0)},e.replace&&st(n,t),this._isCompiled=!0,this._callHook("compiled")}},t.prototype._initElement=function(t){
+wt(t)?(this._isFragment=!0,this.$el=this._fragmentStart=t.firstChild,this._fragmentEnd=t.lastChild,3===this._fragmentStart.nodeType&&(this._fragmentStart.data=this._fragmentEnd.data=""),this._fragment=t):this.$el=t,this.$el.__vue__=this,this._callHook("beforeCompile")},t.prototype._bindDir=function(t,e,n,r,i){this._directives.push(new On(t,this,e,n,r,i))},t.prototype._destroy=function(t,e){if(this._isBeingDestroyed)return void(e||this._cleanup());var n,r,i=this,o=function(){!n||r||e||i._cleanup()};t&&this.$el&&(r=!0,this.$remove(function(){r=!1,o()})),this._callHook("beforeDestroy"),this._isBeingDestroyed=!0;var a,s=this.$parent;for(s&&!s._isBeingDestroyed&&(s.$children.$remove(this),this._updateRef(!0)),a=this.$children.length;a--;)this.$children[a].$destroy();for(this._propsUnlinkFn&&this._propsUnlinkFn(),this._unlinkFn&&this._unlinkFn(),a=this._watchers.length;a--;)this._watchers[a].teardown();this.$el&&(this.$el.__vue__=null),n=!0,o()},t.prototype._cleanup=function(){this._isDestroyed||(this._frag&&this._frag.children.$remove(this),this._data&&this._data.__ob__&&this._data.__ob__.removeVm(this),this.$el=this.$parent=this.$root=this.$children=this._watchers=this._context=this._scope=this._directives=null,this._isDestroyed=!0,this._callHook("destroyed"),this.$off())}}function En(t){t.prototype._applyFilters=function(t,e,n,r){var i,o,a,s,l,c,f,u,h;for(c=0,f=n.length;c<f;c++)if(i=n[r?f-c-1:c],o=Et(this.$options,"filters",i.name,!0),o&&(o=r?o.write:o.read||o,"function"==typeof o)){if(a=r?[t,e]:[t],l=r?2:1,i.args)for(u=0,h=i.args.length;u<h;u++)s=i.args[u],a[u+l]=s.dynamic?this.$get(s.value):s.value;t=o.apply(this,a)}return t},t.prototype._resolveComponent=function(e,n){var r;if(r="function"==typeof e?e:Et(this.$options,"components",e,!0))if(r.options)n(r);else if(r.resolved)n(r.resolved);else if(r.requested)r.pendingCallbacks.push(n);else{r.requested=!0;var i=r.pendingCallbacks=[n];r.call(this,function(e){b(e)&&(e=t.extend(e)),r.resolved=e;for(var n=0,o=i.length;n<o;n++)i[n](e)},function(t){})}}}function Pn(t){function e(t){return JSON.parse(JSON.stringify(t))}t.prototype.$get=function(t,e){var n=te(t);if(n){if(e){var r=this;return function(){r.$arguments=v(arguments);var t=n.get.call(r,r);return r.$arguments=null,t}}try{return n.get.call(this,this)}catch(t){}}},t.prototype.$set=function(t,e){var n=te(t,!0);n&&n.set&&n.set.call(this,this,e)},t.prototype.$delete=function(t){r(this._data,t)},t.prototype.$watch=function(t,e,n){var r,i=this;"string"==typeof t&&(r=L(t),t=r.expression);var o=new ae(i,t,e,{deep:n&&n.deep,sync:n&&n.sync,filters:r&&r.filters,user:!n||n.user!==!1});return n&&n.immediate&&e.call(i,o.value),function(){o.teardown()}},t.prototype.$eval=function(t,e){if(ha.test(t)){var n=L(t),r=this.$get(n.expression,e);return n.filters?this._applyFilters(r,null,n.filters):r}return this.$get(t,e)},t.prototype.$interpolate=function(t){var e=H(t),n=this;return e?1===e.length?n.$eval(e[0].value)+"":e.map(function(t){return t.tag?n.$eval(t.value):t.value}).join(""):t},t.prototype.$log=function(t){var n=t?Ut(this._data,t):this._data;if(n&&(n=e(n)),!t){var r;for(r in this.$options.computed)n[r]=e(this[r]);if(this._props)for(r in this._props)n[r]=e(this[r])}console.log(n)}}function Nn(t){function e(t,e,r,i,o,a){e=n(e);var s=!Q(e),l=i===!1||s?o:a,c=!s&&!t._isAttached&&!Q(t.$el);return t._isFragment?(_t(t._fragmentStart,t._fragmentEnd,function(n){l(n,e,t)}),r&&r()):l(t.$el,e,t,r),c&&t._callHook("attached"),t}function n(t){return"string"==typeof t?document.querySelector(t):t}function r(t,e,n,r){e.appendChild(t),r&&r()}function i(t,e,n,r){rt(t,e),r&&r()}function o(t,e,n){ot(t),n&&n()}t.prototype.$nextTick=function(t){ur(t,this)},t.prototype.$appendTo=function(t,n,i){return e(this,t,n,i,r,J)},t.prototype.$prependTo=function(t,e,r){return t=n(t),t.hasChildNodes()?this.$before(t.firstChild,e,r):this.$appendTo(t,e,r),this},t.prototype.$before=function(t,n,r){return e(this,t,n,r,i,G)},t.prototype.$after=function(t,e,r){return t=n(t),t.nextSibling?this.$before(t.nextSibling,e,r):this.$appendTo(t.parentNode,e,r),this},t.prototype.$remove=function(t,e){if(!this.$el.parentNode)return t&&t();var n=this._isAttached&&Q(this.$el);n||(e=!1);var r=this,i=function(){n&&r._callHook("detached"),t&&t()};if(this._isFragment)xt(this._fragmentStart,this._fragmentEnd,this,this._fragment,i);else{var a=e===!1?o:X;a(this.$el,this,i)}return this}}function Fn(t){function e(t,e,r){var i=t.$parent;if(i&&r&&!n.test(e))for(;i;)i._eventsCount[e]=(i._eventsCount[e]||0)+r,i=i.$parent}t.prototype.$on=function(t,n){return(this._events[t]||(this._events[t]=[])).push(n),e(this,t,1),this},t.prototype.$once=function(t,e){function n(){r.$off(t,n),e.apply(this,arguments)}var r=this;return n.fn=e,this.$on(t,n),this},t.prototype.$off=function(t,n){var r;if(!arguments.length){if(this.$parent)for(t in this._events)r=this._events[t],r&&e(this,t,-r.length);return this._events={},this}if(r=this._events[t],!r)return this;if(1===arguments.length)return e(this,t,-r.length),this._events[t]=null,this;for(var i,o=r.length;o--;)if(i=r[o],i===n||i.fn===n){e(this,t,-1),r.splice(o,1);break}return this},t.prototype.$emit=function(t){var e="string"==typeof t;t=e?t:t.name;var n=this._events[t],r=e||!n;if(n){n=n.length>1?v(n):n;var i=e&&n.some(function(t){return t._fromParent});i&&(r=!1);for(var o=v(arguments,1),a=0,s=n.length;a<s;a++){var l=n[a],c=l.apply(this,o);c!==!0||i&&!l._fromParent||(r=!0)}}return r},t.prototype.$broadcast=function(t){var e="string"==typeof t;if(t=e?t:t.name,this._eventsCount[t]){var n=this.$children,r=v(arguments);e&&(r[0]={name:t,source:this});for(var i=0,o=n.length;i<o;i++){var a=n[i],s=a.$emit.apply(a,r);s&&a.$broadcast.apply(a,r)}return this}},t.prototype.$dispatch=function(t){var e=this.$emit.apply(this,arguments);if(e){var n=this.$parent,r=v(arguments);for(r[0]={name:t,source:this};n;)e=n.$emit.apply(n,r),n=e?n.$parent:null;return this}};var n=/^hook:/}function Rn(t){function e(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")}t.prototype.$mount=function(t){if(!this._isCompiled)return t=K(t),t||(t=document.createElement("div")),this._compile(t),this._initDOMHooks(),Q(this.$el)?(this._callHook("attached"),e.call(this)):this.$once("hook:attached",e),this},t.prototype.$destroy=function(t,e){this._destroy(t,e)},t.prototype.$compile=function(t,e,n,r){return Ge(t,this.$options,!0)(this,t,e,n,r)}}function Bn(t){this._init(t)}function Dn(t,e,n){return n=n?parseInt(n,10):0,e=l(e),"number"==typeof e?t.slice(n,n+e):t}function zn(t,e,n){if(t=va(t),null==e)return t;if("function"==typeof e)return t.filter(e);e=(""+e).toLowerCase();for(var r,i,o,a,s="in"===n?3:2,l=Array.prototype.concat.apply([],v(arguments,s)),c=[],f=0,u=t.length;f<u;f++)if(r=t[f],o=r&&r.$value||r,a=l.length){for(;a--;)if(i=l[a],"$key"===i&&Ln(r.$key,e)||Ln(Ut(o,i),e)){c.push(r);break}}else Ln(r,e)&&c.push(r);return c}function In(t){function e(t,e,n){var i=r[n];return i&&("$key"!==i&&(y(t)&&"$value"in t&&(t=t.$value),y(e)&&"$value"in e&&(e=e.$value)),t=y(t)?Ut(t,i):t,e=y(e)?Ut(e,i):e),t===e?0:t>e?o:-o}var n=null,r=void 0;t=va(t);var i=v(arguments,1),o=i[i.length-1];"number"==typeof o?(o=o<0?-1:1,i=i.length>1?i.slice(0,-1):i):o=1;var a=i[0];return a?("function"==typeof a?n=function(t,e){return a(t,e)*o}:(r=Array.prototype.concat.apply([],i),n=function(t,i,o){return o=o||0,o>=r.length-1?e(t,i,o):e(t,i,o)||n(t,i,o+1)}),t.slice().sort(n)):t}function Ln(t,e){var n;if(b(t)){var r=Object.keys(t);for(n=r.length;n--;)if(Ln(t[r[n]],e))return!0}else if(Xn(t)){for(n=t.length;n--;)if(Ln(t[n],e))return!0}else if(null!=t)return t.toString().toLowerCase().indexOf(e)>-1}function qn(t){function e(t){return new Function("return function "+d(t)+" (options) { this._init(options) }")()}t.options={directives:Bo,elementDirectives:ga,filters:ya,transitions:{},components:{},partials:{},replace:!0},t.util=ei,t.config=qr,t.set=n,t.delete=r,t.nextTick=ur,t.compiler=fa,t.FragmentFactory=_e,t.internalDirectives=ea,t.parsers={path:yi,text:zr,template:Gi,directive:Pr,expression:Ei},t.cid=0;var i=1;t.extend=function(t){t=t||{};var n=this,r=0===n.cid;if(r&&t._Ctor)return t._Ctor;var o=t.name||n.options.name,a=e(o||"VueComponent");return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=i++,a.options=Mt(n.options,t),a.super=n,a.extend=n.extend,qr._assetTypes.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),r&&(t._Ctor=a),a},t.use=function(t){if(!t.installed){var e=v(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):t.apply(null,e),t.installed=!0,this}},t.mixin=function(e){t.options=Mt(t.options,e)},qr._assetTypes.forEach(function(e){t[e]=function(n,r){return r?("component"===e&&b(r)&&(r.name||(r.name=n),r=t.extend(r)),this.options[e+"s"][n]=r,r):this.options[e+"s"][n]}}),m(t.transition,Hr)}var Vn=Object.prototype.hasOwnProperty,Hn=/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/,Un=/-(\w)/g,Wn=/([^-])([A-Z])/g,Zn=/(?:^|[-_\/])(\w)/g,Jn=Object.prototype.toString,Gn="[object Object]",Xn=Array.isArray,Yn="__proto__"in{},Kn="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),Qn=Kn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,tr=Kn&&window.navigator.userAgent.toLowerCase(),er=tr&&tr.indexOf("trident")>0,nr=tr&&tr.indexOf("msie 9.0")>0,rr=tr&&tr.indexOf("android")>0,ir=tr&&/iphone|ipad|ipod|ios/.test(tr),or=void 0,ar=void 0,sr=void 0,lr=void 0;if(Kn&&!nr){var cr=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend,fr=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend;or=cr?"WebkitTransition":"transition",ar=cr?"webkitTransitionEnd":"transitionend",sr=fr?"WebkitAnimation":"animation",lr=fr?"webkitAnimationEnd":"animationend"}var ur=function(){function t(){n=!1;var t=e.slice(0);e.length=0;for(var r=0;r<t.length;r++)t[r]()}var e=[],n=!1,r=void 0;if("undefined"!=typeof Promise&&T(Promise)){var i=Promise.resolve(),o=function(){};r=function(){i.then(t),ir&&setTimeout(o)}}else if("undefined"!=typeof MutationObserver){var a=1,s=new MutationObserver(t),l=document.createTextNode(String(a));s.observe(l,{characterData:!0}),r=function(){a=(a+1)%2,l.data=String(a)}}else r=setTimeout;return function(i,o){var a=o?function(){i.call(o)}:i;e.push(a),n||(n=!0,r(t,0))}}(),hr=void 0;"undefined"!=typeof Set&&T(Set)?hr=Set:(hr=function(){this.set=Object.create(null)},hr.prototype.has=function(t){return void 0!==this.set[t]},hr.prototype.add=function(t){this.set[t]=1},hr.prototype.clear=function(){this.set=Object.create(null)});var pr=j.prototype;pr.put=function(t,e){var n,r=this.get(t,!0);return r||(this.size===this.limit&&(n=this.shift()),r={key:t},this._keymap[t]=r,this.tail?(this.tail.newer=r,r.older=this.tail):this.head=r,this.tail=r,this.size++),r.value=e,n},pr.shift=function(){var t=this.head;return t&&(this.head=this.head.newer,this.head.older=void 0,t.newer=t.older=void 0,this._keymap[t.key]=void 0,this.size--),t},pr.get=function(t,e){var n=this._keymap[t];if(void 0!==n)return n===this.tail?e?n:n.value:(n.newer&&(n===this.head&&(this.head=n.newer),n.newer.older=n.older),n.older&&(n.older.newer=n.newer),n.newer=void 0,n.older=this.tail,this.tail&&(this.tail.newer=n),this.tail=n,e?n:n.value)};var dr,gr,vr,mr,yr,br,_r=new j(1e3),xr=/^in$|^-?\d+/,wr=0,kr=1,Cr=2,Tr=3,jr=34,$r=39,Ar=124,Sr=92,Or=32,Mr={91:1,123:1,40:1},Er={91:93,123:125,40:41},Pr=Object.freeze({parseDirective:L}),Nr=/[-.*+?^${}()|[\]\/\\]/g,Fr=void 0,Rr=void 0,Br=void 0,Dr=/[^|]\|[^|]/,zr=Object.freeze({compileRegex:V,parseText:H,tokensToExp:U}),Ir=["{{","}}"],Lr=["{{{","}}}"],qr=Object.defineProperties({debug:!1,silent:!1,async:!0,warnExpressionErrors:!0,devtools:!1,_delimitersChanged:!0,_assetTypes:["component","directive","elementDirective","filter","transition","partial"],_propBindingModes:{ONE_WAY:0,TWO_WAY:1,ONE_TIME:2},_maxUpdateCount:100},{delimiters:{get:function(){return Ir},set:function(t){Ir=t,V()},configurable:!0,enumerable:!0},unsafeDelimiters:{get:function(){return Lr},set:function(t){Lr=t,V()},configurable:!0,enumerable:!0}}),Vr=void 0,Hr=Object.freeze({appendWithTransition:J,beforeWithTransition:G,removeWithTransition:X,applyTransition:Y}),Ur=/^v-ref:/,Wr=/^(div|p|span|img|a|b|i|br|ul|ol|li|h1|h2|h3|h4|h5|h6|code|pre|table|th|td|tr|form|label|input|select|option|nav|article|section|header|footer)$/i,Zr=/^(slot|partial|component)$/i,Jr=qr.optionMergeStrategies=Object.create(null);Jr.data=function(t,e,n){return n?t||e?function(){var r="function"==typeof e?e.call(n):e,i="function"==typeof t?t.call(n):void 0;return r?jt(r,i):i}:void 0:e?"function"!=typeof e?t:t?function(){return jt(e.call(this),t.call(this))}:e:t},Jr.el=function(t,e,n){if(n||!e||"function"==typeof e){var r=e||t;return n&&"function"==typeof r?r.call(n):r}},Jr.init=Jr.created=Jr.ready=Jr.attached=Jr.detached=Jr.beforeCompile=Jr.compiled=Jr.beforeDestroy=Jr.destroyed=Jr.activate=function(t,e){return e?t?t.concat(e):Xn(e)?e:[e]:t},qr._assetTypes.forEach(function(t){Jr[t+"s"]=$t}),Jr.watch=Jr.events=function(t,e){if(!e)return t;if(!t)return e;var n={};m(n,t);for(var r in e){var i=n[r],o=e[r];i&&!Xn(i)&&(i=[i]),n[r]=i?i.concat(o):[o]}return n},Jr.props=Jr.methods=Jr.computed=function(t,e){if(!e)return t;if(!t)return e;var n=Object.create(null);return m(n,t),m(n,e),n};var Gr=function(t,e){return void 0===e?t:e},Xr=0;Pt.target=null,Pt.prototype.addSub=function(t){this.subs.push(t)},Pt.prototype.removeSub=function(t){this.subs.$remove(t)},Pt.prototype.depend=function(){Pt.target.addDep(this)},Pt.prototype.notify=function(){for(var t=v(this.subs),e=0,n=t.length;e<n;e++)t[e].update()};var Yr=Array.prototype,Kr=Object.create(Yr);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){var e=Yr[t];_(Kr,t,function(){for(var n=arguments.length,r=new Array(n);n--;)r[n]=arguments[n];var i,o=e.apply(this,r),a=this.__ob__;switch(t){case"push":i=r;break;case"unshift":i=r;break;case"splice":i=r.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})}),_(Yr,"$set",function(t,e){return t>=this.length&&(this.length=Number(t)+1),this.splice(t,1,e)[0]}),_(Yr,"$remove",function(t){if(this.length){var e=w(this,t);return e>-1?this.splice(e,1):void 0}});var Qr=Object.getOwnPropertyNames(Kr),ti=!0;Ft.prototype.walk=function(t){for(var e=Object.keys(t),n=0,r=e.length;n<r;n++)this.convert(e[n],t[e[n]])},Ft.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)Dt(t[e])},Ft.prototype.convert=function(t,e){zt(this.value,t,e)},Ft.prototype.addVm=function(t){(this.vms||(this.vms=[])).push(t)},Ft.prototype.removeVm=function(t){this.vms.$remove(t)};var ei=Object.freeze({defineReactive:zt,set:n,del:r,hasOwn:i,isLiteral:o,isReserved:a,_toString:s,toNumber:l,toBoolean:c,stripQuotes:f,camelize:u,hyphenate:p,classify:d,bind:g,toArray:v,extend:m,isObject:y,isPlainObject:b,def:_,debounce:x,indexOf:w,cancellable:k,looseEqual:C,isArray:Xn,hasProto:Yn,inBrowser:Kn,devtools:Qn,isIE:er,isIE9:nr,isAndroid:rr,isIOS:ir,get transitionProp(){return or},get transitionEndEvent(){return ar},get animationProp(){return sr},get animationEndEvent(){return lr},nextTick:ur,get _Set(){return hr},query:K,inDoc:Q,getAttr:tt,getBindAttr:et,hasBindAttr:nt,before:rt,after:it,remove:ot,prepend:at,replace:st,on:lt,off:ct,setClass:ut,addClass:ht,removeClass:pt,extractContent:dt,trimNode:gt,isTemplate:mt,createAnchor:yt,findRef:bt,mapNodeRange:_t,removeNodeRange:xt,isFragment:wt,getOuterHTML:kt,mergeOptions:Mt,resolveAsset:Et,checkComponentAttr:Ct,commonTagRE:Wr,reservedTagRE:Zr,get warn(){return Vr}}),ni=0,ri=new j(1e3),ii=0,oi=1,ai=2,si=3,li=0,ci=1,fi=2,ui=3,hi=4,pi=5,di=6,gi=7,vi=8,mi=[];mi[li]={ws:[li],ident:[ui,ii],"[":[hi],eof:[gi]},mi[ci]={ws:[ci],".":[fi],"[":[hi],eof:[gi]},mi[fi]={ws:[fi],ident:[ui,ii]},mi[ui]={ident:[ui,ii],0:[ui,ii],number:[ui,ii],ws:[ci,oi],".":[fi,oi],"[":[hi,oi],eof:[gi,oi]},mi[hi]={"'":[pi,ii],'"':[di,ii],"[":[hi,ai],"]":[ci,si],eof:vi,else:[hi,ii]},mi[pi]={"'":[hi,ii],eof:vi,else:[pi,ii]},mi[di]={'"':[hi,ii],eof:vi,else:[di,ii]};var yi=Object.freeze({parsePath:Ht,getPath:Ut,setPath:Wt}),bi=new j(1e3),_i="Math,Date,this,true,false,null,undefined,Infinity,NaN,isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,parseInt,parseFloat",xi=new RegExp("^("+_i.replace(/,/g,"\\b|")+"\\b)"),wi="break,case,class,catch,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,let,return,super,switch,throw,try,var,while,with,yield,enum,await,implements,package,protected,static,interface,private,public",ki=new RegExp("^("+wi.replace(/,/g,"\\b|")+"\\b)"),Ci=/\s/g,Ti=/\n/g,ji=/[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\"']|\\.)*`|`(?:[^`\\]|\\.)*`)|new |typeof |void /g,$i=/"(\d+)"/g,Ai=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/,Si=/[^\w$\.](?:[A-Za-z_$][\w$]*)/g,Oi=/^(?:true|false|null|undefined|Infinity|NaN)$/,Mi=[],Ei=Object.freeze({parseExpression:te,isSimplePath:ee}),Pi=[],Ni=[],Fi={},Ri={},Bi=!1,Di=0;ae.prototype.get=function(){this.beforeGet();var t,e=this.scope||this.vm;try{t=this.getter.call(e,e)}catch(t){}return this.deep&&se(t),this.preProcess&&(t=this.preProcess(t)),this.filters&&(t=e._applyFilters(t,null,this.filters,!1)),this.postProcess&&(t=this.postProcess(t)),this.afterGet(),t},ae.prototype.set=function(t){var e=this.scope||this.vm;this.filters&&(t=e._applyFilters(t,this.value,this.filters,!0));try{this.setter.call(e,e,t)}catch(t){}var n=e.$forContext;if(n&&n.alias===this.expression){if(n.filters)return;n._withLock(function(){e.$key?n.rawValue[e.$key]=t:n.rawValue.$set(e.$index,t)})}},ae.prototype.beforeGet=function(){Pt.target=this},ae.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},ae.prototype.afterGet=function(){Pt.target=null;for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},ae.prototype.update=function(t){this.lazy?this.dirty=!0:this.sync||!qr.async?this.run():(this.shallow=this.queued?!!t&&this.shallow:!!t,this.queued=!0,oe(this))},ae.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||(y(t)||this.deep)&&!this.shallow){var e=this.value;this.value=t;this.prevError;this.cb.call(this.vm,t,e)}this.queued=this.shallow=!1}},ae.prototype.evaluate=function(){var t=Pt.target;this.value=this.get(),this.dirty=!1,Pt.target=t},ae.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},ae.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||this.vm._vForRemoving||this.vm._watchers.$remove(this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.vm=this.cb=this.value=null}};var zi=new hr,Ii={bind:function(){this.attr=3===this.el.nodeType?"data":"textContent"},update:function(t){this.el[this.attr]=s(t)}},Li=new j(1e3),qi=new j(1e3),Vi={efault:[0,"",""],legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]};Vi.td=Vi.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Vi.option=Vi.optgroup=[1,'<select multiple="multiple">',"</select>"],Vi.thead=Vi.tbody=Vi.colgroup=Vi.caption=Vi.tfoot=[1,"<table>","</table>"],Vi.g=Vi.defs=Vi.symbol=Vi.use=Vi.image=Vi.text=Vi.circle=Vi.ellipse=Vi.line=Vi.path=Vi.polygon=Vi.polyline=Vi.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"version="1.1">',"</svg>"];var Hi=/<([\w:-]+)/,Ui=/&#?\w+?;/,Wi=/<!--/,Zi=function(){if(Kn){var t=document.createElement("div");return t.innerHTML="<template>1</template>",!t.cloneNode(!0).firstChild.innerHTML}return!1}(),Ji=function(){if(Kn){var t=document.createElement("textarea");return t.placeholder="t","t"===t.cloneNode(!0).value}return!1}(),Gi=Object.freeze({cloneNode:ue,parseTemplate:he}),Xi={bind:function(){8===this.el.nodeType&&(this.nodes=[],this.anchor=yt("v-html"),st(this.el,this.anchor))},update:function(t){t=s(t),this.nodes?this.swap(t):this.el.innerHTML=t},swap:function(t){for(var e=this.nodes.length;e--;)ot(this.nodes[e]);var n=he(t,!0,!0);this.nodes=v(n.childNodes),rt(n,this.anchor)}};pe.prototype.callHook=function(t){var e,n;for(e=0,n=this.childFrags.length;e<n;e++)this.childFrags[e].callHook(t);for(e=0,n=this.children.length;e<n;e++)t(this.children[e])},pe.prototype.beforeRemove=function(){var t,e;for(t=0,e=this.childFrags.length;t<e;t++)this.childFrags[t].beforeRemove(!1);for(t=0,e=this.children.length;t<e;t++)this.children[t].$destroy(!1,!0);var n=this.unlink.dirs;for(t=0,e=n.length;t<e;t++)n[t]._watcher&&n[t]._watcher.teardown()},pe.prototype.destroy=function(){this.parentFrag&&this.parentFrag.childFrags.$remove(this),this.node.__v_frag=null,this.unlink()};var Yi=new j(5e3);_e.prototype.create=function(t,e,n){var r=ue(this.template);return new pe(this.linker,this.vm,r,t,e,n)};var Ki=700,Qi=800,to=850,eo=1100,no=1500,ro=1500,io=1750,oo=2100,ao=2200,so=2300,lo=0,co={priority:ao,terminal:!0,params:["track-by","stagger","enter-stagger","leave-stagger"],bind:function(){var t=this.expression.match(/(.*) (?:in|of) (.*)/);if(t){var e=t[1].match(/\((.*),(.*)\)/);e?(this.iterator=e[1].trim(),this.alias=e[2].trim()):this.alias=t[1].trim(),this.expression=t[2]}if(this.alias){this.id="__v-for__"+ ++lo;var n=this.el.tagName;this.isOption=("OPTION"===n||"OPTGROUP"===n)&&"SELECT"===this.el.parentNode.tagName,this.start=yt("v-for-start"),this.end=yt("v-for-end"),st(this.el,this.end),rt(this.start,this.end),this.cache=Object.create(null),this.factory=new _e(this.vm,this.el)}},update:function(t){this.diff(t),this.updateRef(),this.updateModel()},diff:function(t){var e,n,r,o,a,s,l=t[0],c=this.fromObject=y(l)&&i(l,"$key")&&i(l,"$value"),f=this.params.trackBy,u=this.frags,h=this.frags=new Array(t.length),p=this.alias,d=this.iterator,g=this.start,v=this.end,m=Q(g),b=!u;for(e=0,n=t.length;e<n;e++)l=t[e],o=c?l.$key:null,a=c?l.$value:l,s=!y(a),r=!b&&this.getCachedFrag(a,e,o),r?(r.reused=!0,r.scope.$index=e,o&&(r.scope.$key=o),d&&(r.scope[d]=null!==o?o:e),(f||c||s)&&Nt(function(){r.scope[p]=a})):(r=this.create(a,p,e,o),r.fresh=!b),h[e]=r,b&&r.before(v);if(!b){var _=0,x=u.length-h.length;for(this.vm._vForRemoving=!0,e=0,n=u.length;e<n;e++)r=u[e],r.reused||(this.deleteCachedFrag(r),this.remove(r,_++,x,m));this.vm._vForRemoving=!1,_&&(this.vm._watchers=this.vm._watchers.filter(function(t){return t.active}));var w,k,C,T=0;for(e=0,n=h.length;e<n;e++)r=h[e],w=h[e-1],k=w?w.staggerCb?w.staggerAnchor:w.end||w.node:g,r.reused&&!r.staggerCb?(C=xe(r,g,this.id),C===w||C&&xe(C,g,this.id)===w||this.move(r,k)):this.insert(r,T++,k,m),r.reused=r.fresh=!1}},create:function(t,e,n,r){var i=this._host,o=this._scope||this.vm,a=Object.create(o);a.$refs=Object.create(o.$refs),a.$els=Object.create(o.$els),a.$parent=o,a.$forContext=this,Nt(function(){zt(a,e,t)}),zt(a,"$index",n),r?zt(a,"$key",r):a.$key&&_(a,"$key",null),this.iterator&&zt(a,this.iterator,null!==r?r:n);var s=this.factory.create(i,a,this._frag);return s.forId=this.id,this.cacheFrag(t,s,n,r),s},updateRef:function(){var t=this.descriptor.ref;if(t){var e,n=(this._scope||this.vm).$refs;this.fromObject?(e={},this.frags.forEach(function(t){e[t.scope.$key]=Ce(t)})):e=this.frags.map(Ce),n[t]=e}},updateModel:function(){if(this.isOption){var t=this.start.parentNode,e=t&&t.__v_model;e&&e.forceUpdate()}},insert:function(t,e,n,r){t.staggerCb&&(t.staggerCb.cancel(),t.staggerCb=null);var i=this.getStagger(t,e,null,"enter");if(r&&i){var o=t.staggerAnchor;o||(o=t.staggerAnchor=yt("stagger-anchor"),o.__v_frag=t),it(o,n);var a=t.staggerCb=k(function(){t.staggerCb=null,t.before(o),ot(o)});setTimeout(a,i)}else{var s=n.nextSibling;s||(it(this.end,n),s=this.end),t.before(s)}},remove:function(t,e,n,r){if(t.staggerCb)return t.staggerCb.cancel(),void(t.staggerCb=null);var i=this.getStagger(t,e,n,"leave");if(r&&i){var o=t.staggerCb=k(function(){t.staggerCb=null,t.remove()});setTimeout(o,i)}else t.remove()},move:function(t,e){e.nextSibling||this.end.parentNode.appendChild(this.end),t.before(e.nextSibling,!1)},cacheFrag:function(t,e,n,r){var o,a=this.params.trackBy,s=this.cache,l=!y(t);r||a||l?(o=ke(n,r,t,a),s[o]||(s[o]=e)):(o=this.id,i(t,o)?null===t[o]&&(t[o]=e):Object.isExtensible(t)&&_(t,o,e)),e.raw=t},getCachedFrag:function(t,e,n){var r,i=this.params.trackBy,o=!y(t);if(n||i||o){var a=ke(e,n,t,i);r=this.cache[a]}else r=t[this.id];return r&&(r.reused||r.fresh),r},deleteCachedFrag:function(t){var e=t.raw,n=this.params.trackBy,r=t.scope,o=r.$index,a=i(r,"$key")&&r.$key,s=!y(e);if(n||a||s){var l=ke(o,a,e,n);this.cache[l]=null}else e[this.id]=null,t.raw=null},getStagger:function(t,e,n,r){r+="Stagger";var i=t.node.__v_trans,o=i&&i.hooks,a=o&&(o[r]||o.stagger);return a?a.call(t,e,n):e*parseInt(this.params[r]||this.params.stagger,10)},_preProcess:function(t){return this.rawValue=t,t},_postProcess:function(t){if(Xn(t))return t;if(b(t)){for(var e,n=Object.keys(t),r=n.length,i=new Array(r);r--;)e=n[r],i[r]={$key:e,$value:t[e]};return i}return"number"!=typeof t||isNaN(t)||(t=we(t)),t||[]},unbind:function(){if(this.descriptor.ref&&((this._scope||this.vm).$refs[this.descriptor.ref]=null),this.frags)for(var t,e=this.frags.length;e--;)t=this.frags[e],this.deleteCachedFrag(t),t.destroy()}},fo={priority:oo,terminal:!0,bind:function(){var t=this.el;if(t.__vue__)this.invalid=!0;else{var e=t.nextElementSibling;e&&null!==tt(e,"v-else")&&(ot(e),this.elseEl=e),this.anchor=yt("v-if"),st(t,this.anchor)}},update:function(t){this.invalid||(t?this.frag||this.insert():this.remove())},insert:function(){this.elseFrag&&(this.elseFrag.remove(),this.elseFrag=null),this.factory||(this.factory=new _e(this.vm,this.el)),this.frag=this.factory.create(this._host,this._scope,this._frag),this.frag.before(this.anchor)},remove:function(){this.frag&&(this.frag.remove(),this.frag=null),this.elseEl&&!this.elseFrag&&(this.elseFactory||(this.elseFactory=new _e(this.elseEl._context||this.vm,this.elseEl)),this.elseFrag=this.elseFactory.create(this._host,this._scope,this._frag),this.elseFrag.before(this.anchor))},unbind:function(){this.frag&&this.frag.destroy(),this.elseFrag&&this.elseFrag.destroy()}},uo={bind:function(){var t=this.el.nextElementSibling;t&&null!==tt(t,"v-else")&&(this.elseEl=t)},update:function(t){this.apply(this.el,t),this.elseEl&&this.apply(this.elseEl,!t)},apply:function(t,e){function n(){t.style.display=e?"":"none"}Q(t)?Y(t,e?1:-1,n,this.vm):n()}},ho={bind:function(){var t=this,n=this.el,r="range"===n.type,i=this.params.lazy,o=this.params.number,a=this.params.debounce,s=!1;if(rr||r||(this.on("compositionstart",function(){s=!0}),this.on("compositionend",function(){s=!1,i||t.listener()})),this.focused=!1,r||i||(this.on("focus",function(){t.focused=!0}),this.on("blur",function(){t.focused=!1,t._frag&&!t._frag.inserted||t.rawListener()})),this.listener=this.rawListener=function(){if(!s&&t._bound){var e=o||r?l(n.value):n.value;t.set(e),ur(function(){t._bound&&!t.focused&&t.update(t._watcher.value)})}},a&&(this.listener=x(this.listener,a)),this.hasjQuery="function"==typeof e,this.hasjQuery){var c=e.fn.on?"on":"bind";e(n)[c]("change",this.rawListener),i||e(n)[c]("input",this.listener)}else this.on("change",this.rawListener),i||this.on("input",this.listener);!i&&nr&&(this.on("cut",function(){ur(t.listener)}),this.on("keyup",function(e){46!==e.keyCode&&8!==e.keyCode||t.listener()})),(n.hasAttribute("value")||"TEXTAREA"===n.tagName&&n.value.trim())&&(this.afterBind=this.listener)},update:function(t){t=s(t),t!==this.el.value&&(this.el.value=t)},unbind:function(){var t=this.el;if(this.hasjQuery){var n=e.fn.off?"off":"unbind";e(t)[n]("change",this.listener),e(t)[n]("input",this.listener)}}},po={bind:function(){var t=this,e=this.el;this.getValue=function(){if(e.hasOwnProperty("_value"))return e._value;var n=e.value;return t.params.number&&(n=l(n)),n},this.listener=function(){t.set(t.getValue())},this.on("change",this.listener),e.hasAttribute("checked")&&(this.afterBind=this.listener)},update:function(t){this.el.checked=C(t,this.getValue())}},go={bind:function(){var t=this,e=this,n=this.el;this.forceUpdate=function(){e._watcher&&e.update(e._watcher.get())};var r=this.multiple=n.hasAttribute("multiple");this.listener=function(){var t=Te(n,r);t=e.params.number?Xn(t)?t.map(l):l(t):t,e.set(t)},this.on("change",this.listener);var i=Te(n,r,!0);(r&&i.length||!r&&null!==i)&&(this.afterBind=this.listener),this.vm.$on("hook:attached",function(){ur(t.forceUpdate)}),Q(n)||ur(this.forceUpdate)},update:function(t){var e=this.el;e.selectedIndex=-1;for(var n,r,i=this.multiple&&Xn(t),o=e.options,a=o.length;a--;)n=o[a],r=n.hasOwnProperty("_value")?n._value:n.value,n.selected=i?je(t,r)>-1:C(t,r)},unbind:function(){this.vm.$off("hook:attached",this.forceUpdate)}},vo={bind:function(){function t(){var t=n.checked;return t&&n.hasOwnProperty("_trueValue")?n._trueValue:!t&&n.hasOwnProperty("_falseValue")?n._falseValue:t}var e=this,n=this.el;this.getValue=function(){return n.hasOwnProperty("_value")?n._value:e.params.number?l(n.value):n.value},this.listener=function(){var r=e._watcher.get();if(Xn(r)){var i=e.getValue(),o=w(r,i);n.checked?o<0&&e.set(r.concat(i)):o>-1&&e.set(r.slice(0,o).concat(r.slice(o+1)))}else e.set(t())},this.on("change",this.listener),n.hasAttribute("checked")&&(this.afterBind=this.listener)},update:function(t){var e=this.el;Xn(t)?e.checked=w(t,this.getValue())>-1:e.hasOwnProperty("_trueValue")?e.checked=C(t,e._trueValue):e.checked=!!t}},mo={text:ho,radio:po,select:go,checkbox:vo},yo={priority:Qi,twoWay:!0,handlers:mo,params:["lazy","number","debounce"],bind:function(){this.checkFilters(),this.hasRead&&!this.hasWrite;var t,e=this.el,n=e.tagName;if("INPUT"===n)t=mo[e.type]||mo.text;else if("SELECT"===n)t=mo.select;else{if("TEXTAREA"!==n)return;t=mo.text}e.__v_model=this,t.bind.call(this),this.update=t.update,this._unbind=t.unbind},checkFilters:function(){var t=this.filters;if(t)for(var e=t.length;e--;){var n=Et(this.vm.$options,"filters",t[e].name);("function"==typeof n||n.read)&&(this.hasRead=!0),n.write&&(this.hasWrite=!0)}},unbind:function(){this.el.__v_model=null,this._unbind&&this._unbind()}},bo={esc:27,tab:9,enter:13,space:32,delete:[8,46],up:38,left:37,right:39,down:40},_o={priority:Ki,acceptStatement:!0,keyCodes:bo,bind:function(){if("IFRAME"===this.el.tagName&&"load"!==this.arg){var t=this;this.iframeBind=function(){lt(t.el.contentWindow,t.arg,t.handler,t.modifiers.capture)},this.on("load",this.iframeBind)}},update:function(t){if(this.descriptor.raw||(t=function(){}),"function"==typeof t){this.modifiers.stop&&(t=Ae(t)),this.modifiers.prevent&&(t=Se(t)),this.modifiers.self&&(t=Oe(t));var e=Object.keys(this.modifiers).filter(function(t){return"stop"!==t&&"prevent"!==t&&"self"!==t&&"capture"!==t});e.length&&(t=$e(t,e)),this.reset(),this.handler=t,this.iframeBind?this.iframeBind():lt(this.el,this.arg,this.handler,this.modifiers.capture)}},reset:function(){var t=this.iframeBind?this.el.contentWindow:this.el;this.handler&&ct(t,this.arg,this.handler)},unbind:function(){this.reset()}},xo=["-webkit-","-moz-","-ms-"],wo=["Webkit","Moz","ms"],ko=/!important;?$/,Co=Object.create(null),To=null,jo={deep:!0,update:function(t){"string"==typeof t?this.el.style.cssText=t:Xn(t)?this.handleObject(t.reduce(m,{})):this.handleObject(t||{})},handleObject:function(t){var e,n,r=this.cache||(this.cache={});for(e in r)e in t||(this.handleSingle(e,null),delete r[e]);for(e in t)n=t[e],n!==r[e]&&(r[e]=n,this.handleSingle(e,n))},handleSingle:function(t,e){if(t=Me(t))if(null!=e&&(e+=""),e){var n=ko.test(e)?"important":"";n?(e=e.replace(ko,"").trim(),this.el.style.setProperty(t.kebab,e,n)):this.el.style[t.camel]=e}else this.el.style[t.camel]=""}},$o="http://www.w3.org/1999/xlink",Ao=/^xlink:/,So=/^v-|^:|^@|^(?:is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/,Oo=/^(?:value|checked|selected|muted)$/,Mo=/^(?:draggable|contenteditable|spellcheck)$/,Eo={
+value:"_value","true-value":"_trueValue","false-value":"_falseValue"},Po={priority:to,bind:function(){var t=this.arg,e=this.el.tagName;t||(this.deep=!0);var n=this.descriptor,r=n.interp;if(r){n.hasOneTime&&(this.expression=U(r,this._scope||this.vm)),(So.test(t)||"name"===t&&("PARTIAL"===e||"SLOT"===e))&&(this.el.removeAttribute(t),this.invalid=!0)}},update:function(t){if(!this.invalid){var e=this.arg;this.arg?this.handleSingle(e,t):this.handleObject(t||{})}},handleObject:jo.handleObject,handleSingle:function(t,e){var n=this.el,r=this.descriptor.interp;if(this.modifiers.camel&&(t=u(t)),!r&&Oo.test(t)&&t in n){var i="value"===t&&null==e?"":e;n[t]!==i&&(n[t]=i)}var o=Eo[t];if(!r&&o){n[o]=e;var a=n.__v_model;a&&a.listener()}return"value"===t&&"TEXTAREA"===n.tagName?void n.removeAttribute(t):void(Mo.test(t)?n.setAttribute(t,e?"true":"false"):null!=e&&e!==!1?"class"===t?(n.__v_trans&&(e+=" "+n.__v_trans.id+"-transition"),ut(n,e)):Ao.test(t)?n.setAttributeNS($o,t,e===!0?"":e):n.setAttribute(t,e===!0?"":e):n.removeAttribute(t))}},No={priority:no,bind:function(){if(this.arg){var t=this.id=u(this.arg),e=(this._scope||this.vm).$els;i(e,t)?e[t]=this.el:zt(e,t,this.el)}},unbind:function(){var t=(this._scope||this.vm).$els;t[this.id]===this.el&&(t[this.id]=null)}},Fo={bind:function(){}},Ro={bind:function(){var t=this.el;this.vm.$once("pre-hook:compiled",function(){t.removeAttribute("v-cloak")})}},Bo={text:Ii,html:Xi,for:co,if:fo,show:uo,model:yo,on:_o,bind:Po,el:No,ref:Fo,cloak:Ro},Do={deep:!0,update:function(t){t?"string"==typeof t?this.setClass(t.trim().split(/\s+/)):this.setClass(Pe(t)):this.cleanup()},setClass:function(t){this.cleanup(t);for(var e=0,n=t.length;e<n;e++){var r=t[e];r&&Ne(this.el,r,ht)}this.prevKeys=t},cleanup:function(t){var e=this.prevKeys;if(e)for(var n=e.length;n--;){var r=e[n];(!t||t.indexOf(r)<0)&&Ne(this.el,r,pt)}}},zo={priority:ro,params:["keep-alive","transition-mode","inline-template"],bind:function(){this.el.__vue__||(this.keepAlive=this.params.keepAlive,this.keepAlive&&(this.cache={}),this.params.inlineTemplate&&(this.inlineTemplate=dt(this.el,!0)),this.pendingComponentCb=this.Component=null,this.pendingRemovals=0,this.pendingRemovalCb=null,this.anchor=yt("v-component"),st(this.el,this.anchor),this.el.removeAttribute("is"),this.el.removeAttribute(":is"),this.descriptor.ref&&this.el.removeAttribute("v-ref:"+p(this.descriptor.ref)),this.literal&&this.setComponent(this.expression))},update:function(t){this.literal||this.setComponent(t)},setComponent:function(t,e){if(this.invalidatePending(),t){var n=this;this.resolveComponent(t,function(){n.mountComponent(e)})}else this.unbuild(!0),this.remove(this.childVM,e),this.childVM=null},resolveComponent:function(t,e){var n=this;this.pendingComponentCb=k(function(r){n.ComponentName=r.options.name||("string"==typeof t?t:null),n.Component=r,e()}),this.vm._resolveComponent(t,this.pendingComponentCb)},mountComponent:function(t){this.unbuild(!0);var e=this,n=this.Component.options.activate,r=this.getCached(),i=this.build();n&&!r?(this.waitingFor=i,Fe(n,i,function(){e.waitingFor===i&&(e.waitingFor=null,e.transition(i,t))})):(r&&i._updateRef(),this.transition(i,t))},invalidatePending:function(){this.pendingComponentCb&&(this.pendingComponentCb.cancel(),this.pendingComponentCb=null)},build:function(t){var e=this.getCached();if(e)return e;if(this.Component){var n={name:this.ComponentName,el:ue(this.el),template:this.inlineTemplate,parent:this._host||this.vm,_linkerCachable:!this.inlineTemplate,_ref:this.descriptor.ref,_asComponent:!0,_isRouterView:this._isRouterView,_context:this.vm,_scope:this._scope,_frag:this._frag};t&&m(n,t);var r=new this.Component(n);return this.keepAlive&&(this.cache[this.Component.cid]=r),r}},getCached:function(){return this.keepAlive&&this.cache[this.Component.cid]},unbuild:function(t){this.waitingFor&&(this.keepAlive||this.waitingFor.$destroy(),this.waitingFor=null);var e=this.childVM;return!e||this.keepAlive?void(e&&(e._inactive=!0,e._updateRef(!0))):void e.$destroy(!1,t)},remove:function(t,e){var n=this.keepAlive;if(t){this.pendingRemovals++,this.pendingRemovalCb=e;var r=this;t.$remove(function(){r.pendingRemovals--,n||t._cleanup(),!r.pendingRemovals&&r.pendingRemovalCb&&(r.pendingRemovalCb(),r.pendingRemovalCb=null)})}else e&&e()},transition:function(t,e){var n=this,r=this.childVM;switch(r&&(r._inactive=!0),t._inactive=!1,this.childVM=t,n.params.transitionMode){case"in-out":t.$before(n.anchor,function(){n.remove(r,e)});break;case"out-in":n.remove(r,function(){t.$before(n.anchor,e)});break;default:n.remove(r),t.$before(n.anchor,e)}},unbind:function(){if(this.invalidatePending(),this.unbuild(),this.cache){for(var t in this.cache)this.cache[t].$destroy();this.cache=null}}},Io=qr._propBindingModes,Lo={},qo=/^[$_a-zA-Z]+[\w$]*$/,Vo=qr._propBindingModes,Ho={bind:function(){var t=this.vm,e=t._context,n=this.descriptor.prop,r=n.path,i=n.parentPath,o=n.mode===Vo.TWO_WAY,a=this.parentWatcher=new ae(e,i,function(e){Ie(t,n,e)},{twoWay:o,filters:n.filters,scope:this._scope});if(ze(t,n,a.value),o){var s=this;t.$once("pre-hook:created",function(){s.childWatcher=new ae(t,r,function(t){a.set(t)},{sync:!0})})}},unbind:function(){this.parentWatcher.teardown(),this.childWatcher&&this.childWatcher.teardown()}},Uo=[],Wo=!1,Zo="transition",Jo="animation",Go=or+"Duration",Xo=sr+"Duration",Yo=Kn&&window.requestAnimationFrame,Ko=Yo?function(t){Yo(function(){Yo(t)})}:function(t){setTimeout(t,50)},Qo=Ze.prototype;Qo.enter=function(t,e){this.cancelPending(),this.callHook("beforeEnter"),this.cb=e,ht(this.el,this.enterClass),t(),this.entered=!1,this.callHookWithCb("enter"),this.entered||(this.cancel=this.hooks&&this.hooks.enterCancelled,Ue(this.enterNextTick))},Qo.enterNextTick=function(){var t=this;this.justEntered=!0,Ko(function(){t.justEntered=!1});var e=this.enterDone,n=this.getCssTransitionType(this.enterClass);this.pendingJsCb?n===Zo&&pt(this.el,this.enterClass):n===Zo?(pt(this.el,this.enterClass),this.setupCssCb(ar,e)):n===Jo?this.setupCssCb(lr,e):e()},Qo.enterDone=function(){this.entered=!0,this.cancel=this.pendingJsCb=null,pt(this.el,this.enterClass),this.callHook("afterEnter"),this.cb&&this.cb()},Qo.leave=function(t,e){this.cancelPending(),this.callHook("beforeLeave"),this.op=t,this.cb=e,ht(this.el,this.leaveClass),this.left=!1,this.callHookWithCb("leave"),this.left||(this.cancel=this.hooks&&this.hooks.leaveCancelled,this.op&&!this.pendingJsCb&&(this.justEntered?this.leaveDone():Ue(this.leaveNextTick)))},Qo.leaveNextTick=function(){var t=this.getCssTransitionType(this.leaveClass);if(t){var e=t===Zo?ar:lr;this.setupCssCb(e,this.leaveDone)}else this.leaveDone()},Qo.leaveDone=function(){this.left=!0,this.cancel=this.pendingJsCb=null,this.op(),pt(this.el,this.leaveClass),this.callHook("afterLeave"),this.cb&&this.cb(),this.op=null},Qo.cancelPending=function(){this.op=this.cb=null;var t=!1;this.pendingCssCb&&(t=!0,ct(this.el,this.pendingCssEvent,this.pendingCssCb),this.pendingCssEvent=this.pendingCssCb=null),this.pendingJsCb&&(t=!0,this.pendingJsCb.cancel(),this.pendingJsCb=null),t&&(pt(this.el,this.enterClass),pt(this.el,this.leaveClass)),this.cancel&&(this.cancel.call(this.vm,this.el),this.cancel=null)},Qo.callHook=function(t){this.hooks&&this.hooks[t]&&this.hooks[t].call(this.vm,this.el)},Qo.callHookWithCb=function(t){var e=this.hooks&&this.hooks[t];e&&(e.length>1&&(this.pendingJsCb=k(this[t+"Done"])),e.call(this.vm,this.el,this.pendingJsCb))},Qo.getCssTransitionType=function(t){if(!(!ar||document.hidden||this.hooks&&this.hooks.css===!1||Je(this.el))){var e=this.type||this.typeCache[t];if(e)return e;var n=this.el.style,r=window.getComputedStyle(this.el),i=n[Go]||r[Go];if(i&&"0s"!==i)e=Zo;else{var o=n[Xo]||r[Xo];o&&"0s"!==o&&(e=Jo)}return e&&(this.typeCache[t]=e),e}},Qo.setupCssCb=function(t,e){this.pendingCssEvent=t;var n=this,r=this.el,i=this.pendingCssCb=function(o){o.target===r&&(ct(r,t,i),n.pendingCssEvent=n.pendingCssCb=null,!n.pendingJsCb&&e&&e())};lt(r,t,i)};var ta={priority:eo,update:function(t,e){var n=this.el,r=Et(this.vm.$options,"transitions",t);t=t||"v",e=e||"v",n.__v_trans=new Ze(n,t,r,this.vm),pt(n,e+"-transition"),ht(n,t+"-transition")}},ea={style:jo,class:Do,component:zo,prop:Ho,transition:ta},na=/^v-bind:|^:/,ra=/^v-on:|^@/,ia=/^v-([^:]+)(?:$|:(.*)$)/,oa=/\.[^\.]+/g,aa=/^(v-bind:|:)?transition$/,sa=1e3,la=2e3;dn.terminal=!0;var ca=/[^\w\-:\.]/,fa=Object.freeze({compile:Ge,compileAndLinkProps:tn,compileRoot:en,transclude:xn,resolveSlots:Tn}),ua=/^v-on:|^@/;On.prototype._bind=function(){var t=this.name,e=this.descriptor;if(("cloak"!==t||this.vm._isCompiled)&&this.el&&this.el.removeAttribute){var n=e.attr||"v-"+t;this.el.removeAttribute(n)}var r=e.def;if("function"==typeof r?this.update=r:m(this,r),this._setupParams(),this.bind&&this.bind(),this._bound=!0,this.literal)this.update&&this.update(e.raw);else if((this.expression||this.modifiers)&&(this.update||this.twoWay)&&!this._checkStatement()){var i=this;this.update?this._update=function(t,e){i._locked||i.update(t,e)}:this._update=Sn;var o=this._preProcess?g(this._preProcess,this):null,a=this._postProcess?g(this._postProcess,this):null,s=this._watcher=new ae(this.vm,this.expression,this._update,{filters:this.filters,twoWay:this.twoWay,deep:this.deep,preProcess:o,postProcess:a,scope:this._scope});this.afterBind?this.afterBind():this.update&&this.update(s.value)}},On.prototype._setupParams=function(){if(this.params){var t=this.params;this.params=Object.create(null);for(var e,n,r,i=t.length;i--;)e=p(t[i]),r=u(e),n=et(this.el,e),null!=n?this._setupParamWatcher(r,n):(n=tt(this.el,e),null!=n&&(this.params[r]=""===n||n))}},On.prototype._setupParamWatcher=function(t,e){var n=this,r=!1,i=(this._scope||this.vm).$watch(e,function(e,i){if(n.params[t]=e,r){var o=n.paramWatchers&&n.paramWatchers[t];o&&o.call(n,e,i)}else r=!0},{immediate:!0,user:!1});(this._paramUnwatchFns||(this._paramUnwatchFns=[])).push(i)},On.prototype._checkStatement=function(){var t=this.expression;if(t&&this.acceptStatement&&!ee(t)){var e=te(t).get,n=this._scope||this.vm,r=function(t){n.$event=t,e.call(n,n),n.$event=null};return this.filters&&(r=n._applyFilters(r,null,this.filters)),this.update(r),!0}},On.prototype.set=function(t){this.twoWay&&this._withLock(function(){this._watcher.set(t)})},On.prototype._withLock=function(t){var e=this;e._locked=!0,t.call(e),ur(function(){e._locked=!1})},On.prototype.on=function(t,e,n){lt(this.el,t,e,n),(this._listeners||(this._listeners=[])).push([t,e])},On.prototype._teardown=function(){if(this._bound){this._bound=!1,this.unbind&&this.unbind(),this._watcher&&this._watcher.teardown();var t,e=this._listeners;if(e)for(t=e.length;t--;)ct(this.el,e[t][0],e[t][1]);var n=this._paramUnwatchFns;if(n)for(t=n.length;t--;)n[t]();this.vm=this.el=this._watcher=this._listeners=null}};var ha=/[^|]\|[^|]/;It(Bn),$n(Bn),An(Bn),Mn(Bn),En(Bn),Pn(Bn),Nn(Bn),Fn(Bn),Rn(Bn);var pa={priority:so,params:["name"],bind:function(){var t=this.params.name||"default",e=this.vm._slotContents&&this.vm._slotContents[t];e&&e.hasChildNodes()?this.compile(e.cloneNode(!0),this.vm._context,this.vm):this.fallback()},compile:function(t,e,n){if(t&&e){if(this.el.hasChildNodes()&&1===t.childNodes.length&&1===t.childNodes[0].nodeType&&t.childNodes[0].hasAttribute("v-if")){var r=document.createElement("template");r.setAttribute("v-else",""),r.innerHTML=this.el.innerHTML,r._context=this.vm,t.appendChild(r)}var i=n?n._scope:this._scope;this.unlink=e.$compile(t,n,i,this._frag)}t?st(this.el,t):ot(this.el)},fallback:function(){this.compile(dt(this.el,!0),this.vm)},unbind:function(){this.unlink&&this.unlink()}},da={priority:io,params:["name"],paramWatchers:{name:function(t){fo.remove.call(this),t&&this.insert(t)}},bind:function(){this.anchor=yt("v-partial"),st(this.el,this.anchor),this.insert(this.params.name)},insert:function(t){var e=Et(this.vm.$options,"partials",t,!0);e&&(this.factory=new _e(this.vm,e),fo.insert.call(this))},unbind:function(){this.frag&&this.frag.destroy()}},ga={slot:pa,partial:da},va=co._postProcess,ma=/(\d{3})(?=\d)/g,ya={orderBy:In,filterBy:zn,limitBy:Dn,json:{read:function(t,e){return"string"==typeof t?t:JSON.stringify(t,null,arguments.length>1?e:2)},write:function(t){try{return JSON.parse(t)}catch(e){return t}}},capitalize:function(t){return t||0===t?(t=t.toString(),t.charAt(0).toUpperCase()+t.slice(1)):""},uppercase:function(t){return t||0===t?t.toString().toUpperCase():""},lowercase:function(t){return t||0===t?t.toString().toLowerCase():""},currency:function(t,e,n){if(t=parseFloat(t),!isFinite(t)||!t&&0!==t)return"";e=null!=e?e:"$",n=null!=n?n:2;var r=Math.abs(t).toFixed(n),i=n?r.slice(0,-1-n):r,o=i.length%3,a=o>0?i.slice(0,o)+(i.length>3?",":""):"",s=n?r.slice(-1-n):"",l=t<0?"-":"";return l+e+a+i.slice(o).replace(ma,"$1,")+s},pluralize:function(t){var e=v(arguments,1),n=e.length;if(n>1){var r=t%10-1;return r in e?e[r]:e[n-1]}return e[0]+(1===t?"":"s")},debounce:function(t,e){if(t)return e||(e=300),x(t,e)}};qn(Bn),Bn.version="1.0.28",setTimeout(function(){qr.devtools&&Qn&&Qn.emit("init",Bn)},0),t.exports=Bn}).call(e,n(1))},function(t,e,n){(function(e){/*!
+ * Vue.js v2.1.10
+ * (c) 2014-2017 Evan You
+ * Released under the MIT License.
*/
-
- function contains(val, search) {
- var i;
- if (isPlainObject(val)) {
- var keys = Object.keys(val);
- i = keys.length;
- while (i--) {
- if (contains(val[keys[i]], search)) {
- return true;
- }
- }
- } else if (isArray(val)) {
- i = val.length;
- while (i--) {
- if (contains(val[i], search)) {
- return true;
- }
- }
- } else if (val != null) {
- return val.toString().toLowerCase().indexOf(search) > -1;
- }
- }
-
- var digitsRE = /(\d{3})(?=\d)/g;
-
- // asset collections must be a plain object.
- var filters = {
-
- orderBy: orderBy,
- filterBy: filterBy,
- limitBy: limitBy,
-
- /**
- * Stringify value.
- *
- * @param {Number} indent
- */
-
- json: {
- read: function read(value, indent) {
- return typeof value === 'string' ? value : JSON.stringify(value, null, arguments.length > 1 ? indent : 2);
- },
- write: function write(value) {
- try {
- return JSON.parse(value);
- } catch (e) {
- return value;
- }
- }
- },
-
- /**
- * 'abc' => 'Abc'
- */
-
- capitalize: function capitalize(value) {
- if (!value && value !== 0) return '';
- value = value.toString();
- return value.charAt(0).toUpperCase() + value.slice(1);
- },
-
- /**
- * 'abc' => 'ABC'
- */
-
- uppercase: function uppercase(value) {
- return value || value === 0 ? value.toString().toUpperCase() : '';
- },
-
- /**
- * 'AbC' => 'abc'
- */
-
- lowercase: function lowercase(value) {
- return value || value === 0 ? value.toString().toLowerCase() : '';
- },
-
- /**
- * 12345 => $12,345.00
- *
- * @param {String} sign
- * @param {Number} decimals Decimal places
- */
-
- currency: function currency(value, _currency, decimals) {
- value = parseFloat(value);
- if (!isFinite(value) || !value && value !== 0) return '';
- _currency = _currency != null ? _currency : '$';
- decimals = decimals != null ? decimals : 2;
- var stringified = Math.abs(value).toFixed(decimals);
- var _int = decimals ? stringified.slice(0, -1 - decimals) : stringified;
- var i = _int.length % 3;
- var head = i > 0 ? _int.slice(0, i) + (_int.length > 3 ? ',' : '') : '';
- var _float = decimals ? stringified.slice(-1 - decimals) : '';
- var sign = value < 0 ? '-' : '';
- return sign + _currency + head + _int.slice(i).replace(digitsRE, '$1,') + _float;
- },
-
- /**
- * 'item' => 'items'
- *
- * @params
- * an array of strings corresponding to
- * the single, double, triple ... forms of the word to
- * be pluralized. When the number to be pluralized
- * exceeds the length of the args, it will use the last
- * entry in the array.
- *
- * e.g. ['single', 'double', 'triple', 'multiple']
- */
-
- pluralize: function pluralize(value) {
- var args = toArray(arguments, 1);
- var length = args.length;
- if (length > 1) {
- var index = value % 10 - 1;
- return index in args ? args[index] : args[length - 1];
- } else {
- return args[0] + (value === 1 ? '' : 's');
- }
- },
-
- /**
- * Debounce a handler function.
- *
- * @param {Function} handler
- * @param {Number} delay = 300
- * @return {Function}
- */
-
- debounce: function debounce(handler, delay) {
- if (!handler) return;
- if (!delay) {
- delay = 300;
- }
- return _debounce(handler, delay);
- }
- };
-
- function installGlobalAPI (Vue) {
- /**
- * Vue and every constructor that extends Vue has an
- * associated options object, which can be accessed during
- * compilation steps as `this.constructor.options`.
- *
- * These can be seen as the default options of every
- * Vue instance.
- */
-
- Vue.options = {
- directives: directives,
- elementDirectives: elementDirectives,
- filters: filters,
- transitions: {},
- components: {},
- partials: {},
- replace: true
- };
-
- /**
- * Expose useful internals
- */
-
- Vue.util = util;
- Vue.config = config;
- Vue.set = set;
- Vue['delete'] = del;
- Vue.nextTick = nextTick;
-
- /**
- * The following are exposed for advanced usage / plugins
- */
-
- Vue.compiler = compiler;
- Vue.FragmentFactory = FragmentFactory;
- Vue.internalDirectives = internalDirectives;
- Vue.parsers = {
- path: path,
- text: text,
- template: template,
- directive: directive,
- expression: expression
- };
-
- /**
- * Each instance constructor, including Vue, has a unique
- * cid. This enables us to create wrapped "child
- * constructors" for prototypal inheritance and cache them.
- */
-
- Vue.cid = 0;
- var cid = 1;
-
- /**
- * Class inheritance
- *
- * @param {Object} extendOptions
- */
-
- Vue.extend = function (extendOptions) {
- extendOptions = extendOptions || {};
- var Super = this;
- var isFirstExtend = Super.cid === 0;
- if (isFirstExtend && extendOptions._Ctor) {
- return extendOptions._Ctor;
- }
- var name = extendOptions.name || Super.options.name;
- if (process.env.NODE_ENV !== 'production') {
- if (!/^[a-zA-Z][\w-]*$/.test(name)) {
- warn('Invalid component name: "' + name + '". Component names ' + 'can only contain alphanumeric characaters and the hyphen.');
- name = null;
- }
- }
- var Sub = createClass(name || 'VueComponent');
- Sub.prototype = Object.create(Super.prototype);
- Sub.prototype.constructor = Sub;
- Sub.cid = cid++;
- Sub.options = mergeOptions(Super.options, extendOptions);
- Sub['super'] = Super;
- // allow further extension
- Sub.extend = Super.extend;
- // create asset registers, so extended classes
- // can have their private assets too.
- config._assetTypes.forEach(function (type) {
- Sub[type] = Super[type];
- });
- // enable recursive self-lookup
- if (name) {
- Sub.options.components[name] = Sub;
- }
- // cache constructor
- if (isFirstExtend) {
- extendOptions._Ctor = Sub;
- }
- return Sub;
- };
-
- /**
- * A function that returns a sub-class constructor with the
- * given name. This gives us much nicer output when
- * logging instances in the console.
- *
- * @param {String} name
- * @return {Function}
- */
-
- function createClass(name) {
- /* eslint-disable no-new-func */
- return new Function('return function ' + classify(name) + ' (options) { this._init(options) }')();
- /* eslint-enable no-new-func */
- }
-
- /**
- * Plugin system
- *
- * @param {Object} plugin
- */
-
- Vue.use = function (plugin) {
- /* istanbul ignore if */
- if (plugin.installed) {
- return;
- }
- // additional parameters
- var args = toArray(arguments, 1);
- args.unshift(this);
- if (typeof plugin.install === 'function') {
- plugin.install.apply(plugin, args);
- } else {
- plugin.apply(null, args);
- }
- plugin.installed = true;
- return this;
- };
-
- /**
- * Apply a global mixin by merging it into the default
- * options.
- */
-
- Vue.mixin = function (mixin) {
- Vue.options = mergeOptions(Vue.options, mixin);
- };
-
- /**
- * Create asset registration methods with the following
- * signature:
- *
- * @param {String} id
- * @param {*} definition
- */
-
- config._assetTypes.forEach(function (type) {
- Vue[type] = function (id, definition) {
- if (!definition) {
- return this.options[type + 's'][id];
- } else {
- /* istanbul ignore if */
- if (process.env.NODE_ENV !== 'production') {
- if (type === 'component' && (commonTagRE.test(id) || reservedTagRE.test(id))) {
- warn('Do not use built-in or reserved HTML elements as component ' + 'id: ' + id);
- }
- }
- if (type === 'component' && isPlainObject(definition)) {
- if (!definition.name) {
- definition.name = id;
- }
- definition = Vue.extend(definition);
- }
- this.options[type + 's'][id] = definition;
- return definition;
- }
- };
- });
-
- // expose internal transition API
- extend(Vue.transition, transition);
- }
-
- installGlobalAPI(Vue);
-
- Vue.version = '1.0.28';
-
- // devtools global hook
- /* istanbul ignore next */
- setTimeout(function () {
- if (config.devtools) {
- if (devtools) {
- devtools.emit('init', Vue);
- } else if (process.env.NODE_ENV !== 'production' && inBrowser && /Chrome\/\d+/.test(window.navigator.userAgent)) {
- console.log('Download the Vue Devtools for a better development experience:\n' + 'https://github.com/vuejs/vue-devtools');
- }
- }
- }, 0);
-
- module.exports = Vue;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(57), __webpack_require__(5)))
-
-/***/ },
-/* 57 */
-/***/ function(module, exports) {
-
- // shim for using process in browser
- var process = module.exports = {};
-
- // cached from whatever global is present so that test runners that stub it
- // don't break things. But we need to wrap it in a try catch in case it is
- // wrapped in strict mode code which doesn't define any globals. It's inside a
- // function because try/catches deoptimize in certain engines.
-
- var cachedSetTimeout;
- var cachedClearTimeout;
-
- function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
- }
- function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
- }
- (function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
- } ())
- function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
-
-
- }
- function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
-
-
-
- }
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
-
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
-
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
- }
-
- process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
- };
-
- // v8 likes predictible objects
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function () {
- this.fun.apply(null, this.array);
- };
- process.title = 'browser';
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = ''; // empty string to avoid regexp issues
- process.versions = {};
-
- function noop() {}
-
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
-
- process.binding = function (name) {
- throw new Error('process.binding is not supported');
- };
-
- process.cwd = function () { return '/' };
- process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
- };
- process.umask = function() { return 0; };
-
-
-/***/ },
-/* 58 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* script */
- __vue_exports__ = __webpack_require__(59)
-
- /* template */
- var __vue_template__ = __webpack_require__(76)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/taglist/Taglist.vue"
- __vue_options__.render = __vue_template__.render
- __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-8bbbd580", __vue_options__)
- } else {
- hotAPI.reload("data-v-8bbbd580", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] Taglist.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 59 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _utils = __webpack_require__(60);
-
- exports.default = {
- data: function data() {
- return {
- tags: [],
- readOnly: false
- };
- },
-
-
- methods: {
- removeTag: function removeTag(index) {
- this.tags.$remove(index);
- this.normalizeSelectedTags();
- },
-
- reset: function reset() {
- this.tags = [];
- this.normalizeSelectedTags();
- },
-
- /* check tag already exists */
- tagAlreadyExists: function tagAlreadyExists(tag) {
- var result = false;
- var found = this.tags.find(function (userTag) {
-
- if (!userTag.tag_link) {
-
- if (userTag.tag_label === tag.tag_label) {
- return true;
- }
- } else {
- if (userTag.tag_link === tag.tag_link) {
- return true;
- }
- }
- });
- if (found) {
- var tagNode = this.$refs[found.id][0];
- tagNode.style.border = "1px solid red";
- setTimeout(function () {
- tagNode.style.border = "";
- }, 1000);
- result = true;
- }
- return result;
- },
- setTags: function setTags(tagArrays) {
-
- if (!Array.isArray(tagArrays)) {
- new Error('setTags expects an array!');
- }
- var self = this;
- tagArrays.map(function (tag) {
- self.addTag(tag);
- });
- },
- addTag: function addTag(tag) {
-
- if (this.tagAlreadyExists(tag)) {
- return false;
- }
-
- if (!tag || !tag.hasOwnProperty('tag_label')) {
- return;
- }
-
- if (!tag.id) {
- tag.id = (0, _utils.generateId)('tag_');
- }
-
- this.tags.push(tag);
- this.normalizeSelectedTags();
- },
- normalizeSelectedTags: function normalizeSelectedTags() {
- var result = [];
-
- this.tags.map(function (tag) {
- var tagItem = {};
- tagItem.tag_input = typeof tag.tag_link === "string" && tag.tag_link.length ? tag.tag_link : tag.tag_label;
- tagItem.accuracy = tag.accuracy;
- tagItem.relevancy = tag.relevancy;
- result.push(tagItem);
- });
- this.$parent.$data.selectedTags = JSON.stringify(result);
- },
-
-
- updateAccuracy: function updateAccuracy(event, tag) {
- tag.accuracy = event.target.value;
- this.normalizeSelectedTags();
- },
-
- updatePertinence: function updatePertinence(event, tag) {
- tag.relevancy = event.target.value;
- this.normalizeSelectedTags();
- }
- }
- }; //
-
-/***/ },
-/* 60 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.eventEmitter = exports.generateId = undefined;
-
- var _eventEmitter = __webpack_require__(61);
-
- var _eventEmitter2 = _interopRequireDefault(_eventEmitter);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var eventEmitter = (0, _eventEmitter2.default)({});
-
- var generateId = function () {
- var cpt = 0;
- var defautPrefix = "item_";
- return function (prefix) {
- prefix = typeof prefix === "string" ? prefix : defautPrefix;
- cpt = cpt + 1;
- return prefix + cpt;
- };
- }();
-
- exports.generateId = generateId;
- exports.eventEmitter = eventEmitter;
-
-/***/ },
-/* 61 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var d = __webpack_require__(62)
- , callable = __webpack_require__(75)
-
- , apply = Function.prototype.apply, call = Function.prototype.call
- , create = Object.create, defineProperty = Object.defineProperty
- , defineProperties = Object.defineProperties
- , hasOwnProperty = Object.prototype.hasOwnProperty
- , descriptor = { configurable: true, enumerable: false, writable: true }
-
- , on, once, off, emit, methods, descriptors, base;
-
- on = function (type, listener) {
- var data;
-
- callable(listener);
-
- if (!hasOwnProperty.call(this, '__ee__')) {
- data = descriptor.value = create(null);
- defineProperty(this, '__ee__', descriptor);
- descriptor.value = null;
- } else {
- data = this.__ee__;
- }
- if (!data[type]) data[type] = listener;
- else if (typeof data[type] === 'object') data[type].push(listener);
- else data[type] = [data[type], listener];
-
- return this;
- };
-
- once = function (type, listener) {
- var once, self;
-
- callable(listener);
- self = this;
- on.call(this, type, once = function () {
- off.call(self, type, once);
- apply.call(listener, this, arguments);
- });
-
- once.__eeOnceListener__ = listener;
- return this;
- };
-
- off = function (type, listener) {
- var data, listeners, candidate, i;
-
- callable(listener);
-
- if (!hasOwnProperty.call(this, '__ee__')) return this;
- data = this.__ee__;
- if (!data[type]) return this;
- listeners = data[type];
-
- if (typeof listeners === 'object') {
- for (i = 0; (candidate = listeners[i]); ++i) {
- if ((candidate === listener) ||
- (candidate.__eeOnceListener__ === listener)) {
- if (listeners.length === 2) data[type] = listeners[i ? 0 : 1];
- else listeners.splice(i, 1);
- }
- }
- } else {
- if ((listeners === listener) ||
- (listeners.__eeOnceListener__ === listener)) {
- delete data[type];
- }
- }
-
- return this;
- };
-
- emit = function (type) {
- var i, l, listener, listeners, args;
-
- if (!hasOwnProperty.call(this, '__ee__')) return;
- listeners = this.__ee__[type];
- if (!listeners) return;
-
- if (typeof listeners === 'object') {
- l = arguments.length;
- args = new Array(l - 1);
- for (i = 1; i < l; ++i) args[i - 1] = arguments[i];
-
- listeners = listeners.slice();
- for (i = 0; (listener = listeners[i]); ++i) {
- apply.call(listener, this, args);
- }
- } else {
- switch (arguments.length) {
- case 1:
- call.call(listeners, this);
- break;
- case 2:
- call.call(listeners, this, arguments[1]);
- break;
- case 3:
- call.call(listeners, this, arguments[1], arguments[2]);
- break;
- default:
- l = arguments.length;
- args = new Array(l - 1);
- for (i = 1; i < l; ++i) {
- args[i - 1] = arguments[i];
- }
- apply.call(listeners, this, args);
- }
- }
- };
-
- methods = {
- on: on,
- once: once,
- off: off,
- emit: emit
- };
-
- descriptors = {
- on: d(on),
- once: d(once),
- off: d(off),
- emit: d(emit)
- };
-
- base = defineProperties({}, descriptors);
-
- module.exports = exports = function (o) {
- return (o == null) ? create(base) : defineProperties(Object(o), descriptors);
- };
- exports.methods = methods;
-
-
-/***/ },
-/* 62 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var assign = __webpack_require__(63)
- , normalizeOpts = __webpack_require__(70)
- , isCallable = __webpack_require__(71)
- , contains = __webpack_require__(72)
-
- , d;
-
- d = module.exports = function (dscr, value/*, options*/) {
- var c, e, w, options, desc;
- if ((arguments.length < 2) || (typeof dscr !== 'string')) {
- options = value;
- value = dscr;
- dscr = null;
- } else {
- options = arguments[2];
- }
- if (dscr == null) {
- c = w = true;
- e = false;
- } else {
- c = contains.call(dscr, 'c');
- e = contains.call(dscr, 'e');
- w = contains.call(dscr, 'w');
- }
-
- desc = { value: value, configurable: c, enumerable: e, writable: w };
- return !options ? desc : assign(normalizeOpts(options), desc);
- };
-
- d.gs = function (dscr, get, set/*, options*/) {
- var c, e, options, desc;
- if (typeof dscr !== 'string') {
- options = set;
- set = get;
- get = dscr;
- dscr = null;
- } else {
- options = arguments[3];
- }
- if (get == null) {
- get = undefined;
- } else if (!isCallable(get)) {
- options = get;
- get = set = undefined;
- } else if (set == null) {
- set = undefined;
- } else if (!isCallable(set)) {
- options = set;
- set = undefined;
- }
- if (dscr == null) {
- c = true;
- e = false;
- } else {
- c = contains.call(dscr, 'c');
- e = contains.call(dscr, 'e');
- }
-
- desc = { get: get, set: set, configurable: c, enumerable: e };
- return !options ? desc : assign(normalizeOpts(options), desc);
- };
-
-
-/***/ },
-/* 63 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- module.exports = __webpack_require__(64)()
- ? Object.assign
- : __webpack_require__(65);
-
-
-/***/ },
-/* 64 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- module.exports = function () {
- var assign = Object.assign, obj;
- if (typeof assign !== 'function') return false;
- obj = { foo: 'raz' };
- assign(obj, { bar: 'dwa' }, { trzy: 'trzy' });
- return (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy';
- };
-
-
-/***/ },
-/* 65 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var keys = __webpack_require__(66)
- , value = __webpack_require__(69)
-
- , max = Math.max;
-
- module.exports = function (dest, src/*, …srcn*/) {
- var error, i, l = max(arguments.length, 2), assign;
- dest = Object(value(dest));
- assign = function (key) {
- try { dest[key] = src[key]; } catch (e) {
- if (!error) error = e;
- }
- };
- for (i = 1; i < l; ++i) {
- src = arguments[i];
- keys(src).forEach(assign);
- }
- if (error !== undefined) throw error;
- return dest;
- };
-
-
-/***/ },
-/* 66 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- module.exports = __webpack_require__(67)()
- ? Object.keys
- : __webpack_require__(68);
-
-
-/***/ },
-/* 67 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- module.exports = function () {
- try {
- Object.keys('primitive');
- return true;
- } catch (e) { return false; }
- };
-
-
-/***/ },
-/* 68 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- var keys = Object.keys;
-
- module.exports = function (object) {
- return keys(object == null ? object : Object(object));
- };
-
-
-/***/ },
-/* 69 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- module.exports = function (value) {
- if (value == null) throw new TypeError("Cannot use null or undefined");
- return value;
- };
-
-
-/***/ },
-/* 70 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- var forEach = Array.prototype.forEach, create = Object.create;
-
- var process = function (src, obj) {
- var key;
- for (key in src) obj[key] = src[key];
- };
-
- module.exports = function (options/*, …options*/) {
- var result = create(null);
- forEach.call(arguments, function (options) {
- if (options == null) return;
- process(Object(options), result);
- });
- return result;
- };
-
-
-/***/ },
-/* 71 */
-/***/ function(module, exports) {
-
- // Deprecated
-
- 'use strict';
-
- module.exports = function (obj) { return typeof obj === 'function'; };
-
-
-/***/ },
-/* 72 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- module.exports = __webpack_require__(73)()
- ? String.prototype.contains
- : __webpack_require__(74);
-
-
-/***/ },
-/* 73 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- var str = 'razdwatrzy';
-
- module.exports = function () {
- if (typeof str.contains !== 'function') return false;
- return ((str.contains('dwa') === true) && (str.contains('foo') === false));
- };
-
-
-/***/ },
-/* 74 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- var indexOf = String.prototype.indexOf;
-
- module.exports = function (searchString/*, position*/) {
- return indexOf.call(this, searchString, arguments[1]) > -1;
- };
-
-
-/***/ },
-/* 75 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- module.exports = function (fn) {
- if (typeof fn !== 'function') throw new TypeError(fn + " is not a function");
- return fn;
- };
-
-
-/***/ },
-/* 76 */
-/***/ function(module, exports, __webpack_require__) {
-
- module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
- return _c('div', [_c('ul', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (!_vm.readOnly),
- expression: "!readOnly"
- }],
- staticClass: "tags-wrapper list-unstyled"
- }, _vm._l((_vm.tags), function(tag, index) {
- return _c('li', {
- ref: tag.id,
- refInFor: true,
- staticClass: "tag-item"
- }, [_c('i', {
- staticClass: "fa fa-tag"
- }), _vm._v(" "), _c('strong', [_c('span', {
- domProps: {
- "textContent": _vm._s(tag.tag_label)
- }
- })]), _vm._v("\n\n\t\t\tFiabilité: \t"), _c('select', {
- on: {
- "change": function($event) {
- _vm.updateAccuracy($event, tag)
- }
- }
- }, _vm._l(([1, 2, 3, 4, 5]), function(no, index) {
- return _c('option', {
- domProps: {
- "selected": tag.accuracy == no,
- "value": no
- }
- }, [_vm._v(_vm._s(no))])
- })), _vm._v("\n\n\t\t\tPertinence: "), _c('select', {
- on: {
- "change": function($event) {
- _vm.updatePertinence($event, tag)
- }
- }
- }, _vm._l(([1, 2, 3, 4, 5]), function(no, index) {
- return _c('option', {
- domProps: {
- "selected": tag.relevancy == no,
- "value": no
- }
- }, [_vm._v(_vm._s(no))])
- })), _vm._v(" "), _c('a', {
- on: {
- "click": function($event) {
- _vm.removeTag(tag)
- }
- }
- }, [_c('i', {
- staticClass: "fa fa-trash"
- })])])
- })), _vm._v(" "), _c('ul', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (_vm.readOnly),
- expression: "readOnly"
- }],
- staticClass: "list-inline"
- }, _vm._l((_vm.tags), function(tag, index) {
- return _c('li', [_c('i', {
- staticClass: "fa fa-tag"
- }), _vm._v(" "), _c('span', {
- staticClass: "label label-info"
- }, [_vm._v(_vm._s(tag.tag_label))]), _vm._v("\n\t\t\t | fiabilité "), _c('span', {
- staticClass: "badge"
- }, [_vm._v(_vm._s(tag.accuracy))]), _vm._v("\n\t\t\t | pertinence "), _c('span', {
- staticClass: "badge"
- }, [_vm._v(_vm._s(tag.relevancy))])])
- }))])
- },staticRenderFns: []}
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api").rerender("data-v-8bbbd580", module.exports)
- }
- }
-
-/***/ },
-/* 77 */
-/***/ function(module, exports, __webpack_require__) {
-
- module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
- return _c('div', [_c('taglist', {
- ref: "taglist"
- }), _vm._v(" "), _c('input', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (!_vm.readOnly),
- expression: "!readOnly"
- }, {
- name: "model",
- rawName: "v-model",
- value: (_vm.query),
- expression: "query"
- }],
- attrs: {
- "type": "text",
- "placeholder": "...",
- "autocomplete": "off"
- },
- domProps: {
- "value": _vm._s(_vm.query)
- },
- on: {
- "keyup": [function($event) {
- if ($event.keyCode !== 8) { return; }
- _vm.checkQuery($event)
- }, _vm.update],
- "keydown": [function($event) {
- if (_vm._k($event.keyCode, "down", 40)) { return; }
- _vm.down($event)
- }, function($event) {
- if (_vm._k($event.keyCode, "up", 38)) { return; }
- _vm.up($event)
- }, function($event) {
- if (_vm._k($event.keyCode, "enter", 13)) { return; }
- _vm.hit($event)
- }, function($event) {
- if (_vm._k($event.keyCode, "esc", 27)) { return; }
- _vm.reset($event)
- }],
- "input": function($event) {
- if ($event.target.composing) { return; }
- _vm.query = $event.target.value
- }
- }
- }), _vm._v(" "), _c('a', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (_vm.showAddButton),
- expression: "showAddButton"
- }],
- on: {
- "click": _vm.addTag
- }
- }, [_c('i', {
- staticClass: "fa fa-plus"
- }), _vm._v(" Créer ce tag")]), _vm._v(" "), _c('ul', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (_vm.hasItems || !_vm.readOnly),
- expression: "hasItems || !readOnly"
- }]
- }, _vm._l((_vm.items), function(item, index) {
- return _c('li', {
- class: _vm.activeClass(index),
- on: {
- "mousedown": _vm.hit,
- "mousemove": function($event) {
- _vm.setActive(index)
- }
- }
- }, [_c('span', {
- domProps: {
- "textContent": _vm._s(item.tag_label)
- }
- })])
- })), _vm._v(" "), _c('input', {
- directives: [{
- name: "model",
- rawName: "v-model",
- value: (_vm.selectedTags),
- expression: "selectedTags"
- }],
- attrs: {
- "name": "tags",
- "type": "hidden"
- },
- domProps: {
- "value": _vm._s(_vm.selectedTags)
- },
- on: {
- "input": function($event) {
- if ($event.target.composing) { return; }
- _vm.selectedTags = $event.target.value
- }
- }
- })], 1)
- },staticRenderFns: []}
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api").rerender("data-v-09005644", module.exports)
- }
- }
-
-/***/ },
-/* 78 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _Cutout = __webpack_require__(79);
-
- var _Cutout2 = _interopRequireDefault(_Cutout);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- exports.default = {
-
- init: function init() {
- new Vue(_Cutout2.default);
- }
- };
-
-/***/ },
-/* 79 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* script */
- __vue_exports__ = __webpack_require__(80)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/cutout/Cutout.vue"
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-6cafb84e", __vue_options__)
- } else {
- hotAPI.reload("data-v-6cafb84e", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] Cutout.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 80 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _svgboard = __webpack_require__(81);
-
- var _svgboard2 = _interopRequireDefault(_svgboard);
-
- var _Typeahead = __webpack_require__(8);
-
- var _Typeahead2 = _interopRequireDefault(_Typeahead);
-
- var _Zoomview = __webpack_require__(85);
-
- var _Zoomview2 = _interopRequireDefault(_Zoomview);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- exports.default = {
-
- el: '#drawing-zone',
- MODE_RECT: 'RECT',
- MODE_FREE: 'FREE',
- ZOOM_IN: 'in',
- ZOOM_OUT: 'out',
-
- components: { typeahead: _Typeahead2.default, zoomview: _Zoomview2.default },
- data: {
- mode: "",
- isRect: true,
- normalizePath: "",
- readOnly: false,
- formView: true,
- useClipPath: false,
- transformMatrix: "",
- fragmentPath: "",
- canZoom: true,
- displayMask: false
- },
-
- mounted: function mounted() {
- var self = this;
- this.initialDrawingMode = null;
- this.drawingComponent = _svgboard2.default.init({
- wrapperId: '#iconolab-image-wrapper',
- actionWrapper: '#action-wrapper',
- readOnly: false,
- onDrawingModeChange: function onDrawingModeChange(mode) {
- self.setDrawingMode(mode, false);
- }
- });
- this.$refs.zoomview.setZoomTarget(this.drawingComponent.getPaper());
- this.showForm();
- },
-
-
- methods: {
-
- computeCentreredViewBox: function computeCentreredViewBox() {
- var zoomSvg = this.$refs.zoomSvg;
- var viewBox = [];
- var imageWidth = zoomSvg.getAttribute("width");
- var imageHeight = zoomSvg.getAttribute("height");
-
- /* normalize */
- var xRatio = imageWidth / 100;
- var yRatio = imageHeight / 100;
-
- var zTarget = this.drawingComponent.getShapeBBox();
- viewBox = [(zTarget.x - 1) * xRatio, (zTarget.y - 1) * yRatio, (zTarget.w + 2) * xRatio, (zTarget.h + 2) * yRatio];
- return viewBox.join(" ");
- },
-
- computeZoomedViewBox: function computeZoomedViewBox() {
- var viewBoxArray = [];
- var zoomSvg = this.$refs.zoomSvg;
- var shapeBBox = this.drawingComponent.getShapeBBox();
- var imageWidth = zoomSvg.getAttribute("width");
- var imageHeight = zoomSvg.getAttribute("height");
- var xRatio = imageWidth / 100;
- var yRatio = imageHeight / 100;
- /* denormalize coordonate, max is imageX * 100x = imageHeigth*/
- shapeBBox.x = shapeBBox.x * xRatio;
- shapeBBox.y = shapeBBox.y * yRatio;
-
- shapeBBox.w = shapeBBox.w * xRatio;
- shapeBBox.h = shapeBBox.h * yRatio;
-
- var imgRatio = imageWidth / imageHeight;
- if (shapeBBox.w > shapeBBox.h) {
- shapeBBox.y = Math.max(0, shapeBBox.y - (shapeBBox.w * imgRatio - shapeBBox.h) / 2);
- shapeBBox.h = shapeBBox.w * imgRatio;
- } else {
- shapeBBox.x = Math.max(0, shapeBBox.x - (shapeBBox.h / imgRatio - shapeBBox.w) / 2);
- shapeBBox.w = shapeBBox.h / imgRatio;
- }
- viewBoxArray = [shapeBBox.x, shapeBBox.y, shapeBBox.w, shapeBBox.h];
-
- if (!shapeBBox) {
- return false;
- }
-
- return viewBoxArray.join(" ");
- },
-
- zoom: function zoom(direction) {
-
- var mainSvgWrapper = this.$refs.smallSvgWrapper;
- if (this.$options.ZOOM_OUT === direction) {
- var defaultViewBox = [0, 0, mainSvgWrapper.getAttribute("width"), mainSvgWrapper.getAttribute("height")];
- mainSvgWrapper.setAttribute("viewBox", defaultViewBox.join(" "));
- this.canZoom = true;
- }
-
- if (this.$options.ZOOM_IN === direction) {
- mainSvgWrapper.setAttribute("viewBox", this.computeCentreredViewBox()); //this.computeZoomedViewBox());//
- this.canZoom = false;
- }
- },
-
- setDrawingMode: function setDrawingMode(mode, updateComponent) {
- if (!this.initialDrawingMode) {
- this.initialDrawingMode = mode; //useful for cancel
- }
- var updateComponent = typeof updateComponent === "boolean" ? updateComponent : true;
- this.mode = this.$options['MODE_' + mode];
- this.isRect = this.mode === this.$options.MODE_RECT ? true : false;
- if (updateComponent) {
- this.drawingComponent.setDrawingMode(this.mode);
- }
- },
-
- cancel: function cancel() {
- this.formView = true;
- var currentPath = this.$refs.currentPath.getAttribute("d");
- if (!currentPath.length || !this.initialDrawingMode) {
- return;
- }{
- currentPath += ";" + this.initialDrawingMode;
- this.drawingComponent.setPath(currentPath);
- }
- },
-
- highLightZone: function highLightZone() {
- if (!this.displayMask) {
- this.displayMask = true;
- } else {
- this.displayMask = false;
- }
- },
-
- displayEditedPath: function displayEditedPath() {
- var normalizePath = this.drawingComponent.getPath();
- },
-
- resetZoom: function resetZoom() {
- this.zoom(this.$options.ZOOM_OUT);
- },
-
- showEditor: function showEditor() {
- this.formView = false;
- this.resetZoom();
- /* on edit mode reset*/
- },
-
- showForm: function showForm() {
- this.normalizePath = this.drawingComponent.getPath();
- var smallImage = this.$refs.smallImage;
- this.formView = true;
- var xRatio = smallImage.getAttribute("width") / 100;
- var yRatio = smallImage.getAttribute("height") / 100;
- var transformMatrix = [xRatio, 0, 0, yRatio, 0, 0].join(',');
- this.transformMatrix = "matrix(" + transformMatrix + ")";
- this.fragmentPath = this.normalizePath.split(';')[0];
- },
-
- clear: function clear() {
- this.drawingComponent.clear();
- }
- }
- };
-
-/***/ },
-/* 81 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _snapsvg = __webpack_require__(82);
-
- var _snapsvg2 = _interopRequireDefault(_snapsvg);
-
- var _shapeResizer = __webpack_require__(83);
-
- var _shapeResizer2 = _interopRequireDefault(_shapeResizer);
-
- var _utils = __webpack_require__(60);
-
- var _snapsvgZoom = __webpack_require__(84);
-
- var _snapsvgZoom2 = _interopRequireDefault(_snapsvgZoom);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- /* custom plugins */
- _snapsvg2.default.plugin(function (Snap, Element, Paper, glob) {
- var elproto = Element.prototype;
-
- elproto.toBack = function () {
- this.prependTo(this.paper);
- };
-
- elproto.toFront = function () {
- this.appendTo(this.paper);
- };
- });
-
- Element.prototype.getTransformedXY = function (x, y) {
- var m = this.transform().globalMatrix;
- return { x: m.x(x, y), y: m.y(x, y) };
- };
-
- var paper = null;
- var mainImage = null;
- var pointData = [];
- var viewBoxBounds = { X: 100, Y: 100 };
- var zoomFactor = { x: 1, y: 1 };
- var viewPort = { width: 850, height: 850 };
- var currentViewBox = [];
- var config = null;
- var readOnly = false;
- var startPoint = null;
- var drawing_path = null;
- var drawing_paths = [];
- var canDraw = false;
- var rectZone = null;
- var PATH_COLOR = "#ff00ff";
- var STROKE_COLOR = "red";
- var FILL_COLOR = "orange";
-
- var SELECTED_COLOR = "#ffff00";
- var FIRST_NODE_COLOR = "#FF0000";
- var HANDLE_SIZE = 8;
- var isDragged = false;
- var enablePoint = true;
- var pathIsClosed = false;
- var ENABLE_NEW_NODE = true;
- var RECT_MODE = 'RECT';
- var drawingMode = RECT_MODE; //free
- var FREE_MODE = 'FREE';
- var availableModes = [RECT_MODE, FREE_MODE];
- var onChangeCallback = null;
-
- var getId = function () {
- var cpt = 0;
- var defautPrefix = "item_";
- return function (prefix) {
- prefix = typeof prefix === 'string' ? prefix : defautPrefix;
- cpt = cpt + 1;
- return prefix + cpt;
- };
- }();
-
- var handleRectPath = function handleRectPath(path) {
- if (readOnly) {
- paper.path(path).attr({ stroke: 'red', opacity: 0.6 });
- return;
- }
-
- var bbBox = _snapsvg2.default.path.getBBox(path);
- rectZone = paper.rect(bbBox.x, bbBox.y, bbBox.width, bbBox.height);
- rectZone.attr({ fill: FILL_COLOR, stroke: STROKE_COLOR, opacity: 0.6 });
- drawing_path = rectZone;
- canDraw = false;
- pathIsClosed = true;
- _shapeResizer2.default.enable_resizer(paper, drawing_path, viewPort, currentViewBox);
- };
-
- var handleFreePath = function handleFreePath(path) {
-
- if (readOnly) {
-
- paper.path(path).attr({
- stroke: 'orange',
- fill: 'orange',
- opacity: 0.5
- });
-
- return;
- }
-
- var pathInfos = _snapsvg2.default.parsePathString(path);
- pathInfos.map(function (pathData) {
- if (pathData[0] !== 'Z') {
- createPoint(paper, pathData[1], pathData[2], pointData);
- } else {
- pathIsClosed = true;
- updatePath(paper, onClosePath);
- }
- });
-
- /* replay the path here */
- };
- //transform point to path
- var updatePath = function updatePath(paper, updateCallback) {
- var path = "M";
-
- if (pointData.length <= 1) {
- return;
- }
-
- path += pointData[0].x + ',' + pointData[0].y;
-
- for (var i = 0; i < pointData.length; i++) {
- if (i == 0) continue;
-
- var pointInfos = pointData[i];
- var lPath = "L" + pointInfos.x + "," + pointInfos.y;
- path += " " + lPath;
- }
-
- path += pathIsClosed ? " Z" : "";
-
- /* remove prev path */
- if (drawing_path) {
- drawing_path.remove();
- }
-
- drawing_path = paper.path(path);
-
- drawing_path.attr({
- stroke: STROKE_COLOR,
- "vector-effect": "non-scaling-stroke", //prevent line to be zoom in
- "stroke-width": 3,
- fill: "white",
- opacity: 0.1
- });
-
- /* bring all handler to front */
- pointData.map(function (point) {
-
- /*deal with handler size */
- var handleSize = computeHandleSize();
- if (point.handler) {
- point.handler.toFront();
- }
- });
-
- if (typeof updateCallback === 'function' && pathIsClosed) {
- updateCallback();
- }
-
- if (!updateCallback && pathIsClosed) {
- applyClosedStyle();
- }
- };
-
- var applyClosedStyle = function applyClosedStyle() {
- drawing_path.attr({ fill: FILL_COLOR, strokeWidth: 1, opacity: .6 });
- };
-
- var onClosePath = function onClosePath() {
- ENABLE_NEW_NODE = false;
- applyClosedStyle();
- };
-
- var onClickOnHandler = function onClickOnHandler(point, p, e) {
- //close path
- if (point.isFirst && pointData.length > 2) {
- pathIsClosed = true;
- }
- };
-
- var updatePointPosition = function updatePointPosition(newPoint, x, y) {
- var index = pointData.indexOf(newPoint);
- if (index !== -1) {
- pointData[index].x = x;
- pointData[index].y = y;
- return true;
- } else {
- return false;
- }
- };
-
- var clearPreviousPath = function clearPreviousPath() {
- drawing_path.remove();
- };
-
- var computeHandleSize = function computeHandleSize() {
-
- if (!currentViewBox.length) {
- currentViewBox = [0, 0, parseInt(mainImage.width()), parseInt(mainImage.height())];
- }
- var currentHandleSize = HANDLE_SIZE * Math.min(currentViewBox[2], currentViewBox[3]) / 850;
- return currentHandleSize;
- };
-
- var onMoveHandler = function onMoveHandler(dx, dy, posX, posY, e) {
- isDragged = true;
- var tdx, tdy;
- var snapInvMatrix = this.transform().diffMatrix.invert();
- snapInvMatrix.e = snapInvMatrix.f = 0;
- tdx = snapInvMatrix.x(dx, dy);
- tdy = snapInvMatrix.y(dx, dy);
- var transformValue = this.data('origTransform') + (this.data('origTransform') ? "T" : "t") + [tdx, tdy];
- this.attr({ transform: transformValue });
- var boxSize = this.getBBox();
-
- var wasUpdated = updatePointPosition(this.data('point'), boxSize.x + computeHandleSize() / 2, boxSize.y + computeHandleSize() / 2);
-
- if (wasUpdated) {
- updatePath(this.paper);
- }
- };
-
- var bindHandlerEvent = function bindHandlerEvent(point, p) {
- point.handler.click(onClickOnHandler.bind(this, point, p));
- /* -- handler -- */
- point.handler.hover(function () {
- point.handler.attr({ fill: 'yellow' });
- }, function () {
- var fillColor = point.isFirst ? FIRST_NODE_COLOR : "";
- point.handler.attr({ fill: fillColor });
- });
-
- point.handler.drag(onMoveHandler, function () {
- this.data('origTransform', this.transform().local);
- }, function () {
- if (!isDragged) {
- return true;
- }
- isDragged = false;
- enablePoint = false;
- });
- };
-
- var createPointHandler = function createPointHandler(p, point) {
- var handler;
- var handleSize = computeHandleSize();
- var handleX = point.x - handleSize / 2;
- var handleY = point.y - handleSize / 2;
-
- /* preserve initial size of 5px a quoi correspond 5 deal with current vp */
- handler = p.rect(handleX, handleY, handleSize, handleSize);
-
- handler.addClass("drawingHandler");
- point.handler = handler;
- point.handler.data('point', point);
- if (pointData.length === 0) {
- point.isFirst = true;
- }
-
- bindHandlerEvent(point, p);
- point.handler.attr({
- fill: pointData.length === 0 ? FIRST_NODE_COLOR : "",
- opacity: 0.9,
- stroke: PATH_COLOR
- });
-
- return point;
- };
-
- //create paper
- var createPoint = function createPoint(paper, x, y, pointData) {
-
- var point = { x: x, y: y, id: getId() };
-
- if (pathIsClosed) {
- updatePath(paper, onClosePath);
- return;
- }
-
- if (!enablePoint) {
- enablePoint = true;
- return false;
- }
-
- point = createPointHandler(paper, point);
- pointData.push(point);
- updatePath(paper);
- };
-
- var attachRectEvents = function attachRectEvents(paper) {
- if (readOnly) {
- return false;
- }
-
- var startPosition = {};
- var currentPosition = {};
- /* add resizer */
-
- var computeOffset = function computeOffset(e) {
- var target = e.target || e.srcElement;
- var rect = target.getBoundingClientRect();
- var offsetX = (e.clientX - rect.left) / Math.min(zoomFactor.x, zoomFactor.y);
- var offsetY = (e.clientY - rect.top) / Math.min(zoomFactor.x, zoomFactor.y);
- return { x: offsetX, y: offsetY };
- };
-
- paper.mousedown(function (e) {
-
- if (drawingMode === FREE_MODE || pathIsClosed) {
- return;
- }
- var offset = computeOffset(e);
- startPosition.x = offset.x;
- startPosition.y = offset.y;
- canDraw = true;
- });
-
- paper.mousemove(function (e) {
- if (drawingMode === FREE_MODE) {
- return;
- }
- if (!canDraw) {
- return;
- }
- var x, y;
- var offset = computeOffset(e);
- currentPosition.x = offset.x;
- currentPosition.y = offset.y;
-
- if (rectZone) {
- rectZone.remove();
- }
-
- /* bas -> droite */
- var width = Math.abs(currentPosition.x - startPosition.x);
- var height = Math.abs(startPosition.y - currentPosition.y);
-
- if (currentPosition.y > startPosition.y && currentPosition.x > startPosition.x) {
- x = startPosition.x;
- y = startPosition.y;
- }
-
- /* haut -> droite */
- if (currentPosition.y < startPosition.y && currentPosition.x > startPosition.x) {
- x = currentPosition.x - width;
- y = currentPosition.y;
- }
-
- /* haut -> gauche */
- if (currentPosition.y < startPosition.y && currentPosition.x < startPosition.x) {
- x = currentPosition.x;
- y = currentPosition.y;
- }
-
- /* bas -> gauche */
- if (currentPosition.y > startPosition.y && currentPosition.x < startPosition.x) {
- x = currentPosition.x;
- y = currentPosition.y - height;
- }
- if (!x || !y) {
- return;
- }
-
- rectZone = paper.rect(x, y, width, height);
- rectZone.attr({ fill: FILL_COLOR, stroke: STROKE_COLOR, opacity: 0.6 });
- });
-
- paper.mouseup(function () {
- if (drawingMode === FREE_MODE || pathIsClosed || !rectZone) {
- return false;
- }
- drawing_path = rectZone;
- _shapeResizer2.default.enable_resizer(paper, rectZone, viewPort, currentViewBox);
- canDraw = false;
- pathIsClosed = true;
- });
- };
-
- var attachPointEvents = function attachPointEvents(paper) {
- if (readOnly) {
- return;
- }
- var clickTimeout = null;
- var preventClick = false;
- paper.dblclick(function (e) {
- if (drawingMode === RECT_MODE) {
- return true;
- }
- preventClick = true;
- if (clickTimeout) {
- clickTimeout = clearTimeout(clickTimeout);
- preventClick = false;
- pathIsClosed = true;
- if (pointData.length > 2) {
- updatePath(paper, onClosePath);
- }
- }
-
- return false;
- });
-
- var computeOffset = function computeOffset(e) {
- var target = e.target || e.srcElement;
- var rect = target.getBoundingClientRect();
- var offsetX = (e.clientX - rect.left) / Math.min(zoomFactor.x, zoomFactor.y);
- var offsetY = (e.clientY - rect.top) / Math.min(zoomFactor.x, zoomFactor.y);
- return { x: offsetX, y: offsetY };
- };
-
- var clickHandler = function clickHandler(offsetX, offsetY) {
-
- if (preventClick) {
- return;
- }
-
- if (drawingMode === RECT_MODE) {
- return true;
- }
- if (!ENABLE_NEW_NODE) {
- return true;
- }
- createPoint(paper, offsetX, offsetY, pointData);
- clickTimeout = null;
- preventClick = false;
- };
-
- paper.click(function (e) {
- if (clickTimeout) {
- return;
- }
- if (!jQuery(e.target).is(mainImage)) {
- return;
- }
- var offset = computeOffset(e);
- var offsetX = offset.x;
- var offsetY = offset.y;
- clickTimeout = setTimeout(clickHandler.bind(this, offsetX, offsetY), 190);
- });
- };
-
- var attachZoomEvents = function attachZoomEvents() {
-
- _utils.eventEmitter.on("zoomChanged", function (zoomInfos) {
- zoomFactor = zoomInfos.zoomFactor;
- currentViewBox = zoomInfos.currentViewBox;
- var previousPath = API.getPath();
- API.clear();
- API.setPath(previousPath);
- });
- };
-
- var API = {
-
- getPaper: function getPaper() {
- return paper;
- },
-
- setPath: function setPath(pathString) {
- /* redraw the path */
- var pathInfos = pathString.split(';');
- if (availableModes.indexOf(pathInfos[1]) === -1) {
- /* We assume then it is a free path */
- pathInfos[1] = "FREE";
- }
-
- this.setDrawingMode(pathInfos[1]);
- var pathData = pathInfos[0];
-
- if (!pathData.length) {
- return;
- }
- /* deal with path nomalization x = ImageWith/MaxXBound */
- var xRatio = mainImage.attr("width") / viewBoxBounds.X;
- var yRatio = mainImage.attr("height") / viewBoxBounds.Y;
-
- if (isNaN(xRatio) || isNaN(yRatio)) {
- new Error('Ratio should be a number.');
- }
-
- var transformMatrix = _snapsvg2.default.matrix(xRatio, 0, 0, yRatio, 0, 0);
- var path = _snapsvg2.default.path.map(pathData, transformMatrix).toString();
-
- /* always close path */
- if (path.search(/[z|Z]/gi) === -1) {
- path += "Z";
- }
- if (pathInfos.length >= 2) {
- if (pathInfos[1] === RECT_MODE) {
- handleRectPath(path);
- }
-
- if (pathInfos[1] === FREE_MODE) {
- handleFreePath(path);
- }
- }
- },
-
- setDrawingMode: function setDrawingMode(mode) {
-
- if (availableModes.indexOf(mode) !== -1) {
- drawingMode = mode;
- }
- if (typeof onChangeCallback === "function") {
- onChangeCallback(drawingMode);
- }
-
- this.clear();
- },
-
- clear: function clear() {
- /* clear previous path, point, handler */
- pointData.map(function (point) {
- if (point.handler) {
- point.handler.remove();
- }
- });
-
- /*clear path is exists*/
- if (drawing_path) {
- drawing_path.remove();
- }
- _utils.eventEmitter.emit("cutout:clear");
- pointData = [];
- startPoint = null;
- drawing_path = null;
- isDragged = false;
- enablePoint = true;
- pathIsClosed = false;
- ENABLE_NEW_NODE = true;
- },
-
- getShapeBBox: function getShapeBBox() {
- var currentPath = this.getPath();
- return _snapsvg2.default.path.getBBox(currentPath);
- },
-
- getShape: function getShape() {
- return this.getPath();
- },
-
- getPath: function getPath() {
- /* retourne le chemin */
- /* send path and BBox | implement edit and load path */
- var path = "";
- if (drawing_path) {
- if (drawingMode === RECT_MODE) {
- var bBox = drawing_path.getBBox();
- var transform = drawing_path.transform();
-
- if (!transform.global.length) {
- var shapePath = drawing_path.getBBox().path;
- } else {
-
- var shapeX = drawing_path.node.getAttribute('x');
- var shapeY = drawing_path.node.getAttribute('y');
- var transformMatrix = transform.totalMatrix;
- var fakeShape = paper.rect(transformMatrix.x(shapeX, shapeY), transformMatrix.y(shapeX, shapeY), bBox.width, bBox.height);
- shapePath = fakeShape.getBBox().path;
- fakeShape.remove();
- }
-
- path = _snapsvg2.default.path.toAbsolute(shapePath).toString();
- } else {
- path = drawing_path.attr('d');
- }
- }
-
- var xRatio = viewBoxBounds.X / mainImage.attr("width");
- var yRatio = viewBoxBounds.Y / mainImage.attr("height");
-
- if (isNaN(xRatio) || isNaN(yRatio)) {
- new Error('ratio should be a number.');
- }
-
- if (!path.length) {
- path = drawingMode === RECT_MODE ? ";RECT" : ";FREE";
- return path;
- }
- var normalizeMatrix = _snapsvg2.default.matrix(xRatio, 0, 0, yRatio, 0, 0);
-
- path = _snapsvg2.default.path.map(path, normalizeMatrix).toString();
-
- /* save the type */
- var type = drawingMode === RECT_MODE ? ";RECT" : ";FREE";
- if (path.search(/[z|Z]/gi) === -1) {
- path += " Z";
- }
-
- path += type;
-
- return path;
- }
- };
-
- /* change to a component */
- exports.default = {
-
- init: function init(config) {
- mainImage = jQuery(config.wrapperId).find('.main-image').eq(0);
- var cutCanvas = jQuery(config.wrapperId).find('.cut-canvas').eq(0);
- var path = jQuery(config.wrapperId).find('.image-path').eq(0);
-
- if (typeof config.onDrawingModeChange === 'function') {
- onChangeCallback = config.onDrawingModeChange;
- }
-
- if (!mainImage.length) {
- throw new Error("The main image Can't be found ...");
- }
-
- if (!cutCanvas.length) {
- var cutCanvas = jQuery('<svg version="1.1"></svg>').addClass('cut-canvas');
- jQuery(config.wrapperId).append(cutCanvas);
- cutCanvas.append(mainImage);
- }
-
- cutCanvas.css({
- marginLeft: 'auto',
- marginRight: 'auto',
- width: viewPort.width,
- height: viewPort.height
- });
- if (typeof config.readOnly === 'boolean' && config.readOnly === true) {
- readOnly = true;
- }
-
- paper = new _snapsvg2.default(cutCanvas.get(0));
-
- if (path.length) {
- jQuery(cutCanvas).append(path);
- var pathData = path.attr("d");
- API.setPath(pathData);
- path.remove();
- }
- /* enable zoom */
- attachZoomEvents();
- attachPointEvents(paper);
- attachRectEvents(paper);
-
- return API;
- }
- };
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
-
-/***/ },
-/* 82 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_LOCAL_MODULE_0__;var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*** IMPORTS FROM imports-loader ***/
- (function() {
- var fix = module.exports=0;
-
- // Snap.svg 0.4.0
- //
- // Copyright (c) 2013 – 2015 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- //
- // build: 2015-04-07
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- // ┌────────────────────────────────────────────────────────────┐ \\
- // │ Eve 0.4.2 - JavaScript Events Library │ \\
- // ├────────────────────────────────────────────────────────────┤ \\
- // │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\
- // └────────────────────────────────────────────────────────────┘ \\
-
- (function (glob) {
- var version = "0.4.2",
- has = "hasOwnProperty",
- separator = /[\.\/]/,
- comaseparator = /\s*,\s*/,
- wildcard = "*",
- fun = function () {},
- numsort = function (a, b) {
- return a - b;
- },
- current_event,
- stop,
- events = {n: {}},
- firstDefined = function () {
- for (var i = 0, ii = this.length; i < ii; i++) {
- if (typeof this[i] != "undefined") {
- return this[i];
- }
- }
- },
- lastDefined = function () {
- var i = this.length;
- while (--i) {
- if (typeof this[i] != "undefined") {
- return this[i];
- }
- }
- },
- /*\
- * eve
- [ method ]
-
- * Fires event with given `name`, given scope and other parameters.
-
- > Arguments
-
- - name (string) name of the *event*, dot (`.`) or slash (`/`) separated
- - scope (object) context for the event handlers
- - varargs (...) the rest of arguments will be sent to event handlers
-
- = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.
- \*/
- eve = function (name, scope) {
- name = String(name);
- var e = events,
- oldstop = stop,
- args = Array.prototype.slice.call(arguments, 2),
- listeners = eve.listeners(name),
- z = 0,
- f = false,
- l,
- indexed = [],
- queue = {},
- out = [],
- ce = current_event,
- errors = [];
- out.firstDefined = firstDefined;
- out.lastDefined = lastDefined;
- current_event = name;
- stop = 0;
- for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
- indexed.push(listeners[i].zIndex);
- if (listeners[i].zIndex < 0) {
- queue[listeners[i].zIndex] = listeners[i];
- }
- }
- indexed.sort(numsort);
- while (indexed[z] < 0) {
- l = queue[indexed[z++]];
- out.push(l.apply(scope, args));
- if (stop) {
- stop = oldstop;
- return out;
- }
- }
- for (i = 0; i < ii; i++) {
- l = listeners[i];
- if ("zIndex" in l) {
- if (l.zIndex == indexed[z]) {
- out.push(l.apply(scope, args));
- if (stop) {
- break;
- }
- do {
- z++;
- l = queue[indexed[z]];
- l && out.push(l.apply(scope, args));
- if (stop) {
- break;
- }
- } while (l)
- } else {
- queue[l.zIndex] = l;
- }
- } else {
- out.push(l.apply(scope, args));
- if (stop) {
- break;
- }
- }
- }
- stop = oldstop;
- current_event = ce;
- return out;
- };
- // Undocumented. Debug only.
- eve._events = events;
- /*\
- * eve.listeners
- [ method ]
-
- * Internal method which gives you array of all event handlers that will be triggered by the given `name`.
-
- > Arguments
-
- - name (string) name of the event, dot (`.`) or slash (`/`) separated
-
- = (array) array of event handlers
- \*/
- eve.listeners = function (name) {
- var names = name.split(separator),
- e = events,
- item,
- items,
- k,
- i,
- ii,
- j,
- jj,
- nes,
- es = [e],
- out = [];
- for (i = 0, ii = names.length; i < ii; i++) {
- nes = [];
- for (j = 0, jj = es.length; j < jj; j++) {
- e = es[j].n;
- items = [e[names[i]], e[wildcard]];
- k = 2;
- while (k--) {
- item = items[k];
- if (item) {
- nes.push(item);
- out = out.concat(item.f || []);
- }
- }
- }
- es = nes;
- }
- return out;
- };
-
- /*\
- * eve.on
- [ method ]
- **
- * Binds given event handler with a given name. You can use wildcards “`*`” for the names:
- | eve.on("*.under.*", f);
- | eve("mouse.under.floor"); // triggers f
- * Use @eve to trigger the listener.
- **
- > Arguments
- **
- - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- - f (function) event handler function
- **
- = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
- > Example:
- | eve.on("mouse", eatIt)(2);
- | eve.on("mouse", scream);
- | eve.on("mouse", catchIt)(1);
- * This will ensure that `catchIt` function will be called before `eatIt`.
- *
- * If you want to put your handler before non-indexed handlers, specify a negative value.
- * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
- \*/
- eve.on = function (name, f) {
- name = String(name);
- if (typeof f != "function") {
- return function () {};
- }
- var names = name.split(comaseparator);
- for (var i = 0, ii = names.length; i < ii; i++) {
- (function (name) {
- var names = name.split(separator),
- e = events,
- exist;
- for (var i = 0, ii = names.length; i < ii; i++) {
- e = e.n;
- e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});
- }
- e.f = e.f || [];
- for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
- exist = true;
- break;
- }
- !exist && e.f.push(f);
- }(names[i]));
- }
- return function (zIndex) {
- if (+zIndex == +zIndex) {
- f.zIndex = +zIndex;
- }
- };
- };
- /*\
- * eve.f
- [ method ]
- **
- * Returns function that will fire given event with optional arguments.
- * Arguments that will be passed to the result function will be also
- * concated to the list of final arguments.
- | el.onclick = eve.f("click", 1, 2);
- | eve.on("click", function (a, b, c) {
- | console.log(a, b, c); // 1, 2, [event object]
- | });
- > Arguments
- - event (string) event name
- - varargs (…) and any other arguments
- = (function) possible event handler function
- \*/
- eve.f = function (event) {
- var attrs = [].slice.call(arguments, 1);
- return function () {
- eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
- };
- };
- /*\
- * eve.stop
- [ method ]
- **
- * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.
- \*/
- eve.stop = function () {
- stop = 1;
- };
- /*\
- * eve.nt
- [ method ]
- **
- * Could be used inside event handler to figure out actual name of the event.
- **
- > Arguments
- **
- - subname (string) #optional subname of the event
- **
- = (string) name of the event, if `subname` is not specified
- * or
- = (boolean) `true`, if current event’s name contains `subname`
- \*/
- eve.nt = function (subname) {
- if (subname) {
- return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
- }
- return current_event;
- };
- /*\
- * eve.nts
- [ method ]
- **
- * Could be used inside event handler to figure out actual name of the event.
- **
- **
- = (array) names of the event
- \*/
- eve.nts = function () {
- return current_event.split(separator);
- };
- /*\
- * eve.off
- [ method ]
- **
- * Removes given function from the list of event listeners assigned to given name.
- * If no arguments specified all the events will be cleared.
- **
- > Arguments
- **
- - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- - f (function) event handler function
- \*/
- /*\
- * eve.unbind
- [ method ]
- **
- * See @eve.off
- \*/
- eve.off = eve.unbind = function (name, f) {
- if (!name) {
- eve._events = events = {n: {}};
- return;
- }
- var names = name.split(comaseparator);
- if (names.length > 1) {
- for (var i = 0, ii = names.length; i < ii; i++) {
- eve.off(names[i], f);
- }
- return;
- }
- names = name.split(separator);
- var e,
- key,
- splice,
- i, ii, j, jj,
- cur = [events];
- for (i = 0, ii = names.length; i < ii; i++) {
- for (j = 0; j < cur.length; j += splice.length - 2) {
- splice = [j, 1];
- e = cur[j].n;
- if (names[i] != wildcard) {
- if (e[names[i]]) {
- splice.push(e[names[i]]);
- }
- } else {
- for (key in e) if (e[has](key)) {
- splice.push(e[key]);
- }
- }
- cur.splice.apply(cur, splice);
- }
- }
- for (i = 0, ii = cur.length; i < ii; i++) {
- e = cur[i];
- while (e.n) {
- if (f) {
- if (e.f) {
- for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {
- e.f.splice(j, 1);
- break;
- }
- !e.f.length && delete e.f;
- }
- for (key in e.n) if (e.n[has](key) && e.n[key].f) {
- var funcs = e.n[key].f;
- for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {
- funcs.splice(j, 1);
- break;
- }
- !funcs.length && delete e.n[key].f;
- }
- } else {
- delete e.f;
- for (key in e.n) if (e.n[has](key) && e.n[key].f) {
- delete e.n[key].f;
- }
- }
- e = e.n;
- }
- }
- };
- /*\
- * eve.once
- [ method ]
- **
- * Binds given event handler with a given name to only run once then unbind itself.
- | eve.once("login", f);
- | eve("login"); // triggers f
- | eve("login"); // no listeners
- * Use @eve to trigger the listener.
- **
- > Arguments
- **
- - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- - f (function) event handler function
- **
- = (function) same return function as @eve.on
- \*/
- eve.once = function (name, f) {
- var f2 = function () {
- eve.unbind(name, f2);
- return f.apply(this, arguments);
- };
- return eve.on(name, f2);
- };
- /*\
- * eve.version
- [ property (string) ]
- **
- * Current version of the library.
- \*/
- eve.version = version;
- eve.toString = function () {
- return "You are running Eve " + version;
- };
- (typeof module != "undefined" && module.exports) ? (module.exports = eve) : ( true ? (!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_LOCAL_MODULE_0__ = (function() { return eve; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)))) : (glob.eve = eve));
- })(this);
-
- (function (glob, factory) {
- // AMD support
- if (true) {
- // Define as an anonymous module
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__WEBPACK_LOCAL_MODULE_0__], __WEBPACK_AMD_DEFINE_RESULT__ = function (eve) {
- return factory(glob, eve);
- }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else if (typeof exports != 'undefined') {
- // Next for Node.js or CommonJS
- var eve = require('eve');
- module.exports = factory(glob, eve);
- } else {
- // Browser globals (glob is window)
- // Snap adds itself to window
- factory(glob, glob.eve);
- }
- }(window || this, function (window, eve) {
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- var mina = (function (eve) {
- var animations = {},
- requestAnimFrame = window.requestAnimationFrame ||
- window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.oRequestAnimationFrame ||
- window.msRequestAnimationFrame ||
- function (callback) {
- setTimeout(callback, 16);
- },
- isArray = Array.isArray || function (a) {
- return a instanceof Array ||
- Object.prototype.toString.call(a) == "[object Array]";
- },
- idgen = 0,
- idprefix = "M" + (+new Date).toString(36),
- ID = function () {
- return idprefix + (idgen++).toString(36);
- },
- diff = function (a, b, A, B) {
- if (isArray(a)) {
- res = [];
- for (var i = 0, ii = a.length; i < ii; i++) {
- res[i] = diff(a[i], b, A[i], B);
- }
- return res;
- }
- var dif = (A - a) / (B - b);
- return function (bb) {
- return a + dif * (bb - b);
- };
- },
- timer = Date.now || function () {
- return +new Date;
- },
- sta = function (val) {
- var a = this;
- if (val == null) {
- return a.s;
- }
- var ds = a.s - val;
- a.b += a.dur * ds;
- a.B += a.dur * ds;
- a.s = val;
- },
- speed = function (val) {
- var a = this;
- if (val == null) {
- return a.spd;
- }
- a.spd = val;
- },
- duration = function (val) {
- var a = this;
- if (val == null) {
- return a.dur;
- }
- a.s = a.s * val / a.dur;
- a.dur = val;
- },
- stopit = function () {
- var a = this;
- delete animations[a.id];
- a.update();
- eve("mina.stop." + a.id, a);
- },
- pause = function () {
- var a = this;
- if (a.pdif) {
- return;
- }
- delete animations[a.id];
- a.update();
- a.pdif = a.get() - a.b;
- },
- resume = function () {
- var a = this;
- if (!a.pdif) {
- return;
- }
- a.b = a.get() - a.pdif;
- delete a.pdif;
- animations[a.id] = a;
- },
- update = function () {
- var a = this,
- res;
- if (isArray(a.start)) {
- res = [];
- for (var j = 0, jj = a.start.length; j < jj; j++) {
- res[j] = +a.start[j] +
- (a.end[j] - a.start[j]) * a.easing(a.s);
- }
- } else {
- res = +a.start + (a.end - a.start) * a.easing(a.s);
- }
- a.set(res);
- },
- frame = function () {
- var len = 0;
- for (var i in animations) if (animations.hasOwnProperty(i)) {
- var a = animations[i],
- b = a.get(),
- res;
- len++;
- a.s = (b - a.b) / (a.dur / a.spd);
- if (a.s >= 1) {
- delete animations[i];
- a.s = 1;
- len--;
- (function (a) {
- setTimeout(function () {
- eve("mina.finish." + a.id, a);
- });
- }(a));
- }
- a.update();
- }
- len && requestAnimFrame(frame);
- },
- /*\
- * mina
- [ method ]
- **
- * Generic animation of numbers
- **
- - a (number) start _slave_ number
- - A (number) end _slave_ number
- - b (number) start _master_ number (start time in general case)
- - B (number) end _master_ number (end time in gereal case)
- - get (function) getter of _master_ number (see @mina.time)
- - set (function) setter of _slave_ number
- - easing (function) #optional easing function, default is @mina.linear
- = (object) animation descriptor
- o {
- o id (string) animation id,
- o start (number) start _slave_ number,
- o end (number) end _slave_ number,
- o b (number) start _master_ number,
- o s (number) animation status (0..1),
- o dur (number) animation duration,
- o spd (number) animation speed,
- o get (function) getter of _master_ number (see @mina.time),
- o set (function) setter of _slave_ number,
- o easing (function) easing function, default is @mina.linear,
- o status (function) status getter/setter,
- o speed (function) speed getter/setter,
- o duration (function) duration getter/setter,
- o stop (function) animation stopper
- o pause (function) pauses the animation
- o resume (function) resumes the animation
- o update (function) calles setter with the right value of the animation
- o }
- \*/
- mina = function (a, A, b, B, get, set, easing) {
- var anim = {
- id: ID(),
- start: a,
- end: A,
- b: b,
- s: 0,
- dur: B - b,
- spd: 1,
- get: get,
- set: set,
- easing: easing || mina.linear,
- status: sta,
- speed: speed,
- duration: duration,
- stop: stopit,
- pause: pause,
- resume: resume,
- update: update
- };
- animations[anim.id] = anim;
- var len = 0, i;
- for (i in animations) if (animations.hasOwnProperty(i)) {
- len++;
- if (len == 2) {
- break;
- }
- }
- len == 1 && requestAnimFrame(frame);
- return anim;
- };
- /*\
- * mina.time
- [ method ]
- **
- * Returns the current time. Equivalent to:
- | function () {
- | return (new Date).getTime();
- | }
- \*/
- mina.time = timer;
- /*\
- * mina.getById
- [ method ]
- **
- * Returns an animation by its id
- - id (string) animation's id
- = (object) See @mina
- \*/
- mina.getById = function (id) {
- return animations[id] || null;
- };
-
- /*\
- * mina.linear
- [ method ]
- **
- * Default linear easing
- - n (number) input 0..1
- = (number) output 0..1
- \*/
- mina.linear = function (n) {
- return n;
- };
- /*\
- * mina.easeout
- [ method ]
- **
- * Easeout easing
- - n (number) input 0..1
- = (number) output 0..1
- \*/
- mina.easeout = function (n) {
- return Math.pow(n, 1.7);
- };
- /*\
- * mina.easein
- [ method ]
- **
- * Easein easing
- - n (number) input 0..1
- = (number) output 0..1
- \*/
- mina.easein = function (n) {
- return Math.pow(n, .48);
- };
- /*\
- * mina.easeinout
- [ method ]
- **
- * Easeinout easing
- - n (number) input 0..1
- = (number) output 0..1
- \*/
- mina.easeinout = function (n) {
- if (n == 1) {
- return 1;
- }
- if (n == 0) {
- return 0;
- }
- var q = .48 - n / 1.04,
- Q = Math.sqrt(.1734 + q * q),
- x = Q - q,
- X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
- y = -Q - q,
- Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
- t = X + Y + .5;
- return (1 - t) * 3 * t * t + t * t * t;
- };
- /*\
- * mina.backin
- [ method ]
- **
- * Backin easing
- - n (number) input 0..1
- = (number) output 0..1
- \*/
- mina.backin = function (n) {
- if (n == 1) {
- return 1;
- }
- var s = 1.70158;
- return n * n * ((s + 1) * n - s);
- };
- /*\
- * mina.backout
- [ method ]
- **
- * Backout easing
- - n (number) input 0..1
- = (number) output 0..1
- \*/
- mina.backout = function (n) {
- if (n == 0) {
- return 0;
- }
- n = n - 1;
- var s = 1.70158;
- return n * n * ((s + 1) * n + s) + 1;
- };
- /*\
- * mina.elastic
- [ method ]
- **
- * Elastic easing
- - n (number) input 0..1
- = (number) output 0..1
- \*/
- mina.elastic = function (n) {
- if (n == !!n) {
- return n;
- }
- return Math.pow(2, -10 * n) * Math.sin((n - .075) *
- (2 * Math.PI) / .3) + 1;
- };
- /*\
- * mina.bounce
- [ method ]
- **
- * Bounce easing
- - n (number) input 0..1
- = (number) output 0..1
- \*/
- mina.bounce = function (n) {
- var s = 7.5625,
- p = 2.75,
- l;
- if (n < (1 / p)) {
- l = s * n * n;
- } else {
- if (n < (2 / p)) {
- n -= (1.5 / p);
- l = s * n * n + .75;
- } else {
- if (n < (2.5 / p)) {
- n -= (2.25 / p);
- l = s * n * n + .9375;
- } else {
- n -= (2.625 / p);
- l = s * n * n + .984375;
- }
- }
- }
- return l;
- };
- window.mina = mina;
- return mina;
- })(typeof eve == "undefined" ? function () {} : eve);
- // Copyright (c) 2013 - 2015 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
-
- var Snap = (function(root) {
- Snap.version = "0.4.0";
- /*\
- * Snap
- [ method ]
- **
- * Creates a drawing surface or wraps existing SVG element.
- **
- - width (number|string) width of surface
- - height (number|string) height of surface
- * or
- - DOM (SVGElement) element to be wrapped into Snap structure
- * or
- - array (array) array of elements (will return set of elements)
- * or
- - query (string) CSS query selector
- = (object) @Element
- \*/
- function Snap(w, h) {
- if (w) {
- if (w.nodeType) {
- return wrap(w);
- }
- if (is(w, "array") && Snap.set) {
- return Snap.set.apply(Snap, w);
- }
- if (w instanceof Element) {
- return w;
- }
- if (h == null) {
- w = glob.doc.querySelector(String(w));
- return wrap(w);
- }
- }
- w = w == null ? "100%" : w;
- h = h == null ? "100%" : h;
- return new Paper(w, h);
- }
- Snap.toString = function () {
- return "Snap v" + this.version;
- };
- Snap._ = {};
- var glob = {
- win: root.window,
- doc: root.window.document
- };
- Snap._.glob = glob;
- var has = "hasOwnProperty",
- Str = String,
- toFloat = parseFloat,
- toInt = parseInt,
- math = Math,
- mmax = math.max,
- mmin = math.min,
- abs = math.abs,
- pow = math.pow,
- PI = math.PI,
- round = math.round,
- E = "",
- S = " ",
- objectToString = Object.prototype.toString,
- ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
- colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
- bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
- reURLValue = /^url\(#?([^)]+)\)$/,
- separator = Snap._.separator = /[,\s]+/,
- whitespace = /[\s]/g,
- commaSpaces = /[\s]*,[\s]*/,
- hsrg = {hs: 1, rg: 1},
- pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
- tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
- pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
- idgen = 0,
- idprefix = "S" + (+new Date).toString(36),
- ID = function (el) {
- return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
- },
- xlink = "http://www.w3.org/1999/xlink",
- xmlns = "http://www.w3.org/2000/svg",
- hub = {},
- URL = Snap.url = function (url) {
- return "url('#" + url + "')";
- };
-
- function $(el, attr) {
- if (attr) {
- if (el == "#text") {
- el = glob.doc.createTextNode(attr.text || attr["#text"] || "");
- }
- if (el == "#comment") {
- el = glob.doc.createComment(attr.text || attr["#text"] || "");
- }
- if (typeof el == "string") {
- el = $(el);
- }
- if (typeof attr == "string") {
- if (el.nodeType == 1) {
- if (attr.substring(0, 6) == "xlink:") {
- return el.getAttributeNS(xlink, attr.substring(6));
- }
- if (attr.substring(0, 4) == "xml:") {
- return el.getAttributeNS(xmlns, attr.substring(4));
- }
- return el.getAttribute(attr);
- } else if (attr == "text") {
- return el.nodeValue;
- } else {
- return null;
- }
- }
- if (el.nodeType == 1) {
- for (var key in attr) if (attr[has](key)) {
- var val = Str(attr[key]);
- if (val) {
- if (key.substring(0, 6) == "xlink:") {
- el.setAttributeNS(xlink, key.substring(6), val);
- } else if (key.substring(0, 4) == "xml:") {
- el.setAttributeNS(xmlns, key.substring(4), val);
- } else {
- el.setAttribute(key, val);
- }
- } else {
- el.removeAttribute(key);
- }
- }
- } else if ("text" in attr) {
- el.nodeValue = attr.text;
- }
- } else {
- el = glob.doc.createElementNS(xmlns, el);
- }
- return el;
- }
- Snap._.$ = $;
- Snap._.id = ID;
- function getAttrs(el) {
- var attrs = el.attributes,
- name,
- out = {};
- for (var i = 0; i < attrs.length; i++) {
- if (attrs[i].namespaceURI == xlink) {
- name = "xlink:";
- } else {
- name = "";
- }
- name += attrs[i].name;
- out[name] = attrs[i].textContent;
- }
- return out;
- }
- function is(o, type) {
- type = Str.prototype.toLowerCase.call(type);
- if (type == "finite") {
- return isFinite(o);
- }
- if (type == "array" &&
- (o instanceof Array || Array.isArray && Array.isArray(o))) {
- return true;
- }
- return (type == "null" && o === null) ||
- (type == typeof o && o !== null) ||
- (type == "object" && o === Object(o)) ||
- objectToString.call(o).slice(8, -1).toLowerCase() == type;
- }
- /*\
- * Snap.format
- [ method ]
- **
- * Replaces construction of type `{<name>}` to the corresponding argument
- **
- - token (string) string to format
- - json (object) object which properties are used as a replacement
- = (string) formatted string
- > Usage
- | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
- | paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", {
- | x: 10,
- | y: 20,
- | dim: {
- | width: 40,
- | height: 50,
- | "negative width": -40
- | }
- | }));
- \*/
- Snap.format = (function () {
- var tokenRegex = /\{([^\}]+)\}/g,
- objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches .xxxxx or ["xxxxx"] to run over object properties
- replacer = function (all, key, obj) {
- var res = obj;
- key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
- name = name || quotedName;
- if (res) {
- if (name in res) {
- res = res[name];
- }
- typeof res == "function" && isFunc && (res = res());
- }
- });
- res = (res == null || res == obj ? all : res) + "";
- return res;
- };
- return function (str, obj) {
- return Str(str).replace(tokenRegex, function (all, key) {
- return replacer(all, key, obj);
- });
- };
- })();
- function clone(obj) {
- if (typeof obj == "function" || Object(obj) !== obj) {
- return obj;
- }
- var res = new obj.constructor;
- for (var key in obj) if (obj[has](key)) {
- res[key] = clone(obj[key]);
- }
- return res;
- }
- Snap._.clone = clone;
- function repush(array, item) {
- for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {
- return array.push(array.splice(i, 1)[0]);
- }
- }
- function cacher(f, scope, postprocessor) {
- function newf() {
- var arg = Array.prototype.slice.call(arguments, 0),
- args = arg.join("\u2400"),
- cache = newf.cache = newf.cache || {},
- count = newf.count = newf.count || [];
- if (cache[has](args)) {
- repush(count, args);
- return postprocessor ? postprocessor(cache[args]) : cache[args];
- }
- count.length >= 1e3 && delete cache[count.shift()];
- count.push(args);
- cache[args] = f.apply(scope, arg);
- return postprocessor ? postprocessor(cache[args]) : cache[args];
- }
- return newf;
- }
- Snap._.cacher = cacher;
- function angle(x1, y1, x2, y2, x3, y3) {
- if (x3 == null) {
- var x = x1 - x2,
- y = y1 - y2;
- if (!x && !y) {
- return 0;
- }
- return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
- } else {
- return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
- }
- }
- function rad(deg) {
- return deg % 360 * PI / 180;
- }
- function deg(rad) {
- return rad * 180 / PI % 360;
- }
- function x_y() {
- return this.x + S + this.y;
- }
- function x_y_w_h() {
- return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
- }
-
- /*\
- * Snap.rad
- [ method ]
- **
- * Transform angle to radians
- - deg (number) angle in degrees
- = (number) angle in radians
- \*/
- Snap.rad = rad;
- /*\
- * Snap.deg
- [ method ]
- **
- * Transform angle to degrees
- - rad (number) angle in radians
- = (number) angle in degrees
- \*/
- Snap.deg = deg;
- /*\
- * Snap.sin
- [ method ]
- **
- * Equivalent to `Math.sin()` only works with degrees, not radians.
- - angle (number) angle in degrees
- = (number) sin
- \*/
- Snap.sin = function (angle) {
- return math.sin(Snap.rad(angle));
- };
- /*\
- * Snap.tan
- [ method ]
- **
- * Equivalent to `Math.tan()` only works with degrees, not radians.
- - angle (number) angle in degrees
- = (number) tan
- \*/
- Snap.tan = function (angle) {
- return math.tan(Snap.rad(angle));
- };
- /*\
- * Snap.cos
- [ method ]
- **
- * Equivalent to `Math.cos()` only works with degrees, not radians.
- - angle (number) angle in degrees
- = (number) cos
- \*/
- Snap.cos = function (angle) {
- return math.cos(Snap.rad(angle));
- };
- /*\
- * Snap.asin
- [ method ]
- **
- * Equivalent to `Math.asin()` only works with degrees, not radians.
- - num (number) value
- = (number) asin in degrees
- \*/
- Snap.asin = function (num) {
- return Snap.deg(math.asin(num));
- };
- /*\
- * Snap.acos
- [ method ]
- **
- * Equivalent to `Math.acos()` only works with degrees, not radians.
- - num (number) value
- = (number) acos in degrees
- \*/
- Snap.acos = function (num) {
- return Snap.deg(math.acos(num));
- };
- /*\
- * Snap.atan
- [ method ]
- **
- * Equivalent to `Math.atan()` only works with degrees, not radians.
- - num (number) value
- = (number) atan in degrees
- \*/
- Snap.atan = function (num) {
- return Snap.deg(math.atan(num));
- };
- /*\
- * Snap.atan2
- [ method ]
- **
- * Equivalent to `Math.atan2()` only works with degrees, not radians.
- - num (number) value
- = (number) atan2 in degrees
- \*/
- Snap.atan2 = function (num) {
- return Snap.deg(math.atan2(num));
- };
- /*\
- * Snap.angle
- [ method ]
- **
- * Returns an angle between two or three points
- > Parameters
- - x1 (number) x coord of first point
- - y1 (number) y coord of first point
- - x2 (number) x coord of second point
- - y2 (number) y coord of second point
- - x3 (number) #optional x coord of third point
- - y3 (number) #optional y coord of third point
- = (number) angle in degrees
- \*/
- Snap.angle = angle;
- /*\
- * Snap.len
- [ method ]
- **
- * Returns distance between two points
- > Parameters
- - x1 (number) x coord of first point
- - y1 (number) y coord of first point
- - x2 (number) x coord of second point
- - y2 (number) y coord of second point
- = (number) distance
- \*/
- Snap.len = function (x1, y1, x2, y2) {
- return Math.sqrt(Snap.len2(x1, y1, x2, y2));
- };
- /*\
- * Snap.len2
- [ method ]
- **
- * Returns squared distance between two points
- > Parameters
- - x1 (number) x coord of first point
- - y1 (number) y coord of first point
- - x2 (number) x coord of second point
- - y2 (number) y coord of second point
- = (number) distance
- \*/
- Snap.len2 = function (x1, y1, x2, y2) {
- return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
- };
- /*\
- * Snap.closestPoint
- [ method ]
- **
- * Returns closest point to a given one on a given path.
- > Parameters
- - path (Element) path element
- - x (number) x coord of a point
- - y (number) y coord of a point
- = (object) in format
- {
- x (number) x coord of the point on the path
- y (number) y coord of the point on the path
- length (number) length of the path to the point
- distance (number) distance from the given point to the path
- }
- \*/
- // Copied from http://bl.ocks.org/mbostock/8027637
- Snap.closestPoint = function (path, x, y) {
- function distance2(p) {
- var dx = p.x - x,
- dy = p.y - y;
- return dx * dx + dy * dy;
- }
- var pathNode = path.node,
- pathLength = pathNode.getTotalLength(),
- precision = pathLength / pathNode.pathSegList.numberOfItems * .125,
- best,
- bestLength,
- bestDistance = Infinity;
-
- // linear scan for coarse approximation
- for (var scan, scanLength = 0, scanDistance; scanLength <= pathLength; scanLength += precision) {
- if ((scanDistance = distance2(scan = pathNode.getPointAtLength(scanLength))) < bestDistance) {
- best = scan, bestLength = scanLength, bestDistance = scanDistance;
- }
- }
-
- // binary search for precise estimate
- precision *= .5;
- while (precision > .5) {
- var before,
- after,
- beforeLength,
- afterLength,
- beforeDistance,
- afterDistance;
- if ((beforeLength = bestLength - precision) >= 0 && (beforeDistance = distance2(before = pathNode.getPointAtLength(beforeLength))) < bestDistance) {
- best = before, bestLength = beforeLength, bestDistance = beforeDistance;
- } else if ((afterLength = bestLength + precision) <= pathLength && (afterDistance = distance2(after = pathNode.getPointAtLength(afterLength))) < bestDistance) {
- best = after, bestLength = afterLength, bestDistance = afterDistance;
- } else {
- precision *= .5;
- }
- }
-
- best = {
- x: best.x,
- y: best.y,
- length: bestLength,
- distance: Math.sqrt(bestDistance)
- };
- return best;
- }
- /*\
- * Snap.is
- [ method ]
- **
- * Handy replacement for the `typeof` operator
- - o (…) any object or primitive
- - type (string) name of the type, e.g., `string`, `function`, `number`, etc.
- = (boolean) `true` if given value is of given type
- \*/
- Snap.is = is;
- /*\
- * Snap.snapTo
- [ method ]
- **
- * Snaps given value to given grid
- - values (array|number) given array of values or step of the grid
- - value (number) value to adjust
- - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.
- = (number) adjusted value
- \*/
- Snap.snapTo = function (values, value, tolerance) {
- tolerance = is(tolerance, "finite") ? tolerance : 10;
- if (is(values, "array")) {
- var i = values.length;
- while (i--) if (abs(values[i] - value) <= tolerance) {
- return values[i];
- }
- } else {
- values = +values;
- var rem = value % values;
- if (rem < tolerance) {
- return value - rem;
- }
- if (rem > values - tolerance) {
- return value - rem + values;
- }
- }
- return value;
- };
- // Colour
- /*\
- * Snap.getRGB
- [ method ]
- **
- * Parses color string as RGB object
- - color (string) color string in one of the following formats:
- # <ul>
- # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>
- # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>
- # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>
- # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200, 100, 0)</code>)</li>
- # <li>rgba(•••, •••, •••, •••) — also with opacity</li>
- # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%, 175%, 0%)</code>)</li>
- # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>
- # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5, 0.25, 1)</code>)</li>
- # <li>hsba(•••, •••, •••, •••) — also with opacity</li>
- # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
- # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>
- # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5, 0.25, 0.5)</code>)</li>
- # <li>hsla(•••, •••, •••, •••) — also with opacity</li>
- # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
- # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>
- # </ul>
- * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.
- = (object) RGB object in the following format:
- o {
- o r (number) red,
- o g (number) green,
- o b (number) blue,
- o hex (string) color in HTML/CSS format: #••••••,
- o error (boolean) true if string can't be parsed
- o }
- \*/
- Snap.getRGB = cacher(function (colour) {
- if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
- return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
- }
- if (colour == "none") {
- return {r: -1, g: -1, b: -1, hex: "none", toString: rgbtoString};
- }
- !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
- if (!colour) {
- return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
- }
- var res,
- red,
- green,
- blue,
- opacity,
- t,
- values,
- rgb = colour.match(colourRegExp);
- if (rgb) {
- if (rgb[2]) {
- blue = toInt(rgb[2].substring(5), 16);
- green = toInt(rgb[2].substring(3, 5), 16);
- red = toInt(rgb[2].substring(1, 3), 16);
- }
- if (rgb[3]) {
- blue = toInt((t = rgb[3].charAt(3)) + t, 16);
- green = toInt((t = rgb[3].charAt(2)) + t, 16);
- red = toInt((t = rgb[3].charAt(1)) + t, 16);
- }
- if (rgb[4]) {
- values = rgb[4].split(commaSpaces);
- red = toFloat(values[0]);
- values[0].slice(-1) == "%" && (red *= 2.55);
- green = toFloat(values[1]);
- values[1].slice(-1) == "%" && (green *= 2.55);
- blue = toFloat(values[2]);
- values[2].slice(-1) == "%" && (blue *= 2.55);
- rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
- values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
- }
- if (rgb[5]) {
- values = rgb[5].split(commaSpaces);
- red = toFloat(values[0]);
- values[0].slice(-1) == "%" && (red /= 100);
- green = toFloat(values[1]);
- values[1].slice(-1) == "%" && (green /= 100);
- blue = toFloat(values[2]);
- values[2].slice(-1) == "%" && (blue /= 100);
- (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
- rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
- values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
- return Snap.hsb2rgb(red, green, blue, opacity);
- }
- if (rgb[6]) {
- values = rgb[6].split(commaSpaces);
- red = toFloat(values[0]);
- values[0].slice(-1) == "%" && (red /= 100);
- green = toFloat(values[1]);
- values[1].slice(-1) == "%" && (green /= 100);
- blue = toFloat(values[2]);
- values[2].slice(-1) == "%" && (blue /= 100);
- (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
- rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
- values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
- return Snap.hsl2rgb(red, green, blue, opacity);
- }
- red = mmin(math.round(red), 255);
- green = mmin(math.round(green), 255);
- blue = mmin(math.round(blue), 255);
- opacity = mmin(mmax(opacity, 0), 1);
- rgb = {r: red, g: green, b: blue, toString: rgbtoString};
- rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
- rgb.opacity = is(opacity, "finite") ? opacity : 1;
- return rgb;
- }
- return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
- }, Snap);
- /*\
- * Snap.hsb
- [ method ]
- **
- * Converts HSB values to a hex representation of the color
- - h (number) hue
- - s (number) saturation
- - b (number) value or brightness
- = (string) hex representation of the color
- \*/
- Snap.hsb = cacher(function (h, s, b) {
- return Snap.hsb2rgb(h, s, b).hex;
- });
- /*\
- * Snap.hsl
- [ method ]
- **
- * Converts HSL values to a hex representation of the color
- - h (number) hue
- - s (number) saturation
- - l (number) luminosity
- = (string) hex representation of the color
- \*/
- Snap.hsl = cacher(function (h, s, l) {
- return Snap.hsl2rgb(h, s, l).hex;
- });
- /*\
- * Snap.rgb
- [ method ]
- **
- * Converts RGB values to a hex representation of the color
- - r (number) red
- - g (number) green
- - b (number) blue
- = (string) hex representation of the color
- \*/
- Snap.rgb = cacher(function (r, g, b, o) {
- if (is(o, "finite")) {
- var round = math.round;
- return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
- }
- return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
- });
- var toHex = function (color) {
- var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
- red = "rgb(255, 0, 0)";
- toHex = cacher(function (color) {
- if (color.toLowerCase() == "red") {
- return red;
- }
- i.style.color = red;
- i.style.color = color;
- var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
- return out == red ? null : out;
- });
- return toHex(color);
- },
- hsbtoString = function () {
- return "hsb(" + [this.h, this.s, this.b] + ")";
- },
- hsltoString = function () {
- return "hsl(" + [this.h, this.s, this.l] + ")";
- },
- rgbtoString = function () {
- return this.opacity == 1 || this.opacity == null ?
- this.hex :
- "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
- },
- prepareRGB = function (r, g, b) {
- if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
- b = r.b;
- g = r.g;
- r = r.r;
- }
- if (g == null && is(r, string)) {
- var clr = Snap.getRGB(r);
- r = clr.r;
- g = clr.g;
- b = clr.b;
- }
- if (r > 1 || g > 1 || b > 1) {
- r /= 255;
- g /= 255;
- b /= 255;
- }
-
- return [r, g, b];
- },
- packageRGB = function (r, g, b, o) {
- r = math.round(r * 255);
- g = math.round(g * 255);
- b = math.round(b * 255);
- var rgb = {
- r: r,
- g: g,
- b: b,
- opacity: is(o, "finite") ? o : 1,
- hex: Snap.rgb(r, g, b),
- toString: rgbtoString
- };
- is(o, "finite") && (rgb.opacity = o);
- return rgb;
- };
- /*\
- * Snap.color
- [ method ]
- **
- * Parses the color string and returns an object featuring the color's component values
- - clr (string) color string in one of the supported formats (see @Snap.getRGB)
- = (object) Combined RGB/HSB object in the following format:
- o {
- o r (number) red,
- o g (number) green,
- o b (number) blue,
- o hex (string) color in HTML/CSS format: #••••••,
- o error (boolean) `true` if string can't be parsed,
- o h (number) hue,
- o s (number) saturation,
- o v (number) value (brightness),
- o l (number) lightness
- o }
- \*/
- Snap.color = function (clr) {
- var rgb;
- if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
- rgb = Snap.hsb2rgb(clr);
- clr.r = rgb.r;
- clr.g = rgb.g;
- clr.b = rgb.b;
- clr.opacity = 1;
- clr.hex = rgb.hex;
- } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
- rgb = Snap.hsl2rgb(clr);
- clr.r = rgb.r;
- clr.g = rgb.g;
- clr.b = rgb.b;
- clr.opacity = 1;
- clr.hex = rgb.hex;
- } else {
- if (is(clr, "string")) {
- clr = Snap.getRGB(clr);
- }
- if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
- rgb = Snap.rgb2hsl(clr);
- clr.h = rgb.h;
- clr.s = rgb.s;
- clr.l = rgb.l;
- rgb = Snap.rgb2hsb(clr);
- clr.v = rgb.b;
- } else {
- clr = {hex: "none"};
- clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
- clr.error = 1;
- }
- }
- clr.toString = rgbtoString;
- return clr;
- };
- /*\
- * Snap.hsb2rgb
- [ method ]
- **
- * Converts HSB values to an RGB object
- - h (number) hue
- - s (number) saturation
- - v (number) value or brightness
- = (object) RGB object in the following format:
- o {
- o r (number) red,
- o g (number) green,
- o b (number) blue,
- o hex (string) color in HTML/CSS format: #••••••
- o }
- \*/
- Snap.hsb2rgb = function (h, s, v, o) {
- if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
- v = h.b;
- s = h.s;
- o = h.o;
- h = h.h;
- }
- h *= 360;
- var R, G, B, X, C;
- h = (h % 360) / 60;
- C = v * s;
- X = C * (1 - abs(h % 2 - 1));
- R = G = B = v - C;
-
- h = ~~h;
- R += [C, X, 0, 0, X, C][h];
- G += [X, C, C, X, 0, 0][h];
- B += [0, 0, X, C, C, X][h];
- return packageRGB(R, G, B, o);
- };
- /*\
- * Snap.hsl2rgb
- [ method ]
- **
- * Converts HSL values to an RGB object
- - h (number) hue
- - s (number) saturation
- - l (number) luminosity
- = (object) RGB object in the following format:
- o {
- o r (number) red,
- o g (number) green,
- o b (number) blue,
- o hex (string) color in HTML/CSS format: #••••••
- o }
- \*/
- Snap.hsl2rgb = function (h, s, l, o) {
- if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
- l = h.l;
- s = h.s;
- h = h.h;
- }
- if (h > 1 || s > 1 || l > 1) {
- h /= 360;
- s /= 100;
- l /= 100;
- }
- h *= 360;
- var R, G, B, X, C;
- h = (h % 360) / 60;
- C = 2 * s * (l < .5 ? l : 1 - l);
- X = C * (1 - abs(h % 2 - 1));
- R = G = B = l - C / 2;
-
- h = ~~h;
- R += [C, X, 0, 0, X, C][h];
- G += [X, C, C, X, 0, 0][h];
- B += [0, 0, X, C, C, X][h];
- return packageRGB(R, G, B, o);
- };
- /*\
- * Snap.rgb2hsb
- [ method ]
- **
- * Converts RGB values to an HSB object
- - r (number) red
- - g (number) green
- - b (number) blue
- = (object) HSB object in the following format:
- o {
- o h (number) hue,
- o s (number) saturation,
- o b (number) brightness
- o }
- \*/
- Snap.rgb2hsb = function (r, g, b) {
- b = prepareRGB(r, g, b);
- r = b[0];
- g = b[1];
- b = b[2];
-
- var H, S, V, C;
- V = mmax(r, g, b);
- C = V - mmin(r, g, b);
- H = (C == 0 ? null :
- V == r ? (g - b) / C :
- V == g ? (b - r) / C + 2 :
- (r - g) / C + 4
- );
- H = ((H + 360) % 6) * 60 / 360;
- S = C == 0 ? 0 : C / V;
- return {h: H, s: S, b: V, toString: hsbtoString};
- };
- /*\
- * Snap.rgb2hsl
- [ method ]
- **
- * Converts RGB values to an HSL object
- - r (number) red
- - g (number) green
- - b (number) blue
- = (object) HSL object in the following format:
- o {
- o h (number) hue,
- o s (number) saturation,
- o l (number) luminosity
- o }
- \*/
- Snap.rgb2hsl = function (r, g, b) {
- b = prepareRGB(r, g, b);
- r = b[0];
- g = b[1];
- b = b[2];
-
- var H, S, L, M, m, C;
- M = mmax(r, g, b);
- m = mmin(r, g, b);
- C = M - m;
- H = (C == 0 ? null :
- M == r ? (g - b) / C :
- M == g ? (b - r) / C + 2 :
- (r - g) / C + 4);
- H = ((H + 360) % 6) * 60 / 360;
- L = (M + m) / 2;
- S = (C == 0 ? 0 :
- L < .5 ? C / (2 * L) :
- C / (2 - 2 * L));
- return {h: H, s: S, l: L, toString: hsltoString};
- };
-
- // Transformations
- /*\
- * Snap.parsePathString
- [ method ]
- **
- * Utility method
- **
- * Parses given path string into an array of arrays of path segments
- - pathString (string|array) path string or array of segments (in the last case it is returned straight away)
- = (array) array of segments
- \*/
- Snap.parsePathString = function (pathString) {
- if (!pathString) {
- return null;
- }
- var pth = Snap.path(pathString);
- if (pth.arr) {
- return Snap.path.clone(pth.arr);
- }
-
- var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},
- data = [];
- if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption
- data = Snap.path.clone(pathString);
- }
- if (!data.length) {
- Str(pathString).replace(pathCommand, function (a, b, c) {
- var params = [],
- name = b.toLowerCase();
- c.replace(pathValues, function (a, b) {
- b && params.push(+b);
- });
- if (name == "m" && params.length > 2) {
- data.push([b].concat(params.splice(0, 2)));
- name = "l";
- b = b == "m" ? "l" : "L";
- }
- if (name == "o" && params.length == 1) {
- data.push([b, params[0]]);
- }
- if (name == "r") {
- data.push([b].concat(params));
- } else while (params.length >= paramCounts[name]) {
- data.push([b].concat(params.splice(0, paramCounts[name])));
- if (!paramCounts[name]) {
- break;
- }
- }
- });
- }
- data.toString = Snap.path.toString;
- pth.arr = Snap.path.clone(data);
- return data;
- };
- /*\
- * Snap.parseTransformString
- [ method ]
- **
- * Utility method
- **
- * Parses given transform string into an array of transformations
- - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)
- = (array) array of transformations
- \*/
- var parseTransformString = Snap.parseTransformString = function (TString) {
- if (!TString) {
- return null;
- }
- var paramCounts = {r: 3, s: 4, t: 2, m: 6},
- data = [];
- if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
- data = Snap.path.clone(TString);
- }
- if (!data.length) {
- Str(TString).replace(tCommand, function (a, b, c) {
- var params = [],
- name = b.toLowerCase();
- c.replace(pathValues, function (a, b) {
- b && params.push(+b);
- });
- data.push([b].concat(params));
- });
- }
- data.toString = Snap.path.toString;
- return data;
- };
- function svgTransform2string(tstr) {
- var res = [];
- tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function (all, name, params) {
- params = params.split(/\s*,\s*|\s+/);
- if (name == "rotate" && params.length == 1) {
- params.push(0, 0);
- }
- if (name == "scale") {
- if (params.length > 2) {
- params = params.slice(0, 2);
- } else if (params.length == 2) {
- params.push(0, 0);
- }
- if (params.length == 1) {
- params.push(params[0], 0, 0);
- }
- }
- if (name == "skewX") {
- res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
- } else if (name == "skewY") {
- res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
- } else {
- res.push([name.charAt(0)].concat(params));
- }
- return all;
- });
- return res;
- }
- Snap._.svgTransform2string = svgTransform2string;
- Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
- function transform2matrix(tstr, bbox) {
- var tdata = parseTransformString(tstr),
- m = new Snap.Matrix;
- if (tdata) {
- for (var i = 0, ii = tdata.length; i < ii; i++) {
- var t = tdata[i],
- tlen = t.length,
- command = Str(t[0]).toLowerCase(),
- absolute = t[0] != command,
- inver = absolute ? m.invert() : 0,
- x1,
- y1,
- x2,
- y2,
- bb;
- if (command == "t" && tlen == 2){
- m.translate(t[1], 0);
- } else if (command == "t" && tlen == 3) {
- if (absolute) {
- x1 = inver.x(0, 0);
- y1 = inver.y(0, 0);
- x2 = inver.x(t[1], t[2]);
- y2 = inver.y(t[1], t[2]);
- m.translate(x2 - x1, y2 - y1);
- } else {
- m.translate(t[1], t[2]);
- }
- } else if (command == "r") {
- if (tlen == 2) {
- bb = bb || bbox;
- m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
- } else if (tlen == 4) {
- if (absolute) {
- x2 = inver.x(t[2], t[3]);
- y2 = inver.y(t[2], t[3]);
- m.rotate(t[1], x2, y2);
- } else {
- m.rotate(t[1], t[2], t[3]);
- }
- }
- } else if (command == "s") {
- if (tlen == 2 || tlen == 3) {
- bb = bb || bbox;
- m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
- } else if (tlen == 4) {
- if (absolute) {
- x2 = inver.x(t[2], t[3]);
- y2 = inver.y(t[2], t[3]);
- m.scale(t[1], t[1], x2, y2);
- } else {
- m.scale(t[1], t[1], t[2], t[3]);
- }
- } else if (tlen == 5) {
- if (absolute) {
- x2 = inver.x(t[3], t[4]);
- y2 = inver.y(t[3], t[4]);
- m.scale(t[1], t[2], x2, y2);
- } else {
- m.scale(t[1], t[2], t[3], t[4]);
- }
- }
- } else if (command == "m" && tlen == 7) {
- m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
- }
- }
- }
- return m;
- }
- Snap._.transform2matrix = transform2matrix;
- Snap._unit2px = unit2px;
- var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
- function (a, b) {
- var adown = a.nodeType == 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a == bup || !!(bup && bup.nodeType == 1 && (
- adown.contains ?
- adown.contains(bup) :
- a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
- ));
- } :
- function (a, b) {
- if (b) {
- while (b) {
- b = b.parentNode;
- if (b == a) {
- return true;
- }
- }
- }
- return false;
- };
- function getSomeDefs(el) {
- var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
- (el.node.parentNode && wrap(el.node.parentNode)) ||
- Snap.select("svg") ||
- Snap(0, 0),
- pdefs = p.select("defs"),
- defs = pdefs == null ? false : pdefs.node;
- if (!defs) {
- defs = make("defs", p.node).node;
- }
- return defs;
- }
- function getSomeSVG(el) {
- return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
- }
- Snap._.getSomeDefs = getSomeDefs;
- Snap._.getSomeSVG = getSomeSVG;
- function unit2px(el, name, value) {
- var svg = getSomeSVG(el).node,
- out = {},
- mgr = svg.querySelector(".svg---mgr");
- if (!mgr) {
- mgr = $("rect");
- $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, "class": "svg---mgr", fill: "none"});
- svg.appendChild(mgr);
- }
- function getW(val) {
- if (val == null) {
- return E;
- }
- if (val == +val) {
- return val;
- }
- $(mgr, {width: val});
- try {
- return mgr.getBBox().width;
- } catch (e) {
- return 0;
- }
- }
- function getH(val) {
- if (val == null) {
- return E;
- }
- if (val == +val) {
- return val;
- }
- $(mgr, {height: val});
- try {
- return mgr.getBBox().height;
- } catch (e) {
- return 0;
- }
- }
- function set(nam, f) {
- if (name == null) {
- out[nam] = f(el.attr(nam) || 0);
- } else if (nam == name) {
- out = f(value == null ? el.attr(nam) || 0 : value);
- }
- }
- switch (el.type) {
- case "rect":
- set("rx", getW);
- set("ry", getH);
- case "image":
- set("width", getW);
- set("height", getH);
- case "text":
- set("x", getW);
- set("y", getH);
- break;
- case "circle":
- set("cx", getW);
- set("cy", getH);
- set("r", getW);
- break;
- case "ellipse":
- set("cx", getW);
- set("cy", getH);
- set("rx", getW);
- set("ry", getH);
- break;
- case "line":
- set("x1", getW);
- set("x2", getW);
- set("y1", getH);
- set("y2", getH);
- break;
- case "marker":
- set("refX", getW);
- set("markerWidth", getW);
- set("refY", getH);
- set("markerHeight", getH);
- break;
- case "radialGradient":
- set("fx", getW);
- set("fy", getH);
- break;
- case "tspan":
- set("dx", getW);
- set("dy", getH);
- break;
- default:
- set(name, getW);
- }
- svg.removeChild(mgr);
- return out;
- }
- /*\
- * Snap.select
- [ method ]
- **
- * Wraps a DOM element specified by CSS selector as @Element
- - query (string) CSS selector of the element
- = (Element) the current element
- \*/
- Snap.select = function (query) {
- query = Str(query).replace(/([^\\]):/g, "$1\\:");
- return wrap(glob.doc.querySelector(query));
- };
- /*\
- * Snap.selectAll
- [ method ]
- **
- * Wraps DOM elements specified by CSS selector as set or array of @Element
- - query (string) CSS selector of the element
- = (Element) the current element
- \*/
- Snap.selectAll = function (query) {
- var nodelist = glob.doc.querySelectorAll(query),
- set = (Snap.set || Array)();
- for (var i = 0; i < nodelist.length; i++) {
- set.push(wrap(nodelist[i]));
- }
- return set;
- };
-
- function add2group(list) {
- if (!is(list, "array")) {
- list = Array.prototype.slice.call(arguments, 0);
- }
- var i = 0,
- j = 0,
- node = this.node;
- while (this[i]) delete this[i++];
- for (i = 0; i < list.length; i++) {
- if (list[i].type == "set") {
- list[i].forEach(function (el) {
- node.appendChild(el.node);
- });
- } else {
- node.appendChild(list[i].node);
- }
- }
- var children = node.childNodes;
- for (i = 0; i < children.length; i++) {
- this[j++] = wrap(children[i]);
- }
- return this;
- }
- // Hub garbage collector every 10s
- setInterval(function () {
- for (var key in hub) if (hub[has](key)) {
- var el = hub[key],
- node = el.node;
- if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
- delete hub[key];
- }
- }
- }, 1e4);
- function Element(el) {
- if (el.snap in hub) {
- return hub[el.snap];
- }
- var svg;
- try {
- svg = el.ownerSVGElement;
- } catch(e) {}
- /*\
- * Element.node
- [ property (object) ]
- **
- * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
- > Usage
- | // draw a circle at coordinate 10,10 with radius of 10
- | var c = paper.circle(10, 10, 10);
- | c.node.onclick = function () {
- | c.attr("fill", "red");
- | };
- \*/
- this.node = el;
- if (svg) {
- this.paper = new Paper(svg);
- }
- /*\
- * Element.type
- [ property (string) ]
- **
- * SVG tag name of the given element.
- \*/
- this.type = el.tagName || el.nodeName;
- var id = this.id = ID(this);
- this.anims = {};
- this._ = {
- transform: []
- };
- el.snap = id;
- hub[id] = this;
- if (this.type == "g") {
- this.add = add2group;
- }
- if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {
- for (var method in Paper.prototype) if (Paper.prototype[has](method)) {
- this[method] = Paper.prototype[method];
- }
- }
- }
- /*\
- * Element.attr
- [ method ]
- **
- * Gets or sets given attributes of the element.
- **
- - params (object) contains key-value pairs of attributes you want to set
- * or
- - param (string) name of the attribute
- = (Element) the current element
- * or
- = (string) value of attribute
- > Usage
- | el.attr({
- | fill: "#fc0",
- | stroke: "#000",
- | strokeWidth: 2, // CamelCase...
- | "fill-opacity": 0.5, // or dash-separated names
- | width: "*=2" // prefixed values
- | });
- | console.log(el.attr("fill")); // #fc0
- * Prefixed values in format `"+=10"` supported. All four operations
- * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`
- * and `-`: `"+=2em"`.
- \*/
- Element.prototype.attr = function (params, value) {
- var el = this,
- node = el.node;
- if (!params) {
- if (node.nodeType != 1) {
- return {
- text: node.nodeValue
- };
- }
- var attr = node.attributes,
- out = {};
- for (var i = 0, ii = attr.length; i < ii; i++) {
- out[attr[i].nodeName] = attr[i].nodeValue;
- }
- return out;
- }
- if (is(params, "string")) {
- if (arguments.length > 1) {
- var json = {};
- json[params] = value;
- params = json;
- } else {
- return eve("snap.util.getattr." + params, el).firstDefined();
- }
- }
- for (var att in params) {
- if (params[has](att)) {
- eve("snap.util.attr." + att, el, params[att]);
- }
- }
- return el;
- };
- /*\
- * Snap.parse
- [ method ]
- **
- * Parses SVG fragment and converts it into a @Fragment
- **
- - svg (string) SVG string
- = (Fragment) the @Fragment
- \*/
- Snap.parse = function (svg) {
- var f = glob.doc.createDocumentFragment(),
- full = true,
- div = glob.doc.createElement("div");
- svg = Str(svg);
- if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
- svg = "<svg>" + svg + "</svg>";
- full = false;
- }
- div.innerHTML = svg;
- svg = div.getElementsByTagName("svg")[0];
- if (svg) {
- if (full) {
- f = svg;
- } else {
- while (svg.firstChild) {
- f.appendChild(svg.firstChild);
- }
- }
- }
- return new Fragment(f);
- };
- function Fragment(frag) {
- this.node = frag;
- }
- /*\
- * Snap.fragment
- [ method ]
- **
- * Creates a DOM fragment from a given list of elements or strings
- **
- - varargs (…) SVG string
- = (Fragment) the @Fragment
- \*/
- Snap.fragment = function () {
- var args = Array.prototype.slice.call(arguments, 0),
- f = glob.doc.createDocumentFragment();
- for (var i = 0, ii = args.length; i < ii; i++) {
- var item = args[i];
- if (item.node && item.node.nodeType) {
- f.appendChild(item.node);
- }
- if (item.nodeType) {
- f.appendChild(item);
- }
- if (typeof item == "string") {
- f.appendChild(Snap.parse(item).node);
- }
- }
- return new Fragment(f);
- };
-
- function make(name, parent) {
- var res = $(name);
- parent.appendChild(res);
- var el = wrap(res);
- return el;
- }
- function Paper(w, h) {
- var res,
- desc,
- defs,
- proto = Paper.prototype;
- if (w && w.tagName == "svg") {
- if (w.snap in hub) {
- return hub[w.snap];
- }
- var doc = w.ownerDocument;
- res = new Element(w);
- desc = w.getElementsByTagName("desc")[0];
- defs = w.getElementsByTagName("defs")[0];
- if (!desc) {
- desc = $("desc");
- desc.appendChild(doc.createTextNode("Created with Snap"));
- res.node.appendChild(desc);
- }
- if (!defs) {
- defs = $("defs");
- res.node.appendChild(defs);
- }
- res.defs = defs;
- for (var key in proto) if (proto[has](key)) {
- res[key] = proto[key];
- }
- res.paper = res.root = res;
- } else {
- res = make("svg", glob.doc.body);
- $(res.node, {
- height: h,
- version: 1.1,
- width: w,
- xmlns: xmlns
- });
- }
- return res;
- }
- function wrap(dom) {
- if (!dom) {
- return dom;
- }
- if (dom instanceof Element || dom instanceof Fragment) {
- return dom;
- }
- if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
- return new Paper(dom);
- }
- if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
- return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
- }
- return new Element(dom);
- }
-
- Snap._.make = make;
- Snap._.wrap = wrap;
- /*\
- * Paper.el
- [ method ]
- **
- * Creates an element on paper with a given name and no attributes
- **
- - name (string) tag name
- - attr (object) attributes
- = (Element) the current element
- > Usage
- | var c = paper.circle(10, 10, 10); // is the same as...
- | var c = paper.el("circle").attr({
- | cx: 10,
- | cy: 10,
- | r: 10
- | });
- | // and the same as
- | var c = paper.el("circle", {
- | cx: 10,
- | cy: 10,
- | r: 10
- | });
- \*/
- Paper.prototype.el = function (name, attr) {
- var el = make(name, this.node);
- attr && el.attr(attr);
- return el;
- };
- /*\
- * Element.children
- [ method ]
- **
- * Returns array of all the children of the element.
- = (array) array of Elements
- \*/
- Element.prototype.children = function () {
- var out = [],
- ch = this.node.childNodes;
- for (var i = 0, ii = ch.length; i < ii; i++) {
- out[i] = Snap(ch[i]);
- }
- return out;
- };
- function jsonFiller(root, o) {
- for (var i = 0, ii = root.length; i < ii; i++) {
- var item = {
- type: root[i].type,
- attr: root[i].attr()
- },
- children = root[i].children();
- o.push(item);
- if (children.length) {
- jsonFiller(children, item.childNodes = []);
- }
- }
- }
- /*\
- * Element.toJSON
- [ method ]
- **
- * Returns object representation of the given element and all its children.
- = (object) in format
- o {
- o type (string) this.type,
- o attr (object) attributes map,
- o childNodes (array) optional array of children in the same format
- o }
- \*/
- Element.prototype.toJSON = function () {
- var out = [];
- jsonFiller([this], out);
- return out[0];
- };
- // default
- eve.on("snap.util.getattr", function () {
- var att = eve.nt();
- att = att.substring(att.lastIndexOf(".") + 1);
- var css = att.replace(/[A-Z]/g, function (letter) {
- return "-" + letter.toLowerCase();
- });
- if (cssAttr[has](css)) {
- return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
- } else {
- return $(this.node, att);
- }
- });
- var cssAttr = {
- "alignment-baseline": 0,
- "baseline-shift": 0,
- "clip": 0,
- "clip-path": 0,
- "clip-rule": 0,
- "color": 0,
- "color-interpolation": 0,
- "color-interpolation-filters": 0,
- "color-profile": 0,
- "color-rendering": 0,
- "cursor": 0,
- "direction": 0,
- "display": 0,
- "dominant-baseline": 0,
- "enable-background": 0,
- "fill": 0,
- "fill-opacity": 0,
- "fill-rule": 0,
- "filter": 0,
- "flood-color": 0,
- "flood-opacity": 0,
- "font": 0,
- "font-family": 0,
- "font-size": 0,
- "font-size-adjust": 0,
- "font-stretch": 0,
- "font-style": 0,
- "font-variant": 0,
- "font-weight": 0,
- "glyph-orientation-horizontal": 0,
- "glyph-orientation-vertical": 0,
- "image-rendering": 0,
- "kerning": 0,
- "letter-spacing": 0,
- "lighting-color": 0,
- "marker": 0,
- "marker-end": 0,
- "marker-mid": 0,
- "marker-start": 0,
- "mask": 0,
- "opacity": 0,
- "overflow": 0,
- "pointer-events": 0,
- "shape-rendering": 0,
- "stop-color": 0,
- "stop-opacity": 0,
- "stroke": 0,
- "stroke-dasharray": 0,
- "stroke-dashoffset": 0,
- "stroke-linecap": 0,
- "stroke-linejoin": 0,
- "stroke-miterlimit": 0,
- "stroke-opacity": 0,
- "stroke-width": 0,
- "text-anchor": 0,
- "text-decoration": 0,
- "text-rendering": 0,
- "unicode-bidi": 0,
- "visibility": 0,
- "word-spacing": 0,
- "writing-mode": 0
- };
-
- eve.on("snap.util.attr", function (value) {
- var att = eve.nt(),
- attr = {};
- att = att.substring(att.lastIndexOf(".") + 1);
- attr[att] = value;
- var style = att.replace(/-(\w)/gi, function (all, letter) {
- return letter.toUpperCase();
- }),
- css = att.replace(/[A-Z]/g, function (letter) {
- return "-" + letter.toLowerCase();
- });
- if (cssAttr[has](css)) {
- this.node.style[style] = value == null ? E : value;
- } else {
- $(this.node, attr);
- }
- });
- (function (proto) {}(Paper.prototype));
-
- // simple ajax
- /*\
- * Snap.ajax
- [ method ]
- **
- * Simple implementation of Ajax
- **
- - url (string) URL
- - postData (object|string) data for post request
- - callback (function) callback
- - scope (object) #optional scope of callback
- * or
- - url (string) URL
- - callback (function) callback
- - scope (object) #optional scope of callback
- = (XMLHttpRequest) the XMLHttpRequest object, just in case
- \*/
- Snap.ajax = function (url, postData, callback, scope){
- var req = new XMLHttpRequest,
- id = ID();
- if (req) {
- if (is(postData, "function")) {
- scope = callback;
- callback = postData;
- postData = null;
- } else if (is(postData, "object")) {
- var pd = [];
- for (var key in postData) if (postData.hasOwnProperty(key)) {
- pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
- }
- postData = pd.join("&");
- }
- req.open((postData ? "POST" : "GET"), url, true);
- if (postData) {
- req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- }
- if (callback) {
- eve.once("snap.ajax." + id + ".0", callback);
- eve.once("snap.ajax." + id + ".200", callback);
- eve.once("snap.ajax." + id + ".304", callback);
- }
- req.onreadystatechange = function() {
- if (req.readyState != 4) return;
- eve("snap.ajax." + id + "." + req.status, scope, req);
- };
- if (req.readyState == 4) {
- return req;
- }
- req.send(postData);
- return req;
- }
- };
- /*\
- * Snap.load
- [ method ]
- **
- * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)
- **
- - url (string) URL
- - callback (function) callback
- - scope (object) #optional scope of callback
- \*/
- Snap.load = function (url, callback, scope) {
- Snap.ajax(url, function (req) {
- var f = Snap.parse(req.responseText);
- scope ? callback.call(scope, f) : callback(f);
- });
- };
- var getOffset = function (elem) {
- var box = elem.getBoundingClientRect(),
- doc = elem.ownerDocument,
- body = doc.body,
- docElem = doc.documentElement,
- clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
- top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,
- left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
- return {
- y: top,
- x: left
- };
- };
- /*\
- * Snap.getElementByPoint
- [ method ]
- **
- * Returns you topmost element under given point.
- **
- = (object) Snap element object
- - x (number) x coordinate from the top left corner of the window
- - y (number) y coordinate from the top left corner of the window
- > Usage
- | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});
- \*/
- Snap.getElementByPoint = function (x, y) {
- var paper = this,
- svg = paper.canvas,
- target = glob.doc.elementFromPoint(x, y);
- if (glob.win.opera && target.tagName == "svg") {
- var so = getOffset(target),
- sr = target.createSVGRect();
- sr.x = x - so.x;
- sr.y = y - so.y;
- sr.width = sr.height = 1;
- var hits = target.getIntersectionList(sr, null);
- if (hits.length) {
- target = hits[hits.length - 1];
- }
- }
- if (!target) {
- return null;
- }
- return wrap(target);
- };
- /*\
- * Snap.plugin
- [ method ]
- **
- * Let you write plugins. You pass in a function with five arguments, like this:
- | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
- | Snap.newmethod = function () {};
- | Element.prototype.newmethod = function () {};
- | Paper.prototype.newmethod = function () {};
- | });
- * Inside the function you have access to all main objects (and their
- * prototypes). This allow you to extend anything you want.
- **
- - f (function) your plugin body
- \*/
- Snap.plugin = function (f) {
- f(Snap, Element, Paper, glob, Fragment);
- };
- glob.win.Snap = Snap;
- return Snap;
- }(window || this));
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
- var elproto = Element.prototype,
- is = Snap.is,
- Str = String,
- unit2px = Snap._unit2px,
- $ = Snap._.$,
- make = Snap._.make,
- getSomeDefs = Snap._.getSomeDefs,
- has = "hasOwnProperty",
- wrap = Snap._.wrap;
- /*\
- * Element.getBBox
- [ method ]
- **
- * Returns the bounding box descriptor for the given element
- **
- = (object) bounding box descriptor:
- o {
- o cx: (number) x of the center,
- o cy: (number) x of the center,
- o h: (number) height,
- o height: (number) height,
- o path: (string) path command for the box,
- o r0: (number) radius of a circle that fully encloses the box,
- o r1: (number) radius of the smallest circle that can be enclosed,
- o r2: (number) radius of the largest circle that can be enclosed,
- o vb: (string) box as a viewbox command,
- o w: (number) width,
- o width: (number) width,
- o x2: (number) x of the right side,
- o x: (number) x of the left side,
- o y2: (number) y of the bottom edge,
- o y: (number) y of the top edge
- o }
- \*/
- elproto.getBBox = function (isWithoutTransform) {
- if (!Snap.Matrix || !Snap.path) {
- return this.node.getBBox();
- }
- var el = this,
- m = new Snap.Matrix;
- if (el.removed) {
- return Snap._.box();
- }
- while (el.type == "use") {
- if (!isWithoutTransform) {
- m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
- }
- if (el.original) {
- el = el.original;
- } else {
- var href = el.attr("xlink:href");
- el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
- }
- }
- var _ = el._,
- pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
- try {
- if (isWithoutTransform) {
- _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
- return Snap._.box(_.bboxwt);
- } else {
- el.realPath = pathfinder(el);
- el.matrix = el.transform().localMatrix;
- _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
- return Snap._.box(_.bbox);
- }
- } catch (e) {
- // Firefox doesn’t give you bbox of hidden element
- return Snap._.box();
- }
- };
- var propString = function () {
- return this.string;
- };
- function extractTransform(el, tstr) {
- if (tstr == null) {
- var doReturn = true;
- if (el.type == "linearGradient" || el.type == "radialGradient") {
- tstr = el.node.getAttribute("gradientTransform");
- } else if (el.type == "pattern") {
- tstr = el.node.getAttribute("patternTransform");
- } else {
- tstr = el.node.getAttribute("transform");
- }
- if (!tstr) {
- return new Snap.Matrix;
- }
- tstr = Snap._.svgTransform2string(tstr);
- } else {
- if (!Snap._.rgTransform.test(tstr)) {
- tstr = Snap._.svgTransform2string(tstr);
- } else {
- tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
- }
- if (is(tstr, "array")) {
- tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
- }
- el._.transform = tstr;
- }
- var m = Snap._.transform2matrix(tstr, el.getBBox(1));
- if (doReturn) {
- return m;
- } else {
- el.matrix = m;
- }
- }
- /*\
- * Element.transform
- [ method ]
- **
- * Gets or sets transformation of the element
- **
- - tstr (string) transform string in Snap or SVG format
- = (Element) the current element
- * or
- = (object) transformation descriptor:
- o {
- o string (string) transform string,
- o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,
- o localMatrix (Matrix) matrix of transformations applied only to the element,
- o diffMatrix (Matrix) matrix of difference between global and local transformations,
- o global (string) global transformation as string,
- o local (string) local transformation as string,
- o toString (function) returns `string` property
- o }
- \*/
- elproto.transform = function (tstr) {
- var _ = this._;
- if (tstr == null) {
- var papa = this,
- global = new Snap.Matrix(this.node.getCTM()),
- local = extractTransform(this),
- ms = [local],
- m = new Snap.Matrix,
- i,
- localString = local.toTransformString(),
- string = Str(local) == Str(this.matrix) ?
- Str(_.transform) : localString;
- while (papa.type != "svg" && (papa = papa.parent())) {
- ms.push(extractTransform(papa));
- }
- i = ms.length;
- while (i--) {
- m.add(ms[i]);
- }
- return {
- string: string,
- globalMatrix: global,
- totalMatrix: m,
- localMatrix: local,
- diffMatrix: global.clone().add(local.invert()),
- global: global.toTransformString(),
- total: m.toTransformString(),
- local: localString,
- toString: propString
- };
- }
- if (tstr instanceof Snap.Matrix) {
- this.matrix = tstr;
- this._.transform = tstr.toTransformString();
- } else {
- extractTransform(this, tstr);
- }
-
- if (this.node) {
- if (this.type == "linearGradient" || this.type == "radialGradient") {
- $(this.node, {gradientTransform: this.matrix});
- } else if (this.type == "pattern") {
- $(this.node, {patternTransform: this.matrix});
- } else {
- $(this.node, {transform: this.matrix});
- }
- }
-
- return this;
- };
- /*\
- * Element.parent
- [ method ]
- **
- * Returns the element's parent
- **
- = (Element) the parent element
- \*/
- elproto.parent = function () {
- return wrap(this.node.parentNode);
- };
- /*\
- * Element.append
- [ method ]
- **
- * Appends the given element to current one
- **
- - el (Element|Set) element to append
- = (Element) the parent element
- \*/
- /*\
- * Element.add
- [ method ]
- **
- * See @Element.append
- \*/
- elproto.append = elproto.add = function (el) {
- if (el) {
- if (el.type == "set") {
- var it = this;
- el.forEach(function (el) {
- it.add(el);
- });
- return this;
- }
- el = wrap(el);
- this.node.appendChild(el.node);
- el.paper = this.paper;
- }
- return this;
- };
- /*\
- * Element.appendTo
- [ method ]
- **
- * Appends the current element to the given one
- **
- - el (Element) parent element to append to
- = (Element) the child element
- \*/
- elproto.appendTo = function (el) {
- if (el) {
- el = wrap(el);
- el.append(this);
- }
- return this;
- };
- /*\
- * Element.prepend
- [ method ]
- **
- * Prepends the given element to the current one
- **
- - el (Element) element to prepend
- = (Element) the parent element
- \*/
- elproto.prepend = function (el) {
- if (el) {
- if (el.type == "set") {
- var it = this,
- first;
- el.forEach(function (el) {
- if (first) {
- first.after(el);
- } else {
- it.prepend(el);
- }
- first = el;
- });
- return this;
- }
- el = wrap(el);
- var parent = el.parent();
- this.node.insertBefore(el.node, this.node.firstChild);
- this.add && this.add();
- el.paper = this.paper;
- this.parent() && this.parent().add();
- parent && parent.add();
- }
- return this;
- };
- /*\
- * Element.prependTo
- [ method ]
- **
- * Prepends the current element to the given one
- **
- - el (Element) parent element to prepend to
- = (Element) the child element
- \*/
- elproto.prependTo = function (el) {
- el = wrap(el);
- el.prepend(this);
- return this;
- };
- /*\
- * Element.before
- [ method ]
- **
- * Inserts given element before the current one
- **
- - el (Element) element to insert
- = (Element) the parent element
- \*/
- elproto.before = function (el) {
- if (el.type == "set") {
- var it = this;
- el.forEach(function (el) {
- var parent = el.parent();
- it.node.parentNode.insertBefore(el.node, it.node);
- parent && parent.add();
- });
- this.parent().add();
- return this;
- }
- el = wrap(el);
- var parent = el.parent();
- this.node.parentNode.insertBefore(el.node, this.node);
- this.parent() && this.parent().add();
- parent && parent.add();
- el.paper = this.paper;
- return this;
- };
- /*\
- * Element.after
- [ method ]
- **
- * Inserts given element after the current one
- **
- - el (Element) element to insert
- = (Element) the parent element
- \*/
- elproto.after = function (el) {
- el = wrap(el);
- var parent = el.parent();
- if (this.node.nextSibling) {
- this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
- } else {
- this.node.parentNode.appendChild(el.node);
- }
- this.parent() && this.parent().add();
- parent && parent.add();
- el.paper = this.paper;
- return this;
- };
- /*\
- * Element.insertBefore
- [ method ]
- **
- * Inserts the element after the given one
- **
- - el (Element) element next to whom insert to
- = (Element) the parent element
- \*/
- elproto.insertBefore = function (el) {
- el = wrap(el);
- var parent = this.parent();
- el.node.parentNode.insertBefore(this.node, el.node);
- this.paper = el.paper;
- parent && parent.add();
- el.parent() && el.parent().add();
- return this;
- };
- /*\
- * Element.insertAfter
- [ method ]
- **
- * Inserts the element after the given one
- **
- - el (Element) element next to whom insert to
- = (Element) the parent element
- \*/
- elproto.insertAfter = function (el) {
- el = wrap(el);
- var parent = this.parent();
- el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
- this.paper = el.paper;
- parent && parent.add();
- el.parent() && el.parent().add();
- return this;
- };
- /*\
- * Element.remove
- [ method ]
- **
- * Removes element from the DOM
- = (Element) the detached element
- \*/
- elproto.remove = function () {
- var parent = this.parent();
- this.node.parentNode && this.node.parentNode.removeChild(this.node);
- delete this.paper;
- this.removed = true;
- parent && parent.add();
- return this;
- };
- /*\
- * Element.select
- [ method ]
- **
- * Gathers the nested @Element matching the given set of CSS selectors
- **
- - query (string) CSS selector
- = (Element) result of query selection
- \*/
- elproto.select = function (query) {
- query = Str(query).replace(/([^\\]):/g, "$1\\:");
- return wrap(this.node.querySelector(query));
- };
- /*\
- * Element.selectAll
- [ method ]
- **
- * Gathers nested @Element objects matching the given set of CSS selectors
- **
- - query (string) CSS selector
- = (Set|array) result of query selection
- \*/
- elproto.selectAll = function (query) {
- var nodelist = this.node.querySelectorAll(query),
- set = (Snap.set || Array)();
- for (var i = 0; i < nodelist.length; i++) {
- set.push(wrap(nodelist[i]));
- }
- return set;
- };
- /*\
- * Element.asPX
- [ method ]
- **
- * Returns given attribute of the element as a `px` value (not %, em, etc.)
- **
- - attr (string) attribute name
- - value (string) #optional attribute value
- = (Element) result of query selection
- \*/
- elproto.asPX = function (attr, value) {
- if (value == null) {
- value = this.attr(attr);
- }
- return +unit2px(this, attr, value);
- };
- // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.
- /*\
- * Element.use
- [ method ]
- **
- * Creates a `<use>` element linked to the current element
- **
- = (Element) the `<use>` element
- \*/
- elproto.use = function () {
- var use,
- id = this.node.id;
- if (!id) {
- id = this.id;
- $(this.node, {
- id: id
- });
- }
- if (this.type == "linearGradient" || this.type == "radialGradient" ||
- this.type == "pattern") {
- use = make(this.type, this.node.parentNode);
- } else {
- use = make("use", this.node.parentNode);
- }
- $(use.node, {
- "xlink:href": "#" + id
- });
- use.original = this;
- return use;
- };
- function fixids(el) {
- var els = el.selectAll("*"),
- it,
- url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
- ids = [],
- uses = {};
- function urltest(it, name) {
- var val = $(it.node, name);
- val = val && val.match(url);
- val = val && val[2];
- if (val && val.charAt() == "#") {
- val = val.substring(1);
- } else {
- return;
- }
- if (val) {
- uses[val] = (uses[val] || []).concat(function (id) {
- var attr = {};
- attr[name] = URL(id);
- $(it.node, attr);
- });
- }
- }
- function linktest(it) {
- var val = $(it.node, "xlink:href");
- if (val && val.charAt() == "#") {
- val = val.substring(1);
- } else {
- return;
- }
- if (val) {
- uses[val] = (uses[val] || []).concat(function (id) {
- it.attr("xlink:href", "#" + id);
- });
- }
- }
- for (var i = 0, ii = els.length; i < ii; i++) {
- it = els[i];
- urltest(it, "fill");
- urltest(it, "stroke");
- urltest(it, "filter");
- urltest(it, "mask");
- urltest(it, "clip-path");
- linktest(it);
- var oldid = $(it.node, "id");
- if (oldid) {
- $(it.node, {id: it.id});
- ids.push({
- old: oldid,
- id: it.id
- });
- }
- }
- for (i = 0, ii = ids.length; i < ii; i++) {
- var fs = uses[ids[i].old];
- if (fs) {
- for (var j = 0, jj = fs.length; j < jj; j++) {
- fs[j](ids[i].id);
- }
- }
- }
- }
- /*\
- * Element.clone
- [ method ]
- **
- * Creates a clone of the element and inserts it after the element
- **
- = (Element) the clone
- \*/
- elproto.clone = function () {
- var clone = wrap(this.node.cloneNode(true));
- if ($(clone.node, "id")) {
- $(clone.node, {id: clone.id});
- }
- fixids(clone);
- clone.insertAfter(this);
- return clone;
- };
- /*\
- * Element.toDefs
- [ method ]
- **
- * Moves element to the shared `<defs>` area
- **
- = (Element) the element
- \*/
- elproto.toDefs = function () {
- var defs = getSomeDefs(this);
- defs.appendChild(this.node);
- return this;
- };
- /*\
- * Element.toPattern
- [ method ]
- **
- * Creates a `<pattern>` element from the current element
- **
- * To create a pattern you have to specify the pattern rect:
- - x (string|number)
- - y (string|number)
- - width (string|number)
- - height (string|number)
- = (Element) the `<pattern>` element
- * You can use pattern later on as an argument for `fill` attribute:
- | var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
- | fill: "none",
- | stroke: "#bada55",
- | strokeWidth: 5
- | }).pattern(0, 0, 10, 10),
- | c = paper.circle(200, 200, 100);
- | c.attr({
- | fill: p
- | });
- \*/
- elproto.pattern = elproto.toPattern = function (x, y, width, height) {
- var p = make("pattern", getSomeDefs(this));
- if (x == null) {
- x = this.getBBox();
- }
- if (is(x, "object") && "x" in x) {
- y = x.y;
- width = x.width;
- height = x.height;
- x = x.x;
- }
- $(p.node, {
- x: x,
- y: y,
- width: width,
- height: height,
- patternUnits: "userSpaceOnUse",
- id: p.id,
- viewBox: [x, y, width, height].join(" ")
- });
- p.node.appendChild(this.node);
- return p;
- };
- // SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.
- // SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?
- /*\
- * Element.marker
- [ method ]
- **
- * Creates a `<marker>` element from the current element
- **
- * To create a marker you have to specify the bounding rect and reference point:
- - x (number)
- - y (number)
- - width (number)
- - height (number)
- - refX (number)
- - refY (number)
- = (Element) the `<marker>` element
- * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.
- \*/
- // TODO add usage for markers
- elproto.marker = function (x, y, width, height, refX, refY) {
- var p = make("marker", getSomeDefs(this));
- if (x == null) {
- x = this.getBBox();
- }
- if (is(x, "object") && "x" in x) {
- y = x.y;
- width = x.width;
- height = x.height;
- refX = x.refX || x.cx;
- refY = x.refY || x.cy;
- x = x.x;
- }
- $(p.node, {
- viewBox: [x, y, width, height].join(" "),
- markerWidth: width,
- markerHeight: height,
- orient: "auto",
- refX: refX || 0,
- refY: refY || 0,
- id: p.id
- });
- p.node.appendChild(this.node);
- return p;
- };
- // animation
- function slice(from, to, f) {
- return function (arr) {
- var res = arr.slice(from, to);
- if (res.length == 1) {
- res = res[0];
- }
- return f ? f(res) : res;
- };
- }
- var Animation = function (attr, ms, easing, callback) {
- if (typeof easing == "function" && !easing.length) {
- callback = easing;
- easing = mina.linear;
- }
- this.attr = attr;
- this.dur = ms;
- easing && (this.easing = easing);
- callback && (this.callback = callback);
- };
- Snap._.Animation = Animation;
- /*\
- * Snap.animation
- [ method ]
- **
- * Creates an animation object
- **
- - attr (object) attributes of final destination
- - duration (number) duration of the animation, in milliseconds
- - easing (function) #optional one of easing functions of @mina or custom one
- - callback (function) #optional callback function that fires when animation ends
- = (object) animation object
- \*/
- Snap.animation = function (attr, ms, easing, callback) {
- return new Animation(attr, ms, easing, callback);
- };
- /*\
- * Element.inAnim
- [ method ]
- **
- * Returns a set of animations that may be able to manipulate the current element
- **
- = (object) in format:
- o {
- o anim (object) animation object,
- o mina (object) @mina object,
- o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,
- o status (function) gets or sets the status of the animation,
- o stop (function) stops the animation
- o }
- \*/
- elproto.inAnim = function () {
- var el = this,
- res = [];
- for (var id in el.anims) if (el.anims[has](id)) {
- (function (a) {
- res.push({
- anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
- mina: a,
- curStatus: a.status(),
- status: function (val) {
- return a.status(val);
- },
- stop: function () {
- a.stop();
- }
- });
- }(el.anims[id]));
- }
- return res;
- };
- /*\
- * Snap.animate
- [ method ]
- **
- * Runs generic animation of one number into another with a caring function
- **
- - from (number|array) number or array of numbers
- - to (number|array) number or array of numbers
- - setter (function) caring function that accepts one number argument
- - duration (number) duration, in milliseconds
- - easing (function) #optional easing function from @mina or custom
- - callback (function) #optional callback function to execute when animation ends
- = (object) animation object in @mina format
- o {
- o id (string) animation id, consider it read-only,
- o duration (function) gets or sets the duration of the animation,
- o easing (function) easing,
- o speed (function) gets or sets the speed of the animation,
- o status (function) gets or sets the status of the animation,
- o stop (function) stops the animation
- o }
- | var rect = Snap().rect(0, 0, 10, 10);
- | Snap.animate(0, 10, function (val) {
- | rect.attr({
- | x: val
- | });
- | }, 1000);
- | // in given context is equivalent to
- | rect.animate({x: 10}, 1000);
- \*/
- Snap.animate = function (from, to, setter, ms, easing, callback) {
- if (typeof easing == "function" && !easing.length) {
- callback = easing;
- easing = mina.linear;
- }
- var now = mina.time(),
- anim = mina(from, to, now, now + ms, mina.time, setter, easing);
- callback && eve.once("mina.finish." + anim.id, callback);
- return anim;
- };
- /*\
- * Element.stop
- [ method ]
- **
- * Stops all the animations for the current element
- **
- = (Element) the current element
- \*/
- elproto.stop = function () {
- var anims = this.inAnim();
- for (var i = 0, ii = anims.length; i < ii; i++) {
- anims[i].stop();
- }
- return this;
- };
- /*\
- * Element.animate
- [ method ]
- **
- * Animates the given attributes of the element
- **
- - attrs (object) key-value pairs of destination attributes
- - duration (number) duration of the animation in milliseconds
- - easing (function) #optional easing function from @mina or custom
- - callback (function) #optional callback function that executes when the animation ends
- = (Element) the current element
- \*/
- elproto.animate = function (attrs, ms, easing, callback) {
- if (typeof easing == "function" && !easing.length) {
- callback = easing;
- easing = mina.linear;
- }
- if (attrs instanceof Animation) {
- callback = attrs.callback;
- easing = attrs.easing;
- ms = easing.dur;
- attrs = attrs.attr;
- }
- var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,
- el = this;
- for (var key in attrs) if (attrs[has](key)) {
- if (el.equal) {
- eq = el.equal(key, Str(attrs[key]));
- from = eq.from;
- to = eq.to;
- f = eq.f;
- } else {
- from = +el.attr(key);
- to = +attrs[key];
- }
- var len = is(from, "array") ? from.length : 1;
- keys[key] = slice(fkeys.length, fkeys.length + len, f);
- fkeys = fkeys.concat(from);
- tkeys = tkeys.concat(to);
- }
- var now = mina.time(),
- anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {
- var attr = {};
- for (var key in keys) if (keys[has](key)) {
- attr[key] = keys[key](val);
- }
- el.attr(attr);
- }, easing);
- el.anims[anim.id] = anim;
- anim._attrs = attrs;
- anim._callback = callback;
- eve("snap.animcreated." + el.id, anim);
- eve.once("mina.finish." + anim.id, function () {
- delete el.anims[anim.id];
- callback && callback.call(el);
- });
- eve.once("mina.stop." + anim.id, function () {
- delete el.anims[anim.id];
- });
- return el;
- };
- var eldata = {};
- /*\
- * Element.data
- [ method ]
- **
- * Adds or retrieves given value associated with given key. (Don’t confuse
- * with `data-` attributes)
- *
- * See also @Element.removeData
- - key (string) key to store data
- - value (any) #optional value to store
- = (object) @Element
- * or, if value is not specified:
- = (any) value
- > Usage
- | for (var i = 0, i < 5, i++) {
- | paper.circle(10 + 15 * i, 10, 10)
- | .attr({fill: "#000"})
- | .data("i", i)
- | .click(function () {
- | alert(this.data("i"));
- | });
- | }
- \*/
- elproto.data = function (key, value) {
- var data = eldata[this.id] = eldata[this.id] || {};
- if (arguments.length == 0){
- eve("snap.data.get." + this.id, this, data, null);
- return data;
- }
- if (arguments.length == 1) {
- if (Snap.is(key, "object")) {
- for (var i in key) if (key[has](i)) {
- this.data(i, key[i]);
- }
- return this;
- }
- eve("snap.data.get." + this.id, this, data[key], key);
- return data[key];
- }
- data[key] = value;
- eve("snap.data.set." + this.id, this, value, key);
- return this;
- };
- /*\
- * Element.removeData
- [ method ]
- **
- * Removes value associated with an element by given key.
- * If key is not provided, removes all the data of the element.
- - key (string) #optional key
- = (object) @Element
- \*/
- elproto.removeData = function (key) {
- if (key == null) {
- eldata[this.id] = {};
- } else {
- eldata[this.id] && delete eldata[this.id][key];
- }
- return this;
- };
- /*\
- * Element.outerSVG
- [ method ]
- **
- * Returns SVG code for the element, equivalent to HTML's `outerHTML`.
- *
- * See also @Element.innerSVG
- = (string) SVG code for the element
- \*/
- /*\
- * Element.toString
- [ method ]
- **
- * See @Element.outerSVG
- \*/
- elproto.outerSVG = elproto.toString = toString(1);
- /*\
- * Element.innerSVG
- [ method ]
- **
- * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`
- = (string) SVG code for the element
- \*/
- elproto.innerSVG = toString();
- function toString(type) {
- return function () {
- var res = type ? "<" + this.type : "",
- attr = this.node.attributes,
- chld = this.node.childNodes;
- if (type) {
- for (var i = 0, ii = attr.length; i < ii; i++) {
- res += " " + attr[i].name + '="' +
- attr[i].value.replace(/"/g, '\\"') + '"';
- }
- }
- if (chld.length) {
- type && (res += ">");
- for (i = 0, ii = chld.length; i < ii; i++) {
- if (chld[i].nodeType == 3) {
- res += chld[i].nodeValue;
- } else if (chld[i].nodeType == 1) {
- res += wrap(chld[i]).toString();
- }
- }
- type && (res += "</" + this.type + ">");
- } else {
- type && (res += "/>");
- }
- return res;
- };
- }
- elproto.toDataURL = function () {
- if (window && window.btoa) {
- var bb = this.getBBox(),
- svg = Snap.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>', {
- x: +bb.x.toFixed(3),
- y: +bb.y.toFixed(3),
- width: +bb.width.toFixed(3),
- height: +bb.height.toFixed(3),
- contents: this.outerSVG()
- });
- return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
- }
- };
- /*\
- * Fragment.select
- [ method ]
- **
- * See @Element.select
- \*/
- Fragment.prototype.select = elproto.select;
- /*\
- * Fragment.selectAll
- [ method ]
- **
- * See @Element.selectAll
- \*/
- Fragment.prototype.selectAll = elproto.selectAll;
- });
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
- var objectToString = Object.prototype.toString,
- Str = String,
- math = Math,
- E = "";
- function Matrix(a, b, c, d, e, f) {
- if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
- this.a = a.a;
- this.b = a.b;
- this.c = a.c;
- this.d = a.d;
- this.e = a.e;
- this.f = a.f;
- return;
- }
- if (a != null) {
- this.a = +a;
- this.b = +b;
- this.c = +c;
- this.d = +d;
- this.e = +e;
- this.f = +f;
- } else {
- this.a = 1;
- this.b = 0;
- this.c = 0;
- this.d = 1;
- this.e = 0;
- this.f = 0;
- }
- }
- (function (matrixproto) {
- /*\
- * Matrix.add
- [ method ]
- **
- * Adds the given matrix to existing one
- - a (number)
- - b (number)
- - c (number)
- - d (number)
- - e (number)
- - f (number)
- * or
- - matrix (object) @Matrix
- \*/
- matrixproto.add = function (a, b, c, d, e, f) {
- var out = [[], [], []],
- m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],
- matrix = [[a, c, e], [b, d, f], [0, 0, 1]],
- x, y, z, res;
-
- if (a && a instanceof Matrix) {
- matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];
- }
-
- for (x = 0; x < 3; x++) {
- for (y = 0; y < 3; y++) {
- res = 0;
- for (z = 0; z < 3; z++) {
- res += m[x][z] * matrix[z][y];
- }
- out[x][y] = res;
- }
- }
- this.a = out[0][0];
- this.b = out[1][0];
- this.c = out[0][1];
- this.d = out[1][1];
- this.e = out[0][2];
- this.f = out[1][2];
- return this;
- };
- /*\
- * Matrix.invert
- [ method ]
- **
- * Returns an inverted version of the matrix
- = (object) @Matrix
- \*/
- matrixproto.invert = function () {
- var me = this,
- x = me.a * me.d - me.b * me.c;
- return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
- };
- /*\
- * Matrix.clone
- [ method ]
- **
- * Returns a copy of the matrix
- = (object) @Matrix
- \*/
- matrixproto.clone = function () {
- return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
- };
- /*\
- * Matrix.translate
- [ method ]
- **
- * Translate the matrix
- - x (number) horizontal offset distance
- - y (number) vertical offset distance
- \*/
- matrixproto.translate = function (x, y) {
- return this.add(1, 0, 0, 1, x, y);
- };
- /*\
- * Matrix.scale
- [ method ]
- **
- * Scales the matrix
- - x (number) amount to be scaled, with `1` resulting in no change
- - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)
- - cx (number) #optional horizontal origin point from which to scale
- - cy (number) #optional vertical origin point from which to scale
- * Default cx, cy is the middle point of the element.
- \*/
- matrixproto.scale = function (x, y, cx, cy) {
- y == null && (y = x);
- (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
- this.add(x, 0, 0, y, 0, 0);
- (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
- return this;
- };
- /*\
- * Matrix.rotate
- [ method ]
- **
- * Rotates the matrix
- - a (number) angle of rotation, in degrees
- - x (number) horizontal origin point from which to rotate
- - y (number) vertical origin point from which to rotate
- \*/
- matrixproto.rotate = function (a, x, y) {
- a = Snap.rad(a);
- x = x || 0;
- y = y || 0;
- var cos = +math.cos(a).toFixed(9),
- sin = +math.sin(a).toFixed(9);
- this.add(cos, sin, -sin, cos, x, y);
- return this.add(1, 0, 0, 1, -x, -y);
- };
- /*\
- * Matrix.x
- [ method ]
- **
- * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y
- - x (number)
- - y (number)
- = (number) x
- \*/
- matrixproto.x = function (x, y) {
- return x * this.a + y * this.c + this.e;
- };
- /*\
- * Matrix.y
- [ method ]
- **
- * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x
- - x (number)
- - y (number)
- = (number) y
- \*/
- matrixproto.y = function (x, y) {
- return x * this.b + y * this.d + this.f;
- };
- matrixproto.get = function (i) {
- return +this[Str.fromCharCode(97 + i)].toFixed(4);
- };
- matrixproto.toString = function () {
- return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
- };
- matrixproto.offset = function () {
- return [this.e.toFixed(4), this.f.toFixed(4)];
- };
- function norm(a) {
- return a[0] * a[0] + a[1] * a[1];
- }
- function normalize(a) {
- var mag = math.sqrt(norm(a));
- a[0] && (a[0] /= mag);
- a[1] && (a[1] /= mag);
- }
- /*\
- * Matrix.determinant
- [ method ]
- **
- * Finds determinant of the given matrix.
- = (number) determinant
- \*/
- matrixproto.determinant = function () {
- return this.a * this.d - this.b * this.c;
- };
- /*\
- * Matrix.split
- [ method ]
- **
- * Splits matrix into primitive transformations
- = (object) in format:
- o dx (number) translation by x
- o dy (number) translation by y
- o scalex (number) scale by x
- o scaley (number) scale by y
- o shear (number) shear
- o rotate (number) rotation in deg
- o isSimple (boolean) could it be represented via simple transformations
- \*/
- matrixproto.split = function () {
- var out = {};
- // translation
- out.dx = this.e;
- out.dy = this.f;
-
- // scale and shear
- var row = [[this.a, this.c], [this.b, this.d]];
- out.scalex = math.sqrt(norm(row[0]));
- normalize(row[0]);
-
- out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
- row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
-
- out.scaley = math.sqrt(norm(row[1]));
- normalize(row[1]);
- out.shear /= out.scaley;
-
- if (this.determinant() < 0) {
- out.scalex = -out.scalex;
- }
-
- // rotation
- var sin = -row[0][1],
- cos = row[1][1];
- if (cos < 0) {
- out.rotate = Snap.deg(math.acos(cos));
- if (sin < 0) {
- out.rotate = 360 - out.rotate;
- }
- } else {
- out.rotate = Snap.deg(math.asin(sin));
- }
-
- out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
- out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
- out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
- return out;
- };
- /*\
- * Matrix.toTransformString
- [ method ]
- **
- * Returns transform string that represents given matrix
- = (string) transform string
- \*/
- matrixproto.toTransformString = function (shorter) {
- var s = shorter || this.split();
- if (!+s.shear.toFixed(9)) {
- s.scalex = +s.scalex.toFixed(4);
- s.scaley = +s.scaley.toFixed(4);
- s.rotate = +s.rotate.toFixed(4);
- return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
- (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
- (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
- } else {
- return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
- }
- };
- })(Matrix.prototype);
- /*\
- * Snap.Matrix
- [ method ]
- **
- * Matrix constructor, extend on your own risk.
- * To create matrices use @Snap.matrix.
- \*/
- Snap.Matrix = Matrix;
- /*\
- * Snap.matrix
- [ method ]
- **
- * Utility method
- **
- * Returns a matrix based on the given parameters
- - a (number)
- - b (number)
- - c (number)
- - d (number)
- - e (number)
- - f (number)
- * or
- - svgMatrix (SVGMatrix)
- = (object) @Matrix
- \*/
- Snap.matrix = function (a, b, c, d, e, f) {
- return new Matrix(a, b, c, d, e, f);
- };
- });
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
- var has = "hasOwnProperty",
- make = Snap._.make,
- wrap = Snap._.wrap,
- is = Snap.is,
- getSomeDefs = Snap._.getSomeDefs,
- reURLValue = /^url\(#?([^)]+)\)$/,
- $ = Snap._.$,
- URL = Snap.url,
- Str = String,
- separator = Snap._.separator,
- E = "";
- // Attributes event handlers
- eve.on("snap.util.attr.mask", function (value) {
- if (value instanceof Element || value instanceof Fragment) {
- eve.stop();
- if (value instanceof Fragment && value.node.childNodes.length == 1) {
- value = value.node.firstChild;
- getSomeDefs(this).appendChild(value);
- value = wrap(value);
- }
- if (value.type == "mask") {
- var mask = value;
- } else {
- mask = make("mask", getSomeDefs(this));
- mask.node.appendChild(value.node);
- }
- !mask.node.id && $(mask.node, {
- id: mask.id
- });
- $(this.node, {
- mask: URL(mask.id)
- });
- }
- });
- (function (clipIt) {
- eve.on("snap.util.attr.clip", clipIt);
- eve.on("snap.util.attr.clip-path", clipIt);
- eve.on("snap.util.attr.clipPath", clipIt);
- }(function (value) {
- if (value instanceof Element || value instanceof Fragment) {
- eve.stop();
- if (value.type == "clipPath") {
- var clip = value;
- } else {
- clip = make("clipPath", getSomeDefs(this));
- clip.node.appendChild(value.node);
- !clip.node.id && $(clip.node, {
- id: clip.id
- });
- }
- $(this.node, {
- "clip-path": URL(clip.node.id || clip.id)
- });
- }
- }));
- function fillStroke(name) {
- return function (value) {
- eve.stop();
- if (value instanceof Fragment && value.node.childNodes.length == 1 &&
- (value.node.firstChild.tagName == "radialGradient" ||
- value.node.firstChild.tagName == "linearGradient" ||
- value.node.firstChild.tagName == "pattern")) {
- value = value.node.firstChild;
- getSomeDefs(this).appendChild(value);
- value = wrap(value);
- }
- if (value instanceof Element) {
- if (value.type == "radialGradient" || value.type == "linearGradient"
- || value.type == "pattern") {
- if (!value.node.id) {
- $(value.node, {
- id: value.id
- });
- }
- var fill = URL(value.node.id);
- } else {
- fill = value.attr(name);
- }
- } else {
- fill = Snap.color(value);
- if (fill.error) {
- var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
- if (grad) {
- if (!grad.node.id) {
- $(grad.node, {
- id: grad.id
- });
- }
- fill = URL(grad.node.id);
- } else {
- fill = value;
- }
- } else {
- fill = Str(fill);
- }
- }
- var attrs = {};
- attrs[name] = fill;
- $(this.node, attrs);
- this.node.style[name] = E;
- };
- }
- eve.on("snap.util.attr.fill", fillStroke("fill"));
- eve.on("snap.util.attr.stroke", fillStroke("stroke"));
- var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
- eve.on("snap.util.grad.parse", function parseGrad(string) {
- string = Str(string);
- var tokens = string.match(gradrg);
- if (!tokens) {
- return null;
- }
- var type = tokens[1],
- params = tokens[2],
- stops = tokens[3];
- params = params.split(/\s*,\s*/).map(function (el) {
- return +el == el ? +el : el;
- });
- if (params.length == 1 && params[0] == 0) {
- params = [];
- }
- stops = stops.split("-");
- stops = stops.map(function (el) {
- el = el.split(":");
- var out = {
- color: el[0]
- };
- if (el[1]) {
- out.offset = parseFloat(el[1]);
- }
- return out;
- });
- return {
- type: type,
- params: params,
- stops: stops
- };
- });
-
- eve.on("snap.util.attr.d", function (value) {
- eve.stop();
- if (is(value, "array") && is(value[0], "array")) {
- value = Snap.path.toString.call(value);
- }
- value = Str(value);
- if (value.match(/[ruo]/i)) {
- value = Snap.path.toAbsolute(value);
- }
- $(this.node, {d: value});
- })(-1);
- eve.on("snap.util.attr.#text", function (value) {
- eve.stop();
- value = Str(value);
- var txt = glob.doc.createTextNode(value);
- while (this.node.firstChild) {
- this.node.removeChild(this.node.firstChild);
- }
- this.node.appendChild(txt);
- })(-1);
- eve.on("snap.util.attr.path", function (value) {
- eve.stop();
- this.attr({d: value});
- })(-1);
- eve.on("snap.util.attr.class", function (value) {
- eve.stop();
- this.node.className.baseVal = value;
- })(-1);
- eve.on("snap.util.attr.viewBox", function (value) {
- var vb;
- if (is(value, "object") && "x" in value) {
- vb = [value.x, value.y, value.width, value.height].join(" ");
- } else if (is(value, "array")) {
- vb = value.join(" ");
- } else {
- vb = value;
- }
- $(this.node, {
- viewBox: vb
- });
- eve.stop();
- })(-1);
- eve.on("snap.util.attr.transform", function (value) {
- this.transform(value);
- eve.stop();
- })(-1);
- eve.on("snap.util.attr.r", function (value) {
- if (this.type == "rect") {
- eve.stop();
- $(this.node, {
- rx: value,
- ry: value
- });
- }
- })(-1);
- eve.on("snap.util.attr.textpath", function (value) {
- eve.stop();
- if (this.type == "text") {
- var id, tp, node;
- if (!value && this.textPath) {
- tp = this.textPath;
- while (tp.node.firstChild) {
- this.node.appendChild(tp.node.firstChild);
- }
- tp.remove();
- delete this.textPath;
- return;
- }
- if (is(value, "string")) {
- var defs = getSomeDefs(this),
- path = wrap(defs.parentNode).path(value);
- defs.appendChild(path.node);
- id = path.id;
- path.attr({id: id});
- } else {
- value = wrap(value);
- if (value instanceof Element) {
- id = value.attr("id");
- if (!id) {
- id = value.id;
- value.attr({id: id});
- }
- }
- }
- if (id) {
- tp = this.textPath;
- node = this.node;
- if (tp) {
- tp.attr({"xlink:href": "#" + id});
- } else {
- tp = $("textPath", {
- "xlink:href": "#" + id
- });
- while (node.firstChild) {
- tp.appendChild(node.firstChild);
- }
- node.appendChild(tp);
- this.textPath = wrap(tp);
- }
- }
- }
- })(-1);
- eve.on("snap.util.attr.text", function (value) {
- if (this.type == "text") {
- var i = 0,
- node = this.node,
- tuner = function (chunk) {
- var out = $("tspan");
- if (is(chunk, "array")) {
- for (var i = 0; i < chunk.length; i++) {
- out.appendChild(tuner(chunk[i]));
- }
- } else {
- out.appendChild(glob.doc.createTextNode(chunk));
- }
- out.normalize && out.normalize();
- return out;
- };
- while (node.firstChild) {
- node.removeChild(node.firstChild);
- }
- var tuned = tuner(value);
- while (tuned.firstChild) {
- node.appendChild(tuned.firstChild);
- }
- }
- eve.stop();
- })(-1);
- function setFontSize(value) {
- eve.stop();
- if (value == +value) {
- value += "px";
- }
- this.node.style.fontSize = value;
- }
- eve.on("snap.util.attr.fontSize", setFontSize)(-1);
- eve.on("snap.util.attr.font-size", setFontSize)(-1);
-
-
- eve.on("snap.util.getattr.transform", function () {
- eve.stop();
- return this.transform();
- })(-1);
- eve.on("snap.util.getattr.textpath", function () {
- eve.stop();
- return this.textPath;
- })(-1);
- // Markers
- (function () {
- function getter(end) {
- return function () {
- eve.stop();
- var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
- if (style == "none") {
- return style;
- } else {
- return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
- }
- };
- }
- function setter(end) {
- return function (value) {
- eve.stop();
- var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
- if (value == "" || !value) {
- this.node.style[name] = "none";
- return;
- }
- if (value.type == "marker") {
- var id = value.node.id;
- if (!id) {
- $(value.node, {id: value.id});
- }
- this.node.style[name] = URL(id);
- return;
- }
- };
- }
- eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
- eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
- eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
- eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
- eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
- eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
- eve.on("snap.util.attr.marker-end", setter("end"))(-1);
- eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
- eve.on("snap.util.attr.marker-start", setter("start"))(-1);
- eve.on("snap.util.attr.markerStart", setter("start"))(-1);
- eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
- eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
- }());
- eve.on("snap.util.getattr.r", function () {
- if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
- eve.stop();
- return $(this.node, "rx");
- }
- })(-1);
- function textExtract(node) {
- var out = [];
- var children = node.childNodes;
- for (var i = 0, ii = children.length; i < ii; i++) {
- var chi = children[i];
- if (chi.nodeType == 3) {
- out.push(chi.nodeValue);
- }
- if (chi.tagName == "tspan") {
- if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
- out.push(chi.firstChild.nodeValue);
- } else {
- out.push(textExtract(chi));
- }
- }
- }
- return out;
- }
- eve.on("snap.util.getattr.text", function () {
- if (this.type == "text" || this.type == "tspan") {
- eve.stop();
- var out = textExtract(this.node);
- return out.length == 1 ? out[0] : out;
- }
- })(-1);
- eve.on("snap.util.getattr.#text", function () {
- return this.node.textContent;
- })(-1);
- eve.on("snap.util.getattr.viewBox", function () {
- eve.stop();
- var vb = $(this.node, "viewBox");
- if (vb) {
- vb = vb.split(separator);
- return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
- } else {
- return;
- }
- })(-1);
- eve.on("snap.util.getattr.points", function () {
- var p = $(this.node, "points");
- eve.stop();
- if (p) {
- return p.split(separator);
- } else {
- return;
- }
- })(-1);
- eve.on("snap.util.getattr.path", function () {
- var p = $(this.node, "d");
- eve.stop();
- return p;
- })(-1);
- eve.on("snap.util.getattr.class", function () {
- return this.node.className.baseVal;
- })(-1);
- function getFontSize() {
- eve.stop();
- return this.node.style.fontSize;
- }
- eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
- eve.on("snap.util.getattr.font-size", getFontSize)(-1);
- });
-
- // Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
- var rgNotSpace = /\S+/g,
- rgBadSpace = /[\t\r\n\f]/g,
- rgTrim = /(^\s+|\s+$)/g,
- Str = String,
- elproto = Element.prototype;
- /*\
- * Element.addClass
- [ method ]
- **
- * Adds given class name or list of class names to the element.
- - value (string) class name or space separated list of class names
- **
- = (Element) original element.
- \*/
- elproto.addClass = function (value) {
- var classes = Str(value || "").match(rgNotSpace) || [],
- elem = this.node,
- className = elem.className.baseVal,
- curClasses = className.match(rgNotSpace) || [],
- j,
- pos,
- clazz,
- finalValue;
-
- if (classes.length) {
- j = 0;
- while ((clazz = classes[j++])) {
- pos = curClasses.indexOf(clazz);
- if (!~pos) {
- curClasses.push(clazz);
- }
- }
-
- finalValue = curClasses.join(" ");
- if (className != finalValue) {
- elem.className.baseVal = finalValue;
- }
- }
- return this;
- };
- /*\
- * Element.removeClass
- [ method ]
- **
- * Removes given class name or list of class names from the element.
- - value (string) class name or space separated list of class names
- **
- = (Element) original element.
- \*/
- elproto.removeClass = function (value) {
- var classes = Str(value || "").match(rgNotSpace) || [],
- elem = this.node,
- className = elem.className.baseVal,
- curClasses = className.match(rgNotSpace) || [],
- j,
- pos,
- clazz,
- finalValue;
- if (curClasses.length) {
- j = 0;
- while ((clazz = classes[j++])) {
- pos = curClasses.indexOf(clazz);
- if (~pos) {
- curClasses.splice(pos, 1);
- }
- }
-
- finalValue = curClasses.join(" ");
- if (className != finalValue) {
- elem.className.baseVal = finalValue;
- }
- }
- return this;
- };
- /*\
- * Element.hasClass
- [ method ]
- **
- * Checks if the element has a given class name in the list of class names applied to it.
- - value (string) class name
- **
- = (boolean) `true` if the element has given class
- \*/
- elproto.hasClass = function (value) {
- var elem = this.node,
- className = elem.className.baseVal,
- curClasses = className.match(rgNotSpace) || [];
- return !!~curClasses.indexOf(value);
- };
- /*\
- * Element.toggleClass
- [ method ]
- **
- * Add or remove one or more classes from the element, depending on either
- * the class’s presence or the value of the `flag` argument.
- - value (string) class name or space separated list of class names
- - flag (boolean) value to determine whether the class should be added or removed
- **
- = (Element) original element.
- \*/
- elproto.toggleClass = function (value, flag) {
- if (flag != null) {
- if (flag) {
- return this.addClass(value);
- } else {
- return this.removeClass(value);
- }
- }
- var classes = (value || "").match(rgNotSpace) || [],
- elem = this.node,
- className = elem.className.baseVal,
- curClasses = className.match(rgNotSpace) || [],
- j,
- pos,
- clazz,
- finalValue;
- j = 0;
- while ((clazz = classes[j++])) {
- pos = curClasses.indexOf(clazz);
- if (~pos) {
- curClasses.splice(pos, 1);
- } else {
- curClasses.push(clazz);
- }
- }
-
- finalValue = curClasses.join(" ");
- if (className != finalValue) {
- elem.className.baseVal = finalValue;
- }
- return this;
- };
- });
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
- var operators = {
- "+": function (x, y) {
- return x + y;
- },
- "-": function (x, y) {
- return x - y;
- },
- "/": function (x, y) {
- return x / y;
- },
- "*": function (x, y) {
- return x * y;
- }
- },
- Str = String,
- reUnit = /[a-z]+$/i,
- reAddon = /^\s*([+\-\/*])\s*=\s*([\d.eE+\-]+)\s*([^\d\s]+)?\s*$/;
- function getNumber(val) {
- return val;
- }
- function getUnit(unit) {
- return function (val) {
- return +val.toFixed(3) + unit;
- };
- }
- eve.on("snap.util.attr", function (val) {
- var plus = Str(val).match(reAddon);
- if (plus) {
- var evnt = eve.nt(),
- name = evnt.substring(evnt.lastIndexOf(".") + 1),
- a = this.attr(name),
- atr = {};
- eve.stop();
- var unit = plus[3] || "",
- aUnit = a.match(reUnit),
- op = operators[plus[1]];
- if (aUnit && aUnit == unit) {
- val = op(parseFloat(a), +plus[2]);
- } else {
- a = this.asPX(name);
- val = op(this.asPX(name), this.asPX(name, plus[2] + unit));
- }
- if (isNaN(a) || isNaN(val)) {
- return;
- }
- atr[name] = val;
- this.attr(atr);
- }
- })(-10);
- eve.on("snap.util.equal", function (name, b) {
- var A, B, a = Str(this.attr(name) || ""),
- el = this,
- bplus = Str(b).match(reAddon);
- if (bplus) {
- eve.stop();
- var unit = bplus[3] || "",
- aUnit = a.match(reUnit),
- op = operators[bplus[1]];
- if (aUnit && aUnit == unit) {
- return {
- from: parseFloat(a),
- to: op(parseFloat(a), +bplus[2]),
- f: getUnit(aUnit)
- };
- } else {
- a = this.asPX(name);
- return {
- from: a,
- to: op(a, this.asPX(name, bplus[2] + unit)),
- f: getNumber
- };
- }
- }
- })(-10);
- });
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
- var proto = Paper.prototype,
- is = Snap.is;
- /*\
- * Paper.rect
- [ method ]
- *
- * Draws a rectangle
- **
- - x (number) x coordinate of the top left corner
- - y (number) y coordinate of the top left corner
- - width (number) width
- - height (number) height
- - rx (number) #optional horizontal radius for rounded corners, default is 0
- - ry (number) #optional vertical radius for rounded corners, default is rx or 0
- = (object) the `rect` element
- **
- > Usage
- | // regular rectangle
- | var c = paper.rect(10, 10, 50, 50);
- | // rectangle with rounded corners
- | var c = paper.rect(40, 40, 50, 50, 10);
- \*/
- proto.rect = function (x, y, w, h, rx, ry) {
- var attr;
- if (ry == null) {
- ry = rx;
- }
- if (is(x, "object") && x == "[object Object]") {
- attr = x;
- } else if (x != null) {
- attr = {
- x: x,
- y: y,
- width: w,
- height: h
- };
- if (rx != null) {
- attr.rx = rx;
- attr.ry = ry;
- }
- }
- return this.el("rect", attr);
- };
- /*\
- * Paper.circle
- [ method ]
- **
- * Draws a circle
- **
- - x (number) x coordinate of the centre
- - y (number) y coordinate of the centre
- - r (number) radius
- = (object) the `circle` element
- **
- > Usage
- | var c = paper.circle(50, 50, 40);
- \*/
- proto.circle = function (cx, cy, r) {
- var attr;
- if (is(cx, "object") && cx == "[object Object]") {
- attr = cx;
- } else if (cx != null) {
- attr = {
- cx: cx,
- cy: cy,
- r: r
- };
- }
- return this.el("circle", attr);
- };
-
- var preload = (function () {
- function onerror() {
- this.parentNode.removeChild(this);
- }
- return function (src, f) {
- var img = glob.doc.createElement("img"),
- body = glob.doc.body;
- img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
- img.onload = function () {
- f.call(img);
- img.onload = img.onerror = null;
- body.removeChild(img);
- };
- img.onerror = onerror;
- body.appendChild(img);
- img.src = src;
- };
- }());
-
- /*\
- * Paper.image
- [ method ]
- **
- * Places an image on the surface
- **
- - src (string) URI of the source image
- - x (number) x offset position
- - y (number) y offset position
- - width (number) width of the image
- - height (number) height of the image
- = (object) the `image` element
- * or
- = (object) Snap element object with type `image`
- **
- > Usage
- | var c = paper.image("apple.png", 10, 10, 80, 80);
- \*/
- proto.image = function (src, x, y, width, height) {
- var el = this.el("image");
- if (is(src, "object") && "src" in src) {
- el.attr(src);
- } else if (src != null) {
- var set = {
- "xlink:href": src,
- preserveAspectRatio: "none"
- };
- if (x != null && y != null) {
- set.x = x;
- set.y = y;
- }
- if (width != null && height != null) {
- set.width = width;
- set.height = height;
- } else {
- preload(src, function () {
- Snap._.$(el.node, {
- width: this.offsetWidth,
- height: this.offsetHeight
- });
- });
- }
- Snap._.$(el.node, set);
- }
- return el;
- };
- /*\
- * Paper.ellipse
- [ method ]
- **
- * Draws an ellipse
- **
- - x (number) x coordinate of the centre
- - y (number) y coordinate of the centre
- - rx (number) horizontal radius
- - ry (number) vertical radius
- = (object) the `ellipse` element
- **
- > Usage
- | var c = paper.ellipse(50, 50, 40, 20);
- \*/
- proto.ellipse = function (cx, cy, rx, ry) {
- var attr;
- if (is(cx, "object") && cx == "[object Object]") {
- attr = cx;
- } else if (cx != null) {
- attr ={
- cx: cx,
- cy: cy,
- rx: rx,
- ry: ry
- };
- }
- return this.el("ellipse", attr);
- };
- // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.
- /*\
- * Paper.path
- [ method ]
- **
- * Creates a `<path>` element using the given string as the path's definition
- - pathString (string) #optional path string in SVG format
- * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:
- | "M10,20L30,40"
- * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.
- *
- # <p>Here is short list of commands available, for more details see <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path's data attribute's format are described in the SVG specification.">SVG path string format</a> or <a href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about path strings at MDN</a>.</p>
- # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>
- # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>
- # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>
- # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>
- # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>
- # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>
- # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>
- # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>
- # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>
- # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>
- # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>
- # <tr><td>R</td><td><a href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>
- * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.
- * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.
- > Usage
- | var c = paper.path("M10 10L90 90");
- | // draw a diagonal line:
- | // move to 10,10, line to 90,90
- \*/
- proto.path = function (d) {
- var attr;
- if (is(d, "object") && !is(d, "array")) {
- attr = d;
- } else if (d) {
- attr = {d: d};
- }
- return this.el("path", attr);
- };
- /*\
- * Paper.g
- [ method ]
- **
- * Creates a group element
- **
- - varargs (…) #optional elements to nest within the group
- = (object) the `g` element
- **
- > Usage
- | var c1 = paper.circle(),
- | c2 = paper.rect(),
- | g = paper.g(c2, c1); // note that the order of elements is different
- * or
- | var c1 = paper.circle(),
- | c2 = paper.rect(),
- | g = paper.g();
- | g.add(c2, c1);
- \*/
- /*\
- * Paper.group
- [ method ]
- **
- * See @Paper.g
- \*/
- proto.group = proto.g = function (first) {
- var attr,
- el = this.el("g");
- if (arguments.length == 1 && first && !first.type) {
- el.attr(first);
- } else if (arguments.length) {
- el.add(Array.prototype.slice.call(arguments, 0));
- }
- return el;
- };
- /*\
- * Paper.svg
- [ method ]
- **
- * Creates a nested SVG element.
- - x (number) @optional X of the element
- - y (number) @optional Y of the element
- - width (number) @optional width of the element
- - height (number) @optional height of the element
- - vbx (number) @optional viewbox X
- - vby (number) @optional viewbox Y
- - vbw (number) @optional viewbox width
- - vbh (number) @optional viewbox height
- **
- = (object) the `svg` element
- **
- \*/
- proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {
- var attrs = {};
- if (is(x, "object") && y == null) {
- attrs = x;
- } else {
- if (x != null) {
- attrs.x = x;
- }
- if (y != null) {
- attrs.y = y;
- }
- if (width != null) {
- attrs.width = width;
- }
- if (height != null) {
- attrs.height = height;
- }
- if (vbx != null && vby != null && vbw != null && vbh != null) {
- attrs.viewBox = [vbx, vby, vbw, vbh];
- }
- }
- return this.el("svg", attrs);
- };
- /*\
- * Paper.mask
- [ method ]
- **
- * Equivalent in behaviour to @Paper.g, except it’s a mask.
- **
- = (object) the `mask` element
- **
- \*/
- proto.mask = function (first) {
- var attr,
- el = this.el("mask");
- if (arguments.length == 1 && first && !first.type) {
- el.attr(first);
- } else if (arguments.length) {
- el.add(Array.prototype.slice.call(arguments, 0));
- }
- return el;
- };
- /*\
- * Paper.ptrn
- [ method ]
- **
- * Equivalent in behaviour to @Paper.g, except it’s a pattern.
- - x (number) @optional X of the element
- - y (number) @optional Y of the element
- - width (number) @optional width of the element
- - height (number) @optional height of the element
- - vbx (number) @optional viewbox X
- - vby (number) @optional viewbox Y
- - vbw (number) @optional viewbox width
- - vbh (number) @optional viewbox height
- **
- = (object) the `pattern` element
- **
- \*/
- proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {
- if (is(x, "object")) {
- var attr = x;
- } else {
- attr = {patternUnits: "userSpaceOnUse"};
- if (x) {
- attr.x = x;
- }
- if (y) {
- attr.y = y;
- }
- if (width != null) {
- attr.width = width;
- }
- if (height != null) {
- attr.height = height;
- }
- if (vx != null && vy != null && vw != null && vh != null) {
- attr.viewBox = [vx, vy, vw, vh];
- } else {
- attr.viewBox = [x || 0, y || 0, width || 0, height || 0];
- }
- }
- return this.el("pattern", attr);
- };
- /*\
- * Paper.use
- [ method ]
- **
- * Creates a <use> element.
- - id (string) @optional id of element to link
- * or
- - id (Element) @optional element to link
- **
- = (object) the `use` element
- **
- \*/
- proto.use = function (id) {
- if (id != null) {
- if (id instanceof Element) {
- if (!id.attr("id")) {
- id.attr({id: Snap._.id(id)});
- }
- id = id.attr("id");
- }
- if (String(id).charAt() == "#") {
- id = id.substring(1);
- }
- return this.el("use", {"xlink:href": "#" + id});
- } else {
- return Element.prototype.use.call(this);
- }
- };
- /*\
- * Paper.symbol
- [ method ]
- **
- * Creates a <symbol> element.
- - vbx (number) @optional viewbox X
- - vby (number) @optional viewbox Y
- - vbw (number) @optional viewbox width
- - vbh (number) @optional viewbox height
- = (object) the `symbol` element
- **
- \*/
- proto.symbol = function (vx, vy, vw, vh) {
- var attr = {};
- if (vx != null && vy != null && vw != null && vh != null) {
- attr.viewBox = [vx, vy, vw, vh];
- }
-
- return this.el("symbol", attr);
- };
- /*\
- * Paper.text
- [ method ]
- **
- * Draws a text string
- **
- - x (number) x coordinate position
- - y (number) y coordinate position
- - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements
- = (object) the `text` element
- **
- > Usage
- | var t1 = paper.text(50, 50, "Snap");
- | var t2 = paper.text(50, 50, ["S","n","a","p"]);
- | // Text path usage
- | t1.attr({textpath: "M10,10L100,100"});
- | // or
- | var pth = paper.path("M10,10L100,100");
- | t1.attr({textpath: pth});
- \*/
- proto.text = function (x, y, text) {
- var attr = {};
- if (is(x, "object")) {
- attr = x;
- } else if (x != null) {
- attr = {
- x: x,
- y: y,
- text: text || ""
- };
- }
- return this.el("text", attr);
- };
- /*\
- * Paper.line
- [ method ]
- **
- * Draws a line
- **
- - x1 (number) x coordinate position of the start
- - y1 (number) y coordinate position of the start
- - x2 (number) x coordinate position of the end
- - y2 (number) y coordinate position of the end
- = (object) the `line` element
- **
- > Usage
- | var t1 = paper.line(50, 50, 100, 100);
- \*/
- proto.line = function (x1, y1, x2, y2) {
- var attr = {};
- if (is(x1, "object")) {
- attr = x1;
- } else if (x1 != null) {
- attr = {
- x1: x1,
- x2: x2,
- y1: y1,
- y2: y2
- };
- }
- return this.el("line", attr);
- };
- /*\
- * Paper.polyline
- [ method ]
- **
- * Draws a polyline
- **
- - points (array) array of points
- * or
- - varargs (…) points
- = (object) the `polyline` element
- **
- > Usage
- | var p1 = paper.polyline([10, 10, 100, 100]);
- | var p2 = paper.polyline(10, 10, 100, 100);
- \*/
- proto.polyline = function (points) {
- if (arguments.length > 1) {
- points = Array.prototype.slice.call(arguments, 0);
- }
- var attr = {};
- if (is(points, "object") && !is(points, "array")) {
- attr = points;
- } else if (points != null) {
- attr = {points: points};
- }
- return this.el("polyline", attr);
- };
- /*\
- * Paper.polygon
- [ method ]
- **
- * Draws a polygon. See @Paper.polyline
- \*/
- proto.polygon = function (points) {
- if (arguments.length > 1) {
- points = Array.prototype.slice.call(arguments, 0);
- }
- var attr = {};
- if (is(points, "object") && !is(points, "array")) {
- attr = points;
- } else if (points != null) {
- attr = {points: points};
- }
- return this.el("polygon", attr);
- };
- // gradients
- (function () {
- var $ = Snap._.$;
- // gradients' helpers
- function Gstops() {
- return this.selectAll("stop");
- }
- function GaddStop(color, offset) {
- var stop = $("stop"),
- attr = {
- offset: +offset + "%"
- };
- color = Snap.color(color);
- attr["stop-color"] = color.hex;
- if (color.opacity < 1) {
- attr["stop-opacity"] = color.opacity;
- }
- $(stop, attr);
- this.node.appendChild(stop);
- return this;
- }
- function GgetBBox() {
- if (this.type == "linearGradient") {
- var x1 = $(this.node, "x1") || 0,
- x2 = $(this.node, "x2") || 1,
- y1 = $(this.node, "y1") || 0,
- y2 = $(this.node, "y2") || 0;
- return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
- } else {
- var cx = this.node.cx || .5,
- cy = this.node.cy || .5,
- r = this.node.r || 0;
- return Snap._.box(cx - r, cy - r, r * 2, r * 2);
- }
- }
- function gradient(defs, str) {
- var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
- el;
- if (!grad) {
- return null;
- }
- grad.params.unshift(defs);
- if (grad.type.toLowerCase() == "l") {
- el = gradientLinear.apply(0, grad.params);
- } else {
- el = gradientRadial.apply(0, grad.params);
- }
- if (grad.type != grad.type.toLowerCase()) {
- $(el.node, {
- gradientUnits: "userSpaceOnUse"
- });
- }
- var stops = grad.stops,
- len = stops.length,
- start = 0,
- j = 0;
- function seed(i, end) {
- var step = (end - start) / (i - j);
- for (var k = j; k < i; k++) {
- stops[k].offset = +(+start + step * (k - j)).toFixed(2);
- }
- j = i;
- start = end;
- }
- len--;
- for (var i = 0; i < len; i++) if ("offset" in stops[i]) {
- seed(i, stops[i].offset);
- }
- stops[len].offset = stops[len].offset || 100;
- seed(len, stops[len].offset);
- for (i = 0; i <= len; i++) {
- var stop = stops[i];
- el.addStop(stop.color, stop.offset);
- }
- return el;
- }
- function gradientLinear(defs, x1, y1, x2, y2) {
- var el = Snap._.make("linearGradient", defs);
- el.stops = Gstops;
- el.addStop = GaddStop;
- el.getBBox = GgetBBox;
- if (x1 != null) {
- $(el.node, {
- x1: x1,
- y1: y1,
- x2: x2,
- y2: y2
- });
- }
- return el;
- }
- function gradientRadial(defs, cx, cy, r, fx, fy) {
- var el = Snap._.make("radialGradient", defs);
- el.stops = Gstops;
- el.addStop = GaddStop;
- el.getBBox = GgetBBox;
- if (cx != null) {
- $(el.node, {
- cx: cx,
- cy: cy,
- r: r
- });
- }
- if (fx != null && fy != null) {
- $(el.node, {
- fx: fx,
- fy: fy
- });
- }
- return el;
- }
- /*\
- * Paper.gradient
- [ method ]
- **
- * Creates a gradient element
- **
- - gradient (string) gradient descriptor
- > Gradient Descriptor
- * The gradient descriptor is an expression formatted as
- * follows: `<type>(<coords>)<colors>`. The `<type>` can be
- * either linear or radial. The uppercase `L` or `R` letters
- * indicate absolute coordinates offset from the SVG surface.
- * Lowercase `l` or `r` letters indicate coordinates
- * calculated relative to the element to which the gradient is
- * applied. Coordinates specify a linear gradient vector as
- * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,
- * `r` and optional `fx`, `fy` specifying a focal point away
- * from the center of the circle. Specify `<colors>` as a list
- * of dash-separated CSS color values. Each color may be
- * followed by a custom offset value, separated with a colon
- * character.
- > Examples
- * Linear gradient, relative from top-left corner to bottom-right
- * corner, from black through red to white:
- | var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
- * Linear gradient, absolute from (0, 0) to (100, 100), from black
- * through red at 25% to white:
- | var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25-#fff");
- * Radial gradient, relative from the center of the element with radius
- * half the width, from black to white:
- | var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff");
- * To apply the gradient:
- | paper.circle(50, 50, 40).attr({
- | fill: g
- | });
- = (object) the `gradient` element
- \*/
- proto.gradient = function (str) {
- return gradient(this.defs, str);
- };
- proto.gradientLinear = function (x1, y1, x2, y2) {
- return gradientLinear(this.defs, x1, y1, x2, y2);
- };
- proto.gradientRadial = function (cx, cy, r, fx, fy) {
- return gradientRadial(this.defs, cx, cy, r, fx, fy);
- };
- /*\
- * Paper.toString
- [ method ]
- **
- * Returns SVG code for the @Paper
- = (string) SVG code for the @Paper
- \*/
- proto.toString = function () {
- var doc = this.node.ownerDocument,
- f = doc.createDocumentFragment(),
- d = doc.createElement("div"),
- svg = this.node.cloneNode(true),
- res;
- f.appendChild(d);
- d.appendChild(svg);
- Snap._.$(svg, {xmlns: "http://www.w3.org/2000/svg"});
- res = d.innerHTML;
- f.removeChild(f.firstChild);
- return res;
- };
- /*\
- * Paper.toDataURL
- [ method ]
- **
- * Returns SVG code for the @Paper as Data URI string.
- = (string) Data URI string
- \*/
- proto.toDataURL = function () {
- if (window && window.btoa) {
- return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
- }
- };
- /*\
- * Paper.clear
- [ method ]
- **
- * Removes all child nodes of the paper, except <defs>.
- \*/
- proto.clear = function () {
- var node = this.node.firstChild,
- next;
- while (node) {
- next = node.nextSibling;
- if (node.tagName != "defs") {
- node.parentNode.removeChild(node);
- } else {
- proto.clear.call({node: node});
- }
- node = next;
- }
- };
- }());
- });
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob) {
- var elproto = Element.prototype,
- is = Snap.is,
- clone = Snap._.clone,
- has = "hasOwnProperty",
- p2s = /,?([a-z]),?/gi,
- toFloat = parseFloat,
- math = Math,
- PI = math.PI,
- mmin = math.min,
- mmax = math.max,
- pow = math.pow,
- abs = math.abs;
- function paths(ps) {
- var p = paths.ps = paths.ps || {};
- if (p[ps]) {
- p[ps].sleep = 100;
- } else {
- p[ps] = {
- sleep: 100
- };
- }
- setTimeout(function () {
- for (var key in p) if (p[has](key) && key != ps) {
- p[key].sleep--;
- !p[key].sleep && delete p[key];
- }
- });
- return p[ps];
- }
- function box(x, y, width, height) {
- if (x == null) {
- x = y = width = height = 0;
- }
- if (y == null) {
- y = x.y;
- width = x.width;
- height = x.height;
- x = x.x;
- }
- return {
- x: x,
- y: y,
- width: width,
- w: width,
- height: height,
- h: height,
- x2: x + width,
- y2: y + height,
- cx: x + width / 2,
- cy: y + height / 2,
- r1: math.min(width, height) / 2,
- r2: math.max(width, height) / 2,
- r0: math.sqrt(width * width + height * height) / 2,
- path: rectPath(x, y, width, height),
- vb: [x, y, width, height].join(" ")
- };
- }
- function toString() {
- return this.join(",").replace(p2s, "$1");
- }
- function pathClone(pathArray) {
- var res = clone(pathArray);
- res.toString = toString;
- return res;
- }
- function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
- if (length == null) {
- return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
- } else {
- return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
- getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
- }
- }
- function getLengthFactory(istotal, subpath) {
- function O(val) {
- return +(+val).toFixed(3);
- }
- return Snap._.cacher(function (path, length, onlystart) {
- if (path instanceof Element) {
- path = path.attr("d");
- }
- path = path2curve(path);
- var x, y, p, l, sp = "", subpaths = {}, point,
- len = 0;
- for (var i = 0, ii = path.length; i < ii; i++) {
- p = path[i];
- if (p[0] == "M") {
- x = +p[1];
- y = +p[2];
- } else {
- l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
- if (len + l > length) {
- if (subpath && !subpaths.start) {
- point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
- sp += [
- "C" + O(point.start.x),
- O(point.start.y),
- O(point.m.x),
- O(point.m.y),
- O(point.x),
- O(point.y)
- ];
- if (onlystart) {return sp;}
- subpaths.start = sp;
- sp = [
- "M" + O(point.x),
- O(point.y) + "C" + O(point.n.x),
- O(point.n.y),
- O(point.end.x),
- O(point.end.y),
- O(p[5]),
- O(p[6])
- ].join();
- len += l;
- x = +p[5];
- y = +p[6];
- continue;
- }
- if (!istotal && !subpath) {
- point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
- return point;
- }
- }
- len += l;
- x = +p[5];
- y = +p[6];
- }
- sp += p.shift() + p;
- }
- subpaths.end = sp;
- point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
- return point;
- }, null, Snap._.clone);
- }
- var getTotalLength = getLengthFactory(1),
- getPointAtLength = getLengthFactory(),
- getSubpathsAtLength = getLengthFactory(0, 1);
- function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
- var t1 = 1 - t,
- t13 = pow(t1, 3),
- t12 = pow(t1, 2),
- t2 = t * t,
- t3 = t2 * t,
- x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
- y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
- mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
- my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
- nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
- ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
- ax = t1 * p1x + t * c1x,
- ay = t1 * p1y + t * c1y,
- cx = t1 * c2x + t * p2x,
- cy = t1 * c2y + t * p2y,
- alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
- // (mx > nx || my < ny) && (alpha += 180);
- return {
- x: x,
- y: y,
- m: {x: mx, y: my},
- n: {x: nx, y: ny},
- start: {x: ax, y: ay},
- end: {x: cx, y: cy},
- alpha: alpha
- };
- }
- function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
- if (!Snap.is(p1x, "array")) {
- p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
- }
- var bbox = curveDim.apply(null, p1x);
- return box(
- bbox.min.x,
- bbox.min.y,
- bbox.max.x - bbox.min.x,
- bbox.max.y - bbox.min.y
- );
- }
- function isPointInsideBBox(bbox, x, y) {
- return x >= bbox.x &&
- x <= bbox.x + bbox.width &&
- y >= bbox.y &&
- y <= bbox.y + bbox.height;
- }
- function isBBoxIntersect(bbox1, bbox2) {
- bbox1 = box(bbox1);
- bbox2 = box(bbox2);
- return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)
- || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)
- || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)
- || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)
- || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)
- || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)
- || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)
- || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)
- || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x
- || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)
- && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y
- || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
- }
- function base3(t, p1, p2, p3, p4) {
- var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
- t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
- return t * t2 - 3 * p1 + 3 * p2;
- }
- function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
- if (z == null) {
- z = 1;
- }
- z = z > 1 ? 1 : z < 0 ? 0 : z;
- var z2 = z / 2,
- n = 12,
- Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],
- Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],
- sum = 0;
- for (var i = 0; i < n; i++) {
- var ct = z2 * Tvalues[i] + z2,
- xbase = base3(ct, x1, x2, x3, x4),
- ybase = base3(ct, y1, y2, y3, y4),
- comb = xbase * xbase + ybase * ybase;
- sum += Cvalues[i] * math.sqrt(comb);
- }
- return z2 * sum;
- }
- function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
- if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
- return;
- }
- var t = 1,
- step = t / 2,
- t2 = t - step,
- l,
- e = .01;
- l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
- while (abs(l - ll) > e) {
- step /= 2;
- t2 += (l < ll ? 1 : -1) * step;
- l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
- }
- return t2;
- }
- function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
- if (
- mmax(x1, x2) < mmin(x3, x4) ||
- mmin(x1, x2) > mmax(x3, x4) ||
- mmax(y1, y2) < mmin(y3, y4) ||
- mmin(y1, y2) > mmax(y3, y4)
- ) {
- return;
- }
- var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
- ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
- denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
-
- if (!denominator) {
- return;
- }
- var px = nx / denominator,
- py = ny / denominator,
- px2 = +px.toFixed(2),
- py2 = +py.toFixed(2);
- if (
- px2 < +mmin(x1, x2).toFixed(2) ||
- px2 > +mmax(x1, x2).toFixed(2) ||
- px2 < +mmin(x3, x4).toFixed(2) ||
- px2 > +mmax(x3, x4).toFixed(2) ||
- py2 < +mmin(y1, y2).toFixed(2) ||
- py2 > +mmax(y1, y2).toFixed(2) ||
- py2 < +mmin(y3, y4).toFixed(2) ||
- py2 > +mmax(y3, y4).toFixed(2)
- ) {
- return;
- }
- return {x: px, y: py};
- }
- function inter(bez1, bez2) {
- return interHelper(bez1, bez2);
- }
- function interCount(bez1, bez2) {
- return interHelper(bez1, bez2, 1);
- }
- function interHelper(bez1, bez2, justCount) {
- var bbox1 = bezierBBox(bez1),
- bbox2 = bezierBBox(bez2);
- if (!isBBoxIntersect(bbox1, bbox2)) {
- return justCount ? 0 : [];
- }
- var l1 = bezlen.apply(0, bez1),
- l2 = bezlen.apply(0, bez2),
- n1 = ~~(l1 / 8),
- n2 = ~~(l2 / 8),
- dots1 = [],
- dots2 = [],
- xy = {},
- res = justCount ? 0 : [];
- for (var i = 0; i < n1 + 1; i++) {
- var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
- dots1.push({x: p.x, y: p.y, t: i / n1});
- }
- for (i = 0; i < n2 + 1; i++) {
- p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
- dots2.push({x: p.x, y: p.y, t: i / n2});
- }
- for (i = 0; i < n1; i++) {
- for (var j = 0; j < n2; j++) {
- var di = dots1[i],
- di1 = dots1[i + 1],
- dj = dots2[j],
- dj1 = dots2[j + 1],
- ci = abs(di1.x - di.x) < .001 ? "y" : "x",
- cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
- is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
- if (is) {
- if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
- continue;
- }
- xy[is.x.toFixed(4)] = is.y.toFixed(4);
- var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
- t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
- if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
- if (justCount) {
- res++;
- } else {
- res.push({
- x: is.x,
- y: is.y,
- t1: t1,
- t2: t2
- });
- }
- }
- }
- }
- }
- return res;
- }
- function pathIntersection(path1, path2) {
- return interPathHelper(path1, path2);
- }
- function pathIntersectionNumber(path1, path2) {
- return interPathHelper(path1, path2, 1);
- }
- function interPathHelper(path1, path2, justCount) {
- path1 = path2curve(path1);
- path2 = path2curve(path2);
- var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
- res = justCount ? 0 : [];
- for (var i = 0, ii = path1.length; i < ii; i++) {
- var pi = path1[i];
- if (pi[0] == "M") {
- x1 = x1m = pi[1];
- y1 = y1m = pi[2];
- } else {
- if (pi[0] == "C") {
- bez1 = [x1, y1].concat(pi.slice(1));
- x1 = bez1[6];
- y1 = bez1[7];
- } else {
- bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
- x1 = x1m;
- y1 = y1m;
- }
- for (var j = 0, jj = path2.length; j < jj; j++) {
- var pj = path2[j];
- if (pj[0] == "M") {
- x2 = x2m = pj[1];
- y2 = y2m = pj[2];
- } else {
- if (pj[0] == "C") {
- bez2 = [x2, y2].concat(pj.slice(1));
- x2 = bez2[6];
- y2 = bez2[7];
- } else {
- bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
- x2 = x2m;
- y2 = y2m;
- }
- var intr = interHelper(bez1, bez2, justCount);
- if (justCount) {
- res += intr;
- } else {
- for (var k = 0, kk = intr.length; k < kk; k++) {
- intr[k].segment1 = i;
- intr[k].segment2 = j;
- intr[k].bez1 = bez1;
- intr[k].bez2 = bez2;
- }
- res = res.concat(intr);
- }
- }
- }
- }
- }
- return res;
- }
- function isPointInsidePath(path, x, y) {
- var bbox = pathBBox(path);
- return isPointInsideBBox(bbox, x, y) &&
- interPathHelper(path, [["M", x, y], ["H", bbox.x2 + 10]], 1) % 2 == 1;
- }
- function pathBBox(path) {
- var pth = paths(path);
- if (pth.bbox) {
- return clone(pth.bbox);
- }
- if (!path) {
- return box();
- }
- path = path2curve(path);
- var x = 0,
- y = 0,
- X = [],
- Y = [],
- p;
- for (var i = 0, ii = path.length; i < ii; i++) {
- p = path[i];
- if (p[0] == "M") {
- x = p[1];
- y = p[2];
- X.push(x);
- Y.push(y);
- } else {
- var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
- X = X.concat(dim.min.x, dim.max.x);
- Y = Y.concat(dim.min.y, dim.max.y);
- x = p[5];
- y = p[6];
- }
- }
- var xmin = mmin.apply(0, X),
- ymin = mmin.apply(0, Y),
- xmax = mmax.apply(0, X),
- ymax = mmax.apply(0, Y),
- bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
- pth.bbox = clone(bb);
- return bb;
- }
- function rectPath(x, y, w, h, r) {
- if (r) {
- return [
- ["M", +x + (+r), y],
- ["l", w - r * 2, 0],
- ["a", r, r, 0, 0, 1, r, r],
- ["l", 0, h - r * 2],
- ["a", r, r, 0, 0, 1, -r, r],
- ["l", r * 2 - w, 0],
- ["a", r, r, 0, 0, 1, -r, -r],
- ["l", 0, r * 2 - h],
- ["a", r, r, 0, 0, 1, r, -r],
- ["z"]
- ];
- }
- var res = [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]];
- res.toString = toString;
- return res;
- }
- function ellipsePath(x, y, rx, ry, a) {
- if (a == null && ry == null) {
- ry = rx;
- }
- x = +x;
- y = +y;
- rx = +rx;
- ry = +ry;
- if (a != null) {
- var rad = Math.PI / 180,
- x1 = x + rx * Math.cos(-ry * rad),
- x2 = x + rx * Math.cos(-a * rad),
- y1 = y + rx * Math.sin(-ry * rad),
- y2 = y + rx * Math.sin(-a * rad),
- res = [["M", x1, y1], ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];
- } else {
- res = [
- ["M", x, y],
- ["m", 0, -ry],
- ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
- ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
- ["z"]
- ];
- }
- res.toString = toString;
- return res;
- }
- var unit2px = Snap._unit2px,
- getPath = {
- path: function (el) {
- return el.attr("path");
- },
- circle: function (el) {
- var attr = unit2px(el);
- return ellipsePath(attr.cx, attr.cy, attr.r);
- },
- ellipse: function (el) {
- var attr = unit2px(el);
- return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
- },
- rect: function (el) {
- var attr = unit2px(el);
- return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
- },
- image: function (el) {
- var attr = unit2px(el);
- return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
- },
- line: function (el) {
- return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
- },
- polyline: function (el) {
- return "M" + el.attr("points");
- },
- polygon: function (el) {
- return "M" + el.attr("points") + "z";
- },
- deflt: function (el) {
- var bbox = el.node.getBBox();
- return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
- }
- };
- function pathToRelative(pathArray) {
- var pth = paths(pathArray),
- lowerCase = String.prototype.toLowerCase;
- if (pth.rel) {
- return pathClone(pth.rel);
- }
- if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
- pathArray = Snap.parsePathString(pathArray);
- }
- var res = [],
- x = 0,
- y = 0,
- mx = 0,
- my = 0,
- start = 0;
- if (pathArray[0][0] == "M") {
- x = pathArray[0][1];
- y = pathArray[0][2];
- mx = x;
- my = y;
- start++;
- res.push(["M", x, y]);
- }
- for (var i = start, ii = pathArray.length; i < ii; i++) {
- var r = res[i] = [],
- pa = pathArray[i];
- if (pa[0] != lowerCase.call(pa[0])) {
- r[0] = lowerCase.call(pa[0]);
- switch (r[0]) {
- case "a":
- r[1] = pa[1];
- r[2] = pa[2];
- r[3] = pa[3];
- r[4] = pa[4];
- r[5] = pa[5];
- r[6] = +(pa[6] - x).toFixed(3);
- r[7] = +(pa[7] - y).toFixed(3);
- break;
- case "v":
- r[1] = +(pa[1] - y).toFixed(3);
- break;
- case "m":
- mx = pa[1];
- my = pa[2];
- default:
- for (var j = 1, jj = pa.length; j < jj; j++) {
- r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
- }
- }
- } else {
- r = res[i] = [];
- if (pa[0] == "m") {
- mx = pa[1] + x;
- my = pa[2] + y;
- }
- for (var k = 0, kk = pa.length; k < kk; k++) {
- res[i][k] = pa[k];
- }
- }
- var len = res[i].length;
- switch (res[i][0]) {
- case "z":
- x = mx;
- y = my;
- break;
- case "h":
- x += +res[i][len - 1];
- break;
- case "v":
- y += +res[i][len - 1];
- break;
- default:
- x += +res[i][len - 2];
- y += +res[i][len - 1];
- }
- }
- res.toString = toString;
- pth.rel = pathClone(res);
- return res;
- }
- function pathToAbsolute(pathArray) {
- var pth = paths(pathArray);
- if (pth.abs) {
- return pathClone(pth.abs);
- }
- if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough assumption
- pathArray = Snap.parsePathString(pathArray);
- }
- if (!pathArray || !pathArray.length) {
- return [["M", 0, 0]];
- }
- var res = [],
- x = 0,
- y = 0,
- mx = 0,
- my = 0,
- start = 0,
- pa0;
- if (pathArray[0][0] == "M") {
- x = +pathArray[0][1];
- y = +pathArray[0][2];
- mx = x;
- my = y;
- start++;
- res[0] = ["M", x, y];
- }
- var crz = pathArray.length == 3 &&
- pathArray[0][0] == "M" &&
- pathArray[1][0].toUpperCase() == "R" &&
- pathArray[2][0].toUpperCase() == "Z";
- for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
- res.push(r = []);
- pa = pathArray[i];
- pa0 = pa[0];
- if (pa0 != pa0.toUpperCase()) {
- r[0] = pa0.toUpperCase();
- switch (r[0]) {
- case "A":
- r[1] = pa[1];
- r[2] = pa[2];
- r[3] = pa[3];
- r[4] = pa[4];
- r[5] = pa[5];
- r[6] = +pa[6] + x;
- r[7] = +pa[7] + y;
- break;
- case "V":
- r[1] = +pa[1] + y;
- break;
- case "H":
- r[1] = +pa[1] + x;
- break;
- case "R":
- var dots = [x, y].concat(pa.slice(1));
- for (var j = 2, jj = dots.length; j < jj; j++) {
- dots[j] = +dots[j] + x;
- dots[++j] = +dots[j] + y;
- }
- res.pop();
- res = res.concat(catmullRom2bezier(dots, crz));
- break;
- case "O":
- res.pop();
- dots = ellipsePath(x, y, pa[1], pa[2]);
- dots.push(dots[0]);
- res = res.concat(dots);
- break;
- case "U":
- res.pop();
- res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
- r = ["U"].concat(res[res.length - 1].slice(-2));
- break;
- case "M":
- mx = +pa[1] + x;
- my = +pa[2] + y;
- default:
- for (j = 1, jj = pa.length; j < jj; j++) {
- r[j] = +pa[j] + ((j % 2) ? x : y);
- }
- }
- } else if (pa0 == "R") {
- dots = [x, y].concat(pa.slice(1));
- res.pop();
- res = res.concat(catmullRom2bezier(dots, crz));
- r = ["R"].concat(pa.slice(-2));
- } else if (pa0 == "O") {
- res.pop();
- dots = ellipsePath(x, y, pa[1], pa[2]);
- dots.push(dots[0]);
- res = res.concat(dots);
- } else if (pa0 == "U") {
- res.pop();
- res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
- r = ["U"].concat(res[res.length - 1].slice(-2));
- } else {
- for (var k = 0, kk = pa.length; k < kk; k++) {
- r[k] = pa[k];
- }
- }
- pa0 = pa0.toUpperCase();
- if (pa0 != "O") {
- switch (r[0]) {
- case "Z":
- x = +mx;
- y = +my;
- break;
- case "H":
- x = r[1];
- break;
- case "V":
- y = r[1];
- break;
- case "M":
- mx = r[r.length - 2];
- my = r[r.length - 1];
- default:
- x = r[r.length - 2];
- y = r[r.length - 1];
- }
- }
- }
- res.toString = toString;
- pth.abs = pathClone(res);
- return res;
- }
- function l2c(x1, y1, x2, y2) {
- return [x1, y1, x2, y2, x2, y2];
- }
- function q2c(x1, y1, ax, ay, x2, y2) {
- var _13 = 1 / 3,
- _23 = 2 / 3;
- return [
- _13 * x1 + _23 * ax,
- _13 * y1 + _23 * ay,
- _13 * x2 + _23 * ax,
- _13 * y2 + _23 * ay,
- x2,
- y2
- ];
- }
- function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
- // for more information of where this math came from visit:
- // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
- var _120 = PI * 120 / 180,
- rad = PI / 180 * (+angle || 0),
- res = [],
- xy,
- rotate = Snap._.cacher(function (x, y, rad) {
- var X = x * math.cos(rad) - y * math.sin(rad),
- Y = x * math.sin(rad) + y * math.cos(rad);
- return {x: X, y: Y};
- });
- if (!recursive) {
- xy = rotate(x1, y1, -rad);
- x1 = xy.x;
- y1 = xy.y;
- xy = rotate(x2, y2, -rad);
- x2 = xy.x;
- y2 = xy.y;
- var cos = math.cos(PI / 180 * angle),
- sin = math.sin(PI / 180 * angle),
- x = (x1 - x2) / 2,
- y = (y1 - y2) / 2;
- var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
- if (h > 1) {
- h = math.sqrt(h);
- rx = h * rx;
- ry = h * ry;
- }
- var rx2 = rx * rx,
- ry2 = ry * ry,
- k = (large_arc_flag == sweep_flag ? -1 : 1) *
- math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
- cx = k * rx * y / ry + (x1 + x2) / 2,
- cy = k * -ry * x / rx + (y1 + y2) / 2,
- f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
- f2 = math.asin(((y2 - cy) / ry).toFixed(9));
-
- f1 = x1 < cx ? PI - f1 : f1;
- f2 = x2 < cx ? PI - f2 : f2;
- f1 < 0 && (f1 = PI * 2 + f1);
- f2 < 0 && (f2 = PI * 2 + f2);
- if (sweep_flag && f1 > f2) {
- f1 = f1 - PI * 2;
- }
- if (!sweep_flag && f2 > f1) {
- f2 = f2 - PI * 2;
- }
- } else {
- f1 = recursive[0];
- f2 = recursive[1];
- cx = recursive[2];
- cy = recursive[3];
- }
- var df = f2 - f1;
- if (abs(df) > _120) {
- var f2old = f2,
- x2old = x2,
- y2old = y2;
- f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
- x2 = cx + rx * math.cos(f2);
- y2 = cy + ry * math.sin(f2);
- res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
- }
- df = f2 - f1;
- var c1 = math.cos(f1),
- s1 = math.sin(f1),
- c2 = math.cos(f2),
- s2 = math.sin(f2),
- t = math.tan(df / 4),
- hx = 4 / 3 * rx * t,
- hy = 4 / 3 * ry * t,
- m1 = [x1, y1],
- m2 = [x1 + hx * s1, y1 - hy * c1],
- m3 = [x2 + hx * s2, y2 - hy * c2],
- m4 = [x2, y2];
- m2[0] = 2 * m1[0] - m2[0];
- m2[1] = 2 * m1[1] - m2[1];
- if (recursive) {
- return [m2, m3, m4].concat(res);
- } else {
- res = [m2, m3, m4].concat(res).join().split(",");
- var newres = [];
- for (var i = 0, ii = res.length; i < ii; i++) {
- newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
- }
- return newres;
- }
- }
- function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
- var t1 = 1 - t;
- return {
- x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
- y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
- };
- }
-
- // Returns bounding box of cubic bezier curve.
- // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
- // Original version: NISHIO Hirokazu
- // Modifications: https://github.com/timo22345
- function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
- var tvalues = [],
- bounds = [[], []],
- a, b, c, t, t1, t2, b2ac, sqrtb2ac;
- for (var i = 0; i < 2; ++i) {
- if (i == 0) {
- b = 6 * x0 - 12 * x1 + 6 * x2;
- a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
- c = 3 * x1 - 3 * x0;
- } else {
- b = 6 * y0 - 12 * y1 + 6 * y2;
- a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
- c = 3 * y1 - 3 * y0;
- }
- if (abs(a) < 1e-12) {
- if (abs(b) < 1e-12) {
- continue;
- }
- t = -c / b;
- if (0 < t && t < 1) {
- tvalues.push(t);
- }
- continue;
- }
- b2ac = b * b - 4 * c * a;
- sqrtb2ac = math.sqrt(b2ac);
- if (b2ac < 0) {
- continue;
- }
- t1 = (-b + sqrtb2ac) / (2 * a);
- if (0 < t1 && t1 < 1) {
- tvalues.push(t1);
- }
- t2 = (-b - sqrtb2ac) / (2 * a);
- if (0 < t2 && t2 < 1) {
- tvalues.push(t2);
- }
- }
-
- var x, y, j = tvalues.length,
- jlen = j,
- mt;
- while (j--) {
- t = tvalues[j];
- mt = 1 - t;
- bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
- bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
- }
-
- bounds[0][jlen] = x0;
- bounds[1][jlen] = y0;
- bounds[0][jlen + 1] = x3;
- bounds[1][jlen + 1] = y3;
- bounds[0].length = bounds[1].length = jlen + 2;
-
-
- return {
- min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},
- max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}
- };
- }
-
- function path2curve(path, path2) {
- var pth = !path2 && paths(path);
- if (!path2 && pth.curve) {
- return pathClone(pth.curve);
- }
- var p = pathToAbsolute(path),
- p2 = path2 && pathToAbsolute(path2),
- attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
- attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
- processPath = function (path, d, pcom) {
- var nx, ny;
- if (!path) {
- return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
- }
- !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);
- switch (path[0]) {
- case "M":
- d.X = path[1];
- d.Y = path[2];
- break;
- case "A":
- path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
- break;
- case "S":
- if (pcom == "C" || pcom == "S") { // In "S" case we have to take into account, if the previous command is C/S.
- nx = d.x * 2 - d.bx; // And reflect the previous
- ny = d.y * 2 - d.by; // command's control point relative to the current point.
- }
- else { // or some else or nothing
- nx = d.x;
- ny = d.y;
- }
- path = ["C", nx, ny].concat(path.slice(1));
- break;
- case "T":
- if (pcom == "Q" || pcom == "T") { // In "T" case we have to take into account, if the previous command is Q/T.
- d.qx = d.x * 2 - d.qx; // And make a reflection similar
- d.qy = d.y * 2 - d.qy; // to case "S".
- }
- else { // or something else or nothing
- d.qx = d.x;
- d.qy = d.y;
- }
- path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
- break;
- case "Q":
- d.qx = path[1];
- d.qy = path[2];
- path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
- break;
- case "L":
- path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
- break;
- case "H":
- path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
- break;
- case "V":
- path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
- break;
- case "Z":
- path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
- break;
- }
- return path;
- },
- fixArc = function (pp, i) {
- if (pp[i].length > 7) {
- pp[i].shift();
- var pi = pp[i];
- while (pi.length) {
- pcoms1[i] = "A"; // if created multiple C:s, their original seg is saved
- p2 && (pcoms2[i] = "A"); // the same as above
- pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
- }
- pp.splice(i, 1);
- ii = mmax(p.length, p2 && p2.length || 0);
- }
- },
- fixM = function (path1, path2, a1, a2, i) {
- if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
- path2.splice(i, 0, ["M", a2.x, a2.y]);
- a1.bx = 0;
- a1.by = 0;
- a1.x = path1[i][1];
- a1.y = path1[i][2];
- ii = mmax(p.length, p2 && p2.length || 0);
- }
- },
- pcoms1 = [], // path commands of original path p
- pcoms2 = [], // path commands of original path p2
- pfirst = "", // temporary holder for original path command
- pcom = ""; // holder for previous path command of original path
- for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
- p[i] && (pfirst = p[i][0]); // save current path command
-
- if (pfirst != "C") // C is not saved yet, because it may be result of conversion
- {
- pcoms1[i] = pfirst; // Save current path command
- i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom
- }
- p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath
-
- if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the only command
- // which may produce multiple C:s
- // so we have to make sure that C is also C in original path
-
- fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1
-
- if (p2) { // the same procedures is done to p2
- p2[i] && (pfirst = p2[i][0]);
- if (pfirst != "C") {
- pcoms2[i] = pfirst;
- i && (pcom = pcoms2[i - 1]);
- }
- p2[i] = processPath(p2[i], attrs2, pcom);
-
- if (pcoms2[i] != "A" && pfirst == "C") {
- pcoms2[i] = "C";
- }
-
- fixArc(p2, i);
- }
- fixM(p, p2, attrs, attrs2, i);
- fixM(p2, p, attrs2, attrs, i);
- var seg = p[i],
- seg2 = p2 && p2[i],
- seglen = seg.length,
- seg2len = p2 && seg2.length;
- attrs.x = seg[seglen - 2];
- attrs.y = seg[seglen - 1];
- attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
- attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
- attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
- attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
- attrs2.x = p2 && seg2[seg2len - 2];
- attrs2.y = p2 && seg2[seg2len - 1];
- }
- if (!p2) {
- pth.curve = pathClone(p);
- }
- return p2 ? [p, p2] : p;
- }
- function mapPath(path, matrix) {
- if (!matrix) {
- return path;
- }
- var x, y, i, j, ii, jj, pathi;
- path = path2curve(path);
- for (i = 0, ii = path.length; i < ii; i++) {
- pathi = path[i];
- for (j = 1, jj = pathi.length; j < jj; j += 2) {
- x = matrix.x(pathi[j], pathi[j + 1]);
- y = matrix.y(pathi[j], pathi[j + 1]);
- pathi[j] = x;
- pathi[j + 1] = y;
- }
- }
- return path;
- }
-
- // http://schepers.cc/getting-to-the-point
- function catmullRom2bezier(crp, z) {
- var d = [];
- for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
- var p = [
- {x: +crp[i - 2], y: +crp[i - 1]},
- {x: +crp[i], y: +crp[i + 1]},
- {x: +crp[i + 2], y: +crp[i + 3]},
- {x: +crp[i + 4], y: +crp[i + 5]}
- ];
- if (z) {
- if (!i) {
- p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};
- } else if (iLen - 4 == i) {
- p[3] = {x: +crp[0], y: +crp[1]};
- } else if (iLen - 2 == i) {
- p[2] = {x: +crp[0], y: +crp[1]};
- p[3] = {x: +crp[2], y: +crp[3]};
- }
- } else {
- if (iLen - 4 == i) {
- p[3] = p[2];
- } else if (!i) {
- p[0] = {x: +crp[i], y: +crp[i + 1]};
- }
- }
- d.push(["C",
- (-p[0].x + 6 * p[1].x + p[2].x) / 6,
- (-p[0].y + 6 * p[1].y + p[2].y) / 6,
- (p[1].x + 6 * p[2].x - p[3].x) / 6,
- (p[1].y + 6*p[2].y - p[3].y) / 6,
- p[2].x,
- p[2].y
- ]);
- }
-
- return d;
- }
-
- // export
- Snap.path = paths;
-
- /*\
- * Snap.path.getTotalLength
- [ method ]
- **
- * Returns the length of the given path in pixels
- **
- - path (string) SVG path string
- **
- = (number) length
- \*/
- Snap.path.getTotalLength = getTotalLength;
- /*\
- * Snap.path.getPointAtLength
- [ method ]
- **
- * Returns the coordinates of the point located at the given length along the given path
- **
- - path (string) SVG path string
- - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
- **
- = (object) representation of the point:
- o {
- o x: (number) x coordinate,
- o y: (number) y coordinate,
- o alpha: (number) angle of derivative
- o }
- \*/
- Snap.path.getPointAtLength = getPointAtLength;
- /*\
- * Snap.path.getSubpath
- [ method ]
- **
- * Returns the subpath of a given path between given start and end lengths
- **
- - path (string) SVG path string
- - from (number) length, in pixels, from the start of the path to the start of the segment
- - to (number) length, in pixels, from the start of the path to the end of the segment
- **
- = (string) path string definition for the segment
- \*/
- Snap.path.getSubpath = function (path, from, to) {
- if (this.getTotalLength(path) - to < 1e-6) {
- return getSubpathsAtLength(path, from).end;
- }
- var a = getSubpathsAtLength(path, to, 1);
- return from ? getSubpathsAtLength(a, from).end : a;
- };
- /*\
- * Element.getTotalLength
- [ method ]
- **
- * Returns the length of the path in pixels (only works for `path` elements)
- = (number) length
- \*/
- elproto.getTotalLength = function () {
- if (this.node.getTotalLength) {
- return this.node.getTotalLength();
- }
- };
- // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?
- /*\
- * Element.getPointAtLength
- [ method ]
- **
- * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)
- **
- - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
- **
- = (object) representation of the point:
- o {
- o x: (number) x coordinate,
- o y: (number) y coordinate,
- o alpha: (number) angle of derivative
- o }
- \*/
- elproto.getPointAtLength = function (length) {
- return getPointAtLength(this.attr("d"), length);
- };
- // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.
- /*\
- * Element.getSubpath
- [ method ]
- **
- * Returns subpath of a given element from given start and end lengths (only works for `path` elements)
- **
- - from (number) length, in pixels, from the start of the path to the start of the segment
- - to (number) length, in pixels, from the start of the path to the end of the segment
- **
- = (string) path string definition for the segment
- \*/
- elproto.getSubpath = function (from, to) {
- return Snap.path.getSubpath(this.attr("d"), from, to);
- };
- Snap._.box = box;
- /*\
- * Snap.path.findDotsAtSegment
- [ method ]
- **
- * Utility method
- **
- * Finds dot coordinates on the given cubic beziér curve at the given t
- - p1x (number) x of the first point of the curve
- - p1y (number) y of the first point of the curve
- - c1x (number) x of the first anchor of the curve
- - c1y (number) y of the first anchor of the curve
- - c2x (number) x of the second anchor of the curve
- - c2y (number) y of the second anchor of the curve
- - p2x (number) x of the second point of the curve
- - p2y (number) y of the second point of the curve
- - t (number) position on the curve (0..1)
- = (object) point information in format:
- o {
- o x: (number) x coordinate of the point,
- o y: (number) y coordinate of the point,
- o m: {
- o x: (number) x coordinate of the left anchor,
- o y: (number) y coordinate of the left anchor
- o },
- o n: {
- o x: (number) x coordinate of the right anchor,
- o y: (number) y coordinate of the right anchor
- o },
- o start: {
- o x: (number) x coordinate of the start of the curve,
- o y: (number) y coordinate of the start of the curve
- o },
- o end: {
- o x: (number) x coordinate of the end of the curve,
- o y: (number) y coordinate of the end of the curve
- o },
- o alpha: (number) angle of the curve derivative at the point
- o }
- \*/
- Snap.path.findDotsAtSegment = findDotsAtSegment;
- /*\
- * Snap.path.bezierBBox
- [ method ]
- **
- * Utility method
- **
- * Returns the bounding box of a given cubic beziér curve
- - p1x (number) x of the first point of the curve
- - p1y (number) y of the first point of the curve
- - c1x (number) x of the first anchor of the curve
- - c1y (number) y of the first anchor of the curve
- - c2x (number) x of the second anchor of the curve
- - c2y (number) y of the second anchor of the curve
- - p2x (number) x of the second point of the curve
- - p2y (number) y of the second point of the curve
- * or
- - bez (array) array of six points for beziér curve
- = (object) bounding box
- o {
- o x: (number) x coordinate of the left top point of the box,
- o y: (number) y coordinate of the left top point of the box,
- o x2: (number) x coordinate of the right bottom point of the box,
- o y2: (number) y coordinate of the right bottom point of the box,
- o width: (number) width of the box,
- o height: (number) height of the box
- o }
- \*/
- Snap.path.bezierBBox = bezierBBox;
- /*\
- * Snap.path.isPointInsideBBox
- [ method ]
- **
- * Utility method
- **
- * Returns `true` if given point is inside bounding box
- - bbox (string) bounding box
- - x (string) x coordinate of the point
- - y (string) y coordinate of the point
- = (boolean) `true` if point is inside
- \*/
- Snap.path.isPointInsideBBox = isPointInsideBBox;
- Snap.closest = function (x, y, X, Y) {
- var r = 100,
- b = box(x - r / 2, y - r / 2, r, r),
- inside = [],
- getter = X[0].hasOwnProperty("x") ? function (i) {
- return {
- x: X[i].x,
- y: X[i].y
- };
- } : function (i) {
- return {
- x: X[i],
- y: Y[i]
- };
- },
- found = 0;
- while (r <= 1e6 && !found) {
- for (var i = 0, ii = X.length; i < ii; i++) {
- var xy = getter(i);
- if (isPointInsideBBox(b, xy.x, xy.y)) {
- found++;
- inside.push(xy);
- break;
- }
- }
- if (!found) {
- r *= 2;
- b = box(x - r / 2, y - r / 2, r, r)
- }
- }
- if (r == 1e6) {
- return;
- }
- var len = Infinity,
- res;
- for (i = 0, ii = inside.length; i < ii; i++) {
- var l = Snap.len(x, y, inside[i].x, inside[i].y);
- if (len > l) {
- len = l;
- inside[i].len = l;
- res = inside[i];
- }
- }
- return res;
- };
- /*\
- * Snap.path.isBBoxIntersect
- [ method ]
- **
- * Utility method
- **
- * Returns `true` if two bounding boxes intersect
- - bbox1 (string) first bounding box
- - bbox2 (string) second bounding box
- = (boolean) `true` if bounding boxes intersect
- \*/
- Snap.path.isBBoxIntersect = isBBoxIntersect;
- /*\
- * Snap.path.intersection
- [ method ]
- **
- * Utility method
- **
- * Finds intersections of two paths
- - path1 (string) path string
- - path2 (string) path string
- = (array) dots of intersection
- o [
- o {
- o x: (number) x coordinate of the point,
- o y: (number) y coordinate of the point,
- o t1: (number) t value for segment of path1,
- o t2: (number) t value for segment of path2,
- o segment1: (number) order number for segment of path1,
- o segment2: (number) order number for segment of path2,
- o bez1: (array) eight coordinates representing beziér curve for the segment of path1,
- o bez2: (array) eight coordinates representing beziér curve for the segment of path2
- o }
- o ]
- \*/
- Snap.path.intersection = pathIntersection;
- Snap.path.intersectionNumber = pathIntersectionNumber;
- /*\
- * Snap.path.isPointInside
- [ method ]
- **
- * Utility method
- **
- * Returns `true` if given point is inside a given closed path.
- *
- * Note: fill mode doesn’t affect the result of this method.
- - path (string) path string
- - x (number) x of the point
- - y (number) y of the point
- = (boolean) `true` if point is inside the path
- \*/
- Snap.path.isPointInside = isPointInsidePath;
- /*\
- * Snap.path.getBBox
- [ method ]
- **
- * Utility method
- **
- * Returns the bounding box of a given path
- - path (string) path string
- = (object) bounding box
- o {
- o x: (number) x coordinate of the left top point of the box,
- o y: (number) y coordinate of the left top point of the box,
- o x2: (number) x coordinate of the right bottom point of the box,
- o y2: (number) y coordinate of the right bottom point of the box,
- o width: (number) width of the box,
- o height: (number) height of the box
- o }
- \*/
- Snap.path.getBBox = pathBBox;
- Snap.path.get = getPath;
- /*\
- * Snap.path.toRelative
- [ method ]
- **
- * Utility method
- **
- * Converts path coordinates into relative values
- - path (string) path string
- = (array) path string
- \*/
- Snap.path.toRelative = pathToRelative;
- /*\
- * Snap.path.toAbsolute
- [ method ]
- **
- * Utility method
- **
- * Converts path coordinates into absolute values
- - path (string) path string
- = (array) path string
- \*/
- Snap.path.toAbsolute = pathToAbsolute;
- /*\
- * Snap.path.toCubic
- [ method ]
- **
- * Utility method
- **
- * Converts path to a new path where all segments are cubic beziér curves
- - pathString (string|array) path string or array of segments
- = (array) array of segments
- \*/
- Snap.path.toCubic = path2curve;
- /*\
- * Snap.path.map
- [ method ]
- **
- * Transform the path string with the given matrix
- - path (string) path string
- - matrix (object) see @Matrix
- = (string) transformed path string
- \*/
- Snap.path.map = mapPath;
- Snap.path.toString = toString;
- Snap.path.clone = pathClone;
- });
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob) {
- var mmax = Math.max,
- mmin = Math.min;
-
- // Set
- var Set = function (items) {
- this.items = [];
- this.bindings = {};
- this.length = 0;
- this.type = "set";
- if (items) {
- for (var i = 0, ii = items.length; i < ii; i++) {
- if (items[i]) {
- this[this.items.length] = this.items[this.items.length] = items[i];
- this.length++;
- }
- }
- }
- },
- setproto = Set.prototype;
- /*\
- * Set.push
- [ method ]
- **
- * Adds each argument to the current set
- = (object) original element
- \*/
- setproto.push = function () {
- var item,
- len;
- for (var i = 0, ii = arguments.length; i < ii; i++) {
- item = arguments[i];
- if (item) {
- len = this.items.length;
- this[len] = this.items[len] = item;
- this.length++;
- }
- }
- return this;
- };
- /*\
- * Set.pop
- [ method ]
- **
- * Removes last element and returns it
- = (object) element
- \*/
- setproto.pop = function () {
- this.length && delete this[this.length--];
- return this.items.pop();
- };
- /*\
- * Set.forEach
- [ method ]
- **
- * Executes given function for each element in the set
- *
- * If the function returns `false`, the loop stops running.
- **
- - callback (function) function to run
- - thisArg (object) context object for the callback
- = (object) Set object
- \*/
- setproto.forEach = function (callback, thisArg) {
- for (var i = 0, ii = this.items.length; i < ii; i++) {
- if (callback.call(thisArg, this.items[i], i) === false) {
- return this;
- }
- }
- return this;
- };
- /*\
- * Set.animate
- [ method ]
- **
- * Animates each element in set in sync.
- *
- **
- - attrs (object) key-value pairs of destination attributes
- - duration (number) duration of the animation in milliseconds
- - easing (function) #optional easing function from @mina or custom
- - callback (function) #optional callback function that executes when the animation ends
- * or
- - animation (array) array of animation parameter for each element in set in format `[attrs, duration, easing, callback]`
- > Usage
- | // animate all elements in set to radius 10
- | set.animate({r: 10}, 500, mina.easein);
- | // or
- | // animate first element to radius 10, but second to radius 20 and in different time
- | set.animate([{r: 10}, 500, mina.easein], [{r: 20}, 1500, mina.easein]);
- = (Element) the current element
- \*/
- setproto.animate = function (attrs, ms, easing, callback) {
- if (typeof easing == "function" && !easing.length) {
- callback = easing;
- easing = mina.linear;
- }
- if (attrs instanceof Snap._.Animation) {
- callback = attrs.callback;
- easing = attrs.easing;
- ms = easing.dur;
- attrs = attrs.attr;
- }
- var args = arguments;
- if (Snap.is(attrs, "array") && Snap.is(args[args.length - 1], "array")) {
- var each = true;
- }
- var begin,
- handler = function () {
- if (begin) {
- this.b = begin;
- } else {
- begin = this.b;
- }
- },
- cb = 0,
- set = this,
- callbacker = callback && function () {
- if (++cb == set.length) {
- callback.call(this);
- }
- };
- return this.forEach(function (el, i) {
- eve.once("snap.animcreated." + el.id, handler);
- if (each) {
- args[i] && el.animate.apply(el, args[i]);
- } else {
- el.animate(attrs, ms, easing, callbacker);
- }
- });
- };
- setproto.remove = function () {
- while (this.length) {
- this.pop().remove();
- }
- return this;
- };
- /*\
- * Set.bind
- [ method ]
- **
- * Specifies how to handle a specific attribute when applied
- * to a set.
- *
- **
- - attr (string) attribute name
- - callback (function) function to run
- * or
- - attr (string) attribute name
- - element (Element) specific element in the set to apply the attribute to
- * or
- - attr (string) attribute name
- - element (Element) specific element in the set to apply the attribute to
- - eattr (string) attribute on the element to bind the attribute to
- = (object) Set object
- \*/
- setproto.bind = function (attr, a, b) {
- var data = {};
- if (typeof a == "function") {
- this.bindings[attr] = a;
- } else {
- var aname = b || attr;
- this.bindings[attr] = function (v) {
- data[aname] = v;
- a.attr(data);
- };
- }
- return this;
- };
- setproto.attr = function (value) {
- var unbound = {};
- for (var k in value) {
- if (this.bindings[k]) {
- this.bindings[k](value[k]);
- } else {
- unbound[k] = value[k];
- }
- }
- for (var i = 0, ii = this.items.length; i < ii; i++) {
- this.items[i].attr(unbound);
- }
- return this;
- };
- /*\
- * Set.clear
- [ method ]
- **
- * Removes all elements from the set
- \*/
- setproto.clear = function () {
- while (this.length) {
- this.pop();
- }
- };
- /*\
- * Set.splice
- [ method ]
- **
- * Removes range of elements from the set
- **
- - index (number) position of the deletion
- - count (number) number of element to remove
- - insertion… (object) #optional elements to insert
- = (object) set elements that were deleted
- \*/
- setproto.splice = function (index, count, insertion) {
- index = index < 0 ? mmax(this.length + index, 0) : index;
- count = mmax(0, mmin(this.length - index, count));
- var tail = [],
- todel = [],
- args = [],
- i;
- for (i = 2; i < arguments.length; i++) {
- args.push(arguments[i]);
- }
- for (i = 0; i < count; i++) {
- todel.push(this[index + i]);
- }
- for (; i < this.length - index; i++) {
- tail.push(this[index + i]);
- }
- var arglen = args.length;
- for (i = 0; i < arglen + tail.length; i++) {
- this.items[index + i] = this[index + i] = i < arglen ? args[i] : tail[i - arglen];
- }
- i = this.items.length = this.length -= count - arglen;
- while (this[i]) {
- delete this[i++];
- }
- return new Set(todel);
- };
- /*\
- * Set.exclude
- [ method ]
- **
- * Removes given element from the set
- **
- - element (object) element to remove
- = (boolean) `true` if object was found and removed from the set
- \*/
- setproto.exclude = function (el) {
- for (var i = 0, ii = this.length; i < ii; i++) if (this[i] == el) {
- this.splice(i, 1);
- return true;
- }
- return false;
- };
- setproto.insertAfter = function (el) {
- var i = this.items.length;
- while (i--) {
- this.items[i].insertAfter(el);
- }
- return this;
- };
- setproto.getBBox = function () {
- var x = [],
- y = [],
- x2 = [],
- y2 = [];
- for (var i = this.items.length; i--;) if (!this.items[i].removed) {
- var box = this.items[i].getBBox();
- x.push(box.x);
- y.push(box.y);
- x2.push(box.x + box.width);
- y2.push(box.y + box.height);
- }
- x = mmin.apply(0, x);
- y = mmin.apply(0, y);
- x2 = mmax.apply(0, x2);
- y2 = mmax.apply(0, y2);
- return {
- x: x,
- y: y,
- x2: x2,
- y2: y2,
- width: x2 - x,
- height: y2 - y,
- cx: x + (x2 - x) / 2,
- cy: y + (y2 - y) / 2
- };
- };
- setproto.clone = function (s) {
- s = new Set;
- for (var i = 0, ii = this.items.length; i < ii; i++) {
- s.push(this.items[i].clone());
- }
- return s;
- };
- setproto.toString = function () {
- return "Snap\u2018s set";
- };
- setproto.type = "set";
- // export
- Snap.Set = Set;
- Snap.set = function () {
- var set = new Set;
- if (arguments.length) {
- set.push.apply(set, Array.prototype.slice.call(arguments, 0));
- }
- return set;
- };
- });
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob) {
- var names = {},
- reUnit = /[a-z]+$/i,
- Str = String;
- names.stroke = names.fill = "colour";
- function getEmpty(item) {
- var l = item[0];
- switch (l.toLowerCase()) {
- case "t": return [l, 0, 0];
- case "m": return [l, 1, 0, 0, 1, 0, 0];
- case "r": if (item.length == 4) {
- return [l, 0, item[2], item[3]];
- } else {
- return [l, 0];
- }
- case "s": if (item.length == 5) {
- return [l, 1, 1, item[3], item[4]];
- } else if (item.length == 3) {
- return [l, 1, 1];
- } else {
- return [l, 1];
- }
- }
- }
- function equaliseTransform(t1, t2, getBBox) {
- t2 = Str(t2).replace(/\.{3}|\u2026/g, t1);
- t1 = Snap.parseTransformString(t1) || [];
- t2 = Snap.parseTransformString(t2) || [];
- var maxlength = Math.max(t1.length, t2.length),
- from = [],
- to = [],
- i = 0, j, jj,
- tt1, tt2;
- for (; i < maxlength; i++) {
- tt1 = t1[i] || getEmpty(t2[i]);
- tt2 = t2[i] || getEmpty(tt1);
- if ((tt1[0] != tt2[0]) ||
- (tt1[0].toLowerCase() == "r" && (tt1[2] != tt2[2] || tt1[3] != tt2[3])) ||
- (tt1[0].toLowerCase() == "s" && (tt1[3] != tt2[3] || tt1[4] != tt2[4]))
- ) {
- t1 = Snap._.transform2matrix(t1, getBBox());
- t2 = Snap._.transform2matrix(t2, getBBox());
- from = [["m", t1.a, t1.b, t1.c, t1.d, t1.e, t1.f]];
- to = [["m", t2.a, t2.b, t2.c, t2.d, t2.e, t2.f]];
- break;
- }
- from[i] = [];
- to[i] = [];
- for (j = 0, jj = Math.max(tt1.length, tt2.length); j < jj; j++) {
- j in tt1 && (from[i][j] = tt1[j]);
- j in tt2 && (to[i][j] = tt2[j]);
- }
- }
- return {
- from: path2array(from),
- to: path2array(to),
- f: getPath(from)
- };
- }
- function getNumber(val) {
- return val;
- }
- function getUnit(unit) {
- return function (val) {
- return +val.toFixed(3) + unit;
- };
- }
- function getViewBox(val) {
- return val.join(" ");
- }
- function getColour(clr) {
- return Snap.rgb(clr[0], clr[1], clr[2]);
- }
- function getPath(path) {
- var k = 0, i, ii, j, jj, out, a, b = [];
- for (i = 0, ii = path.length; i < ii; i++) {
- out = "[";
- a = ['"' + path[i][0] + '"'];
- for (j = 1, jj = path[i].length; j < jj; j++) {
- a[j] = "val[" + (k++) + "]";
- }
- out += a + "]";
- b[i] = out;
- }
- return Function("val", "return Snap.path.toString.call([" + b + "])");
- }
- function path2array(path) {
- var out = [];
- for (var i = 0, ii = path.length; i < ii; i++) {
- for (var j = 1, jj = path[i].length; j < jj; j++) {
- out.push(path[i][j]);
- }
- }
- return out;
- }
- function isNumeric(obj) {
- return isFinite(parseFloat(obj));
- }
- function arrayEqual(arr1, arr2) {
- if (!Snap.is(arr1, "array") || !Snap.is(arr2, "array")) {
- return false;
- }
- return arr1.toString() == arr2.toString();
- }
- Element.prototype.equal = function (name, b) {
- return eve("snap.util.equal", this, name, b).firstDefined();
- };
- eve.on("snap.util.equal", function (name, b) {
- var A, B, a = Str(this.attr(name) || ""),
- el = this;
- if (isNumeric(a) && isNumeric(b)) {
- return {
- from: parseFloat(a),
- to: parseFloat(b),
- f: getNumber
- };
- }
- if (names[name] == "colour") {
- A = Snap.color(a);
- B = Snap.color(b);
- return {
- from: [A.r, A.g, A.b, A.opacity],
- to: [B.r, B.g, B.b, B.opacity],
- f: getColour
- };
- }
- if (name == "viewBox") {
- A = this.attr(name).vb.split(" ").map(Number);
- B = b.split(" ").map(Number);
- return {
- from: A,
- to: B,
- f: getViewBox
- };
- }
- if (name == "transform" || name == "gradientTransform" || name == "patternTransform") {
- if (b instanceof Snap.Matrix) {
- b = b.toTransformString();
- }
- if (!Snap._.rgTransform.test(b)) {
- b = Snap._.svgTransform2string(b);
- }
- return equaliseTransform(a, b, function () {
- return el.getBBox(1);
- });
- }
- if (name == "d" || name == "path") {
- A = Snap.path.toCubic(a, b);
- return {
- from: path2array(A[0]),
- to: path2array(A[1]),
- f: getPath(A[0])
- };
- }
- if (name == "points") {
- A = Str(a).split(Snap._.separator);
- B = Str(b).split(Snap._.separator);
- return {
- from: A,
- to: B,
- f: function (val) { return val; }
- };
- }
- var aUnit = a.match(reUnit),
- bUnit = Str(b).match(reUnit);
- if (aUnit && arrayEqual(aUnit, bUnit)) {
- return {
- from: parseFloat(a),
- to: parseFloat(b),
- f: getUnit(aUnit)
- };
- } else {
- return {
- from: this.asPX(name),
- to: this.asPX(name, b),
- f: getNumber
- };
- }
- });
- });
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob) {
- var elproto = Element.prototype,
- has = "hasOwnProperty",
- supportsTouch = "createTouch" in glob.doc,
- events = [
- "click", "dblclick", "mousedown", "mousemove", "mouseout",
- "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
- "touchcancel"
- ],
- touchMap = {
- mousedown: "touchstart",
- mousemove: "touchmove",
- mouseup: "touchend"
- },
- getScroll = function (xy, el) {
- var name = xy == "y" ? "scrollTop" : "scrollLeft",
- doc = el && el.node ? el.node.ownerDocument : glob.doc;
- return doc[name in doc.documentElement ? "documentElement" : "body"][name];
- },
- preventDefault = function () {
- this.returnValue = false;
- },
- preventTouch = function () {
- return this.originalEvent.preventDefault();
- },
- stopPropagation = function () {
- this.cancelBubble = true;
- },
- stopTouch = function () {
- return this.originalEvent.stopPropagation();
- },
- addEvent = function (obj, type, fn, element) {
- var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
- f = function (e) {
- var scrollY = getScroll("y", element),
- scrollX = getScroll("x", element);
- if (supportsTouch && touchMap[has](type)) {
- for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
- if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
- var olde = e;
- e = e.targetTouches[i];
- e.originalEvent = olde;
- e.preventDefault = preventTouch;
- e.stopPropagation = stopTouch;
- break;
- }
- }
- }
- var x = e.clientX + scrollX,
- y = e.clientY + scrollY;
- return fn.call(element, e, x, y);
- };
-
- if (type !== realName) {
- obj.addEventListener(type, f, false);
- }
-
- obj.addEventListener(realName, f, false);
-
- return function () {
- if (type !== realName) {
- obj.removeEventListener(type, f, false);
- }
-
- obj.removeEventListener(realName, f, false);
- return true;
- };
- },
- drag = [],
- dragMove = function (e) {
- var x = e.clientX,
- y = e.clientY,
- scrollY = getScroll("y"),
- scrollX = getScroll("x"),
- dragi,
- j = drag.length;
- while (j--) {
- dragi = drag[j];
- if (supportsTouch) {
- var i = e.touches && e.touches.length,
- touch;
- while (i--) {
- touch = e.touches[i];
- if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
- x = touch.clientX;
- y = touch.clientY;
- (e.originalEvent ? e.originalEvent : e).preventDefault();
- break;
- }
- }
- } else {
- e.preventDefault();
- }
- var node = dragi.el.node,
- o,
- next = node.nextSibling,
- parent = node.parentNode,
- display = node.style.display;
- // glob.win.opera && parent.removeChild(node);
- // node.style.display = "none";
- // o = dragi.el.paper.getElementByPoint(x, y);
- // node.style.display = display;
- // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));
- // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
- x += scrollX;
- y += scrollY;
- eve("snap.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
- }
- },
- dragUp = function (e) {
- Snap.unmousemove(dragMove).unmouseup(dragUp);
- var i = drag.length,
- dragi;
- while (i--) {
- dragi = drag[i];
- dragi.el._drag = {};
- eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
- eve.off("snap.drag.*." + dragi.el.id);
- }
- drag = [];
- };
- /*\
- * Element.click
- [ method ]
- **
- * Adds a click event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.unclick
- [ method ]
- **
- * Removes a click event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.dblclick
- [ method ]
- **
- * Adds a double click event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.undblclick
- [ method ]
- **
- * Removes a double click event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.mousedown
- [ method ]
- **
- * Adds a mousedown event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.unmousedown
- [ method ]
- **
- * Removes a mousedown event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.mousemove
- [ method ]
- **
- * Adds a mousemove event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.unmousemove
- [ method ]
- **
- * Removes a mousemove event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.mouseout
- [ method ]
- **
- * Adds a mouseout event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.unmouseout
- [ method ]
- **
- * Removes a mouseout event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.mouseover
- [ method ]
- **
- * Adds a mouseover event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.unmouseover
- [ method ]
- **
- * Removes a mouseover event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.mouseup
- [ method ]
- **
- * Adds a mouseup event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.unmouseup
- [ method ]
- **
- * Removes a mouseup event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.touchstart
- [ method ]
- **
- * Adds a touchstart event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.untouchstart
- [ method ]
- **
- * Removes a touchstart event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.touchmove
- [ method ]
- **
- * Adds a touchmove event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.untouchmove
- [ method ]
- **
- * Removes a touchmove event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.touchend
- [ method ]
- **
- * Adds a touchend event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.untouchend
- [ method ]
- **
- * Removes a touchend event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
-
- /*\
- * Element.touchcancel
- [ method ]
- **
- * Adds a touchcancel event handler to the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- /*\
- * Element.untouchcancel
- [ method ]
- **
- * Removes a touchcancel event handler from the element
- - handler (function) handler for the event
- = (object) @Element
- \*/
- for (var i = events.length; i--;) {
- (function (eventName) {
- Snap[eventName] = elproto[eventName] = function (fn, scope) {
- if (Snap.is(fn, "function")) {
- this.events = this.events || [];
- this.events.push({
- name: eventName,
- f: fn,
- unbind: addEvent(this.node || document, eventName, fn, scope || this)
- });
- } else {
- for (var i = 0, ii = this.events.length; i < ii; i++) if (this.events[i].name == eventName) {
- try {
- this.events[i].f.call(this);
- } catch (e) {}
- }
- }
- return this;
- };
- Snap["un" + eventName] =
- elproto["un" + eventName] = function (fn) {
- var events = this.events || [],
- l = events.length;
- while (l--) if (events[l].name == eventName &&
- (events[l].f == fn || !fn)) {
- events[l].unbind();
- events.splice(l, 1);
- !events.length && delete this.events;
- return this;
- }
- return this;
- };
- })(events[i]);
- }
- /*\
- * Element.hover
- [ method ]
- **
- * Adds hover event handlers to the element
- - f_in (function) handler for hover in
- - f_out (function) handler for hover out
- - icontext (object) #optional context for hover in handler
- - ocontext (object) #optional context for hover out handler
- = (object) @Element
- \*/
- elproto.hover = function (f_in, f_out, scope_in, scope_out) {
- return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
- };
- /*\
- * Element.unhover
- [ method ]
- **
- * Removes hover event handlers from the element
- - f_in (function) handler for hover in
- - f_out (function) handler for hover out
- = (object) @Element
- \*/
- elproto.unhover = function (f_in, f_out) {
- return this.unmouseover(f_in).unmouseout(f_out);
- };
- var draggable = [];
- // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.
- // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?
- // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.
- // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?
- /*\
- * Element.drag
- [ method ]
- **
- * Adds event handlers for an element's drag gesture
- **
- - onmove (function) handler for moving
- - onstart (function) handler for drag start
- - onend (function) handler for drag end
- - mcontext (object) #optional context for moving handler
- - scontext (object) #optional context for drag start handler
- - econtext (object) #optional context for drag end handler
- * Additionaly following `drag` events are triggered: `drag.start.<id>` on start,
- * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element
- * `drag.over.<id>` fires as well.
- *
- * Start event and start handler are called in specified context or in context of the element with following parameters:
- o x (number) x position of the mouse
- o y (number) y position of the mouse
- o event (object) DOM event object
- * Move event and move handler are called in specified context or in context of the element with following parameters:
- o dx (number) shift by x from the start point
- o dy (number) shift by y from the start point
- o x (number) x position of the mouse
- o y (number) y position of the mouse
- o event (object) DOM event object
- * End event and end handler are called in specified context or in context of the element with following parameters:
- o event (object) DOM event object
- = (object) @Element
- \*/
- elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {
- var el = this;
- if (!arguments.length) {
- var origTransform;
- return el.drag(function (dx, dy) {
- this.attr({
- transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
- });
- }, function () {
- origTransform = this.transform().local;
- });
- }
- function start(e, x, y) {
- (e.originalEvent || e).preventDefault();
- el._drag.x = x;
- el._drag.y = y;
- el._drag.id = e.identifier;
- !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
- drag.push({el: el, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});
- onstart && eve.on("snap.drag.start." + el.id, onstart);
- onmove && eve.on("snap.drag.move." + el.id, onmove);
- onend && eve.on("snap.drag.end." + el.id, onend);
- eve("snap.drag.start." + el.id, start_scope || move_scope || el, x, y, e);
- }
- function init(e, x, y) {
- eve("snap.draginit." + el.id, el, e, x, y);
- }
- eve.on("snap.draginit." + el.id, start);
- el._drag = {};
- draggable.push({el: el, start: start, init: init});
- el.mousedown(init);
- return el;
- };
- /*
- * Element.onDragOver
- [ method ]
- **
- * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)
- - f (function) handler for event, first argument would be the element you are dragging over
- \*/
- // elproto.onDragOver = function (f) {
- // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over." + this.id);
- // };
- /*\
- * Element.undrag
- [ method ]
- **
- * Removes all drag event handlers from the given element
- \*/
- elproto.undrag = function () {
- var i = draggable.length;
- while (i--) if (draggable[i].el == this) {
- this.unmousedown(draggable[i].init);
- draggable.splice(i, 1);
- eve.unbind("snap.drag.*." + this.id);
- eve.unbind("snap.draginit." + this.id);
- }
- !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
- return this;
- };
- });
-
- // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob) {
- var elproto = Element.prototype,
- pproto = Paper.prototype,
- rgurl = /^\s*url\((.+)\)/,
- Str = String,
- $ = Snap._.$;
- Snap.filter = {};
- /*\
- * Paper.filter
- [ method ]
- **
- * Creates a `<filter>` element
- **
- - filstr (string) SVG fragment of filter provided as a string
- = (object) @Element
- * Note: It is recommended to use filters embedded into the page inside an empty SVG element.
- > Usage
- | var f = paper.filter('<feGaussianBlur stdDeviation="2"/>'),
- | c = paper.circle(10, 10, 10).attr({
- | filter: f
- | });
- \*/
- pproto.filter = function (filstr) {
- var paper = this;
- if (paper.type != "svg") {
- paper = paper.paper;
- }
- var f = Snap.parse(Str(filstr)),
- id = Snap._.id(),
- width = paper.node.offsetWidth,
- height = paper.node.offsetHeight,
- filter = $("filter");
- $(filter, {
- id: id,
- filterUnits: "userSpaceOnUse"
- });
- filter.appendChild(f.node);
- paper.defs.appendChild(filter);
- return new Element(filter);
- };
-
- eve.on("snap.util.getattr.filter", function () {
- eve.stop();
- var p = $(this.node, "filter");
- if (p) {
- var match = Str(p).match(rgurl);
- return match && Snap.select(match[1]);
- }
- });
- eve.on("snap.util.attr.filter", function (value) {
- if (value instanceof Element && value.type == "filter") {
- eve.stop();
- var id = value.node.id;
- if (!id) {
- $(value.node, {id: value.id});
- id = value.id;
- }
- $(this.node, {
- filter: Snap.url(id)
- });
- }
- if (!value || value == "none") {
- eve.stop();
- this.node.removeAttribute("filter");
- }
- });
- /*\
- * Snap.filter.blur
- [ method ]
- **
- * Returns an SVG markup string for the blur filter
- **
- - x (number) amount of horizontal blur, in pixels
- - y (number) #optional amount of vertical blur, in pixels
- = (string) filter representation
- > Usage
- | var f = paper.filter(Snap.filter.blur(5, 10)),
- | c = paper.circle(10, 10, 10).attr({
- | filter: f
- | });
- \*/
- Snap.filter.blur = function (x, y) {
- if (x == null) {
- x = 2;
- }
- var def = y == null ? x : [x, y];
- return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
- def: def
- });
- };
- Snap.filter.blur.toString = function () {
- return this();
- };
- /*\
- * Snap.filter.shadow
- [ method ]
- **
- * Returns an SVG markup string for the shadow filter
- **
- - dx (number) #optional horizontal shift of the shadow, in pixels
- - dy (number) #optional vertical shift of the shadow, in pixels
- - blur (number) #optional amount of blur
- - color (string) #optional color of the shadow
- - opacity (number) #optional `0..1` opacity of the shadow
- * or
- - dx (number) #optional horizontal shift of the shadow, in pixels
- - dy (number) #optional vertical shift of the shadow, in pixels
- - color (string) #optional color of the shadow
- - opacity (number) #optional `0..1` opacity of the shadow
- * which makes blur default to `4`. Or
- - dx (number) #optional horizontal shift of the shadow, in pixels
- - dy (number) #optional vertical shift of the shadow, in pixels
- - opacity (number) #optional `0..1` opacity of the shadow
- = (string) filter representation
- > Usage
- | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
- | c = paper.circle(10, 10, 10).attr({
- | filter: f
- | });
- \*/
- Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
- if (typeof blur == "string") {
- color = blur;
- opacity = color;
- blur = 4;
- }
- if (typeof color != "string") {
- opacity = color;
- color = "#000";
- }
- color = color || "#000";
- if (blur == null) {
- blur = 4;
- }
- if (opacity == null) {
- opacity = 1;
- }
- if (dx == null) {
- dx = 0;
- dy = 2;
- }
- if (dy == null) {
- dy = dx;
- }
- color = Snap.color(color);
- return Snap.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>', {
- color: color,
- dx: dx,
- dy: dy,
- blur: blur,
- opacity: opacity
- });
- };
- Snap.filter.shadow.toString = function () {
- return this();
- };
- /*\
- * Snap.filter.grayscale
- [ method ]
- **
- * Returns an SVG markup string for the grayscale filter
- **
- - amount (number) amount of filter (`0..1`)
- = (string) filter representation
- \*/
- Snap.filter.grayscale = function (amount) {
- if (amount == null) {
- amount = 1;
- }
- return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>', {
- a: 0.2126 + 0.7874 * (1 - amount),
- b: 0.7152 - 0.7152 * (1 - amount),
- c: 0.0722 - 0.0722 * (1 - amount),
- d: 0.2126 - 0.2126 * (1 - amount),
- e: 0.7152 + 0.2848 * (1 - amount),
- f: 0.0722 - 0.0722 * (1 - amount),
- g: 0.2126 - 0.2126 * (1 - amount),
- h: 0.0722 + 0.9278 * (1 - amount)
- });
- };
- Snap.filter.grayscale.toString = function () {
- return this();
- };
- /*\
- * Snap.filter.sepia
- [ method ]
- **
- * Returns an SVG markup string for the sepia filter
- **
- - amount (number) amount of filter (`0..1`)
- = (string) filter representation
- \*/
- Snap.filter.sepia = function (amount) {
- if (amount == null) {
- amount = 1;
- }
- return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>', {
- a: 0.393 + 0.607 * (1 - amount),
- b: 0.769 - 0.769 * (1 - amount),
- c: 0.189 - 0.189 * (1 - amount),
- d: 0.349 - 0.349 * (1 - amount),
- e: 0.686 + 0.314 * (1 - amount),
- f: 0.168 - 0.168 * (1 - amount),
- g: 0.272 - 0.272 * (1 - amount),
- h: 0.534 - 0.534 * (1 - amount),
- i: 0.131 + 0.869 * (1 - amount)
- });
- };
- Snap.filter.sepia.toString = function () {
- return this();
- };
- /*\
- * Snap.filter.saturate
- [ method ]
- **
- * Returns an SVG markup string for the saturate filter
- **
- - amount (number) amount of filter (`0..1`)
- = (string) filter representation
- \*/
- Snap.filter.saturate = function (amount) {
- if (amount == null) {
- amount = 1;
- }
- return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
- amount: 1 - amount
- });
- };
- Snap.filter.saturate.toString = function () {
- return this();
- };
- /*\
- * Snap.filter.hueRotate
- [ method ]
- **
- * Returns an SVG markup string for the hue-rotate filter
- **
- - angle (number) angle of rotation
- = (string) filter representation
- \*/
- Snap.filter.hueRotate = function (angle) {
- angle = angle || 0;
- return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
- angle: angle
- });
- };
- Snap.filter.hueRotate.toString = function () {
- return this();
- };
- /*\
- * Snap.filter.invert
- [ method ]
- **
- * Returns an SVG markup string for the invert filter
- **
- - amount (number) amount of filter (`0..1`)
- = (string) filter representation
- \*/
- Snap.filter.invert = function (amount) {
- if (amount == null) {
- amount = 1;
- }
- // <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB"/>
- return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
- amount: amount,
- amount2: 1 - amount
- });
- };
- Snap.filter.invert.toString = function () {
- return this();
- };
- /*\
- * Snap.filter.brightness
- [ method ]
- **
- * Returns an SVG markup string for the brightness filter
- **
- - amount (number) amount of filter (`0..1`)
- = (string) filter representation
- \*/
- Snap.filter.brightness = function (amount) {
- if (amount == null) {
- amount = 1;
- }
- return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
- amount: amount
- });
- };
- Snap.filter.brightness.toString = function () {
- return this();
- };
- /*\
- * Snap.filter.contrast
- [ method ]
- **
- * Returns an SVG markup string for the contrast filter
- **
- - amount (number) amount of filter (`0..1`)
- = (string) filter representation
- \*/
- Snap.filter.contrast = function (amount) {
- if (amount == null) {
- amount = 1;
- }
- return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>', {
- amount: amount,
- amount2: .5 - amount / 2
- });
- };
- Snap.filter.contrast.toString = function () {
- return this();
- };
- });
-
- // Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
- var box = Snap._.box,
- is = Snap.is,
- firstLetter = /^[^a-z]*([tbmlrc])/i,
- toString = function () {
- return "T" + this.dx + "," + this.dy;
- };
- /*\
- * Element.getAlign
- [ method ]
- **
- * Returns shift needed to align the element relatively to given element.
- * If no elements specified, parent `<svg>` container will be used.
- - el (object) @optional alignment element
- - way (string) one of six values: `"top"`, `"middle"`, `"bottom"`, `"left"`, `"center"`, `"right"`
- = (object|string) Object in format `{dx: , dy: }` also has a string representation as a transformation string
- > Usage
- | el.transform(el.getAlign(el2, "top"));
- * or
- | var dy = el.getAlign(el2, "top").dy;
- \*/
- Element.prototype.getAlign = function (el, way) {
- if (way == null && is(el, "string")) {
- way = el;
- el = null;
- }
- el = el || this.paper;
- var bx = el.getBBox ? el.getBBox() : box(el),
- bb = this.getBBox(),
- out = {};
- way = way && way.match(firstLetter);
- way = way ? way[1].toLowerCase() : "c";
- switch (way) {
- case "t":
- out.dx = 0;
- out.dy = bx.y - bb.y;
- break;
- case "b":
- out.dx = 0;
- out.dy = bx.y2 - bb.y2;
- break;
- case "m":
- out.dx = 0;
- out.dy = bx.cy - bb.cy;
- break;
- case "l":
- out.dx = bx.x - bb.x;
- out.dy = 0;
- break;
- case "r":
- out.dx = bx.x2 - bb.x2;
- out.dy = 0;
- break;
- default:
- out.dx = bx.cx - bb.cx;
- out.dy = 0;
- break;
- }
- out.toString = toString;
- return out;
- };
- /*\
- * Element.align
- [ method ]
- **
- * Aligns the element relatively to given one via transformation.
- * If no elements specified, parent `<svg>` container will be used.
- - el (object) @optional alignment element
- - way (string) one of six values: `"top"`, `"middle"`, `"bottom"`, `"left"`, `"center"`, `"right"`
- = (object) this element
- > Usage
- | el.align(el2, "top");
- * or
- | el.align("middle");
- \*/
- Element.prototype.align = function (el, way) {
- return this.transform("..." + this.getAlign(el, way));
- };
- });
-
- return Snap;
- }));
- }.call(window));
-
-/***/ },
-/* 83 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _utils = __webpack_require__(60);
-
- var ShapeResizer = function ShapeResizer(paper, shape, vp, vb) {
- this.paper = paper;
- this.shape = shape;
- this.handlers = [];
- this.viewPort = vp;
- this.viewBox = vb;
- this.isResizing = false;
- this.currentPosition = {};
- this.HANDLER_SIZE = 8;
- this.SHAPE_MIN_SIZE = 20;
- this.states = {};
- this.noop = function () {};
- this.init();
- }; /* Enabling us to resize a shape width a handler
- #http://stackoverflow.com/questions/32390028/how-to-drag-and-resize-svg-rectangle-using-cursor-types
- */
-
-
- var api = ShapeResizer.prototype = {
-
- init: function init() {
- this.showHandlers();
- },
-
- computeHandlerSize: function computeHandlerSize() {
- return this.HANDLER_SIZE * Math.min(this.viewBox[2], this.viewBox[3]) / this.viewPort.width; //w==h
- },
-
- showHandlers: function showHandlers() {
- /* show handler here */
- var bbox = this.shape.getBBox();
- var handleX = bbox.x - this.computeHandlerSize() / 2;
- var handleY = bbox.y - this.computeHandlerSize() / 2;
- var handler = this.paper.rect(handleX, handleY, this.computeHandlerSize(), this.computeHandlerSize()).attr({ fill: 'red' });
- handler.addClass("drawingHandler");
- this.shape.addClass("drawingHandler");
- var handlerInfos = { position: "t_r", handler: handler };
- this.handlers.push(handlerInfos);
- this.shapesGroup = this.paper.g(this.shape, handler);
- this.attachEvents();
- },
-
- /*one handlers */
- updateShapePositions: function updateShapePositions(handlerData, dx, dy) {
- //start
- var handlerBBox = handlerData.handler.getBBox();
- var shapeBBox = this.shape.data("origBbox");
- var newX = handlerBBox.x + this.computeHandlerSize() / 2;
- var newY = handlerBBox.y + this.computeHandlerSize() / 2;
-
- /*to the right => reduce the size */
- var newWidth = dx > 0 ? shapeBBox.width - dx : shapeBBox.width + Math.abs(dx);
- var newHeight = dy > 0 ? shapeBBox.height - dy : shapeBBox.height + Math.abs(dy);
-
- var transformValue = this.shape.data('origTransform') + (this.shape.data('origTransform') ? "T" : "t") + [dx, dy];
- this.shape.attr({ 'transform': transformValue, width: newWidth, height: newHeight });
- },
-
- dragEvents: {
- onStart: function onStart(handlerData, dx, dy, e) {
- this.startPosition = { x: e.clientX, y: e.clientY };
- this.isResizing = true;
- this.currentPosition = {};
- handlerData.handler.data("origTransform", handlerData.handler.transform().local);
- this.shape.data("origBbox", this.shape.getBBox());
- this.shape.data("origBounding", this.shape.node.getBoundingClientRect());
- this.shape.data("origTransform", this.shape.transform().local);
- },
-
- onMove: function onMove(handlerData, dx, dy, x, y, e) {
-
- var tdx, tdy;
- var snapInvMatrix = handlerData.handler.transform().diffMatrix.invert();
- snapInvMatrix.e = snapInvMatrix.f = 0;
- tdx = snapInvMatrix.x(dx, dy);
- tdy = snapInvMatrix.y(dx, dy);
-
- this.currentPosition.x = e.clientX;
- this.currentPosition.y = e.clientY;
- if (!this.checkBondaries(dx, dy)) {
- return;
- }
-
- handlerData.handler.transform("t" + [tdx, tdy] + handlerData.handler.data("origTransform"));
- this.updateShapePositions(handlerData, tdx, tdy);
- },
-
- onStop: function onStop() {
- this.isResizing = false;
- this.startPosition = {};
- this.currentPosition = {};
- }
- },
-
- checkBondaries: function checkBondaries(dx, dy) {
- var result = true;
- var origBounding = this.shape.data("origBounding");
- var getBoundingClientRect = this.shape.node.getBoundingClientRect();
-
- if (origBounding.width - dx <= this.SHAPE_MIN_SIZE) {
- result = false;
- }
-
- if (origBounding.height - dy <= this.SHAPE_MIN_SIZE) {
- result = false;
- }
-
- return result;
- },
-
- destroy: function destroy() {
- this.handlers.map(function (handlerData) {
- handlerData.handler.remove();
- });
- delete this;
- },
-
- getZoomFactor: function getZoomFactor() {
- return {
- x: this.viewPort.width / this.viewBox[2],
- y: this.viewPort.height / this.viewBox[3]
- };
- },
-
- attachEvents: function attachEvents() {
- var self = this;
- this.handlers.map(function (handlerData) {
- handlerData.handler.drag(self.dragEvents.onMove.bind(self, handlerData), self.dragEvents.onStart.bind(self, handlerData), self.dragEvents.onStop.bind(self, handlerData));
- });
-
- _utils.eventEmitter.on("cutout:clear", function () {
- self.destroy();
- });
-
- this.shapesGroup.drag(function (dx, dy) {
- if (self.isResizing) {
- return;
- }
- var snapInvMatrix = this.transform().diffMatrix.invert();
- snapInvMatrix.e = snapInvMatrix.f = 0;
- var tdx = snapInvMatrix.x(dx, dy);
- var tdy = snapInvMatrix.y(dx, dy);
-
- var transformValue = this.data('origTransform') + (this.data('origTransform') ? "T" : "t") + [tdx, tdy];
- this.transform(transformValue);
- }, function () {
- this.data('origTransform', this.transform().local);
- }, this.noop);
- }
- };
-
- exports.default = {
-
- enable_resizer: function enable_resizer(paper, rect, viewPort, cViewbox) {
- new ShapeResizer(paper, rect, viewPort, cViewbox);
- }
- };
-
-/***/ },
-/* 84 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* enable zoom */
-
-
- var _utils = __webpack_require__(60);
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var ZoomHandler = function () {
- function ZoomHandler(params) {
- _classCallCheck(this, ZoomHandler);
-
- this.zoomFactor = 0.1 || params.zoomFactor;
- this.paper = params.paper;
- this.MIN_SIZE = 40;
- this.imageWidth = parseInt(this.paper.select(".main-image").attr("width"));
- this.imageHeight = parseInt(this.paper.select(".main-image").attr("height"));
-
- this.viewport = {
- width: parseInt(this.paper.attr("width")),
- height: parseInt(this.paper.attr("height"))
- };
-
- this.scale = 1;
- this.paper.attr({ stroke: 2, "fill": "blue" });
- this.disableDrag = false;
- this.imgMinSize = Math.min(this.imageWidth, this.imageHeight);
- this.lastPosition = [];
- this.updateViewBox([0, 0, this.imageWidth, this.imageHeight]);
- }
-
- _createClass(ZoomHandler, [{
- key: "testShowCenter",
- value: function testShowCenter(cx, cy) {
-
- if (this.center) {
- this.center.remove();
- }
- this.center = this.paper.rect(cx - 3, cy - 3, 20, 20);
- this.center.attr({ "fill": "red" });
- }
- }, {
- key: "drawTestRectangle",
- value: function drawTestRectangle(cx, cy, w, h) {
- var x = cx - w / 2;
- var y = cy - h / 2;
- this.paper.rect(x, y, w, h);
- }
- }, {
- key: "zoomIn",
- value: function zoomIn() {
-
- /* current center */
- if (this.scale === 9) {
- this.scale--;return;
- }
- var currentCenterX = this.currentViewBox[0] + this.currentViewBox[2] / 2;
- var currentCenterY = this.currentViewBox[1] + this.currentViewBox[3] / 2;
- var scaleFactor = this.zoomFactor * this.scale;
- var viewBoxW = this.imgMinSize - this.imgMinSize * scaleFactor;
- var viewBoxH = viewBoxW;
-
- this.currentViewBox[0] = currentCenterX - viewBoxW / 2;
- this.currentViewBox[1] = currentCenterY - viewBoxH / 2;
-
- this.currentViewBox[2] = viewBoxW;
- this.currentViewBox[3] = viewBoxH;
- this.scale++;
- this.updateViewBox();
- }
- }, {
- key: "updateViewBox",
- value: function updateViewBox(currentViewBox, notify) {
- notify = typeof notify === "boolean" ? notify : true;
-
- if (currentViewBox && currentViewBox.length != 4) {
- throw new Error("Provided currentViewBox is not valid!");
- }
- if (currentViewBox) {
- this.currentViewBox = currentViewBox;
- }
-
- this.paper.attr({ "viewBox": this.currentViewBox });
-
- if (!notify) {
- return false;
- }
-
- var self = this;
- _utils.eventEmitter.emit("zoomChanged", {
- updateFunction: function updateFunction(updatedViewBox) {
- self.updateViewBox(updatedViewBox, false);
- },
- "zoomFactor": this.getZoomFactor(),
- "viewport": this.viewport,
- "currentScale": this.scale,
- "imageSize": { width: this.imageWidth, height: this.imageHeight },
- "minSize": Math.min(this.imageWidth, this.imageHeight),
- "currentViewBox": this.currentViewBox.slice()
- });
- }
- }, {
- key: "getZoomFactor",
- value: function getZoomFactor() {
- return {
- x: this.viewport.width / this.currentViewBox[2],
- y: this.viewport.height / this.currentViewBox[3]
- };
- }
- }, {
- key: "onStart",
- value: function onStart(x, y, e) {
-
- this.lastPosition[0] = this.currentViewBox[0];
- this.lastPosition[1] = this.currentViewBox[1];
-
- if (e.target.className.baseVal === "drawingHandler") {
- this.disableDrag = true;
- }
- }
- }, {
- key: "canDrag",
- value: function canDrag() {
- return !this.disableDrag;
- }
- }, {
- key: "onStop",
- value: function onStop() {
- this.disableDrag = false;
- }
- }, {
- key: "onDrag",
- value: function onDrag(dx, dy, x, y, event) {
-
- if (!this.canDrag()) {
- return true;
- }
-
- var newX = this.lastPosition[0] - dx;
- var newY = this.lastPosition[1] - dy;
-
- /* maxX bound */
- if (newX + this.currentViewBox[2] >= this.viewport.width) {
- newX = this.viewport.width - this.currentViewBox[2];
- }
-
- /* maxY bound */
- if (newY + this.currentViewBox[3] >= this.viewport.height) {
- newY = this.viewport.height - this.currentViewBox[3];
- }
-
- if (newX <= 0) {
- newX = 0;
- }
-
- if (newY <= 0) {
- newY = 0;
- }
-
- this.currentViewBox[0] = newX;
- this.currentViewBox[1] = newY;
-
- this.updateViewBox();
- }
- }, {
- key: "reset",
- value: function reset() {
- this.scale = 1;
- this.currentViewBox = [0, 0, this.imageWidth, this.imageHeight];
- this.updateViewBox();
- }
- }, {
- key: "zoomOut",
- value: function zoomOut() {
- if (this.scale == 1) {
- return false;
- }
-
- var currentCenterX = this.currentViewBox[0] + this.currentViewBox[2] / 2;
- var currentCenterY = this.currentViewBox[1] + this.currentViewBox[3] / 2;
- var scaleFactor = this.zoomFactor * (this.scale - 1);
-
- var viewBoxW = this.imgMinSize - this.imgMinSize * scaleFactor;
- var viewBoxH = viewBoxW;
-
- var topX = currentCenterX - viewBoxW / 2;
- var topY = currentCenterY - viewBoxH / 2;
-
- this.currentViewBox[0] = topX; //deal with X and Y
- this.currentViewBox[1] = topY;
- this.currentViewBox[2] = viewBoxW;
- this.currentViewBox[3] = viewBoxH;
- this.updateViewBox();
- this.scale--;
- }
- }]);
-
- return ZoomHandler;
- }();
-
- exports.default = {
-
- enable_zoom: function enable_zoom(params) {
- return new ZoomHandler(params);
- }
- };
-
-/***/ },
-/* 85 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* script */
- __vue_exports__ = __webpack_require__(86)
-
- /* template */
- var __vue_template__ = __webpack_require__(87)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/zoomview/Zoomview.vue"
- __vue_options__.render = __vue_template__.render
- __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-38edcce4", __vue_options__)
- } else {
- hotAPI.reload("data-v-38edcce4", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] Zoomview.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 86 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _utils = __webpack_require__(60);
-
- var _snapsvgZoom = __webpack_require__(84);
-
- var _snapsvgZoom2 = _interopRequireDefault(_snapsvgZoom);
-
- var _snapsvg = __webpack_require__(82);
-
- var _snapsvg2 = _interopRequireDefault(_snapsvg);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- exports.default = {
-
- props: ['image-url', 'image-width', 'image-height', 'zoomTarget', 'main-image-id'],
-
- mounted: function mounted() {
- this.root = new _snapsvg2.default(this.$refs['root-svg']);
- this.handler = this.root.select('#zoom-handler');
- this.image = this.root.select('#small-image');
- this.root.attr({ width: 101, height: 101 });
- var imageWidth = parseInt(this.image.attr("width"));
- var imageHeight = parseInt(this.image.attr("height"));
- /* center image in the viewport */
- this.root.attr({ viewBox: [0, 0, imageWidth, imageHeight] });
- this.imgMinSize = Math.min(imageWidth, imageHeight);
-
- this.handlerSize = 20;
- this.handler.attr({ 'width': this.handlerSize, 'height': this.handlerSize });
- this.currentViewBox = null;
- this.currentViewport = null;
- this.updateFunction = null;
- var target = document.getElementById('zoomTarget');
-
- if (target) {
- this.setZoomTarget(target);
- }
- this.handleEvents();
- },
- data: function data() {
- return {
- showHandler: false
- };
- },
-
- methods: {
-
- setZoomTarget: function setZoomTarget(zoomtarget) {
-
- if (zoomtarget.hasOwnProperty("type") && zoomtarget.type === 'svg') {
- this.paper = zoomtarget;
- } else {
-
- this.paper = new _snapsvg2.default(zoomtarget);
- var mainImage = this.paper.select("#" + this.mainImageId);
- if (!mainImage) {
- throw new Error("A main image wasn't found.");
- };
- }
-
- this.zoomHandler = _snapsvgZoom2.default.enable_zoom(this.paper);
- },
-
- incraseDrawingZoom: function incraseDrawingZoom() {
- this.zoomHandler.zoomIn();
- },
-
- resetDrawingZoom: function resetDrawingZoom() {
- this.zoomHandler.reset();
- },
-
- decreaseDrawingZoom: function decreaseDrawingZoom() {
- this.zoomHandler.zoomOut();
- },
-
- handleEvents: function handleEvents() {
- _utils.eventEmitter.on('zoomChanged', this.handleZoomChanged.bind(this));
- var self = this;
-
- this.handler.drag(function (dx, dy) {
- var bbox = this.getBBox();
- var startX = this.data("startPosition").x;
- var startY = this.data("startPosition").y;
- var imageWidth = parseInt(self.image.attr('width'));
- var imageHeight = parseInt(self.image.attr('height'));
-
- /* New X */
- var newX = startX + dx;
- var newY = startY + dy;
-
- /* XBound */
- if (newX + bbox.w >= imageWidth) {
- newX = imageWidth - bbox.w;
- }
- /* YBound */
- if (newY + bbox.h >= imageHeight) {
- newY = imageHeight - bbox.h;
- }
-
- newX = newX < 0 ? 0 : newX;
- newY = newY < 0 ? 0 : newY;
-
- var transformedValue = "T" + [newX, newY];
- this.attr("transform", transformedValue);
- self.notifyMove(this.getBBox().x, this.getBBox().y);
- }, function () {
- this.data("startPosition", { x: this.getBBox().x, y: this.getBBox().y });
- this.data("origTransform", this.transform().local);
- }, function () {});
- },
-
- moveHandlerToCenter: function moveHandlerToCenter(x, c) {
- cx = cx ? cx : this.width / 2;
- cy = cy ? cy : this.height / 2;
- var moveX = cx - this.handler.getBBox().w / 2;
- var moveY = cy - this.handler.getBBox().h / 2;
- this.handler.transform("T" + [moveX, moveY]);
- },
-
- notifyMove: function notifyMove(x, y) {
- _utils.eventEmitter.emit("moveZoomHandler", {
- x: x,
- y: y,
- viewport: {
- width: this.image.attr("width"),
- height: this.image.attr("height")
- } });
-
- if (!this.currentViewBox || !this.currentViewport || typeof this.updateFunction !== 'function') {
- return false;
- }
-
- /*longueur image=> longueur viewbox */
- var xRatio = this.currentImageSize.width / this.image.attr('width');
- var yRatio = this.currentImageSize.height / this.image.attr('height');
- var newX = x * xRatio;
- var newY = y * yRatio;
- this.currentViewBox[0] = newX;
- this.currentViewBox[1] = newY;
- this.updateFunction(this.currentViewBox);
- },
-
- handleZoomChanged: function handleZoomChanged(zoomInfos) {
-
- if (zoomInfos.currentScale === 1) {
- this.showHandler = false;
- return;
- }
-
- this.showHandler = true;
-
- this.currentViewport = zoomInfos.viewport;
- this.currentViewBox = zoomInfos.currentViewBox;
- this.currentImageSize = zoomInfos.imageSize;
- this.updateFunction = zoomInfos.updateFunction;
- var handlerSize = zoomInfos.currentViewBox[2] * this.imgMinSize / zoomInfos.minSize;
-
- this.handler.attr("width", handlerSize);
- this.handler.attr("height", handlerSize);
-
- /*compute handler x, y */
- var x = zoomInfos.currentViewBox[0] * this.image.attr("width") / zoomInfos.imageSize.width;
- var y = zoomInfos.currentViewBox[1] * this.image.attr("height") / zoomInfos.imageSize.height;
- this.handler.transform("T" + [x, y]);
- }
- }
- }; //
- //
- //
-
-/***/ },
-/* 87 */
-/***/ function(module, exports, __webpack_require__) {
-
- module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
- return _c('div', {
- staticClass: "zoomview-wrapper"
- }, [_vm._m(0), _vm._v(" "), _c('svg', {
- ref: "root-svg"
- }, [_c('image', {
- attrs: {
- "id": "small-image",
- "x": "0",
- "y": "0",
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
- "xlink:href": _vm.imageUrl,
- "width": _vm.imageWidth,
- "height": _vm.imageHeight
- }
- }), _vm._v(" "), _c('rect', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (_vm.showHandler),
- expression: "showHandler"
- }],
- ref: "handler",
- staticStyle: {
- "fill": "black",
- "opacity": "0.4"
- },
- attrs: {
- "id": "zoom-handler",
- "x": "0",
- "y": "0"
- }
- })]), _vm._v(" "), _c('ul', {
- staticClass: "form-drawing-wrapper zoom-action-list list-inline"
- }, [_c('li', {
- staticClass: "small showPointer",
- on: {
- "click": _vm.incraseDrawingZoom
- }
- }, [_c('i', {
- staticClass: "fa fa-search-plus"
- })]), _vm._v(" "), _c('li', {
- staticClass: "small showPointer",
- on: {
- "click": _vm.resetDrawingZoom
- }
- }, [_c('i', {
- staticClass: "fa fa-square"
- })]), _vm._v(" "), _c('li', {
- staticClass: "small showPointer",
- on: {
- "click": _vm.decreaseDrawingZoom
- }
- }, [_c('i', {
- staticClass: "fa fa-search-minus"
- })])])])
- },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
- return _c('p', {
- staticClass: "form-drawing pullright"
- }, [_c('strong', [_vm._v("Zoom")])])
- }]}
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api").rerender("data-v-38edcce4", module.exports)
- }
- }
-
-/***/ },
-/* 88 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* script */
- __vue_exports__ = __webpack_require__(89)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/mergetool/MergeTool.vue"
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-62d336d0", __vue_options__)
- } else {
- hotAPI.reload("data-v-62d336d0", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] MergeTool.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 89 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _Typeahead = __webpack_require__(8);
-
- var _Typeahead2 = _interopRequireDefault(_Typeahead);
-
- var _diffviewer = __webpack_require__(90);
-
- var _diffviewer2 = _interopRequireDefault(_diffviewer);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- exports.default = {
- data: function data() {
- return {};
- },
-
-
- components: {
- Typeahead: _Typeahead2.default,
- 'diffviewer': _diffviewer2.default
- },
-
- mounted: function mounted() {
-
- this.targetKeyMap = {
- title: "proposal-title",
- desc: "proposal-description",
- frag: "proposal-fragment"
- };
-
- this.targetFieldTypeMap = {
- title: "input",
- desc: "input",
- frag: "frag"
- };
-
- this.originalValues = {
- title: "",
- desc: "",
- frag: ""
- };
- },
-
-
- methods: {
-
- pickProposition: function pickProposition(event, sourceId, targetKey) {
- var value = "";
- var source = document.getElementById(sourceId);
- var targetField = this.$refs[this.targetKeyMap[targetKey]];
- var targetType = this.targetFieldTypeMap[targetKey];
- if (!targetType) {
- throw new Error("A target type must be provided...");
- }
-
- if (targetType === "input") {
- value = targetField.value;
- targetField.value = source.value;
- }
-
- if (targetType === "frag") {
- value = targetField.getAttribute("d");
- var sourceValue = source.getAttribute("d");
- var targetPathType = targetField.getAttribute("data-path-type");
- targetField.setAttribute("d", sourceValue);
-
- var pathType = source.getAttribute("data-path-type");
- pathType = pathType || "FREE";
- var fragmentField = this.$refs["fragment-field"];
- fragmentField.value = sourceValue + ";" + pathType;
- }
-
- this.preserveOriginalValue(targetKey, value);
- },
-
- pickTag: function pickTag(event, refTag) {
- var source = this.$refs[refTag];
- var target = this.$refs['proposal-tags'];
- this.preserveOriginalValue('proposal-tags', target.tags);
- target.setTags(source.tags, true);
- },
-
- preserveOriginalValue: function preserveOriginalValue(key, value) {
- if (!this.originalValues[key]) {
- this.originalValues[key] = value;
- }
- },
-
- showDiffviewer: function showDiffviewer(refId, sourceId, targetKey) {
-
- var sourceField = document.getElementById(sourceId);
- var targetField = this.$refs[this.targetKeyMap[targetKey]];
- var targetType = this.targetFieldTypeMap[targetKey];
- var diffViewer = this.$refs[refId];
-
- if (!diffViewer) {
- throw new Error("The DiffViewer can't be found for " + targetKey);
- }
-
- if (targetType === "input") {
- diffViewer.showTextDiff(sourceField.value, targetField.value);
- }
-
- if (targetKey === "tag") {
- var source = this.$refs[sourceId];
- var target = this.$refs['proposal-tags'];
- if (source.tags.length !== 0 && target.tags.length !== 0) {
- diffViewer.showTagDiff(source.tags, target.tags);
- }
- }
- /* frag */
- if (targetKey === "frag") {
-
- var originalPath = targetField.getAttribute("d");
- var modifiedPath = sourceField.getAttribute("d");
- diffViewer.showFragmentDiff(originalPath, modifiedPath);
- }
-
- diffViewer.show();
- },
-
- hightlightSource: function hightlightSource(source) {
- source.className += "highlight";
- },
-
- save: function save() {
- alert("this is it ... ");
- }
- }
- };
-
-/***/ },
-/* 90 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* styles */
- __webpack_require__(91)
-
- /* script */
- __vue_exports__ = __webpack_require__(93)
-
- /* template */
- var __vue_template__ = __webpack_require__(97)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/diffviewer/diffviewer.vue"
- __vue_options__.render = __vue_template__.render
- __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
- __vue_options__._scopeId = "data-v-64c3b6ce"
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-64c3b6ce", __vue_options__)
- } else {
- hotAPI.reload("data-v-64c3b6ce", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] diffviewer.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 91 */
-/***/ function(module, exports, __webpack_require__) {
-
- // style-loader: Adds some css to the DOM by adding a <style> tag
-
- // load the styles
- var content = __webpack_require__(92);
- if(typeof content === 'string') content = [[module.id, content, '']];
- // add the styles to the DOM
- var update = __webpack_require__(12)(content, {});
- if(content.locals) module.exports = content.locals;
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!./../../../../../node_modules/css-loader/index.js?sourceMap!./../../../../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-64c3b6ce&scoped=true!./style.css", function() {
- var newContent = require("!!./../../../../../node_modules/css-loader/index.js?sourceMap!./../../../../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-64c3b6ce&scoped=true!./style.css");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
-
-/***/ },
-/* 92 */
-/***/ function(module, exports, __webpack_require__) {
-
- exports = module.exports = __webpack_require__(11)();
- // imports
-
-
- // module
- exports.push([module.id, "\n.diff-viewer-wrapper[data-v-64c3b6ce] {margin-top: 5px;\n}\n.diff-panel[data-v-64c3b6ce] {border: 1px solid gray; width: 300px; heigth: 250px;\n}\ndel[data-v-64c3b6ce] { text-decoration: none;\tcolor: #b30000;\tbackground: #fadad7;\n}\nins[data-v-64c3b6ce] {\tbackground: #eaf2c2; color: #406619; text-decoration: none;\n}", "", {"version":3,"sources":["/./src_js/iconolab-bundle/src/components/diffviewer/style.css"],"names":[],"mappings":";AAAA,uCAAsB,gBAAgB;CAAC;AACvC,8BAAa,uBAAuB,CAAC,aAAa,CAAC,cAAc;CAAC;AAElE,uBAAM,sBAAsB,CAAC,eAAe,CAAC,oBAAoB;CAAC;AAElE,uBAAM,oBAAoB,CAAC,eAAe,CAAC,sBAAsB;CAAE","file":"style.css","sourcesContent":[".diff-viewer-wrapper {margin-top: 5px;}\n.diff-panel {border: 1px solid gray; width: 300px; heigth: 250px;}\n\ndel { text-decoration: none;\tcolor: #b30000;\tbackground: #fadad7;}\n\nins {\tbackground: #eaf2c2; color: #406619; text-decoration: none; }"],"sourceRoot":"webpack://"}]);
-
- // exports
-
-
-/***/ },
-/* 93 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _components$mounted$p;
-
- var _ModalPanel = __webpack_require__(94);
-
- var _ModalPanel2 = _interopRequireDefault(_ModalPanel);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } //
- //
- //
-
-
- exports.default = (_components$mounted$p = {
- components: { 'modalpanel': _ModalPanel2.default },
- mounted: function mounted() {},
- props: ['transform-matrix', 'image-path', 'image-height', 'image-width'],
- data: function data() {
-
- return {
- diffText: "",
- tagMode: false,
- textMode: false,
- fragmentMode: false,
- originalPath: "",
- modifiedPath: "",
- tags: []
- };
- }
- }, _defineProperty(_components$mounted$p, 'mounted', function mounted() {
- return false;
- }), _defineProperty(_components$mounted$p, 'computed', {
- matrixTransform: function matrixTransform() {
- var matrixTransform = "";
- if (this.transformMatrix) {
- matrixTransform = "matrix(" + this.transformMatrix + ")";
- }
- return matrixTransform;
- }
- }), _defineProperty(_components$mounted$p, 'methods', {
-
- setContent: function setContent(content) {
- this.$refs.modalcontent.appendChild(content);
- },
-
- switchMode: function switchMode(mode) {
- var availableMode = ["tagMode", "textMode", "fragmentMode"];
- this.tagMode = false;
- this.textMode = false;
- this.fragmentMode = false;
- if (availableMode.indexOf(mode) !== -1) {
- this[mode] = true;
- }
- },
-
- showTagDiff: function showTagDiff(tags, editedTags) {
- this.switchMode("tagMode");
- //si le label a changé considé qu'il a été effacé.
- var diff = iconolab.JsonDiff.diff(tags, editedTags);
- var tagsToRender = [];
-
- tags.forEach(function (tag, i) {
-
- var tag = JSON.parse(JSON.stringify(tag));
- var deletedDiff = diff["_" + i];
- var currentDiff = diff[i];
-
- if (!deletedDiff && !currentDiff) {
- tagsToRender.push(tag); //render this tag
- }
-
- if (Array.isArray(deletedDiff)) {
- tag.action = "del";
- tagsToRender.push(tag);
- return true;
- }
-
- if (currentDiff && (currentDiff.tag_label || currentDiff.relevancy || currentDiff.accuracy)) {
- tag.action = currentDiff.tag_label ? "replace" : "update";
- tag.new_label = editedTags[i].tag_label;
- tag.new_accuracy = editedTags[i].accuracy;
- tag.new_relevancy = editedTags[i].relevancy;
- tagsToRender.push(tag);
- return true;
- }
- if (Array.isArray(currentDiff)) {
- tag.action = "add";
- tagsToRender.push(editedTags[i]);
- return true;
- }
- });
- /* deal with remain */
- if (tags.length < editedTags.length) {
- var remainedTags = editedTags.slice(tags.length);
- remainedTags.forEach(function (tag, i) {
- tag.action = "add";
- tagsToRender.push(tag);
- });
- }
- this.tags = tagsToRender;
- },
-
- showTextDiff: function showTextDiff(original, mod) {
- this.switchMode("textMode");
- var diff = iconolab.JsDiff.diffWords(original, mod);
- var fragment = document.createDocumentFragment();
- for (var i = 0; i < diff.length; i++) {
-
- if (diff[i].added && diff[i + 1] && diff[i + 1].removed) {
- var swap = diff[i];
- diff[i] = diff[i + 1];
- diff[i + 1] = swap;
- }
-
- var node;
- if (diff[i].removed) {
- node = document.createElement('del');
- node.appendChild(document.createTextNode(diff[i].value));
- } else if (diff[i].added) {
- node = document.createElement('ins');
- node.appendChild(document.createTextNode(diff[i].value));
- } else {
- node = document.createTextNode(diff[i].value);
- }
-
- fragment.appendChild(node);
- }
-
- this.diffText = jQuery('<div>').append(fragment).html();
- },
-
- showFragmentDiff: function showFragmentDiff(originalPath, modifiedPath) {
- this.switchMode("fragmentMode");
- this.originalPath = originalPath;
- this.modifiedPath = modifiedPath;
- },
-
- show: function show() {
- this.$refs.panel.show();
- },
-
- hide: function hide() {
- this.$refs.panel.hide();
- }
- }), _components$mounted$p);
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
-
-/***/ },
-/* 94 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* script */
- __vue_exports__ = __webpack_require__(95)
-
- /* template */
- var __vue_template__ = __webpack_require__(96)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/modalpanel/ModalPanel.vue"
- __vue_options__.render = __vue_template__.render
- __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-02eda264", __vue_options__)
- } else {
- hotAPI.reload("data-v-02eda264", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] ModalPanel.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 95 */
-/***/ function(module, exports) {
-
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- //
-
- exports.default = {
- props: ["close-with-escape"],
- data: function data() {
- return {
- display: false
- };
- },
-
-
- methods: {
- close: function close() {
- this.display = false;
- },
-
- show: function show() {
- this.display = true;
- }
- }
- };
-
-/***/ },
-/* 96 */
-/***/ function(module, exports, __webpack_require__) {
-
- module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
- return _c('div', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (_vm.display),
- expression: "display"
- }],
- staticClass: "modal-mask diff-panel"
- }, [_c('p', {
- staticClass: "pull-right close-btn",
- on: {
- "click": _vm.close
- }
- }, [_c('i', {
- staticClass: "fa fa-close"
- })]), _vm._v(" "), _vm._t("header"), _vm._v(" "), _vm._t("content"), _vm._v(" "), _vm._t("footer")], 2)
- },staticRenderFns: []}
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api").rerender("data-v-02eda264", module.exports)
- }
- }
-
-/***/ },
-/* 97 */
-/***/ function(module, exports, __webpack_require__) {
-
- module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
- return _c('div', {
- staticClass: "diff-viewer-wrapper col-md-12"
- }, [_c('modalpanel', {
- ref: "panel"
- }, [_c('h5', {
- slot: "header"
- }, [_vm._v("Comparer les deux versions:")]), _vm._v(" "), _c('div', {
- slot: "content"
- }, [_c('div', {
- ref: "modalcontent"
- }, [_c('div', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (_vm.fragmentMode),
- expression: "fragmentMode"
- }]
- }, [_c('svg', [_c('image', {
- attrs: {
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
- "href": _vm.imagePath,
- "x": "0",
- "y": "0",
- "width": _vm.imageWidth,
- "height": _vm.imageHeight
- }
- }), _vm._v(" "), _c('g', {
- attrs: {
- "transform": _vm.matrixTransform
- }
- }, [_c('path', {
- attrs: {
- "d": _vm.originalPath,
- "fill": "red",
- "stroke": "blue",
- "opacity": "0.3"
- }
- }), _vm._v(" "), _c('path', {
- attrs: {
- "d": _vm.modifiedPath,
- "fill": "blue",
- "stroke": "red",
- "opacity": "0.3"
- }
- })])])]), _vm._v(" "), _c('div', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (_vm.textMode),
- expression: "textMode"
- }]
- }, [_c('div', {
- domProps: {
- "innerHTML": _vm._s(_vm.diffText)
- }
- })]), _vm._v(" "), _c('div', {
- directives: [{
- name: "show",
- rawName: "v-show",
- value: (_vm.tagMode),
- expression: "tagMode"
- }]
- }, [_c('ul', _vm._l((_vm.tags), function(tag, index) {
- return _c('li', [(!tag.action) ? [_c('li', [_c('span', [_vm._v(_vm._s(tag.tag_label))]), _vm._v(" | précision : " + _vm._s(tag.accuracy) + " \n\t\t\t\t\t\t\t\t\t- \n\t\t\t\t\t\t\t\t\tpertinence : " + _vm._s(tag.relevancy) + "\n\t\t\t\t\t\t\t\t")])] : _vm._e(), _vm._v(" "), (tag.action == 'replace') ? [_c('del', [_vm._v("--")]), _vm._v(" "), _c('del', [_vm._v(_vm._s(tag.tag_label))]), _vm._v(" a été remplacé par\n\t\t\t\t\t\t\t\t"), _c('ins', [_vm._v("++")]), _vm._v(" "), _c('strong', [_c('ins', [_vm._v(_vm._s(tag.new_label))])]), _vm._v(" \n\t\t\t\t\t\t\t\tfiabilité : "), _c('ins', [_vm._v(_vm._s(tag.new_accuracy))]), _vm._v(" - \n\t\t\t\t\t\t\t\tpertinence: "), _c('ins', [_vm._v(_vm._s(tag.new_relevancy))])] : _vm._e(), _vm._v(" "), (tag.action == 'add') ? [_c('li', [_c('ins', [_vm._v("++")]), _vm._v(" "), _c('ins', [_vm._v(_vm._s(tag.tag_label))]), _vm._v("\n\t\t\t\t\t\t\t\t\tfiabilité : "), _c('ins', [_vm._v(_vm._s(tag.accuracy))]), _vm._v(" - \n\t\t\t\t\t\t\t\t\tpertinence : "), _c('ins', [_vm._v(_vm._s(tag.relevancy))])])] : _vm._e(), _vm._v(" "), (tag.action == 'del') ? [_c('li', [_c('del', [_vm._v("--")]), _vm._v(" "), _c('del', [_vm._v(_vm._s(tag.tag_label))]), _vm._v(" a été effacé")])] : _vm._e(), _vm._v(" "), (tag.action == 'update') ? [_c('li', [_c('strong', [_vm._v(_vm._s(tag.tag_label))]), _vm._v(" "), (tag.accuracy != tag.new_accuracy) ? [_vm._v("\n\t\t\t\t\t\t\t\t\t\tfiabilité: "), _c('del', [_vm._v(_vm._s(tag.accuracy))]), _vm._v(" "), _c('ins', [_vm._v(_vm._s(tag.new_accuracy))]), _vm._v(" -\t\n\t\t\t\t\t\t\t\t\t")] : _vm._e(), _vm._v(" "), (tag.accuracy == tag.new_accuracy) ? [_vm._v("\n\t\t\t\t\t\t\t\t\t\tfiabilité: " + _vm._s(tag.accuracy) + " -\n\t\t\t\t\t\t\t\t\t")] : _vm._e(), _vm._v(" "), (tag.relevancy != tag.new_relevancy) ? [_vm._v("\n\t\t\t\t\t\t\t\t\t\tpertinence: "), _c('del', [_vm._v(_vm._s(tag.relevancy))]), _vm._v(" "), _c('ins', [_vm._v(_vm._s(tag.new_relevancy))])] : _vm._e(), _vm._v(" "), (tag.relevancy == tag.new_relevancy) ? [_vm._v("\n\t\t\t\t\t\t\t\t\t\tpertinence: " + _vm._s(tag.relevancy) + "\t\n\t\t\t\t\t\t\t\t\t")] : _vm._e()], 2)] : _vm._e()], 2)
- }))])])])])], 1)
- },staticRenderFns: []}
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api").rerender("data-v-64c3b6ce", module.exports)
- }
- }
-
-/***/ },
-/* 98 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* script */
- __vue_exports__ = __webpack_require__(99)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/collectionselector/CollectionSelector.vue"
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-48b17964", __vue_options__)
- } else {
- hotAPI.reload("data-v-48b17964", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] CollectionSelector.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 99 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function($) {"use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- data: function data() {
- return {};
- },
- mounted: function mounted() {
- var self = this;
- $(".collection-container").hide();
- $(".collection-description-complete").hide();
- $("#show-main-collections").hide();
- },
-
- methods: {
- pickOtherCollection: function pickOtherCollection(name) {
- if (!$("#show-collection-" + name).hasClass("btn-primary")) {
- $("#main-panel").hide();
- $("#show-main-collections").show();
- $(".collection-container").removeClass("selected");
- $(".collection-container:not(.selected)").hide();
- $(".collection-description-complete").hide();
- $(".collection-description").show();
- $(".btn-collection").removeClass("btn-primary");
- $("#show-collection-" + name).addClass("btn-primary");
- $(".collection-container#collection-panel-" + name).show();
- $(".collection-container#collection-panel-" + name).addClass("selected");
- }
- },
- showMainPanel: function showMainPanel() {
- $(".collection-container").removeClass("selected");
- $(".btn-collection").removeClass("btn-primary");
- $(".collection-container").hide();
- $("#main-panel").show();
- $("#show-main-collections").hide();
- },
- showCompleteDescription: function showCompleteDescription(name) {
- $(".collection-description-complete").hide();
- $("#collection-description-short-" + name).hide();
- $("#collection-description-complete-" + name).show();
- },
- hideCompleteDescription: function hideCompleteDescription(name) {
- $(".collection-description-complete").hide();
- $("#collection-description-short-" + name).show();
- }
- }
- };
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
-
-/***/ },
-/* 100 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* script */
- __vue_exports__ = __webpack_require__(101)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/collectionhome/tabselector/TabSelector.vue"
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-249669d0", __vue_options__)
- } else {
- hotAPI.reload("data-v-249669d0", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] TabSelector.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 101 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function($) {"use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- data: function data() {
- return {};
- },
- mounted: function mounted() {
- var self = this;
- $(".collection-home-block:not(.selected)").hide();
- },
-
- methods: {
- switchTab: function switchTab(name) {
- $(".collection-home-block").removeClass("selected");
- $(".collection-home-block").hide();
- $(".collection-home-tab").parent().removeClass("active");
- $("#list-" + name).show();
- $("#tab-" + name).addClass("active");
- }
- }
- };
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
-
-/***/ },
-/* 102 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __vue_exports__, __vue_options__
- var __vue_styles__ = {}
-
- /* script */
- __vue_exports__ = __webpack_require__(103)
- __vue_options__ = __vue_exports__ = __vue_exports__ || {}
- if (
- typeof __vue_exports__.default === "object" ||
- typeof __vue_exports__.default === "function"
- ) {
- if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")}
- __vue_options__ = __vue_exports__ = __vue_exports__.default
- }
- if (typeof __vue_options__ === "function") {
- __vue_options__ = __vue_options__.options
- }
- __vue_options__.__file = "/Users/alex/Workspace/iconolab/src_js/iconolab-bundle/src/components/collectionhome/descriptionviewer/DescriptionViewer.vue"
-
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-5b0b5ce8", __vue_options__)
- } else {
- hotAPI.reload("data-v-5b0b5ce8", __vue_options__)
- }
- })()}
- if (__vue_options__.functional) {console.error("[vue-loader] DescriptionViewer.vue: functional components are not supported and should be defined in plain js files using render functions.")}
-
- module.exports = __vue_exports__
-
-
-/***/ },
-/* 103 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function($) {"use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- data: {},
- mounted: function mounted() {
- $(".collection-description-complete").hide();
- },
-
- methods: {
- showCompleteDescription: function showCompleteDescription() {
- $(".collection-description").hide();
- $(".collection-description-complete").show();
- },
- hideCompleteDescription: function hideCompleteDescription(name) {
- $(".collection-description-complete").hide();
- $(".collection-description").show();
- }
- }
- };
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
-
-/***/ },
-/* 104 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- var environment = __webpack_require__(105);
-
- var DiffPatcher = __webpack_require__(106).DiffPatcher;
- exports.DiffPatcher = DiffPatcher;
-
- exports.create = function(options){
- return new DiffPatcher(options);
- };
-
- exports.dateReviver = __webpack_require__(111);
-
- var defaultInstance;
-
- exports.diff = function() {
- if (!defaultInstance) {
- defaultInstance = new DiffPatcher();
- }
- return defaultInstance.diff.apply(defaultInstance, arguments);
- };
-
- exports.patch = function() {
- if (!defaultInstance) {
- defaultInstance = new DiffPatcher();
- }
- return defaultInstance.patch.apply(defaultInstance, arguments);
- };
-
- exports.unpatch = function() {
- if (!defaultInstance) {
- defaultInstance = new DiffPatcher();
- }
- return defaultInstance.unpatch.apply(defaultInstance, arguments);
- };
-
- exports.reverse = function() {
- if (!defaultInstance) {
- defaultInstance = new DiffPatcher();
- }
- return defaultInstance.reverse.apply(defaultInstance, arguments);
- };
-
- if (environment.isBrowser) {
- exports.homepage = '{{package-homepage}}';
- exports.version = '{{package-version}}';
- } else {
- var packageInfoModuleName = '../package.json';
- var packageInfo = __webpack_require__(122)(packageInfoModuleName);
- exports.homepage = packageInfo.homepage;
- exports.version = packageInfo.version;
-
- var formatterModuleName = './formatters';
- var formatters = __webpack_require__(122)(formatterModuleName);
- exports.formatters = formatters;
- // shortcut for console
- exports.console = formatters.console;
- }
-
-
-/***/ },
-/* 105 */
-/***/ function(module, exports) {
-
-
- exports.isBrowser = typeof window !== 'undefined';
-
-
-/***/ },
-/* 106 */
-/***/ function(module, exports, __webpack_require__) {
-
- var Processor = __webpack_require__(107).Processor;
- var Pipe = __webpack_require__(108).Pipe;
- var DiffContext = __webpack_require__(109).DiffContext;
- var PatchContext = __webpack_require__(112).PatchContext;
- var ReverseContext = __webpack_require__(113).ReverseContext;
-
- var trivial = __webpack_require__(114);
- var nested = __webpack_require__(115);
- var arrays = __webpack_require__(116);
- var dates = __webpack_require__(118);
- var texts = __webpack_require__(119);
-
- var DiffPatcher = function DiffPatcher(options) {
- this.processor = new Processor(options);
- this.processor.pipe(new Pipe('diff').append(
- nested.collectChildrenDiffFilter,
- trivial.diffFilter,
- dates.diffFilter,
- texts.diffFilter,
- nested.objectsDiffFilter,
- arrays.diffFilter
- ).shouldHaveResult());
- this.processor.pipe(new Pipe('patch').append(
- nested.collectChildrenPatchFilter,
- arrays.collectChildrenPatchFilter,
- trivial.patchFilter,
- texts.patchFilter,
- nested.patchFilter,
- arrays.patchFilter
- ).shouldHaveResult());
- this.processor.pipe(new Pipe('reverse').append(
- nested.collectChildrenReverseFilter,
- arrays.collectChildrenReverseFilter,
- trivial.reverseFilter,
- texts.reverseFilter,
- nested.reverseFilter,
- arrays.reverseFilter
- ).shouldHaveResult());
- };
-
- DiffPatcher.prototype.options = function() {
- return this.processor.options.apply(this.processor, arguments);
- };
-
- DiffPatcher.prototype.diff = function(left, right) {
- return this.processor.process(new DiffContext(left, right));
- };
-
- DiffPatcher.prototype.patch = function(left, delta) {
- return this.processor.process(new PatchContext(left, delta));
- };
-
- DiffPatcher.prototype.reverse = function(delta) {
- return this.processor.process(new ReverseContext(delta));
- };
-
- DiffPatcher.prototype.unpatch = function(right, delta) {
- return this.patch(right, this.reverse(delta));
- };
-
- exports.DiffPatcher = DiffPatcher;
-
-
-/***/ },
-/* 107 */
-/***/ function(module, exports) {
-
-
- var Processor = function Processor(options){
- this.selfOptions = options || {};
- this.pipes = {};
- };
-
- Processor.prototype.options = function(options) {
- if (options) {
- this.selfOptions = options;
- }
- return this.selfOptions;
- };
-
- Processor.prototype.pipe = function(name, pipe) {
- if (typeof name === 'string') {
- if (typeof pipe === 'undefined') {
- return this.pipes[name];
- } else {
- this.pipes[name] = pipe;
- }
- }
- if (name && name.name) {
- pipe = name;
- if (pipe.processor === this) { return pipe; }
- this.pipes[pipe.name] = pipe;
- }
- pipe.processor = this;
- return pipe;
- };
-
- Processor.prototype.process = function(input, pipe) {
- var context = input;
- context.options = this.options();
- var nextPipe = pipe || input.pipe || 'default';
- var lastPipe, lastContext;
- while (nextPipe) {
- if (typeof context.nextAfterChildren !== 'undefined') {
- // children processed and coming back to parent
- context.next = context.nextAfterChildren;
- context.nextAfterChildren = null;
- }
-
- if (typeof nextPipe === 'string') {
- nextPipe = this.pipe(nextPipe);
- }
- nextPipe.process(context);
- lastContext = context;
- lastPipe = nextPipe;
- nextPipe = null;
- if (context) {
- if (context.next) {
- context = context.next;
- nextPipe = lastContext.nextPipe || context.pipe || lastPipe;
- }
- }
- }
- return context.hasResult ? context.result : undefined;
- };
-
- exports.Processor = Processor;
-
-
-/***/ },
-/* 108 */
-/***/ function(module, exports) {
-
- var Pipe = function Pipe(name) {
- this.name = name;
- this.filters = [];
- };
-
- Pipe.prototype.process = function(input) {
- if (!this.processor) {
- throw new Error('add this pipe to a processor before using it');
- }
- var debug = this.debug;
- var length = this.filters.length;
- var context = input;
- for (var index = 0; index < length; index++) {
- var filter = this.filters[index];
- if (debug) {
- this.log('filter: ' + filter.filterName);
- }
- filter(context);
- if (typeof context === 'object' && context.exiting) {
- context.exiting = false;
- break;
- }
- }
- if (!context.next && this.resultCheck) {
- this.resultCheck(context);
- }
- };
-
- Pipe.prototype.log = function(msg) {
- console.log('[jsondiffpatch] ' + this.name + ' pipe, ' + msg);
- };
-
- Pipe.prototype.append = function() {
- this.filters.push.apply(this.filters, arguments);
- return this;
- };
-
- Pipe.prototype.prepend = function() {
- this.filters.unshift.apply(this.filters, arguments);
- return this;
- };
-
- Pipe.prototype.indexOf = function(filterName) {
- if (!filterName) {
- throw new Error('a filter name is required');
- }
- for (var index = 0; index < this.filters.length; index++) {
- var filter = this.filters[index];
- if (filter.filterName === filterName) {
- return index;
- }
- }
- throw new Error('filter not found: ' + filterName);
- };
-
- Pipe.prototype.list = function() {
- var names = [];
- for (var index = 0; index < this.filters.length; index++) {
- var filter = this.filters[index];
- names.push(filter.filterName);
- }
- return names;
- };
-
- Pipe.prototype.after = function(filterName) {
- var index = this.indexOf(filterName);
- var params = Array.prototype.slice.call(arguments, 1);
- if (!params.length) {
- throw new Error('a filter is required');
- }
- params.unshift(index + 1, 0);
- Array.prototype.splice.apply(this.filters, params);
- return this;
- };
-
- Pipe.prototype.before = function(filterName) {
- var index = this.indexOf(filterName);
- var params = Array.prototype.slice.call(arguments, 1);
- if (!params.length) {
- throw new Error('a filter is required');
- }
- params.unshift(index, 0);
- Array.prototype.splice.apply(this.filters, params);
- return this;
- };
-
- Pipe.prototype.clear = function() {
- this.filters.length = 0;
- return this;
- };
-
- Pipe.prototype.shouldHaveResult = function(should) {
- if (should === false) {
- this.resultCheck = null;
- return;
- }
- if (this.resultCheck) {
- return;
- }
- var pipe = this;
- this.resultCheck = function(context) {
- if (!context.hasResult) {
- console.log(context);
- var error = new Error(pipe.name + ' failed');
- error.noResult = true;
- throw error;
- }
- };
- return this;
- };
-
- exports.Pipe = Pipe;
-
-
-/***/ },
-/* 109 */
-/***/ function(module, exports, __webpack_require__) {
-
- var Context = __webpack_require__(110).Context;
- var dateReviver = __webpack_require__(111);
-
- var DiffContext = function DiffContext(left, right) {
- this.left = left;
- this.right = right;
- this.pipe = 'diff';
- };
-
- DiffContext.prototype = new Context();
-
- DiffContext.prototype.setResult = function(result) {
- if (this.options.cloneDiffValues) {
- var clone = typeof this.options.cloneDiffValues === 'function' ?
- this.options.cloneDiffValues : function(value) {
- return JSON.parse(JSON.stringify(value), dateReviver);
- };
- if (typeof result[0] === 'object') {
- result[0] = clone(result[0]);
- }
- if (typeof result[1] === 'object') {
- result[1] = clone(result[1]);
- }
- }
- return Context.prototype.setResult.apply(this, arguments);
- };
-
- exports.DiffContext = DiffContext;
-
-
-/***/ },
-/* 110 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- var Pipe = __webpack_require__(108).Pipe;
-
- var Context = function Context(){
- };
-
- Context.prototype.setResult = function(result) {
- this.result = result;
- this.hasResult = true;
- return this;
- };
-
- Context.prototype.exit = function() {
- this.exiting = true;
- return this;
- };
-
- Context.prototype.switchTo = function(next, pipe) {
- if (typeof next === 'string' || next instanceof Pipe) {
- this.nextPipe = next;
- } else {
- this.next = next;
- if (pipe) {
- this.nextPipe = pipe;
- }
- }
- return this;
- };
-
- Context.prototype.push = function(child, name) {
- child.parent = this;
- if (typeof name !== 'undefined') {
- child.childName = name;
- }
- child.root = this.root || this;
- child.options = child.options || this.options;
- if (!this.children) {
- this.children = [child];
- this.nextAfterChildren = this.next || null;
- this.next = child;
- } else {
- this.children[this.children.length - 1].next = child;
- this.children.push(child);
- }
- child.next = this;
- return this;
- };
-
- exports.Context = Context;
-
-
-/***/ },
-/* 111 */
-/***/ function(module, exports) {
-
- // use as 2nd parameter for JSON.parse to revive Date instances
- module.exports = function dateReviver(key, value) {
- var parts;
- if (typeof value === 'string') {
- parts = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d*))?(Z|([+\-])(\d{2}):(\d{2}))$/.exec(value);
- if (parts) {
- return new Date(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4], +parts[5], +parts[6], +(parts[7] || 0)));
- }
- }
- return value;
- };
-
-
-/***/ },
-/* 112 */
-/***/ function(module, exports, __webpack_require__) {
-
- var Context = __webpack_require__(110).Context;
-
- var PatchContext = function PatchContext(left, delta) {
- this.left = left;
- this.delta = delta;
- this.pipe = 'patch';
- };
-
- PatchContext.prototype = new Context();
-
- exports.PatchContext = PatchContext;
-
-
-/***/ },
-/* 113 */
-/***/ function(module, exports, __webpack_require__) {
-
- var Context = __webpack_require__(110).Context;
-
- var ReverseContext = function ReverseContext(delta) {
- this.delta = delta;
- this.pipe = 'reverse';
- };
-
- ReverseContext.prototype = new Context();
-
- exports.ReverseContext = ReverseContext;
-
-
-/***/ },
-/* 114 */
-/***/ function(module, exports) {
-
- var isArray = (typeof Array.isArray === 'function') ?
- // use native function
- Array.isArray :
- // use instanceof operator
- function(a) {
- return a instanceof Array;
- };
-
- var diffFilter = function trivialMatchesDiffFilter(context) {
- if (context.left === context.right) {
- context.setResult(undefined).exit();
- return;
- }
- if (typeof context.left === 'undefined') {
- if (typeof context.right === 'function') {
- throw new Error('functions are not supported');
- }
- context.setResult([context.right]).exit();
- return;
- }
- if (typeof context.right === 'undefined') {
- context.setResult([context.left, 0, 0]).exit();
- return;
- }
- if (typeof context.left === 'function' || typeof context.right === 'function') {
- throw new Error('functions are not supported');
- }
- context.leftType = context.left === null ? 'null' : typeof context.left;
- context.rightType = context.right === null ? 'null' : typeof context.right;
- if (context.leftType !== context.rightType) {
- context.setResult([context.left, context.right]).exit();
- return;
- }
- if (context.leftType === 'boolean' || context.leftType === 'number') {
- context.setResult([context.left, context.right]).exit();
- return;
- }
- if (context.leftType === 'object') {
- context.leftIsArray = isArray(context.left);
- }
- if (context.rightType === 'object') {
- context.rightIsArray = isArray(context.right);
- }
- if (context.leftIsArray !== context.rightIsArray) {
- context.setResult([context.left, context.right]).exit();
- return;
- }
- };
- diffFilter.filterName = 'trivial';
-
- var patchFilter = function trivialMatchesPatchFilter(context) {
- if (typeof context.delta === 'undefined') {
- context.setResult(context.left).exit();
- return;
- }
- context.nested = !isArray(context.delta);
- if (context.nested) {
- return;
- }
- if (context.delta.length === 1) {
- context.setResult(context.delta[0]).exit();
- return;
- }
- if (context.delta.length === 2) {
- context.setResult(context.delta[1]).exit();
- return;
- }
- if (context.delta.length === 3 && context.delta[2] === 0) {
- context.setResult(undefined).exit();
- return;
- }
- };
- patchFilter.filterName = 'trivial';
-
- var reverseFilter = function trivialReferseFilter(context) {
- if (typeof context.delta === 'undefined') {
- context.setResult(context.delta).exit();
- return;
- }
- context.nested = !isArray(context.delta);
- if (context.nested) {
- return;
- }
- if (context.delta.length === 1) {
- context.setResult([context.delta[0], 0, 0]).exit();
- return;
- }
- if (context.delta.length === 2) {
- context.setResult([context.delta[1], context.delta[0]]).exit();
- return;
- }
- if (context.delta.length === 3 && context.delta[2] === 0) {
- context.setResult([context.delta[0]]).exit();
- return;
- }
- };
- reverseFilter.filterName = 'trivial';
-
- exports.diffFilter = diffFilter;
- exports.patchFilter = patchFilter;
- exports.reverseFilter = reverseFilter;
-
-
-/***/ },
-/* 115 */
-/***/ function(module, exports, __webpack_require__) {
-
- var DiffContext = __webpack_require__(109).DiffContext;
- var PatchContext = __webpack_require__(112).PatchContext;
- var ReverseContext = __webpack_require__(113).ReverseContext;
-
- var collectChildrenDiffFilter = function collectChildrenDiffFilter(context) {
- if (!context || !context.children) {
- return;
- }
- var length = context.children.length;
- var child;
- var result = context.result;
- for (var index = 0; index < length; index++) {
- child = context.children[index];
- if (typeof child.result === 'undefined') {
- continue;
- }
- result = result || {};
- result[child.childName] = child.result;
- }
- if (result && context.leftIsArray) {
- result._t = 'a';
- }
- context.setResult(result).exit();
- };
- collectChildrenDiffFilter.filterName = 'collectChildren';
-
- var objectsDiffFilter = function objectsDiffFilter(context) {
- if (context.leftIsArray || context.leftType !== 'object') {
- return;
- }
-
- var name, child, propertyFilter = context.options.propertyFilter;
- for (name in context.left) {
- if (!Object.prototype.hasOwnProperty.call(context.left, name)) {
- continue;
- }
- if (propertyFilter && !propertyFilter(name, context)) {
- continue;
- }
- child = new DiffContext(context.left[name], context.right[name]);
- context.push(child, name);
- }
- for (name in context.right) {
- if (!Object.prototype.hasOwnProperty.call(context.right, name)) {
- continue;
- }
- if (propertyFilter && !propertyFilter(name, context)) {
- continue;
- }
- if (typeof context.left[name] === 'undefined') {
- child = new DiffContext(undefined, context.right[name]);
- context.push(child, name);
- }
- }
-
- if (!context.children || context.children.length === 0) {
- context.setResult(undefined).exit();
- return;
- }
- context.exit();
- };
- objectsDiffFilter.filterName = 'objects';
-
- var patchFilter = function nestedPatchFilter(context) {
- if (!context.nested) {
- return;
- }
- if (context.delta._t) {
- return;
- }
- var name, child;
- for (name in context.delta) {
- child = new PatchContext(context.left[name], context.delta[name]);
- context.push(child, name);
- }
- context.exit();
- };
- patchFilter.filterName = 'objects';
-
- var collectChildrenPatchFilter = function collectChildrenPatchFilter(context) {
- if (!context || !context.children) {
- return;
- }
- if (context.delta._t) {
- return;
- }
- var length = context.children.length;
- var child;
- for (var index = 0; index < length; index++) {
- child = context.children[index];
- if (Object.prototype.hasOwnProperty.call(context.left, child.childName) && child.result === undefined) {
- delete context.left[child.childName];
- } else if (context.left[child.childName] !== child.result) {
- context.left[child.childName] = child.result;
- }
- }
- context.setResult(context.left).exit();
- };
- collectChildrenPatchFilter.filterName = 'collectChildren';
-
- var reverseFilter = function nestedReverseFilter(context) {
- if (!context.nested) {
- return;
- }
- if (context.delta._t) {
- return;
- }
- var name, child;
- for (name in context.delta) {
- child = new ReverseContext(context.delta[name]);
- context.push(child, name);
- }
- context.exit();
- };
- reverseFilter.filterName = 'objects';
-
- var collectChildrenReverseFilter = function collectChildrenReverseFilter(context) {
- if (!context || !context.children) {
- return;
- }
- if (context.delta._t) {
- return;
- }
- var length = context.children.length;
- var child;
- var delta = {};
- for (var index = 0; index < length; index++) {
- child = context.children[index];
- if (delta[child.childName] !== child.result) {
- delta[child.childName] = child.result;
- }
- }
- context.setResult(delta).exit();
- };
- collectChildrenReverseFilter.filterName = 'collectChildren';
-
- exports.collectChildrenDiffFilter = collectChildrenDiffFilter;
- exports.objectsDiffFilter = objectsDiffFilter;
- exports.patchFilter = patchFilter;
- exports.collectChildrenPatchFilter = collectChildrenPatchFilter;
- exports.reverseFilter = reverseFilter;
- exports.collectChildrenReverseFilter = collectChildrenReverseFilter;
-
-
-/***/ },
-/* 116 */
-/***/ function(module, exports, __webpack_require__) {
-
- var DiffContext = __webpack_require__(109).DiffContext;
- var PatchContext = __webpack_require__(112).PatchContext;
- var ReverseContext = __webpack_require__(113).ReverseContext;
-
- var lcs = __webpack_require__(117);
-
- var ARRAY_MOVE = 3;
-
- var isArray = (typeof Array.isArray === 'function') ?
- // use native function
- Array.isArray :
- // use instanceof operator
- function(a) {
- return a instanceof Array;
- };
-
- var arrayIndexOf = typeof Array.prototype.indexOf === 'function' ?
- function(array, item) {
- return array.indexOf(item);
- } : function(array, item) {
- var length = array.length;
- for (var i = 0; i < length; i++) {
- if (array[i] === item) {
- return i;
- }
- }
- return -1;
- };
-
- function arraysHaveMatchByRef(array1, array2, len1, len2) {
- for (var index1 = 0; index1 < len1; index1++) {
- var val1 = array1[index1];
- for (var index2 = 0; index2 < len2; index2++) {
- var val2 = array2[index2];
- if (val1 === val2) {
- return true;
- }
- }
- }
- }
-
- function matchItems(array1, array2, index1, index2, context) {
- var value1 = array1[index1];
- var value2 = array2[index2];
- if (value1 === value2) {
- return true;
- }
- if (typeof value1 !== 'object' || typeof value2 !== 'object') {
- return false;
- }
- var objectHash = context.objectHash;
- if (!objectHash) {
- // no way to match objects was provided, try match by position
- return context.matchByPosition && index1 === index2;
- }
- var hash1;
- var hash2;
- if (typeof index1 === 'number') {
- context.hashCache1 = context.hashCache1 || [];
- hash1 = context.hashCache1[index1];
- if (typeof hash1 === 'undefined') {
- context.hashCache1[index1] = hash1 = objectHash(value1, index1);
- }
- } else {
- hash1 = objectHash(value1);
- }
- if (typeof hash1 === 'undefined') {
- return false;
- }
- if (typeof index2 === 'number') {
- context.hashCache2 = context.hashCache2 || [];
- hash2 = context.hashCache2[index2];
- if (typeof hash2 === 'undefined') {
- context.hashCache2[index2] = hash2 = objectHash(value2, index2);
- }
- } else {
- hash2 = objectHash(value2);
- }
- if (typeof hash2 === 'undefined') {
- return false;
- }
- return hash1 === hash2;
- }
-
- var diffFilter = function arraysDiffFilter(context) {
- if (!context.leftIsArray) {
- return;
- }
-
- var matchContext = {
- objectHash: context.options && context.options.objectHash,
- matchByPosition: context.options && context.options.matchByPosition
- };
- var commonHead = 0;
- var commonTail = 0;
- var index;
- var index1;
- var index2;
- var array1 = context.left;
- var array2 = context.right;
- var len1 = array1.length;
- var len2 = array2.length;
-
- var child;
-
- if (len1 > 0 && len2 > 0 && !matchContext.objectHash &&
- typeof matchContext.matchByPosition !== 'boolean') {
- matchContext.matchByPosition = !arraysHaveMatchByRef(array1, array2, len1, len2);
- }
-
- // separate common head
- while (commonHead < len1 && commonHead < len2 &&
- matchItems(array1, array2, commonHead, commonHead, matchContext)) {
- index = commonHead;
- child = new DiffContext(context.left[index], context.right[index]);
- context.push(child, index);
- commonHead++;
- }
- // separate common tail
- while (commonTail + commonHead < len1 && commonTail + commonHead < len2 &&
- matchItems(array1, array2, len1 - 1 - commonTail, len2 - 1 - commonTail, matchContext)) {
- index1 = len1 - 1 - commonTail;
- index2 = len2 - 1 - commonTail;
- child = new DiffContext(context.left[index1], context.right[index2]);
- context.push(child, index2);
- commonTail++;
- }
- var result;
- if (commonHead + commonTail === len1) {
- if (len1 === len2) {
- // arrays are identical
- context.setResult(undefined).exit();
- return;
- }
- // trivial case, a block (1 or more consecutive items) was added
- result = result || {
- _t: 'a'
- };
- for (index = commonHead; index < len2 - commonTail; index++) {
- result[index] = [array2[index]];
- }
- context.setResult(result).exit();
- return;
- }
- if (commonHead + commonTail === len2) {
- // trivial case, a block (1 or more consecutive items) was removed
- result = result || {
- _t: 'a'
- };
- for (index = commonHead; index < len1 - commonTail; index++) {
- result['_' + index] = [array1[index], 0, 0];
- }
- context.setResult(result).exit();
- return;
- }
- // reset hash cache
- delete matchContext.hashCache1;
- delete matchContext.hashCache2;
-
- // diff is not trivial, find the LCS (Longest Common Subsequence)
- var trimmed1 = array1.slice(commonHead, len1 - commonTail);
- var trimmed2 = array2.slice(commonHead, len2 - commonTail);
- var seq = lcs.get(
- trimmed1, trimmed2,
- matchItems,
- matchContext
- );
- var removedItems = [];
- result = result || {
- _t: 'a'
- };
- for (index = commonHead; index < len1 - commonTail; index++) {
- if (arrayIndexOf(seq.indices1, index - commonHead) < 0) {
- // removed
- result['_' + index] = [array1[index], 0, 0];
- removedItems.push(index);
- }
- }
-
- var detectMove = true;
- if (context.options && context.options.arrays && context.options.arrays.detectMove === false) {
- detectMove = false;
- }
- var includeValueOnMove = false;
- if (context.options && context.options.arrays && context.options.arrays.includeValueOnMove) {
- includeValueOnMove = true;
- }
-
- var removedItemsLength = removedItems.length;
- for (index = commonHead; index < len2 - commonTail; index++) {
- var indexOnArray2 = arrayIndexOf(seq.indices2, index - commonHead);
- if (indexOnArray2 < 0) {
- // added, try to match with a removed item and register as position move
- var isMove = false;
- if (detectMove && removedItemsLength > 0) {
- for (var removeItemIndex1 = 0; removeItemIndex1 < removedItemsLength; removeItemIndex1++) {
- index1 = removedItems[removeItemIndex1];
- if (matchItems(trimmed1, trimmed2, index1 - commonHead,
- index - commonHead, matchContext)) {
- // store position move as: [originalValue, newPosition, ARRAY_MOVE]
- result['_' + index1].splice(1, 2, index, ARRAY_MOVE);
- if (!includeValueOnMove) {
- // don't include moved value on diff, to save bytes
- result['_' + index1][0] = '';
- }
-
- index2 = index;
- child = new DiffContext(context.left[index1], context.right[index2]);
- context.push(child, index2);
- removedItems.splice(removeItemIndex1, 1);
- isMove = true;
- break;
- }
- }
- }
- if (!isMove) {
- // added
- result[index] = [array2[index]];
- }
- } else {
- // match, do inner diff
- index1 = seq.indices1[indexOnArray2] + commonHead;
- index2 = seq.indices2[indexOnArray2] + commonHead;
- child = new DiffContext(context.left[index1], context.right[index2]);
- context.push(child, index2);
- }
- }
-
- context.setResult(result).exit();
-
- };
- diffFilter.filterName = 'arrays';
-
- var compare = {
- numerically: function(a, b) {
- return a - b;
- },
- numericallyBy: function(name) {
- return function(a, b) {
- return a[name] - b[name];
- };
- }
- };
-
- var patchFilter = function nestedPatchFilter(context) {
- if (!context.nested) {
- return;
- }
- if (context.delta._t !== 'a') {
- return;
- }
- var index, index1;
-
- var delta = context.delta;
- var array = context.left;
-
- // first, separate removals, insertions and modifications
- var toRemove = [];
- var toInsert = [];
- var toModify = [];
- for (index in delta) {
- if (index !== '_t') {
- if (index[0] === '_') {
- // removed item from original array
- if (delta[index][2] === 0 || delta[index][2] === ARRAY_MOVE) {
- toRemove.push(parseInt(index.slice(1), 10));
- } else {
- throw new Error('only removal or move can be applied at original array indices' +
- ', invalid diff type: ' + delta[index][2]);
- }
- } else {
- if (delta[index].length === 1) {
- // added item at new array
- toInsert.push({
- index: parseInt(index, 10),
- value: delta[index][0]
- });
- } else {
- // modified item at new array
- toModify.push({
- index: parseInt(index, 10),
- delta: delta[index]
- });
- }
- }
- }
- }
-
- // remove items, in reverse order to avoid sawing our own floor
- toRemove = toRemove.sort(compare.numerically);
- for (index = toRemove.length - 1; index >= 0; index--) {
- index1 = toRemove[index];
- var indexDiff = delta['_' + index1];
- var removedValue = array.splice(index1, 1)[0];
- if (indexDiff[2] === ARRAY_MOVE) {
- // reinsert later
- toInsert.push({
- index: indexDiff[1],
- value: removedValue
- });
- }
- }
-
- // insert items, in reverse order to avoid moving our own floor
- toInsert = toInsert.sort(compare.numericallyBy('index'));
- var toInsertLength = toInsert.length;
- for (index = 0; index < toInsertLength; index++) {
- var insertion = toInsert[index];
- array.splice(insertion.index, 0, insertion.value);
- }
-
- // apply modifications
- var toModifyLength = toModify.length;
- var child;
- if (toModifyLength > 0) {
- for (index = 0; index < toModifyLength; index++) {
- var modification = toModify[index];
- child = new PatchContext(context.left[modification.index], modification.delta);
- context.push(child, modification.index);
- }
- }
-
- if (!context.children) {
- context.setResult(context.left).exit();
- return;
- }
- context.exit();
- };
- patchFilter.filterName = 'arrays';
-
- var collectChildrenPatchFilter = function collectChildrenPatchFilter(context) {
- if (!context || !context.children) {
- return;
- }
- if (context.delta._t !== 'a') {
- return;
- }
- var length = context.children.length;
- var child;
- for (var index = 0; index < length; index++) {
- child = context.children[index];
- context.left[child.childName] = child.result;
- }
- context.setResult(context.left).exit();
- };
- collectChildrenPatchFilter.filterName = 'arraysCollectChildren';
-
- var reverseFilter = function arraysReverseFilter(context) {
- if (!context.nested) {
- if (context.delta[2] === ARRAY_MOVE) {
- context.newName = '_' + context.delta[1];
- context.setResult([context.delta[0], parseInt(context.childName.substr(1), 10), ARRAY_MOVE]).exit();
- }
- return;
- }
- if (context.delta._t !== 'a') {
- return;
- }
- var name, child;
- for (name in context.delta) {
- if (name === '_t') {
- continue;
- }
- child = new ReverseContext(context.delta[name]);
- context.push(child, name);
- }
- context.exit();
- };
- reverseFilter.filterName = 'arrays';
-
- var reverseArrayDeltaIndex = function(delta, index, itemDelta) {
- if (typeof index === 'string' && index[0] === '_') {
- return parseInt(index.substr(1), 10);
- } else if (isArray(itemDelta) && itemDelta[2] === 0) {
- return '_' + index;
- }
-
- var reverseIndex = +index;
- for (var deltaIndex in delta) {
- var deltaItem = delta[deltaIndex];
- if (isArray(deltaItem)) {
- if (deltaItem[2] === ARRAY_MOVE) {
- var moveFromIndex = parseInt(deltaIndex.substr(1), 10);
- var moveToIndex = deltaItem[1];
- if (moveToIndex === +index) {
- return moveFromIndex;
- }
- if (moveFromIndex <= reverseIndex && moveToIndex > reverseIndex) {
- reverseIndex++;
- } else if (moveFromIndex >= reverseIndex && moveToIndex < reverseIndex) {
- reverseIndex--;
- }
- } else if (deltaItem[2] === 0) {
- var deleteIndex = parseInt(deltaIndex.substr(1), 10);
- if (deleteIndex <= reverseIndex) {
- reverseIndex++;
- }
- } else if (deltaItem.length === 1 && deltaIndex <= reverseIndex) {
- reverseIndex--;
- }
- }
- }
-
- return reverseIndex;
- };
-
- var collectChildrenReverseFilter = function collectChildrenReverseFilter(context) {
- if (!context || !context.children) {
- return;
- }
- if (context.delta._t !== 'a') {
- return;
- }
- var length = context.children.length;
- var child;
- var delta = {
- _t: 'a'
- };
-
- for (var index = 0; index < length; index++) {
- child = context.children[index];
- var name = child.newName;
- if (typeof name === 'undefined') {
- name = reverseArrayDeltaIndex(context.delta, child.childName, child.result);
- }
- if (delta[name] !== child.result) {
- delta[name] = child.result;
- }
- }
- context.setResult(delta).exit();
- };
- collectChildrenReverseFilter.filterName = 'arraysCollectChildren';
-
- exports.diffFilter = diffFilter;
- exports.patchFilter = patchFilter;
- exports.collectChildrenPatchFilter = collectChildrenPatchFilter;
- exports.reverseFilter = reverseFilter;
- exports.collectChildrenReverseFilter = collectChildrenReverseFilter;
-
-
-/***/ },
-/* 117 */
-/***/ function(module, exports) {
-
- /*
-
- LCS implementation that supports arrays or strings
-
- reference: http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
-
- */
-
- var defaultMatch = function(array1, array2, index1, index2) {
- return array1[index1] === array2[index2];
- };
-
- var lengthMatrix = function(array1, array2, match, context) {
- var len1 = array1.length;
- var len2 = array2.length;
- var x, y;
-
- // initialize empty matrix of len1+1 x len2+1
- var matrix = [len1 + 1];
- for (x = 0; x < len1 + 1; x++) {
- matrix[x] = [len2 + 1];
- for (y = 0; y < len2 + 1; y++) {
- matrix[x][y] = 0;
- }
- }
- matrix.match = match;
- // save sequence lengths for each coordinate
- for (x = 1; x < len1 + 1; x++) {
- for (y = 1; y < len2 + 1; y++) {
- if (match(array1, array2, x - 1, y - 1, context)) {
- matrix[x][y] = matrix[x - 1][y - 1] + 1;
- } else {
- matrix[x][y] = Math.max(matrix[x - 1][y], matrix[x][y - 1]);
- }
- }
- }
- return matrix;
- };
-
- var backtrack = function(matrix, array1, array2, index1, index2, context) {
- if (index1 === 0 || index2 === 0) {
- return {
- sequence: [],
- indices1: [],
- indices2: []
- };
- }
-
- if (matrix.match(array1, array2, index1 - 1, index2 - 1, context)) {
- var subsequence = backtrack(matrix, array1, array2, index1 - 1, index2 - 1, context);
- subsequence.sequence.push(array1[index1 - 1]);
- subsequence.indices1.push(index1 - 1);
- subsequence.indices2.push(index2 - 1);
- return subsequence;
- }
-
- if (matrix[index1][index2 - 1] > matrix[index1 - 1][index2]) {
- return backtrack(matrix, array1, array2, index1, index2 - 1, context);
- } else {
- return backtrack(matrix, array1, array2, index1 - 1, index2, context);
- }
- };
-
- var get = function(array1, array2, match, context) {
- context = context || {};
- var matrix = lengthMatrix(array1, array2, match || defaultMatch, context);
- var result = backtrack(matrix, array1, array2, array1.length, array2.length, context);
- if (typeof array1 === 'string' && typeof array2 === 'string') {
- result.sequence = result.sequence.join('');
- }
- return result;
- };
-
- exports.get = get;
-
-
-/***/ },
-/* 118 */
-/***/ function(module, exports) {
-
- var diffFilter = function datesDiffFilter(context) {
- if (context.left instanceof Date) {
- if (context.right instanceof Date) {
- if (context.left.getTime() !== context.right.getTime()) {
- context.setResult([context.left, context.right]);
- } else {
- context.setResult(undefined);
- }
- } else {
- context.setResult([context.left, context.right]);
- }
- context.exit();
- } else if (context.right instanceof Date) {
- context.setResult([context.left, context.right]).exit();
- }
- };
- diffFilter.filterName = 'dates';
-
- exports.diffFilter = diffFilter;
-
-
-/***/ },
-/* 119 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* global diff_match_patch */
- var TEXT_DIFF = 2;
- var DEFAULT_MIN_LENGTH = 60;
- var cachedDiffPatch = null;
-
- var getDiffMatchPatch = function(required) {
- /*jshint camelcase: false */
-
- if (!cachedDiffPatch) {
- var instance;
- if (typeof diff_match_patch !== 'undefined') {
- // already loaded, probably a browser
- instance = typeof diff_match_patch === 'function' ?
- new diff_match_patch() : new diff_match_patch.diff_match_patch();
- } else if (true) {
- try {
- var dmpModuleName = 'diff_match_patch_uncompressed';
- var dmp = __webpack_require__(120)("./" + dmpModuleName);
- instance = new dmp.diff_match_patch();
- } catch (err) {
- instance = null;
- }
- }
- if (!instance) {
- if (!required) {
- return null;
- }
- var error = new Error('text diff_match_patch library not found');
- error.diff_match_patch_not_found = true;
- throw error;
- }
- cachedDiffPatch = {
- diff: function(txt1, txt2) {
- return instance.patch_toText(instance.patch_make(txt1, txt2));
- },
- patch: function(txt1, patch) {
- var results = instance.patch_apply(instance.patch_fromText(patch), txt1);
- for (var i = 0; i < results[1].length; i++) {
- if (!results[1][i]) {
- var error = new Error('text patch failed');
- error.textPatchFailed = true;
- }
- }
- return results[0];
- }
- };
- }
- return cachedDiffPatch;
- };
-
- var diffFilter = function textsDiffFilter(context) {
- if (context.leftType !== 'string') {
- return;
- }
- var minLength = (context.options && context.options.textDiff &&
- context.options.textDiff.minLength) || DEFAULT_MIN_LENGTH;
- if (context.left.length < minLength ||
- context.right.length < minLength) {
- context.setResult([context.left, context.right]).exit();
- return;
- }
- // large text, try to use a text-diff algorithm
- var diffMatchPatch = getDiffMatchPatch();
- if (!diffMatchPatch) {
- // diff-match-patch library not available, fallback to regular string replace
- context.setResult([context.left, context.right]).exit();
- return;
- }
- var diff = diffMatchPatch.diff;
- context.setResult([diff(context.left, context.right), 0, TEXT_DIFF]).exit();
- };
- diffFilter.filterName = 'texts';
-
- var patchFilter = function textsPatchFilter(context) {
- if (context.nested) {
- return;
- }
- if (context.delta[2] !== TEXT_DIFF) {
- return;
- }
-
- // text-diff, use a text-patch algorithm
- var patch = getDiffMatchPatch(true).patch;
- context.setResult(patch(context.left, context.delta[0])).exit();
- };
- patchFilter.filterName = 'texts';
-
- var textDeltaReverse = function(delta) {
- var i, l, lines, line, lineTmp, header = null,
- headerRegex = /^@@ +\-(\d+),(\d+) +\+(\d+),(\d+) +@@$/,
- lineHeader, lineAdd, lineRemove;
- lines = delta.split('\n');
- for (i = 0, l = lines.length; i < l; i++) {
- line = lines[i];
- var lineStart = line.slice(0, 1);
- if (lineStart === '@') {
- header = headerRegex.exec(line);
- lineHeader = i;
- lineAdd = null;
- lineRemove = null;
-
- // fix header
- lines[lineHeader] = '@@ -' + header[3] + ',' + header[4] + ' +' + header[1] + ',' + header[2] + ' @@';
- } else if (lineStart === '+') {
- lineAdd = i;
- lines[i] = '-' + lines[i].slice(1);
- if (lines[i - 1].slice(0, 1) === '+') {
- // swap lines to keep default order (-+)
- lineTmp = lines[i];
- lines[i] = lines[i - 1];
- lines[i - 1] = lineTmp;
- }
- } else if (lineStart === '-') {
- lineRemove = i;
- lines[i] = '+' + lines[i].slice(1);
- }
- }
- return lines.join('\n');
- };
-
- var reverseFilter = function textsReverseFilter(context) {
- if (context.nested) {
- return;
- }
- if (context.delta[2] !== TEXT_DIFF) {
- return;
- }
-
- // text-diff, use a text-diff algorithm
- context.setResult([textDeltaReverse(context.delta[0]), 0, TEXT_DIFF]).exit();
- };
- reverseFilter.filterName = 'texts';
-
- exports.diffFilter = diffFilter;
- exports.patchFilter = patchFilter;
- exports.reverseFilter = reverseFilter;
-
-
-/***/ },
-/* 120 */
-/***/ function(module, exports, __webpack_require__) {
-
- var map = {
- "./diff_match_patch_uncompressed": 121,
- "./diff_match_patch_uncompressed.js": 121
- };
- function webpackContext(req) {
- return __webpack_require__(webpackContextResolve(req));
- };
- function webpackContextResolve(req) {
- return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
- };
- webpackContext.keys = function webpackContextKeys() {
- return Object.keys(map);
- };
- webpackContext.resolve = webpackContextResolve;
- module.exports = webpackContext;
- webpackContext.id = 120;
-
-
-/***/ },
-/* 121 */
-/***/ function(module, exports) {
-
- /**
- * Diff Match and Patch
- *
- * Copyright 2006 Google Inc.
- * http://code.google.com/p/google-diff-match-patch/
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- /**
- * @fileoverview Computes the difference between two texts to create a patch.
- * Applies the patch onto another text, allowing for errors.
- * @author fraser@google.com (Neil Fraser)
- */
-
- /**
- * Class containing the diff, match and patch methods.
- * @constructor
- */
- function diff_match_patch() {
-
- // Defaults.
- // Redefine these in your program to override the defaults.
-
- // Number of seconds to map a diff before giving up (0 for infinity).
- this.Diff_Timeout = 1.0;
- // Cost of an empty edit operation in terms of edit characters.
- this.Diff_EditCost = 4;
- // At what point is no match declared (0.0 = perfection, 1.0 = very loose).
- this.Match_Threshold = 0.5;
- // How far to search for a match (0 = exact location, 1000+ = broad match).
- // A match this many characters away from the expected location will add
- // 1.0 to the score (0.0 is a perfect match).
- this.Match_Distance = 1000;
- // When deleting a large block of text (over ~64 characters), how close does
- // the contents have to match the expected contents. (0.0 = perfection,
- // 1.0 = very loose). Note that Match_Threshold controls how closely the
- // end points of a delete need to match.
- this.Patch_DeleteThreshold = 0.5;
- // Chunk size for context length.
- this.Patch_Margin = 4;
-
- // The number of bits in an int.
- this.Match_MaxBits = 32;
- }
-
-
- // DIFF FUNCTIONS
-
-
- /**
- * The data structure representing a diff is an array of tuples:
- * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
- * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
- */
- var DIFF_DELETE = -1;
- var DIFF_INSERT = 1;
- var DIFF_EQUAL = 0;
-
- /** @typedef {!Array.<number|string>} */
- diff_match_patch.Diff;
-
-
- /**
- * Find the differences between two texts. Simplifies the problem by stripping
- * any common prefix or suffix off the texts before diffing.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {boolean=} opt_checklines Optional speedup flag. If present and false,
- * then don't run a line-level diff first to identify the changed areas.
- * Defaults to true, which does a faster, slightly less optimal diff.
- * @param {number} opt_deadline Optional time when the diff should be complete
- * by. Used internally for recursive calls. Users should set DiffTimeout
- * instead.
- * @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
- */
- diff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines,
- opt_deadline) {
- // Set a deadline by which time the diff must be complete.
- if (typeof opt_deadline == 'undefined') {
- if (this.Diff_Timeout <= 0) {
- opt_deadline = Number.MAX_VALUE;
- } else {
- opt_deadline = (new Date).getTime() + this.Diff_Timeout * 1000;
- }
- }
- var deadline = opt_deadline;
-
- // Check for null inputs.
- if (text1 == null || text2 == null) {
- throw new Error('Null input. (diff_main)');
- }
-
- // Check for equality (speedup).
- if (text1 == text2) {
- if (text1) {
- return [[DIFF_EQUAL, text1]];
- }
- return [];
- }
-
- if (typeof opt_checklines == 'undefined') {
- opt_checklines = true;
- }
- var checklines = opt_checklines;
-
- // Trim off common prefix (speedup).
- var commonlength = this.diff_commonPrefix(text1, text2);
- var commonprefix = text1.substring(0, commonlength);
- text1 = text1.substring(commonlength);
- text2 = text2.substring(commonlength);
-
- // Trim off common suffix (speedup).
- commonlength = this.diff_commonSuffix(text1, text2);
- var commonsuffix = text1.substring(text1.length - commonlength);
- text1 = text1.substring(0, text1.length - commonlength);
- text2 = text2.substring(0, text2.length - commonlength);
-
- // Compute the diff on the middle block.
- var diffs = this.diff_compute_(text1, text2, checklines, deadline);
-
- // Restore the prefix and suffix.
- if (commonprefix) {
- diffs.unshift([DIFF_EQUAL, commonprefix]);
- }
- if (commonsuffix) {
- diffs.push([DIFF_EQUAL, commonsuffix]);
- }
- this.diff_cleanupMerge(diffs);
- return diffs;
- };
-
-
- /**
- * Find the differences between two texts. Assumes that the texts do not
- * have any common prefix or suffix.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {boolean} checklines Speedup flag. If false, then don't run a
- * line-level diff first to identify the changed areas.
- * If true, then run a faster, slightly less optimal diff.
- * @param {number} deadline Time when the diff should be complete by.
- * @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
- * @private
- */
- diff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines,
- deadline) {
- var diffs;
-
- if (!text1) {
- // Just add some text (speedup).
- return [[DIFF_INSERT, text2]];
- }
-
- if (!text2) {
- // Just delete some text (speedup).
- return [[DIFF_DELETE, text1]];
- }
-
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- var i = longtext.indexOf(shorttext);
- if (i != -1) {
- // Shorter text is inside the longer text (speedup).
- diffs = [[DIFF_INSERT, longtext.substring(0, i)],
- [DIFF_EQUAL, shorttext],
- [DIFF_INSERT, longtext.substring(i + shorttext.length)]];
- // Swap insertions for deletions if diff is reversed.
- if (text1.length > text2.length) {
- diffs[0][0] = diffs[2][0] = DIFF_DELETE;
- }
- return diffs;
- }
-
- if (shorttext.length == 1) {
- // Single character string.
- // After the previous speedup, the character can't be an equality.
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- }
- longtext = shorttext = null; // Garbage collect.
-
- // Check to see if the problem can be split in two.
- var hm = this.diff_halfMatch_(text1, text2);
- if (hm) {
- // A half-match was found, sort out the return data.
- var text1_a = hm[0];
- var text1_b = hm[1];
- var text2_a = hm[2];
- var text2_b = hm[3];
- var mid_common = hm[4];
- // Send both pairs off for separate processing.
- var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);
- var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);
- // Merge the results.
- return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
- }
-
- if (checklines && text1.length > 100 && text2.length > 100) {
- return this.diff_lineMode_(text1, text2, deadline);
- }
-
- return this.diff_bisect_(text1, text2, deadline);
- };
-
-
- /**
- * Do a quick line-level diff on both strings, then rediff the parts for
- * greater accuracy.
- * This speedup can produce non-minimal diffs.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {number} deadline Time when the diff should be complete by.
- * @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
- * @private
- */
- diff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {
- // Scan the text on a line-by-line basis first.
- var a = this.diff_linesToChars_(text1, text2);
- text1 = /** @type {string} */(a[0]);
- text2 = /** @type {string} */(a[1]);
- var linearray = /** @type {!Array.<string>} */(a[2]);
-
- var diffs = this.diff_bisect_(text1, text2, deadline);
-
- // Convert the diff back to original text.
- this.diff_charsToLines_(diffs, linearray);
- // Eliminate freak matches (e.g. blank lines)
- this.diff_cleanupSemantic(diffs);
-
- // Rediff any replacement blocks, this time character-by-character.
- // Add a dummy entry at the end.
- diffs.push([DIFF_EQUAL, '']);
- var pointer = 0;
- var count_delete = 0;
- var count_insert = 0;
- var text_delete = '';
- var text_insert = '';
- while (pointer < diffs.length) {
- switch (diffs[pointer][0]) {
- case DIFF_INSERT:
- count_insert++;
- text_insert += diffs[pointer][1];
- break;
- case DIFF_DELETE:
- count_delete++;
- text_delete += diffs[pointer][1];
- break;
- case DIFF_EQUAL:
- // Upon reaching an equality, check for prior redundancies.
- if (count_delete >= 1 && count_insert >= 1) {
- // Delete the offending records and add the merged ones.
- var a = this.diff_main(text_delete, text_insert, false, deadline);
- diffs.splice(pointer - count_delete - count_insert,
- count_delete + count_insert);
- pointer = pointer - count_delete - count_insert;
- for (var j = a.length - 1; j >= 0; j--) {
- diffs.splice(pointer, 0, a[j]);
- }
- pointer = pointer + a.length;
- }
- count_insert = 0;
- count_delete = 0;
- text_delete = '';
- text_insert = '';
- break;
- }
- pointer++;
- }
- diffs.pop(); // Remove the dummy entry at the end.
-
- return diffs;
- };
-
-
- /**
- * Find the 'middle snake' of a diff, split the problem in two
- * and return the recursively constructed diff.
- * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {number} deadline Time at which to bail if not yet complete.
- * @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
- * @private
- */
- diff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {
- // Cache the text lengths to prevent multiple calls.
- var text1_length = text1.length;
- var text2_length = text2.length;
- var max_d = Math.ceil((text1_length + text2_length) / 2);
- var v_offset = max_d;
- var v_length = 2 * max_d;
- var v1 = new Array(v_length);
- var v2 = new Array(v_length);
- // Setting all elements to -1 is faster in Chrome & Firefox than mixing
- // integers and undefined.
- for (var x = 0; x < v_length; x++) {
- v1[x] = -1;
- v2[x] = -1;
- }
- v1[v_offset + 1] = 0;
- v2[v_offset + 1] = 0;
- var delta = text1_length - text2_length;
- // If the total number of characters is odd, then the front path will collide
- // with the reverse path.
- var front = (delta % 2 != 0);
- // Offsets for start and end of k loop.
- // Prevents mapping of space beyond the grid.
- var k1start = 0;
- var k1end = 0;
- var k2start = 0;
- var k2end = 0;
- for (var d = 0; d < max_d; d++) {
- // Bail out if deadline is reached.
- if ((new Date()).getTime() > deadline) {
- break;
- }
-
- // Walk the front path one step.
- for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
- var k1_offset = v_offset + k1;
- var x1;
- if (k1 == -d || k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
- x1 = v1[k1_offset + 1];
- } else {
- x1 = v1[k1_offset - 1] + 1;
- }
- var y1 = x1 - k1;
- while (x1 < text1_length && y1 < text2_length &&
- text1.charAt(x1) == text2.charAt(y1)) {
- x1++;
- y1++;
- }
- v1[k1_offset] = x1;
- if (x1 > text1_length) {
- // Ran off the right of the graph.
- k1end += 2;
- } else if (y1 > text2_length) {
- // Ran off the bottom of the graph.
- k1start += 2;
- } else if (front) {
- var k2_offset = v_offset + delta - k1;
- if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
- // Mirror x2 onto top-left coordinate system.
- var x2 = text1_length - v2[k2_offset];
- if (x1 >= x2) {
- // Overlap detected.
- return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
- }
- }
- }
- }
-
- // Walk the reverse path one step.
- for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
- var k2_offset = v_offset + k2;
- var x2;
- if (k2 == -d || k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1]) {
- x2 = v2[k2_offset + 1];
- } else {
- x2 = v2[k2_offset - 1] + 1;
- }
- var y2 = x2 - k2;
- while (x2 < text1_length && y2 < text2_length &&
- text1.charAt(text1_length - x2 - 1) ==
- text2.charAt(text2_length - y2 - 1)) {
- x2++;
- y2++;
- }
- v2[k2_offset] = x2;
- if (x2 > text1_length) {
- // Ran off the left of the graph.
- k2end += 2;
- } else if (y2 > text2_length) {
- // Ran off the top of the graph.
- k2start += 2;
- } else if (!front) {
- var k1_offset = v_offset + delta - k2;
- if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
- var x1 = v1[k1_offset];
- var y1 = v_offset + x1 - k1_offset;
- // Mirror x2 onto top-left coordinate system.
- x2 = text1_length - x2;
- if (x1 >= x2) {
- // Overlap detected.
- return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
- }
- }
- }
- }
- }
- // Diff took too long and hit the deadline or
- // number of diffs equals number of characters, no commonality at all.
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- };
-
-
- /**
- * Given the location of the 'middle snake', split the diff in two parts
- * and recurse.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {number} x Index of split point in text1.
- * @param {number} y Index of split point in text2.
- * @param {number} deadline Time at which to bail if not yet complete.
- * @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
- * @private
- */
- diff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y,
- deadline) {
- var text1a = text1.substring(0, x);
- var text2a = text2.substring(0, y);
- var text1b = text1.substring(x);
- var text2b = text2.substring(y);
-
- // Compute both diffs serially.
- var diffs = this.diff_main(text1a, text2a, false, deadline);
- var diffsb = this.diff_main(text1b, text2b, false, deadline);
-
- return diffs.concat(diffsb);
- };
-
-
- /**
- * Split two texts into an array of strings. Reduce the texts to a string of
- * hashes where each Unicode character represents one line.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {!Array.<string|!Array.<string>>} Three element Array, containing the
- * encoded text1, the encoded text2 and the array of unique strings. The
- * zeroth element of the array of unique strings is intentionally blank.
- * @private
- */
- diff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {
- var lineArray = []; // e.g. lineArray[4] == 'Hello\n'
- var lineHash = {}; // e.g. lineHash['Hello\n'] == 4
-
- // '\x00' is a valid character, but various debuggers don't like it.
- // So we'll insert a junk entry to avoid generating a null character.
- lineArray[0] = '';
-
- /**
- * Split a text into an array of strings. Reduce the texts to a string of
- * hashes where each Unicode character represents one line.
- * Modifies linearray and linehash through being a closure.
- * @param {string} text String to encode.
- * @return {string} Encoded string.
- * @private
- */
- function diff_linesToCharsMunge_(text) {
- var chars = '';
- // Walk the text, pulling out a substring for each line.
- // text.split('\n') would would temporarily double our memory footprint.
- // Modifying text would create many large strings to garbage collect.
- var lineStart = 0;
- var lineEnd = -1;
- // Keeping our own length variable is faster than looking it up.
- var lineArrayLength = lineArray.length;
- while (lineEnd < text.length - 1) {
- lineEnd = text.indexOf('\n', lineStart);
- if (lineEnd == -1) {
- lineEnd = text.length - 1;
- }
- var line = text.substring(lineStart, lineEnd + 1);
- lineStart = lineEnd + 1;
-
- if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) :
- (lineHash[line] !== undefined)) {
- chars += String.fromCharCode(lineHash[line]);
- } else {
- chars += String.fromCharCode(lineArrayLength);
- lineHash[line] = lineArrayLength;
- lineArray[lineArrayLength++] = line;
- }
- }
- return chars;
- }
-
- var chars1 = diff_linesToCharsMunge_(text1);
- var chars2 = diff_linesToCharsMunge_(text2);
- return [chars1, chars2, lineArray];
- };
-
-
- /**
- * Rehydrate the text in a diff from a string of line hashes to real lines of
- * text.
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- * @param {!Array.<string>} lineArray Array of unique strings.
- * @private
- */
- diff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {
- for (var x = 0; x < diffs.length; x++) {
- var chars = diffs[x][1];
- var text = [];
- for (var y = 0; y < chars.length; y++) {
- text[y] = lineArray[chars.charCodeAt(y)];
- }
- diffs[x][1] = text.join('');
- }
- };
-
-
- /**
- * Determine the common prefix of two strings.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the start of each
- * string.
- */
- diff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {
- // Quick check for common null cases.
- if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
- return 0;
- }
- // Binary search.
- // Performance analysis: http://neil.fraser.name/news/2007/10/09/
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerstart = 0;
- while (pointermin < pointermid) {
- if (text1.substring(pointerstart, pointermid) ==
- text2.substring(pointerstart, pointermid)) {
- pointermin = pointermid;
- pointerstart = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- return pointermid;
- };
-
-
- /**
- * Determine the common suffix of two strings.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the end of each string.
- */
- diff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {
- // Quick check for common null cases.
- if (!text1 || !text2 ||
- text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
- return 0;
- }
- // Binary search.
- // Performance analysis: http://neil.fraser.name/news/2007/10/09/
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerend = 0;
- while (pointermin < pointermid) {
- if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==
- text2.substring(text2.length - pointermid, text2.length - pointerend)) {
- pointermin = pointermid;
- pointerend = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- return pointermid;
- };
-
-
- /**
- * Determine if the suffix of one string is the prefix of another.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the end of the first
- * string and the start of the second string.
- * @private
- */
- diff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {
- // Cache the text lengths to prevent multiple calls.
- var text1_length = text1.length;
- var text2_length = text2.length;
- // Eliminate the null case.
- if (text1_length == 0 || text2_length == 0) {
- return 0;
- }
- // Truncate the longer string.
- if (text1_length > text2_length) {
- text1 = text1.substring(text1_length - text2_length);
- } else if (text1_length < text2_length) {
- text2 = text2.substring(0, text1_length);
- }
- var text_length = Math.min(text1_length, text2_length);
- // Quick check for the worst case.
- if (text1 == text2) {
- return text_length;
- }
-
- // Start by looking for a single character match
- // and increase length until no match is found.
- // Performance analysis: http://neil.fraser.name/news/2010/11/04/
- var best = 0;
- var length = 1;
- while (true) {
- var pattern = text1.substring(text_length - length);
- var found = text2.indexOf(pattern);
- if (found == -1) {
- return best;
- }
- length += found;
- if (found == 0 || text1.substring(text_length - length) ==
- text2.substring(0, length)) {
- best = length;
- length++;
- }
- }
- };
-
-
- /**
- * Do the two texts share a substring which is at least half the length of the
- * longer text?
- * This speedup can produce non-minimal diffs.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {Array.<string>} Five element Array, containing the prefix of
- * text1, the suffix of text1, the prefix of text2, the suffix of
- * text2 and the common middle. Or null if there was no match.
- * @private
- */
- diff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {
- if (this.Diff_Timeout <= 0) {
- // Don't risk returning a non-optimal diff if we have unlimited time.
- return null;
- }
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
- return null; // Pointless.
- }
- var dmp = this; // 'this' becomes 'window' in a closure.
-
- /**
- * Does a substring of shorttext exist within longtext such that the substring
- * is at least half the length of longtext?
- * Closure, but does not reference any external variables.
- * @param {string} longtext Longer string.
- * @param {string} shorttext Shorter string.
- * @param {number} i Start index of quarter length substring within longtext.
- * @return {Array.<string>} Five element Array, containing the prefix of
- * longtext, the suffix of longtext, the prefix of shorttext, the suffix
- * of shorttext and the common middle. Or null if there was no match.
- * @private
- */
- function diff_halfMatchI_(longtext, shorttext, i) {
- // Start with a 1/4 length substring at position i as a seed.
- var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
- var j = -1;
- var best_common = '';
- var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
- while ((j = shorttext.indexOf(seed, j + 1)) != -1) {
- var prefixLength = dmp.diff_commonPrefix(longtext.substring(i),
- shorttext.substring(j));
- var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i),
- shorttext.substring(0, j));
- if (best_common.length < suffixLength + prefixLength) {
- best_common = shorttext.substring(j - suffixLength, j) +
- shorttext.substring(j, j + prefixLength);
- best_longtext_a = longtext.substring(0, i - suffixLength);
- best_longtext_b = longtext.substring(i + prefixLength);
- best_shorttext_a = shorttext.substring(0, j - suffixLength);
- best_shorttext_b = shorttext.substring(j + prefixLength);
- }
- }
- if (best_common.length * 2 >= longtext.length) {
- return [best_longtext_a, best_longtext_b,
- best_shorttext_a, best_shorttext_b, best_common];
- } else {
- return null;
- }
- }
-
- // First check if the second quarter is the seed for a half-match.
- var hm1 = diff_halfMatchI_(longtext, shorttext,
- Math.ceil(longtext.length / 4));
- // Check again based on the third quarter.
- var hm2 = diff_halfMatchI_(longtext, shorttext,
- Math.ceil(longtext.length / 2));
- var hm;
- if (!hm1 && !hm2) {
- return null;
- } else if (!hm2) {
- hm = hm1;
- } else if (!hm1) {
- hm = hm2;
- } else {
- // Both matched. Select the longest.
- hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
- }
-
- // A half-match was found, sort out the return data.
- var text1_a, text1_b, text2_a, text2_b;
- if (text1.length > text2.length) {
- text1_a = hm[0];
- text1_b = hm[1];
- text2_a = hm[2];
- text2_b = hm[3];
- } else {
- text2_a = hm[0];
- text2_b = hm[1];
- text1_a = hm[2];
- text1_b = hm[3];
- }
- var mid_common = hm[4];
- return [text1_a, text1_b, text2_a, text2_b, mid_common];
- };
-
-
- /**
- * Reduce the number of edits by eliminating semantically trivial equalities.
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- */
- diff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {
- var changes = false;
- var equalities = []; // Stack of indices where equalities are found.
- var equalitiesLength = 0; // Keeping our own length var is faster in JS.
- /** @type {?string} */
- var lastequality = null; // Always equal to equalities[equalitiesLength-1][1]
- var pointer = 0; // Index of current position.
- // Number of characters that changed prior to the equality.
- var length_insertions1 = 0;
- var length_deletions1 = 0;
- // Number of characters that changed after the equality.
- var length_insertions2 = 0;
- var length_deletions2 = 0;
- while (pointer < diffs.length) {
- if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.
- equalities[equalitiesLength++] = pointer;
- length_insertions1 = length_insertions2;
- length_deletions1 = length_deletions2;
- length_insertions2 = 0;
- length_deletions2 = 0;
- lastequality = /** @type {string} */(diffs[pointer][1]);
- } else { // An insertion or deletion.
- if (diffs[pointer][0] == DIFF_INSERT) {
- length_insertions2 += diffs[pointer][1].length;
- } else {
- length_deletions2 += diffs[pointer][1].length;
- }
- // Eliminate an equality that is smaller or equal to the edits on both
- // sides of it.
- if (lastequality !== null && (lastequality.length <=
- Math.max(length_insertions1, length_deletions1)) &&
- (lastequality.length <= Math.max(length_insertions2,
- length_deletions2))) {
- // Duplicate record.
- diffs.splice(equalities[equalitiesLength - 1], 0,
- [DIFF_DELETE, lastequality]);
- // Change second copy to insert.
- diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
- // Throw away the equality we just deleted.
- equalitiesLength--;
- // Throw away the previous equality (it needs to be reevaluated).
- equalitiesLength--;
- pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
- length_insertions1 = 0; // Reset the counters.
- length_deletions1 = 0;
- length_insertions2 = 0;
- length_deletions2 = 0;
- lastequality = null;
- changes = true;
- }
- }
- pointer++;
- }
-
- // Normalize the diff.
- if (changes) {
- this.diff_cleanupMerge(diffs);
- }
- this.diff_cleanupSemanticLossless(diffs);
-
- // Find any overlaps between deletions and insertions.
- // e.g: <del>abcxxx</del><ins>xxxdef</ins>
- // -> <del>abc</del>xxx<ins>def</ins>
- // Only extract an overlap if it is as big as the edit ahead or behind it.
- pointer = 1;
- while (pointer < diffs.length) {
- if (diffs[pointer - 1][0] == DIFF_DELETE &&
- diffs[pointer][0] == DIFF_INSERT) {
- var deletion = /** @type {string} */(diffs[pointer - 1][1]);
- var insertion = /** @type {string} */(diffs[pointer][1]);
- var overlap_length = this.diff_commonOverlap_(deletion, insertion);
- if (overlap_length >= deletion.length / 2 ||
- overlap_length >= insertion.length / 2) {
- // Overlap found. Insert an equality and trim the surrounding edits.
- diffs.splice(pointer, 0,
- [DIFF_EQUAL, insertion.substring(0, overlap_length)]);
- diffs[pointer - 1][1] =
- deletion.substring(0, deletion.length - overlap_length);
- diffs[pointer + 1][1] = insertion.substring(overlap_length);
- pointer++;
- }
- pointer++;
- }
- pointer++;
- }
- };
-
-
- /**
- * Look for single edits surrounded on both sides by equalities
- * which can be shifted sideways to align the edit to a word boundary.
- * e.g: The c<ins>at c</ins>ame. -> The <ins>cat </ins>came.
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- */
- diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
- // Define some regex patterns for matching boundaries.
- var punctuation = /[^a-zA-Z0-9]/;
- var whitespace = /\s/;
- var linebreak = /[\r\n]/;
- var blanklineEnd = /\n\r?\n$/;
- var blanklineStart = /^\r?\n\r?\n/;
-
- /**
- * Given two strings, compute a score representing whether the internal
- * boundary falls on logical boundaries.
- * Scores range from 5 (best) to 0 (worst).
- * Closure, makes reference to regex patterns defined above.
- * @param {string} one First string.
- * @param {string} two Second string.
- * @return {number} The score.
- * @private
- */
- function diff_cleanupSemanticScore_(one, two) {
- if (!one || !two) {
- // Edges are the best.
- return 5;
- }
-
- // Each port of this function behaves slightly differently due to
- // subtle differences in each language's definition of things like
- // 'whitespace'. Since this function's purpose is largely cosmetic,
- // the choice has been made to use each language's native features
- // rather than force total conformity.
- var score = 0;
- // One point for non-alphanumeric.
- if (one.charAt(one.length - 1).match(punctuation) ||
- two.charAt(0).match(punctuation)) {
- score++;
- // Two points for whitespace.
- if (one.charAt(one.length - 1).match(whitespace) ||
- two.charAt(0).match(whitespace)) {
- score++;
- // Three points for line breaks.
- if (one.charAt(one.length - 1).match(linebreak) ||
- two.charAt(0).match(linebreak)) {
- score++;
- // Four points for blank lines.
- if (one.match(blanklineEnd) || two.match(blanklineStart)) {
- score++;
- }
- }
- }
- }
- return score;
- }
-
- var pointer = 1;
- // Intentionally ignore the first and last element (don't need checking).
- while (pointer < diffs.length - 1) {
- if (diffs[pointer - 1][0] == DIFF_EQUAL &&
- diffs[pointer + 1][0] == DIFF_EQUAL) {
- // This is a single edit surrounded by equalities.
- var equality1 = /** @type {string} */(diffs[pointer - 1][1]);
- var edit = /** @type {string} */(diffs[pointer][1]);
- var equality2 = /** @type {string} */(diffs[pointer + 1][1]);
-
- // First, shift the edit as far left as possible.
- var commonOffset = this.diff_commonSuffix(equality1, edit);
- if (commonOffset) {
- var commonString = edit.substring(edit.length - commonOffset);
- equality1 = equality1.substring(0, equality1.length - commonOffset);
- edit = commonString + edit.substring(0, edit.length - commonOffset);
- equality2 = commonString + equality2;
- }
-
- // Second, step character by character right, looking for the best fit.
- var bestEquality1 = equality1;
- var bestEdit = edit;
- var bestEquality2 = equality2;
- var bestScore = diff_cleanupSemanticScore_(equality1, edit) +
- diff_cleanupSemanticScore_(edit, equality2);
- while (edit.charAt(0) === equality2.charAt(0)) {
- equality1 += edit.charAt(0);
- edit = edit.substring(1) + equality2.charAt(0);
- equality2 = equality2.substring(1);
- var score = diff_cleanupSemanticScore_(equality1, edit) +
- diff_cleanupSemanticScore_(edit, equality2);
- // The >= encourages trailing rather than leading whitespace on edits.
- if (score >= bestScore) {
- bestScore = score;
- bestEquality1 = equality1;
- bestEdit = edit;
- bestEquality2 = equality2;
- }
- }
-
- if (diffs[pointer - 1][1] != bestEquality1) {
- // We have an improvement, save it back to the diff.
- if (bestEquality1) {
- diffs[pointer - 1][1] = bestEquality1;
- } else {
- diffs.splice(pointer - 1, 1);
- pointer--;
- }
- diffs[pointer][1] = bestEdit;
- if (bestEquality2) {
- diffs[pointer + 1][1] = bestEquality2;
- } else {
- diffs.splice(pointer + 1, 1);
- pointer--;
- }
- }
- }
- pointer++;
- }
- };
-
-
- /**
- * Reduce the number of edits by eliminating operationally trivial equalities.
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- */
- diff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {
- var changes = false;
- var equalities = []; // Stack of indices where equalities are found.
- var equalitiesLength = 0; // Keeping our own length var is faster in JS.
- var lastequality = ''; // Always equal to equalities[equalitiesLength-1][1]
- var pointer = 0; // Index of current position.
- // Is there an insertion operation before the last equality.
- var pre_ins = false;
- // Is there a deletion operation before the last equality.
- var pre_del = false;
- // Is there an insertion operation after the last equality.
- var post_ins = false;
- // Is there a deletion operation after the last equality.
- var post_del = false;
- while (pointer < diffs.length) {
- if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.
- if (diffs[pointer][1].length < this.Diff_EditCost &&
- (post_ins || post_del)) {
- // Candidate found.
- equalities[equalitiesLength++] = pointer;
- pre_ins = post_ins;
- pre_del = post_del;
- lastequality = diffs[pointer][1];
- } else {
- // Not a candidate, and can never become one.
- equalitiesLength = 0;
- lastequality = '';
- }
- post_ins = post_del = false;
- } else { // An insertion or deletion.
- if (diffs[pointer][0] == DIFF_DELETE) {
- post_del = true;
- } else {
- post_ins = true;
- }
- /*
- * Five types to be split:
- * <ins>A</ins><del>B</del>XY<ins>C</ins><del>D</del>
- * <ins>A</ins>X<ins>C</ins><del>D</del>
- * <ins>A</ins><del>B</del>X<ins>C</ins>
- * <ins>A</del>X<ins>C</ins><del>D</del>
- * <ins>A</ins><del>B</del>X<del>C</del>
- */
- if (lastequality && ((pre_ins && pre_del && post_ins && post_del) ||
- ((lastequality.length < this.Diff_EditCost / 2) &&
- (pre_ins + pre_del + post_ins + post_del) == 3))) {
- // Duplicate record.
- diffs.splice(equalities[equalitiesLength - 1], 0,
- [DIFF_DELETE, lastequality]);
- // Change second copy to insert.
- diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
- equalitiesLength--; // Throw away the equality we just deleted;
- lastequality = '';
- if (pre_ins && pre_del) {
- // No changes made which could affect previous entry, keep going.
- post_ins = post_del = true;
- equalitiesLength = 0;
- } else {
- equalitiesLength--; // Throw away the previous equality.
- pointer = equalitiesLength > 0 ?
- equalities[equalitiesLength - 1] : -1;
- post_ins = post_del = false;
- }
- changes = true;
- }
- }
- pointer++;
- }
-
- if (changes) {
- this.diff_cleanupMerge(diffs);
- }
- };
-
-
- /**
- * Reorder and merge like edit sections. Merge equalities.
- * Any edit section can move as long as it doesn't cross an equality.
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- */
- diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
- diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
- var pointer = 0;
- var count_delete = 0;
- var count_insert = 0;
- var text_delete = '';
- var text_insert = '';
- var commonlength;
- while (pointer < diffs.length) {
- switch (diffs[pointer][0]) {
- case DIFF_INSERT:
- count_insert++;
- text_insert += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_DELETE:
- count_delete++;
- text_delete += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_EQUAL:
- // Upon reaching an equality, check for prior redundancies.
- if (count_delete + count_insert > 1) {
- if (count_delete !== 0 && count_insert !== 0) {
- // Factor out any common prefixies.
- commonlength = this.diff_commonPrefix(text_insert, text_delete);
- if (commonlength !== 0) {
- if ((pointer - count_delete - count_insert) > 0 &&
- diffs[pointer - count_delete - count_insert - 1][0] ==
- DIFF_EQUAL) {
- diffs[pointer - count_delete - count_insert - 1][1] +=
- text_insert.substring(0, commonlength);
- } else {
- diffs.splice(0, 0, [DIFF_EQUAL,
- text_insert.substring(0, commonlength)]);
- pointer++;
- }
- text_insert = text_insert.substring(commonlength);
- text_delete = text_delete.substring(commonlength);
- }
- // Factor out any common suffixies.
- commonlength = this.diff_commonSuffix(text_insert, text_delete);
- if (commonlength !== 0) {
- diffs[pointer][1] = text_insert.substring(text_insert.length -
- commonlength) + diffs[pointer][1];
- text_insert = text_insert.substring(0, text_insert.length -
- commonlength);
- text_delete = text_delete.substring(0, text_delete.length -
- commonlength);
- }
- }
- // Delete the offending records and add the merged ones.
- if (count_delete === 0) {
- diffs.splice(pointer - count_delete - count_insert,
- count_delete + count_insert, [DIFF_INSERT, text_insert]);
- } else if (count_insert === 0) {
- diffs.splice(pointer - count_delete - count_insert,
- count_delete + count_insert, [DIFF_DELETE, text_delete]);
- } else {
- diffs.splice(pointer - count_delete - count_insert,
- count_delete + count_insert, [DIFF_DELETE, text_delete],
- [DIFF_INSERT, text_insert]);
- }
- pointer = pointer - count_delete - count_insert +
- (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
- } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
- // Merge this equality with the previous one.
- diffs[pointer - 1][1] += diffs[pointer][1];
- diffs.splice(pointer, 1);
- } else {
- pointer++;
- }
- count_insert = 0;
- count_delete = 0;
- text_delete = '';
- text_insert = '';
- break;
- }
- }
- if (diffs[diffs.length - 1][1] === '') {
- diffs.pop(); // Remove the dummy entry at the end.
- }
-
- // Second pass: look for single edits surrounded on both sides by equalities
- // which can be shifted sideways to eliminate an equality.
- // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
- var changes = false;
- pointer = 1;
- // Intentionally ignore the first and last element (don't need checking).
- while (pointer < diffs.length - 1) {
- if (diffs[pointer - 1][0] == DIFF_EQUAL &&
- diffs[pointer + 1][0] == DIFF_EQUAL) {
- // This is a single edit surrounded by equalities.
- if (diffs[pointer][1].substring(diffs[pointer][1].length -
- diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
- // Shift the edit over the previous equality.
- diffs[pointer][1] = diffs[pointer - 1][1] +
- diffs[pointer][1].substring(0, diffs[pointer][1].length -
- diffs[pointer - 1][1].length);
- diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
- diffs.splice(pointer - 1, 1);
- changes = true;
- } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==
- diffs[pointer + 1][1]) {
- // Shift the edit over the next equality.
- diffs[pointer - 1][1] += diffs[pointer + 1][1];
- diffs[pointer][1] =
- diffs[pointer][1].substring(diffs[pointer + 1][1].length) +
- diffs[pointer + 1][1];
- diffs.splice(pointer + 1, 1);
- changes = true;
- }
- }
- pointer++;
- }
- // If shifts were made, the diff needs reordering and another shift sweep.
- if (changes) {
- this.diff_cleanupMerge(diffs);
- }
- };
-
-
- /**
- * loc is a location in text1, compute and return the equivalent location in
- * text2.
- * e.g. 'The cat' vs 'The big cat', 1->1, 5->8
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- * @param {number} loc Location within text1.
- * @return {number} Location within text2.
- */
- diff_match_patch.prototype.diff_xIndex = function(diffs, loc) {
- var chars1 = 0;
- var chars2 = 0;
- var last_chars1 = 0;
- var last_chars2 = 0;
- var x;
- for (x = 0; x < diffs.length; x++) {
- if (diffs[x][0] !== DIFF_INSERT) { // Equality or deletion.
- chars1 += diffs[x][1].length;
- }
- if (diffs[x][0] !== DIFF_DELETE) { // Equality or insertion.
- chars2 += diffs[x][1].length;
- }
- if (chars1 > loc) { // Overshot the location.
- break;
- }
- last_chars1 = chars1;
- last_chars2 = chars2;
- }
- // Was the location was deleted?
- if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {
- return last_chars2;
- }
- // Add the remaining character length.
- return last_chars2 + (loc - last_chars1);
- };
-
-
- /**
- * Convert a diff array into a pretty HTML report.
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- * @return {string} HTML representation.
- */
- diff_match_patch.prototype.diff_prettyHtml = function(diffs) {
- var html = [];
- var i = 0;
- var pattern_amp = /&/g;
- var pattern_lt = /</g;
- var pattern_gt = />/g;
- var pattern_para = /\n/g;
- for (var x = 0; x < diffs.length; x++) {
- var op = diffs[x][0]; // Operation (insert, delete, equal)
- var data = diffs[x][1]; // Text of change.
- var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')
- .replace(pattern_gt, '>').replace(pattern_para, '¶<br>');
- switch (op) {
- case DIFF_INSERT:
- html[x] = '<ins style="background:#e6ffe6;">' + text + '</ins>';
- break;
- case DIFF_DELETE:
- html[x] = '<del style="background:#ffe6e6;">' + text + '</del>';
- break;
- case DIFF_EQUAL:
- html[x] = '<span>' + text + '</span>';
- break;
- }
- if (op !== DIFF_DELETE) {
- i += data.length;
- }
- }
- return html.join('');
- };
-
-
- /**
- * Compute and return the source text (all equalities and deletions).
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- * @return {string} Source text.
- */
- diff_match_patch.prototype.diff_text1 = function(diffs) {
- var text = [];
- for (var x = 0; x < diffs.length; x++) {
- if (diffs[x][0] !== DIFF_INSERT) {
- text[x] = diffs[x][1];
- }
- }
- return text.join('');
- };
-
-
- /**
- * Compute and return the destination text (all equalities and insertions).
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- * @return {string} Destination text.
- */
- diff_match_patch.prototype.diff_text2 = function(diffs) {
- var text = [];
- for (var x = 0; x < diffs.length; x++) {
- if (diffs[x][0] !== DIFF_DELETE) {
- text[x] = diffs[x][1];
- }
- }
- return text.join('');
- };
-
-
- /**
- * Compute the Levenshtein distance; the number of inserted, deleted or
- * substituted characters.
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- * @return {number} Number of changes.
- */
- diff_match_patch.prototype.diff_levenshtein = function(diffs) {
- var levenshtein = 0;
- var insertions = 0;
- var deletions = 0;
- for (var x = 0; x < diffs.length; x++) {
- var op = diffs[x][0];
- var data = diffs[x][1];
- switch (op) {
- case DIFF_INSERT:
- insertions += data.length;
- break;
- case DIFF_DELETE:
- deletions += data.length;
- break;
- case DIFF_EQUAL:
- // A deletion and an insertion is one substitution.
- levenshtein += Math.max(insertions, deletions);
- insertions = 0;
- deletions = 0;
- break;
- }
- }
- levenshtein += Math.max(insertions, deletions);
- return levenshtein;
- };
-
-
- /**
- * Crush the diff into an encoded string which describes the operations
- * required to transform text1 into text2.
- * E.g. =3\t-2\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.
- * Operations are tab-separated. Inserted text is escaped using %xx notation.
- * @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
- * @return {string} Delta text.
- */
- diff_match_patch.prototype.diff_toDelta = function(diffs) {
- var text = [];
- for (var x = 0; x < diffs.length; x++) {
- switch (diffs[x][0]) {
- case DIFF_INSERT:
- text[x] = '+' + encodeURI(diffs[x][1]);
- break;
- case DIFF_DELETE:
- text[x] = '-' + diffs[x][1].length;
- break;
- case DIFF_EQUAL:
- text[x] = '=' + diffs[x][1].length;
- break;
- }
- }
- return text.join('\t').replace(/%20/g, ' ');
- };
-
-
- /**
- * Given the original text1, and an encoded string which describes the
- * operations required to transform text1 into text2, compute the full diff.
- * @param {string} text1 Source string for the diff.
- * @param {string} delta Delta text.
- * @return {!Array.<!diff_match_patch.Diff>} Array of diff tuples.
- * @throws {!Error} If invalid input.
- */
- diff_match_patch.prototype.diff_fromDelta = function(text1, delta) {
- var diffs = [];
- var diffsLength = 0; // Keeping our own length var is faster in JS.
- var pointer = 0; // Cursor in text1
- var tokens = delta.split(/\t/g);
- for (var x = 0; x < tokens.length; x++) {
- // Each token begins with a one character parameter which specifies the
- // operation of this token (delete, insert, equality).
- var param = tokens[x].substring(1);
- switch (tokens[x].charAt(0)) {
- case '+':
- try {
- diffs[diffsLength++] = [DIFF_INSERT, decodeURI(param)];
- } catch (ex) {
- // Malformed URI sequence.
- throw new Error('Illegal escape in diff_fromDelta: ' + param);
- }
- break;
- case '-':
- // Fall through.
- case '=':
- var n = parseInt(param, 10);
- if (isNaN(n) || n < 0) {
- throw new Error('Invalid number in diff_fromDelta: ' + param);
- }
- var text = text1.substring(pointer, pointer += n);
- if (tokens[x].charAt(0) == '=') {
- diffs[diffsLength++] = [DIFF_EQUAL, text];
- } else {
- diffs[diffsLength++] = [DIFF_DELETE, text];
- }
- break;
- default:
- // Blank tokens are ok (from a trailing \t).
- // Anything else is an error.
- if (tokens[x]) {
- throw new Error('Invalid diff operation in diff_fromDelta: ' +
- tokens[x]);
- }
- }
- }
- if (pointer != text1.length) {
- throw new Error('Delta length (' + pointer +
- ') does not equal source text length (' + text1.length + ').');
- }
- return diffs;
- };
-
-
- // MATCH FUNCTIONS
-
-
- /**
- * Locate the best instance of 'pattern' in 'text' near 'loc'.
- * @param {string} text The text to search.
- * @param {string} pattern The pattern to search for.
- * @param {number} loc The location to search around.
- * @return {number} Best match index or -1.
- */
- diff_match_patch.prototype.match_main = function(text, pattern, loc) {
- // Check for null inputs.
- if (text == null || pattern == null || loc == null) {
- throw new Error('Null input. (match_main)');
- }
-
- loc = Math.max(0, Math.min(loc, text.length));
- if (text == pattern) {
- // Shortcut (potentially not guaranteed by the algorithm)
- return 0;
- } else if (!text.length) {
- // Nothing to match.
- return -1;
- } else if (text.substring(loc, loc + pattern.length) == pattern) {
- // Perfect match at the perfect spot! (Includes case of null pattern)
- return loc;
- } else {
- // Do a fuzzy compare.
- return this.match_bitap_(text, pattern, loc);
- }
- };
-
-
- /**
- * Locate the best instance of 'pattern' in 'text' near 'loc' using the
- * Bitap algorithm.
- * @param {string} text The text to search.
- * @param {string} pattern The pattern to search for.
- * @param {number} loc The location to search around.
- * @return {number} Best match index or -1.
- * @private
- */
- diff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {
- if (pattern.length > this.Match_MaxBits) {
- throw new Error('Pattern too long for this browser.');
- }
-
- // Initialise the alphabet.
- var s = this.match_alphabet_(pattern);
-
- var dmp = this; // 'this' becomes 'window' in a closure.
-
- /**
- * Compute and return the score for a match with e errors and x location.
- * Accesses loc and pattern through being a closure.
- * @param {number} e Number of errors in match.
- * @param {number} x Location of match.
- * @return {number} Overall score for match (0.0 = good, 1.0 = bad).
- * @private
- */
- function match_bitapScore_(e, x) {
- var accuracy = e / pattern.length;
- var proximity = Math.abs(loc - x);
- if (!dmp.Match_Distance) {
- // Dodge divide by zero error.
- return proximity ? 1.0 : accuracy;
- }
- return accuracy + (proximity / dmp.Match_Distance);
- }
-
- // Highest score beyond which we give up.
- var score_threshold = this.Match_Threshold;
- // Is there a nearby exact match? (speedup)
- var best_loc = text.indexOf(pattern, loc);
- if (best_loc != -1) {
- score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);
- // What about in the other direction? (speedup)
- best_loc = text.lastIndexOf(pattern, loc + pattern.length);
- if (best_loc != -1) {
- score_threshold =
- Math.min(match_bitapScore_(0, best_loc), score_threshold);
- }
- }
-
- // Initialise the bit arrays.
- var matchmask = 1 << (pattern.length - 1);
- best_loc = -1;
-
- var bin_min, bin_mid;
- var bin_max = pattern.length + text.length;
- var last_rd;
- for (var d = 0; d < pattern.length; d++) {
- // Scan for the best match; each iteration allows for one more error.
- // Run a binary search to determine how far from 'loc' we can stray at this
- // error level.
- bin_min = 0;
- bin_mid = bin_max;
- while (bin_min < bin_mid) {
- if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {
- bin_min = bin_mid;
- } else {
- bin_max = bin_mid;
- }
- bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);
- }
- // Use the result from this iteration as the maximum for the next.
- bin_max = bin_mid;
- var start = Math.max(1, loc - bin_mid + 1);
- var finish = Math.min(loc + bin_mid, text.length) + pattern.length;
-
- var rd = Array(finish + 2);
- rd[finish + 1] = (1 << d) - 1;
- for (var j = finish; j >= start; j--) {
- // The alphabet (s) is a sparse hash, so the following line generates
- // warnings.
- var charMatch = s[text.charAt(j - 1)];
- if (d === 0) { // First pass: exact match.
- rd[j] = ((rd[j + 1] << 1) | 1) & charMatch;
- } else { // Subsequent passes: fuzzy match.
- rd[j] = ((rd[j + 1] << 1) | 1) & charMatch |
- (((last_rd[j + 1] | last_rd[j]) << 1) | 1) |
- last_rd[j + 1];
- }
- if (rd[j] & matchmask) {
- var score = match_bitapScore_(d, j - 1);
- // This match will almost certainly be better than any existing match.
- // But check anyway.
- if (score <= score_threshold) {
- // Told you so.
- score_threshold = score;
- best_loc = j - 1;
- if (best_loc > loc) {
- // When passing loc, don't exceed our current distance from loc.
- start = Math.max(1, 2 * loc - best_loc);
- } else {
- // Already passed loc, downhill from here on in.
- break;
- }
- }
- }
- }
- // No hope for a (better) match at greater error levels.
- if (match_bitapScore_(d + 1, loc) > score_threshold) {
- break;
- }
- last_rd = rd;
- }
- return best_loc;
- };
-
-
- /**
- * Initialise the alphabet for the Bitap algorithm.
- * @param {string} pattern The text to encode.
- * @return {!Object} Hash of character locations.
- * @private
- */
- diff_match_patch.prototype.match_alphabet_ = function(pattern) {
- var s = {};
- for (var i = 0; i < pattern.length; i++) {
- s[pattern.charAt(i)] = 0;
- }
- for (var i = 0; i < pattern.length; i++) {
- s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1);
- }
- return s;
- };
-
-
- // PATCH FUNCTIONS
-
-
- /**
- * Increase the context until it is unique,
- * but don't let the pattern expand beyond Match_MaxBits.
- * @param {!diff_match_patch.patch_obj} patch The patch to grow.
- * @param {string} text Source text.
- * @private
- */
- diff_match_patch.prototype.patch_addContext_ = function(patch, text) {
- if (text.length == 0) {
- return;
- }
- var pattern = text.substring(patch.start2, patch.start2 + patch.length1);
- var padding = 0;
-
- // Look for the first and last matches of pattern in text. If two different
- // matches are found, increase the pattern length.
- while (text.indexOf(pattern) != text.lastIndexOf(pattern) &&
- pattern.length < this.Match_MaxBits - this.Patch_Margin -
- this.Patch_Margin) {
- padding += this.Patch_Margin;
- pattern = text.substring(patch.start2 - padding,
- patch.start2 + patch.length1 + padding);
- }
- // Add one chunk for good luck.
- padding += this.Patch_Margin;
-
- // Add the prefix.
- var prefix = text.substring(patch.start2 - padding, patch.start2);
- if (prefix) {
- patch.diffs.unshift([DIFF_EQUAL, prefix]);
- }
- // Add the suffix.
- var suffix = text.substring(patch.start2 + patch.length1,
- patch.start2 + patch.length1 + padding);
- if (suffix) {
- patch.diffs.push([DIFF_EQUAL, suffix]);
- }
-
- // Roll back the start points.
- patch.start1 -= prefix.length;
- patch.start2 -= prefix.length;
- // Extend the lengths.
- patch.length1 += prefix.length + suffix.length;
- patch.length2 += prefix.length + suffix.length;
- };
-
-
- /**
- * Compute a list of patches to turn text1 into text2.
- * Use diffs if provided, otherwise compute it ourselves.
- * There are four ways to call this function, depending on what data is
- * available to the caller:
- * Method 1:
- * a = text1, b = text2
- * Method 2:
- * a = diffs
- * Method 3 (optimal):
- * a = text1, b = diffs
- * Method 4 (deprecated, use method 3):
- * a = text1, b = text2, c = diffs
- *
- * @param {string|!Array.<!diff_match_patch.Diff>} a text1 (methods 1,3,4) or
- * Array of diff tuples for text1 to text2 (method 2).
- * @param {string|!Array.<!diff_match_patch.Diff>} opt_b text2 (methods 1,4) or
- * Array of diff tuples for text1 to text2 (method 3) or undefined (method 2).
- * @param {string|!Array.<!diff_match_patch.Diff>} opt_c Array of diff tuples
- * for text1 to text2 (method 4) or undefined (methods 1,2,3).
- * @return {!Array.<!diff_match_patch.patch_obj>} Array of patch objects.
- */
- diff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {
- var text1, diffs;
- if (typeof a == 'string' && typeof opt_b == 'string' &&
- typeof opt_c == 'undefined') {
- // Method 1: text1, text2
- // Compute diffs from text1 and text2.
- text1 = /** @type {string} */(a);
- diffs = this.diff_main(text1, /** @type {string} */(opt_b), true);
- if (diffs.length > 2) {
- this.diff_cleanupSemantic(diffs);
- this.diff_cleanupEfficiency(diffs);
- }
- } else if (a && typeof a == 'object' && typeof opt_b == 'undefined' &&
- typeof opt_c == 'undefined') {
- // Method 2: diffs
- // Compute text1 from diffs.
- diffs = /** @type {!Array.<!diff_match_patch.Diff>} */(a);
- text1 = this.diff_text1(diffs);
- } else if (typeof a == 'string' && opt_b && typeof opt_b == 'object' &&
- typeof opt_c == 'undefined') {
- // Method 3: text1, diffs
- text1 = /** @type {string} */(a);
- diffs = /** @type {!Array.<!diff_match_patch.Diff>} */(opt_b);
- } else if (typeof a == 'string' && typeof opt_b == 'string' &&
- opt_c && typeof opt_c == 'object') {
- // Method 4: text1, text2, diffs
- // text2 is not used.
- text1 = /** @type {string} */(a);
- diffs = /** @type {!Array.<!diff_match_patch.Diff>} */(opt_c);
- } else {
- throw new Error('Unknown call format to patch_make.');
- }
-
- if (diffs.length === 0) {
- return []; // Get rid of the null case.
- }
- var patches = [];
- var patch = new diff_match_patch.patch_obj();
- var patchDiffLength = 0; // Keeping our own length var is faster in JS.
- var char_count1 = 0; // Number of characters into the text1 string.
- var char_count2 = 0; // Number of characters into the text2 string.
- // Start with text1 (prepatch_text) and apply the diffs until we arrive at
- // text2 (postpatch_text). We recreate the patches one by one to determine
- // context info.
- var prepatch_text = text1;
- var postpatch_text = text1;
- for (var x = 0; x < diffs.length; x++) {
- var diff_type = diffs[x][0];
- var diff_text = diffs[x][1];
-
- if (!patchDiffLength && diff_type !== DIFF_EQUAL) {
- // A new patch starts here.
- patch.start1 = char_count1;
- patch.start2 = char_count2;
- }
-
- switch (diff_type) {
- case DIFF_INSERT:
- patch.diffs[patchDiffLength++] = diffs[x];
- patch.length2 += diff_text.length;
- postpatch_text = postpatch_text.substring(0, char_count2) + diff_text +
- postpatch_text.substring(char_count2);
- break;
- case DIFF_DELETE:
- patch.length1 += diff_text.length;
- patch.diffs[patchDiffLength++] = diffs[x];
- postpatch_text = postpatch_text.substring(0, char_count2) +
- postpatch_text.substring(char_count2 +
- diff_text.length);
- break;
- case DIFF_EQUAL:
- if (diff_text.length <= 2 * this.Patch_Margin &&
- patchDiffLength && diffs.length != x + 1) {
- // Small equality inside a patch.
- patch.diffs[patchDiffLength++] = diffs[x];
- patch.length1 += diff_text.length;
- patch.length2 += diff_text.length;
- } else if (diff_text.length >= 2 * this.Patch_Margin) {
- // Time for a new patch.
- if (patchDiffLength) {
- this.patch_addContext_(patch, prepatch_text);
- patches.push(patch);
- patch = new diff_match_patch.patch_obj();
- patchDiffLength = 0;
- // Unlike Unidiff, our patch lists have a rolling context.
- // http://code.google.com/p/google-diff-match-patch/wiki/Unidiff
- // Update prepatch text & pos to reflect the application of the
- // just completed patch.
- prepatch_text = postpatch_text;
- char_count1 = char_count2;
- }
- }
- break;
- }
-
- // Update the current character count.
- if (diff_type !== DIFF_INSERT) {
- char_count1 += diff_text.length;
- }
- if (diff_type !== DIFF_DELETE) {
- char_count2 += diff_text.length;
- }
- }
- // Pick up the leftover patch if not empty.
- if (patchDiffLength) {
- this.patch_addContext_(patch, prepatch_text);
- patches.push(patch);
- }
-
- return patches;
- };
-
-
- /**
- * Given an array of patches, return another array that is identical.
- * @param {!Array.<!diff_match_patch.patch_obj>} patches Array of patch objects.
- * @return {!Array.<!diff_match_patch.patch_obj>} Array of patch objects.
- */
- diff_match_patch.prototype.patch_deepCopy = function(patches) {
- // Making deep copies is hard in JavaScript.
- var patchesCopy = [];
- for (var x = 0; x < patches.length; x++) {
- var patch = patches[x];
- var patchCopy = new diff_match_patch.patch_obj();
- patchCopy.diffs = [];
- for (var y = 0; y < patch.diffs.length; y++) {
- patchCopy.diffs[y] = patch.diffs[y].slice();
- }
- patchCopy.start1 = patch.start1;
- patchCopy.start2 = patch.start2;
- patchCopy.length1 = patch.length1;
- patchCopy.length2 = patch.length2;
- patchesCopy[x] = patchCopy;
- }
- return patchesCopy;
- };
-
-
- /**
- * Merge a set of patches onto the text. Return a patched text, as well
- * as a list of true/false values indicating which patches were applied.
- * @param {!Array.<!diff_match_patch.patch_obj>} patches Array of patch objects.
- * @param {string} text Old text.
- * @return {!Array.<string|!Array.<boolean>>} Two element Array, containing the
- * new text and an array of boolean values.
- */
- diff_match_patch.prototype.patch_apply = function(patches, text) {
- if (patches.length == 0) {
- return [text, []];
- }
-
- // Deep copy the patches so that no changes are made to originals.
- patches = this.patch_deepCopy(patches);
-
- var nullPadding = this.patch_addPadding(patches);
- text = nullPadding + text + nullPadding;
-
- this.patch_splitMax(patches);
- // delta keeps track of the offset between the expected and actual location
- // of the previous patch. If there are patches expected at positions 10 and
- // 20, but the first patch was found at 12, delta is 2 and the second patch
- // has an effective expected position of 22.
- var delta = 0;
- var results = [];
- for (var x = 0; x < patches.length; x++) {
- var expected_loc = patches[x].start2 + delta;
- var text1 = this.diff_text1(patches[x].diffs);
- var start_loc;
- var end_loc = -1;
- if (text1.length > this.Match_MaxBits) {
- // patch_splitMax will only provide an oversized pattern in the case of
- // a monster delete.
- start_loc = this.match_main(text, text1.substring(0, this.Match_MaxBits),
- expected_loc);
- if (start_loc != -1) {
- end_loc = this.match_main(text,
- text1.substring(text1.length - this.Match_MaxBits),
- expected_loc + text1.length - this.Match_MaxBits);
- if (end_loc == -1 || start_loc >= end_loc) {
- // Can't find valid trailing context. Drop this patch.
- start_loc = -1;
- }
- }
- } else {
- start_loc = this.match_main(text, text1, expected_loc);
- }
- if (start_loc == -1) {
- // No match found. :(
- results[x] = false;
- // Subtract the delta for this failed patch from subsequent patches.
- delta -= patches[x].length2 - patches[x].length1;
- } else {
- // Found a match. :)
- results[x] = true;
- delta = start_loc - expected_loc;
- var text2;
- if (end_loc == -1) {
- text2 = text.substring(start_loc, start_loc + text1.length);
- } else {
- text2 = text.substring(start_loc, end_loc + this.Match_MaxBits);
- }
- if (text1 == text2) {
- // Perfect match, just shove the replacement text in.
- text = text.substring(0, start_loc) +
- this.diff_text2(patches[x].diffs) +
- text.substring(start_loc + text1.length);
- } else {
- // Imperfect match. Run a diff to get a framework of equivalent
- // indices.
- var diffs = this.diff_main(text1, text2, false);
- if (text1.length > this.Match_MaxBits &&
- this.diff_levenshtein(diffs) / text1.length >
- this.Patch_DeleteThreshold) {
- // The end points match, but the content is unacceptably bad.
- results[x] = false;
- } else {
- this.diff_cleanupSemanticLossless(diffs);
- var index1 = 0;
- var index2;
- for (var y = 0; y < patches[x].diffs.length; y++) {
- var mod = patches[x].diffs[y];
- if (mod[0] !== DIFF_EQUAL) {
- index2 = this.diff_xIndex(diffs, index1);
- }
- if (mod[0] === DIFF_INSERT) { // Insertion
- text = text.substring(0, start_loc + index2) + mod[1] +
- text.substring(start_loc + index2);
- } else if (mod[0] === DIFF_DELETE) { // Deletion
- text = text.substring(0, start_loc + index2) +
- text.substring(start_loc + this.diff_xIndex(diffs,
- index1 + mod[1].length));
- }
- if (mod[0] !== DIFF_DELETE) {
- index1 += mod[1].length;
- }
- }
- }
- }
- }
- }
- // Strip the padding off.
- text = text.substring(nullPadding.length, text.length - nullPadding.length);
- return [text, results];
- };
-
-
- /**
- * Add some padding on text start and end so that edges can match something.
- * Intended to be called only from within patch_apply.
- * @param {!Array.<!diff_match_patch.patch_obj>} patches Array of patch objects.
- * @return {string} The padding string added to each side.
- */
- diff_match_patch.prototype.patch_addPadding = function(patches) {
- var paddingLength = this.Patch_Margin;
- var nullPadding = '';
- for (var x = 1; x <= paddingLength; x++) {
- nullPadding += String.fromCharCode(x);
- }
-
- // Bump all the patches forward.
- for (var x = 0; x < patches.length; x++) {
- patches[x].start1 += paddingLength;
- patches[x].start2 += paddingLength;
- }
-
- // Add some padding on start of first diff.
- var patch = patches[0];
- var diffs = patch.diffs;
- if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) {
- // Add nullPadding equality.
- diffs.unshift([DIFF_EQUAL, nullPadding]);
- patch.start1 -= paddingLength; // Should be 0.
- patch.start2 -= paddingLength; // Should be 0.
- patch.length1 += paddingLength;
- patch.length2 += paddingLength;
- } else if (paddingLength > diffs[0][1].length) {
- // Grow first equality.
- var extraLength = paddingLength - diffs[0][1].length;
- diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];
- patch.start1 -= extraLength;
- patch.start2 -= extraLength;
- patch.length1 += extraLength;
- patch.length2 += extraLength;
- }
-
- // Add some padding on end of last diff.
- patch = patches[patches.length - 1];
- diffs = patch.diffs;
- if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) {
- // Add nullPadding equality.
- diffs.push([DIFF_EQUAL, nullPadding]);
- patch.length1 += paddingLength;
- patch.length2 += paddingLength;
- } else if (paddingLength > diffs[diffs.length - 1][1].length) {
- // Grow last equality.
- var extraLength = paddingLength - diffs[diffs.length - 1][1].length;
- diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);
- patch.length1 += extraLength;
- patch.length2 += extraLength;
- }
-
- return nullPadding;
- };
-
-
- /**
- * Look through the patches and break up any which are longer than the maximum
- * limit of the match algorithm.
- * Intended to be called only from within patch_apply.
- * @param {!Array.<!diff_match_patch.patch_obj>} patches Array of patch objects.
- */
- diff_match_patch.prototype.patch_splitMax = function(patches) {
- var patch_size = this.Match_MaxBits;
- for (var x = 0; x < patches.length; x++) {
- if (patches[x].length1 > patch_size) {
- var bigpatch = patches[x];
- // Remove the big old patch.
- patches.splice(x--, 1);
- var start1 = bigpatch.start1;
- var start2 = bigpatch.start2;
- var precontext = '';
- while (bigpatch.diffs.length !== 0) {
- // Create one of several smaller patches.
- var patch = new diff_match_patch.patch_obj();
- var empty = true;
- patch.start1 = start1 - precontext.length;
- patch.start2 = start2 - precontext.length;
- if (precontext !== '') {
- patch.length1 = patch.length2 = precontext.length;
- patch.diffs.push([DIFF_EQUAL, precontext]);
- }
- while (bigpatch.diffs.length !== 0 &&
- patch.length1 < patch_size - this.Patch_Margin) {
- var diff_type = bigpatch.diffs[0][0];
- var diff_text = bigpatch.diffs[0][1];
- if (diff_type === DIFF_INSERT) {
- // Insertions are harmless.
- patch.length2 += diff_text.length;
- start2 += diff_text.length;
- patch.diffs.push(bigpatch.diffs.shift());
- empty = false;
- } else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 &&
- patch.diffs[0][0] == DIFF_EQUAL &&
- diff_text.length > 2 * patch_size) {
- // This is a large deletion. Let it pass in one chunk.
- patch.length1 += diff_text.length;
- start1 += diff_text.length;
- empty = false;
- patch.diffs.push([diff_type, diff_text]);
- bigpatch.diffs.shift();
- } else {
- // Deletion or equality. Only take as much as we can stomach.
- diff_text = diff_text.substring(0,
- patch_size - patch.length1 - this.Patch_Margin);
- patch.length1 += diff_text.length;
- start1 += diff_text.length;
- if (diff_type === DIFF_EQUAL) {
- patch.length2 += diff_text.length;
- start2 += diff_text.length;
- } else {
- empty = false;
- }
- patch.diffs.push([diff_type, diff_text]);
- if (diff_text == bigpatch.diffs[0][1]) {
- bigpatch.diffs.shift();
- } else {
- bigpatch.diffs[0][1] =
- bigpatch.diffs[0][1].substring(diff_text.length);
- }
- }
- }
- // Compute the head context for the next patch.
- precontext = this.diff_text2(patch.diffs);
- precontext =
- precontext.substring(precontext.length - this.Patch_Margin);
- // Append the end context for this patch.
- var postcontext = this.diff_text1(bigpatch.diffs)
- .substring(0, this.Patch_Margin);
- if (postcontext !== '') {
- patch.length1 += postcontext.length;
- patch.length2 += postcontext.length;
- if (patch.diffs.length !== 0 &&
- patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {
- patch.diffs[patch.diffs.length - 1][1] += postcontext;
- } else {
- patch.diffs.push([DIFF_EQUAL, postcontext]);
- }
- }
- if (!empty) {
- patches.splice(++x, 0, patch);
- }
- }
- }
- }
- };
-
-
- /**
- * Take a list of patches and return a textual representation.
- * @param {!Array.<!diff_match_patch.patch_obj>} patches Array of patch objects.
- * @return {string} Text representation of patches.
- */
- diff_match_patch.prototype.patch_toText = function(patches) {
- var text = [];
- for (var x = 0; x < patches.length; x++) {
- text[x] = patches[x];
- }
- return text.join('');
- };
-
-
- /**
- * Parse a textual representation of patches and return a list of patch objects.
- * @param {string} textline Text representation of patches.
- * @return {!Array.<!diff_match_patch.patch_obj>} Array of patch objects.
- * @throws {!Error} If invalid input.
- */
- diff_match_patch.prototype.patch_fromText = function(textline) {
- var patches = [];
- if (!textline) {
- return patches;
- }
- var text = textline.split('\n');
- var textPointer = 0;
- var patchHeader = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;
- while (textPointer < text.length) {
- var m = text[textPointer].match(patchHeader);
- if (!m) {
- throw new Error('Invalid patch string: ' + text[textPointer]);
- }
- var patch = new diff_match_patch.patch_obj();
- patches.push(patch);
- patch.start1 = parseInt(m[1], 10);
- if (m[2] === '') {
- patch.start1--;
- patch.length1 = 1;
- } else if (m[2] == '0') {
- patch.length1 = 0;
- } else {
- patch.start1--;
- patch.length1 = parseInt(m[2], 10);
- }
-
- patch.start2 = parseInt(m[3], 10);
- if (m[4] === '') {
- patch.start2--;
- patch.length2 = 1;
- } else if (m[4] == '0') {
- patch.length2 = 0;
- } else {
- patch.start2--;
- patch.length2 = parseInt(m[4], 10);
- }
- textPointer++;
-
- while (textPointer < text.length) {
- var sign = text[textPointer].charAt(0);
- try {
- var line = decodeURI(text[textPointer].substring(1));
- } catch (ex) {
- // Malformed URI sequence.
- throw new Error('Illegal escape in patch_fromText: ' + line);
- }
- if (sign == '-') {
- // Deletion.
- patch.diffs.push([DIFF_DELETE, line]);
- } else if (sign == '+') {
- // Insertion.
- patch.diffs.push([DIFF_INSERT, line]);
- } else if (sign == ' ') {
- // Minor equality.
- patch.diffs.push([DIFF_EQUAL, line]);
- } else if (sign == '@') {
- // Start of next patch.
- break;
- } else if (sign === '') {
- // Blank line? Whatever.
- } else {
- // WTF?
- throw new Error('Invalid patch mode "' + sign + '" in: ' + line);
- }
- textPointer++;
- }
- }
- return patches;
- };
-
-
- /**
- * Class representing one patch operation.
- * @constructor
- */
- diff_match_patch.patch_obj = function() {
- /** @type {!Array.<!diff_match_patch.Diff>} */
- this.diffs = [];
- /** @type {?number} */
- this.start1 = null;
- /** @type {?number} */
- this.start2 = null;
- /** @type {number} */
- this.length1 = 0;
- /** @type {number} */
- this.length2 = 0;
- };
-
-
- /**
- * Emmulate GNU diff's format.
- * Header: @@ -382,8 +481,9 @@
- * Indicies are printed as 1-based, not 0-based.
- * @return {string} The GNU diff string.
- */
- diff_match_patch.patch_obj.prototype.toString = function() {
- var coords1, coords2;
- if (this.length1 === 0) {
- coords1 = this.start1 + ',0';
- } else if (this.length1 == 1) {
- coords1 = this.start1 + 1;
- } else {
- coords1 = (this.start1 + 1) + ',' + this.length1;
- }
- if (this.length2 === 0) {
- coords2 = this.start2 + ',0';
- } else if (this.length2 == 1) {
- coords2 = this.start2 + 1;
- } else {
- coords2 = (this.start2 + 1) + ',' + this.length2;
- }
- var text = ['@@ -' + coords1 + ' +' + coords2 + ' @@\n'];
- var op;
- // Escape the body of the patch with %xx notation.
- for (var x = 0; x < this.diffs.length; x++) {
- switch (this.diffs[x][0]) {
- case DIFF_INSERT:
- op = '+';
- break;
- case DIFF_DELETE:
- op = '-';
- break;
- case DIFF_EQUAL:
- op = ' ';
- break;
- }
- text[x + 1] = op + encodeURI(this.diffs[x][1]) + '\n';
- }
- return text.join('').replace(/%20/g, ' ');
- };
-
-
- // Export these global variables so that they survive Google's JS compiler.
- // In a browser, 'this' will be 'window'.
- // In node.js 'this' will be a global object.
- this['diff_match_patch'] = diff_match_patch;
- this['DIFF_DELETE'] = DIFF_DELETE;
- this['DIFF_INSERT'] = DIFF_INSERT;
- this['DIFF_EQUAL'] = DIFF_EQUAL;
-
-
-
-/***/ },
-/* 122 */
-/***/ function(module, exports, __webpack_require__) {
-
- var map = {
- "./contexts/context": 110,
- "./contexts/context.js": 110,
- "./contexts/diff": 109,
- "./contexts/diff.js": 109,
- "./contexts/patch": 112,
- "./contexts/patch.js": 112,
- "./contexts/reverse": 113,
- "./contexts/reverse.js": 113,
- "./date-reviver": 111,
- "./date-reviver.js": 111,
- "./diffpatcher": 106,
- "./diffpatcher.js": 106,
- "./environment": 105,
- "./environment.js": 105,
- "./filters/arrays": 116,
- "./filters/arrays.js": 116,
- "./filters/dates": 118,
- "./filters/dates.js": 118,
- "./filters/lcs": 117,
- "./filters/lcs.js": 117,
- "./filters/nested": 115,
- "./filters/nested.js": 115,
- "./filters/texts": 119,
- "./filters/texts.js": 119,
- "./filters/trivial": 114,
- "./filters/trivial.js": 114,
- "./formatters/annotated": 123,
- "./formatters/annotated.js": 123,
- "./formatters/base": 124,
- "./formatters/base.js": 124,
- "./formatters/console": 125,
- "./formatters/console.js": 125,
- "./formatters/html": 133,
- "./formatters/html.js": 133,
- "./formatters/index": 134,
- "./formatters/index.js": 134,
- "./formatters/jsonpatch": 135,
- "./formatters/jsonpatch.js": 135,
- "./main": 104,
- "./main-formatters": 137,
- "./main-formatters.js": 137,
- "./main-full": 138,
- "./main-full.js": 138,
- "./main.js": 104,
- "./pipe": 108,
- "./pipe.js": 108,
- "./processor": 107,
- "./processor.js": 107
- };
- function webpackContext(req) {
- return __webpack_require__(webpackContextResolve(req));
- };
- function webpackContextResolve(req) {
- return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
- };
- webpackContext.keys = function webpackContextKeys() {
- return Object.keys(map);
- };
- webpackContext.resolve = webpackContextResolve;
- module.exports = webpackContext;
- webpackContext.id = 122;
-
-
-/***/ },
-/* 123 */
-/***/ function(module, exports, __webpack_require__) {
-
- var base = __webpack_require__(124);
- var BaseFormatter = base.BaseFormatter;
-
- var AnnotatedFormatter = function AnnotatedFormatter() {
- this.includeMoveDestinations = false;
- };
-
- AnnotatedFormatter.prototype = new BaseFormatter();
-
- AnnotatedFormatter.prototype.prepareContext = function(context) {
- BaseFormatter.prototype.prepareContext.call(this, context);
- context.indent = function(levels) {
- this.indentLevel = (this.indentLevel || 0) +
- (typeof levels === 'undefined' ? 1 : levels);
- this.indentPad = new Array(this.indentLevel + 1).join(' ');
- };
- context.row = function(json, htmlNote) {
- context.out('<tr><td style="white-space: nowrap;">' +
- '<pre class="jsondiffpatch-annotated-indent" style="display: inline-block">');
- context.out(context.indentPad);
- context.out('</pre><pre style="display: inline-block">');
- context.out(json);
- context.out('</pre></td><td class="jsondiffpatch-delta-note"><div>');
- context.out(htmlNote);
- context.out('</div></td></tr>');
- };
- };
-
- AnnotatedFormatter.prototype.typeFormattterErrorFormatter = function(context, err) {
- context.row('', '<pre class="jsondiffpatch-error">' + err + '</pre>');
- };
-
- AnnotatedFormatter.prototype.formatTextDiffString = function(context, value) {
- var lines = this.parseTextDiff(value);
- context.out('<ul class="jsondiffpatch-textdiff">');
- for (var i = 0, l = lines.length; i < l; i++) {
- var line = lines[i];
- context.out('<li>' +
- '<div class="jsondiffpatch-textdiff-location">' +
- '<span class="jsondiffpatch-textdiff-line-number">' +
- line.location.line +
- '</span>' +
- '<span class="jsondiffpatch-textdiff-char">' +
- line.location.chr +
- '</span>' +
- '</div>' +
- '<div class="jsondiffpatch-textdiff-line">');
- var pieces = line.pieces;
- for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
- var piece = pieces[pieceIndex];
- context.out('<span class="jsondiffpatch-textdiff-' + piece.type + '">' +
- piece.text + '</span>');
- }
- context.out('</div></li>');
- }
- context.out('</ul>');
- };
-
- AnnotatedFormatter.prototype.rootBegin = function(context, type, nodeType) {
- context.out('<table class="jsondiffpatch-annotated-delta">');
- if (type === 'node') {
- context.row('{');
- context.indent();
- }
- if (nodeType === 'array') {
- context.row('"_t": "a",', 'Array delta (member names indicate array indices)');
- }
- };
-
- AnnotatedFormatter.prototype.rootEnd = function(context, type) {
- if (type === 'node') {
- context.indent(-1);
- context.row('}');
- }
- context.out('</table>');
- };
-
- AnnotatedFormatter.prototype.nodeBegin = function(context, key, leftKey, type, nodeType) {
- context.row('"' + key + '": {');
- if (type === 'node') {
- context.indent();
- }
- if (nodeType === 'array') {
- context.row('"_t": "a",', 'Array delta (member names indicate array indices)');
- }
- };
-
- AnnotatedFormatter.prototype.nodeEnd = function(context, key, leftKey, type, nodeType, isLast) {
- if (type === 'node') {
- context.indent(-1);
- }
- context.row('}' + (isLast ? '' : ','));
- };
-
- /* jshint camelcase: false */
-
- AnnotatedFormatter.prototype.format_unchanged = function() {
- return;
- };
-
- AnnotatedFormatter.prototype.format_movedestination = function() {
- return;
- };
-
-
- AnnotatedFormatter.prototype.format_node = function(context, delta, left) {
- // recurse
- this.formatDeltaChildren(context, delta, left);
- };
-
- var wrapPropertyName = function(name) {
- return '<pre style="display:inline-block">"' + name + '"</pre>';
- };
-
- var deltaAnnotations = {
- added: function(delta, left, key, leftKey) {
- var formatLegend = ' <pre>([newValue])</pre>';
- if (typeof leftKey === 'undefined') {
- return 'new value' + formatLegend;
- }
- if (typeof leftKey === 'number') {
- return 'insert at index ' + leftKey + formatLegend;
- }
- return 'add property ' + wrapPropertyName(leftKey) + formatLegend;
- },
- modified: function(delta, left, key, leftKey) {
- var formatLegend = ' <pre>([previousValue, newValue])</pre>';
- if (typeof leftKey === 'undefined') {
- return 'modify value' + formatLegend;
- }
- if (typeof leftKey === 'number') {
- return 'modify at index ' + leftKey + formatLegend;
- }
- return 'modify property ' + wrapPropertyName(leftKey) + formatLegend;
- },
- deleted: function(delta, left, key, leftKey) {
- var formatLegend = ' <pre>([previousValue, 0, 0])</pre>';
- if (typeof leftKey === 'undefined') {
- return 'delete value' + formatLegend;
- }
- if (typeof leftKey === 'number') {
- return 'remove index ' + leftKey + formatLegend;
- }
- return 'delete property ' + wrapPropertyName(leftKey) + formatLegend;
- },
- moved: function(delta, left, key, leftKey) {
- return 'move from <span title="(position to remove at original state)">index ' +
- leftKey + '</span> to ' +
- '<span title="(position to insert at final state)">index ' +
- delta[1] + '</span>';
- },
- textdiff: function(delta, left, key, leftKey) {
- var location = (typeof leftKey === 'undefined') ?
- '' : (
- (typeof leftKey === 'number') ?
- ' at index ' + leftKey :
- ' at property ' + wrapPropertyName(leftKey)
- );
- return 'text diff' + location + ', format is ' +
- '<a href="https://code.google.com/p/google-diff-match-patch/wiki/Unidiff">' +
- 'a variation of Unidiff</a>';
- }
- };
-
- var formatAnyChange = function(context, delta) {
- var deltaType = this.getDeltaType(delta);
- var annotator = deltaAnnotations[deltaType];
- var htmlNote = annotator && annotator.apply(annotator,
- Array.prototype.slice.call(arguments, 1));
- var json = JSON.stringify(delta, null, 2);
- if (deltaType === 'textdiff') {
- // split text diffs lines
- json = json.split('\\n').join('\\n"+\n "');
- }
- context.indent();
- context.row(json, htmlNote);
- context.indent(-1);
- };
-
- AnnotatedFormatter.prototype.format_added = formatAnyChange;
- AnnotatedFormatter.prototype.format_modified = formatAnyChange;
- AnnotatedFormatter.prototype.format_deleted = formatAnyChange;
- AnnotatedFormatter.prototype.format_moved = formatAnyChange;
- AnnotatedFormatter.prototype.format_textdiff = formatAnyChange;
-
- /* jshint camelcase: true */
-
- exports.AnnotatedFormatter = AnnotatedFormatter;
-
- var defaultInstance;
-
- exports.format = function(delta, left) {
- if (!defaultInstance) {
- defaultInstance = new AnnotatedFormatter();
- }
- return defaultInstance.format(delta, left);
- };
-
-
-/***/ },
-/* 124 */
-/***/ function(module, exports) {
-
- var isArray = (typeof Array.isArray === 'function') ?
- // use native function
- Array.isArray :
- // use instanceof operator
- function(a) {
- return a instanceof Array;
- };
-
- var getObjectKeys = typeof Object.keys === 'function' ?
- function(obj) {
- return Object.keys(obj);
- } : function(obj) {
- var names = [];
- for (var property in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, property)) {
- names.push(property);
- }
- }
- return names;
- };
-
- var trimUnderscore = function(str) {
- if (str.substr(0, 1) === '_') {
- return str.slice(1);
- }
- return str;
- };
-
- var arrayKeyToSortNumber = function(key) {
- if (key === '_t') {
- return -1;
- } else {
- if (key.substr(0, 1) === '_') {
- return parseInt(key.slice(1), 10);
- } else {
- return parseInt(key, 10) + 0.1;
- }
- }
- };
-
- var arrayKeyComparer = function(key1, key2) {
- return arrayKeyToSortNumber(key1) - arrayKeyToSortNumber(key2);
- };
-
- var BaseFormatter = function BaseFormatter() {};
-
- BaseFormatter.prototype.format = function(delta, left) {
- var context = {};
- this.prepareContext(context);
- this.recurse(context, delta, left);
- return this.finalize(context);
- };
-
- BaseFormatter.prototype.prepareContext = function(context) {
- context.buffer = [];
- context.out = function() {
- this.buffer.push.apply(this.buffer, arguments);
- };
- };
-
- BaseFormatter.prototype.typeFormattterNotFound = function(context, deltaType) {
- throw new Error('cannot format delta type: ' + deltaType);
- };
-
- BaseFormatter.prototype.typeFormattterErrorFormatter = function(context, err) {
- return err.toString();
- };
-
- BaseFormatter.prototype.finalize = function(context) {
- if (isArray(context.buffer)) {
- return context.buffer.join('');
- }
- };
-
- BaseFormatter.prototype.recurse = function(context, delta, left, key, leftKey, movedFrom, isLast) {
-
- var useMoveOriginHere = delta && movedFrom;
- var leftValue = useMoveOriginHere ? movedFrom.value : left;
-
- if (typeof delta === 'undefined' && typeof key === 'undefined') {
- return undefined;
- }
-
- var type = this.getDeltaType(delta, movedFrom);
- var nodeType = type === 'node' ? (delta._t === 'a' ? 'array' : 'object') : '';
-
- if (typeof key !== 'undefined') {
- this.nodeBegin(context, key, leftKey, type, nodeType, isLast);
- } else {
- this.rootBegin(context, type, nodeType);
- }
-
- var typeFormattter;
- try {
- typeFormattter = this['format_' + type] || this.typeFormattterNotFound(context, type);
- typeFormattter.call(this, context, delta, leftValue, key, leftKey, movedFrom);
- } catch (err) {
- this.typeFormattterErrorFormatter(context, err, delta, leftValue, key, leftKey, movedFrom);
- if (typeof console !== 'undefined' && console.error) {
- console.error(err.stack);
- }
- }
-
- if (typeof key !== 'undefined') {
- this.nodeEnd(context, key, leftKey, type, nodeType, isLast);
- } else {
- this.rootEnd(context, type, nodeType);
- }
- };
-
- BaseFormatter.prototype.formatDeltaChildren = function(context, delta, left) {
- var self = this;
- this.forEachDeltaKey(delta, left, function(key, leftKey, movedFrom, isLast) {
- self.recurse(context, delta[key], left ? left[leftKey] : undefined,
- key, leftKey, movedFrom, isLast);
- });
- };
-
- BaseFormatter.prototype.forEachDeltaKey = function(delta, left, fn) {
- var keys = getObjectKeys(delta);
- var arrayKeys = delta._t === 'a';
- var moveDestinations = {};
- var name;
- if (typeof left !== 'undefined') {
- for (name in left) {
- if (typeof delta[name] === 'undefined' &&
- ((!arrayKeys) || typeof delta['_' + name] === 'undefined')) {
- keys.push(name);
- }
- }
- }
- // look for move destinations
- for (name in delta) {
- var value = delta[name];
- if (isArray(value) && value[2] === 3) {
- moveDestinations[value[1].toString()] = {
- key: name,
- value: left && left[parseInt(name.substr(1))]
- };
- if (this.includeMoveDestinations !== false) {
- if ((typeof left === 'undefined') &&
- (typeof delta[value[1]] === 'undefined')) {
- keys.push(value[1].toString());
- }
- }
- }
- }
- if (arrayKeys) {
- keys.sort(arrayKeyComparer);
- } else {
- keys.sort();
- }
- for (var index = 0, length = keys.length; index < length; index++) {
- var key = keys[index];
- if (arrayKeys && key === '_t') {
- continue;
- }
- var leftKey = arrayKeys ?
- (typeof key === 'number' ? key : parseInt(trimUnderscore(key), 10)) :
- key;
- var isLast = (index === length - 1);
- fn(key, leftKey, moveDestinations[leftKey], isLast);
- }
- };
-
- BaseFormatter.prototype.getDeltaType = function(delta, movedFrom) {
- if (typeof delta === 'undefined') {
- if (typeof movedFrom !== 'undefined') {
- return 'movedestination';
- }
- return 'unchanged';
- }
- if (isArray(delta)) {
- if (delta.length === 1) {
- return 'added';
- }
- if (delta.length === 2) {
- return 'modified';
- }
- if (delta.length === 3 && delta[2] === 0) {
- return 'deleted';
- }
- if (delta.length === 3 && delta[2] === 2) {
- return 'textdiff';
- }
- if (delta.length === 3 && delta[2] === 3) {
- return 'moved';
- }
- } else if (typeof delta === 'object') {
- return 'node';
- }
- return 'unknown';
- };
-
- BaseFormatter.prototype.parseTextDiff = function(value) {
- var output = [];
- var lines = value.split('\n@@ ');
- for (var i = 0, l = lines.length; i < l; i++) {
- var line = lines[i];
- var lineOutput = {
- pieces: []
- };
- var location = /^(?:@@ )?[-+]?(\d+),(\d+)/.exec(line).slice(1);
- lineOutput.location = {
- line: location[0],
- chr: location[1]
- };
- var pieces = line.split('\n').slice(1);
- for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
- var piece = pieces[pieceIndex];
- if (!piece.length) {
- continue;
- }
- var pieceOutput = {
- type: 'context'
- };
- if (piece.substr(0, 1) === '+') {
- pieceOutput.type = 'added';
- } else if (piece.substr(0, 1) === '-') {
- pieceOutput.type = 'deleted';
- }
- pieceOutput.text = piece.slice(1);
- lineOutput.pieces.push(pieceOutput);
- }
- output.push(lineOutput);
- }
- return output;
- };
-
- exports.BaseFormatter = BaseFormatter;
-
-
-/***/ },
-/* 125 */
-/***/ function(module, exports, __webpack_require__) {
-
- var chalk = __webpack_require__(126);
- var base = __webpack_require__(124);
- var BaseFormatter = base.BaseFormatter;
-
- var colors = {
- added: chalk.green,
- deleted: chalk.red,
- movedestination: chalk.gray,
- moved: chalk.yellow,
- unchanged: chalk.gray,
- error: chalk.white.bgRed,
- textDiffLine: chalk.gray
- };
-
- var ConsoleFormatter = function ConsoleFormatter() {
- this.includeMoveDestinations = false;
- };
-
- ConsoleFormatter.prototype = new BaseFormatter();
-
- ConsoleFormatter.prototype.prepareContext = function(context) {
- BaseFormatter.prototype.prepareContext.call(this, context);
- context.indent = function(levels) {
- this.indentLevel = (this.indentLevel || 0) +
- (typeof levels === 'undefined' ? 1 : levels);
- this.indentPad = new Array(this.indentLevel + 1).join(' ');
- this.outLine();
- };
- context.outLine = function() {
- this.buffer.push('\n' + (this.indentPad || ''));
- };
- context.out = function() {
- for (var i = 0, l = arguments.length; i < l; i++) {
- var lines = arguments[i].split('\n');
- var text = lines.join('\n' + (this.indentPad || ''));
- if (this.color && this.color[0]) {
- text = this.color[0](text);
- }
- this.buffer.push(text);
- }
- };
- context.pushColor = function(color) {
- this.color = this.color || [];
- this.color.unshift(color);
- };
- context.popColor = function() {
- this.color = this.color || [];
- this.color.shift();
- };
- };
-
- ConsoleFormatter.prototype.typeFormattterErrorFormatter = function(context, err) {
- context.pushColor(colors.error);
- context.out('[ERROR]' + err);
- context.popColor();
- };
-
- ConsoleFormatter.prototype.formatValue = function(context, value) {
- context.out(JSON.stringify(value, null, 2));
- };
-
- ConsoleFormatter.prototype.formatTextDiffString = function(context, value) {
- var lines = this.parseTextDiff(value);
- context.indent();
- for (var i = 0, l = lines.length; i < l; i++) {
- var line = lines[i];
- context.pushColor(colors.textDiffLine);
- context.out(line.location.line + ',' + line.location.chr + ' ');
- context.popColor();
- var pieces = line.pieces;
- for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
- var piece = pieces[pieceIndex];
- context.pushColor(colors[piece.type]);
- context.out(piece.text);
- context.popColor();
- }
- if (i < l - 1) {
- context.outLine();
- }
- }
- context.indent(-1);
- };
-
- ConsoleFormatter.prototype.rootBegin = function(context, type, nodeType) {
- context.pushColor(colors[type]);
- if (type === 'node') {
- context.out(nodeType === 'array' ? '[' : '{');
- context.indent();
- }
- };
-
- ConsoleFormatter.prototype.rootEnd = function(context, type, nodeType) {
- if (type === 'node') {
- context.indent(-1);
- context.out(nodeType === 'array' ? ']' : '}');
- }
- context.popColor();
- };
-
- ConsoleFormatter.prototype.nodeBegin = function(context, key, leftKey, type, nodeType) {
- context.pushColor(colors[type]);
- context.out(leftKey + ': ');
- if (type === 'node') {
- context.out(nodeType === 'array' ? '[' : '{');
- context.indent();
- }
- };
-
- ConsoleFormatter.prototype.nodeEnd = function(context, key, leftKey, type, nodeType, isLast) {
- if (type === 'node') {
- context.indent(-1);
- context.out(nodeType === 'array' ? ']' : '}' +
- (isLast ? '' : ','));
- }
- if (!isLast) {
- context.outLine();
- }
- context.popColor();
- };
-
- /* jshint camelcase: false */
-
- ConsoleFormatter.prototype.format_unchanged = function(context, delta, left) {
- if (typeof left === 'undefined') {
- return;
- }
- this.formatValue(context, left);
- };
-
- ConsoleFormatter.prototype.format_movedestination = function(context, delta, left) {
- if (typeof left === 'undefined') {
- return;
- }
- this.formatValue(context, left);
- };
-
- ConsoleFormatter.prototype.format_node = function(context, delta, left) {
- // recurse
- this.formatDeltaChildren(context, delta, left);
- };
-
- ConsoleFormatter.prototype.format_added = function(context, delta) {
- this.formatValue(context, delta[0]);
- };
-
- ConsoleFormatter.prototype.format_modified = function(context, delta) {
- context.pushColor(colors.deleted);
- this.formatValue(context, delta[0]);
- context.popColor();
- context.out(' => ');
- context.pushColor(colors.added);
- this.formatValue(context, delta[1]);
- context.popColor();
- };
-
- ConsoleFormatter.prototype.format_deleted = function(context, delta) {
- this.formatValue(context, delta[0]);
- };
-
- ConsoleFormatter.prototype.format_moved = function(context, delta) {
- context.out('==> ' + delta[1]);
- };
-
- ConsoleFormatter.prototype.format_textdiff = function(context, delta) {
- this.formatTextDiffString(context, delta[0]);
- };
-
- /* jshint camelcase: true */
-
- exports.ConsoleFormatter = ConsoleFormatter;
-
- var defaultInstance;
-
- var format = function(delta, left) {
- if (!defaultInstance) {
- defaultInstance = new ConsoleFormatter();
- }
- return defaultInstance.format(delta, left);
- };
-
- exports.log = function(delta, left) {
- console.log(format(delta, left));
- };
-
- exports.format = format;
-
-
-/***/ },
-/* 126 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- var escapeStringRegexp = __webpack_require__(127);
- var ansiStyles = __webpack_require__(128);
- var stripAnsi = __webpack_require__(129);
- var hasAnsi = __webpack_require__(131);
- var supportsColor = __webpack_require__(132);
- var defineProps = Object.defineProperties;
- var chalk = module.exports;
-
- function build(_styles) {
- var builder = function builder() {
- return applyStyle.apply(builder, arguments);
- };
- builder._styles = _styles;
- // __proto__ is used because we must return a function, but there is
- // no way to create a function with a different prototype.
- builder.__proto__ = proto;
- return builder;
- }
-
- var styles = (function () {
- var ret = {};
-
- ansiStyles.grey = ansiStyles.gray;
-
- Object.keys(ansiStyles).forEach(function (key) {
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
-
- ret[key] = {
- get: function () {
- return build(this._styles.concat(key));
- }
- };
- });
-
- return ret;
- })();
-
- var proto = defineProps(function chalk() {}, styles);
-
- function applyStyle() {
- // support varags, but simply cast to string in case there's only one arg
- var args = arguments;
- var argsLen = args.length;
- var str = argsLen !== 0 && String(arguments[0]);
- if (argsLen > 1) {
- // don't slice `arguments`, it prevents v8 optimizations
- for (var a = 1; a < argsLen; a++) {
- str += ' ' + args[a];
- }
- }
-
- if (!chalk.enabled || !str) {
- return str;
- }
-
- /*jshint validthis: true*/
- var nestedStyles = this._styles;
-
- for (var i = 0; i < nestedStyles.length; i++) {
- var code = ansiStyles[nestedStyles[i]];
- // Replace any instances already present with a re-opening code
- // otherwise only the part of the string until said closing code
- // will be colored, and the rest will simply be 'plain'.
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
- }
-
- return str;
- }
-
- function init() {
- var ret = {};
-
- Object.keys(styles).forEach(function (name) {
- ret[name] = {
- get: function () {
- return build([name]);
- }
- };
- });
-
- return ret;
- }
-
- defineProps(chalk, init());
-
- chalk.styles = ansiStyles;
- chalk.hasColor = hasAnsi;
- chalk.stripColor = stripAnsi;
- chalk.supportsColor = supportsColor;
-
- // detect mode if not set manually
- if (chalk.enabled === undefined) {
- chalk.enabled = chalk.supportsColor;
- }
-
-
-/***/ },
-/* 127 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
-
- module.exports = function (str) {
- if (typeof str !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- return str.replace(matchOperatorsRe, '\\$&');
- };
-
-
-/***/ },
-/* 128 */
-/***/ function(module, exports) {
-
- 'use strict';
- var styles = module.exports;
-
- var codes = {
- reset: [0, 0],
-
- bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29],
-
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- gray: [90, 39],
-
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49]
- };
-
- Object.keys(codes).forEach(function (key) {
- var val = codes[key];
- var style = styles[key] = {};
- style.open = '\u001b[' + val[0] + 'm';
- style.close = '\u001b[' + val[1] + 'm';
- });
-
-
-/***/ },
-/* 129 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- var ansiRegex = __webpack_require__(130)();
-
- module.exports = function (str) {
- return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
- };
-
-
-/***/ },
-/* 130 */
-/***/ function(module, exports) {
-
- 'use strict';
- module.exports = function () {
- return /\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g;
- };
-
-
-/***/ },
-/* 131 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- var ansiRegex = __webpack_require__(130);
- var re = new RegExp(ansiRegex().source); // remove the `g` flag
- module.exports = re.test.bind(re);
-
-
-/***/ },
-/* 132 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(process) {'use strict';
- module.exports = (function () {
- if (process.argv.indexOf('--no-color') !== -1) {
- return false;
- }
-
- if (process.argv.indexOf('--color') !== -1) {
- return true;
- }
-
- if (process.stdout && !process.stdout.isTTY) {
- return false;
- }
-
- if (process.platform === 'win32') {
- return true;
- }
-
- if ('COLORTERM' in process.env) {
- return true;
- }
-
- if (process.env.TERM === 'dumb') {
- return false;
- }
-
- if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
- return true;
- }
-
- return false;
- })();
-
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(57)))
-
-/***/ },
-/* 133 */
-/***/ function(module, exports, __webpack_require__) {
-
- var base = __webpack_require__(124);
- var BaseFormatter = base.BaseFormatter;
-
- var HtmlFormatter = function HtmlFormatter() {};
-
- HtmlFormatter.prototype = new BaseFormatter();
-
- function htmlEscape(text) {
- var html = text;
- var replacements = [
- [/&/g, '&'],
- [/</g, '<'],
- [/>/g, '>'],
- [/'/g, '''],
- [/"/g, '"']
- ];
- for (var i = 0; i < replacements.length; i++) {
- html = html.replace(replacements[i][0], replacements[i][1]);
- }
- return html;
- }
-
- HtmlFormatter.prototype.typeFormattterErrorFormatter = function(context, err) {
- context.out('<pre class="jsondiffpatch-error">' + err + '</pre>');
- };
-
- HtmlFormatter.prototype.formatValue = function(context, value) {
- context.out('<pre>' + htmlEscape(JSON.stringify(value, null, 2)) + '</pre>');
- };
-
- HtmlFormatter.prototype.formatTextDiffString = function(context, value) {
- var lines = this.parseTextDiff(value);
- context.out('<ul class="jsondiffpatch-textdiff">');
- for (var i = 0, l = lines.length; i < l; i++) {
- var line = lines[i];
- context.out('<li>' +
- '<div class="jsondiffpatch-textdiff-location">' +
- '<span class="jsondiffpatch-textdiff-line-number">' +
- line.location.line +
- '</span>' +
- '<span class="jsondiffpatch-textdiff-char">' +
- line.location.chr +
- '</span>' +
- '</div>' +
- '<div class="jsondiffpatch-textdiff-line">');
- var pieces = line.pieces;
- for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
- /* global unescape */
- var piece = pieces[pieceIndex];
- context.out('<span class="jsondiffpatch-textdiff-' + piece.type + '">' +
- htmlEscape(unescape(piece.text)) + '</span>');
- }
- context.out('</div></li>');
- }
- context.out('</ul>');
- };
-
- var adjustArrows = function jsondiffpatchHtmlFormatterAdjustArrows(node) {
- node = node || document;
- var getElementText = function(el) {
- return el.textContent || el.innerText;
- };
- var eachByQuery = function(el, query, fn) {
- var elems = el.querySelectorAll(query);
- for (var i = 0, l = elems.length; i < l; i++) {
- fn(elems[i]);
- }
- };
- var eachChildren = function(el, fn) {
- for (var i = 0, l = el.children.length; i < l; i++) {
- fn(el.children[i], i);
- }
- };
- eachByQuery(node, '.jsondiffpatch-arrow', function(arrow) {
- var arrowParent = arrow.parentNode;
- var svg = arrow.children[0],
- path = svg.children[1];
- svg.style.display = 'none';
- var destination = getElementText(arrowParent.querySelector('.jsondiffpatch-moved-destination'));
- var container = arrowParent.parentNode;
- var destinationElem;
- eachChildren(container, function(child) {
- if (child.getAttribute('data-key') === destination) {
- destinationElem = child;
- }
- });
- if (!destinationElem) {
- return;
- }
- try {
- var distance = destinationElem.offsetTop - arrowParent.offsetTop;
- svg.setAttribute('height', Math.abs(distance) + 6);
- arrow.style.top = (-8 + (distance > 0 ? 0 : distance)) + 'px';
- var curve = distance > 0 ?
- 'M30,0 Q-10,' + Math.round(distance / 2) + ' 26,' + (distance - 4) :
- 'M30,' + (-distance) + ' Q-10,' + Math.round(-distance / 2) + ' 26,4';
- path.setAttribute('d', curve);
- svg.style.display = '';
- } catch (err) {
- return;
- }
- });
- };
-
- HtmlFormatter.prototype.rootBegin = function(context, type, nodeType) {
- var nodeClass = 'jsondiffpatch-' + type +
- (nodeType ? ' jsondiffpatch-child-node-type-' + nodeType : '');
- context.out('<div class="jsondiffpatch-delta ' + nodeClass + '">');
- };
-
- HtmlFormatter.prototype.rootEnd = function(context) {
- context.out('</div>' + (context.hasArrows ?
- ('<script type="text/javascript">setTimeout(' +
- adjustArrows.toString() +
- ',10);</script>') : ''));
- };
-
- HtmlFormatter.prototype.nodeBegin = function(context, key, leftKey, type, nodeType) {
- var nodeClass = 'jsondiffpatch-' + type +
- (nodeType ? ' jsondiffpatch-child-node-type-' + nodeType : '');
- context.out('<li class="' + nodeClass + '" data-key="' + leftKey + '">' +
- '<div class="jsondiffpatch-property-name">' + leftKey + '</div>');
- };
-
-
- HtmlFormatter.prototype.nodeEnd = function(context) {
- context.out('</li>');
- };
-
- /* jshint camelcase: false */
-
- HtmlFormatter.prototype.format_unchanged = function(context, delta, left) {
- if (typeof left === 'undefined') {
- return;
- }
- context.out('<div class="jsondiffpatch-value">');
- this.formatValue(context, left);
- context.out('</div>');
- };
-
- HtmlFormatter.prototype.format_movedestination = function(context, delta, left) {
- if (typeof left === 'undefined') {
- return;
- }
- context.out('<div class="jsondiffpatch-value">');
- this.formatValue(context, left);
- context.out('</div>');
- };
-
- HtmlFormatter.prototype.format_node = function(context, delta, left) {
- // recurse
- var nodeType = (delta._t === 'a') ? 'array' : 'object';
- context.out('<ul class="jsondiffpatch-node jsondiffpatch-node-type-' + nodeType + '">');
- this.formatDeltaChildren(context, delta, left);
- context.out('</ul>');
- };
-
- HtmlFormatter.prototype.format_added = function(context, delta) {
- context.out('<div class="jsondiffpatch-value">');
- this.formatValue(context, delta[0]);
- context.out('</div>');
- };
-
- HtmlFormatter.prototype.format_modified = function(context, delta) {
- context.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">');
- this.formatValue(context, delta[0]);
- context.out('</div>' +
- '<div class="jsondiffpatch-value jsondiffpatch-right-value">');
- this.formatValue(context, delta[1]);
- context.out('</div>');
- };
-
- HtmlFormatter.prototype.format_deleted = function(context, delta) {
- context.out('<div class="jsondiffpatch-value">');
- this.formatValue(context, delta[0]);
- context.out('</div>');
- };
-
- HtmlFormatter.prototype.format_moved = function(context, delta) {
- context.out('<div class="jsondiffpatch-value">');
- this.formatValue(context, delta[0]);
- context.out('</div><div class="jsondiffpatch-moved-destination">' + delta[1] + '</div>');
-
- // draw an SVG arrow from here to move destination
- context.out(
- /*jshint multistr: true */
- '<div class="jsondiffpatch-arrow" style="position: relative; left: -34px;">\
- <svg width="30" height="60" style="position: absolute; display: none;">\
- <defs>\
- <marker id="markerArrow" markerWidth="8" markerHeight="8" refx="2" refy="4"\
- orient="auto" markerUnits="userSpaceOnUse">\
- <path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />\
- </marker>\
- </defs>\
- <path d="M30,0 Q-10,25 26,50" style="stroke: #88f; stroke-width: 2px; fill: none;\
- stroke-opacity: 0.5; marker-end: url(#markerArrow);"></path>\
- </svg>\
- </div>');
- context.hasArrows = true;
- };
-
- HtmlFormatter.prototype.format_textdiff = function(context, delta) {
- context.out('<div class="jsondiffpatch-value">');
- this.formatTextDiffString(context, delta[0]);
- context.out('</div>');
- };
-
- /* jshint camelcase: true */
-
- var showUnchanged = function(show, node, delay) {
- var el = node || document.body;
- var prefix = 'jsondiffpatch-unchanged-';
- var classes = {
- showing: prefix + 'showing',
- hiding: prefix + 'hiding',
- visible: prefix + 'visible',
- hidden: prefix + 'hidden',
- };
- var list = el.classList;
- if (!list) {
- return;
- }
- if (!delay) {
- list.remove(classes.showing);
- list.remove(classes.hiding);
- list.remove(classes.visible);
- list.remove(classes.hidden);
- if (show === false) {
- list.add(classes.hidden);
- }
- return;
- }
- if (show === false) {
- list.remove(classes.showing);
- list.add(classes.visible);
- setTimeout(function() {
- list.add(classes.hiding);
- }, 10);
- } else {
- list.remove(classes.hiding);
- list.add(classes.showing);
- list.remove(classes.hidden);
- }
- var intervalId = setInterval(function() {
- adjustArrows(el);
- }, 100);
- setTimeout(function() {
- list.remove(classes.showing);
- list.remove(classes.hiding);
- if (show === false) {
- list.add(classes.hidden);
- list.remove(classes.visible);
- } else {
- list.add(classes.visible);
- list.remove(classes.hidden);
- }
- setTimeout(function() {
- list.remove(classes.visible);
- clearInterval(intervalId);
- }, delay + 400);
- }, delay);
- };
-
- var hideUnchanged = function(node, delay) {
- return showUnchanged(false, node, delay);
- };
-
- exports.HtmlFormatter = HtmlFormatter;
-
- exports.showUnchanged = showUnchanged;
-
- exports.hideUnchanged = hideUnchanged;
-
- var defaultInstance;
-
- exports.format = function(delta, left) {
- if (!defaultInstance) {
- defaultInstance = new HtmlFormatter();
- }
- return defaultInstance.format(delta, left);
- };
-
-
-/***/ },
-/* 134 */
-/***/ function(module, exports, __webpack_require__) {
-
- var environment = __webpack_require__(105);
-
- exports.base = __webpack_require__(124);
- exports.html = __webpack_require__(133);
- exports.annotated = __webpack_require__(123);
- exports.jsonpatch = __webpack_require__(135);
-
- if (!environment.isBrowser) {
- var consoleModuleName = './console';
- exports.console = __webpack_require__(136)(consoleModuleName);
- }
-
-
-/***/ },
-/* 135 */
-/***/ function(module, exports, __webpack_require__) {
-
- (function () {
- var base = __webpack_require__(124);
- var BaseFormatter = base.BaseFormatter;
-
- var named = {
- added: 'add',
- deleted: 'remove',
- modified: 'replace',
- moved: 'moved',
- movedestination: 'movedestination',
- unchanged: 'unchanged',
- error: 'error',
- textDiffLine: 'textDiffLine'
- };
-
- function JSONFormatter() {
- this.includeMoveDestinations = false;
- }
-
- JSONFormatter.prototype = new BaseFormatter();
-
- JSONFormatter.prototype.prepareContext = function (context) {
- BaseFormatter.prototype.prepareContext.call(this, context);
- context.result = [];
- context.path = [];
- context.pushCurrentOp = function (op, value) {
- var val = {
- op: op,
- path: this.currentPath()
- };
- if (typeof value !== 'undefined') {
- val.value = value;
- }
- this.result.push(val);
- };
-
- context.currentPath = function () {
- return '/' + this.path.join('/');
- };
- };
-
- JSONFormatter.prototype.typeFormattterErrorFormatter = function (context, err) {
- context.out('[ERROR]' + err);
- };
-
- JSONFormatter.prototype.rootBegin = function () {
- };
-
- JSONFormatter.prototype.rootEnd = function () {
- };
-
- JSONFormatter.prototype.nodeBegin = function (context, key, leftKey) {
- context.path.push(leftKey);
- };
-
- JSONFormatter.prototype.nodeEnd = function (context) {
- context.path.pop();
- };
-
- /* jshint camelcase: false */
-
- JSONFormatter.prototype.format_unchanged = function (context, delta, left) {
- if (typeof left === 'undefined') {
- return;
- }
- context.pushCurrentOp(named.unchanged, left);
- };
-
- JSONFormatter.prototype.format_movedestination = function (context, delta, left) {
- if (typeof left === 'undefined') {
- return;
- }
- context.pushCurrentOp(named.movedestination, left);
- };
-
- JSONFormatter.prototype.format_node = function (context, delta, left) {
- this.formatDeltaChildren(context, delta, left);
- };
-
- JSONFormatter.prototype.format_added = function (context, delta) {
- context.pushCurrentOp(named.added, delta[0]);
- };
-
- JSONFormatter.prototype.format_modified = function (context, delta) {
- context.pushCurrentOp(named.modified, delta[1]);
- };
-
- JSONFormatter.prototype.format_deleted = function (context) {
- context.pushCurrentOp(named.deleted);
- };
-
- JSONFormatter.prototype.format_moved = function (context, delta) {
- context.pushCurrentOp(named.moved, delta[1]);
- };
-
- JSONFormatter.prototype.format_textdiff = function () {
- throw 'not implimented';
- };
-
- JSONFormatter.prototype.format = function (delta, left) {
- var context = {};
- this.prepareContext(context);
- this.recurse(context, delta, left);
- return context.result;
- };
- /* jshint camelcase: true */
-
- exports.JSONFormatter = JSONFormatter;
-
- var defaultInstance;
-
- function last(arr) {
- return arr[arr.length - 1];
- }
-
- function sortBy(arr, pred) {
- arr.sort(pred);
- return arr;
- }
-
- var compareByIndexDesc = function (indexA, indexB) {
- var lastA = parseInt(indexA, 10);
- var lastB = parseInt(indexB, 10);
- if (!(isNaN(lastA) || isNaN(lastB))) {
- return lastB - lastA;
- } else {
- return 0;
- }
- };
-
- function opsByDescendingOrder(removeOps) {
- return sortBy(removeOps, function (a, b) {
- var splitA = a.path.split('/');
- var splitB = b.path.split('/');
- if (splitA.length !== splitB.length) {
- return splitA.length - splitB.length;
- } else {
- return compareByIndexDesc(last(splitA), last(splitB));
- }
- });
- }
-
- function partition(arr, pred) {
- var left = [];
- var right = [];
-
- arr.forEach(function (el) {
- var coll = pred(el) ? left : right;
- coll.push(el);
- });
- return [left, right];
- }
-
- function reorderOps(jsonFormattedDiff) {
- var removeOpsOtherOps = partition(jsonFormattedDiff, function (operation) {
- return operation.op === 'remove';
- });
- var removeOps = removeOpsOtherOps[0];
- var otherOps = removeOpsOtherOps[1];
-
- var removeOpsReverse = opsByDescendingOrder(removeOps);
- return removeOpsReverse.concat(otherOps);
- }
-
-
- var format = function (delta, left) {
- if (!defaultInstance) {
- defaultInstance = new JSONFormatter();
- }
- return reorderOps(defaultInstance.format(delta, left));
- };
-
- exports.log = function (delta, left) {
- console.log(format(delta, left));
- };
-
- exports.format = format;
- })();
-
-
-/***/ },
-/* 136 */
-/***/ function(module, exports, __webpack_require__) {
-
- var map = {
- "./annotated": 123,
- "./annotated.js": 123,
- "./base": 124,
- "./base.js": 124,
- "./console": 125,
- "./console.js": 125,
- "./html": 133,
- "./html.js": 133,
- "./index": 134,
- "./index.js": 134,
- "./jsonpatch": 135,
- "./jsonpatch.js": 135
- };
- function webpackContext(req) {
- return __webpack_require__(webpackContextResolve(req));
- };
- function webpackContextResolve(req) {
- return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
- };
- webpackContext.keys = function webpackContextKeys() {
- return Object.keys(map);
- };
- webpackContext.resolve = webpackContextResolve;
- module.exports = webpackContext;
- webpackContext.id = 136;
-
-
-/***/ },
-/* 137 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- module.exports = __webpack_require__(134);
-
-
-/***/ },
-/* 138 */
-/***/ function(module, exports, __webpack_require__) {
-
- var environment = __webpack_require__(105);
-
- if (environment.isBrowser) {
- /* global window */
- /* jshint camelcase: false */
- window.diff_match_patch = __webpack_require__(121);
- /* jshint camelcase: true */
- }
-
- module.exports = __webpack_require__(104);
-
-
-/***/ },
-/* 139 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined;
- /*istanbul ignore end*/
- var /*istanbul ignore start*/_base = __webpack_require__(140) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _base2 = _interopRequireDefault(_base);
-
- /*istanbul ignore end*/
- var /*istanbul ignore start*/_character = __webpack_require__(141) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_word = __webpack_require__(142) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_line = __webpack_require__(144) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_sentence = __webpack_require__(145) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_css = __webpack_require__(146) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_json = __webpack_require__(147) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_array = __webpack_require__(148) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_apply = __webpack_require__(149) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_parse = __webpack_require__(150) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_create = __webpack_require__(152) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_dmp = __webpack_require__(153) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_xml = __webpack_require__(154) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- exports. /*istanbul ignore end*/Diff = _base2['default'];
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffArrays = _array.diffArrays;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize; /* See LICENSE file for terms of use */
-
- /*
- * Text diff implementation.
- *
- * This library supports the following APIS:
- * JsDiff.diffChars: Character by character diff
- * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
- * JsDiff.diffLines: Line based diff
- *
- * JsDiff.diffCss: Diff targeted at CSS content
- *
- * These methods are based on the implementation proposed in
- * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
- * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
- */
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQWdCQSxJLHlCQUFBLDhCLHdCQUFBOzs7Ozs7QUFDQSxJLHlCQUFBLHdDLHdCQUFBOztBQUNBLEkseUJBQUEsOEIsd0JBQUE7O0FBQ0EsSSx5QkFBQSw4Qix3QkFBQTs7QUFDQSxJLHlCQUFBLHNDLHdCQUFBOztBQUVBLEkseUJBQUEsNEIsd0JBQUE7O0FBQ0EsSSx5QkFBQSw4Qix3QkFBQTs7QUFFQSxJLHlCQUFBLGdDLHdCQUFBOztBQUVBLEkseUJBQUEsaUMsd0JBQUE7O0FBQ0EsSSx5QkFBQSxpQyx3QkFBQTs7QUFDQSxJLHlCQUFBLG1DLHdCQUFBOztBQUVBLEkseUJBQUEsK0Isd0JBQUE7O0FBQ0EsSSx5QkFBQSwrQix3QkFBQTs7Ozs7Z0NBR0UsSTt5REFFQSxTO3lEQUNBLFM7eURBQ0Esa0I7eURBQ0EsUzt5REFDQSxnQjt5REFDQSxhO3lEQUVBLE87eURBQ0EsUTt5REFFQSxVO3lEQUVBLGU7eURBQ0EsbUI7eURBQ0EsVzt5REFDQSxVO3lEQUNBLFk7eURBQ0EsVTt5REFDQSxtQjt5REFDQSxtQjt5REFDQSxZIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyogU2VlIExJQ0VOU0UgZmlsZSBmb3IgdGVybXMgb2YgdXNlICovXG5cbi8qXG4gKiBUZXh0IGRpZmYgaW1wbGVtZW50YXRpb24uXG4gKlxuICogVGhpcyBsaWJyYXJ5IHN1cHBvcnRzIHRoZSBmb2xsb3dpbmcgQVBJUzpcbiAqIEpzRGlmZi5kaWZmQ2hhcnM6IENoYXJhY3RlciBieSBjaGFyYWN0ZXIgZGlmZlxuICogSnNEaWZmLmRpZmZXb3JkczogV29yZCAoYXMgZGVmaW5lZCBieSBcXGIgcmVnZXgpIGRpZmYgd2hpY2ggaWdub3JlcyB3aGl0ZXNwYWNlXG4gKiBKc0RpZmYuZGlmZkxpbmVzOiBMaW5lIGJhc2VkIGRpZmZcbiAqXG4gKiBKc0RpZmYuZGlmZkNzczogRGlmZiB0YXJnZXRlZCBhdCBDU1MgY29udGVudFxuICpcbiAqIFRoZXNlIG1ldGhvZHMgYXJlIGJhc2VkIG9uIHRoZSBpbXBsZW1lbnRhdGlvbiBwcm9wb3NlZCBpblxuICogXCJBbiBPKE5EKSBEaWZmZXJlbmNlIEFsZ29yaXRobSBhbmQgaXRzIFZhcmlhdGlvbnNcIiAoTXllcnMsIDE5ODYpLlxuICogaHR0cDovL2NpdGVzZWVyeC5pc3QucHN1LmVkdS92aWV3ZG9jL3N1bW1hcnk/ZG9pPTEwLjEuMS40LjY5MjdcbiAqL1xuaW1wb3J0IERpZmYgZnJvbSAnLi9kaWZmL2Jhc2UnO1xuaW1wb3J0IHtkaWZmQ2hhcnN9IGZyb20gJy4vZGlmZi9jaGFyYWN0ZXInO1xuaW1wb3J0IHtkaWZmV29yZHMsIGRpZmZXb3Jkc1dpdGhTcGFjZX0gZnJvbSAnLi9kaWZmL3dvcmQnO1xuaW1wb3J0IHtkaWZmTGluZXMsIGRpZmZUcmltbWVkTGluZXN9IGZyb20gJy4vZGlmZi9saW5lJztcbmltcG9ydCB7ZGlmZlNlbnRlbmNlc30gZnJvbSAnLi9kaWZmL3NlbnRlbmNlJztcblxuaW1wb3J0IHtkaWZmQ3NzfSBmcm9tICcuL2RpZmYvY3NzJztcbmltcG9ydCB7ZGlmZkpzb24sIGNhbm9uaWNhbGl6ZX0gZnJvbSAnLi9kaWZmL2pzb24nO1xuXG5pbXBvcnQge2RpZmZBcnJheXN9IGZyb20gJy4vZGlmZi9hcnJheSc7XG5cbmltcG9ydCB7YXBwbHlQYXRjaCwgYXBwbHlQYXRjaGVzfSBmcm9tICcuL3BhdGNoL2FwcGx5JztcbmltcG9ydCB7cGFyc2VQYXRjaH0gZnJvbSAnLi9wYXRjaC9wYXJzZSc7XG5pbXBvcnQge3N0cnVjdHVyZWRQYXRjaCwgY3JlYXRlVHdvRmlsZXNQYXRjaCwgY3JlYXRlUGF0Y2h9IGZyb20gJy4vcGF0Y2gvY3JlYXRlJztcblxuaW1wb3J0IHtjb252ZXJ0Q2hhbmdlc1RvRE1QfSBmcm9tICcuL2NvbnZlcnQvZG1wJztcbmltcG9ydCB7Y29udmVydENoYW5nZXNUb1hNTH0gZnJvbSAnLi9jb252ZXJ0L3htbCc7XG5cbmV4cG9ydCB7XG4gIERpZmYsXG5cbiAgZGlmZkNoYXJzLFxuICBkaWZmV29yZHMsXG4gIGRpZmZXb3Jkc1dpdGhTcGFjZSxcbiAgZGlmZkxpbmVzLFxuICBkaWZmVHJpbW1lZExpbmVzLFxuICBkaWZmU2VudGVuY2VzLFxuXG4gIGRpZmZDc3MsXG4gIGRpZmZKc29uLFxuXG4gIGRpZmZBcnJheXMsXG5cbiAgc3RydWN0dXJlZFBhdGNoLFxuICBjcmVhdGVUd29GaWxlc1BhdGNoLFxuICBjcmVhdGVQYXRjaCxcbiAgYXBwbHlQYXRjaCxcbiAgYXBwbHlQYXRjaGVzLFxuICBwYXJzZVBhdGNoLFxuICBjb252ZXJ0Q2hhbmdlc1RvRE1QLFxuICBjb252ZXJ0Q2hhbmdlc1RvWE1MLFxuICBjYW5vbmljYWxpemVcbn07XG4iXX0=
-
-
-/***/ },
-/* 140 */
-/***/ function(module, exports) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports['default'] = /*istanbul ignore end*/Diff;
- function Diff() {}
-
- Diff.prototype = { /*istanbul ignore start*/
- /*istanbul ignore end*/diff: function diff(oldString, newString) {
- /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
-
- var callback = options.callback;
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- this.options = options;
-
- var self = this;
-
- function done(value) {
- if (callback) {
- setTimeout(function () {
- callback(undefined, value);
- }, 0);
- return true;
- } else {
- return value;
- }
- }
-
- // Allow subclasses to massage the input prior to running
- oldString = this.castInput(oldString);
- newString = this.castInput(newString);
-
- oldString = this.removeEmpty(this.tokenize(oldString));
- newString = this.removeEmpty(this.tokenize(newString));
-
- var newLen = newString.length,
- oldLen = oldString.length;
- var editLength = 1;
- var maxEditLength = newLen + oldLen;
- var bestPath = [{ newPos: -1, components: [] }];
-
- // Seed editLength = 0, i.e. the content starts with the same values
- var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
- if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
- // Identity per the equality and tokenizer
- return done([{ value: this.join(newString), count: newString.length }]);
- }
-
- // Main worker method. checks all permutations of a given edit length for acceptance.
- function execEditLength() {
- for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
- var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
- var addPath = bestPath[diagonalPath - 1],
- removePath = bestPath[diagonalPath + 1],
- _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
- if (addPath) {
- // No one else is going to attempt to use this value, clear it
- bestPath[diagonalPath - 1] = undefined;
- }
-
- var canAdd = addPath && addPath.newPos + 1 < newLen,
- canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
- if (!canAdd && !canRemove) {
- // If this path is a terminal then prune
- bestPath[diagonalPath] = undefined;
- continue;
- }
-
- // Select the diagonal that we want to branch from. We select the prior
- // path whose position in the new string is the farthest from the origin
- // and does not pass the bounds of the diff graph
- if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
- basePath = clonePath(removePath);
- self.pushComponent(basePath.components, undefined, true);
- } else {
- basePath = addPath; // No need to clone, we've pulled it from the list
- basePath.newPos++;
- self.pushComponent(basePath.components, true, undefined);
- }
-
- _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
-
- // If we have hit the end of both strings, then we are done
- if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
- return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
- } else {
- // Otherwise track this path as a potential candidate and continue.
- bestPath[diagonalPath] = basePath;
- }
- }
-
- editLength++;
- }
-
- // Performs the length of edit iteration. Is a bit fugly as this has to support the
- // sync and async mode which is never fun. Loops over execEditLength until a value
- // is produced.
- if (callback) {
- (function exec() {
- setTimeout(function () {
- // This should not happen, but we want to be safe.
- /* istanbul ignore next */
- if (editLength > maxEditLength) {
- return callback();
- }
-
- if (!execEditLength()) {
- exec();
- }
- }, 0);
- })();
- } else {
- while (editLength <= maxEditLength) {
- var ret = execEditLength();
- if (ret) {
- return ret;
- }
- }
- }
- },
- /*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) {
- var last = components[components.length - 1];
- if (last && last.added === added && last.removed === removed) {
- // We need to clone here as the component clone operation is just
- // as shallow array clone
- components[components.length - 1] = { count: last.count + 1, added: added, removed: removed };
- } else {
- components.push({ count: 1, added: added, removed: removed });
- }
- },
- /*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
- var newLen = newString.length,
- oldLen = oldString.length,
- newPos = basePath.newPos,
- oldPos = newPos - diagonalPath,
- commonCount = 0;
- while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
- newPos++;
- oldPos++;
- commonCount++;
- }
-
- if (commonCount) {
- basePath.components.push({ count: commonCount });
- }
-
- basePath.newPos = newPos;
- return oldPos;
- },
- /*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) {
- return left === right;
- },
- /*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) {
- var ret = [];
- for (var i = 0; i < array.length; i++) {
- if (array[i]) {
- ret.push(array[i]);
- }
- }
- return ret;
- },
- /*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) {
- return value;
- },
- /*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) {
- return value.split('');
- },
- /*istanbul ignore start*/ /*istanbul ignore end*/join: function join(chars) {
- return chars.join('');
- }
- };
-
- function buildValues(diff, components, newString, oldString, useLongestToken) {
- var componentPos = 0,
- componentLen = components.length,
- newPos = 0,
- oldPos = 0;
-
- for (; componentPos < componentLen; componentPos++) {
- var component = components[componentPos];
- if (!component.removed) {
- if (!component.added && useLongestToken) {
- var value = newString.slice(newPos, newPos + component.count);
- value = value.map(function (value, i) {
- var oldValue = oldString[oldPos + i];
- return oldValue.length > value.length ? oldValue : value;
- });
-
- component.value = diff.join(value);
- } else {
- component.value = diff.join(newString.slice(newPos, newPos + component.count));
- }
- newPos += component.count;
-
- // Common case
- if (!component.added) {
- oldPos += component.count;
- }
- } else {
- component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
- oldPos += component.count;
-
- // Reverse add and remove so removes are output first to match common convention
- // The diffing algorithm is tied to add then remove output and this is the simplest
- // route to get the desired output with minimal overhead.
- if (componentPos && components[componentPos - 1].added) {
- var tmp = components[componentPos - 1];
- components[componentPos - 1] = components[componentPos];
- components[componentPos] = tmp;
- }
- }
- }
-
- // Special case handle for when one terminal is ignored. For this case we merge the
- // terminal into the prior string and drop the change.
- var lastComponent = components[componentLen - 1];
- if (componentLen > 1 && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
- components[componentLen - 2].value += lastComponent.value;
- components.pop();
- }
-
- return components;
- }
-
- function clonePath(path) {
- return { newPos: path.newPos, components: path.components.slice(0) };
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OzRDQUF3QixJO0FBQVQsU0FBUyxJQUFULEdBQWdCLENBQUU7O0FBRWpDLEtBQUssU0FBTCxHQUFpQixFO3lCQUNmLElBRGUsZ0JBQ1YsU0FEVSxFQUNDLFNBREQsRUFDMEI7NkJBQUEsSSx1QkFBZCxPQUFjLHlEQUFKLEVBQUk7O0FBQ3ZDLFFBQUksV0FBVyxRQUFRLFFBQXZCO0FBQ0EsUUFBSSxPQUFPLE9BQVAsS0FBbUIsVUFBdkIsRUFBbUM7QUFDakMsaUJBQVcsT0FBWDtBQUNBLGdCQUFVLEVBQVY7QUFDRDtBQUNELFNBQUssT0FBTCxHQUFlLE9BQWY7O0FBRUEsUUFBSSxPQUFPLElBQVg7O0FBRUEsYUFBUyxJQUFULENBQWMsS0FBZCxFQUFxQjtBQUNuQixVQUFJLFFBQUosRUFBYztBQUNaLG1CQUFXLFlBQVc7QUFBRSxtQkFBUyxTQUFULEVBQW9CLEtBQXBCO0FBQTZCLFNBQXJELEVBQXVELENBQXZEO0FBQ0EsZUFBTyxJQUFQO0FBQ0QsT0FIRCxNQUdPO0FBQ0wsZUFBTyxLQUFQO0FBQ0Q7QUFDRjs7O0FBR0QsZ0JBQVksS0FBSyxTQUFMLENBQWUsU0FBZixDQUFaO0FBQ0EsZ0JBQVksS0FBSyxTQUFMLENBQWUsU0FBZixDQUFaOztBQUVBLGdCQUFZLEtBQUssV0FBTCxDQUFpQixLQUFLLFFBQUwsQ0FBYyxTQUFkLENBQWpCLENBQVo7QUFDQSxnQkFBWSxLQUFLLFdBQUwsQ0FBaUIsS0FBSyxRQUFMLENBQWMsU0FBZCxDQUFqQixDQUFaOztBQUVBLFFBQUksU0FBUyxVQUFVLE1BQXZCO0FBQUEsUUFBK0IsU0FBUyxVQUFVLE1BQWxEO0FBQ0EsUUFBSSxhQUFhLENBQWpCO0FBQ0EsUUFBSSxnQkFBZ0IsU0FBUyxNQUE3QjtBQUNBLFFBQUksV0FBVyxDQUFDLEVBQUUsUUFBUSxDQUFDLENBQVgsRUFBYyxZQUFZLEVBQTFCLEVBQUQsQ0FBZjs7O0FBR0EsUUFBSSxTQUFTLEtBQUssYUFBTCxDQUFtQixTQUFTLENBQVQsQ0FBbkIsRUFBZ0MsU0FBaEMsRUFBMkMsU0FBM0MsRUFBc0QsQ0FBdEQsQ0FBYjtBQUNBLFFBQUksU0FBUyxDQUFULEVBQVksTUFBWixHQUFxQixDQUFyQixJQUEwQixNQUExQixJQUFvQyxTQUFTLENBQVQsSUFBYyxNQUF0RCxFQUE4RDs7QUFFNUQsYUFBTyxLQUFLLENBQUMsRUFBQyxPQUFPLEtBQUssSUFBTCxDQUFVLFNBQVYsQ0FBUixFQUE4QixPQUFPLFVBQVUsTUFBL0MsRUFBRCxDQUFMLENBQVA7QUFDRDs7O0FBR0QsYUFBUyxjQUFULEdBQTBCO0FBQ3hCLFdBQUssSUFBSSxlQUFlLENBQUMsQ0FBRCxHQUFLLFVBQTdCLEVBQXlDLGdCQUFnQixVQUF6RCxFQUFxRSxnQkFBZ0IsQ0FBckYsRUFBd0Y7QUFDdEYsWUFBSSxXLHlCQUFBLE0sd0JBQUo7QUFDQSxZQUFJLFVBQVUsU0FBUyxlQUFlLENBQXhCLENBQWQ7QUFBQSxZQUNJLGFBQWEsU0FBUyxlQUFlLENBQXhCLENBRGpCO0FBQUEsWUFFSSxVQUFTLENBQUMsYUFBYSxXQUFXLE1BQXhCLEdBQWlDLENBQWxDLElBQXVDLFlBRnBEO0FBR0EsWUFBSSxPQUFKLEVBQWE7O0FBRVgsbUJBQVMsZUFBZSxDQUF4QixJQUE2QixTQUE3QjtBQUNEOztBQUVELFlBQUksU0FBUyxXQUFXLFFBQVEsTUFBUixHQUFpQixDQUFqQixHQUFxQixNQUE3QztBQUFBLFlBQ0ksWUFBWSxjQUFjLEtBQUssT0FBbkIsSUFBNkIsVUFBUyxNQUR0RDtBQUVBLFlBQUksQ0FBQyxNQUFELElBQVcsQ0FBQyxTQUFoQixFQUEyQjs7QUFFekIsbUJBQVMsWUFBVCxJQUF5QixTQUF6QjtBQUNBO0FBQ0Q7Ozs7O0FBS0QsWUFBSSxDQUFDLE1BQUQsSUFBWSxhQUFhLFFBQVEsTUFBUixHQUFpQixXQUFXLE1BQXpELEVBQWtFO0FBQ2hFLHFCQUFXLFVBQVUsVUFBVixDQUFYO0FBQ0EsZUFBSyxhQUFMLENBQW1CLFNBQVMsVUFBNUIsRUFBd0MsU0FBeEMsRUFBbUQsSUFBbkQ7QUFDRCxTQUhELE1BR087QUFDTCxxQkFBVyxPQUFYLEM7QUFDQSxtQkFBUyxNQUFUO0FBQ0EsZUFBSyxhQUFMLENBQW1CLFNBQVMsVUFBNUIsRUFBd0MsSUFBeEMsRUFBOEMsU0FBOUM7QUFDRDs7QUFFRCxrQkFBUyxLQUFLLGFBQUwsQ0FBbUIsUUFBbkIsRUFBNkIsU0FBN0IsRUFBd0MsU0FBeEMsRUFBbUQsWUFBbkQsQ0FBVDs7O0FBR0EsWUFBSSxTQUFTLE1BQVQsR0FBa0IsQ0FBbEIsSUFBdUIsTUFBdkIsSUFBaUMsVUFBUyxDQUFULElBQWMsTUFBbkQsRUFBMkQ7QUFDekQsaUJBQU8sS0FBSyxZQUFZLElBQVosRUFBa0IsU0FBUyxVQUEzQixFQUF1QyxTQUF2QyxFQUFrRCxTQUFsRCxFQUE2RCxLQUFLLGVBQWxFLENBQUwsQ0FBUDtBQUNELFNBRkQsTUFFTzs7QUFFTCxtQkFBUyxZQUFULElBQXlCLFFBQXpCO0FBQ0Q7QUFDRjs7QUFFRDtBQUNEOzs7OztBQUtELFFBQUksUUFBSixFQUFjO0FBQ1gsZ0JBQVMsSUFBVCxHQUFnQjtBQUNmLG1CQUFXLFlBQVc7OztBQUdwQixjQUFJLGFBQWEsYUFBakIsRUFBZ0M7QUFDOUIsbUJBQU8sVUFBUDtBQUNEOztBQUVELGNBQUksQ0FBQyxnQkFBTCxFQUF1QjtBQUNyQjtBQUNEO0FBQ0YsU0FWRCxFQVVHLENBVkg7QUFXRCxPQVpBLEdBQUQ7QUFhRCxLQWRELE1BY087QUFDTCxhQUFPLGNBQWMsYUFBckIsRUFBb0M7QUFDbEMsWUFBSSxNQUFNLGdCQUFWO0FBQ0EsWUFBSSxHQUFKLEVBQVM7QUFDUCxpQkFBTyxHQUFQO0FBQ0Q7QUFDRjtBQUNGO0FBQ0YsR0E5R2M7bURBZ0hmLGFBaEhlLHlCQWdIRCxVQWhIQyxFQWdIVyxLQWhIWCxFQWdIa0IsT0FoSGxCLEVBZ0gyQjtBQUN4QyxRQUFJLE9BQU8sV0FBVyxXQUFXLE1BQVgsR0FBb0IsQ0FBL0IsQ0FBWDtBQUNBLFFBQUksUUFBUSxLQUFLLEtBQUwsS0FBZSxLQUF2QixJQUFnQyxLQUFLLE9BQUwsS0FBaUIsT0FBckQsRUFBOEQ7OztBQUc1RCxpQkFBVyxXQUFXLE1BQVgsR0FBb0IsQ0FBL0IsSUFBb0MsRUFBQyxPQUFPLEtBQUssS0FBTCxHQUFhLENBQXJCLEVBQXdCLE9BQU8sS0FBL0IsRUFBc0MsU0FBUyxPQUEvQyxFQUFwQztBQUNELEtBSkQsTUFJTztBQUNMLGlCQUFXLElBQVgsQ0FBZ0IsRUFBQyxPQUFPLENBQVIsRUFBVyxPQUFPLEtBQWxCLEVBQXlCLFNBQVMsT0FBbEMsRUFBaEI7QUFDRDtBQUNGLEdBekhjO21EQTBIZixhQTFIZSx5QkEwSEQsUUExSEMsRUEwSFMsU0ExSFQsRUEwSG9CLFNBMUhwQixFQTBIK0IsWUExSC9CLEVBMEg2QztBQUMxRCxRQUFJLFNBQVMsVUFBVSxNQUF2QjtBQUFBLFFBQ0ksU0FBUyxVQUFVLE1BRHZCO0FBQUEsUUFFSSxTQUFTLFNBQVMsTUFGdEI7QUFBQSxRQUdJLFNBQVMsU0FBUyxZQUh0QjtBQUFBLFFBS0ksY0FBYyxDQUxsQjtBQU1BLFdBQU8sU0FBUyxDQUFULEdBQWEsTUFBYixJQUF1QixTQUFTLENBQVQsR0FBYSxNQUFwQyxJQUE4QyxLQUFLLE1BQUwsQ0FBWSxVQUFVLFNBQVMsQ0FBbkIsQ0FBWixFQUFtQyxVQUFVLFNBQVMsQ0FBbkIsQ0FBbkMsQ0FBckQsRUFBZ0g7QUFDOUc7QUFDQTtBQUNBO0FBQ0Q7O0FBRUQsUUFBSSxXQUFKLEVBQWlCO0FBQ2YsZUFBUyxVQUFULENBQW9CLElBQXBCLENBQXlCLEVBQUMsT0FBTyxXQUFSLEVBQXpCO0FBQ0Q7O0FBRUQsYUFBUyxNQUFULEdBQWtCLE1BQWxCO0FBQ0EsV0FBTyxNQUFQO0FBQ0QsR0E3SWM7bURBK0lmLE1BL0llLGtCQStJUixJQS9JUSxFQStJRixLQS9JRSxFQStJSztBQUNsQixXQUFPLFNBQVMsS0FBaEI7QUFDRCxHQWpKYzttREFrSmYsV0FsSmUsdUJBa0pILEtBbEpHLEVBa0pJO0FBQ2pCLFFBQUksTUFBTSxFQUFWO0FBQ0EsU0FBSyxJQUFJLElBQUksQ0FBYixFQUFnQixJQUFJLE1BQU0sTUFBMUIsRUFBa0MsR0FBbEMsRUFBdUM7QUFDckMsVUFBSSxNQUFNLENBQU4sQ0FBSixFQUFjO0FBQ1osWUFBSSxJQUFKLENBQVMsTUFBTSxDQUFOLENBQVQ7QUFDRDtBQUNGO0FBQ0QsV0FBTyxHQUFQO0FBQ0QsR0ExSmM7bURBMkpmLFNBM0plLHFCQTJKTCxLQTNKSyxFQTJKRTtBQUNmLFdBQU8sS0FBUDtBQUNELEdBN0pjO21EQThKZixRQTlKZSxvQkE4Sk4sS0E5Sk0sRUE4SkM7QUFDZCxXQUFPLE1BQU0sS0FBTixDQUFZLEVBQVosQ0FBUDtBQUNELEdBaEtjO21EQWlLZixJQWpLZSxnQkFpS1YsS0FqS1UsRUFpS0g7QUFDVixXQUFPLE1BQU0sSUFBTixDQUFXLEVBQVgsQ0FBUDtBQUNEO0FBbktjLENBQWpCOztBQXNLQSxTQUFTLFdBQVQsQ0FBcUIsSUFBckIsRUFBMkIsVUFBM0IsRUFBdUMsU0FBdkMsRUFBa0QsU0FBbEQsRUFBNkQsZUFBN0QsRUFBOEU7QUFDNUUsTUFBSSxlQUFlLENBQW5CO0FBQUEsTUFDSSxlQUFlLFdBQVcsTUFEOUI7QUFBQSxNQUVJLFNBQVMsQ0FGYjtBQUFBLE1BR0ksU0FBUyxDQUhiOztBQUtBLFNBQU8sZUFBZSxZQUF0QixFQUFvQyxjQUFwQyxFQUFvRDtBQUNsRCxRQUFJLFlBQVksV0FBVyxZQUFYLENBQWhCO0FBQ0EsUUFBSSxDQUFDLFVBQVUsT0FBZixFQUF3QjtBQUN0QixVQUFJLENBQUMsVUFBVSxLQUFYLElBQW9CLGVBQXhCLEVBQXlDO0FBQ3ZDLFlBQUksUUFBUSxVQUFVLEtBQVYsQ0FBZ0IsTUFBaEIsRUFBd0IsU0FBUyxVQUFVLEtBQTNDLENBQVo7QUFDQSxnQkFBUSxNQUFNLEdBQU4sQ0FBVSxVQUFTLEtBQVQsRUFBZ0IsQ0FBaEIsRUFBbUI7QUFDbkMsY0FBSSxXQUFXLFVBQVUsU0FBUyxDQUFuQixDQUFmO0FBQ0EsaUJBQU8sU0FBUyxNQUFULEdBQWtCLE1BQU0sTUFBeEIsR0FBaUMsUUFBakMsR0FBNEMsS0FBbkQ7QUFDRCxTQUhPLENBQVI7O0FBS0Esa0JBQVUsS0FBVixHQUFrQixLQUFLLElBQUwsQ0FBVSxLQUFWLENBQWxCO0FBQ0QsT0FSRCxNQVFPO0FBQ0wsa0JBQVUsS0FBVixHQUFrQixLQUFLLElBQUwsQ0FBVSxVQUFVLEtBQVYsQ0FBZ0IsTUFBaEIsRUFBd0IsU0FBUyxVQUFVLEtBQTNDLENBQVYsQ0FBbEI7QUFDRDtBQUNELGdCQUFVLFVBQVUsS0FBcEI7OztBQUdBLFVBQUksQ0FBQyxVQUFVLEtBQWYsRUFBc0I7QUFDcEIsa0JBQVUsVUFBVSxLQUFwQjtBQUNEO0FBQ0YsS0FsQkQsTUFrQk87QUFDTCxnQkFBVSxLQUFWLEdBQWtCLEtBQUssSUFBTCxDQUFVLFVBQVUsS0FBVixDQUFnQixNQUFoQixFQUF3QixTQUFTLFVBQVUsS0FBM0MsQ0FBVixDQUFsQjtBQUNBLGdCQUFVLFVBQVUsS0FBcEI7Ozs7O0FBS0EsVUFBSSxnQkFBZ0IsV0FBVyxlQUFlLENBQTFCLEVBQTZCLEtBQWpELEVBQXdEO0FBQ3RELFlBQUksTUFBTSxXQUFXLGVBQWUsQ0FBMUIsQ0FBVjtBQUNBLG1CQUFXLGVBQWUsQ0FBMUIsSUFBK0IsV0FBVyxZQUFYLENBQS9CO0FBQ0EsbUJBQVcsWUFBWCxJQUEyQixHQUEzQjtBQUNEO0FBQ0Y7QUFDRjs7OztBQUlELE1BQUksZ0JBQWdCLFdBQVcsZUFBZSxDQUExQixDQUFwQjtBQUNBLE1BQUksZUFBZSxDQUFmLEtBQ0ksY0FBYyxLQUFkLElBQXVCLGNBQWMsT0FEekMsS0FFRyxLQUFLLE1BQUwsQ0FBWSxFQUFaLEVBQWdCLGNBQWMsS0FBOUIsQ0FGUCxFQUU2QztBQUMzQyxlQUFXLGVBQWUsQ0FBMUIsRUFBNkIsS0FBN0IsSUFBc0MsY0FBYyxLQUFwRDtBQUNBLGVBQVcsR0FBWDtBQUNEOztBQUVELFNBQU8sVUFBUDtBQUNEOztBQUVELFNBQVMsU0FBVCxDQUFtQixJQUFuQixFQUF5QjtBQUN2QixTQUFPLEVBQUUsUUFBUSxLQUFLLE1BQWYsRUFBdUIsWUFBWSxLQUFLLFVBQUwsQ0FBZ0IsS0FBaEIsQ0FBc0IsQ0FBdEIsQ0FBbkMsRUFBUDtBQUNEIiwiZmlsZSI6ImJhc2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBEaWZmKCkge31cblxuRGlmZi5wcm90b3R5cGUgPSB7XG4gIGRpZmYob2xkU3RyaW5nLCBuZXdTdHJpbmcsIG9wdGlvbnMgPSB7fSkge1xuICAgIGxldCBjYWxsYmFjayA9IG9wdGlvbnMuY2FsbGJhY2s7XG4gICAgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICBjYWxsYmFjayA9IG9wdGlvbnM7XG4gICAgICBvcHRpb25zID0ge307XG4gICAgfVxuICAgIHRoaXMub3B0aW9ucyA9IG9wdGlvbnM7XG5cbiAgICBsZXQgc2VsZiA9IHRoaXM7XG5cbiAgICBmdW5jdGlvbiBkb25lKHZhbHVlKSB7XG4gICAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsgY2FsbGJhY2sodW5kZWZpbmVkLCB2YWx1ZSk7IH0sIDApO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBBbGxvdyBzdWJjbGFzc2VzIHRvIG1hc3NhZ2UgdGhlIGlucHV0IHByaW9yIHRvIHJ1bm5pbmdcbiAgICBvbGRTdHJpbmcgPSB0aGlzLmNhc3RJbnB1dChvbGRTdHJpbmcpO1xuICAgIG5ld1N0cmluZyA9IHRoaXMuY2FzdElucHV0KG5ld1N0cmluZyk7XG5cbiAgICBvbGRTdHJpbmcgPSB0aGlzLnJlbW92ZUVtcHR5KHRoaXMudG9rZW5pemUob2xkU3RyaW5nKSk7XG4gICAgbmV3U3RyaW5nID0gdGhpcy5yZW1vdmVFbXB0eSh0aGlzLnRva2VuaXplKG5ld1N0cmluZykpO1xuXG4gICAgbGV0IG5ld0xlbiA9IG5ld1N0cmluZy5sZW5ndGgsIG9sZExlbiA9IG9sZFN0cmluZy5sZW5ndGg7XG4gICAgbGV0IGVkaXRMZW5ndGggPSAxO1xuICAgIGxldCBtYXhFZGl0TGVuZ3RoID0gbmV3TGVuICsgb2xkTGVuO1xuICAgIGxldCBiZXN0UGF0aCA9IFt7IG5ld1BvczogLTEsIGNvbXBvbmVudHM6IFtdIH1dO1xuXG4gICAgLy8gU2VlZCBlZGl0TGVuZ3RoID0gMCwgaS5lLiB0aGUgY29udGVudCBzdGFydHMgd2l0aCB0aGUgc2FtZSB2YWx1ZXNcbiAgICBsZXQgb2xkUG9zID0gdGhpcy5leHRyYWN0Q29tbW9uKGJlc3RQYXRoWzBdLCBuZXdTdHJpbmcsIG9sZFN0cmluZywgMCk7XG4gICAgaWYgKGJlc3RQYXRoWzBdLm5ld1BvcyArIDEgPj0gbmV3TGVuICYmIG9sZFBvcyArIDEgPj0gb2xkTGVuKSB7XG4gICAgICAvLyBJZGVudGl0eSBwZXIgdGhlIGVxdWFsaXR5IGFuZCB0b2tlbml6ZXJcbiAgICAgIHJldHVybiBkb25lKFt7dmFsdWU6IHRoaXMuam9pbihuZXdTdHJpbmcpLCBjb3VudDogbmV3U3RyaW5nLmxlbmd0aH1dKTtcbiAgICB9XG5cbiAgICAvLyBNYWluIHdvcmtlciBtZXRob2QuIGNoZWNrcyBhbGwgcGVybXV0YXRpb25zIG9mIGEgZ2l2ZW4gZWRpdCBsZW5ndGggZm9yIGFjY2VwdGFuY2UuXG4gICAgZnVuY3Rpb24gZXhlY0VkaXRMZW5ndGgoKSB7XG4gICAgICBmb3IgKGxldCBkaWFnb25hbFBhdGggPSAtMSAqIGVkaXRMZW5ndGg7IGRpYWdvbmFsUGF0aCA8PSBlZGl0TGVuZ3RoOyBkaWFnb25hbFBhdGggKz0gMikge1xuICAgICAgICBsZXQgYmFzZVBhdGg7XG4gICAgICAgIGxldCBhZGRQYXRoID0gYmVzdFBhdGhbZGlhZ29uYWxQYXRoIC0gMV0sXG4gICAgICAgICAgICByZW1vdmVQYXRoID0gYmVzdFBhdGhbZGlhZ29uYWxQYXRoICsgMV0sXG4gICAgICAgICAgICBvbGRQb3MgPSAocmVtb3ZlUGF0aCA/IHJlbW92ZVBhdGgubmV3UG9zIDogMCkgLSBkaWFnb25hbFBhdGg7XG4gICAgICAgIGlmIChhZGRQYXRoKSB7XG4gICAgICAgICAgLy8gTm8gb25lIGVsc2UgaXMgZ29pbmcgdG8gYXR0ZW1wdCB0byB1c2UgdGhpcyB2YWx1ZSwgY2xlYXIgaXRcbiAgICAgICAgICBiZXN0UGF0aFtkaWFnb25hbFBhdGggLSAxXSA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBjYW5BZGQgPSBhZGRQYXRoICYmIGFkZFBhdGgubmV3UG9zICsgMSA8IG5ld0xlbixcbiAgICAgICAgICAgIGNhblJlbW92ZSA9IHJlbW92ZVBhdGggJiYgMCA8PSBvbGRQb3MgJiYgb2xkUG9zIDwgb2xkTGVuO1xuICAgICAgICBpZiAoIWNhbkFkZCAmJiAhY2FuUmVtb3ZlKSB7XG4gICAgICAgICAgLy8gSWYgdGhpcyBwYXRoIGlzIGEgdGVybWluYWwgdGhlbiBwcnVuZVxuICAgICAgICAgIGJlc3RQYXRoW2RpYWdvbmFsUGF0aF0gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZWxlY3QgdGhlIGRpYWdvbmFsIHRoYXQgd2Ugd2FudCB0byBicmFuY2ggZnJvbS4gV2Ugc2VsZWN0IHRoZSBwcmlvclxuICAgICAgICAvLyBwYXRoIHdob3NlIHBvc2l0aW9uIGluIHRoZSBuZXcgc3RyaW5nIGlzIHRoZSBmYXJ0aGVzdCBmcm9tIHRoZSBvcmlnaW5cbiAgICAgICAgLy8gYW5kIGRvZXMgbm90IHBhc3MgdGhlIGJvdW5kcyBvZiB0aGUgZGlmZiBncmFwaFxuICAgICAgICBpZiAoIWNhbkFkZCB8fCAoY2FuUmVtb3ZlICYmIGFkZFBhdGgubmV3UG9zIDwgcmVtb3ZlUGF0aC5uZXdQb3MpKSB7XG4gICAgICAgICAgYmFzZVBhdGggPSBjbG9uZVBhdGgocmVtb3ZlUGF0aCk7XG4gICAgICAgICAgc2VsZi5wdXNoQ29tcG9uZW50KGJhc2VQYXRoLmNvbXBvbmVudHMsIHVuZGVmaW5lZCwgdHJ1ZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYmFzZVBhdGggPSBhZGRQYXRoOyAgIC8vIE5vIG5lZWQgdG8gY2xvbmUsIHdlJ3ZlIHB1bGxlZCBpdCBmcm9tIHRoZSBsaXN0XG4gICAgICAgICAgYmFzZVBhdGgubmV3UG9zKys7XG4gICAgICAgICAgc2VsZi5wdXNoQ29tcG9uZW50KGJhc2VQYXRoLmNvbXBvbmVudHMsIHRydWUsIHVuZGVmaW5lZCk7XG4gICAgICAgIH1cblxuICAgICAgICBvbGRQb3MgPSBzZWxmLmV4dHJhY3RDb21tb24oYmFzZVBhdGgsIG5ld1N0cmluZywgb2xkU3RyaW5nLCBkaWFnb25hbFBhdGgpO1xuXG4gICAgICAgIC8vIElmIHdlIGhhdmUgaGl0IHRoZSBlbmQgb2YgYm90aCBzdHJpbmdzLCB0aGVuIHdlIGFyZSBkb25lXG4gICAgICAgIGlmIChiYXNlUGF0aC5uZXdQb3MgKyAxID49IG5ld0xlbiAmJiBvbGRQb3MgKyAxID49IG9sZExlbikge1xuICAgICAgICAgIHJldHVybiBkb25lKGJ1aWxkVmFsdWVzKHNlbGYsIGJhc2VQYXRoLmNvbXBvbmVudHMsIG5ld1N0cmluZywgb2xkU3RyaW5nLCBzZWxmLnVzZUxvbmdlc3RUb2tlbikpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIE90aGVyd2lzZSB0cmFjayB0aGlzIHBhdGggYXMgYSBwb3RlbnRpYWwgY2FuZGlkYXRlIGFuZCBjb250aW51ZS5cbiAgICAgICAgICBiZXN0UGF0aFtkaWFnb25hbFBhdGhdID0gYmFzZVBhdGg7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgZWRpdExlbmd0aCsrO1xuICAgIH1cblxuICAgIC8vIFBlcmZvcm1zIHRoZSBsZW5ndGggb2YgZWRpdCBpdGVyYXRpb24uIElzIGEgYml0IGZ1Z2x5IGFzIHRoaXMgaGFzIHRvIHN1cHBvcnQgdGhlXG4gICAgLy8gc3luYyBhbmQgYXN5bmMgbW9kZSB3aGljaCBpcyBuZXZlciBmdW4uIExvb3BzIG92ZXIgZXhlY0VkaXRMZW5ndGggdW50aWwgYSB2YWx1ZVxuICAgIC8vIGlzIHByb2R1Y2VkLlxuICAgIGlmIChjYWxsYmFjaykge1xuICAgICAgKGZ1bmN0aW9uIGV4ZWMoKSB7XG4gICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgLy8gVGhpcyBzaG91bGQgbm90IGhhcHBlbiwgYnV0IHdlIHdhbnQgdG8gYmUgc2FmZS5cbiAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgICAgICAgIGlmIChlZGl0TGVuZ3RoID4gbWF4RWRpdExlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCFleGVjRWRpdExlbmd0aCgpKSB7XG4gICAgICAgICAgICBleGVjKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9LCAwKTtcbiAgICAgIH0oKSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHdoaWxlIChlZGl0TGVuZ3RoIDw9IG1heEVkaXRMZW5ndGgpIHtcbiAgICAgICAgbGV0IHJldCA9IGV4ZWNFZGl0TGVuZ3RoKCk7XG4gICAgICAgIGlmIChyZXQpIHtcbiAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9LFxuXG4gIHB1c2hDb21wb25lbnQoY29tcG9uZW50cywgYWRkZWQsIHJlbW92ZWQpIHtcbiAgICBsZXQgbGFzdCA9IGNvbXBvbmVudHNbY29tcG9uZW50cy5sZW5ndGggLSAxXTtcbiAgICBpZiAobGFzdCAmJiBsYXN0LmFkZGVkID09PSBhZGRlZCAmJiBsYXN0LnJlbW92ZWQgPT09IHJlbW92ZWQpIHtcbiAgICAgIC8vIFdlIG5lZWQgdG8gY2xvbmUgaGVyZSBhcyB0aGUgY29tcG9uZW50IGNsb25lIG9wZXJhdGlvbiBpcyBqdXN0XG4gICAgICAvLyBhcyBzaGFsbG93IGFycmF5IGNsb25lXG4gICAgICBjb21wb25lbnRzW2NvbXBvbmVudHMubGVuZ3RoIC0gMV0gPSB7Y291bnQ6IGxhc3QuY291bnQgKyAxLCBhZGRlZDogYWRkZWQsIHJlbW92ZWQ6IHJlbW92ZWQgfTtcbiAgICB9IGVsc2Uge1xuICAgICAgY29tcG9uZW50cy5wdXNoKHtjb3VudDogMSwgYWRkZWQ6IGFkZGVkLCByZW1vdmVkOiByZW1vdmVkIH0pO1xuICAgIH1cbiAgfSxcbiAgZXh0cmFjdENvbW1vbihiYXNlUGF0aCwgbmV3U3RyaW5nLCBvbGRTdHJpbmcsIGRpYWdvbmFsUGF0aCkge1xuICAgIGxldCBuZXdMZW4gPSBuZXdTdHJpbmcubGVuZ3RoLFxuICAgICAgICBvbGRMZW4gPSBvbGRTdHJpbmcubGVuZ3RoLFxuICAgICAgICBuZXdQb3MgPSBiYXNlUGF0aC5uZXdQb3MsXG4gICAgICAgIG9sZFBvcyA9IG5ld1BvcyAtIGRpYWdvbmFsUGF0aCxcblxuICAgICAgICBjb21tb25Db3VudCA9IDA7XG4gICAgd2hpbGUgKG5ld1BvcyArIDEgPCBuZXdMZW4gJiYgb2xkUG9zICsgMSA8IG9sZExlbiAmJiB0aGlzLmVxdWFscyhuZXdTdHJpbmdbbmV3UG9zICsgMV0sIG9sZFN0cmluZ1tvbGRQb3MgKyAxXSkpIHtcbiAgICAgIG5ld1BvcysrO1xuICAgICAgb2xkUG9zKys7XG4gICAgICBjb21tb25Db3VudCsrO1xuICAgIH1cblxuICAgIGlmIChjb21tb25Db3VudCkge1xuICAgICAgYmFzZVBhdGguY29tcG9uZW50cy5wdXNoKHtjb3VudDogY29tbW9uQ291bnR9KTtcbiAgICB9XG5cbiAgICBiYXNlUGF0aC5uZXdQb3MgPSBuZXdQb3M7XG4gICAgcmV0dXJuIG9sZFBvcztcbiAgfSxcblxuICBlcXVhbHMobGVmdCwgcmlnaHQpIHtcbiAgICByZXR1cm4gbGVmdCA9PT0gcmlnaHQ7XG4gIH0sXG4gIHJlbW92ZUVtcHR5KGFycmF5KSB7XG4gICAgbGV0IHJldCA9IFtdO1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgIGlmIChhcnJheVtpXSkge1xuICAgICAgICByZXQucHVzaChhcnJheVtpXSk7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXQ7XG4gIH0sXG4gIGNhc3RJbnB1dCh2YWx1ZSkge1xuICAgIHJldHVybiB2YWx1ZTtcbiAgfSxcbiAgdG9rZW5pemUodmFsdWUpIHtcbiAgICByZXR1cm4gdmFsdWUuc3BsaXQoJycpO1xuICB9LFxuICBqb2luKGNoYXJzKSB7XG4gICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpO1xuICB9XG59O1xuXG5mdW5jdGlvbiBidWlsZFZhbHVlcyhkaWZmLCBjb21wb25lbnRzLCBuZXdTdHJpbmcsIG9sZFN0cmluZywgdXNlTG9uZ2VzdFRva2VuKSB7XG4gIGxldCBjb21wb25lbnRQb3MgPSAwLFxuICAgICAgY29tcG9uZW50TGVuID0gY29tcG9uZW50cy5sZW5ndGgsXG4gICAgICBuZXdQb3MgPSAwLFxuICAgICAgb2xkUG9zID0gMDtcblxuICBmb3IgKDsgY29tcG9uZW50UG9zIDwgY29tcG9uZW50TGVuOyBjb21wb25lbnRQb3MrKykge1xuICAgIGxldCBjb21wb25lbnQgPSBjb21wb25lbnRzW2NvbXBvbmVudFBvc107XG4gICAgaWYgKCFjb21wb25lbnQucmVtb3ZlZCkge1xuICAgICAgaWYgKCFjb21wb25lbnQuYWRkZWQgJiYgdXNlTG9uZ2VzdFRva2VuKSB7XG4gICAgICAgIGxldCB2YWx1ZSA9IG5ld1N0cmluZy5zbGljZShuZXdQb3MsIG5ld1BvcyArIGNvbXBvbmVudC5jb3VudCk7XG4gICAgICAgIHZhbHVlID0gdmFsdWUubWFwKGZ1bmN0aW9uKHZhbHVlLCBpKSB7XG4gICAgICAgICAgbGV0IG9sZFZhbHVlID0gb2xkU3RyaW5nW29sZFBvcyArIGldO1xuICAgICAgICAgIHJldHVybiBvbGRWYWx1ZS5sZW5ndGggPiB2YWx1ZS5sZW5ndGggPyBvbGRWYWx1ZSA6IHZhbHVlO1xuICAgICAgICB9KTtcblxuICAgICAgICBjb21wb25lbnQudmFsdWUgPSBkaWZmLmpvaW4odmFsdWUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29tcG9uZW50LnZhbHVlID0gZGlmZi5qb2luKG5ld1N0cmluZy5zbGljZShuZXdQb3MsIG5ld1BvcyArIGNvbXBvbmVudC5jb3VudCkpO1xuICAgICAgfVxuICAgICAgbmV3UG9zICs9IGNvbXBvbmVudC5jb3VudDtcblxuICAgICAgLy8gQ29tbW9uIGNhc2VcbiAgICAgIGlmICghY29tcG9uZW50LmFkZGVkKSB7XG4gICAgICAgIG9sZFBvcyArPSBjb21wb25lbnQuY291bnQ7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbXBvbmVudC52YWx1ZSA9IGRpZmYuam9pbihvbGRTdHJpbmcuc2xpY2Uob2xkUG9zLCBvbGRQb3MgKyBjb21wb25lbnQuY291bnQpKTtcbiAgICAgIG9sZFBvcyArPSBjb21wb25lbnQuY291bnQ7XG5cbiAgICAgIC8vIFJldmVyc2UgYWRkIGFuZCByZW1vdmUgc28gcmVtb3ZlcyBhcmUgb3V0cHV0IGZpcnN0IHRvIG1hdGNoIGNvbW1vbiBjb252ZW50aW9uXG4gICAgICAvLyBUaGUgZGlmZmluZyBhbGdvcml0aG0gaXMgdGllZCB0byBhZGQgdGhlbiByZW1vdmUgb3V0cHV0IGFuZCB0aGlzIGlzIHRoZSBzaW1wbGVzdFxuICAgICAgLy8gcm91dGUgdG8gZ2V0IHRoZSBkZXNpcmVkIG91dHB1dCB3aXRoIG1pbmltYWwgb3ZlcmhlYWQuXG4gICAgICBpZiAoY29tcG9uZW50UG9zICYmIGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV0uYWRkZWQpIHtcbiAgICAgICAgbGV0IHRtcCA9IGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV07XG4gICAgICAgIGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV0gPSBjb21wb25lbnRzW2NvbXBvbmVudFBvc107XG4gICAgICAgIGNvbXBvbmVudHNbY29tcG9uZW50UG9zXSA9IHRtcDtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvLyBTcGVjaWFsIGNhc2UgaGFuZGxlIGZvciB3aGVuIG9uZSB0ZXJtaW5hbCBpcyBpZ25vcmVkLiBGb3IgdGhpcyBjYXNlIHdlIG1lcmdlIHRoZVxuICAvLyB0ZXJtaW5hbCBpbnRvIHRoZSBwcmlvciBzdHJpbmcgYW5kIGRyb3AgdGhlIGNoYW5nZS5cbiAgbGV0IGxhc3RDb21wb25lbnQgPSBjb21wb25lbnRzW2NvbXBvbmVudExlbiAtIDFdO1xuICBpZiAoY29tcG9uZW50TGVuID4gMVxuICAgICAgJiYgKGxhc3RDb21wb25lbnQuYWRkZWQgfHwgbGFzdENvbXBvbmVudC5yZW1vdmVkKVxuICAgICAgJiYgZGlmZi5lcXVhbHMoJycsIGxhc3RDb21wb25lbnQudmFsdWUpKSB7XG4gICAgY29tcG9uZW50c1tjb21wb25lbnRMZW4gLSAyXS52YWx1ZSArPSBsYXN0Q29tcG9uZW50LnZhbHVlO1xuICAgIGNvbXBvbmVudHMucG9wKCk7XG4gIH1cblxuICByZXR1cm4gY29tcG9uZW50cztcbn1cblxuZnVuY3Rpb24gY2xvbmVQYXRoKHBhdGgpIHtcbiAgcmV0dXJuIHsgbmV3UG9zOiBwYXRoLm5ld1BvcywgY29tcG9uZW50czogcGF0aC5jb21wb25lbnRzLnNsaWNlKDApIH07XG59XG4iXX0=
-
-
-/***/ },
-/* 141 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports.characterDiff = undefined;
- exports. /*istanbul ignore end*/diffChars = diffChars;
-
- var /*istanbul ignore start*/_base = __webpack_require__(140) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _base2 = _interopRequireDefault(_base);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/;
- function diffChars(oldStr, newStr, callback) {
- return characterDiff.diff(oldStr, newStr, callback);
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O2dDQUdnQixTLEdBQUEsUzs7QUFIaEIsSSx5QkFBQSx5Qix3QkFBQTs7Ozs7Ozt1QkFFTyxJQUFNLGdCLHlCQUFBLFEsd0JBQUEsZ0JBQWdCLEkseUJBQUEsbUIsd0JBQXRCO0FBQ0EsU0FBUyxTQUFULENBQW1CLE1BQW5CLEVBQTJCLE1BQTNCLEVBQW1DLFFBQW5DLEVBQTZDO0FBQUUsU0FBTyxjQUFjLElBQWQsQ0FBbUIsTUFBbkIsRUFBMkIsTUFBM0IsRUFBbUMsUUFBbkMsQ0FBUDtBQUFzRCIsImZpbGUiOiJjaGFyYWN0ZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuXG5leHBvcnQgY29uc3QgY2hhcmFjdGVyRGlmZiA9IG5ldyBEaWZmKCk7XG5leHBvcnQgZnVuY3Rpb24gZGlmZkNoYXJzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gY2hhcmFjdGVyRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ==
-
-
-/***/ },
-/* 142 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports.wordDiff = undefined;
- exports. /*istanbul ignore end*/diffWords = diffWords;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace;
-
- var /*istanbul ignore start*/_base = __webpack_require__(140) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _base2 = _interopRequireDefault(_base);
-
- /*istanbul ignore end*/
- var /*istanbul ignore start*/_params = __webpack_require__(143) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- /*istanbul ignore end*/
-
- // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
- //
- // Ranges and exceptions:
- // Latin-1 Supplement, 0080–00FF
- // - U+00D7 × Multiplication sign
- // - U+00F7 ÷ Division sign
- // Latin Extended-A, 0100–017F
- // Latin Extended-B, 0180–024F
- // IPA Extensions, 0250–02AF
- // Spacing Modifier Letters, 02B0–02FF
- // - U+02C7 ˇ ˇ Caron
- // - U+02D8 ˘ ˘ Breve
- // - U+02D9 ˙ ˙ Dot Above
- // - U+02DA ˚ ˚ Ring Above
- // - U+02DB ˛ ˛ Ogonek
- // - U+02DC ˜ ˜ Small Tilde
- // - U+02DD ˝ ˝ Double Acute Accent
- // Latin Extended Additional, 1E00–1EFF
- var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
-
- var reWhitespace = /\S/;
-
- var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/;
- wordDiff.equals = function (left, right) {
- return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
- };
- wordDiff.tokenize = function (value) {
- var tokens = value.split(/(\s+|\b)/);
-
- // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
- for (var i = 0; i < tokens.length - 1; i++) {
- // If we have an empty string in the next field and we have only word chars before and after, merge
- if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
- tokens[i] += tokens[i + 2];
- tokens.splice(i + 1, 2);
- i--;
- }
- }
-
- return tokens;
- };
-
- function diffWords(oldStr, newStr, callback) {
- var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
- return wordDiff.diff(oldStr, newStr, options);
- }
- function diffWordsWithSpace(oldStr, newStr, callback) {
- return wordDiff.diff(oldStr, newStr, callback);
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztnQ0ErQ2dCLFMsR0FBQSxTO3lEQUlBLGtCLEdBQUEsa0I7O0FBbkRoQixJLHlCQUFBLHlCLHdCQUFBOzs7Ozs7QUFDQSxJLHlCQUFBLG1DLHdCQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0JBLElBQU0sb0JBQW9CLCtEQUExQjs7QUFFQSxJQUFNLGVBQWUsSUFBckI7O0FBRU8sSUFBTSxXLHlCQUFBLFEsd0JBQUEsV0FBVyxJLHlCQUFBLG1CLHdCQUFqQjtBQUNQLFNBQVMsTUFBVCxHQUFrQixVQUFTLElBQVQsRUFBZSxLQUFmLEVBQXNCO0FBQ3RDLFNBQU8sU0FBUyxLQUFULElBQW1CLEtBQUssT0FBTCxDQUFhLGdCQUFiLElBQWlDLENBQUMsYUFBYSxJQUFiLENBQWtCLElBQWxCLENBQWxDLElBQTZELENBQUMsYUFBYSxJQUFiLENBQWtCLEtBQWxCLENBQXhGO0FBQ0QsQ0FGRDtBQUdBLFNBQVMsUUFBVCxHQUFvQixVQUFTLEtBQVQsRUFBZ0I7QUFDbEMsTUFBSSxTQUFTLE1BQU0sS0FBTixDQUFZLFVBQVosQ0FBYjs7O0FBR0EsT0FBSyxJQUFJLElBQUksQ0FBYixFQUFnQixJQUFJLE9BQU8sTUFBUCxHQUFnQixDQUFwQyxFQUF1QyxHQUF2QyxFQUE0Qzs7QUFFMUMsUUFBSSxDQUFDLE9BQU8sSUFBSSxDQUFYLENBQUQsSUFBa0IsT0FBTyxJQUFJLENBQVgsQ0FBbEIsSUFDSyxrQkFBa0IsSUFBbEIsQ0FBdUIsT0FBTyxDQUFQLENBQXZCLENBREwsSUFFSyxrQkFBa0IsSUFBbEIsQ0FBdUIsT0FBTyxJQUFJLENBQVgsQ0FBdkIsQ0FGVCxFQUVnRDtBQUM5QyxhQUFPLENBQVAsS0FBYSxPQUFPLElBQUksQ0FBWCxDQUFiO0FBQ0EsYUFBTyxNQUFQLENBQWMsSUFBSSxDQUFsQixFQUFxQixDQUFyQjtBQUNBO0FBQ0Q7QUFDRjs7QUFFRCxTQUFPLE1BQVA7QUFDRCxDQWhCRDs7QUFrQk8sU0FBUyxTQUFULENBQW1CLE1BQW5CLEVBQTJCLE1BQTNCLEVBQW1DLFFBQW5DLEVBQTZDO0FBQ2xELE1BQUksVSx5QkFBVSw0Qix3QkFBQSxDQUFnQixRQUFoQixFQUEwQixFQUFDLGtCQUFrQixJQUFuQixFQUExQixDQUFkO0FBQ0EsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLE9BQTlCLENBQVA7QUFDRDtBQUNNLFNBQVMsa0JBQVQsQ0FBNEIsTUFBNUIsRUFBb0MsTUFBcEMsRUFBNEMsUUFBNUMsRUFBc0Q7QUFDM0QsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLFFBQTlCLENBQVA7QUFDRCIsImZpbGUiOiJ3b3JkLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcbmltcG9ydCB7Z2VuZXJhdGVPcHRpb25zfSBmcm9tICcuLi91dGlsL3BhcmFtcyc7XG5cbi8vIEJhc2VkIG9uIGh0dHBzOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL0xhdGluX3NjcmlwdF9pbl9Vbmljb2RlXG4vL1xuLy8gUmFuZ2VzIGFuZCBleGNlcHRpb25zOlxuLy8gTGF0aW4tMSBTdXBwbGVtZW50LCAwMDgw4oCTMDBGRlxuLy8gIC0gVSswMEQ3ICDDlyBNdWx0aXBsaWNhdGlvbiBzaWduXG4vLyAgLSBVKzAwRjcgIMO3IERpdmlzaW9uIHNpZ25cbi8vIExhdGluIEV4dGVuZGVkLUEsIDAxMDDigJMwMTdGXG4vLyBMYXRpbiBFeHRlbmRlZC1CLCAwMTgw4oCTMDI0RlxuLy8gSVBBIEV4dGVuc2lvbnMsIDAyNTDigJMwMkFGXG4vLyBTcGFjaW5nIE1vZGlmaWVyIExldHRlcnMsIDAyQjDigJMwMkZGXG4vLyAgLSBVKzAyQzcgIMuHICYjNzExOyAgQ2Fyb25cbi8vICAtIFUrMDJEOCAgy5ggJiM3Mjg7ICBCcmV2ZVxuLy8gIC0gVSswMkQ5ICDLmSAmIzcyOTsgIERvdCBBYm92ZVxuLy8gIC0gVSswMkRBICDLmiAmIzczMDsgIFJpbmcgQWJvdmVcbi8vICAtIFUrMDJEQiAgy5sgJiM3MzE7ICBPZ29uZWtcbi8vICAtIFUrMDJEQyAgy5wgJiM3MzI7ICBTbWFsbCBUaWxkZVxuLy8gIC0gVSswMkREICDLnSAmIzczMzsgIERvdWJsZSBBY3V0ZSBBY2NlbnRcbi8vIExhdGluIEV4dGVuZGVkIEFkZGl0aW9uYWwsIDFFMDDigJMxRUZGXG5jb25zdCBleHRlbmRlZFdvcmRDaGFycyA9IC9eW2EtekEtWlxcdXtDMH0tXFx1e0ZGfVxcdXtEOH0tXFx1e0Y2fVxcdXtGOH0tXFx1ezJDNn1cXHV7MkM4fS1cXHV7MkQ3fVxcdXsyREV9LVxcdXsyRkZ9XFx1ezFFMDB9LVxcdXsxRUZGfV0rJC91O1xuXG5jb25zdCByZVdoaXRlc3BhY2UgPSAvXFxTLztcblxuZXhwb3J0IGNvbnN0IHdvcmREaWZmID0gbmV3IERpZmYoKTtcbndvcmREaWZmLmVxdWFscyA9IGZ1bmN0aW9uKGxlZnQsIHJpZ2h0KSB7XG4gIHJldHVybiBsZWZ0ID09PSByaWdodCB8fCAodGhpcy5vcHRpb25zLmlnbm9yZVdoaXRlc3BhY2UgJiYgIXJlV2hpdGVzcGFjZS50ZXN0KGxlZnQpICYmICFyZVdoaXRlc3BhY2UudGVzdChyaWdodCkpO1xufTtcbndvcmREaWZmLnRva2VuaXplID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgbGV0IHRva2VucyA9IHZhbHVlLnNwbGl0KC8oXFxzK3xcXGIpLyk7XG5cbiAgLy8gSm9pbiB0aGUgYm91bmRhcnkgc3BsaXRzIHRoYXQgd2UgZG8gbm90IGNvbnNpZGVyIHRvIGJlIGJvdW5kYXJpZXMuIFRoaXMgaXMgcHJpbWFyaWx5IHRoZSBleHRlbmRlZCBMYXRpbiBjaGFyYWN0ZXIgc2V0LlxuICBmb3IgKGxldCBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGggLSAxOyBpKyspIHtcbiAgICAvLyBJZiB3ZSBoYXZlIGFuIGVtcHR5IHN0cmluZyBpbiB0aGUgbmV4dCBmaWVsZCBhbmQgd2UgaGF2ZSBvbmx5IHdvcmQgY2hhcnMgYmVmb3JlIGFuZCBhZnRlciwgbWVyZ2VcbiAgICBpZiAoIXRva2Vuc1tpICsgMV0gJiYgdG9rZW5zW2kgKyAyXVxuICAgICAgICAgICYmIGV4dGVuZGVkV29yZENoYXJzLnRlc3QodG9rZW5zW2ldKVxuICAgICAgICAgICYmIGV4dGVuZGVkV29yZENoYXJzLnRlc3QodG9rZW5zW2kgKyAyXSkpIHtcbiAgICAgIHRva2Vuc1tpXSArPSB0b2tlbnNbaSArIDJdO1xuICAgICAgdG9rZW5zLnNwbGljZShpICsgMSwgMik7XG4gICAgICBpLS07XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHRva2Vucztcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmV29yZHMob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7XG4gIGxldCBvcHRpb25zID0gZ2VuZXJhdGVPcHRpb25zKGNhbGxiYWNrLCB7aWdub3JlV2hpdGVzcGFjZTogdHJ1ZX0pO1xuICByZXR1cm4gd29yZERpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG59XG5leHBvcnQgZnVuY3Rpb24gZGlmZldvcmRzV2l0aFNwYWNlKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykge1xuICByZXR1cm4gd29yZERpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spO1xufVxuIl19
-
-
-/***/ },
-/* 143 */
-/***/ function(module, exports) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports. /*istanbul ignore end*/generateOptions = generateOptions;
- function generateOptions(options, defaults) {
- if (typeof options === 'function') {
- defaults.callback = options;
- } else if (options) {
- for (var name in options) {
- /* istanbul ignore else */
- if (options.hasOwnProperty(name)) {
- defaults[name] = options[name];
- }
- }
- }
- return defaults;
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCLGUsR0FBQSxlO0FBQVQsU0FBUyxlQUFULENBQXlCLE9BQXpCLEVBQWtDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBTyxPQUFQLEtBQW1CLFVBQXZCLEVBQW1DO0FBQ2pDLGFBQVMsUUFBVCxHQUFvQixPQUFwQjtBQUNELEdBRkQsTUFFTyxJQUFJLE9BQUosRUFBYTtBQUNsQixTQUFLLElBQUksSUFBVCxJQUFpQixPQUFqQixFQUEwQjs7QUFFeEIsVUFBSSxRQUFRLGNBQVIsQ0FBdUIsSUFBdkIsQ0FBSixFQUFrQztBQUNoQyxpQkFBUyxJQUFULElBQWlCLFFBQVEsSUFBUixDQUFqQjtBQUNEO0FBQ0Y7QUFDRjtBQUNELFNBQU8sUUFBUDtBQUNEIiwiZmlsZSI6InBhcmFtcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBnZW5lcmF0ZU9wdGlvbnMob3B0aW9ucywgZGVmYXVsdHMpIHtcbiAgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgZGVmYXVsdHMuY2FsbGJhY2sgPSBvcHRpb25zO1xuICB9IGVsc2UgaWYgKG9wdGlvbnMpIHtcbiAgICBmb3IgKGxldCBuYW1lIGluIG9wdGlvbnMpIHtcbiAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICBpZiAob3B0aW9ucy5oYXNPd25Qcm9wZXJ0eShuYW1lKSkge1xuICAgICAgICBkZWZhdWx0c1tuYW1lXSA9IG9wdGlvbnNbbmFtZV07XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBkZWZhdWx0cztcbn1cbiJdfQ==
-
-
-/***/ },
-/* 144 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports.lineDiff = undefined;
- exports. /*istanbul ignore end*/diffLines = diffLines;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines;
-
- var /*istanbul ignore start*/_base = __webpack_require__(140) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _base2 = _interopRequireDefault(_base);
-
- /*istanbul ignore end*/
- var /*istanbul ignore start*/_params = __webpack_require__(143) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/;
- lineDiff.tokenize = function (value) {
- var retLines = [],
- linesAndNewlines = value.split(/(\n|\r\n)/);
-
- // Ignore the final empty token that occurs if the string ends with a new line
- if (!linesAndNewlines[linesAndNewlines.length - 1]) {
- linesAndNewlines.pop();
- }
-
- // Merge the content and line separators into single tokens
- for (var i = 0; i < linesAndNewlines.length; i++) {
- var line = linesAndNewlines[i];
-
- if (i % 2 && !this.options.newlineIsToken) {
- retLines[retLines.length - 1] += line;
- } else {
- if (this.options.ignoreWhitespace) {
- line = line.trim();
- }
- retLines.push(line);
- }
- }
-
- return retLines;
- };
-
- function diffLines(oldStr, newStr, callback) {
- return lineDiff.diff(oldStr, newStr, callback);
- }
- function diffTrimmedLines(oldStr, newStr, callback) {
- var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
- return lineDiff.diff(oldStr, newStr, options);
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztnQ0E4QmdCLFMsR0FBQSxTO3lEQUNBLGdCLEdBQUEsZ0I7O0FBL0JoQixJLHlCQUFBLHlCLHdCQUFBOzs7Ozs7QUFDQSxJLHlCQUFBLG1DLHdCQUFBOzs7Ozt1QkFFTyxJQUFNLFcseUJBQUEsUSx3QkFBQSxXQUFXLEkseUJBQUEsbUIsd0JBQWpCO0FBQ1AsU0FBUyxRQUFULEdBQW9CLFVBQVMsS0FBVCxFQUFnQjtBQUNsQyxNQUFJLFdBQVcsRUFBZjtBQUFBLE1BQ0ksbUJBQW1CLE1BQU0sS0FBTixDQUFZLFdBQVosQ0FEdkI7OztBQUlBLE1BQUksQ0FBQyxpQkFBaUIsaUJBQWlCLE1BQWpCLEdBQTBCLENBQTNDLENBQUwsRUFBb0Q7QUFDbEQscUJBQWlCLEdBQWpCO0FBQ0Q7OztBQUdELE9BQUssSUFBSSxJQUFJLENBQWIsRUFBZ0IsSUFBSSxpQkFBaUIsTUFBckMsRUFBNkMsR0FBN0MsRUFBa0Q7QUFDaEQsUUFBSSxPQUFPLGlCQUFpQixDQUFqQixDQUFYOztBQUVBLFFBQUksSUFBSSxDQUFKLElBQVMsQ0FBQyxLQUFLLE9BQUwsQ0FBYSxjQUEzQixFQUEyQztBQUN6QyxlQUFTLFNBQVMsTUFBVCxHQUFrQixDQUEzQixLQUFpQyxJQUFqQztBQUNELEtBRkQsTUFFTztBQUNMLFVBQUksS0FBSyxPQUFMLENBQWEsZ0JBQWpCLEVBQW1DO0FBQ2pDLGVBQU8sS0FBSyxJQUFMLEVBQVA7QUFDRDtBQUNELGVBQVMsSUFBVCxDQUFjLElBQWQ7QUFDRDtBQUNGOztBQUVELFNBQU8sUUFBUDtBQUNELENBeEJEOztBQTBCTyxTQUFTLFNBQVQsQ0FBbUIsTUFBbkIsRUFBMkIsTUFBM0IsRUFBbUMsUUFBbkMsRUFBNkM7QUFBRSxTQUFPLFNBQVMsSUFBVCxDQUFjLE1BQWQsRUFBc0IsTUFBdEIsRUFBOEIsUUFBOUIsQ0FBUDtBQUFpRDtBQUNoRyxTQUFTLGdCQUFULENBQTBCLE1BQTFCLEVBQWtDLE1BQWxDLEVBQTBDLFFBQTFDLEVBQW9EO0FBQ3pELE1BQUksVSx5QkFBVSw0Qix3QkFBQSxDQUFnQixRQUFoQixFQUEwQixFQUFDLGtCQUFrQixJQUFuQixFQUExQixDQUFkO0FBQ0EsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLE9BQTlCLENBQVA7QUFDRCIsImZpbGUiOiJsaW5lLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcbmltcG9ydCB7Z2VuZXJhdGVPcHRpb25zfSBmcm9tICcuLi91dGlsL3BhcmFtcyc7XG5cbmV4cG9ydCBjb25zdCBsaW5lRGlmZiA9IG5ldyBEaWZmKCk7XG5saW5lRGlmZi50b2tlbml6ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gIGxldCByZXRMaW5lcyA9IFtdLFxuICAgICAgbGluZXNBbmROZXdsaW5lcyA9IHZhbHVlLnNwbGl0KC8oXFxufFxcclxcbikvKTtcblxuICAvLyBJZ25vcmUgdGhlIGZpbmFsIGVtcHR5IHRva2VuIHRoYXQgb2NjdXJzIGlmIHRoZSBzdHJpbmcgZW5kcyB3aXRoIGEgbmV3IGxpbmVcbiAgaWYgKCFsaW5lc0FuZE5ld2xpbmVzW2xpbmVzQW5kTmV3bGluZXMubGVuZ3RoIC0gMV0pIHtcbiAgICBsaW5lc0FuZE5ld2xpbmVzLnBvcCgpO1xuICB9XG5cbiAgLy8gTWVyZ2UgdGhlIGNvbnRlbnQgYW5kIGxpbmUgc2VwYXJhdG9ycyBpbnRvIHNpbmdsZSB0b2tlbnNcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaW5lc0FuZE5ld2xpbmVzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGxpbmUgPSBsaW5lc0FuZE5ld2xpbmVzW2ldO1xuXG4gICAgaWYgKGkgJSAyICYmICF0aGlzLm9wdGlvbnMubmV3bGluZUlzVG9rZW4pIHtcbiAgICAgIHJldExpbmVzW3JldExpbmVzLmxlbmd0aCAtIDFdICs9IGxpbmU7XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmICh0aGlzLm9wdGlvbnMuaWdub3JlV2hpdGVzcGFjZSkge1xuICAgICAgICBsaW5lID0gbGluZS50cmltKCk7XG4gICAgICB9XG4gICAgICByZXRMaW5lcy5wdXNoKGxpbmUpO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiByZXRMaW5lcztcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmTGluZXMob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7IHJldHVybiBsaW5lRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbmV4cG9ydCBmdW5jdGlvbiBkaWZmVHJpbW1lZExpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykge1xuICBsZXQgb3B0aW9ucyA9IGdlbmVyYXRlT3B0aW9ucyhjYWxsYmFjaywge2lnbm9yZVdoaXRlc3BhY2U6IHRydWV9KTtcbiAgcmV0dXJuIGxpbmVEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIG9wdGlvbnMpO1xufVxuIl19
-
-
-/***/ },
-/* 145 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports.sentenceDiff = undefined;
- exports. /*istanbul ignore end*/diffSentences = diffSentences;
-
- var /*istanbul ignore start*/_base = __webpack_require__(140) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _base2 = _interopRequireDefault(_base);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/;
- sentenceDiff.tokenize = function (value) {
- return value.split(/(\S.+?[.!?])(?=\s+|$)/);
- };
-
- function diffSentences(oldStr, newStr, callback) {
- return sentenceDiff.diff(oldStr, newStr, callback);
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3NlbnRlbmNlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Z0NBUWdCLGEsR0FBQSxhOztBQVJoQixJLHlCQUFBLHlCLHdCQUFBOzs7Ozs7O3VCQUdPLElBQU0sZSx5QkFBQSxRLHdCQUFBLGVBQWUsSSx5QkFBQSxtQix3QkFBckI7QUFDUCxhQUFhLFFBQWIsR0FBd0IsVUFBUyxLQUFULEVBQWdCO0FBQ3RDLFNBQU8sTUFBTSxLQUFOLENBQVksdUJBQVosQ0FBUDtBQUNELENBRkQ7O0FBSU8sU0FBUyxhQUFULENBQXVCLE1BQXZCLEVBQStCLE1BQS9CLEVBQXVDLFFBQXZDLEVBQWlEO0FBQUUsU0FBTyxhQUFhLElBQWIsQ0FBa0IsTUFBbEIsRUFBMEIsTUFBMUIsRUFBa0MsUUFBbEMsQ0FBUDtBQUFxRCIsImZpbGUiOiJzZW50ZW5jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cblxuZXhwb3J0IGNvbnN0IHNlbnRlbmNlRGlmZiA9IG5ldyBEaWZmKCk7XG5zZW50ZW5jZURpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhcXFMuKz9bLiE/XSkoPz1cXHMrfCQpLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZlNlbnRlbmNlcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIHNlbnRlbmNlRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ==
-
-
-/***/ },
-/* 146 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports.cssDiff = undefined;
- exports. /*istanbul ignore end*/diffCss = diffCss;
-
- var /*istanbul ignore start*/_base = __webpack_require__(140) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _base2 = _interopRequireDefault(_base);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/;
- cssDiff.tokenize = function (value) {
- return value.split(/([{}:;,]|\s+)/);
- };
-
- function diffCss(oldStr, newStr, callback) {
- return cssDiff.diff(oldStr, newStr, callback);
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O2dDQU9nQixPLEdBQUEsTzs7QUFQaEIsSSx5QkFBQSx5Qix3QkFBQTs7Ozs7Ozt1QkFFTyxJQUFNLFUseUJBQUEsUSx3QkFBQSxVQUFVLEkseUJBQUEsbUIsd0JBQWhCO0FBQ1AsUUFBUSxRQUFSLEdBQW1CLFVBQVMsS0FBVCxFQUFnQjtBQUNqQyxTQUFPLE1BQU0sS0FBTixDQUFZLGVBQVosQ0FBUDtBQUNELENBRkQ7O0FBSU8sU0FBUyxPQUFULENBQWlCLE1BQWpCLEVBQXlCLE1BQXpCLEVBQWlDLFFBQWpDLEVBQTJDO0FBQUUsU0FBTyxRQUFRLElBQVIsQ0FBYSxNQUFiLEVBQXFCLE1BQXJCLEVBQTZCLFFBQTdCLENBQVA7QUFBZ0QiLCJmaWxlIjoiY3NzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcblxuZXhwb3J0IGNvbnN0IGNzc0RpZmYgPSBuZXcgRGlmZigpO1xuY3NzRGlmZi50b2tlbml6ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gIHJldHVybiB2YWx1ZS5zcGxpdCgvKFt7fTo7LF18XFxzKykvKTtcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmQ3NzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gY3NzRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ==
-
-
-/***/ },
-/* 147 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports.jsonDiff = undefined;
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
-
- exports. /*istanbul ignore end*/diffJson = diffJson;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize;
-
- var /*istanbul ignore start*/_base = __webpack_require__(140) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _base2 = _interopRequireDefault(_base);
-
- /*istanbul ignore end*/
- var /*istanbul ignore start*/_line = __webpack_require__(144) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- /*istanbul ignore end*/
-
- var objectPrototypeToString = Object.prototype.toString;
-
- var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/;
- // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
- // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
- jsonDiff.useLongestToken = true;
-
- jsonDiff.tokenize = /*istanbul ignore start*/_line.lineDiff. /*istanbul ignore end*/tokenize;
- jsonDiff.castInput = function (value) {
- /*istanbul ignore start*/var /*istanbul ignore end*/undefinedReplacement = this.options.undefinedReplacement;
-
-
- return typeof value === 'string' ? value : JSON.stringify(canonicalize(value), function (k, v) {
- if (typeof v === 'undefined') {
- return undefinedReplacement;
- }
-
- return v;
- }, ' ');
- };
- jsonDiff.equals = function (left, right) {
- return (/*istanbul ignore start*/_base2['default']. /*istanbul ignore end*/prototype.equals(left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'))
- );
- };
-
- function diffJson(oldObj, newObj, options) {
- return jsonDiff.diff(oldObj, newObj, options);
- }
-
- // This function handles the presence of circular references by bailing out when encountering an
- // object that is already on the "stack" of items being processed.
- function canonicalize(obj, stack, replacementStack) {
- stack = stack || [];
- replacementStack = replacementStack || [];
-
- var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
-
- for (i = 0; i < stack.length; i += 1) {
- if (stack[i] === obj) {
- return replacementStack[i];
- }
- }
-
- var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
-
- if ('[object Array]' === objectPrototypeToString.call(obj)) {
- stack.push(obj);
- canonicalizedObj = new Array(obj.length);
- replacementStack.push(canonicalizedObj);
- for (i = 0; i < obj.length; i += 1) {
- canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack);
- }
- stack.pop();
- replacementStack.pop();
- return canonicalizedObj;
- }
-
- if (obj && obj.toJSON) {
- obj = obj.toJSON();
- }
-
- if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) {
- stack.push(obj);
- canonicalizedObj = {};
- replacementStack.push(canonicalizedObj);
- var sortedKeys = [],
- key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
- for (key in obj) {
- /* istanbul ignore else */
- if (obj.hasOwnProperty(key)) {
- sortedKeys.push(key);
- }
- }
- sortedKeys.sort();
- for (i = 0; i < sortedKeys.length; i += 1) {
- key = sortedKeys[i];
- canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack);
- }
- stack.pop();
- replacementStack.pop();
- } else {
- canonicalizedObj = obj;
- }
- return canonicalizedObj;
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztnQ0EyQmdCLFEsR0FBQSxRO3lEQUlBLFksR0FBQSxZOztBQS9CaEIsSSx5QkFBQSx5Qix3QkFBQTs7Ozs7O0FBQ0EsSSx5QkFBQSx5Qix3QkFBQTs7Ozs7OztBQUVBLElBQU0sMEJBQTBCLE9BQU8sU0FBUCxDQUFpQixRQUFqRDs7QUFHTyxJQUFNLFcseUJBQUEsUSx3QkFBQSxXQUFXLEkseUJBQUEsbUIsd0JBQWpCOzs7QUFHUCxTQUFTLGVBQVQsR0FBMkIsSUFBM0I7O0FBRUEsU0FBUyxRQUFULEcseUJBQW9CLGUsd0JBQVMsUUFBN0I7QUFDQSxTQUFTLFNBQVQsR0FBcUIsVUFBUyxLQUFULEVBQWdCOzJCQUFBLEksdUJBQzVCLG9CQUQ0QixHQUNKLEtBQUssT0FERCxDQUM1QixvQkFENEI7OztBQUduQyxTQUFPLE9BQU8sS0FBUCxLQUFpQixRQUFqQixHQUE0QixLQUE1QixHQUFvQyxLQUFLLFNBQUwsQ0FBZSxhQUFhLEtBQWIsQ0FBZixFQUFvQyxVQUFTLENBQVQsRUFBWSxDQUFaLEVBQWU7QUFDNUYsUUFBSSxPQUFPLENBQVAsS0FBYSxXQUFqQixFQUE4QjtBQUM1QixhQUFPLG9CQUFQO0FBQ0Q7O0FBRUQsV0FBTyxDQUFQO0FBQ0QsR0FOMEMsRUFNeEMsSUFOd0MsQ0FBM0M7QUFPRCxDQVZEO0FBV0EsU0FBUyxNQUFULEdBQWtCLFVBQVMsSUFBVCxFQUFlLEtBQWYsRUFBc0I7QUFDdEMsUywwQkFBTyxrQix3QkFBSyxTQUFMLENBQWUsTUFBZixDQUFzQixLQUFLLE9BQUwsQ0FBYSxZQUFiLEVBQTJCLElBQTNCLENBQXRCLEVBQXdELE1BQU0sT0FBTixDQUFjLFlBQWQsRUFBNEIsSUFBNUIsQ0FBeEQ7QUFBUDtBQUNELENBRkQ7O0FBSU8sU0FBUyxRQUFULENBQWtCLE1BQWxCLEVBQTBCLE1BQTFCLEVBQWtDLE9BQWxDLEVBQTJDO0FBQUUsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLE9BQTlCLENBQVA7QUFBZ0Q7Ozs7QUFJN0YsU0FBUyxZQUFULENBQXNCLEdBQXRCLEVBQTJCLEtBQTNCLEVBQWtDLGdCQUFsQyxFQUFvRDtBQUN6RCxVQUFRLFNBQVMsRUFBakI7QUFDQSxxQkFBbUIsb0JBQW9CLEVBQXZDOztBQUVBLE1BQUksSSx5QkFBQSxNLHdCQUFKOztBQUVBLE9BQUssSUFBSSxDQUFULEVBQVksSUFBSSxNQUFNLE1BQXRCLEVBQThCLEtBQUssQ0FBbkMsRUFBc0M7QUFDcEMsUUFBSSxNQUFNLENBQU4sTUFBYSxHQUFqQixFQUFzQjtBQUNwQixhQUFPLGlCQUFpQixDQUFqQixDQUFQO0FBQ0Q7QUFDRjs7QUFFRCxNQUFJLG1CLHlCQUFBLE0sd0JBQUo7O0FBRUEsTUFBSSxxQkFBcUIsd0JBQXdCLElBQXhCLENBQTZCLEdBQTdCLENBQXpCLEVBQTREO0FBQzFELFVBQU0sSUFBTixDQUFXLEdBQVg7QUFDQSx1QkFBbUIsSUFBSSxLQUFKLENBQVUsSUFBSSxNQUFkLENBQW5CO0FBQ0EscUJBQWlCLElBQWpCLENBQXNCLGdCQUF0QjtBQUNBLFNBQUssSUFBSSxDQUFULEVBQVksSUFBSSxJQUFJLE1BQXBCLEVBQTRCLEtBQUssQ0FBakMsRUFBb0M7QUFDbEMsdUJBQWlCLENBQWpCLElBQXNCLGFBQWEsSUFBSSxDQUFKLENBQWIsRUFBcUIsS0FBckIsRUFBNEIsZ0JBQTVCLENBQXRCO0FBQ0Q7QUFDRCxVQUFNLEdBQU47QUFDQSxxQkFBaUIsR0FBakI7QUFDQSxXQUFPLGdCQUFQO0FBQ0Q7O0FBRUQsTUFBSSxPQUFPLElBQUksTUFBZixFQUF1QjtBQUNyQixVQUFNLElBQUksTUFBSixFQUFOO0FBQ0Q7O0FBRUQsTSwwQkFBSSxRLHVCQUFPLEdBQVAseUNBQU8sR0FBUCxPQUFlLFFBQWYsSUFBMkIsUUFBUSxJQUF2QyxFQUE2QztBQUMzQyxVQUFNLElBQU4sQ0FBVyxHQUFYO0FBQ0EsdUJBQW1CLEVBQW5CO0FBQ0EscUJBQWlCLElBQWpCLENBQXNCLGdCQUF0QjtBQUNBLFFBQUksYUFBYSxFQUFqQjtBQUFBLFFBQ0ksTSx5QkFBQSxNLHdCQURKO0FBRUEsU0FBSyxHQUFMLElBQVksR0FBWixFQUFpQjs7QUFFZixVQUFJLElBQUksY0FBSixDQUFtQixHQUFuQixDQUFKLEVBQTZCO0FBQzNCLG1CQUFXLElBQVgsQ0FBZ0IsR0FBaEI7QUFDRDtBQUNGO0FBQ0QsZUFBVyxJQUFYO0FBQ0EsU0FBSyxJQUFJLENBQVQsRUFBWSxJQUFJLFdBQVcsTUFBM0IsRUFBbUMsS0FBSyxDQUF4QyxFQUEyQztBQUN6QyxZQUFNLFdBQVcsQ0FBWCxDQUFOO0FBQ0EsdUJBQWlCLEdBQWpCLElBQXdCLGFBQWEsSUFBSSxHQUFKLENBQWIsRUFBdUIsS0FBdkIsRUFBOEIsZ0JBQTlCLENBQXhCO0FBQ0Q7QUFDRCxVQUFNLEdBQU47QUFDQSxxQkFBaUIsR0FBakI7QUFDRCxHQW5CRCxNQW1CTztBQUNMLHVCQUFtQixHQUFuQjtBQUNEO0FBQ0QsU0FBTyxnQkFBUDtBQUNEIiwiZmlsZSI6Impzb24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuaW1wb3J0IHtsaW5lRGlmZn0gZnJvbSAnLi9saW5lJztcblxuY29uc3Qgb2JqZWN0UHJvdG90eXBlVG9TdHJpbmcgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xuXG5cbmV4cG9ydCBjb25zdCBqc29uRGlmZiA9IG5ldyBEaWZmKCk7XG4vLyBEaXNjcmltaW5hdGUgYmV0d2VlbiB0d28gbGluZXMgb2YgcHJldHR5LXByaW50ZWQsIHNlcmlhbGl6ZWQgSlNPTiB3aGVyZSBvbmUgb2YgdGhlbSBoYXMgYVxuLy8gZGFuZ2xpbmcgY29tbWEgYW5kIHRoZSBvdGhlciBkb2Vzbid0LiBUdXJucyBvdXQgaW5jbHVkaW5nIHRoZSBkYW5nbGluZyBjb21tYSB5aWVsZHMgdGhlIG5pY2VzdCBvdXRwdXQ6XG5qc29uRGlmZi51c2VMb25nZXN0VG9rZW4gPSB0cnVlO1xuXG5qc29uRGlmZi50b2tlbml6ZSA9IGxpbmVEaWZmLnRva2VuaXplO1xuanNvbkRpZmYuY2FzdElucHV0ID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgY29uc3Qge3VuZGVmaW5lZFJlcGxhY2VtZW50fSA9IHRoaXMub3B0aW9ucztcblxuICByZXR1cm4gdHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJyA/IHZhbHVlIDogSlNPTi5zdHJpbmdpZnkoY2Fub25pY2FsaXplKHZhbHVlKSwgZnVuY3Rpb24oaywgdikge1xuICAgIGlmICh0eXBlb2YgdiA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgIHJldHVybiB1bmRlZmluZWRSZXBsYWNlbWVudDtcbiAgICB9XG5cbiAgICByZXR1cm4gdjtcbiAgfSwgJyAgJyk7XG59O1xuanNvbkRpZmYuZXF1YWxzID0gZnVuY3Rpb24obGVmdCwgcmlnaHQpIHtcbiAgcmV0dXJuIERpZmYucHJvdG90eXBlLmVxdWFscyhsZWZ0LnJlcGxhY2UoLywoW1xcclxcbl0pL2csICckMScpLCByaWdodC5yZXBsYWNlKC8sKFtcXHJcXG5dKS9nLCAnJDEnKSk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkpzb24ob2xkT2JqLCBuZXdPYmosIG9wdGlvbnMpIHsgcmV0dXJuIGpzb25EaWZmLmRpZmYob2xkT2JqLCBuZXdPYmosIG9wdGlvbnMpOyB9XG5cbi8vIFRoaXMgZnVuY3Rpb24gaGFuZGxlcyB0aGUgcHJlc2VuY2Ugb2YgY2lyY3VsYXIgcmVmZXJlbmNlcyBieSBiYWlsaW5nIG91dCB3aGVuIGVuY291bnRlcmluZyBhblxuLy8gb2JqZWN0IHRoYXQgaXMgYWxyZWFkeSBvbiB0aGUgXCJzdGFja1wiIG9mIGl0ZW1zIGJlaW5nIHByb2Nlc3NlZC5cbmV4cG9ydCBmdW5jdGlvbiBjYW5vbmljYWxpemUob2JqLCBzdGFjaywgcmVwbGFjZW1lbnRTdGFjaykge1xuICBzdGFjayA9IHN0YWNrIHx8IFtdO1xuICByZXBsYWNlbWVudFN0YWNrID0gcmVwbGFjZW1lbnRTdGFjayB8fCBbXTtcblxuICBsZXQgaTtcblxuICBmb3IgKGkgPSAwOyBpIDwgc3RhY2subGVuZ3RoOyBpICs9IDEpIHtcbiAgICBpZiAoc3RhY2tbaV0gPT09IG9iaikge1xuICAgICAgcmV0dXJuIHJlcGxhY2VtZW50U3RhY2tbaV07XG4gICAgfVxuICB9XG5cbiAgbGV0IGNhbm9uaWNhbGl6ZWRPYmo7XG5cbiAgaWYgKCdbb2JqZWN0IEFycmF5XScgPT09IG9iamVjdFByb3RvdHlwZVRvU3RyaW5nLmNhbGwob2JqKSkge1xuICAgIHN0YWNrLnB1c2gob2JqKTtcbiAgICBjYW5vbmljYWxpemVkT2JqID0gbmV3IEFycmF5KG9iai5sZW5ndGgpO1xuICAgIHJlcGxhY2VtZW50U3RhY2sucHVzaChjYW5vbmljYWxpemVkT2JqKTtcbiAgICBmb3IgKGkgPSAwOyBpIDwgb2JqLmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICBjYW5vbmljYWxpemVkT2JqW2ldID0gY2Fub25pY2FsaXplKG9ialtpXSwgc3RhY2ssIHJlcGxhY2VtZW50U3RhY2spO1xuICAgIH1cbiAgICBzdGFjay5wb3AoKTtcbiAgICByZXBsYWNlbWVudFN0YWNrLnBvcCgpO1xuICAgIHJldHVybiBjYW5vbmljYWxpemVkT2JqO1xuICB9XG5cbiAgaWYgKG9iaiAmJiBvYmoudG9KU09OKSB7XG4gICAgb2JqID0gb2JqLnRvSlNPTigpO1xuICB9XG5cbiAgaWYgKHR5cGVvZiBvYmogPT09ICdvYmplY3QnICYmIG9iaiAhPT0gbnVsbCkge1xuICAgIHN0YWNrLnB1c2gob2JqKTtcbiAgICBjYW5vbmljYWxpemVkT2JqID0ge307XG4gICAgcmVwbGFjZW1lbnRTdGFjay5wdXNoKGNhbm9uaWNhbGl6ZWRPYmopO1xuICAgIGxldCBzb3J0ZWRLZXlzID0gW10sXG4gICAgICAgIGtleTtcbiAgICBmb3IgKGtleSBpbiBvYmopIHtcbiAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICBpZiAob2JqLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgc29ydGVkS2V5cy5wdXNoKGtleSk7XG4gICAgICB9XG4gICAgfVxuICAgIHNvcnRlZEtleXMuc29ydCgpO1xuICAgIGZvciAoaSA9IDA7IGkgPCBzb3J0ZWRLZXlzLmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICBrZXkgPSBzb3J0ZWRLZXlzW2ldO1xuICAgICAgY2Fub25pY2FsaXplZE9ialtrZXldID0gY2Fub25pY2FsaXplKG9ialtrZXldLCBzdGFjaywgcmVwbGFjZW1lbnRTdGFjayk7XG4gICAgfVxuICAgIHN0YWNrLnBvcCgpO1xuICAgIHJlcGxhY2VtZW50U3RhY2sucG9wKCk7XG4gIH0gZWxzZSB7XG4gICAgY2Fub25pY2FsaXplZE9iaiA9IG9iajtcbiAgfVxuICByZXR1cm4gY2Fub25pY2FsaXplZE9iajtcbn1cbiJdfQ==
-
-
-/***/ },
-/* 148 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports.arrayDiff = undefined;
- exports. /*istanbul ignore end*/diffArrays = diffArrays;
-
- var /*istanbul ignore start*/_base = __webpack_require__(140) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _base2 = _interopRequireDefault(_base);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- /*istanbul ignore end*/var arrayDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/arrayDiff = new /*istanbul ignore start*/_base2['default']() /*istanbul ignore end*/;
- arrayDiff.tokenize = arrayDiff.join = function (value) {
- return value.slice();
- };
-
- function diffArrays(oldArr, newArr, callback) {
- return arrayDiff.diff(oldArr, newArr, callback);
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2FycmF5LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Z0NBT2dCLFUsR0FBQSxVOztBQVBoQixJLHlCQUFBLHlCLHdCQUFBOzs7Ozs7O3VCQUVPLElBQU0sWSx5QkFBQSxRLHdCQUFBLFlBQVksSSx5QkFBQSxtQix3QkFBbEI7QUFDUCxVQUFVLFFBQVYsR0FBcUIsVUFBVSxJQUFWLEdBQWlCLFVBQVMsS0FBVCxFQUFnQjtBQUNwRCxTQUFPLE1BQU0sS0FBTixFQUFQO0FBQ0QsQ0FGRDs7QUFJTyxTQUFTLFVBQVQsQ0FBb0IsTUFBcEIsRUFBNEIsTUFBNUIsRUFBb0MsUUFBcEMsRUFBOEM7QUFBRSxTQUFPLFVBQVUsSUFBVixDQUFlLE1BQWYsRUFBdUIsTUFBdkIsRUFBK0IsUUFBL0IsQ0FBUDtBQUFrRCIsImZpbGUiOiJhcnJheS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBhcnJheURpZmYgPSBuZXcgRGlmZigpO1xuYXJyYXlEaWZmLnRva2VuaXplID0gYXJyYXlEaWZmLmpvaW4gPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc2xpY2UoKTtcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmQXJyYXlzKG9sZEFyciwgbmV3QXJyLCBjYWxsYmFjaykgeyByZXR1cm4gYXJyYXlEaWZmLmRpZmYob2xkQXJyLCBuZXdBcnIsIGNhbGxiYWNrKTsgfVxuIl19
-
-
-/***/ },
-/* 149 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports. /*istanbul ignore end*/applyPatch = applyPatch;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches;
-
- var /*istanbul ignore start*/_parse = __webpack_require__(150) /*istanbul ignore end*/;
-
- var /*istanbul ignore start*/_distanceIterator = __webpack_require__(151) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- var _distanceIterator2 = _interopRequireDefault(_distanceIterator);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
- /*istanbul ignore end*/function applyPatch(source, uniDiff) {
- /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
-
- if (typeof uniDiff === 'string') {
- uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
- }
-
- if (Array.isArray(uniDiff)) {
- if (uniDiff.length > 1) {
- throw new Error('applyPatch only works with a single input.');
- }
-
- uniDiff = uniDiff[0];
- }
-
- // Apply the diff to the input
- var lines = source.split(/\r\n|[\n\v\f\r\x85]/),
- delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [],
- hunks = uniDiff.hunks,
- compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{
- return (/*istanbul ignore end*/line === patchContent
- );
- },
- errorCount = 0,
- fuzzFactor = options.fuzzFactor || 0,
- minLine = 0,
- offset = 0,
- removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
- addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
-
- /**
- * Checks if the hunk exactly fits on the provided location
- */
- function hunkFits(hunk, toPos) {
- for (var j = 0; j < hunk.lines.length; j++) {
- var line = hunk.lines[j],
- operation = line[0],
- content = line.substr(1);
-
- if (operation === ' ' || operation === '-') {
- // Context sanity check
- if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
- errorCount++;
-
- if (errorCount > fuzzFactor) {
- return false;
- }
- }
- toPos++;
- }
- }
-
- return true;
- }
-
- // Search best fit offsets for each hunk based on the previous ones
- for (var i = 0; i < hunks.length; i++) {
- var hunk = hunks[i],
- maxLine = lines.length - hunk.oldLines,
- localOffset = 0,
- toPos = offset + hunk.oldStart - 1;
-
- var iterator = /*istanbul ignore start*/(0, _distanceIterator2['default']) /*istanbul ignore end*/(toPos, minLine, maxLine);
-
- for (; localOffset !== undefined; localOffset = iterator()) {
- if (hunkFits(hunk, toPos + localOffset)) {
- hunk.offset = offset += localOffset;
- break;
- }
- }
-
- if (localOffset === undefined) {
- return false;
- }
-
- // Set lower text limit to end of the current hunk, so next ones don't try
- // to fit over already patched text
- minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
- }
-
- // Apply patch hunks
- for (var _i = 0; _i < hunks.length; _i++) {
- var _hunk = hunks[_i],
- _toPos = _hunk.offset + _hunk.newStart - 1;
- if (_hunk.newLines == 0) {
- _toPos++;
- }
-
- for (var j = 0; j < _hunk.lines.length; j++) {
- var line = _hunk.lines[j],
- operation = line[0],
- content = line.substr(1),
- delimiter = _hunk.linedelimiters[j];
-
- if (operation === ' ') {
- _toPos++;
- } else if (operation === '-') {
- lines.splice(_toPos, 1);
- delimiters.splice(_toPos, 1);
- /* istanbul ignore else */
- } else if (operation === '+') {
- lines.splice(_toPos, 0, content);
- delimiters.splice(_toPos, 0, delimiter);
- _toPos++;
- } else if (operation === '\\') {
- var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
- if (previousOperation === '+') {
- removeEOFNL = true;
- } else if (previousOperation === '-') {
- addEOFNL = true;
- }
- }
- }
- }
-
- // Handle EOFNL insertion/removal
- if (removeEOFNL) {
- while (!lines[lines.length - 1]) {
- lines.pop();
- delimiters.pop();
- }
- } else if (addEOFNL) {
- lines.push('');
- delimiters.push('\n');
- }
- for (var _k = 0; _k < lines.length - 1; _k++) {
- lines[_k] = lines[_k] + delimiters[_k];
- }
- return lines.join('');
- }
-
- // Wrapper that supports multiple file patches via callbacks.
- function applyPatches(uniDiff, options) {
- if (typeof uniDiff === 'string') {
- uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
- }
-
- var currentIndex = 0;
- function processIndex() {
- var index = uniDiff[currentIndex++];
- if (!index) {
- return options.complete();
- }
-
- options.loadFile(index, function (err, data) {
- if (err) {
- return options.complete(err);
- }
-
- var updatedContent = applyPatch(data, index, options);
- options.patched(index, updatedContent, function (err) {
- if (err) {
- return options.complete(err);
- }
-
- processIndex();
- });
- });
- }
- processIndex();
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBR2dCLFUsR0FBQSxVO3lEQStIQSxZLEdBQUEsWTs7QUFsSWhCLEkseUJBQUEsMkIsd0JBQUE7O0FBQ0EsSSx5QkFBQSx3RCx3QkFBQTs7Ozs7Ozt1QkFFTyxTQUFTLFVBQVQsQ0FBb0IsTUFBcEIsRUFBNEIsT0FBNUIsRUFBbUQ7MkJBQUEsSSx1QkFBZCxPQUFjLHlEQUFKLEVBQUk7O0FBQ3hELE1BQUksT0FBTyxPQUFQLEtBQW1CLFFBQXZCLEVBQWlDO0FBQy9CLGMseUJBQVUsc0Isd0JBQUEsQ0FBVyxPQUFYLENBQVY7QUFDRDs7QUFFRCxNQUFJLE1BQU0sT0FBTixDQUFjLE9BQWQsQ0FBSixFQUE0QjtBQUMxQixRQUFJLFFBQVEsTUFBUixHQUFpQixDQUFyQixFQUF3QjtBQUN0QixZQUFNLElBQUksS0FBSixDQUFVLDRDQUFWLENBQU47QUFDRDs7QUFFRCxjQUFVLFFBQVEsQ0FBUixDQUFWO0FBQ0Q7OztBQUdELE1BQUksUUFBUSxPQUFPLEtBQVAsQ0FBYSxxQkFBYixDQUFaO0FBQUEsTUFDSSxhQUFhLE9BQU8sS0FBUCxDQUFhLHNCQUFiLEtBQXdDLEVBRHpEO0FBQUEsTUFFSSxRQUFRLFFBQVEsS0FGcEI7QUFBQSxNQUlJLGNBQWMsUUFBUSxXQUFSLElBQXdCLFVBQUMsVUFBRCxFQUFhLElBQWIsRUFBbUIsU0FBbkIsRUFBOEIsWUFBOUIsRSx5QkFBQTtBQUFBLFcsd0JBQStDLFNBQVM7QUFBeEQ7QUFBQSxHQUoxQztBQUFBLE1BS0ksYUFBYSxDQUxqQjtBQUFBLE1BTUksYUFBYSxRQUFRLFVBQVIsSUFBc0IsQ0FOdkM7QUFBQSxNQU9JLFVBQVUsQ0FQZDtBQUFBLE1BUUksU0FBUyxDQVJiO0FBQUEsTUFVSSxjLHlCQUFBLE0sd0JBVko7QUFBQSxNQVdJLFcseUJBQUEsTSx3QkFYSjs7Ozs7QUFnQkEsV0FBUyxRQUFULENBQWtCLElBQWxCLEVBQXdCLEtBQXhCLEVBQStCO0FBQzdCLFNBQUssSUFBSSxJQUFJLENBQWIsRUFBZ0IsSUFBSSxLQUFLLEtBQUwsQ0FBVyxNQUEvQixFQUF1QyxHQUF2QyxFQUE0QztBQUMxQyxVQUFJLE9BQU8sS0FBSyxLQUFMLENBQVcsQ0FBWCxDQUFYO0FBQUEsVUFDSSxZQUFZLEtBQUssQ0FBTCxDQURoQjtBQUFBLFVBRUksVUFBVSxLQUFLLE1BQUwsQ0FBWSxDQUFaLENBRmQ7O0FBSUEsVUFBSSxjQUFjLEdBQWQsSUFBcUIsY0FBYyxHQUF2QyxFQUE0Qzs7QUFFMUMsWUFBSSxDQUFDLFlBQVksUUFBUSxDQUFwQixFQUF1QixNQUFNLEtBQU4sQ0FBdkIsRUFBcUMsU0FBckMsRUFBZ0QsT0FBaEQsQ0FBTCxFQUErRDtBQUM3RDs7QUFFQSxjQUFJLGFBQWEsVUFBakIsRUFBNkI7QUFDM0IsbUJBQU8sS0FBUDtBQUNEO0FBQ0Y7QUFDRDtBQUNEO0FBQ0Y7O0FBRUQsV0FBTyxJQUFQO0FBQ0Q7OztBQUdELE9BQUssSUFBSSxJQUFJLENBQWIsRUFBZ0IsSUFBSSxNQUFNLE1BQTFCLEVBQWtDLEdBQWxDLEVBQXVDO0FBQ3JDLFFBQUksT0FBTyxNQUFNLENBQU4sQ0FBWDtBQUFBLFFBQ0ksVUFBVSxNQUFNLE1BQU4sR0FBZSxLQUFLLFFBRGxDO0FBQUEsUUFFSSxjQUFjLENBRmxCO0FBQUEsUUFHSSxRQUFRLFNBQVMsS0FBSyxRQUFkLEdBQXlCLENBSHJDOztBQUtBLFFBQUksVyx5QkFBVyxrQyx3QkFBQSxDQUFpQixLQUFqQixFQUF3QixPQUF4QixFQUFpQyxPQUFqQyxDQUFmOztBQUVBLFdBQU8sZ0JBQWdCLFNBQXZCLEVBQWtDLGNBQWMsVUFBaEQsRUFBNEQ7QUFDMUQsVUFBSSxTQUFTLElBQVQsRUFBZSxRQUFRLFdBQXZCLENBQUosRUFBeUM7QUFDdkMsYUFBSyxNQUFMLEdBQWMsVUFBVSxXQUF4QjtBQUNBO0FBQ0Q7QUFDRjs7QUFFRCxRQUFJLGdCQUFnQixTQUFwQixFQUErQjtBQUM3QixhQUFPLEtBQVA7QUFDRDs7OztBQUlELGNBQVUsS0FBSyxNQUFMLEdBQWMsS0FBSyxRQUFuQixHQUE4QixLQUFLLFFBQTdDO0FBQ0Q7OztBQUdELE9BQUssSUFBSSxLQUFJLENBQWIsRUFBZ0IsS0FBSSxNQUFNLE1BQTFCLEVBQWtDLElBQWxDLEVBQXVDO0FBQ3JDLFFBQUksUUFBTyxNQUFNLEVBQU4sQ0FBWDtBQUFBLFFBQ0ksU0FBUSxNQUFLLE1BQUwsR0FBYyxNQUFLLFFBQW5CLEdBQThCLENBRDFDO0FBRUEsUUFBSSxNQUFLLFFBQUwsSUFBaUIsQ0FBckIsRUFBd0I7QUFBRTtBQUFVOztBQUVwQyxTQUFLLElBQUksSUFBSSxDQUFiLEVBQWdCLElBQUksTUFBSyxLQUFMLENBQVcsTUFBL0IsRUFBdUMsR0FBdkMsRUFBNEM7QUFDMUMsVUFBSSxPQUFPLE1BQUssS0FBTCxDQUFXLENBQVgsQ0FBWDtBQUFBLFVBQ0ksWUFBWSxLQUFLLENBQUwsQ0FEaEI7QUFBQSxVQUVJLFVBQVUsS0FBSyxNQUFMLENBQVksQ0FBWixDQUZkO0FBQUEsVUFHSSxZQUFZLE1BQUssY0FBTCxDQUFvQixDQUFwQixDQUhoQjs7QUFLQSxVQUFJLGNBQWMsR0FBbEIsRUFBdUI7QUFDckI7QUFDRCxPQUZELE1BRU8sSUFBSSxjQUFjLEdBQWxCLEVBQXVCO0FBQzVCLGNBQU0sTUFBTixDQUFhLE1BQWIsRUFBb0IsQ0FBcEI7QUFDQSxtQkFBVyxNQUFYLENBQWtCLE1BQWxCLEVBQXlCLENBQXpCOztBQUVELE9BSk0sTUFJQSxJQUFJLGNBQWMsR0FBbEIsRUFBdUI7QUFDNUIsZ0JBQU0sTUFBTixDQUFhLE1BQWIsRUFBb0IsQ0FBcEIsRUFBdUIsT0FBdkI7QUFDQSxxQkFBVyxNQUFYLENBQWtCLE1BQWxCLEVBQXlCLENBQXpCLEVBQTRCLFNBQTVCO0FBQ0E7QUFDRCxTQUpNLE1BSUEsSUFBSSxjQUFjLElBQWxCLEVBQXdCO0FBQzdCLGNBQUksb0JBQW9CLE1BQUssS0FBTCxDQUFXLElBQUksQ0FBZixJQUFvQixNQUFLLEtBQUwsQ0FBVyxJQUFJLENBQWYsRUFBa0IsQ0FBbEIsQ0FBcEIsR0FBMkMsSUFBbkU7QUFDQSxjQUFJLHNCQUFzQixHQUExQixFQUErQjtBQUM3QiwwQkFBYyxJQUFkO0FBQ0QsV0FGRCxNQUVPLElBQUksc0JBQXNCLEdBQTFCLEVBQStCO0FBQ3BDLHVCQUFXLElBQVg7QUFDRDtBQUNGO0FBQ0Y7QUFDRjs7O0FBR0QsTUFBSSxXQUFKLEVBQWlCO0FBQ2YsV0FBTyxDQUFDLE1BQU0sTUFBTSxNQUFOLEdBQWUsQ0FBckIsQ0FBUixFQUFpQztBQUMvQixZQUFNLEdBQU47QUFDQSxpQkFBVyxHQUFYO0FBQ0Q7QUFDRixHQUxELE1BS08sSUFBSSxRQUFKLEVBQWM7QUFDbkIsVUFBTSxJQUFOLENBQVcsRUFBWDtBQUNBLGVBQVcsSUFBWCxDQUFnQixJQUFoQjtBQUNEO0FBQ0QsT0FBSyxJQUFJLEtBQUssQ0FBZCxFQUFpQixLQUFLLE1BQU0sTUFBTixHQUFlLENBQXJDLEVBQXdDLElBQXhDLEVBQThDO0FBQzVDLFVBQU0sRUFBTixJQUFZLE1BQU0sRUFBTixJQUFZLFdBQVcsRUFBWCxDQUF4QjtBQUNEO0FBQ0QsU0FBTyxNQUFNLElBQU4sQ0FBVyxFQUFYLENBQVA7QUFDRDs7O0FBR00sU0FBUyxZQUFULENBQXNCLE9BQXRCLEVBQStCLE9BQS9CLEVBQXdDO0FBQzdDLE1BQUksT0FBTyxPQUFQLEtBQW1CLFFBQXZCLEVBQWlDO0FBQy9CLGMseUJBQVUsc0Isd0JBQUEsQ0FBVyxPQUFYLENBQVY7QUFDRDs7QUFFRCxNQUFJLGVBQWUsQ0FBbkI7QUFDQSxXQUFTLFlBQVQsR0FBd0I7QUFDdEIsUUFBSSxRQUFRLFFBQVEsY0FBUixDQUFaO0FBQ0EsUUFBSSxDQUFDLEtBQUwsRUFBWTtBQUNWLGFBQU8sUUFBUSxRQUFSLEVBQVA7QUFDRDs7QUFFRCxZQUFRLFFBQVIsQ0FBaUIsS0FBakIsRUFBd0IsVUFBUyxHQUFULEVBQWMsSUFBZCxFQUFvQjtBQUMxQyxVQUFJLEdBQUosRUFBUztBQUNQLGVBQU8sUUFBUSxRQUFSLENBQWlCLEdBQWpCLENBQVA7QUFDRDs7QUFFRCxVQUFJLGlCQUFpQixXQUFXLElBQVgsRUFBaUIsS0FBakIsRUFBd0IsT0FBeEIsQ0FBckI7QUFDQSxjQUFRLE9BQVIsQ0FBZ0IsS0FBaEIsRUFBdUIsY0FBdkIsRUFBdUMsVUFBUyxHQUFULEVBQWM7QUFDbkQsWUFBSSxHQUFKLEVBQVM7QUFDUCxpQkFBTyxRQUFRLFFBQVIsQ0FBaUIsR0FBakIsQ0FBUDtBQUNEOztBQUVEO0FBQ0QsT0FORDtBQU9ELEtBYkQ7QUFjRDtBQUNEO0FBQ0QiLCJmaWxlIjoiYXBwbHkuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge3BhcnNlUGF0Y2h9IGZyb20gJy4vcGFyc2UnO1xuaW1wb3J0IGRpc3RhbmNlSXRlcmF0b3IgZnJvbSAnLi4vdXRpbC9kaXN0YW5jZS1pdGVyYXRvcic7XG5cbmV4cG9ydCBmdW5jdGlvbiBhcHBseVBhdGNoKHNvdXJjZSwgdW5pRGlmZiwgb3B0aW9ucyA9IHt9KSB7XG4gIGlmICh0eXBlb2YgdW5pRGlmZiA9PT0gJ3N0cmluZycpIHtcbiAgICB1bmlEaWZmID0gcGFyc2VQYXRjaCh1bmlEaWZmKTtcbiAgfVxuXG4gIGlmIChBcnJheS5pc0FycmF5KHVuaURpZmYpKSB7XG4gICAgaWYgKHVuaURpZmYubGVuZ3RoID4gMSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdhcHBseVBhdGNoIG9ubHkgd29ya3Mgd2l0aCBhIHNpbmdsZSBpbnB1dC4nKTtcbiAgICB9XG5cbiAgICB1bmlEaWZmID0gdW5pRGlmZlswXTtcbiAgfVxuXG4gIC8vIEFwcGx5IHRoZSBkaWZmIHRvIHRoZSBpbnB1dFxuICBsZXQgbGluZXMgPSBzb3VyY2Uuc3BsaXQoL1xcclxcbnxbXFxuXFx2XFxmXFxyXFx4ODVdLyksXG4gICAgICBkZWxpbWl0ZXJzID0gc291cmNlLm1hdGNoKC9cXHJcXG58W1xcblxcdlxcZlxcclxceDg1XS9nKSB8fCBbXSxcbiAgICAgIGh1bmtzID0gdW5pRGlmZi5odW5rcyxcblxuICAgICAgY29tcGFyZUxpbmUgPSBvcHRpb25zLmNvbXBhcmVMaW5lIHx8ICgobGluZU51bWJlciwgbGluZSwgb3BlcmF0aW9uLCBwYXRjaENvbnRlbnQpID0+IGxpbmUgPT09IHBhdGNoQ29udGVudCksXG4gICAgICBlcnJvckNvdW50ID0gMCxcbiAgICAgIGZ1enpGYWN0b3IgPSBvcHRpb25zLmZ1enpGYWN0b3IgfHwgMCxcbiAgICAgIG1pbkxpbmUgPSAwLFxuICAgICAgb2Zmc2V0ID0gMCxcblxuICAgICAgcmVtb3ZlRU9GTkwsXG4gICAgICBhZGRFT0ZOTDtcblxuICAvKipcbiAgICogQ2hlY2tzIGlmIHRoZSBodW5rIGV4YWN0bHkgZml0cyBvbiB0aGUgcHJvdmlkZWQgbG9jYXRpb25cbiAgICovXG4gIGZ1bmN0aW9uIGh1bmtGaXRzKGh1bmssIHRvUG9zKSB7XG4gICAgZm9yIChsZXQgaiA9IDA7IGogPCBodW5rLmxpbmVzLmxlbmd0aDsgaisrKSB7XG4gICAgICBsZXQgbGluZSA9IGh1bmsubGluZXNbal0sXG4gICAgICAgICAgb3BlcmF0aW9uID0gbGluZVswXSxcbiAgICAgICAgICBjb250ZW50ID0gbGluZS5zdWJzdHIoMSk7XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICcgJyB8fCBvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICAvLyBDb250ZXh0IHNhbml0eSBjaGVja1xuICAgICAgICBpZiAoIWNvbXBhcmVMaW5lKHRvUG9zICsgMSwgbGluZXNbdG9Qb3NdLCBvcGVyYXRpb24sIGNvbnRlbnQpKSB7XG4gICAgICAgICAgZXJyb3JDb3VudCsrO1xuXG4gICAgICAgICAgaWYgKGVycm9yQ291bnQgPiBmdXp6RmFjdG9yKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRvUG9zKys7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHRydWU7XG4gIH1cblxuICAvLyBTZWFyY2ggYmVzdCBmaXQgb2Zmc2V0cyBmb3IgZWFjaCBodW5rIGJhc2VkIG9uIHRoZSBwcmV2aW91cyBvbmVzXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgaHVua3MubGVuZ3RoOyBpKyspIHtcbiAgICBsZXQgaHVuayA9IGh1bmtzW2ldLFxuICAgICAgICBtYXhMaW5lID0gbGluZXMubGVuZ3RoIC0gaHVuay5vbGRMaW5lcyxcbiAgICAgICAgbG9jYWxPZmZzZXQgPSAwLFxuICAgICAgICB0b1BvcyA9IG9mZnNldCArIGh1bmsub2xkU3RhcnQgLSAxO1xuXG4gICAgbGV0IGl0ZXJhdG9yID0gZGlzdGFuY2VJdGVyYXRvcih0b1BvcywgbWluTGluZSwgbWF4TGluZSk7XG5cbiAgICBmb3IgKDsgbG9jYWxPZmZzZXQgIT09IHVuZGVmaW5lZDsgbG9jYWxPZmZzZXQgPSBpdGVyYXRvcigpKSB7XG4gICAgICBpZiAoaHVua0ZpdHMoaHVuaywgdG9Qb3MgKyBsb2NhbE9mZnNldCkpIHtcbiAgICAgICAgaHVuay5vZmZzZXQgPSBvZmZzZXQgKz0gbG9jYWxPZmZzZXQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChsb2NhbE9mZnNldCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLy8gU2V0IGxvd2VyIHRleHQgbGltaXQgdG8gZW5kIG9mIHRoZSBjdXJyZW50IGh1bmssIHNvIG5leHQgb25lcyBkb24ndCB0cnlcbiAgICAvLyB0byBmaXQgb3ZlciBhbHJlYWR5IHBhdGNoZWQgdGV4dFxuICAgIG1pbkxpbmUgPSBodW5rLm9mZnNldCArIGh1bmsub2xkU3RhcnQgKyBodW5rLm9sZExpbmVzO1xuICB9XG5cbiAgLy8gQXBwbHkgcGF0Y2ggaHVua3NcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBodW5rcy5sZW5ndGg7IGkrKykge1xuICAgIGxldCBodW5rID0gaHVua3NbaV0sXG4gICAgICAgIHRvUG9zID0gaHVuay5vZmZzZXQgKyBodW5rLm5ld1N0YXJ0IC0gMTtcbiAgICBpZiAoaHVuay5uZXdMaW5lcyA9PSAwKSB7IHRvUG9zKys7IH1cblxuICAgIGZvciAobGV0IGogPSAwOyBqIDwgaHVuay5saW5lcy5sZW5ndGg7IGorKykge1xuICAgICAgbGV0IGxpbmUgPSBodW5rLmxpbmVzW2pdLFxuICAgICAgICAgIG9wZXJhdGlvbiA9IGxpbmVbMF0sXG4gICAgICAgICAgY29udGVudCA9IGxpbmUuc3Vic3RyKDEpLFxuICAgICAgICAgIGRlbGltaXRlciA9IGh1bmsubGluZWRlbGltaXRlcnNbal07XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICcgJykge1xuICAgICAgICB0b1BvcysrO1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICBsaW5lcy5zcGxpY2UodG9Qb3MsIDEpO1xuICAgICAgICBkZWxpbWl0ZXJzLnNwbGljZSh0b1BvcywgMSk7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICcrJykge1xuICAgICAgICBsaW5lcy5zcGxpY2UodG9Qb3MsIDAsIGNvbnRlbnQpO1xuICAgICAgICBkZWxpbWl0ZXJzLnNwbGljZSh0b1BvcywgMCwgZGVsaW1pdGVyKTtcbiAgICAgICAgdG9Qb3MrKztcbiAgICAgIH0gZWxzZSBpZiAob3BlcmF0aW9uID09PSAnXFxcXCcpIHtcbiAgICAgICAgbGV0IHByZXZpb3VzT3BlcmF0aW9uID0gaHVuay5saW5lc1tqIC0gMV0gPyBodW5rLmxpbmVzW2ogLSAxXVswXSA6IG51bGw7XG4gICAgICAgIGlmIChwcmV2aW91c09wZXJhdGlvbiA9PT0gJysnKSB7XG4gICAgICAgICAgcmVtb3ZlRU9GTkwgPSB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKHByZXZpb3VzT3BlcmF0aW9uID09PSAnLScpIHtcbiAgICAgICAgICBhZGRFT0ZOTCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvLyBIYW5kbGUgRU9GTkwgaW5zZXJ0aW9uL3JlbW92YWxcbiAgaWYgKHJlbW92ZUVPRk5MKSB7XG4gICAgd2hpbGUgKCFsaW5lc1tsaW5lcy5sZW5ndGggLSAxXSkge1xuICAgICAgbGluZXMucG9wKCk7XG4gICAgICBkZWxpbWl0ZXJzLnBvcCgpO1xuICAgIH1cbiAgfSBlbHNlIGlmIChhZGRFT0ZOTCkge1xuICAgIGxpbmVzLnB1c2goJycpO1xuICAgIGRlbGltaXRlcnMucHVzaCgnXFxuJyk7XG4gIH1cbiAgZm9yIChsZXQgX2sgPSAwOyBfayA8IGxpbmVzLmxlbmd0aCAtIDE7IF9rKyspIHtcbiAgICBsaW5lc1tfa10gPSBsaW5lc1tfa10gKyBkZWxpbWl0ZXJzW19rXTtcbiAgfVxuICByZXR1cm4gbGluZXMuam9pbignJyk7XG59XG5cbi8vIFdyYXBwZXIgdGhhdCBzdXBwb3J0cyBtdWx0aXBsZSBmaWxlIHBhdGNoZXMgdmlhIGNhbGxiYWNrcy5cbmV4cG9ydCBmdW5jdGlvbiBhcHBseVBhdGNoZXModW5pRGlmZiwgb3B0aW9ucykge1xuICBpZiAodHlwZW9mIHVuaURpZmYgPT09ICdzdHJpbmcnKSB7XG4gICAgdW5pRGlmZiA9IHBhcnNlUGF0Y2godW5pRGlmZik7XG4gIH1cblxuICBsZXQgY3VycmVudEluZGV4ID0gMDtcbiAgZnVuY3Rpb24gcHJvY2Vzc0luZGV4KCkge1xuICAgIGxldCBpbmRleCA9IHVuaURpZmZbY3VycmVudEluZGV4KytdO1xuICAgIGlmICghaW5kZXgpIHtcbiAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKCk7XG4gICAgfVxuXG4gICAgb3B0aW9ucy5sb2FkRmlsZShpbmRleCwgZnVuY3Rpb24oZXJyLCBkYXRhKSB7XG4gICAgICBpZiAoZXJyKSB7XG4gICAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKGVycik7XG4gICAgICB9XG5cbiAgICAgIGxldCB1cGRhdGVkQ29udGVudCA9IGFwcGx5UGF0Y2goZGF0YSwgaW5kZXgsIG9wdGlvbnMpO1xuICAgICAgb3B0aW9ucy5wYXRjaGVkKGluZGV4LCB1cGRhdGVkQ29udGVudCwgZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICByZXR1cm4gb3B0aW9ucy5jb21wbGV0ZShlcnIpO1xuICAgICAgICB9XG5cbiAgICAgICAgcHJvY2Vzc0luZGV4KCk7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfVxuICBwcm9jZXNzSW5kZXgoKTtcbn1cbiJdfQ==
-
-
-/***/ },
-/* 150 */
-/***/ function(module, exports) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports. /*istanbul ignore end*/parsePatch = parsePatch;
- function parsePatch(uniDiff) {
- /*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
-
- var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/),
- delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [],
- list = [],
- i = 0;
-
- function parseIndex() {
- var index = {};
- list.push(index);
-
- // Parse diff metadata
- while (i < diffstr.length) {
- var line = diffstr[i];
-
- // File header found, end parsing diff metadata
- if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
- break;
- }
-
- // Diff index
- var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
- if (header) {
- index.index = header[1];
- }
-
- i++;
- }
-
- // Parse file headers if they are defined. Unified diff requires them, but
- // there's no technical issues to have an isolated hunk without file header
- parseFileHeader(index);
- parseFileHeader(index);
-
- // Parse hunks
- index.hunks = [];
-
- while (i < diffstr.length) {
- var _line = diffstr[i];
-
- if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
- break;
- } else if (/^@@/.test(_line)) {
- index.hunks.push(parseHunk());
- } else if (_line && options.strict) {
- // Ignore unexpected content unless in strict mode
- throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
- } else {
- i++;
- }
- }
- }
-
- // Parses the --- and +++ headers, if none are found, no lines
- // are consumed.
- function parseFileHeader(index) {
- var headerPattern = /^(---|\+\+\+)\s+([\S ]*)(?:\t(.*?)\s*)?$/;
- var fileHeader = headerPattern.exec(diffstr[i]);
- if (fileHeader) {
- var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
- index[keyPrefix + 'FileName'] = fileHeader[2];
- index[keyPrefix + 'Header'] = fileHeader[3];
-
- i++;
- }
- }
-
- // Parses a hunk
- // This assumes that we are at the start of a hunk.
- function parseHunk() {
- var chunkHeaderIndex = i,
- chunkHeaderLine = diffstr[i++],
- chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
-
- var hunk = {
- oldStart: +chunkHeader[1],
- oldLines: +chunkHeader[2] || 1,
- newStart: +chunkHeader[3],
- newLines: +chunkHeader[4] || 1,
- lines: [],
- linedelimiters: []
- };
-
- var addCount = 0,
- removeCount = 0;
- for (; i < diffstr.length; i++) {
- // Lines starting with '---' could be mistaken for the "remove line" operation
- // But they could be the header for the next file. Therefore prune such cases out.
- if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {
- break;
- }
- var operation = diffstr[i][0];
-
- if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
- hunk.lines.push(diffstr[i]);
- hunk.linedelimiters.push(delimiters[i] || '\n');
-
- if (operation === '+') {
- addCount++;
- } else if (operation === '-') {
- removeCount++;
- } else if (operation === ' ') {
- addCount++;
- removeCount++;
- }
- } else {
- break;
- }
- }
-
- // Handle the empty block count case
- if (!addCount && hunk.newLines === 1) {
- hunk.newLines = 0;
- }
- if (!removeCount && hunk.oldLines === 1) {
- hunk.oldLines = 0;
- }
-
- // Perform optional sanity checking
- if (options.strict) {
- if (addCount !== hunk.newLines) {
- throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
- }
- if (removeCount !== hunk.oldLines) {
- throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
- }
- }
-
- return hunk;
- }
-
- while (i < diffstr.length) {
- parseIndex();
- }
-
- return list;
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9wYXJzZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCLFUsR0FBQSxVO0FBQVQsU0FBUyxVQUFULENBQW9CLE9BQXBCLEVBQTJDOzJCQUFBLEksdUJBQWQsT0FBYyx5REFBSixFQUFJOztBQUNoRCxNQUFJLFVBQVUsUUFBUSxLQUFSLENBQWMscUJBQWQsQ0FBZDtBQUFBLE1BQ0ksYUFBYSxRQUFRLEtBQVIsQ0FBYyxzQkFBZCxLQUF5QyxFQUQxRDtBQUFBLE1BRUksT0FBTyxFQUZYO0FBQUEsTUFHSSxJQUFJLENBSFI7O0FBS0EsV0FBUyxVQUFULEdBQXNCO0FBQ3BCLFFBQUksUUFBUSxFQUFaO0FBQ0EsU0FBSyxJQUFMLENBQVUsS0FBVjs7O0FBR0EsV0FBTyxJQUFJLFFBQVEsTUFBbkIsRUFBMkI7QUFDekIsVUFBSSxPQUFPLFFBQVEsQ0FBUixDQUFYOzs7QUFHQSxVQUFJLHdCQUF3QixJQUF4QixDQUE2QixJQUE3QixDQUFKLEVBQXdDO0FBQ3RDO0FBQ0Q7OztBQUdELFVBQUksU0FBVSwwQ0FBRCxDQUE2QyxJQUE3QyxDQUFrRCxJQUFsRCxDQUFiO0FBQ0EsVUFBSSxNQUFKLEVBQVk7QUFDVixjQUFNLEtBQU4sR0FBYyxPQUFPLENBQVAsQ0FBZDtBQUNEOztBQUVEO0FBQ0Q7Ozs7QUFJRCxvQkFBZ0IsS0FBaEI7QUFDQSxvQkFBZ0IsS0FBaEI7OztBQUdBLFVBQU0sS0FBTixHQUFjLEVBQWQ7O0FBRUEsV0FBTyxJQUFJLFFBQVEsTUFBbkIsRUFBMkI7QUFDekIsVUFBSSxRQUFPLFFBQVEsQ0FBUixDQUFYOztBQUVBLFVBQUksaUNBQWlDLElBQWpDLENBQXNDLEtBQXRDLENBQUosRUFBaUQ7QUFDL0M7QUFDRCxPQUZELE1BRU8sSUFBSSxNQUFNLElBQU4sQ0FBVyxLQUFYLENBQUosRUFBc0I7QUFDM0IsY0FBTSxLQUFOLENBQVksSUFBWixDQUFpQixXQUFqQjtBQUNELE9BRk0sTUFFQSxJQUFJLFNBQVEsUUFBUSxNQUFwQixFQUE0Qjs7QUFFakMsY0FBTSxJQUFJLEtBQUosQ0FBVSxtQkFBbUIsSUFBSSxDQUF2QixJQUE0QixHQUE1QixHQUFrQyxLQUFLLFNBQUwsQ0FBZSxLQUFmLENBQTVDLENBQU47QUFDRCxPQUhNLE1BR0E7QUFDTDtBQUNEO0FBQ0Y7QUFDRjs7OztBQUlELFdBQVMsZUFBVCxDQUF5QixLQUF6QixFQUFnQztBQUM5QixRQUFNLGdCQUFnQiwwQ0FBdEI7QUFDQSxRQUFNLGFBQWEsY0FBYyxJQUFkLENBQW1CLFFBQVEsQ0FBUixDQUFuQixDQUFuQjtBQUNBLFFBQUksVUFBSixFQUFnQjtBQUNkLFVBQUksWUFBWSxXQUFXLENBQVgsTUFBa0IsS0FBbEIsR0FBMEIsS0FBMUIsR0FBa0MsS0FBbEQ7QUFDQSxZQUFNLFlBQVksVUFBbEIsSUFBZ0MsV0FBVyxDQUFYLENBQWhDO0FBQ0EsWUFBTSxZQUFZLFFBQWxCLElBQThCLFdBQVcsQ0FBWCxDQUE5Qjs7QUFFQTtBQUNEO0FBQ0Y7Ozs7QUFJRCxXQUFTLFNBQVQsR0FBcUI7QUFDbkIsUUFBSSxtQkFBbUIsQ0FBdkI7QUFBQSxRQUNJLGtCQUFrQixRQUFRLEdBQVIsQ0FEdEI7QUFBQSxRQUVJLGNBQWMsZ0JBQWdCLEtBQWhCLENBQXNCLDRDQUF0QixDQUZsQjs7QUFJQSxRQUFJLE9BQU87QUFDVCxnQkFBVSxDQUFDLFlBQVksQ0FBWixDQURGO0FBRVQsZ0JBQVUsQ0FBQyxZQUFZLENBQVosQ0FBRCxJQUFtQixDQUZwQjtBQUdULGdCQUFVLENBQUMsWUFBWSxDQUFaLENBSEY7QUFJVCxnQkFBVSxDQUFDLFlBQVksQ0FBWixDQUFELElBQW1CLENBSnBCO0FBS1QsYUFBTyxFQUxFO0FBTVQsc0JBQWdCO0FBTlAsS0FBWDs7QUFTQSxRQUFJLFdBQVcsQ0FBZjtBQUFBLFFBQ0ksY0FBYyxDQURsQjtBQUVBLFdBQU8sSUFBSSxRQUFRLE1BQW5CLEVBQTJCLEdBQTNCLEVBQWdDOzs7QUFHOUIsVUFBSSxRQUFRLENBQVIsRUFBVyxPQUFYLENBQW1CLE1BQW5CLE1BQStCLENBQS9CLElBQ00sSUFBSSxDQUFKLEdBQVEsUUFBUSxNQUR0QixJQUVLLFFBQVEsSUFBSSxDQUFaLEVBQWUsT0FBZixDQUF1QixNQUF2QixNQUFtQyxDQUZ4QyxJQUdLLFFBQVEsSUFBSSxDQUFaLEVBQWUsT0FBZixDQUF1QixJQUF2QixNQUFpQyxDQUgxQyxFQUc2QztBQUN6QztBQUNIO0FBQ0QsVUFBSSxZQUFZLFFBQVEsQ0FBUixFQUFXLENBQVgsQ0FBaEI7O0FBRUEsVUFBSSxjQUFjLEdBQWQsSUFBcUIsY0FBYyxHQUFuQyxJQUEwQyxjQUFjLEdBQXhELElBQStELGNBQWMsSUFBakYsRUFBdUY7QUFDckYsYUFBSyxLQUFMLENBQVcsSUFBWCxDQUFnQixRQUFRLENBQVIsQ0FBaEI7QUFDQSxhQUFLLGNBQUwsQ0FBb0IsSUFBcEIsQ0FBeUIsV0FBVyxDQUFYLEtBQWlCLElBQTFDOztBQUVBLFlBQUksY0FBYyxHQUFsQixFQUF1QjtBQUNyQjtBQUNELFNBRkQsTUFFTyxJQUFJLGNBQWMsR0FBbEIsRUFBdUI7QUFDNUI7QUFDRCxTQUZNLE1BRUEsSUFBSSxjQUFjLEdBQWxCLEVBQXVCO0FBQzVCO0FBQ0E7QUFDRDtBQUNGLE9BWkQsTUFZTztBQUNMO0FBQ0Q7QUFDRjs7O0FBR0QsUUFBSSxDQUFDLFFBQUQsSUFBYSxLQUFLLFFBQUwsS0FBa0IsQ0FBbkMsRUFBc0M7QUFDcEMsV0FBSyxRQUFMLEdBQWdCLENBQWhCO0FBQ0Q7QUFDRCxRQUFJLENBQUMsV0FBRCxJQUFnQixLQUFLLFFBQUwsS0FBa0IsQ0FBdEMsRUFBeUM7QUFDdkMsV0FBSyxRQUFMLEdBQWdCLENBQWhCO0FBQ0Q7OztBQUdELFFBQUksUUFBUSxNQUFaLEVBQW9CO0FBQ2xCLFVBQUksYUFBYSxLQUFLLFFBQXRCLEVBQWdDO0FBQzlCLGNBQU0sSUFBSSxLQUFKLENBQVUsc0RBQXNELG1CQUFtQixDQUF6RSxDQUFWLENBQU47QUFDRDtBQUNELFVBQUksZ0JBQWdCLEtBQUssUUFBekIsRUFBbUM7QUFDakMsY0FBTSxJQUFJLEtBQUosQ0FBVSx3REFBd0QsbUJBQW1CLENBQTNFLENBQVYsQ0FBTjtBQUNEO0FBQ0Y7O0FBRUQsV0FBTyxJQUFQO0FBQ0Q7O0FBRUQsU0FBTyxJQUFJLFFBQVEsTUFBbkIsRUFBMkI7QUFDekI7QUFDRDs7QUFFRCxTQUFPLElBQVA7QUFDRCIsImZpbGUiOiJwYXJzZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBwYXJzZVBhdGNoKHVuaURpZmYsIG9wdGlvbnMgPSB7fSkge1xuICBsZXQgZGlmZnN0ciA9IHVuaURpZmYuc3BsaXQoL1xcclxcbnxbXFxuXFx2XFxmXFxyXFx4ODVdLyksXG4gICAgICBkZWxpbWl0ZXJzID0gdW5pRGlmZi5tYXRjaCgvXFxyXFxufFtcXG5cXHZcXGZcXHJcXHg4NV0vZykgfHwgW10sXG4gICAgICBsaXN0ID0gW10sXG4gICAgICBpID0gMDtcblxuICBmdW5jdGlvbiBwYXJzZUluZGV4KCkge1xuICAgIGxldCBpbmRleCA9IHt9O1xuICAgIGxpc3QucHVzaChpbmRleCk7XG5cbiAgICAvLyBQYXJzZSBkaWZmIG1ldGFkYXRhXG4gICAgd2hpbGUgKGkgPCBkaWZmc3RyLmxlbmd0aCkge1xuICAgICAgbGV0IGxpbmUgPSBkaWZmc3RyW2ldO1xuXG4gICAgICAvLyBGaWxlIGhlYWRlciBmb3VuZCwgZW5kIHBhcnNpbmcgZGlmZiBtZXRhZGF0YVxuICAgICAgaWYgKC9eKFxcLVxcLVxcLXxcXCtcXCtcXCt8QEApXFxzLy50ZXN0KGxpbmUpKSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuXG4gICAgICAvLyBEaWZmIGluZGV4XG4gICAgICBsZXQgaGVhZGVyID0gKC9eKD86SW5kZXg6fGRpZmYoPzogLXIgXFx3KykrKVxccysoLis/KVxccyokLykuZXhlYyhsaW5lKTtcbiAgICAgIGlmIChoZWFkZXIpIHtcbiAgICAgICAgaW5kZXguaW5kZXggPSBoZWFkZXJbMV07XG4gICAgICB9XG5cbiAgICAgIGkrKztcbiAgICB9XG5cbiAgICAvLyBQYXJzZSBmaWxlIGhlYWRlcnMgaWYgdGhleSBhcmUgZGVmaW5lZC4gVW5pZmllZCBkaWZmIHJlcXVpcmVzIHRoZW0sIGJ1dFxuICAgIC8vIHRoZXJlJ3Mgbm8gdGVjaG5pY2FsIGlzc3VlcyB0byBoYXZlIGFuIGlzb2xhdGVkIGh1bmsgd2l0aG91dCBmaWxlIGhlYWRlclxuICAgIHBhcnNlRmlsZUhlYWRlcihpbmRleCk7XG4gICAgcGFyc2VGaWxlSGVhZGVyKGluZGV4KTtcblxuICAgIC8vIFBhcnNlIGh1bmtzXG4gICAgaW5kZXguaHVua3MgPSBbXTtcblxuICAgIHdoaWxlIChpIDwgZGlmZnN0ci5sZW5ndGgpIHtcbiAgICAgIGxldCBsaW5lID0gZGlmZnN0cltpXTtcblxuICAgICAgaWYgKC9eKEluZGV4OnxkaWZmfFxcLVxcLVxcLXxcXCtcXCtcXCspXFxzLy50ZXN0KGxpbmUpKSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfSBlbHNlIGlmICgvXkBALy50ZXN0KGxpbmUpKSB7XG4gICAgICAgIGluZGV4Lmh1bmtzLnB1c2gocGFyc2VIdW5rKCkpO1xuICAgICAgfSBlbHNlIGlmIChsaW5lICYmIG9wdGlvbnMuc3RyaWN0KSB7XG4gICAgICAgIC8vIElnbm9yZSB1bmV4cGVjdGVkIGNvbnRlbnQgdW5sZXNzIGluIHN0cmljdCBtb2RlXG4gICAgICAgIHRocm93IG5ldyBFcnJvcignVW5rbm93biBsaW5lICcgKyAoaSArIDEpICsgJyAnICsgSlNPTi5zdHJpbmdpZnkobGluZSkpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaSsrO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIC8vIFBhcnNlcyB0aGUgLS0tIGFuZCArKysgaGVhZGVycywgaWYgbm9uZSBhcmUgZm91bmQsIG5vIGxpbmVzXG4gIC8vIGFyZSBjb25zdW1lZC5cbiAgZnVuY3Rpb24gcGFyc2VGaWxlSGVhZGVyKGluZGV4KSB7XG4gICAgY29uc3QgaGVhZGVyUGF0dGVybiA9IC9eKC0tLXxcXCtcXCtcXCspXFxzKyhbXFxTIF0qKSg/OlxcdCguKj8pXFxzKik/JC87XG4gICAgY29uc3QgZmlsZUhlYWRlciA9IGhlYWRlclBhdHRlcm4uZXhlYyhkaWZmc3RyW2ldKTtcbiAgICBpZiAoZmlsZUhlYWRlcikge1xuICAgICAgbGV0IGtleVByZWZpeCA9IGZpbGVIZWFkZXJbMV0gPT09ICctLS0nID8gJ29sZCcgOiAnbmV3JztcbiAgICAgIGluZGV4W2tleVByZWZpeCArICdGaWxlTmFtZSddID0gZmlsZUhlYWRlclsyXTtcbiAgICAgIGluZGV4W2tleVByZWZpeCArICdIZWFkZXInXSA9IGZpbGVIZWFkZXJbM107XG5cbiAgICAgIGkrKztcbiAgICB9XG4gIH1cblxuICAvLyBQYXJzZXMgYSBodW5rXG4gIC8vIFRoaXMgYXNzdW1lcyB0aGF0IHdlIGFyZSBhdCB0aGUgc3RhcnQgb2YgYSBodW5rLlxuICBmdW5jdGlvbiBwYXJzZUh1bmsoKSB7XG4gICAgbGV0IGNodW5rSGVhZGVySW5kZXggPSBpLFxuICAgICAgICBjaHVua0hlYWRlckxpbmUgPSBkaWZmc3RyW2krK10sXG4gICAgICAgIGNodW5rSGVhZGVyID0gY2h1bmtIZWFkZXJMaW5lLnNwbGl0KC9AQCAtKFxcZCspKD86LChcXGQrKSk/IFxcKyhcXGQrKSg/OiwoXFxkKykpPyBAQC8pO1xuXG4gICAgbGV0IGh1bmsgPSB7XG4gICAgICBvbGRTdGFydDogK2NodW5rSGVhZGVyWzFdLFxuICAgICAgb2xkTGluZXM6ICtjaHVua0hlYWRlclsyXSB8fCAxLFxuICAgICAgbmV3U3RhcnQ6ICtjaHVua0hlYWRlclszXSxcbiAgICAgIG5ld0xpbmVzOiArY2h1bmtIZWFkZXJbNF0gfHwgMSxcbiAgICAgIGxpbmVzOiBbXSxcbiAgICAgIGxpbmVkZWxpbWl0ZXJzOiBbXVxuICAgIH07XG5cbiAgICBsZXQgYWRkQ291bnQgPSAwLFxuICAgICAgICByZW1vdmVDb3VudCA9IDA7XG4gICAgZm9yICg7IGkgPCBkaWZmc3RyLmxlbmd0aDsgaSsrKSB7XG4gICAgICAvLyBMaW5lcyBzdGFydGluZyB3aXRoICctLS0nIGNvdWxkIGJlIG1pc3Rha2VuIGZvciB0aGUgXCJyZW1vdmUgbGluZVwiIG9wZXJhdGlvblxuICAgICAgLy8gQnV0IHRoZXkgY291bGQgYmUgdGhlIGhlYWRlciBmb3IgdGhlIG5leHQgZmlsZS4gVGhlcmVmb3JlIHBydW5lIHN1Y2ggY2FzZXMgb3V0LlxuICAgICAgaWYgKGRpZmZzdHJbaV0uaW5kZXhPZignLS0tICcpID09PSAwXG4gICAgICAgICAgICAmJiAoaSArIDIgPCBkaWZmc3RyLmxlbmd0aClcbiAgICAgICAgICAgICYmIGRpZmZzdHJbaSArIDFdLmluZGV4T2YoJysrKyAnKSA9PT0gMFxuICAgICAgICAgICAgJiYgZGlmZnN0cltpICsgMl0uaW5kZXhPZignQEAnKSA9PT0gMCkge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgbGV0IG9wZXJhdGlvbiA9IGRpZmZzdHJbaV1bMF07XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICcrJyB8fCBvcGVyYXRpb24gPT09ICctJyB8fCBvcGVyYXRpb24gPT09ICcgJyB8fCBvcGVyYXRpb24gPT09ICdcXFxcJykge1xuICAgICAgICBodW5rLmxpbmVzLnB1c2goZGlmZnN0cltpXSk7XG4gICAgICAgIGh1bmsubGluZWRlbGltaXRlcnMucHVzaChkZWxpbWl0ZXJzW2ldIHx8ICdcXG4nKTtcblxuICAgICAgICBpZiAob3BlcmF0aW9uID09PSAnKycpIHtcbiAgICAgICAgICBhZGRDb3VudCsrO1xuICAgICAgICB9IGVsc2UgaWYgKG9wZXJhdGlvbiA9PT0gJy0nKSB7XG4gICAgICAgICAgcmVtb3ZlQ291bnQrKztcbiAgICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICcgJykge1xuICAgICAgICAgIGFkZENvdW50Kys7XG4gICAgICAgICAgcmVtb3ZlQ291bnQrKztcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gSGFuZGxlIHRoZSBlbXB0eSBibG9jayBjb3VudCBjYXNlXG4gICAgaWYgKCFhZGRDb3VudCAmJiBodW5rLm5ld0xpbmVzID09PSAxKSB7XG4gICAgICBodW5rLm5ld0xpbmVzID0gMDtcbiAgICB9XG4gICAgaWYgKCFyZW1vdmVDb3VudCAmJiBodW5rLm9sZExpbmVzID09PSAxKSB7XG4gICAgICBodW5rLm9sZExpbmVzID0gMDtcbiAgICB9XG5cbiAgICAvLyBQZXJmb3JtIG9wdGlvbmFsIHNhbml0eSBjaGVja2luZ1xuICAgIGlmIChvcHRpb25zLnN0cmljdCkge1xuICAgICAgaWYgKGFkZENvdW50ICE9PSBodW5rLm5ld0xpbmVzKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcignQWRkZWQgbGluZSBjb3VudCBkaWQgbm90IG1hdGNoIGZvciBodW5rIGF0IGxpbmUgJyArIChjaHVua0hlYWRlckluZGV4ICsgMSkpO1xuICAgICAgfVxuICAgICAgaWYgKHJlbW92ZUNvdW50ICE9PSBodW5rLm9sZExpbmVzKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcignUmVtb3ZlZCBsaW5lIGNvdW50IGRpZCBub3QgbWF0Y2ggZm9yIGh1bmsgYXQgbGluZSAnICsgKGNodW5rSGVhZGVySW5kZXggKyAxKSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGh1bms7XG4gIH1cblxuICB3aGlsZSAoaSA8IGRpZmZzdHIubGVuZ3RoKSB7XG4gICAgcGFyc2VJbmRleCgpO1xuICB9XG5cbiAgcmV0dXJuIGxpc3Q7XG59XG4iXX0=
-
-
-/***/ },
-/* 151 */
-/***/ function(module, exports) {
-
- /*istanbul ignore start*/"use strict";
-
- exports.__esModule = true;
-
- exports["default"] = /*istanbul ignore end*/function (start, minLine, maxLine) {
- var wantForward = true,
- backwardExhausted = false,
- forwardExhausted = false,
- localOffset = 1;
-
- return function iterator() {
- if (wantForward && !forwardExhausted) {
- if (backwardExhausted) {
- localOffset++;
- } else {
- wantForward = false;
- }
-
- // Check if trying to fit beyond text length, and if not, check it fits
- // after offset location (or desired location on first iteration)
- if (start + localOffset <= maxLine) {
- return localOffset;
- }
-
- forwardExhausted = true;
- }
-
- if (!backwardExhausted) {
- if (!forwardExhausted) {
- wantForward = true;
- }
-
- // Check if trying to fit before text beginning, and if not, check it fits
- // before offset location
- if (minLine <= start - localOffset) {
- return -localOffset++;
- }
-
- backwardExhausted = true;
- return iterator();
- }
-
- // We tried to fit hunk before text beginning and beyond text lenght, then
- // hunk can't fit on the text. Return undefined
- };
- };
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7NENBR2UsVUFBUyxLQUFULEVBQWdCLE9BQWhCLEVBQXlCLE9BQXpCLEVBQWtDO0FBQy9DLE1BQUksY0FBYyxJQUFsQjtBQUFBLE1BQ0ksb0JBQW9CLEtBRHhCO0FBQUEsTUFFSSxtQkFBbUIsS0FGdkI7QUFBQSxNQUdJLGNBQWMsQ0FIbEI7O0FBS0EsU0FBTyxTQUFTLFFBQVQsR0FBb0I7QUFDekIsUUFBSSxlQUFlLENBQUMsZ0JBQXBCLEVBQXNDO0FBQ3BDLFVBQUksaUJBQUosRUFBdUI7QUFDckI7QUFDRCxPQUZELE1BRU87QUFDTCxzQkFBYyxLQUFkO0FBQ0Q7Ozs7QUFJRCxVQUFJLFFBQVEsV0FBUixJQUF1QixPQUEzQixFQUFvQztBQUNsQyxlQUFPLFdBQVA7QUFDRDs7QUFFRCx5QkFBbUIsSUFBbkI7QUFDRDs7QUFFRCxRQUFJLENBQUMsaUJBQUwsRUFBd0I7QUFDdEIsVUFBSSxDQUFDLGdCQUFMLEVBQXVCO0FBQ3JCLHNCQUFjLElBQWQ7QUFDRDs7OztBQUlELFVBQUksV0FBVyxRQUFRLFdBQXZCLEVBQW9DO0FBQ2xDLGVBQU8sQ0FBQyxhQUFSO0FBQ0Q7O0FBRUQsMEJBQW9CLElBQXBCO0FBQ0EsYUFBTyxVQUFQO0FBQ0Q7Ozs7QUFJRixHQWxDRDtBQW1DRCxDIiwiZmlsZSI6ImRpc3RhbmNlLWl0ZXJhdG9yLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gSXRlcmF0b3IgdGhhdCB0cmF2ZXJzZXMgaW4gdGhlIHJhbmdlIG9mIFttaW4sIG1heF0sIHN0ZXBwaW5nXG4vLyBieSBkaXN0YW5jZSBmcm9tIGEgZ2l2ZW4gc3RhcnQgcG9zaXRpb24uIEkuZS4gZm9yIFswLCA0XSwgd2l0aFxuLy8gc3RhcnQgb2YgMiwgdGhpcyB3aWxsIGl0ZXJhdGUgMiwgMywgMSwgNCwgMC5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKHN0YXJ0LCBtaW5MaW5lLCBtYXhMaW5lKSB7XG4gIGxldCB3YW50Rm9yd2FyZCA9IHRydWUsXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IGZhbHNlLFxuICAgICAgZm9yd2FyZEV4aGF1c3RlZCA9IGZhbHNlLFxuICAgICAgbG9jYWxPZmZzZXQgPSAxO1xuXG4gIHJldHVybiBmdW5jdGlvbiBpdGVyYXRvcigpIHtcbiAgICBpZiAod2FudEZvcndhcmQgJiYgIWZvcndhcmRFeGhhdXN0ZWQpIHtcbiAgICAgIGlmIChiYWNrd2FyZEV4aGF1c3RlZCkge1xuICAgICAgICBsb2NhbE9mZnNldCsrO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgd2FudEZvcndhcmQgPSBmYWxzZTtcbiAgICAgIH1cblxuICAgICAgLy8gQ2hlY2sgaWYgdHJ5aW5nIHRvIGZpdCBiZXlvbmQgdGV4dCBsZW5ndGgsIGFuZCBpZiBub3QsIGNoZWNrIGl0IGZpdHNcbiAgICAgIC8vIGFmdGVyIG9mZnNldCBsb2NhdGlvbiAob3IgZGVzaXJlZCBsb2NhdGlvbiBvbiBmaXJzdCBpdGVyYXRpb24pXG4gICAgICBpZiAoc3RhcnQgKyBsb2NhbE9mZnNldCA8PSBtYXhMaW5lKSB7XG4gICAgICAgIHJldHVybiBsb2NhbE9mZnNldDtcbiAgICAgIH1cblxuICAgICAgZm9yd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgfVxuXG4gICAgaWYgKCFiYWNrd2FyZEV4aGF1c3RlZCkge1xuICAgICAgaWYgKCFmb3J3YXJkRXhoYXVzdGVkKSB7XG4gICAgICAgIHdhbnRGb3J3YXJkID0gdHJ1ZTtcbiAgICAgIH1cblxuICAgICAgLy8gQ2hlY2sgaWYgdHJ5aW5nIHRvIGZpdCBiZWZvcmUgdGV4dCBiZWdpbm5pbmcsIGFuZCBpZiBub3QsIGNoZWNrIGl0IGZpdHNcbiAgICAgIC8vIGJlZm9yZSBvZmZzZXQgbG9jYXRpb25cbiAgICAgIGlmIChtaW5MaW5lIDw9IHN0YXJ0IC0gbG9jYWxPZmZzZXQpIHtcbiAgICAgICAgcmV0dXJuIC1sb2NhbE9mZnNldCsrO1xuICAgICAgfVxuXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgICByZXR1cm4gaXRlcmF0b3IoKTtcbiAgICB9XG5cbiAgICAvLyBXZSB0cmllZCB0byBmaXQgaHVuayBiZWZvcmUgdGV4dCBiZWdpbm5pbmcgYW5kIGJleW9uZCB0ZXh0IGxlbmdodCwgdGhlblxuICAgIC8vIGh1bmsgY2FuJ3QgZml0IG9uIHRoZSB0ZXh0LiBSZXR1cm4gdW5kZWZpbmVkXG4gIH07XG59XG4iXX0=
-
-
-/***/ },
-/* 152 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports. /*istanbul ignore end*/structuredPatch = structuredPatch;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch;
- /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch;
-
- var /*istanbul ignore start*/_line = __webpack_require__(144) /*istanbul ignore end*/;
-
- /*istanbul ignore start*/
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
- /*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
- if (!options) {
- options = {};
- }
- if (typeof options.context === 'undefined') {
- options.context = 4;
- }
-
- var diff = /*istanbul ignore start*/(0, _line.diffLines) /*istanbul ignore end*/(oldStr, newStr, options);
- diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier
-
- function contextLines(lines) {
- return lines.map(function (entry) {
- return ' ' + entry;
- });
- }
-
- var hunks = [];
- var oldRangeStart = 0,
- newRangeStart = 0,
- curRange = [],
- oldLine = 1,
- newLine = 1;
- /*istanbul ignore start*/
- var _loop = function _loop( /*istanbul ignore end*/i) {
- var current = diff[i],
- lines = current.lines || current.value.replace(/\n$/, '').split('\n');
- current.lines = lines;
-
- if (current.added || current.removed) {
- /*istanbul ignore start*/
- var _curRange;
-
- /*istanbul ignore end*/
- // If we have previous context, start with that
- if (!oldRangeStart) {
- var prev = diff[i - 1];
- oldRangeStart = oldLine;
- newRangeStart = newLine;
-
- if (prev) {
- curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
- oldRangeStart -= curRange.length;
- newRangeStart -= curRange.length;
- }
- }
-
- // Output our changes
- /*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) {
- return (current.added ? '+' : '-') + entry;
- })));
-
- // Track the updated file position
- if (current.added) {
- newLine += lines.length;
- } else {
- oldLine += lines.length;
- }
- } else {
- // Identical context lines. Track line changes
- if (oldRangeStart) {
- // Close out any changes that have been output (or join overlapping)
- if (lines.length <= options.context * 2 && i < diff.length - 2) {
- /*istanbul ignore start*/
- var _curRange2;
-
- /*istanbul ignore end*/
- // Overlapping
- /*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines)));
- } else {
- /*istanbul ignore start*/
- var _curRange3;
-
- /*istanbul ignore end*/
- // end the range and output
- var contextSize = Math.min(lines.length, options.context);
- /*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize))));
-
- var hunk = {
- oldStart: oldRangeStart,
- oldLines: oldLine - oldRangeStart + contextSize,
- newStart: newRangeStart,
- newLines: newLine - newRangeStart + contextSize,
- lines: curRange
- };
- if (i >= diff.length - 2 && lines.length <= options.context) {
- // EOF is inside this hunk
- var oldEOFNewline = /\n$/.test(oldStr);
- var newEOFNewline = /\n$/.test(newStr);
- if (lines.length == 0 && !oldEOFNewline) {
- // special case: old has no eol and no trailing context; no-nl can end up before adds
- curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file');
- } else if (!oldEOFNewline || !newEOFNewline) {
- curRange.push('\\ No newline at end of file');
- }
- }
- hunks.push(hunk);
-
- oldRangeStart = 0;
- newRangeStart = 0;
- curRange = [];
- }
- }
- oldLine += lines.length;
- newLine += lines.length;
- }
- };
-
- for (var i = 0; i < diff.length; i++) {
- /*istanbul ignore start*/
- _loop( /*istanbul ignore end*/i);
- }
-
- return {
- oldFileName: oldFileName, newFileName: newFileName,
- oldHeader: oldHeader, newHeader: newHeader,
- hunks: hunks
- };
- }
-
- function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
- var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
-
- var ret = [];
- if (oldFileName == newFileName) {
- ret.push('Index: ' + oldFileName);
- }
- ret.push('===================================================================');
- ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
- ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
-
- for (var i = 0; i < diff.hunks.length; i++) {
- var hunk = diff.hunks[i];
- ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
- ret.push.apply(ret, hunk.lines);
- }
-
- return ret.join('\n') + '\n';
- }
-
- function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
- return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9jcmVhdGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O2dDQUVnQixlLEdBQUEsZTt5REFpR0EsbUIsR0FBQSxtQjt5REF3QkEsVyxHQUFBLFc7O0FBM0hoQixJLHlCQUFBLCtCLHdCQUFBOzs7Ozt1QkFFTyxTQUFTLGVBQVQsQ0FBeUIsV0FBekIsRUFBc0MsV0FBdEMsRUFBbUQsTUFBbkQsRUFBMkQsTUFBM0QsRUFBbUUsU0FBbkUsRUFBOEUsU0FBOUUsRUFBeUYsT0FBekYsRUFBa0c7QUFDdkcsTUFBSSxDQUFDLE9BQUwsRUFBYztBQUNaLGNBQVUsRUFBVjtBQUNEO0FBQ0QsTUFBSSxPQUFPLFFBQVEsT0FBZixLQUEyQixXQUEvQixFQUE0QztBQUMxQyxZQUFRLE9BQVIsR0FBa0IsQ0FBbEI7QUFDRDs7QUFFRCxNQUFNLE8seUJBQU8sb0Isd0JBQUEsQ0FBVSxNQUFWLEVBQWtCLE1BQWxCLEVBQTBCLE9BQTFCLENBQWI7QUFDQSxPQUFLLElBQUwsQ0FBVSxFQUFDLE9BQU8sRUFBUixFQUFZLE9BQU8sRUFBbkIsRUFBVixFOztBQUVBLFdBQVMsWUFBVCxDQUFzQixLQUF0QixFQUE2QjtBQUMzQixXQUFPLE1BQU0sR0FBTixDQUFVLFVBQVMsS0FBVCxFQUFnQjtBQUFFLGFBQU8sTUFBTSxLQUFiO0FBQXFCLEtBQWpELENBQVA7QUFDRDs7QUFFRCxNQUFJLFFBQVEsRUFBWjtBQUNBLE1BQUksZ0JBQWdCLENBQXBCO0FBQUEsTUFBdUIsZ0JBQWdCLENBQXZDO0FBQUEsTUFBMEMsV0FBVyxFQUFyRDtBQUFBLE1BQ0ksVUFBVSxDQURkO0FBQUEsTUFDaUIsVUFBVSxDQUQzQjs7QUFoQnVHLDZCLHdCQWtCOUYsQ0FsQjhGO0FBbUJyRyxRQUFNLFVBQVUsS0FBSyxDQUFMLENBQWhCO0FBQUEsUUFDTSxRQUFRLFFBQVEsS0FBUixJQUFpQixRQUFRLEtBQVIsQ0FBYyxPQUFkLENBQXNCLEtBQXRCLEVBQTZCLEVBQTdCLEVBQWlDLEtBQWpDLENBQXVDLElBQXZDLENBRC9CO0FBRUEsWUFBUSxLQUFSLEdBQWdCLEtBQWhCOztBQUVBLFFBQUksUUFBUSxLQUFSLElBQWlCLFFBQVEsT0FBN0IsRUFBc0M7O0FBQUE7Ozs7QUFFcEMsVUFBSSxDQUFDLGFBQUwsRUFBb0I7QUFDbEIsWUFBTSxPQUFPLEtBQUssSUFBSSxDQUFULENBQWI7QUFDQSx3QkFBZ0IsT0FBaEI7QUFDQSx3QkFBZ0IsT0FBaEI7O0FBRUEsWUFBSSxJQUFKLEVBQVU7QUFDUixxQkFBVyxRQUFRLE9BQVIsR0FBa0IsQ0FBbEIsR0FBc0IsYUFBYSxLQUFLLEtBQUwsQ0FBVyxLQUFYLENBQWlCLENBQUMsUUFBUSxPQUExQixDQUFiLENBQXRCLEdBQXlFLEVBQXBGO0FBQ0EsMkJBQWlCLFNBQVMsTUFBMUI7QUFDQSwyQkFBaUIsU0FBUyxNQUExQjtBQUNEO0FBQ0Y7OzsrQkFHRCxhLHVCQUFBLFVBQVMsSUFBVCxDLDBCQUFBLEssd0JBQUEsQywwQkFBQSxTLHdCQUFBLEUseUJBQUEsbUIsd0JBQWtCLE1BQU0sR0FBTixDQUFVLFVBQVMsS0FBVCxFQUFnQjtBQUMxQyxlQUFPLENBQUMsUUFBUSxLQUFSLEdBQWdCLEdBQWhCLEdBQXNCLEdBQXZCLElBQThCLEtBQXJDO0FBQ0QsT0FGaUIsQ0FBbEI7OztBQUtBLFVBQUksUUFBUSxLQUFaLEVBQW1CO0FBQ2pCLG1CQUFXLE1BQU0sTUFBakI7QUFDRCxPQUZELE1BRU87QUFDTCxtQkFBVyxNQUFNLE1BQWpCO0FBQ0Q7QUFDRixLQXpCRCxNQXlCTzs7QUFFTCxVQUFJLGFBQUosRUFBbUI7O0FBRWpCLFlBQUksTUFBTSxNQUFOLElBQWdCLFFBQVEsT0FBUixHQUFrQixDQUFsQyxJQUF1QyxJQUFJLEtBQUssTUFBTCxHQUFjLENBQTdELEVBQWdFOztBQUFBOzs7O21DQUU5RCxjLHVCQUFBLFVBQVMsSUFBVCxDLDBCQUFBLEssd0JBQUEsQywwQkFBQSxVLHdCQUFBLEUseUJBQUEsbUIsd0JBQWtCLGFBQWEsS0FBYixDQUFsQjtBQUNELFNBSEQsTUFHTzs7QUFBQTs7OztBQUVMLGNBQUksY0FBYyxLQUFLLEdBQUwsQ0FBUyxNQUFNLE1BQWYsRUFBdUIsUUFBUSxPQUEvQixDQUFsQjttQ0FDQSxjLHVCQUFBLFVBQVMsSUFBVCxDLDBCQUFBLEssd0JBQUEsQywwQkFBQSxVLHdCQUFBLEUseUJBQUEsbUIsd0JBQWtCLGFBQWEsTUFBTSxLQUFOLENBQVksQ0FBWixFQUFlLFdBQWYsQ0FBYixDQUFsQjs7QUFFQSxjQUFJLE9BQU87QUFDVCxzQkFBVSxhQUREO0FBRVQsc0JBQVcsVUFBVSxhQUFWLEdBQTBCLFdBRjVCO0FBR1Qsc0JBQVUsYUFIRDtBQUlULHNCQUFXLFVBQVUsYUFBVixHQUEwQixXQUo1QjtBQUtULG1CQUFPO0FBTEUsV0FBWDtBQU9BLGNBQUksS0FBSyxLQUFLLE1BQUwsR0FBYyxDQUFuQixJQUF3QixNQUFNLE1BQU4sSUFBZ0IsUUFBUSxPQUFwRCxFQUE2RDs7QUFFM0QsZ0JBQUksZ0JBQWlCLE1BQU0sSUFBTixDQUFXLE1BQVgsQ0FBckI7QUFDQSxnQkFBSSxnQkFBaUIsTUFBTSxJQUFOLENBQVcsTUFBWCxDQUFyQjtBQUNBLGdCQUFJLE1BQU0sTUFBTixJQUFnQixDQUFoQixJQUFxQixDQUFDLGFBQTFCLEVBQXlDOztBQUV2Qyx1QkFBUyxNQUFULENBQWdCLEtBQUssUUFBckIsRUFBK0IsQ0FBL0IsRUFBa0MsOEJBQWxDO0FBQ0QsYUFIRCxNQUdPLElBQUksQ0FBQyxhQUFELElBQWtCLENBQUMsYUFBdkIsRUFBc0M7QUFDM0MsdUJBQVMsSUFBVCxDQUFjLDhCQUFkO0FBQ0Q7QUFDRjtBQUNELGdCQUFNLElBQU4sQ0FBVyxJQUFYOztBQUVBLDBCQUFnQixDQUFoQjtBQUNBLDBCQUFnQixDQUFoQjtBQUNBLHFCQUFXLEVBQVg7QUFDRDtBQUNGO0FBQ0QsaUJBQVcsTUFBTSxNQUFqQjtBQUNBLGlCQUFXLE1BQU0sTUFBakI7QUFDRDtBQXZGb0c7O0FBa0J2RyxPQUFLLElBQUksSUFBSSxDQUFiLEVBQWdCLElBQUksS0FBSyxNQUF6QixFQUFpQyxHQUFqQyxFQUFzQzs7QUFBQSxVLHdCQUE3QixDQUE2QjtBQXNFckM7O0FBRUQsU0FBTztBQUNMLGlCQUFhLFdBRFIsRUFDcUIsYUFBYSxXQURsQztBQUVMLGVBQVcsU0FGTixFQUVpQixXQUFXLFNBRjVCO0FBR0wsV0FBTztBQUhGLEdBQVA7QUFLRDs7QUFFTSxTQUFTLG1CQUFULENBQTZCLFdBQTdCLEVBQTBDLFdBQTFDLEVBQXVELE1BQXZELEVBQStELE1BQS9ELEVBQXVFLFNBQXZFLEVBQWtGLFNBQWxGLEVBQTZGLE9BQTdGLEVBQXNHO0FBQzNHLE1BQU0sT0FBTyxnQkFBZ0IsV0FBaEIsRUFBNkIsV0FBN0IsRUFBMEMsTUFBMUMsRUFBa0QsTUFBbEQsRUFBMEQsU0FBMUQsRUFBcUUsU0FBckUsRUFBZ0YsT0FBaEYsQ0FBYjs7QUFFQSxNQUFNLE1BQU0sRUFBWjtBQUNBLE1BQUksZUFBZSxXQUFuQixFQUFnQztBQUM5QixRQUFJLElBQUosQ0FBUyxZQUFZLFdBQXJCO0FBQ0Q7QUFDRCxNQUFJLElBQUosQ0FBUyxxRUFBVDtBQUNBLE1BQUksSUFBSixDQUFTLFNBQVMsS0FBSyxXQUFkLElBQTZCLE9BQU8sS0FBSyxTQUFaLEtBQTBCLFdBQTFCLEdBQXdDLEVBQXhDLEdBQTZDLE9BQU8sS0FBSyxTQUF0RixDQUFUO0FBQ0EsTUFBSSxJQUFKLENBQVMsU0FBUyxLQUFLLFdBQWQsSUFBNkIsT0FBTyxLQUFLLFNBQVosS0FBMEIsV0FBMUIsR0FBd0MsRUFBeEMsR0FBNkMsT0FBTyxLQUFLLFNBQXRGLENBQVQ7O0FBRUEsT0FBSyxJQUFJLElBQUksQ0FBYixFQUFnQixJQUFJLEtBQUssS0FBTCxDQUFXLE1BQS9CLEVBQXVDLEdBQXZDLEVBQTRDO0FBQzFDLFFBQU0sT0FBTyxLQUFLLEtBQUwsQ0FBVyxDQUFYLENBQWI7QUFDQSxRQUFJLElBQUosQ0FDRSxTQUFTLEtBQUssUUFBZCxHQUF5QixHQUF6QixHQUErQixLQUFLLFFBQXBDLEdBQ0UsSUFERixHQUNTLEtBQUssUUFEZCxHQUN5QixHQUR6QixHQUMrQixLQUFLLFFBRHBDLEdBRUUsS0FISjtBQUtBLFFBQUksSUFBSixDQUFTLEtBQVQsQ0FBZSxHQUFmLEVBQW9CLEtBQUssS0FBekI7QUFDRDs7QUFFRCxTQUFPLElBQUksSUFBSixDQUFTLElBQVQsSUFBaUIsSUFBeEI7QUFDRDs7QUFFTSxTQUFTLFdBQVQsQ0FBcUIsUUFBckIsRUFBK0IsTUFBL0IsRUFBdUMsTUFBdkMsRUFBK0MsU0FBL0MsRUFBMEQsU0FBMUQsRUFBcUUsT0FBckUsRUFBOEU7QUFDbkYsU0FBTyxvQkFBb0IsUUFBcEIsRUFBOEIsUUFBOUIsRUFBd0MsTUFBeEMsRUFBZ0QsTUFBaEQsRUFBd0QsU0FBeEQsRUFBbUUsU0FBbkUsRUFBOEUsT0FBOUUsQ0FBUDtBQUNEIiwiZmlsZSI6ImNyZWF0ZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7ZGlmZkxpbmVzfSBmcm9tICcuLi9kaWZmL2xpbmUnO1xuXG5leHBvcnQgZnVuY3Rpb24gc3RydWN0dXJlZFBhdGNoKG9sZEZpbGVOYW1lLCBuZXdGaWxlTmFtZSwgb2xkU3RyLCBuZXdTdHIsIG9sZEhlYWRlciwgbmV3SGVhZGVyLCBvcHRpb25zKSB7XG4gIGlmICghb3B0aW9ucykge1xuICAgIG9wdGlvbnMgPSB7fTtcbiAgfVxuICBpZiAodHlwZW9mIG9wdGlvbnMuY29udGV4dCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICBvcHRpb25zLmNvbnRleHQgPSA0O1xuICB9XG5cbiAgY29uc3QgZGlmZiA9IGRpZmZMaW5lcyhvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG4gIGRpZmYucHVzaCh7dmFsdWU6ICcnLCBsaW5lczogW119KTsgICAvLyBBcHBlbmQgYW4gZW1wdHkgdmFsdWUgdG8gbWFrZSBjbGVhbnVwIGVhc2llclxuXG4gIGZ1bmN0aW9uIGNvbnRleHRMaW5lcyhsaW5lcykge1xuICAgIHJldHVybiBsaW5lcy5tYXAoZnVuY3Rpb24oZW50cnkpIHsgcmV0dXJuICcgJyArIGVudHJ5OyB9KTtcbiAgfVxuXG4gIGxldCBodW5rcyA9IFtdO1xuICBsZXQgb2xkUmFuZ2VTdGFydCA9IDAsIG5ld1JhbmdlU3RhcnQgPSAwLCBjdXJSYW5nZSA9IFtdLFxuICAgICAgb2xkTGluZSA9IDEsIG5ld0xpbmUgPSAxO1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGRpZmYubGVuZ3RoOyBpKyspIHtcbiAgICBjb25zdCBjdXJyZW50ID0gZGlmZltpXSxcbiAgICAgICAgICBsaW5lcyA9IGN1cnJlbnQubGluZXMgfHwgY3VycmVudC52YWx1ZS5yZXBsYWNlKC9cXG4kLywgJycpLnNwbGl0KCdcXG4nKTtcbiAgICBjdXJyZW50LmxpbmVzID0gbGluZXM7XG5cbiAgICBpZiAoY3VycmVudC5hZGRlZCB8fCBjdXJyZW50LnJlbW92ZWQpIHtcbiAgICAgIC8vIElmIHdlIGhhdmUgcHJldmlvdXMgY29udGV4dCwgc3RhcnQgd2l0aCB0aGF0XG4gICAgICBpZiAoIW9sZFJhbmdlU3RhcnQpIHtcbiAgICAgICAgY29uc3QgcHJldiA9IGRpZmZbaSAtIDFdO1xuICAgICAgICBvbGRSYW5nZVN0YXJ0ID0gb2xkTGluZTtcbiAgICAgICAgbmV3UmFuZ2VTdGFydCA9IG5ld0xpbmU7XG5cbiAgICAgICAgaWYgKHByZXYpIHtcbiAgICAgICAgICBjdXJSYW5nZSA9IG9wdGlvbnMuY29udGV4dCA+IDAgPyBjb250ZXh0TGluZXMocHJldi5saW5lcy5zbGljZSgtb3B0aW9ucy5jb250ZXh0KSkgOiBbXTtcbiAgICAgICAgICBvbGRSYW5nZVN0YXJ0IC09IGN1clJhbmdlLmxlbmd0aDtcbiAgICAgICAgICBuZXdSYW5nZVN0YXJ0IC09IGN1clJhbmdlLmxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBPdXRwdXQgb3VyIGNoYW5nZXNcbiAgICAgIGN1clJhbmdlLnB1c2goLi4uIGxpbmVzLm1hcChmdW5jdGlvbihlbnRyeSkge1xuICAgICAgICByZXR1cm4gKGN1cnJlbnQuYWRkZWQgPyAnKycgOiAnLScpICsgZW50cnk7XG4gICAgICB9KSk7XG5cbiAgICAgIC8vIFRyYWNrIHRoZSB1cGRhdGVkIGZpbGUgcG9zaXRpb25cbiAgICAgIGlmIChjdXJyZW50LmFkZGVkKSB7XG4gICAgICAgIG5ld0xpbmUgKz0gbGluZXMubGVuZ3RoO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgb2xkTGluZSArPSBsaW5lcy5sZW5ndGg7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIC8vIElkZW50aWNhbCBjb250ZXh0IGxpbmVzLiBUcmFjayBsaW5lIGNoYW5nZXNcbiAgICAgIGlmIChvbGRSYW5nZVN0YXJ0KSB7XG4gICAgICAgIC8vIENsb3NlIG91dCBhbnkgY2hhbmdlcyB0aGF0IGhhdmUgYmVlbiBvdXRwdXQgKG9yIGpvaW4gb3ZlcmxhcHBpbmcpXG4gICAgICAgIGlmIChsaW5lcy5sZW5ndGggPD0gb3B0aW9ucy5jb250ZXh0ICogMiAmJiBpIDwgZGlmZi5sZW5ndGggLSAyKSB7XG4gICAgICAgICAgLy8gT3ZlcmxhcHBpbmdcbiAgICAgICAgICBjdXJSYW5nZS5wdXNoKC4uLiBjb250ZXh0TGluZXMobGluZXMpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBlbmQgdGhlIHJhbmdlIGFuZCBvdXRwdXRcbiAgICAgICAgICBsZXQgY29udGV4dFNpemUgPSBNYXRoLm1pbihsaW5lcy5sZW5ndGgsIG9wdGlvbnMuY29udGV4dCk7XG4gICAgICAgICAgY3VyUmFuZ2UucHVzaCguLi4gY29udGV4dExpbmVzKGxpbmVzLnNsaWNlKDAsIGNvbnRleHRTaXplKSkpO1xuXG4gICAgICAgICAgbGV0IGh1bmsgPSB7XG4gICAgICAgICAgICBvbGRTdGFydDogb2xkUmFuZ2VTdGFydCxcbiAgICAgICAgICAgIG9sZExpbmVzOiAob2xkTGluZSAtIG9sZFJhbmdlU3RhcnQgKyBjb250ZXh0U2l6ZSksXG4gICAgICAgICAgICBuZXdTdGFydDogbmV3UmFuZ2VTdGFydCxcbiAgICAgICAgICAgIG5ld0xpbmVzOiAobmV3TGluZSAtIG5ld1JhbmdlU3RhcnQgKyBjb250ZXh0U2l6ZSksXG4gICAgICAgICAgICBsaW5lczogY3VyUmFuZ2VcbiAgICAgICAgICB9O1xuICAgICAgICAgIGlmIChpID49IGRpZmYubGVuZ3RoIC0gMiAmJiBsaW5lcy5sZW5ndGggPD0gb3B0aW9ucy5jb250ZXh0KSB7XG4gICAgICAgICAgICAvLyBFT0YgaXMgaW5zaWRlIHRoaXMgaHVua1xuICAgICAgICAgICAgbGV0IG9sZEVPRk5ld2xpbmUgPSAoL1xcbiQvLnRlc3Qob2xkU3RyKSk7XG4gICAgICAgICAgICBsZXQgbmV3RU9GTmV3bGluZSA9ICgvXFxuJC8udGVzdChuZXdTdHIpKTtcbiAgICAgICAgICAgIGlmIChsaW5lcy5sZW5ndGggPT0gMCAmJiAhb2xkRU9GTmV3bGluZSkge1xuICAgICAgICAgICAgICAvLyBzcGVjaWFsIGNhc2U6IG9sZCBoYXMgbm8gZW9sIGFuZCBubyB0cmFpbGluZyBjb250ZXh0OyBuby1ubCBjYW4gZW5kIHVwIGJlZm9yZSBhZGRzXG4gICAgICAgICAgICAgIGN1clJhbmdlLnNwbGljZShodW5rLm9sZExpbmVzLCAwLCAnXFxcXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlJyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCFvbGRFT0ZOZXdsaW5lIHx8ICFuZXdFT0ZOZXdsaW5lKSB7XG4gICAgICAgICAgICAgIGN1clJhbmdlLnB1c2goJ1xcXFwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBodW5rcy5wdXNoKGh1bmspO1xuXG4gICAgICAgICAgb2xkUmFuZ2VTdGFydCA9IDA7XG4gICAgICAgICAgbmV3UmFuZ2VTdGFydCA9IDA7XG4gICAgICAgICAgY3VyUmFuZ2UgPSBbXTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgb2xkTGluZSArPSBsaW5lcy5sZW5ndGg7XG4gICAgICBuZXdMaW5lICs9IGxpbmVzLmxlbmd0aDtcbiAgICB9XG4gIH1cblxuICByZXR1cm4ge1xuICAgIG9sZEZpbGVOYW1lOiBvbGRGaWxlTmFtZSwgbmV3RmlsZU5hbWU6IG5ld0ZpbGVOYW1lLFxuICAgIG9sZEhlYWRlcjogb2xkSGVhZGVyLCBuZXdIZWFkZXI6IG5ld0hlYWRlcixcbiAgICBodW5rczogaHVua3NcbiAgfTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGNyZWF0ZVR3b0ZpbGVzUGF0Y2gob2xkRmlsZU5hbWUsIG5ld0ZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpIHtcbiAgY29uc3QgZGlmZiA9IHN0cnVjdHVyZWRQYXRjaChvbGRGaWxlTmFtZSwgbmV3RmlsZU5hbWUsIG9sZFN0ciwgbmV3U3RyLCBvbGRIZWFkZXIsIG5ld0hlYWRlciwgb3B0aW9ucyk7XG5cbiAgY29uc3QgcmV0ID0gW107XG4gIGlmIChvbGRGaWxlTmFtZSA9PSBuZXdGaWxlTmFtZSkge1xuICAgIHJldC5wdXNoKCdJbmRleDogJyArIG9sZEZpbGVOYW1lKTtcbiAgfVxuICByZXQucHVzaCgnPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PScpO1xuICByZXQucHVzaCgnLS0tICcgKyBkaWZmLm9sZEZpbGVOYW1lICsgKHR5cGVvZiBkaWZmLm9sZEhlYWRlciA9PT0gJ3VuZGVmaW5lZCcgPyAnJyA6ICdcXHQnICsgZGlmZi5vbGRIZWFkZXIpKTtcbiAgcmV0LnB1c2goJysrKyAnICsgZGlmZi5uZXdGaWxlTmFtZSArICh0eXBlb2YgZGlmZi5uZXdIZWFkZXIgPT09ICd1bmRlZmluZWQnID8gJycgOiAnXFx0JyArIGRpZmYubmV3SGVhZGVyKSk7XG5cbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBkaWZmLmh1bmtzLmxlbmd0aDsgaSsrKSB7XG4gICAgY29uc3QgaHVuayA9IGRpZmYuaHVua3NbaV07XG4gICAgcmV0LnB1c2goXG4gICAgICAnQEAgLScgKyBodW5rLm9sZFN0YXJ0ICsgJywnICsgaHVuay5vbGRMaW5lc1xuICAgICAgKyAnICsnICsgaHVuay5uZXdTdGFydCArICcsJyArIGh1bmsubmV3TGluZXNcbiAgICAgICsgJyBAQCdcbiAgICApO1xuICAgIHJldC5wdXNoLmFwcGx5KHJldCwgaHVuay5saW5lcyk7XG4gIH1cblxuICByZXR1cm4gcmV0LmpvaW4oJ1xcbicpICsgJ1xcbic7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBjcmVhdGVQYXRjaChmaWxlTmFtZSwgb2xkU3RyLCBuZXdTdHIsIG9sZEhlYWRlciwgbmV3SGVhZGVyLCBvcHRpb25zKSB7XG4gIHJldHVybiBjcmVhdGVUd29GaWxlc1BhdGNoKGZpbGVOYW1lLCBmaWxlTmFtZSwgb2xkU3RyLCBuZXdTdHIsIG9sZEhlYWRlciwgbmV3SGVhZGVyLCBvcHRpb25zKTtcbn1cbiJdfQ==
-
-
-/***/ },
-/* 153 */
-/***/ function(module, exports) {
-
- /*istanbul ignore start*/"use strict";
-
- exports.__esModule = true;
- exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP;
- // See: http://code.google.com/p/google-diff-match-patch/wiki/API
- function convertChangesToDMP(changes) {
- var ret = [],
- change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
- operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
- for (var i = 0; i < changes.length; i++) {
- change = changes[i];
- if (change.added) {
- operation = 1;
- } else if (change.removed) {
- operation = -1;
- } else {
- operation = 0;
- }
-
- ret.push([operation, change.value]);
- }
- return ret;
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L2RtcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQ2dCLG1CLEdBQUEsbUI7O0FBQVQsU0FBUyxtQkFBVCxDQUE2QixPQUE3QixFQUFzQztBQUMzQyxNQUFJLE1BQU0sRUFBVjtBQUFBLE1BQ0ksUyx5QkFBQSxNLHdCQURKO0FBQUEsTUFFSSxZLHlCQUFBLE0sd0JBRko7QUFHQSxPQUFLLElBQUksSUFBSSxDQUFiLEVBQWdCLElBQUksUUFBUSxNQUE1QixFQUFvQyxHQUFwQyxFQUF5QztBQUN2QyxhQUFTLFFBQVEsQ0FBUixDQUFUO0FBQ0EsUUFBSSxPQUFPLEtBQVgsRUFBa0I7QUFDaEIsa0JBQVksQ0FBWjtBQUNELEtBRkQsTUFFTyxJQUFJLE9BQU8sT0FBWCxFQUFvQjtBQUN6QixrQkFBWSxDQUFDLENBQWI7QUFDRCxLQUZNLE1BRUE7QUFDTCxrQkFBWSxDQUFaO0FBQ0Q7O0FBRUQsUUFBSSxJQUFKLENBQVMsQ0FBQyxTQUFELEVBQVksT0FBTyxLQUFuQixDQUFUO0FBQ0Q7QUFDRCxTQUFPLEdBQVA7QUFDRCIsImZpbGUiOiJkbXAuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTZWU6IGh0dHA6Ly9jb2RlLmdvb2dsZS5jb20vcC9nb29nbGUtZGlmZi1tYXRjaC1wYXRjaC93aWtpL0FQSVxuZXhwb3J0IGZ1bmN0aW9uIGNvbnZlcnRDaGFuZ2VzVG9ETVAoY2hhbmdlcykge1xuICBsZXQgcmV0ID0gW10sXG4gICAgICBjaGFuZ2UsXG4gICAgICBvcGVyYXRpb247XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgIGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgb3BlcmF0aW9uID0gMTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAtMTtcbiAgICB9IGVsc2Uge1xuICAgICAgb3BlcmF0aW9uID0gMDtcbiAgICB9XG5cbiAgICByZXQucHVzaChbb3BlcmF0aW9uLCBjaGFuZ2UudmFsdWVdKTtcbiAgfVxuICByZXR1cm4gcmV0O1xufVxuIl19
-
-
-/***/ },
-/* 154 */
-/***/ function(module, exports) {
-
- /*istanbul ignore start*/'use strict';
-
- exports.__esModule = true;
- exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML;
- function convertChangesToXML(changes) {
- var ret = [];
- for (var i = 0; i < changes.length; i++) {
- var change = changes[i];
- if (change.added) {
- ret.push('<ins>');
- } else if (change.removed) {
- ret.push('<del>');
- }
-
- ret.push(escapeHTML(change.value));
-
- if (change.added) {
- ret.push('</ins>');
- } else if (change.removed) {
- ret.push('</del>');
- }
- }
- return ret.join('');
- }
-
- function escapeHTML(s) {
- var n = s;
- n = n.replace(/&/g, '&');
- n = n.replace(/</g, '<');
- n = n.replace(/>/g, '>');
- n = n.replace(/"/g, '"');
-
- return n;
- }
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCLG1CLEdBQUEsbUI7QUFBVCxTQUFTLG1CQUFULENBQTZCLE9BQTdCLEVBQXNDO0FBQzNDLE1BQUksTUFBTSxFQUFWO0FBQ0EsT0FBSyxJQUFJLElBQUksQ0FBYixFQUFnQixJQUFJLFFBQVEsTUFBNUIsRUFBb0MsR0FBcEMsRUFBeUM7QUFDdkMsUUFBSSxTQUFTLFFBQVEsQ0FBUixDQUFiO0FBQ0EsUUFBSSxPQUFPLEtBQVgsRUFBa0I7QUFDaEIsVUFBSSxJQUFKLENBQVMsT0FBVDtBQUNELEtBRkQsTUFFTyxJQUFJLE9BQU8sT0FBWCxFQUFvQjtBQUN6QixVQUFJLElBQUosQ0FBUyxPQUFUO0FBQ0Q7O0FBRUQsUUFBSSxJQUFKLENBQVMsV0FBVyxPQUFPLEtBQWxCLENBQVQ7O0FBRUEsUUFBSSxPQUFPLEtBQVgsRUFBa0I7QUFDaEIsVUFBSSxJQUFKLENBQVMsUUFBVDtBQUNELEtBRkQsTUFFTyxJQUFJLE9BQU8sT0FBWCxFQUFvQjtBQUN6QixVQUFJLElBQUosQ0FBUyxRQUFUO0FBQ0Q7QUFDRjtBQUNELFNBQU8sSUFBSSxJQUFKLENBQVMsRUFBVCxDQUFQO0FBQ0Q7O0FBRUQsU0FBUyxVQUFULENBQW9CLENBQXBCLEVBQXVCO0FBQ3JCLE1BQUksSUFBSSxDQUFSO0FBQ0EsTUFBSSxFQUFFLE9BQUYsQ0FBVSxJQUFWLEVBQWdCLE9BQWhCLENBQUo7QUFDQSxNQUFJLEVBQUUsT0FBRixDQUFVLElBQVYsRUFBZ0IsTUFBaEIsQ0FBSjtBQUNBLE1BQUksRUFBRSxPQUFGLENBQVUsSUFBVixFQUFnQixNQUFoQixDQUFKO0FBQ0EsTUFBSSxFQUFFLE9BQUYsQ0FBVSxJQUFWLEVBQWdCLFFBQWhCLENBQUo7O0FBRUEsU0FBTyxDQUFQO0FBQ0QiLCJmaWxlIjoieG1sLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGNvbnZlcnRDaGFuZ2VzVG9YTUwoY2hhbmdlcykge1xuICBsZXQgcmV0ID0gW107XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgIGxldCBjaGFuZ2UgPSBjaGFuZ2VzW2ldO1xuICAgIGlmIChjaGFuZ2UuYWRkZWQpIHtcbiAgICAgIHJldC5wdXNoKCc8aW5zPicpO1xuICAgIH0gZWxzZSBpZiAoY2hhbmdlLnJlbW92ZWQpIHtcbiAgICAgIHJldC5wdXNoKCc8ZGVsPicpO1xuICAgIH1cblxuICAgIHJldC5wdXNoKGVzY2FwZUhUTUwoY2hhbmdlLnZhbHVlKSk7XG5cbiAgICBpZiAoY2hhbmdlLmFkZGVkKSB7XG4gICAgICByZXQucHVzaCgnPC9pbnM+Jyk7XG4gICAgfSBlbHNlIGlmIChjaGFuZ2UucmVtb3ZlZCkge1xuICAgICAgcmV0LnB1c2goJzwvZGVsPicpO1xuICAgIH1cbiAgfVxuICByZXR1cm4gcmV0LmpvaW4oJycpO1xufVxuXG5mdW5jdGlvbiBlc2NhcGVIVE1MKHMpIHtcbiAgbGV0IG4gPSBzO1xuICBuID0gbi5yZXBsYWNlKC8mL2csICcmYW1wOycpO1xuICBuID0gbi5yZXBsYWNlKC88L2csICcmbHQ7Jyk7XG4gIG4gPSBuLnJlcGxhY2UoLz4vZywgJyZndDsnKTtcbiAgbiA9IG4ucmVwbGFjZSgvXCIvZywgJyZxdW90OycpO1xuXG4gIHJldHVybiBuO1xufVxuIl19
-
-
-/***/ },
-/* 155 */
-/***/ function(module, exports) {
-
- // removed by extract-text-webpack-plugin
- module.exports = {"navbar":"navbar","btn":"btn","caret":"caret","dropup":"dropup","label":"label","table":"table","table-bordered":"table-bordered","glyphicon":"glyphicon","glyphicon-asterisk":"glyphicon-asterisk","glyphicon-plus":"glyphicon-plus","glyphicon-euro":"glyphicon-euro","glyphicon-eur":"glyphicon-eur","glyphicon-minus":"glyphicon-minus","glyphicon-cloud":"glyphicon-cloud","glyphicon-envelope":"glyphicon-envelope","glyphicon-pencil":"glyphicon-pencil","glyphicon-glass":"glyphicon-glass","glyphicon-music":"glyphicon-music","glyphicon-search":"glyphicon-search","glyphicon-heart":"glyphicon-heart","glyphicon-star":"glyphicon-star","glyphicon-star-empty":"glyphicon-star-empty","glyphicon-user":"glyphicon-user","glyphicon-film":"glyphicon-film","glyphicon-th-large":"glyphicon-th-large","glyphicon-th":"glyphicon-th","glyphicon-th-list":"glyphicon-th-list","glyphicon-ok":"glyphicon-ok","glyphicon-remove":"glyphicon-remove","glyphicon-zoom-in":"glyphicon-zoom-in","glyphicon-zoom-out":"glyphicon-zoom-out","glyphicon-off":"glyphicon-off","glyphicon-signal":"glyphicon-signal","glyphicon-cog":"glyphicon-cog","glyphicon-trash":"glyphicon-trash","glyphicon-home":"glyphicon-home","glyphicon-file":"glyphicon-file","glyphicon-time":"glyphicon-time","glyphicon-road":"glyphicon-road","glyphicon-download-alt":"glyphicon-download-alt","glyphicon-download":"glyphicon-download","glyphicon-upload":"glyphicon-upload","glyphicon-inbox":"glyphicon-inbox","glyphicon-play-circle":"glyphicon-play-circle","glyphicon-repeat":"glyphicon-repeat","glyphicon-refresh":"glyphicon-refresh","glyphicon-list-alt":"glyphicon-list-alt","glyphicon-lock":"glyphicon-lock","glyphicon-flag":"glyphicon-flag","glyphicon-headphones":"glyphicon-headphones","glyphicon-volume-off":"glyphicon-volume-off","glyphicon-volume-down":"glyphicon-volume-down","glyphicon-volume-up":"glyphicon-volume-up","glyphicon-qrcode":"glyphicon-qrcode","glyphicon-barcode":"glyphicon-barcode","glyphicon-tag":"glyphicon-tag","glyphicon-tags":"glyphicon-tags","glyphicon-book":"glyphicon-book","glyphicon-bookmark":"glyphicon-bookmark","glyphicon-print":"glyphicon-print","glyphicon-camera":"glyphicon-camera","glyphicon-font":"glyphicon-font","glyphicon-bold":"glyphicon-bold","glyphicon-italic":"glyphicon-italic","glyphicon-text-height":"glyphicon-text-height","glyphicon-text-width":"glyphicon-text-width","glyphicon-align-left":"glyphicon-align-left","glyphicon-align-center":"glyphicon-align-center","glyphicon-align-right":"glyphicon-align-right","glyphicon-align-justify":"glyphicon-align-justify","glyphicon-list":"glyphicon-list","glyphicon-indent-left":"glyphicon-indent-left","glyphicon-indent-right":"glyphicon-indent-right","glyphicon-facetime-video":"glyphicon-facetime-video","glyphicon-picture":"glyphicon-picture","glyphicon-map-marker":"glyphicon-map-marker","glyphicon-adjust":"glyphicon-adjust","glyphicon-tint":"glyphicon-tint","glyphicon-edit":"glyphicon-edit","glyphicon-share":"glyphicon-share","glyphicon-check":"glyphicon-check","glyphicon-move":"glyphicon-move","glyphicon-step-backward":"glyphicon-step-backward","glyphicon-fast-backward":"glyphicon-fast-backward","glyphicon-backward":"glyphicon-backward","glyphicon-play":"glyphicon-play","glyphicon-pause":"glyphicon-pause","glyphicon-stop":"glyphicon-stop","glyphicon-forward":"glyphicon-forward","glyphicon-fast-forward":"glyphicon-fast-forward","glyphicon-step-forward":"glyphicon-step-forward","glyphicon-eject":"glyphicon-eject","glyphicon-chevron-left":"glyphicon-chevron-left","glyphicon-chevron-right":"glyphicon-chevron-right","glyphicon-plus-sign":"glyphicon-plus-sign","glyphicon-minus-sign":"glyphicon-minus-sign","glyphicon-remove-sign":"glyphicon-remove-sign","glyphicon-ok-sign":"glyphicon-ok-sign","glyphicon-question-sign":"glyphicon-question-sign","glyphicon-info-sign":"glyphicon-info-sign","glyphicon-screenshot":"glyphicon-screenshot","glyphicon-remove-circle":"glyphicon-remove-circle","glyphicon-ok-circle":"glyphicon-ok-circle","glyphicon-ban-circle":"glyphicon-ban-circle","glyphicon-arrow-left":"glyphicon-arrow-left","glyphicon-arrow-right":"glyphicon-arrow-right","glyphicon-arrow-up":"glyphicon-arrow-up","glyphicon-arrow-down":"glyphicon-arrow-down","glyphicon-share-alt":"glyphicon-share-alt","glyphicon-resize-full":"glyphicon-resize-full","glyphicon-resize-small":"glyphicon-resize-small","glyphicon-exclamation-sign":"glyphicon-exclamation-sign","glyphicon-gift":"glyphicon-gift","glyphicon-leaf":"glyphicon-leaf","glyphicon-fire":"glyphicon-fire","glyphicon-eye-open":"glyphicon-eye-open","glyphicon-eye-close":"glyphicon-eye-close","glyphicon-warning-sign":"glyphicon-warning-sign","glyphicon-plane":"glyphicon-plane","glyphicon-calendar":"glyphicon-calendar","glyphicon-random":"glyphicon-random","glyphicon-comment":"glyphicon-comment","glyphicon-magnet":"glyphicon-magnet","glyphicon-chevron-up":"glyphicon-chevron-up","glyphicon-chevron-down":"glyphicon-chevron-down","glyphicon-retweet":"glyphicon-retweet","glyphicon-shopping-cart":"glyphicon-shopping-cart","glyphicon-folder-close":"glyphicon-folder-close","glyphicon-folder-open":"glyphicon-folder-open","glyphicon-resize-vertical":"glyphicon-resize-vertical","glyphicon-resize-horizontal":"glyphicon-resize-horizontal","glyphicon-hdd":"glyphicon-hdd","glyphicon-bullhorn":"glyphicon-bullhorn","glyphicon-bell":"glyphicon-bell","glyphicon-certificate":"glyphicon-certificate","glyphicon-thumbs-up":"glyphicon-thumbs-up","glyphicon-thumbs-down":"glyphicon-thumbs-down","glyphicon-hand-right":"glyphicon-hand-right","glyphicon-hand-left":"glyphicon-hand-left","glyphicon-hand-up":"glyphicon-hand-up","glyphicon-hand-down":"glyphicon-hand-down","glyphicon-circle-arrow-right":"glyphicon-circle-arrow-right","glyphicon-circle-arrow-left":"glyphicon-circle-arrow-left","glyphicon-circle-arrow-up":"glyphicon-circle-arrow-up","glyphicon-circle-arrow-down":"glyphicon-circle-arrow-down","glyphicon-globe":"glyphicon-globe","glyphicon-wrench":"glyphicon-wrench","glyphicon-tasks":"glyphicon-tasks","glyphicon-filter":"glyphicon-filter","glyphicon-briefcase":"glyphicon-briefcase","glyphicon-fullscreen":"glyphicon-fullscreen","glyphicon-dashboard":"glyphicon-dashboard","glyphicon-paperclip":"glyphicon-paperclip","glyphicon-heart-empty":"glyphicon-heart-empty","glyphicon-link":"glyphicon-link","glyphicon-phone":"glyphicon-phone","glyphicon-pushpin":"glyphicon-pushpin","glyphicon-usd":"glyphicon-usd","glyphicon-gbp":"glyphicon-gbp","glyphicon-sort":"glyphicon-sort","glyphicon-sort-by-alphabet":"glyphicon-sort-by-alphabet","glyphicon-sort-by-alphabet-alt":"glyphicon-sort-by-alphabet-alt","glyphicon-sort-by-order":"glyphicon-sort-by-order","glyphicon-sort-by-order-alt":"glyphicon-sort-by-order-alt","glyphicon-sort-by-attributes":"glyphicon-sort-by-attributes","glyphicon-sort-by-attributes-alt":"glyphicon-sort-by-attributes-alt","glyphicon-unchecked":"glyphicon-unchecked","glyphicon-expand":"glyphicon-expand","glyphicon-collapse-down":"glyphicon-collapse-down","glyphicon-collapse-up":"glyphicon-collapse-up","glyphicon-log-in":"glyphicon-log-in","glyphicon-flash":"glyphicon-flash","glyphicon-log-out":"glyphicon-log-out","glyphicon-new-window":"glyphicon-new-window","glyphicon-record":"glyphicon-record","glyphicon-save":"glyphicon-save","glyphicon-open":"glyphicon-open","glyphicon-saved":"glyphicon-saved","glyphicon-import":"glyphicon-import","glyphicon-export":"glyphicon-export","glyphicon-send":"glyphicon-send","glyphicon-floppy-disk":"glyphicon-floppy-disk","glyphicon-floppy-saved":"glyphicon-floppy-saved","glyphicon-floppy-remove":"glyphicon-floppy-remove","glyphicon-floppy-save":"glyphicon-floppy-save","glyphicon-floppy-open":"glyphicon-floppy-open","glyphicon-credit-card":"glyphicon-credit-card","glyphicon-transfer":"glyphicon-transfer","glyphicon-cutlery":"glyphicon-cutlery","glyphicon-header":"glyphicon-header","glyphicon-compressed":"glyphicon-compressed","glyphicon-earphone":"glyphicon-earphone","glyphicon-phone-alt":"glyphicon-phone-alt","glyphicon-tower":"glyphicon-tower","glyphicon-stats":"glyphicon-stats","glyphicon-sd-video":"glyphicon-sd-video","glyphicon-hd-video":"glyphicon-hd-video","glyphicon-subtitles":"glyphicon-subtitles","glyphicon-sound-stereo":"glyphicon-sound-stereo","glyphicon-sound-dolby":"glyphicon-sound-dolby","glyphicon-sound-5-1":"glyphicon-sound-5-1","glyphicon-sound-6-1":"glyphicon-sound-6-1","glyphicon-sound-7-1":"glyphicon-sound-7-1","glyphicon-copyright-mark":"glyphicon-copyright-mark","glyphicon-registration-mark":"glyphicon-registration-mark","glyphicon-cloud-download":"glyphicon-cloud-download","glyphicon-cloud-upload":"glyphicon-cloud-upload","glyphicon-tree-conifer":"glyphicon-tree-conifer","glyphicon-tree-deciduous":"glyphicon-tree-deciduous","glyphicon-cd":"glyphicon-cd","glyphicon-save-file":"glyphicon-save-file","glyphicon-open-file":"glyphicon-open-file","glyphicon-level-up":"glyphicon-level-up","glyphicon-copy":"glyphicon-copy","glyphicon-paste":"glyphicon-paste","glyphicon-alert":"glyphicon-alert","glyphicon-equalizer":"glyphicon-equalizer","glyphicon-king":"glyphicon-king","glyphicon-queen":"glyphicon-queen","glyphicon-pawn":"glyphicon-pawn","glyphicon-bishop":"glyphicon-bishop","glyphicon-knight":"glyphicon-knight","glyphicon-baby-formula":"glyphicon-baby-formula","glyphicon-tent":"glyphicon-tent","glyphicon-blackboard":"glyphicon-blackboard","glyphicon-bed":"glyphicon-bed","glyphicon-apple":"glyphicon-apple","glyphicon-erase":"glyphicon-erase","glyphicon-hourglass":"glyphicon-hourglass","glyphicon-lamp":"glyphicon-lamp","glyphicon-duplicate":"glyphicon-duplicate","glyphicon-piggy-bank":"glyphicon-piggy-bank","glyphicon-scissors":"glyphicon-scissors","glyphicon-bitcoin":"glyphicon-bitcoin","glyphicon-btc":"glyphicon-btc","glyphicon-xbt":"glyphicon-xbt","glyphicon-yen":"glyphicon-yen","glyphicon-jpy":"glyphicon-jpy","glyphicon-ruble":"glyphicon-ruble","glyphicon-rub":"glyphicon-rub","glyphicon-scale":"glyphicon-scale","glyphicon-ice-lolly":"glyphicon-ice-lolly","glyphicon-ice-lolly-tasted":"glyphicon-ice-lolly-tasted","glyphicon-education":"glyphicon-education","glyphicon-option-horizontal":"glyphicon-option-horizontal","glyphicon-option-vertical":"glyphicon-option-vertical","glyphicon-menu-hamburger":"glyphicon-menu-hamburger","glyphicon-modal-window":"glyphicon-modal-window","glyphicon-oil":"glyphicon-oil","glyphicon-grain":"glyphicon-grain","glyphicon-sunglasses":"glyphicon-sunglasses","glyphicon-text-size":"glyphicon-text-size","glyphicon-text-color":"glyphicon-text-color","glyphicon-text-background":"glyphicon-text-background","glyphicon-object-align-top":"glyphicon-object-align-top","glyphicon-object-align-bottom":"glyphicon-object-align-bottom","glyphicon-object-align-horizontal":"glyphicon-object-align-horizontal","glyphicon-object-align-left":"glyphicon-object-align-left","glyphicon-object-align-vertical":"glyphicon-object-align-vertical","glyphicon-object-align-right":"glyphicon-object-align-right","glyphicon-triangle-right":"glyphicon-triangle-right","glyphicon-triangle-left":"glyphicon-triangle-left","glyphicon-triangle-bottom":"glyphicon-triangle-bottom","glyphicon-triangle-top":"glyphicon-triangle-top","glyphicon-console":"glyphicon-console","glyphicon-superscript":"glyphicon-superscript","glyphicon-subscript":"glyphicon-subscript","glyphicon-menu-left":"glyphicon-menu-left","glyphicon-menu-right":"glyphicon-menu-right","glyphicon-menu-down":"glyphicon-menu-down","glyphicon-menu-up":"glyphicon-menu-up","img-responsive":"img-responsive","img-rounded":"img-rounded","img-thumbnail":"img-thumbnail","img-circle":"img-circle","sr-only":"sr-only","sr-only-focusable":"sr-only-focusable","h1":"h1","h2":"h2","h3":"h3","h4":"h4","h5":"h5","h6":"h6","small":"small","lead":"lead","mark":"mark","text-left":"text-left","text-right":"text-right","text-center":"text-center","text-justify":"text-justify","text-nowrap":"text-nowrap","text-lowercase":"text-lowercase","text-uppercase":"text-uppercase","initialism":"initialism","text-capitalize":"text-capitalize","text-muted":"text-muted","text-primary":"text-primary","text-success":"text-success","text-info":"text-info","text-warning":"text-warning","text-danger":"text-danger","bg-primary":"bg-primary","bg-success":"bg-success","bg-info":"bg-info","bg-warning":"bg-warning","bg-danger":"bg-danger","page-header":"page-header","list-unstyled":"list-unstyled","list-inline":"list-inline","dl-horizontal":"dl-horizontal","blockquote-reverse":"blockquote-reverse","pull-right":"pull-right","pre-scrollable":"pre-scrollable","container":"container","container-fluid":"container-fluid","row":"row","col-xs-1":"col-xs-1","col-sm-1":"col-sm-1","col-md-1":"col-md-1","col-lg-1":"col-lg-1","col-xs-2":"col-xs-2","col-sm-2":"col-sm-2","col-md-2":"col-md-2","col-lg-2":"col-lg-2","col-xs-3":"col-xs-3","col-sm-3":"col-sm-3","col-md-3":"col-md-3","col-lg-3":"col-lg-3","col-xs-4":"col-xs-4","col-sm-4":"col-sm-4","col-md-4":"col-md-4","col-lg-4":"col-lg-4","col-xs-5":"col-xs-5","col-sm-5":"col-sm-5","col-md-5":"col-md-5","col-lg-5":"col-lg-5","col-xs-6":"col-xs-6","col-sm-6":"col-sm-6","col-md-6":"col-md-6","col-lg-6":"col-lg-6","col-xs-7":"col-xs-7","col-sm-7":"col-sm-7","col-md-7":"col-md-7","col-lg-7":"col-lg-7","col-xs-8":"col-xs-8","col-sm-8":"col-sm-8","col-md-8":"col-md-8","col-lg-8":"col-lg-8","col-xs-9":"col-xs-9","col-sm-9":"col-sm-9","col-md-9":"col-md-9","col-lg-9":"col-lg-9","col-xs-10":"col-xs-10","col-sm-10":"col-sm-10","col-md-10":"col-md-10","col-lg-10":"col-lg-10","col-xs-11":"col-xs-11","col-sm-11":"col-sm-11","col-md-11":"col-md-11","col-lg-11":"col-lg-11","col-xs-12":"col-xs-12","col-sm-12":"col-sm-12","col-md-12":"col-md-12","col-lg-12":"col-lg-12","col-xs-pull-0":"col-xs-pull-0","col-xs-pull-1":"col-xs-pull-1","col-xs-pull-2":"col-xs-pull-2","col-xs-pull-3":"col-xs-pull-3","col-xs-pull-4":"col-xs-pull-4","col-xs-pull-5":"col-xs-pull-5","col-xs-pull-6":"col-xs-pull-6","col-xs-pull-7":"col-xs-pull-7","col-xs-pull-8":"col-xs-pull-8","col-xs-pull-9":"col-xs-pull-9","col-xs-pull-10":"col-xs-pull-10","col-xs-pull-11":"col-xs-pull-11","col-xs-pull-12":"col-xs-pull-12","col-xs-push-0":"col-xs-push-0","col-xs-push-1":"col-xs-push-1","col-xs-push-2":"col-xs-push-2","col-xs-push-3":"col-xs-push-3","col-xs-push-4":"col-xs-push-4","col-xs-push-5":"col-xs-push-5","col-xs-push-6":"col-xs-push-6","col-xs-push-7":"col-xs-push-7","col-xs-push-8":"col-xs-push-8","col-xs-push-9":"col-xs-push-9","col-xs-push-10":"col-xs-push-10","col-xs-push-11":"col-xs-push-11","col-xs-push-12":"col-xs-push-12","col-xs-offset-0":"col-xs-offset-0","col-xs-offset-1":"col-xs-offset-1","col-xs-offset-2":"col-xs-offset-2","col-xs-offset-3":"col-xs-offset-3","col-xs-offset-4":"col-xs-offset-4","col-xs-offset-5":"col-xs-offset-5","col-xs-offset-6":"col-xs-offset-6","col-xs-offset-7":"col-xs-offset-7","col-xs-offset-8":"col-xs-offset-8","col-xs-offset-9":"col-xs-offset-9","col-xs-offset-10":"col-xs-offset-10","col-xs-offset-11":"col-xs-offset-11","col-xs-offset-12":"col-xs-offset-12","col-sm-pull-0":"col-sm-pull-0","col-sm-pull-1":"col-sm-pull-1","col-sm-pull-2":"col-sm-pull-2","col-sm-pull-3":"col-sm-pull-3","col-sm-pull-4":"col-sm-pull-4","col-sm-pull-5":"col-sm-pull-5","col-sm-pull-6":"col-sm-pull-6","col-sm-pull-7":"col-sm-pull-7","col-sm-pull-8":"col-sm-pull-8","col-sm-pull-9":"col-sm-pull-9","col-sm-pull-10":"col-sm-pull-10","col-sm-pull-11":"col-sm-pull-11","col-sm-pull-12":"col-sm-pull-12","col-sm-push-0":"col-sm-push-0","col-sm-push-1":"col-sm-push-1","col-sm-push-2":"col-sm-push-2","col-sm-push-3":"col-sm-push-3","col-sm-push-4":"col-sm-push-4","col-sm-push-5":"col-sm-push-5","col-sm-push-6":"col-sm-push-6","col-sm-push-7":"col-sm-push-7","col-sm-push-8":"col-sm-push-8","col-sm-push-9":"col-sm-push-9","col-sm-push-10":"col-sm-push-10","col-sm-push-11":"col-sm-push-11","col-sm-push-12":"col-sm-push-12","col-sm-offset-0":"col-sm-offset-0","col-sm-offset-1":"col-sm-offset-1","col-sm-offset-2":"col-sm-offset-2","col-sm-offset-3":"col-sm-offset-3","col-sm-offset-4":"col-sm-offset-4","col-sm-offset-5":"col-sm-offset-5","col-sm-offset-6":"col-sm-offset-6","col-sm-offset-7":"col-sm-offset-7","col-sm-offset-8":"col-sm-offset-8","col-sm-offset-9":"col-sm-offset-9","col-sm-offset-10":"col-sm-offset-10","col-sm-offset-11":"col-sm-offset-11","col-sm-offset-12":"col-sm-offset-12","col-md-pull-0":"col-md-pull-0","col-md-pull-1":"col-md-pull-1","col-md-pull-2":"col-md-pull-2","col-md-pull-3":"col-md-pull-3","col-md-pull-4":"col-md-pull-4","col-md-pull-5":"col-md-pull-5","col-md-pull-6":"col-md-pull-6","col-md-pull-7":"col-md-pull-7","col-md-pull-8":"col-md-pull-8","col-md-pull-9":"col-md-pull-9","col-md-pull-10":"col-md-pull-10","col-md-pull-11":"col-md-pull-11","col-md-pull-12":"col-md-pull-12","col-md-push-0":"col-md-push-0","col-md-push-1":"col-md-push-1","col-md-push-2":"col-md-push-2","col-md-push-3":"col-md-push-3","col-md-push-4":"col-md-push-4","col-md-push-5":"col-md-push-5","col-md-push-6":"col-md-push-6","col-md-push-7":"col-md-push-7","col-md-push-8":"col-md-push-8","col-md-push-9":"col-md-push-9","col-md-push-10":"col-md-push-10","col-md-push-11":"col-md-push-11","col-md-push-12":"col-md-push-12","col-md-offset-0":"col-md-offset-0","col-md-offset-1":"col-md-offset-1","col-md-offset-2":"col-md-offset-2","col-md-offset-3":"col-md-offset-3","col-md-offset-4":"col-md-offset-4","col-md-offset-5":"col-md-offset-5","col-md-offset-6":"col-md-offset-6","col-md-offset-7":"col-md-offset-7","col-md-offset-8":"col-md-offset-8","col-md-offset-9":"col-md-offset-9","col-md-offset-10":"col-md-offset-10","col-md-offset-11":"col-md-offset-11","col-md-offset-12":"col-md-offset-12","col-lg-pull-0":"col-lg-pull-0","col-lg-pull-1":"col-lg-pull-1","col-lg-pull-2":"col-lg-pull-2","col-lg-pull-3":"col-lg-pull-3","col-lg-pull-4":"col-lg-pull-4","col-lg-pull-5":"col-lg-pull-5","col-lg-pull-6":"col-lg-pull-6","col-lg-pull-7":"col-lg-pull-7","col-lg-pull-8":"col-lg-pull-8","col-lg-pull-9":"col-lg-pull-9","col-lg-pull-10":"col-lg-pull-10","col-lg-pull-11":"col-lg-pull-11","col-lg-pull-12":"col-lg-pull-12","col-lg-push-0":"col-lg-push-0","col-lg-push-1":"col-lg-push-1","col-lg-push-2":"col-lg-push-2","col-lg-push-3":"col-lg-push-3","col-lg-push-4":"col-lg-push-4","col-lg-push-5":"col-lg-push-5","col-lg-push-6":"col-lg-push-6","col-lg-push-7":"col-lg-push-7","col-lg-push-8":"col-lg-push-8","col-lg-push-9":"col-lg-push-9","col-lg-push-10":"col-lg-push-10","col-lg-push-11":"col-lg-push-11","col-lg-push-12":"col-lg-push-12","col-lg-offset-0":"col-lg-offset-0","col-lg-offset-1":"col-lg-offset-1","col-lg-offset-2":"col-lg-offset-2","col-lg-offset-3":"col-lg-offset-3","col-lg-offset-4":"col-lg-offset-4","col-lg-offset-5":"col-lg-offset-5","col-lg-offset-6":"col-lg-offset-6","col-lg-offset-7":"col-lg-offset-7","col-lg-offset-8":"col-lg-offset-8","col-lg-offset-9":"col-lg-offset-9","col-lg-offset-10":"col-lg-offset-10","col-lg-offset-11":"col-lg-offset-11","col-lg-offset-12":"col-lg-offset-12","table-condensed":"table-condensed","table-striped":"table-striped","table-hover":"table-hover","active":"active","success":"success","info":"info","warning":"warning","danger":"danger","table-responsive":"table-responsive","form-control":"form-control","input-sm":"input-sm","input-group-sm":"input-group-sm","input-group-addon":"input-group-addon","input-group-btn":"input-group-btn","input-lg":"input-lg","input-group-lg":"input-group-lg","form-group":"form-group","radio":"radio","checkbox":"checkbox","radio-inline":"radio-inline","checkbox-inline":"checkbox-inline","disabled":"disabled","form-control-static":"form-control-static","form-group-sm":"form-group-sm","form-group-lg":"form-group-lg","has-feedback":"has-feedback","form-control-feedback":"form-control-feedback","has-success":"has-success","help-block":"help-block","control-label":"control-label","has-warning":"has-warning","has-error":"has-error","form-inline":"form-inline","input-group":"input-group","form-horizontal":"form-horizontal","focus":"focus","btn-default":"btn-default","open":"open","dropdown-toggle":"dropdown-toggle","badge":"badge","btn-primary":"btn-primary","btn-success":"btn-success","btn-info":"btn-info","btn-warning":"btn-warning","btn-danger":"btn-danger","btn-link":"btn-link","btn-lg":"btn-lg","btn-group-lg":"btn-group-lg","btn-sm":"btn-sm","btn-group-sm":"btn-group-sm","btn-xs":"btn-xs","btn-group-xs":"btn-group-xs","btn-block":"btn-block","fade":"fade","in":"in","collapse":"collapse","collapsing":"collapsing","dropdown":"dropdown","dropdown-menu":"dropdown-menu","divider":"divider","dropdown-menu-right":"dropdown-menu-right","dropdown-menu-left":"dropdown-menu-left","dropdown-header":"dropdown-header","dropdown-backdrop":"dropdown-backdrop","navbar-fixed-bottom":"navbar-fixed-bottom","navbar-right":"navbar-right","btn-group":"btn-group","btn-group-vertical":"btn-group-vertical","btn-toolbar":"btn-toolbar","btn-group-justified":"btn-group-justified","nav":"nav","nav-divider":"nav-divider","nav-tabs":"nav-tabs","nav-pills":"nav-pills","nav-stacked":"nav-stacked","nav-justified":"nav-justified","nav-tabs-justified":"nav-tabs-justified","tab-content":"tab-content","tab-pane":"tab-pane","navbar-header":"navbar-header","navbar-collapse":"navbar-collapse","navbar-fixed-top":"navbar-fixed-top","navbar-static-top":"navbar-static-top","navbar-brand":"navbar-brand","navbar-toggle":"navbar-toggle","icon-bar":"icon-bar","navbar-nav":"navbar-nav","navbar-form":"navbar-form","navbar-btn":"navbar-btn","navbar-text":"navbar-text","navbar-left":"navbar-left","navbar-default":"navbar-default","navbar-link":"navbar-link","navbar-inverse":"navbar-inverse","breadcrumb":"breadcrumb","pagination":"pagination","pagination-lg":"pagination-lg","pagination-sm":"pagination-sm","pager":"pager","next":"next","previous":"previous","label-default":"label-default","label-primary":"label-primary","label-success":"label-success","label-info":"label-info","label-warning":"label-warning","label-danger":"label-danger","list-group-item":"list-group-item","jumbotron":"jumbotron","thumbnail":"thumbnail","caption":"caption","alert":"alert","alert-link":"alert-link","alert-dismissable":"alert-dismissable","alert-dismissible":"alert-dismissible","close":"close","alert-success":"alert-success","alert-info":"alert-info","alert-warning":"alert-warning","alert-danger":"alert-danger","progress":"progress","progress-bar":"progress-bar","progress-striped":"progress-striped","progress-bar-striped":"progress-bar-striped","progress-bar-stripes":"progress-bar-stripes","progress-bar-success":"progress-bar-success","progress-bar-info":"progress-bar-info","progress-bar-warning":"progress-bar-warning","progress-bar-danger":"progress-bar-danger","media":"media","media-body":"media-body","media-object":"media-object","media-right":"media-right","media-left":"media-left","pull-left":"pull-left","media-middle":"media-middle","media-bottom":"media-bottom","media-heading":"media-heading","media-list":"media-list","list-group":"list-group","list-group-item-heading":"list-group-item-heading","list-group-item-text":"list-group-item-text","list-group-item-success":"list-group-item-success","list-group-item-info":"list-group-item-info","list-group-item-warning":"list-group-item-warning","list-group-item-danger":"list-group-item-danger","panel":"panel","panel-body":"panel-body","panel-heading":"panel-heading","panel-title":"panel-title","panel-footer":"panel-footer","panel-collapse":"panel-collapse","panel-group":"panel-group","panel-default":"panel-default","panel-primary":"panel-primary","panel-success":"panel-success","panel-info":"panel-info","panel-warning":"panel-warning","panel-danger":"panel-danger","embed-responsive":"embed-responsive","embed-responsive-item":"embed-responsive-item","embed-responsive-16by9":"embed-responsive-16by9","embed-responsive-4by3":"embed-responsive-4by3","well":"well","well-lg":"well-lg","well-sm":"well-sm","modal-open":"modal-open","modal":"modal","modal-dialog":"modal-dialog","modal-content":"modal-content","modal-backdrop":"modal-backdrop","modal-header":"modal-header","modal-title":"modal-title","modal-body":"modal-body","modal-footer":"modal-footer","modal-scrollbar-measure":"modal-scrollbar-measure","modal-sm":"modal-sm","modal-lg":"modal-lg","tooltip":"tooltip","top":"top","right":"right","bottom":"bottom","left":"left","tooltip-inner":"tooltip-inner","tooltip-arrow":"tooltip-arrow","top-left":"top-left","top-right":"top-right","bottom-left":"bottom-left","bottom-right":"bottom-right","popover":"popover","popover-title":"popover-title","popover-content":"popover-content","arrow":"arrow","carousel":"carousel","carousel-inner":"carousel-inner","item":"item","prev":"prev","carousel-control":"carousel-control","icon-prev":"icon-prev","icon-next":"icon-next","carousel-indicators":"carousel-indicators","carousel-caption":"carousel-caption","clearfix":"clearfix","center-block":"center-block","hide":"hide","show":"show","invisible":"invisible","text-hide":"text-hide","hidden":"hidden","affix":"affix","visible-xs":"visible-xs","visible-sm":"visible-sm","visible-md":"visible-md","visible-lg":"visible-lg","visible-xs-block":"visible-xs-block","visible-xs-inline":"visible-xs-inline","visible-xs-inline-block":"visible-xs-inline-block","visible-sm-block":"visible-sm-block","visible-sm-inline":"visible-sm-inline","visible-sm-inline-block":"visible-sm-inline-block","visible-md-block":"visible-md-block","visible-md-inline":"visible-md-inline","visible-md-inline-block":"visible-md-inline-block","visible-lg-block":"visible-lg-block","visible-lg-inline":"visible-lg-inline","visible-lg-inline-block":"visible-lg-inline-block","hidden-xs":"hidden-xs","hidden-sm":"hidden-sm","hidden-md":"hidden-md","hidden-lg":"hidden-lg","visible-print":"visible-print","visible-print-block":"visible-print-block","visible-print-inline":"visible-print-inline","visible-print-inline-block":"visible-print-inline-block","hidden-print":"hidden-print","fa":"fa","fa-lg":"fa-lg","fa-2x":"fa-2x","fa-3x":"fa-3x","fa-4x":"fa-4x","fa-5x":"fa-5x","fa-fw":"fa-fw","fa-ul":"fa-ul","fa-li":"fa-li","fa-border":"fa-border","fa-pull-left":"fa-pull-left","fa-pull-right":"fa-pull-right","fa-spin":"fa-spin","fa-pulse":"fa-pulse","fa-rotate-90":"fa-rotate-90","fa-rotate-180":"fa-rotate-180","fa-rotate-270":"fa-rotate-270","fa-flip-horizontal":"fa-flip-horizontal","fa-flip-vertical":"fa-flip-vertical","fa-stack":"fa-stack","fa-stack-1x":"fa-stack-1x","fa-stack-2x":"fa-stack-2x","fa-inverse":"fa-inverse","fa-glass":"fa-glass","fa-music":"fa-music","fa-search":"fa-search","fa-envelope-o":"fa-envelope-o","fa-heart":"fa-heart","fa-star":"fa-star","fa-star-o":"fa-star-o","fa-user":"fa-user","fa-film":"fa-film","fa-th-large":"fa-th-large","fa-th":"fa-th","fa-th-list":"fa-th-list","fa-check":"fa-check","fa-remove":"fa-remove","fa-close":"fa-close","fa-times":"fa-times","fa-search-plus":"fa-search-plus","fa-search-minus":"fa-search-minus","fa-power-off":"fa-power-off","fa-signal":"fa-signal","fa-gear":"fa-gear","fa-cog":"fa-cog","fa-trash-o":"fa-trash-o","fa-home":"fa-home","fa-file-o":"fa-file-o","fa-clock-o":"fa-clock-o","fa-road":"fa-road","fa-download":"fa-download","fa-arrow-circle-o-down":"fa-arrow-circle-o-down","fa-arrow-circle-o-up":"fa-arrow-circle-o-up","fa-inbox":"fa-inbox","fa-play-circle-o":"fa-play-circle-o","fa-rotate-right":"fa-rotate-right","fa-repeat":"fa-repeat","fa-refresh":"fa-refresh","fa-list-alt":"fa-list-alt","fa-lock":"fa-lock","fa-flag":"fa-flag","fa-headphones":"fa-headphones","fa-volume-off":"fa-volume-off","fa-volume-down":"fa-volume-down","fa-volume-up":"fa-volume-up","fa-qrcode":"fa-qrcode","fa-barcode":"fa-barcode","fa-tag":"fa-tag","fa-tags":"fa-tags","fa-book":"fa-book","fa-bookmark":"fa-bookmark","fa-print":"fa-print","fa-camera":"fa-camera","fa-font":"fa-font","fa-bold":"fa-bold","fa-italic":"fa-italic","fa-text-height":"fa-text-height","fa-text-width":"fa-text-width","fa-align-left":"fa-align-left","fa-align-center":"fa-align-center","fa-align-right":"fa-align-right","fa-align-justify":"fa-align-justify","fa-list":"fa-list","fa-dedent":"fa-dedent","fa-outdent":"fa-outdent","fa-indent":"fa-indent","fa-video-camera":"fa-video-camera","fa-photo":"fa-photo","fa-image":"fa-image","fa-picture-o":"fa-picture-o","fa-pencil":"fa-pencil","fa-map-marker":"fa-map-marker","fa-adjust":"fa-adjust","fa-tint":"fa-tint","fa-edit":"fa-edit","fa-pencil-square-o":"fa-pencil-square-o","fa-share-square-o":"fa-share-square-o","fa-check-square-o":"fa-check-square-o","fa-arrows":"fa-arrows","fa-step-backward":"fa-step-backward","fa-fast-backward":"fa-fast-backward","fa-backward":"fa-backward","fa-play":"fa-play","fa-pause":"fa-pause","fa-stop":"fa-stop","fa-forward":"fa-forward","fa-fast-forward":"fa-fast-forward","fa-step-forward":"fa-step-forward","fa-eject":"fa-eject","fa-chevron-left":"fa-chevron-left","fa-chevron-right":"fa-chevron-right","fa-plus-circle":"fa-plus-circle","fa-minus-circle":"fa-minus-circle","fa-times-circle":"fa-times-circle","fa-check-circle":"fa-check-circle","fa-question-circle":"fa-question-circle","fa-info-circle":"fa-info-circle","fa-crosshairs":"fa-crosshairs","fa-times-circle-o":"fa-times-circle-o","fa-check-circle-o":"fa-check-circle-o","fa-ban":"fa-ban","fa-arrow-left":"fa-arrow-left","fa-arrow-right":"fa-arrow-right","fa-arrow-up":"fa-arrow-up","fa-arrow-down":"fa-arrow-down","fa-mail-forward":"fa-mail-forward","fa-share":"fa-share","fa-expand":"fa-expand","fa-compress":"fa-compress","fa-plus":"fa-plus","fa-minus":"fa-minus","fa-asterisk":"fa-asterisk","fa-exclamation-circle":"fa-exclamation-circle","fa-gift":"fa-gift","fa-leaf":"fa-leaf","fa-fire":"fa-fire","fa-eye":"fa-eye","fa-eye-slash":"fa-eye-slash","fa-warning":"fa-warning","fa-exclamation-triangle":"fa-exclamation-triangle","fa-plane":"fa-plane","fa-calendar":"fa-calendar","fa-random":"fa-random","fa-comment":"fa-comment","fa-magnet":"fa-magnet","fa-chevron-up":"fa-chevron-up","fa-chevron-down":"fa-chevron-down","fa-retweet":"fa-retweet","fa-shopping-cart":"fa-shopping-cart","fa-folder":"fa-folder","fa-folder-open":"fa-folder-open","fa-arrows-v":"fa-arrows-v","fa-arrows-h":"fa-arrows-h","fa-bar-chart-o":"fa-bar-chart-o","fa-bar-chart":"fa-bar-chart","fa-twitter-square":"fa-twitter-square","fa-facebook-square":"fa-facebook-square","fa-camera-retro":"fa-camera-retro","fa-key":"fa-key","fa-gears":"fa-gears","fa-cogs":"fa-cogs","fa-comments":"fa-comments","fa-thumbs-o-up":"fa-thumbs-o-up","fa-thumbs-o-down":"fa-thumbs-o-down","fa-star-half":"fa-star-half","fa-heart-o":"fa-heart-o","fa-sign-out":"fa-sign-out","fa-linkedin-square":"fa-linkedin-square","fa-thumb-tack":"fa-thumb-tack","fa-external-link":"fa-external-link","fa-sign-in":"fa-sign-in","fa-trophy":"fa-trophy","fa-github-square":"fa-github-square","fa-upload":"fa-upload","fa-lemon-o":"fa-lemon-o","fa-phone":"fa-phone","fa-square-o":"fa-square-o","fa-bookmark-o":"fa-bookmark-o","fa-phone-square":"fa-phone-square","fa-twitter":"fa-twitter","fa-facebook-f":"fa-facebook-f","fa-facebook":"fa-facebook","fa-github":"fa-github","fa-unlock":"fa-unlock","fa-credit-card":"fa-credit-card","fa-feed":"fa-feed","fa-rss":"fa-rss","fa-hdd-o":"fa-hdd-o","fa-bullhorn":"fa-bullhorn","fa-bell":"fa-bell","fa-certificate":"fa-certificate","fa-hand-o-right":"fa-hand-o-right","fa-hand-o-left":"fa-hand-o-left","fa-hand-o-up":"fa-hand-o-up","fa-hand-o-down":"fa-hand-o-down","fa-arrow-circle-left":"fa-arrow-circle-left","fa-arrow-circle-right":"fa-arrow-circle-right","fa-arrow-circle-up":"fa-arrow-circle-up","fa-arrow-circle-down":"fa-arrow-circle-down","fa-globe":"fa-globe","fa-wrench":"fa-wrench","fa-tasks":"fa-tasks","fa-filter":"fa-filter","fa-briefcase":"fa-briefcase","fa-arrows-alt":"fa-arrows-alt","fa-group":"fa-group","fa-users":"fa-users","fa-chain":"fa-chain","fa-link":"fa-link","fa-cloud":"fa-cloud","fa-flask":"fa-flask","fa-cut":"fa-cut","fa-scissors":"fa-scissors","fa-copy":"fa-copy","fa-files-o":"fa-files-o","fa-paperclip":"fa-paperclip","fa-save":"fa-save","fa-floppy-o":"fa-floppy-o","fa-square":"fa-square","fa-navicon":"fa-navicon","fa-reorder":"fa-reorder","fa-bars":"fa-bars","fa-list-ul":"fa-list-ul","fa-list-ol":"fa-list-ol","fa-strikethrough":"fa-strikethrough","fa-underline":"fa-underline","fa-table":"fa-table","fa-magic":"fa-magic","fa-truck":"fa-truck","fa-pinterest":"fa-pinterest","fa-pinterest-square":"fa-pinterest-square","fa-google-plus-square":"fa-google-plus-square","fa-google-plus":"fa-google-plus","fa-money":"fa-money","fa-caret-down":"fa-caret-down","fa-caret-up":"fa-caret-up","fa-caret-left":"fa-caret-left","fa-caret-right":"fa-caret-right","fa-columns":"fa-columns","fa-unsorted":"fa-unsorted","fa-sort":"fa-sort","fa-sort-down":"fa-sort-down","fa-sort-desc":"fa-sort-desc","fa-sort-up":"fa-sort-up","fa-sort-asc":"fa-sort-asc","fa-envelope":"fa-envelope","fa-linkedin":"fa-linkedin","fa-rotate-left":"fa-rotate-left","fa-undo":"fa-undo","fa-legal":"fa-legal","fa-gavel":"fa-gavel","fa-dashboard":"fa-dashboard","fa-tachometer":"fa-tachometer","fa-comment-o":"fa-comment-o","fa-comments-o":"fa-comments-o","fa-flash":"fa-flash","fa-bolt":"fa-bolt","fa-sitemap":"fa-sitemap","fa-umbrella":"fa-umbrella","fa-paste":"fa-paste","fa-clipboard":"fa-clipboard","fa-lightbulb-o":"fa-lightbulb-o","fa-exchange":"fa-exchange","fa-cloud-download":"fa-cloud-download","fa-cloud-upload":"fa-cloud-upload","fa-user-md":"fa-user-md","fa-stethoscope":"fa-stethoscope","fa-suitcase":"fa-suitcase","fa-bell-o":"fa-bell-o","fa-coffee":"fa-coffee","fa-cutlery":"fa-cutlery","fa-file-text-o":"fa-file-text-o","fa-building-o":"fa-building-o","fa-hospital-o":"fa-hospital-o","fa-ambulance":"fa-ambulance","fa-medkit":"fa-medkit","fa-fighter-jet":"fa-fighter-jet","fa-beer":"fa-beer","fa-h-square":"fa-h-square","fa-plus-square":"fa-plus-square","fa-angle-double-left":"fa-angle-double-left","fa-angle-double-right":"fa-angle-double-right","fa-angle-double-up":"fa-angle-double-up","fa-angle-double-down":"fa-angle-double-down","fa-angle-left":"fa-angle-left","fa-angle-right":"fa-angle-right","fa-angle-up":"fa-angle-up","fa-angle-down":"fa-angle-down","fa-desktop":"fa-desktop","fa-laptop":"fa-laptop","fa-tablet":"fa-tablet","fa-mobile-phone":"fa-mobile-phone","fa-mobile":"fa-mobile","fa-circle-o":"fa-circle-o","fa-quote-left":"fa-quote-left","fa-quote-right":"fa-quote-right","fa-spinner":"fa-spinner","fa-circle":"fa-circle","fa-mail-reply":"fa-mail-reply","fa-reply":"fa-reply","fa-github-alt":"fa-github-alt","fa-folder-o":"fa-folder-o","fa-folder-open-o":"fa-folder-open-o","fa-smile-o":"fa-smile-o","fa-frown-o":"fa-frown-o","fa-meh-o":"fa-meh-o","fa-gamepad":"fa-gamepad","fa-keyboard-o":"fa-keyboard-o","fa-flag-o":"fa-flag-o","fa-flag-checkered":"fa-flag-checkered","fa-terminal":"fa-terminal","fa-code":"fa-code","fa-mail-reply-all":"fa-mail-reply-all","fa-reply-all":"fa-reply-all","fa-star-half-empty":"fa-star-half-empty","fa-star-half-full":"fa-star-half-full","fa-star-half-o":"fa-star-half-o","fa-location-arrow":"fa-location-arrow","fa-crop":"fa-crop","fa-code-fork":"fa-code-fork","fa-unlink":"fa-unlink","fa-chain-broken":"fa-chain-broken","fa-question":"fa-question","fa-info":"fa-info","fa-exclamation":"fa-exclamation","fa-superscript":"fa-superscript","fa-subscript":"fa-subscript","fa-eraser":"fa-eraser","fa-puzzle-piece":"fa-puzzle-piece","fa-microphone":"fa-microphone","fa-microphone-slash":"fa-microphone-slash","fa-shield":"fa-shield","fa-calendar-o":"fa-calendar-o","fa-fire-extinguisher":"fa-fire-extinguisher","fa-rocket":"fa-rocket","fa-maxcdn":"fa-maxcdn","fa-chevron-circle-left":"fa-chevron-circle-left","fa-chevron-circle-right":"fa-chevron-circle-right","fa-chevron-circle-up":"fa-chevron-circle-up","fa-chevron-circle-down":"fa-chevron-circle-down","fa-html5":"fa-html5","fa-css3":"fa-css3","fa-anchor":"fa-anchor","fa-unlock-alt":"fa-unlock-alt","fa-bullseye":"fa-bullseye","fa-ellipsis-h":"fa-ellipsis-h","fa-ellipsis-v":"fa-ellipsis-v","fa-rss-square":"fa-rss-square","fa-play-circle":"fa-play-circle","fa-ticket":"fa-ticket","fa-minus-square":"fa-minus-square","fa-minus-square-o":"fa-minus-square-o","fa-level-up":"fa-level-up","fa-level-down":"fa-level-down","fa-check-square":"fa-check-square","fa-pencil-square":"fa-pencil-square","fa-external-link-square":"fa-external-link-square","fa-share-square":"fa-share-square","fa-compass":"fa-compass","fa-toggle-down":"fa-toggle-down","fa-caret-square-o-down":"fa-caret-square-o-down","fa-toggle-up":"fa-toggle-up","fa-caret-square-o-up":"fa-caret-square-o-up","fa-toggle-right":"fa-toggle-right","fa-caret-square-o-right":"fa-caret-square-o-right","fa-euro":"fa-euro","fa-eur":"fa-eur","fa-gbp":"fa-gbp","fa-dollar":"fa-dollar","fa-usd":"fa-usd","fa-rupee":"fa-rupee","fa-inr":"fa-inr","fa-cny":"fa-cny","fa-rmb":"fa-rmb","fa-yen":"fa-yen","fa-jpy":"fa-jpy","fa-ruble":"fa-ruble","fa-rouble":"fa-rouble","fa-rub":"fa-rub","fa-won":"fa-won","fa-krw":"fa-krw","fa-bitcoin":"fa-bitcoin","fa-btc":"fa-btc","fa-file":"fa-file","fa-file-text":"fa-file-text","fa-sort-alpha-asc":"fa-sort-alpha-asc","fa-sort-alpha-desc":"fa-sort-alpha-desc","fa-sort-amount-asc":"fa-sort-amount-asc","fa-sort-amount-desc":"fa-sort-amount-desc","fa-sort-numeric-asc":"fa-sort-numeric-asc","fa-sort-numeric-desc":"fa-sort-numeric-desc","fa-thumbs-up":"fa-thumbs-up","fa-thumbs-down":"fa-thumbs-down","fa-youtube-square":"fa-youtube-square","fa-youtube":"fa-youtube","fa-xing":"fa-xing","fa-xing-square":"fa-xing-square","fa-youtube-play":"fa-youtube-play","fa-dropbox":"fa-dropbox","fa-stack-overflow":"fa-stack-overflow","fa-instagram":"fa-instagram","fa-flickr":"fa-flickr","fa-adn":"fa-adn","fa-bitbucket":"fa-bitbucket","fa-bitbucket-square":"fa-bitbucket-square","fa-tumblr":"fa-tumblr","fa-tumblr-square":"fa-tumblr-square","fa-long-arrow-down":"fa-long-arrow-down","fa-long-arrow-up":"fa-long-arrow-up","fa-long-arrow-left":"fa-long-arrow-left","fa-long-arrow-right":"fa-long-arrow-right","fa-apple":"fa-apple","fa-windows":"fa-windows","fa-android":"fa-android","fa-linux":"fa-linux","fa-dribbble":"fa-dribbble","fa-skype":"fa-skype","fa-foursquare":"fa-foursquare","fa-trello":"fa-trello","fa-female":"fa-female","fa-male":"fa-male","fa-gittip":"fa-gittip","fa-gratipay":"fa-gratipay","fa-sun-o":"fa-sun-o","fa-moon-o":"fa-moon-o","fa-archive":"fa-archive","fa-bug":"fa-bug","fa-vk":"fa-vk","fa-weibo":"fa-weibo","fa-renren":"fa-renren","fa-pagelines":"fa-pagelines","fa-stack-exchange":"fa-stack-exchange","fa-arrow-circle-o-right":"fa-arrow-circle-o-right","fa-arrow-circle-o-left":"fa-arrow-circle-o-left","fa-toggle-left":"fa-toggle-left","fa-caret-square-o-left":"fa-caret-square-o-left","fa-dot-circle-o":"fa-dot-circle-o","fa-wheelchair":"fa-wheelchair","fa-vimeo-square":"fa-vimeo-square","fa-turkish-lira":"fa-turkish-lira","fa-try":"fa-try","fa-plus-square-o":"fa-plus-square-o","fa-space-shuttle":"fa-space-shuttle","fa-slack":"fa-slack","fa-envelope-square":"fa-envelope-square","fa-wordpress":"fa-wordpress","fa-openid":"fa-openid","fa-institution":"fa-institution","fa-bank":"fa-bank","fa-university":"fa-university","fa-mortar-board":"fa-mortar-board","fa-graduation-cap":"fa-graduation-cap","fa-yahoo":"fa-yahoo","fa-google":"fa-google","fa-reddit":"fa-reddit","fa-reddit-square":"fa-reddit-square","fa-stumbleupon-circle":"fa-stumbleupon-circle","fa-stumbleupon":"fa-stumbleupon","fa-delicious":"fa-delicious","fa-digg":"fa-digg","fa-pied-piper-pp":"fa-pied-piper-pp","fa-pied-piper-alt":"fa-pied-piper-alt","fa-drupal":"fa-drupal","fa-joomla":"fa-joomla","fa-language":"fa-language","fa-fax":"fa-fax","fa-building":"fa-building","fa-child":"fa-child","fa-paw":"fa-paw","fa-spoon":"fa-spoon","fa-cube":"fa-cube","fa-cubes":"fa-cubes","fa-behance":"fa-behance","fa-behance-square":"fa-behance-square","fa-steam":"fa-steam","fa-steam-square":"fa-steam-square","fa-recycle":"fa-recycle","fa-automobile":"fa-automobile","fa-car":"fa-car","fa-cab":"fa-cab","fa-taxi":"fa-taxi","fa-tree":"fa-tree","fa-spotify":"fa-spotify","fa-deviantart":"fa-deviantart","fa-soundcloud":"fa-soundcloud","fa-database":"fa-database","fa-file-pdf-o":"fa-file-pdf-o","fa-file-word-o":"fa-file-word-o","fa-file-excel-o":"fa-file-excel-o","fa-file-powerpoint-o":"fa-file-powerpoint-o","fa-file-photo-o":"fa-file-photo-o","fa-file-picture-o":"fa-file-picture-o","fa-file-image-o":"fa-file-image-o","fa-file-zip-o":"fa-file-zip-o","fa-file-archive-o":"fa-file-archive-o","fa-file-sound-o":"fa-file-sound-o","fa-file-audio-o":"fa-file-audio-o","fa-file-movie-o":"fa-file-movie-o","fa-file-video-o":"fa-file-video-o","fa-file-code-o":"fa-file-code-o","fa-vine":"fa-vine","fa-codepen":"fa-codepen","fa-jsfiddle":"fa-jsfiddle","fa-life-bouy":"fa-life-bouy","fa-life-buoy":"fa-life-buoy","fa-life-saver":"fa-life-saver","fa-support":"fa-support","fa-life-ring":"fa-life-ring","fa-circle-o-notch":"fa-circle-o-notch","fa-ra":"fa-ra","fa-resistance":"fa-resistance","fa-rebel":"fa-rebel","fa-ge":"fa-ge","fa-empire":"fa-empire","fa-git-square":"fa-git-square","fa-git":"fa-git","fa-y-combinator-square":"fa-y-combinator-square","fa-yc-square":"fa-yc-square","fa-hacker-news":"fa-hacker-news","fa-tencent-weibo":"fa-tencent-weibo","fa-qq":"fa-qq","fa-wechat":"fa-wechat","fa-weixin":"fa-weixin","fa-send":"fa-send","fa-paper-plane":"fa-paper-plane","fa-send-o":"fa-send-o","fa-paper-plane-o":"fa-paper-plane-o","fa-history":"fa-history","fa-circle-thin":"fa-circle-thin","fa-header":"fa-header","fa-paragraph":"fa-paragraph","fa-sliders":"fa-sliders","fa-share-alt":"fa-share-alt","fa-share-alt-square":"fa-share-alt-square","fa-bomb":"fa-bomb","fa-soccer-ball-o":"fa-soccer-ball-o","fa-futbol-o":"fa-futbol-o","fa-tty":"fa-tty","fa-binoculars":"fa-binoculars","fa-plug":"fa-plug","fa-slideshare":"fa-slideshare","fa-twitch":"fa-twitch","fa-yelp":"fa-yelp","fa-newspaper-o":"fa-newspaper-o","fa-wifi":"fa-wifi","fa-calculator":"fa-calculator","fa-paypal":"fa-paypal","fa-google-wallet":"fa-google-wallet","fa-cc-visa":"fa-cc-visa","fa-cc-mastercard":"fa-cc-mastercard","fa-cc-discover":"fa-cc-discover","fa-cc-amex":"fa-cc-amex","fa-cc-paypal":"fa-cc-paypal","fa-cc-stripe":"fa-cc-stripe","fa-bell-slash":"fa-bell-slash","fa-bell-slash-o":"fa-bell-slash-o","fa-trash":"fa-trash","fa-copyright":"fa-copyright","fa-at":"fa-at","fa-eyedropper":"fa-eyedropper","fa-paint-brush":"fa-paint-brush","fa-birthday-cake":"fa-birthday-cake","fa-area-chart":"fa-area-chart","fa-pie-chart":"fa-pie-chart","fa-line-chart":"fa-line-chart","fa-lastfm":"fa-lastfm","fa-lastfm-square":"fa-lastfm-square","fa-toggle-off":"fa-toggle-off","fa-toggle-on":"fa-toggle-on","fa-bicycle":"fa-bicycle","fa-bus":"fa-bus","fa-ioxhost":"fa-ioxhost","fa-angellist":"fa-angellist","fa-cc":"fa-cc","fa-shekel":"fa-shekel","fa-sheqel":"fa-sheqel","fa-ils":"fa-ils","fa-meanpath":"fa-meanpath","fa-buysellads":"fa-buysellads","fa-connectdevelop":"fa-connectdevelop","fa-dashcube":"fa-dashcube","fa-forumbee":"fa-forumbee","fa-leanpub":"fa-leanpub","fa-sellsy":"fa-sellsy","fa-shirtsinbulk":"fa-shirtsinbulk","fa-simplybuilt":"fa-simplybuilt","fa-skyatlas":"fa-skyatlas","fa-cart-plus":"fa-cart-plus","fa-cart-arrow-down":"fa-cart-arrow-down","fa-diamond":"fa-diamond","fa-ship":"fa-ship","fa-user-secret":"fa-user-secret","fa-motorcycle":"fa-motorcycle","fa-street-view":"fa-street-view","fa-heartbeat":"fa-heartbeat","fa-venus":"fa-venus","fa-mars":"fa-mars","fa-mercury":"fa-mercury","fa-intersex":"fa-intersex","fa-transgender":"fa-transgender","fa-transgender-alt":"fa-transgender-alt","fa-venus-double":"fa-venus-double","fa-mars-double":"fa-mars-double","fa-venus-mars":"fa-venus-mars","fa-mars-stroke":"fa-mars-stroke","fa-mars-stroke-v":"fa-mars-stroke-v","fa-mars-stroke-h":"fa-mars-stroke-h","fa-neuter":"fa-neuter","fa-genderless":"fa-genderless","fa-facebook-official":"fa-facebook-official","fa-pinterest-p":"fa-pinterest-p","fa-whatsapp":"fa-whatsapp","fa-server":"fa-server","fa-user-plus":"fa-user-plus","fa-user-times":"fa-user-times","fa-hotel":"fa-hotel","fa-bed":"fa-bed","fa-viacoin":"fa-viacoin","fa-train":"fa-train","fa-subway":"fa-subway","fa-medium":"fa-medium","fa-yc":"fa-yc","fa-y-combinator":"fa-y-combinator","fa-optin-monster":"fa-optin-monster","fa-opencart":"fa-opencart","fa-expeditedssl":"fa-expeditedssl","fa-battery-4":"fa-battery-4","fa-battery":"fa-battery","fa-battery-full":"fa-battery-full","fa-battery-3":"fa-battery-3","fa-battery-three-quarters":"fa-battery-three-quarters","fa-battery-2":"fa-battery-2","fa-battery-half":"fa-battery-half","fa-battery-1":"fa-battery-1","fa-battery-quarter":"fa-battery-quarter","fa-battery-0":"fa-battery-0","fa-battery-empty":"fa-battery-empty","fa-mouse-pointer":"fa-mouse-pointer","fa-i-cursor":"fa-i-cursor","fa-object-group":"fa-object-group","fa-object-ungroup":"fa-object-ungroup","fa-sticky-note":"fa-sticky-note","fa-sticky-note-o":"fa-sticky-note-o","fa-cc-jcb":"fa-cc-jcb","fa-cc-diners-club":"fa-cc-diners-club","fa-clone":"fa-clone","fa-balance-scale":"fa-balance-scale","fa-hourglass-o":"fa-hourglass-o","fa-hourglass-1":"fa-hourglass-1","fa-hourglass-start":"fa-hourglass-start","fa-hourglass-2":"fa-hourglass-2","fa-hourglass-half":"fa-hourglass-half","fa-hourglass-3":"fa-hourglass-3","fa-hourglass-end":"fa-hourglass-end","fa-hourglass":"fa-hourglass","fa-hand-grab-o":"fa-hand-grab-o","fa-hand-rock-o":"fa-hand-rock-o","fa-hand-stop-o":"fa-hand-stop-o","fa-hand-paper-o":"fa-hand-paper-o","fa-hand-scissors-o":"fa-hand-scissors-o","fa-hand-lizard-o":"fa-hand-lizard-o","fa-hand-spock-o":"fa-hand-spock-o","fa-hand-pointer-o":"fa-hand-pointer-o","fa-hand-peace-o":"fa-hand-peace-o","fa-trademark":"fa-trademark","fa-registered":"fa-registered","fa-creative-commons":"fa-creative-commons","fa-gg":"fa-gg","fa-gg-circle":"fa-gg-circle","fa-tripadvisor":"fa-tripadvisor","fa-odnoklassniki":"fa-odnoklassniki","fa-odnoklassniki-square":"fa-odnoklassniki-square","fa-get-pocket":"fa-get-pocket","fa-wikipedia-w":"fa-wikipedia-w","fa-safari":"fa-safari","fa-chrome":"fa-chrome","fa-firefox":"fa-firefox","fa-opera":"fa-opera","fa-internet-explorer":"fa-internet-explorer","fa-tv":"fa-tv","fa-television":"fa-television","fa-contao":"fa-contao","fa-500px":"fa-500px","fa-amazon":"fa-amazon","fa-calendar-plus-o":"fa-calendar-plus-o","fa-calendar-minus-o":"fa-calendar-minus-o","fa-calendar-times-o":"fa-calendar-times-o","fa-calendar-check-o":"fa-calendar-check-o","fa-industry":"fa-industry","fa-map-pin":"fa-map-pin","fa-map-signs":"fa-map-signs","fa-map-o":"fa-map-o","fa-map":"fa-map","fa-commenting":"fa-commenting","fa-commenting-o":"fa-commenting-o","fa-houzz":"fa-houzz","fa-vimeo":"fa-vimeo","fa-black-tie":"fa-black-tie","fa-fonticons":"fa-fonticons","fa-reddit-alien":"fa-reddit-alien","fa-edge":"fa-edge","fa-credit-card-alt":"fa-credit-card-alt","fa-codiepie":"fa-codiepie","fa-modx":"fa-modx","fa-fort-awesome":"fa-fort-awesome","fa-usb":"fa-usb","fa-product-hunt":"fa-product-hunt","fa-mixcloud":"fa-mixcloud","fa-scribd":"fa-scribd","fa-pause-circle":"fa-pause-circle","fa-pause-circle-o":"fa-pause-circle-o","fa-stop-circle":"fa-stop-circle","fa-stop-circle-o":"fa-stop-circle-o","fa-shopping-bag":"fa-shopping-bag","fa-shopping-basket":"fa-shopping-basket","fa-hashtag":"fa-hashtag","fa-bluetooth":"fa-bluetooth","fa-bluetooth-b":"fa-bluetooth-b","fa-percent":"fa-percent","fa-gitlab":"fa-gitlab","fa-wpbeginner":"fa-wpbeginner","fa-wpforms":"fa-wpforms","fa-envira":"fa-envira","fa-universal-access":"fa-universal-access","fa-wheelchair-alt":"fa-wheelchair-alt","fa-question-circle-o":"fa-question-circle-o","fa-blind":"fa-blind","fa-audio-description":"fa-audio-description","fa-volume-control-phone":"fa-volume-control-phone","fa-braille":"fa-braille","fa-assistive-listening-systems":"fa-assistive-listening-systems","fa-asl-interpreting":"fa-asl-interpreting","fa-american-sign-language-interpreting":"fa-american-sign-language-interpreting","fa-deafness":"fa-deafness","fa-hard-of-hearing":"fa-hard-of-hearing","fa-deaf":"fa-deaf","fa-glide":"fa-glide","fa-glide-g":"fa-glide-g","fa-signing":"fa-signing","fa-sign-language":"fa-sign-language","fa-low-vision":"fa-low-vision","fa-viadeo":"fa-viadeo","fa-viadeo-square":"fa-viadeo-square","fa-snapchat":"fa-snapchat","fa-snapchat-ghost":"fa-snapchat-ghost","fa-snapchat-square":"fa-snapchat-square","fa-pied-piper":"fa-pied-piper","fa-first-order":"fa-first-order","fa-yoast":"fa-yoast","fa-themeisle":"fa-themeisle","fa-google-plus-circle":"fa-google-plus-circle","fa-google-plus-official":"fa-google-plus-official","fa-fa":"fa-fa","fa-font-awesome":"fa-font-awesome","fa-handshake-o":"fa-handshake-o","fa-envelope-open":"fa-envelope-open","fa-envelope-open-o":"fa-envelope-open-o","fa-linode":"fa-linode","fa-address-book":"fa-address-book","fa-address-book-o":"fa-address-book-o","fa-vcard":"fa-vcard","fa-address-card":"fa-address-card","fa-vcard-o":"fa-vcard-o","fa-address-card-o":"fa-address-card-o","fa-user-circle":"fa-user-circle","fa-user-circle-o":"fa-user-circle-o","fa-user-o":"fa-user-o","fa-id-badge":"fa-id-badge","fa-drivers-license":"fa-drivers-license","fa-id-card":"fa-id-card","fa-drivers-license-o":"fa-drivers-license-o","fa-id-card-o":"fa-id-card-o","fa-quora":"fa-quora","fa-free-code-camp":"fa-free-code-camp","fa-telegram":"fa-telegram","fa-thermometer-4":"fa-thermometer-4","fa-thermometer":"fa-thermometer","fa-thermometer-full":"fa-thermometer-full","fa-thermometer-3":"fa-thermometer-3","fa-thermometer-three-quarters":"fa-thermometer-three-quarters","fa-thermometer-2":"fa-thermometer-2","fa-thermometer-half":"fa-thermometer-half","fa-thermometer-1":"fa-thermometer-1","fa-thermometer-quarter":"fa-thermometer-quarter","fa-thermometer-0":"fa-thermometer-0","fa-thermometer-empty":"fa-thermometer-empty","fa-shower":"fa-shower","fa-bathtub":"fa-bathtub","fa-s15":"fa-s15","fa-bath":"fa-bath","fa-podcast":"fa-podcast","fa-window-maximize":"fa-window-maximize","fa-window-minimize":"fa-window-minimize","fa-window-restore":"fa-window-restore","fa-times-rectangle":"fa-times-rectangle","fa-window-close":"fa-window-close","fa-times-rectangle-o":"fa-times-rectangle-o","fa-window-close-o":"fa-window-close-o","fa-bandcamp":"fa-bandcamp","fa-grav":"fa-grav","fa-etsy":"fa-etsy","fa-imdb":"fa-imdb","fa-ravelry":"fa-ravelry","fa-eercast":"fa-eercast","fa-microchip":"fa-microchip","fa-snowflake-o":"fa-snowflake-o","fa-superpowers":"fa-superpowers","fa-wpexplorer":"fa-wpexplorer","fa-meetup":"fa-meetup","navbar-container":"navbar-container","navbar-homepage":"navbar-homepage","homepage-logo":"homepage-logo","drawingModeBtn":"drawingModeBtn","form-drawing":"form-drawing","form-drawing-wrapper":"form-drawing-wrapper","selected":"selected","showPointer":"showPointer","zoom-action-list":"zoom-action-list","zoomTarget-wrapper":"zoomTarget-wrapper","zoomTarget":"zoomTarget","cut-canvas":"cut-canvas","no-padding":"no-padding","annotation-content":"annotation-content","highlight":"highlight","revision-proposal":"revision-proposal","collection-home-btn":"collection-home-btn","img-stats-dt":"img-stats-dt","img-stats-dd":"img-stats-dd","revision-link":"revision-link","item-image-thumbnail":"item-image-thumbnail","annotation-comments":"annotation-comments","comment-reply-link":"comment-reply-link","comment-subtext":"comment-subtext","comment-metacategories":"comment-metacategories","comment-separator":"comment-separator","pagination-shortcut":"pagination-shortcut","badge-error":"badge-error","badge-warning":"badge-warning","badge-success":"badge-success","badge-info":"badge-info","badge-inverse":"badge-inverse","notif-badge":"notif-badge","show-all-notifications":"show-all-notifications","annotation-panel":"annotation-panel","annotation-detail":"annotation-detail","stats-annotation-userpage":"stats-annotation-userpage","image-detail":"image-detail","large-image-detail":"large-image-detail","no-user-annotation":"no-user-annotation","dt-annotation":"dt-annotation","userpage-annotation-btn":"userpage-annotation-btn","home-main-button-container":"home-main-button-container","home-main-button":"home-main-button","collection-title":"collection-title","collection-summary":"collection-summary","collection-container":"collection-container","collection-home-title":"collection-home-title","tab-selector":"tab-selector","image-list-wrapper":"image-list-wrapper","image-list-li":"image-list-li","image-list-image-container":"image-list-image-container","object-info":"object-info","collection-home-item-btn":"collection-home-item-btn","collection-home-tab":"collection-home-tab","diff-viewer-wrapper":"diff-viewer-wrapper","diff-panel":"diff-panel","close-btn":"close-btn","partners-icons":"partners-icons","footer-link":"footer-link","footer-info":"footer-info","legals-dl":"legals-dl","show-complete-link":"show-complete-link","hide-complete-link":"hide-complete-link","description-col":"description-col"};
-
-/***/ }
-/******/ ]);
+!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function n(t){var e=parseFloat(t);return isNaN(e)?t:e}function r(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function i(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function o(t,e){return gi.call(t,e)}function a(t){return"string"==typeof t||"number"==typeof t}function s(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}function l(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function c(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function f(t,e){for(var n in e)t[n]=e[n];return t}function u(t){return null!==t&&"object"==typeof t}function h(t){return xi.call(t)===wi}function p(t){for(var e={},n=0;n<t.length;n++)t[n]&&f(e,t[n]);return e}function d(){}function g(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}function v(t,e){var n=u(t),r=u(e);return n&&r?JSON.stringify(t)===JSON.stringify(e):!n&&!r&&String(t)===String(e)}function m(t,e){for(var n=0;n<t.length;n++)if(v(t[n],e))return n;return-1}function y(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function b(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function _(t){if(!ji.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}function x(t){return/native code/.test(t.toString())}function w(t){Vi.target&&Hi.push(Vi.target),Vi.target=t}function k(){Vi.target=Hi.pop()}function C(t,e){t.__proto__=e}function T(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];b(t,o,e[o])}}function j(t,e){if(u(t)){var n;return o(t,"__ob__")&&t.__ob__ instanceof Gi?n=t.__ob__:Ji.shouldConvert&&!Fi()&&(Array.isArray(t)||h(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new Gi(t)),e&&n&&n.vmCount++,n}}function $(t,e,n,r){var i=new Vi,o=Object.getOwnPropertyDescriptor(t,e);if(!o||o.configurable!==!1){var a=o&&o.get,s=o&&o.set,l=j(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=a?a.call(t):n;return Vi.target&&(i.depend(),l&&l.dep.depend(),Array.isArray(e)&&O(e)),e},set:function(e){var o=a?a.call(t):n;e===o||e!==e&&o!==o||(r&&r(),s?s.call(t,e):n=e,l=j(e),i.notify())}})}}function A(t,e,n){if(Array.isArray(t))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(o(t,e))return void(t[e]=n);var r=t.__ob__;return t._isVue||r&&r.vmCount?void zi("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."):r?($(r.value,e,n),r.dep.notify(),n):void(t[e]=n)}function S(t,e){var n=t.__ob__;return t._isVue||n&&n.vmCount?void zi("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):void(o(t,e)&&(delete t[e],n&&n.dep.notify()))}function O(t){for(var e=void 0,n=0,r=t.length;n<r;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&O(e)}function M(t,e){if(!e)return t;for(var n,r,i,a=Object.keys(e),s=0;s<a.length;s++)n=a[s],r=t[n],i=e[n],o(t,n)?h(r)&&h(i)&&M(r,i):A(t,n,i);return t}function E(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t}function P(t,e){var n=Object.create(t||null);return e?f(n,e):n}function N(t){for(var e in t.components){var n=e.toLowerCase();(di(n)||Ti.isReservedTag(n))&&zi("Do not use built-in or reserved HTML elements as component id: "+e)}}function F(t){var e=t.props;if(e){var n,r,i,o={};if(Array.isArray(e))for(n=e.length;n--;)r=e[n],"string"==typeof r?(i=mi(r),o[i]={type:null}):zi("props must be strings when using array syntax.");else if(h(e))for(var a in e)r=e[a],i=mi(a),o[i]=h(r)?r:{type:r};t.props=o}}function R(t){var e=t.directives;if(e)for(var n in e){var r=e[n];"function"==typeof r&&(e[n]={bind:r,update:r})}}function B(t,e,n){function r(r){var i=Xi[r]||Ki;f[r]=i(t[r],e[r],n,r)}N(e),F(e),R(e);var i=e.extends;if(i&&(t="function"==typeof i?B(t,i.options,n):B(t,i,n)),e.mixins)for(var a=0,s=e.mixins.length;a<s;a++){var l=e.mixins[a];l.prototype instanceof Ut&&(l=l.options),t=B(t,l,n)}var c,f={};for(c in t)r(c);for(c in e)o(t,c)||r(c);return f}function D(t,e,n,r){if("string"==typeof n){var i=t[e];if(o(i,n))return i[n];var a=mi(n);if(o(i,a))return i[a];var s=yi(a);if(o(i,s))return i[s];var l=i[n]||i[a]||i[s];return r&&!l&&zi("Failed to resolve "+e.slice(0,-1)+": "+n,t),l}}function z(t,e,n,r){var i=e[t],a=!o(n,t),s=n[t];if(H(Boolean,i.type)&&(a&&!o(i,"default")?s=!1:H(String,i.type)||""!==s&&s!==_i(t)||(s=!0)),void 0===s){s=I(r,i,t);var l=Ji.shouldConvert;Ji.shouldConvert=!0,j(s),Ji.shouldConvert=l}return L(i,t,s,r,a),s}function I(t,e,n){if(o(e,"default")){var r=e.default;return u(r)&&zi('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',t),t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t[n]?t[n]:"function"==typeof r&&e.type!==Function?r.call(t):r}}function L(t,e,n,r,i){if(t.required&&i)return void zi('Missing required prop: "'+e+'"',r);if(null!=n||t.required){var o=t.type,a=!o||o===!0,s=[];if(o){Array.isArray(o)||(o=[o]);for(var l=0;l<o.length&&!a;l++){var c=q(n,o[l]);s.push(c.expectedType||""),a=c.valid}}if(!a)return void zi('Invalid prop: type check failed for prop "'+e+'". Expected '+s.map(yi).join(", ")+", got "+Object.prototype.toString.call(n).slice(8,-1)+".",r);var f=t.validator;f&&(f(n)||zi('Invalid prop: custom validator check failed for prop "'+e+'".',r))}}function q(t,e){var n,r=V(e);return n="String"===r?typeof t==(r="string"):"Number"===r?typeof t==(r="number"):"Boolean"===r?typeof t==(r="boolean"):"Function"===r?typeof t==(r="function"):"Object"===r?h(t):"Array"===r?Array.isArray(t):t instanceof e,{valid:n,expectedType:r}}function V(t){var e=t&&t.toString().match(/^\s*function (\w+)/);return e&&e[1]}function H(t,e){if(!Array.isArray(e))return V(e)===V(t);for(var n=0,r=e.length;n<r;n++)if(V(e[n])===V(t))return!0;return!1}function U(t){return new ao(void 0,void 0,void 0,String(t))}function W(t){var e=new ao(t.tag,t.data,t.children,t.text,t.elm,t.context,t.componentOptions);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isCloned=!0,e}function Z(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=W(t[n]);return e}function J(t,e,n,r,i){if(t){var o=n.$options._base;if(u(t)&&(t=o.extend(t)),"function"!=typeof t)return void zi("Invalid Component definition: "+String(t),n);if(!t.cid)if(t.resolved)t=t.resolved;else if(t=et(t,o,function(){n.$forceUpdate()}),!t)return;Ht(t),e=e||{};var a=nt(e,t);if(t.options.functional)return G(t,a,e,n,r);var s=e.on;e.on=e.nativeOn,t.options.abstract&&(e={}),it(e);var l=t.options.name||i,c=new ao("vue-component-"+t.cid+(l?"-"+l:""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:a,listeners:s,tag:i,children:r});return c}}function G(t,e,n,r,i){var o={},a=t.options.props;if(a)for(var s in a)o[s]=z(s,a,e);var l=Object.create(r),c=function(t,e,n,r){return pt(l,t,e,n,r,!0)},f=t.options.render.call(null,c,{props:o,data:n,parent:r,children:i,slots:function(){return yt(i,r)}});return f instanceof ao&&(f.functionalContext=r,n.slot&&((f.data||(f.data={})).slot=n.slot)),f}function X(t,e,n,r){var i=t.componentOptions,o={_isComponent:!0,parent:e,propsData:i.propsData,_componentTag:i.tag,_parentVnode:t,_parentListeners:i.listeners,_renderChildren:i.children,_parentElm:n||null,_refElm:r||null},a=t.data.inlineTemplate;return a&&(o.render=a.render,o.staticRenderFns=a.staticRenderFns),new i.Ctor(o)}function Y(t,e,n,r){if(!t.componentInstance||t.componentInstance._isDestroyed){var i=t.componentInstance=X(t,vo,n,r);i.$mount(e?t.elm:void 0,e)}else if(t.data.keepAlive){var o=t;K(o,o)}}function K(t,e){var n=e.componentOptions,r=e.componentInstance=t.componentInstance;r._updateFromParent(n.propsData,n.listeners,e,n.children)}function Q(t){t.componentInstance._isMounted||(t.componentInstance._isMounted=!0,jt(t.componentInstance,"mounted")),t.data.keepAlive&&(t.componentInstance._inactive=!1,jt(t.componentInstance,"activated"))}function tt(t){t.componentInstance._isDestroyed||(t.data.keepAlive?(t.componentInstance._inactive=!0,jt(t.componentInstance,"deactivated")):t.componentInstance.$destroy())}function et(t,e,n){if(!t.requested){t.requested=!0;var r=t.pendingCallbacks=[n],i=!0,o=function(n){if(u(n)&&(n=e.extend(n)),t.resolved=n,!i)for(var o=0,a=r.length;o<a;o++)r[o](n)},a=function(e){zi("Failed to resolve async component: "+String(t)+(e?"\nReason: "+e:""))},s=t(o,a);return s&&"function"==typeof s.then&&!t.resolved&&s.then(o,a),i=!1,t.resolved}t.pendingCallbacks.push(n)}function nt(t,e){var n=e.options.props;if(n){var r={},i=t.attrs,o=t.props,a=t.domProps;if(i||o||a)for(var s in n){var l=_i(s);rt(r,o,s,l,!0)||rt(r,i,s,l)||rt(r,a,s,l)}return r}}function rt(t,e,n,r,i){if(e){if(o(e,n))return t[n]=e[n],i||delete e[n],!0;if(o(e,r))return t[n]=e[r],i||delete e[r],!0}return!1}function it(t){t.hook||(t.hook={});for(var e=0;e<uo.length;e++){var n=uo[e],r=t.hook[n],i=fo[n];t.hook[n]=r?ot(i,r):i}}function ot(t,e){return function(n,r,i,o){t(n,r,i,o),e(n,r,i,o)}}function at(t,e,n,r){r+=e;var i=t.__injected||(t.__injected={});if(!i[r]){i[r]=!0;var o=t[e];o?t[e]=function(){o.apply(this,arguments),n.apply(this,arguments)}:t[e]=n}}function st(t){var e={fn:t,invoker:function(){var t=arguments,n=e.fn;if(Array.isArray(n))for(var r=0;r<n.length;r++)n[r].apply(null,t);else n.apply(null,arguments)}};return e}function lt(t,e,n,r,i){var o,a,s,l;for(o in t)a=t[o],s=e[o],l=ho(o),a?s?a!==s&&(s.fn=a,t[o]=s):(a.invoker||(a=t[o]=st(a)),n(l.name,a.invoker,l.once,l.capture)):zi('Invalid handler for event "'+l.name+'": got '+String(a),i);for(o in e)t[o]||(l=ho(o),r(l.name,e[o].invoker,l.capture))}function ct(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}function ft(t){return a(t)?[U(t)]:Array.isArray(t)?ut(t):void 0}function ut(t,e){var n,r,i,o=[];for(n=0;n<t.length;n++)r=t[n],null!=r&&"boolean"!=typeof r&&(i=o[o.length-1],Array.isArray(r)?o.push.apply(o,ut(r,(e||"")+"_"+n)):a(r)?i&&i.text?i.text+=String(r):""!==r&&o.push(U(r)):r.text&&i&&i.text?o[o.length-1]=U(i.text+r.text):(r.tag&&null==r.key&&null!=e&&(r.key="__vlist"+e+"_"+n+"__"),o.push(r)));return o}function ht(t){return t&&t.filter(function(t){return t&&t.componentOptions})[0]}function pt(t,e,n,r,i,o){return(Array.isArray(n)||a(n))&&(i=r,r=n,n=void 0),o&&(i=go),dt(t,e,n,r,i)}function dt(t,e,n,r,i){if(n&&n.__ob__)return zi("Avoid using observed data object as vnode data: "+JSON.stringify(n)+"\nAlways create fresh vnode data objects in each render!",t),co();if(!e)return co();Array.isArray(r)&&"function"==typeof r[0]&&(n=n||{},n.scopedSlots={default:r[0]},r.length=0),i===go?r=ft(r):i===po&&(r=ct(r));var o,a;if("string"==typeof e){var s;a=Ti.getTagNamespace(e),o=Ti.isReservedTag(e)?new ao(Ti.parsePlatformTagName(e),n,r,void 0,void 0,t):(s=D(t.$options,"components",e))?J(s,n,t,r,e):new ao(e,n,r,void 0,void 0,t)}else o=J(e,n,t,r);return o?(a&>(o,a),o):co()}function gt(t,e){if(t.ns=e,"foreignObject"!==t.tag&&t.children)for(var n=0,r=t.children.length;n<r;n++){var i=t.children[n];i.tag&&!i.ns&>(i,e)}}function vt(t){t.$vnode=null,t._vnode=null,t._staticTrees=null;var e=t.$options._parentVnode,n=e&&e.context;t.$slots=yt(t.$options._renderChildren,n),t.$scopedSlots={},t._c=function(e,n,r,i){return pt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return pt(t,e,n,r,i,!0)}}function mt(e){function r(t,e,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&i(t[r],e+"_"+r,n);else i(t,e,n)}function i(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}e.prototype.$nextTick=function(t){return Bi(t,this)},e.prototype._render=function(){var t=this,e=t.$options,n=e.render,r=e.staticRenderFns,i=e._parentVnode;if(t._isMounted)for(var o in t.$slots)t.$slots[o]=Z(t.$slots[o]);i&&i.data.scopedSlots&&(t.$scopedSlots=i.data.scopedSlots),r&&!t._staticTrees&&(t._staticTrees=[]),t.$vnode=i;var a;try{a=n.call(t._renderProxy,t.$createElement)}catch(e){if(!Ti.errorHandler)throw zi("Error when rendering "+Di(t)+":"),e;Ti.errorHandler.call(null,e,t),a=t._vnode}return a instanceof ao||(Array.isArray(a)&&zi("Multiple root nodes returned from render function. Render function should return a single root node.",t),a=co()),a.parent=i,a},e.prototype._s=t,e.prototype._v=U,e.prototype._n=n,e.prototype._e=co,e.prototype._q=v,e.prototype._i=m,e.prototype._m=function(t,e){var n=this._staticTrees[t];return n&&!e?Array.isArray(n)?Z(n):W(n):(n=this._staticTrees[t]=this.$options.staticRenderFns[t].call(this._renderProxy),r(n,"__static__"+t,!1),n)},e.prototype._o=function(t,e,n){return r(t,"__once__"+e+(n?"_"+n:""),!0),t},e.prototype._f=function(t){return D(this.$options,"filters",t,!0)||Ci},e.prototype._l=function(t,e){var n,r,i,o,a;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,i=t.length;r<i;r++)n[r]=e(t[r],r);else if("number"==typeof t)for(n=new Array(t),r=0;r<t;r++)n[r]=e(r+1,r);else if(u(t))for(o=Object.keys(t),n=new Array(o.length),r=0,i=o.length;r<i;r++)a=o[r],n[r]=e(t[a],a,r);return n},e.prototype._t=function(t,e,n,r){var i=this.$scopedSlots[t];if(i)return n=n||{},r&&f(n,r),i(n)||e;var o=this.$slots[t];return o&&(o._rendered&&zi('Duplicate presence of slot "'+t+'" found in the same render tree - this will likely cause render errors.',this),o._rendered=!0),o||e},e.prototype._b=function(t,e,n,r){if(n)if(u(n)){Array.isArray(n)&&(n=p(n));for(var i in n)if("class"===i||"style"===i)t[i]=n[i];else{var o=t.attrs&&t.attrs.type,a=r||Ti.mustUseProp(e,o,i)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={});a[i]=n[i]}}else zi("v-bind without argument expects an Object or Array value",this);return t},e.prototype._k=function(t,e,n){var r=Ti.keyCodes[e]||n;return Array.isArray(r)?r.indexOf(t)===-1:r!==t}}function yt(t,e){var n={};if(!t)return n;for(var r,i,o=[],a=0,s=t.length;a<s;a++)if(i=t[a],(i.context===e||i.functionalContext===e)&&i.data&&(r=i.data.slot)){var l=n[r]||(n[r]=[]);"template"===i.tag?l.push.apply(l,i.children):l.push(i)}else o.push(i);return o.length&&(1!==o.length||" "!==o[0].text&&!o[0].isComment)&&(n.default=o),n}function bt(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&wt(t,e)}function _t(t,e,n){n?lo.$once(t,e):lo.$on(t,e)}function xt(t,e){lo.$off(t,e)}function wt(t,e,n){lo=t,lt(e,n||{},_t,xt,t)}function kt(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;return(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0),r},t.prototype.$once=function(t,e){function n(){r.$off(t,n),e.apply(r,arguments)}var r=this;return n.fn=e,r.$on(t,n),r},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;var r=n._events[t];if(!r)return n;if(1===arguments.length)return n._events[t]=null,n;for(var i,o=r.length;o--;)if(i=r[o],i===e||i.fn===e){r.splice(o,1);break}return n},t.prototype.$emit=function(t){var e=this,n=e._events[t];if(n){n=n.length>1?c(n):n;for(var r=c(arguments,1),i=0,o=n.length;i<o;i++)n[i].apply(e,r)}return e}}function Ct(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function Tt(t){t.prototype._mount=function(t,e){var n=this;return n.$el=t,n.$options.render||(n.$options.render=co,n.$options.template&&"#"!==n.$options.template.charAt(0)?zi("You are using the runtime-only build of Vue where the template option is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",n):zi("Failed to mount component: template or render function not defined.",n)),jt(n,"beforeMount"),n._watcher=new Co(n,function(){n._update(n._render(),e)},d),e=!1,null==n.$vnode&&(n._isMounted=!0,jt(n,"mounted")),n},t.prototype._update=function(t,e){var n=this;n._isMounted&&jt(n,"beforeUpdate");var r=n.$el,i=n._vnode,o=vo;vo=n,n._vnode=t,i?n.$el=n.__patch__(i,t):n.$el=n.__patch__(n.$el,t,e,!1,n.$options._parentElm,n.$options._refElm),vo=o,r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},t.prototype._updateFromParent=function(t,e,n,r){var i=this,o=!(!i.$options._renderChildren&&!r);if(i.$options._parentVnode=n,i.$vnode=n,i._vnode&&(i._vnode.parent=n),i.$options._renderChildren=r,t&&i.$options.props){Ji.shouldConvert=!1,Ji.isSettingProps=!0;for(var a=i.$options._propKeys||[],s=0;s<a.length;s++){var l=a[s];i[l]=z(l,i.$options.props,t,i)}Ji.shouldConvert=!0,Ji.isSettingProps=!1,i.$options.propsData=t}if(e){var c=i.$options._parentListeners;i.$options._parentListeners=e,wt(i,e,c)}o&&(i.$slots=yt(r,n.context),i.$forceUpdate())},t.prototype.$forceUpdate=function(){var t=this;t._watcher&&t._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){jt(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||i(e.$children,t),t._watcher&&t._watcher.teardown();for(var n=t._watchers.length;n--;)t._watchers[n].teardown();t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,jt(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.__patch__(t._vnode,null)}}}function jt(t,e){var n=t.$options[e];if(n)for(var r=0,i=n.length;r<i;r++)n[r].call(t);t._hasHookEvent&&t.$emit("hook:"+e)}function $t(){mo.length=0,yo={},bo={},_o=xo=!1}function At(){xo=!0;var t,e,n;for(mo.sort(function(t,e){return t.id-e.id}),wo=0;wo<mo.length;wo++)if(t=mo[wo],e=t.id,yo[e]=null,t.run(),null!=yo[e]&&(bo[e]=(bo[e]||0)+1,bo[e]>Ti._maxUpdateCount)){zi("You may have an infinite update loop "+(t.user?'in watcher with expression "'+t.expression+'"':"in a component render function."),t.vm);break}for(wo=mo.length;wo--;)t=mo[wo],n=t.vm,n._watcher===t&&n._isMounted&&jt(n,"updated");Ri&&Ti.devtools&&Ri.emit("flush"),$t()}function St(t){var e=t.id;if(null==yo[e]){if(yo[e]=!0,xo){for(var n=mo.length-1;n>=0&&mo[n].id>t.id;)n--;mo.splice(Math.max(n,wo)+1,0,t)}else mo.push(t);_o||(_o=!0,Bi(At))}}function Ot(t){To.clear(),Mt(t,To)}function Mt(t,e){var n,r,i=Array.isArray(t);if((i||u(t))&&Object.isExtensible(t)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(i)for(n=t.length;n--;)Mt(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)Mt(t[r[n]],e)}}function Et(t){t._watchers=[];var e=t.$options;e.props&&Pt(t,e.props),e.methods&&Bt(t,e.methods),e.data?Nt(t):j(t._data={},!0),e.computed&&Ft(t,e.computed),e.watch&&Dt(t,e.watch)}function Pt(t,e){var n=t.$options.propsData||{},r=t.$options._propKeys=Object.keys(e),i=!t.$parent;Ji.shouldConvert=i;for(var o=function(i){var o=r[i];jo[o]&&zi('"'+o+'" is a reserved attribute and cannot be used as component prop.',t),$(t,o,z(o,e,n,t),function(){t.$parent&&!Ji.isSettingProps&&zi("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: \""+o+'"',t)})},a=0;a<r.length;a++)o(a);Ji.shouldConvert=!0}function Nt(t){var e=t.$options.data;e=t._data="function"==typeof e?e.call(t):e||{},h(e)||(e={},zi("data functions should return an object:\nhttps://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",t));for(var n=Object.keys(e),r=t.$options.props,i=n.length;i--;)r&&o(r,n[i])?zi('The data property "'+n[i]+'" is already declared as a prop. Use prop default value instead.',t):Lt(t,n[i]);j(e,!0)}function Ft(t,e){for(var n in e){n in t&&zi('existing instance property "'+n+'" will be overwritten by a computed property with the same name.',t);var r=e[n];"function"==typeof r?($o.get=Rt(r,t),$o.set=d):($o.get=r.get?r.cache!==!1?Rt(r.get,t):l(r.get,t):d,$o.set=r.set?l(r.set,t):d),Object.defineProperty(t,n,$o)}}function Rt(t,e){var n=new Co(e,t,d,{lazy:!0});return function(){return n.dirty&&n.evaluate(),Vi.target&&n.depend(),n.value}}function Bt(t,e){for(var n in e)t[n]=null==e[n]?d:l(e[n],t),null==e[n]&&zi('method "'+n+'" has an undefined value in the component definition. Did you reference the function correctly?',t)}function Dt(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)zt(t,n,r[i]);else zt(t,n,r)}}function zt(t,e,n){var r;h(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}function It(t){var e={};e.get=function(){return this._data},e.set=function(t){zi("Avoid replacing instance root $data. Use nested data properties instead.",this)},Object.defineProperty(t.prototype,"$data",e),t.prototype.$set=A,t.prototype.$delete=S,t.prototype.$watch=function(t,e,n){var r=this;n=n||{},n.user=!0;var i=new Co(r,t,e,n);return n.immediate&&e.call(r,i.value),function(){i.teardown()}}}function Lt(t,e){y(e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return t._data[e]},set:function(n){t._data[e]=n}})}function qt(t){t.prototype._init=function(t){var e=this;e._uid=Ao++,e._isVue=!0,t&&t._isComponent?Vt(e,t):e.$options=B(Ht(e.constructor),t||{},e),Yi(e),e._self=e,Ct(e),bt(e),vt(e),jt(e,"beforeCreate"),Et(e),jt(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}function Vt(t,e){var n=t.$options=Object.create(t.constructor.options);n.parent=e.parent,n.propsData=e.propsData,n._parentVnode=e._parentVnode,n._parentListeners=e._parentListeners,n._renderChildren=e._renderChildren,n._componentTag=e._componentTag,n._parentElm=e._parentElm,n._refElm=e._refElm,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}function Ht(t){var e=t.options;if(t.super){var n=t.super.options,r=t.superOptions,i=t.extendOptions;n!==r&&(t.superOptions=n,i.render=e.render,i.staticRenderFns=e.staticRenderFns,i._scopeId=e._scopeId,e=t.options=B(n,i),e.name&&(e.components[e.name]=t))}return e}function Ut(t){this instanceof Ut||zi("Vue is a constructor and should be called with the `new` keyword"),this._init(t)}function Wt(t){t.use=function(t){if(!t.installed){var e=c(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):t.apply(null,e),t.installed=!0,this}}}function Zt(t){t.mixin=function(t){this.options=B(this.options,t)}}function Jt(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name;/^[a-zA-Z][\w-]*$/.test(o)||zi('Invalid component name: "'+o+'". Component names can only contain alphanumeric characters and the hyphen, and must start with a letter.');var a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=B(n.options,t),a.super=n,a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,Ti._assetTypes.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,i[r]=a,a}}function Gt(t){Ti._assetTypes.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&Ti.isReservedTag(t)&&zi("Do not use built-in or reserved HTML elements as component id: "+t),"component"===e&&h(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function Xt(t){return t&&(t.Ctor.options.name||t.tag)}function Yt(t,e){return"string"==typeof t?t.split(",").indexOf(e)>-1:t.test(e)}function Kt(t,e){for(var n in t){var r=t[n];if(r){var i=Xt(r.componentOptions);i&&!e(i)&&(Qt(r),t[n]=null)}}}function Qt(t){t&&(t.componentInstance._inactive||jt(t.componentInstance,"deactivated"),t.componentInstance.$destroy())}function te(t){var e={};e.get=function(){return Ti},e.set=function(){zi("Do not replace the Vue.config object, set individual fields instead.")},Object.defineProperty(t,"config",e),t.util=Qi,t.set=A,t.delete=S,t.nextTick=Bi,t.options=Object.create(null),Ti._assetTypes.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,f(t.options.components,Mo),Wt(t),Zt(t),Jt(t),Gt(t)}function ee(t){for(var e=t.data,n=t,r=t;r.componentInstance;)r=r.componentInstance._vnode,r.data&&(e=ne(r.data,e));for(;n=n.parent;)n.data&&(e=ne(e,n.data));return re(e)}function ne(t,e){return{staticClass:ie(t.staticClass,e.staticClass),class:t.class?[t.class,e.class]:e.class}}function re(t){var e=t.class,n=t.staticClass;return n||e?ie(n,oe(e)):""}function ie(t,e){return t?e?t+" "+e:t:e||""}function oe(t){var e="";if(!t)return e;if("string"==typeof t)return t;if(Array.isArray(t)){for(var n,r=0,i=t.length;r<i;r++)t[r]&&(n=oe(t[r]))&&(e+=n+" ");return e.slice(0,-1)}if(u(t)){for(var o in t)t[o]&&(e+=o+" ");return e.slice(0,-1)}return e}function ae(t){return Ho(t)?"svg":"math"===t?"math":void 0}function se(t){if(!Ai)return!0;if(Wo(t))return!1;if(t=t.toLowerCase(),null!=Zo[t])return Zo[t];var e=document.createElement(t);return t.indexOf("-")>-1?Zo[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Zo[t]=/HTMLUnknownElement/.test(e.toString())}function le(t){if("string"==typeof t){var e=t;if(t=document.querySelector(t),!t)return zi("Cannot find element: "+e),document.createElement("div")}return t}function ce(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&"multiple"in e.data.attrs&&n.setAttribute("multiple","multiple"),n)}function fe(t,e){return document.createElementNS(qo[t],e)}function ue(t){return document.createTextNode(t)}function he(t){return document.createComment(t)}function pe(t,e,n){t.insertBefore(e,n)}function de(t,e){t.removeChild(e)}function ge(t,e){t.appendChild(e)}function ve(t){return t.parentNode}function me(t){return t.nextSibling}function ye(t){return t.tagName}function be(t,e){t.textContent=e}function _e(t,e,n){t.setAttribute(e,n)}function xe(t,e){var n=t.data.ref;if(n){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?i(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])&&a[n].indexOf(o)<0?a[n].push(o):a[n]=[o]:a[n]=o}}function we(t){return null==t}function ke(t){return null!=t}function Ce(t,e){return t.key===e.key&&t.tag===e.tag&&t.isComment===e.isComment&&!t.data==!e.data}function Te(t,e,n){var r,i,o={};for(r=e;r<=n;++r)i=t[r].key,ke(i)&&(o[i]=r);return o}function je(t){function e(t){return new ao(A.tagName(t).toLowerCase(),{},[],void 0,t)}function n(t,e){function n(){0===--n.listeners&&i(t)}return n.listeners=e,n}function i(t){var e=A.parentNode(t);e&&A.removeChild(e,t)}function o(t,e,n,r,i){if(t.isRootInsert=!i,!s(t,e,n,r)){var o=t.data,a=t.children,l=t.tag;ke(l)?(o&&o.pre&&S++,S||t.ns||Ti.ignoredElements.length&&Ti.ignoredElements.indexOf(l)>-1||!Ti.isUnknownElement(l)||zi("Unknown custom element: <"+l+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',t.context),t.elm=t.ns?A.createElementNS(t.ns,l):A.createElement(l,t),d(t),u(t,a,e),ke(o)&&p(t,e),f(n,t.elm,r),o&&o.pre&&S--):t.isComment?(t.elm=A.createComment(t.text),f(n,t.elm,r)):(t.elm=A.createTextNode(t.text),f(n,t.elm,r))}}function s(t,e,n,r){var i=t.data;if(ke(i)){var o=ke(t.componentInstance)&&i.keepAlive;if(ke(i=i.hook)&&ke(i=i.init)&&i(t,!1,n,r),ke(t.componentInstance))return l(t,e),o&&c(t,e,n,r),!0}}function l(t,e){t.data.pendingInsert&&e.push.apply(e,t.data.pendingInsert),t.elm=t.componentInstance.$el,h(t)?(p(t,e),d(t)):(xe(t),e.push(t))}function c(t,e,n,r){for(var i,o=t;o.componentInstance;)if(o=o.componentInstance._vnode,ke(i=o.data)&&ke(i=i.transition)){for(i=0;i<j.activate.length;++i)j.activate[i](Xo,o);e.push(o);break}f(n,t.elm,r)}function f(t,e,n){t&&(n?A.insertBefore(t,e,n):A.appendChild(t,e))}function u(t,e,n){if(Array.isArray(e))for(var r=0;r<e.length;++r)o(e[r],n,t.elm,null,!0);else a(t.text)&&A.appendChild(t.elm,A.createTextNode(t.text))}function h(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return ke(t.tag)}function p(t,e){for(var n=0;n<j.create.length;++n)j.create[n](Xo,t);C=t.data.hook,ke(C)&&(C.create&&C.create(Xo,t),C.insert&&e.push(t))}function d(t){var e;ke(e=t.context)&&ke(e=e.$options._scopeId)&&A.setAttribute(t.elm,e,""),ke(e=vo)&&e!==t.context&&ke(e=e.$options._scopeId)&&A.setAttribute(t.elm,e,"")}function g(t,e,n,r,i,a){for(;r<=i;++r)o(n[r],a,t,e)}function v(t){var e,n,r=t.data;if(ke(r))for(ke(e=r.hook)&&ke(e=e.destroy)&&e(t),e=0;e<j.destroy.length;++e)j.destroy[e](t);if(ke(e=t.children))for(n=0;n<t.children.length;++n)v(t.children[n])}function m(t,e,n,r){for(;n<=r;++n){var o=e[n];ke(o)&&(ke(o.tag)?(y(o),v(o)):i(o.elm))}}function y(t,e){if(e||ke(t.data)){var r=j.remove.length+1;for(e?e.listeners+=r:e=n(t.elm,r),ke(C=t.componentInstance)&&ke(C=C._vnode)&&ke(C.data)&&y(C,e),C=0;C<j.remove.length;++C)j.remove[C](t,e);ke(C=t.data.hook)&&ke(C=C.remove)?C(t,e):e()}else i(t.elm)}function b(t,e,n,r,i){for(var a,s,l,c,f=0,u=0,h=e.length-1,p=e[0],d=e[h],v=n.length-1,y=n[0],b=n[v],x=!i;f<=h&&u<=v;)we(p)?p=e[++f]:we(d)?d=e[--h]:Ce(p,y)?(_(p,y,r),p=e[++f],y=n[++u]):Ce(d,b)?(_(d,b,r),d=e[--h],b=n[--v]):Ce(p,b)?(_(p,b,r),x&&A.insertBefore(t,p.elm,A.nextSibling(d.elm)),p=e[++f],b=n[--v]):Ce(d,y)?(_(d,y,r),x&&A.insertBefore(t,d.elm,p.elm),d=e[--h],y=n[++u]):(we(a)&&(a=Te(e,f,h)),s=ke(y.key)?a[y.key]:null,we(s)?(o(y,r,t,p.elm),y=n[++u]):(l=e[s],l||zi("It seems there are duplicate keys that is causing an update error. Make sure each v-for item has a unique key."),Ce(l,y)?(_(l,y,r),e[s]=void 0,x&&A.insertBefore(t,y.elm,p.elm),y=n[++u]):(o(y,r,t,p.elm),y=n[++u])));f>h?(c=we(n[v+1])?null:n[v+1].elm,g(t,c,n,u,v,r)):u>v&&m(t,e,f,h)}function _(t,e,n,r){if(t!==e){if(e.isStatic&&t.isStatic&&e.key===t.key&&(e.isCloned||e.isOnce))return e.elm=t.elm,void(e.componentInstance=t.componentInstance);var i,o=e.data,a=ke(o);a&&ke(i=o.hook)&&ke(i=i.prepatch)&&i(t,e);var s=e.elm=t.elm,l=t.children,c=e.children;if(a&&h(e)){for(i=0;i<j.update.length;++i)j.update[i](t,e);ke(i=o.hook)&&ke(i=i.update)&&i(t,e)}we(e.text)?ke(l)&&ke(c)?l!==c&&b(s,l,c,n,r):ke(c)?(ke(t.text)&&A.setTextContent(s,""),g(s,null,c,0,c.length-1,n)):ke(l)?m(s,l,0,l.length-1):ke(t.text)&&A.setTextContent(s,""):t.text!==e.text&&A.setTextContent(s,e.text),a&&ke(i=o.hook)&&ke(i=i.postpatch)&&i(t,e)}}function x(t,e,n){if(n&&t.parent)t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}function w(t,e,n){if(!k(t,e))return!1;e.elm=t;var r=e.tag,i=e.data,o=e.children;if(ke(i)&&(ke(C=i.hook)&&ke(C=C.init)&&C(e,!0),ke(C=e.componentInstance)))return l(e,n),!0;if(ke(r)){if(ke(o))if(t.hasChildNodes()){for(var a=!0,s=t.firstChild,c=0;c<o.length;c++){if(!s||!w(s,o[c],n)){a=!1;break}s=s.nextSibling}if(!a||s)return"undefined"==typeof console||O||(O=!0,console.warn("Parent: ",t),console.warn("Mismatching childNodes vs. VNodes: ",t.childNodes,o)),!1}else u(e,o,n);if(ke(i))for(var f in i)if(!M(f)){p(e,n);break}}else t.data!==e.text&&(t.data=e.text);return!0}function k(t,e){return e.tag?0===e.tag.indexOf("vue-component")||e.tag.toLowerCase()===(t.tagName&&t.tagName.toLowerCase()):t.nodeType===(e.isComment?8:3)}var C,T,j={},$=t.modules,A=t.nodeOps;for(C=0;C<Yo.length;++C)for(j[Yo[C]]=[],T=0;T<$.length;++T)void 0!==$[T][Yo[C]]&&j[Yo[C]].push($[T][Yo[C]]);var S=0,O=!1,M=r("attrs,style,class,staticClass,staticStyle,key");return function(t,n,r,i,a,s){if(!n)return void(t&&v(t));var l=!1,c=[];if(t){var f=ke(t.nodeType);if(!f&&Ce(t,n))_(t,n,c,i);else{if(f){if(1===t.nodeType&&t.hasAttribute("server-rendered")&&(t.removeAttribute("server-rendered"),r=!0),r){if(w(t,n,c))return x(n,c,!0),t;zi("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}t=e(t)}var u=t.elm,p=A.parentNode(u);if(o(n,c,u._leaveCb?null:p,A.nextSibling(u)),n.parent){for(var d=n.parent;d;)d.elm=n.elm,d=d.parent;if(h(n))for(var g=0;g<j.create.length;++g)j.create[g](Xo,n.parent);
+}null!==p?m(p,[t],0,0):ke(t.tag)&&v(t)}}else l=!0,o(n,c,a,s);return x(n,c,l),n.elm}}function $e(t,e){(t.data.directives||e.data.directives)&&Ae(t,e)}function Ae(t,e){var n,r,i,o=t===Xo,a=e===Xo,s=Se(t.data.directives,t.context),l=Se(e.data.directives,e.context),c=[],f=[];for(n in l)r=s[n],i=l[n],r?(i.oldValue=r.value,Me(i,"update",e,t),i.def&&i.def.componentUpdated&&f.push(i)):(Me(i,"bind",e,t),i.def&&i.def.inserted&&c.push(i));if(c.length){var u=function(){for(var n=0;n<c.length;n++)Me(c[n],"inserted",e,t)};o?at(e.data.hook||(e.data.hook={}),"insert",u,"dir-insert"):u()}if(f.length&&at(e.data.hook||(e.data.hook={}),"postpatch",function(){for(var n=0;n<f.length;n++)Me(f[n],"componentUpdated",e,t)},"dir-postpatch"),!o)for(n in s)l[n]||Me(s[n],"unbind",t,t,a)}function Se(t,e){var n=Object.create(null);if(!t)return n;var r,i;for(r=0;r<t.length;r++)i=t[r],i.modifiers||(i.modifiers=Qo),n[Oe(i)]=i,i.def=D(e.$options,"directives",i.name,!0);return n}function Oe(t){return t.rawName||t.name+"."+Object.keys(t.modifiers||{}).join(".")}function Me(t,e,n,r,i){var o=t.def&&t.def[e];o&&o(n.elm,t,n,r,i)}function Ee(t,e){if(t.data.attrs||e.data.attrs){var n,r,i,o=e.elm,a=t.data.attrs||{},s=e.data.attrs||{};s.__ob__&&(s=e.data.attrs=f({},s));for(n in s)r=s[n],i=a[n],i!==r&&Pe(o,n,r);Mi&&s.value!==a.value&&Pe(o,"value",s.value);for(n in a)null==s[n]&&(zo(n)?o.removeAttributeNS(Do,Io(n)):Ro(n)||o.removeAttribute(n))}}function Pe(t,e,n){Bo(e)?Lo(n)?t.removeAttribute(e):t.setAttribute(e,e):Ro(e)?t.setAttribute(e,Lo(n)||"false"===n?"false":"true"):zo(e)?Lo(n)?t.removeAttributeNS(Do,Io(e)):t.setAttributeNS(Do,e,n):Lo(n)?t.removeAttribute(e):t.setAttribute(e,n)}function Ne(t,e){var n=e.elm,r=e.data,i=t.data;if(r.staticClass||r.class||i&&(i.staticClass||i.class)){var o=ee(e),a=n._transitionClasses;a&&(o=ie(o,oe(a))),o!==n._prevClass&&(n.setAttribute("class",o),n._prevClass=o)}}function Fe(t,e,n,r){if(n){var i=e,o=Eo;e=function(n){Re(t,e,r,o),1===arguments.length?i(n):i.apply(null,arguments)}}Eo.addEventListener(t,e,r)}function Re(t,e,n,r){(r||Eo).removeEventListener(t,e,n)}function Be(t,e){if(t.data.on||e.data.on){var n=e.data.on||{},r=t.data.on||{};Eo=e.elm,lt(n,r,Fe,Re,e.context)}}function De(t,e){if(t.data.domProps||e.data.domProps){var n,r,i=e.elm,o=t.data.domProps||{},a=e.data.domProps||{};a.__ob__&&(a=e.data.domProps=f({},a));for(n in o)null==a[n]&&(i[n]="");for(n in a)if(r=a[n],"textContent"!==n&&"innerHTML"!==n||(e.children&&(e.children.length=0),r!==o[n]))if("value"===n){i._value=r;var s=null==r?"":String(r);ze(i,e,s)&&(i.value=s)}else i[n]=r}}function ze(t,e,n){return!t.composing&&("option"===e.tag||Ie(t,n)||Le(e,n))}function Ie(t,e){return document.activeElement!==t&&t.value!==e}function Le(t,e){var r=t.elm.value,i=t.elm._vModifiers;return i&&i.number||"number"===t.elm.type?n(r)!==n(e):i&&i.trim?r.trim()!==e.trim():r!==e}function qe(t){var e=Ve(t.style);return t.staticStyle?f(t.staticStyle,e):e}function Ve(t){return Array.isArray(t)?p(t):"string"==typeof t?oa(t):t}function He(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)i=i.componentInstance._vnode,i.data&&(n=qe(i.data))&&f(r,n);(n=qe(t.data))&&f(r,n);for(var o=t;o=o.parent;)o.data&&(n=qe(o.data))&&f(r,n);return r}function Ue(t,e){var n=e.data,r=t.data;if(n.staticStyle||n.style||r.staticStyle||r.style){var i,o,a=e.elm,s=t.data.staticStyle,l=t.data.style||{},c=s||l,u=Ve(e.data.style)||{};e.data.style=u.__ob__?f({},u):u;var h=He(e,!0);for(o in c)null==h[o]&&la(a,o,"");for(o in h)i=h[o],i!==c[o]&&la(a,o,null==i?"":i)}}function We(t,e){if(e&&e.trim())if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+t.getAttribute("class")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Ze(t,e){if(e&&e.trim())if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e);else{for(var n=" "+t.getAttribute("class")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");t.setAttribute("class",n.trim())}}function Je(t){ba(function(){ba(t)})}function Ge(t,e){(t._transitionClasses||(t._transitionClasses=[])).push(e),We(t,e)}function Xe(t,e){t._transitionClasses&&i(t._transitionClasses,e),Ze(t,e)}function Ye(t,e,n){var r=Ke(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===pa?va:ya,l=0,c=function(){t.removeEventListener(s,f),n()},f=function(e){e.target===t&&++l>=a&&c()};setTimeout(function(){l<a&&c()},o+1),t.addEventListener(s,f)}function Ke(t,e){var n,r=window.getComputedStyle(t),i=r[ga+"Delay"].split(", "),o=r[ga+"Duration"].split(", "),a=Qe(i,o),s=r[ma+"Delay"].split(", "),l=r[ma+"Duration"].split(", "),c=Qe(s,l),f=0,u=0;e===pa?a>0&&(n=pa,f=a,u=o.length):e===da?c>0&&(n=da,f=c,u=l.length):(f=Math.max(a,c),n=f>0?a>c?pa:da:null,u=n?n===pa?o.length:l.length:0);var h=n===pa&&_a.test(r[ga+"Property"]);return{type:n,timeout:f,propCount:u,hasTransform:h}}function Qe(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map(function(e,n){return tn(e)+tn(t[n])}))}function tn(t){return 1e3*Number(t.slice(0,-1))}function en(t,e){var n=t.elm;n._leaveCb&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=rn(t.data.transition);if(r&&!n._enterCb&&1===n.nodeType){for(var i=r.css,o=r.type,a=r.enterClass,s=r.enterToClass,l=r.enterActiveClass,c=r.appearClass,f=r.appearToClass,u=r.appearActiveClass,h=r.beforeEnter,p=r.enter,d=r.afterEnter,g=r.enterCancelled,v=r.beforeAppear,m=r.appear,y=r.afterAppear,b=r.appearCancelled,_=vo,x=vo.$vnode;x&&x.parent;)x=x.parent,_=x.context;var w=!_._isMounted||!t.isRootInsert;if(!w||m||""===m){var k=w?c:a,C=w?u:l,T=w?f:s,j=w?v||h:h,$=w&&"function"==typeof m?m:p,A=w?y||d:d,S=w?b||g:g,O=i!==!1&&!Mi,M=$&&($._length||$.length)>1,E=n._enterCb=on(function(){O&&(Xe(n,T),Xe(n,C)),E.cancelled?(O&&Xe(n,k),S&&S(n)):A&&A(n),n._enterCb=null});t.data.show||at(t.data.hook||(t.data.hook={}),"insert",function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),$&&$(n,E)},"transition-insert"),j&&j(n),O&&(Ge(n,k),Ge(n,C),Je(function(){Ge(n,T),Xe(n,k),E.cancelled||M||Ye(n,o,E)})),t.data.show&&(e&&e(),$&&$(n,E)),O||M||E()}}}function nn(t,e){function n(){m.cancelled||(t.data.show||((r.parentNode._pending||(r.parentNode._pending={}))[t.key]=t),f&&f(r),g&&(Ge(r,s),Ge(r,c),Je(function(){Ge(r,l),Xe(r,s),m.cancelled||v||Ye(r,a,m)})),u&&u(r,m),g||v||m())}var r=t.elm;r._enterCb&&(r._enterCb.cancelled=!0,r._enterCb());var i=rn(t.data.transition);if(!i)return e();if(!r._leaveCb&&1===r.nodeType){var o=i.css,a=i.type,s=i.leaveClass,l=i.leaveToClass,c=i.leaveActiveClass,f=i.beforeLeave,u=i.leave,h=i.afterLeave,p=i.leaveCancelled,d=i.delayLeave,g=o!==!1&&!Mi,v=u&&(u._length||u.length)>1,m=r._leaveCb=on(function(){r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[t.key]=null),g&&(Xe(r,l),Xe(r,c)),m.cancelled?(g&&Xe(r,s),p&&p(r)):(e(),h&&h(r)),r._leaveCb=null});d?d(n):n()}}function rn(t){if(t){if("object"==typeof t){var e={};return t.css!==!1&&f(e,xa(t.name||"v")),f(e,t),e}return"string"==typeof t?xa(t):void 0}}function on(t){var e=!1;return function(){e||(e=!0,t())}}function an(t,e){e.data.show||en(e)}function sn(t,e,n){var r=e.value,i=t.multiple;if(i&&!Array.isArray(r))return void zi('<select multiple v-model="'+e.expression+'"> expects an Array value for its binding, but got '+Object.prototype.toString.call(r).slice(8,-1),n);for(var o,a,s=0,l=t.options.length;s<l;s++)if(a=t.options[s],i)o=m(r,cn(a))>-1,a.selected!==o&&(a.selected=o);else if(v(cn(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}function ln(t,e){for(var n=0,r=e.length;n<r;n++)if(v(cn(e[n]),t))return!1;return!0}function cn(t){return"_value"in t?t._value:t.value}function fn(t){t.target.composing=!0}function un(t){t.target.composing=!1,hn(t.target,"input")}function hn(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function pn(t){return!t.componentInstance||t.data&&t.data.transition?t:pn(t.componentInstance._vnode)}function dn(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?dn(ht(e.children)):t}function gn(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[mi(o)]=i[o].fn;return e}function vn(t,e){return/\d-keep-alive$/.test(e.tag)?t("keep-alive"):null}function mn(t){for(;t=t.parent;)if(t.data.transition)return!0}function yn(t,e){return e.key===t.key&&e.tag===t.tag}function bn(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function _n(t){t.data.newPos=t.elm.getBoundingClientRect()}function xn(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function wn(t,e){var n=document.createElement("div");return n.innerHTML='<div a="'+t+'">',n.innerHTML.indexOf(e)>0}function kn(t){return Fa=Fa||document.createElement("div"),Fa.innerHTML=t,Fa.textContent}function Cn(t,e){return e&&(t=t.replace(As,"\n")),t.replace(js,"<").replace($s,">").replace(Ss,"&").replace(Os,'"')}function Tn(t,e){function n(e){u+=e,t=t.substring(e)}function r(){var e=t.match(Wa);if(e){var r={tagName:e[1],attrs:[],start:u};n(e[0].length);for(var i,o;!(i=t.match(Za))&&(o=t.match(Va));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=u,r}}function i(t){var n=t.tagName,r=t.unarySlash;c&&("p"===s&&za(n)&&o(s),Da(n)&&s===n&&o(n));for(var i=f(n)||"html"===n&&"head"===s||!!r,a=t.attrs.length,u=new Array(a),h=0;h<a;h++){var p=t.attrs[h];Ka&&p[0].indexOf('""')===-1&&(""===p[3]&&delete p[3],""===p[4]&&delete p[4],""===p[5]&&delete p[5]);var d=p[3]||p[4]||p[5]||"";u[h]={name:p[1],value:Cn(d,e.shouldDecodeNewlines)}}i||(l.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:u}),s=n,r=""),e.start&&e.start(n,u,i,t.start,t.end)}function o(t,n,r){var i,o;if(null==n&&(n=u),null==r&&(r=u),t&&(o=t.toLowerCase()),t)for(i=l.length-1;i>=0&&l[i].lowerCasedTag!==o;i--);else i=0;if(i>=0){for(var a=l.length-1;a>=i;a--)e.end&&e.end(l[a].tag,n,r);l.length=i,s=i&&l[i-1].tag}else"br"===o?e.start&&e.start(t,[],!0,n,r):"p"===o&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var a,s,l=[],c=e.expectHTML,f=e.isUnaryTag||ki,u=0;t;){if(a=t,s&&Cs(s)){var h=s.toLowerCase(),p=Ts[h]||(Ts[h]=new RegExp("([\\s\\S]*?)(</"+h+"[^>]*>)","i")),d=0,g=t.replace(p,function(t,n,r){return d=r.length,"script"!==h&&"style"!==h&&"noscript"!==h&&(n=n.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),e.chars&&e.chars(n),""});u+=t.length-g.length,t=g,o(h,u-d,u)}else{var v=t.indexOf("<");if(0===v){if(Xa.test(t)){var m=t.indexOf("-->");if(m>=0){n(m+3);continue}}if(Ya.test(t)){var y=t.indexOf("]>");if(y>=0){n(y+2);continue}}var b=t.match(Ga);if(b){n(b[0].length);continue}var _=t.match(Ja);if(_){var x=u;n(_[0].length),o(_[1],x,u);continue}var w=r();if(w){i(w);continue}}var k=void 0,C=void 0,T=void 0;if(v>0){for(C=t.slice(v);!(Ja.test(C)||Wa.test(C)||Xa.test(C)||Ya.test(C)||(T=C.indexOf("<",1),T<0));)v+=T,C=t.slice(v);k=t.substring(0,v),n(v)}v<0&&(k=t,t=""),e.chars&&k&&e.chars(k)}if(t===a&&e.chars){e.chars(t);break}}o()}function jn(t){function e(){(a||(a=[])).push(t.slice(d,i).trim()),d=i+1}var n,r,i,o,a,s=!1,l=!1,c=!1,f=!1,u=0,h=0,p=0,d=0;for(i=0;i<t.length;i++)if(r=n,n=t.charCodeAt(i),s)39===n&&92!==r&&(s=!1);else if(l)34===n&&92!==r&&(l=!1);else if(c)96===n&&92!==r&&(c=!1);else if(f)47===n&&92!==r&&(f=!1);else if(124!==n||124===t.charCodeAt(i+1)||124===t.charCodeAt(i-1)||u||h||p){switch(n){case 34:l=!0;break;case 39:s=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:h++;break;case 93:h--;break;case 123:u++;break;case 125:u--}if(47===n){for(var g=i-1,v=void 0;g>=0&&(v=t.charAt(g)," "===v);g--);v&&/[\w$]/.test(v)||(f=!0)}}else void 0===o?(d=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==d&&e(),a)for(i=0;i<a.length;i++)o=$n(o,a[i]);return o}function $n(t,e){var n=e.indexOf("(");if(n<0)return'_f("'+e+'")('+t+")";var r=e.slice(0,n),i=e.slice(n+1);return'_f("'+r+'")('+t+","+i}function An(t,e){var n=e?Ps(e):Ms;if(n.test(t)){for(var r,i,o=[],a=n.lastIndex=0;r=n.exec(t);){i=r.index,i>a&&o.push(JSON.stringify(t.slice(a,i)));var s=jn(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a<t.length&&o.push(JSON.stringify(t.slice(a))),o.join("+")}}function Sn(t){console.error("[Vue parser]: "+t)}function On(t,e){return t?t.map(function(t){return t[e]}).filter(function(t){return t}):[]}function Mn(t,e,n){(t.props||(t.props=[])).push({name:e,value:n})}function En(t,e,n){(t.attrs||(t.attrs=[])).push({name:e,value:n})}function Pn(t,e,n,r,i,o){(t.directives||(t.directives=[])).push({name:e,rawName:n,value:r,arg:i,modifiers:o})}function Nn(t,e,n,r,i){r&&r.capture&&(delete r.capture,e="!"+e),r&&r.once&&(delete r.once,e="~"+e);var o;r&&r.native?(delete r.native,o=t.nativeEvents||(t.nativeEvents={})):o=t.events||(t.events={});var a={value:n,modifiers:r},s=o[e];Array.isArray(s)?i?s.unshift(a):s.push(a):s?o[e]=i?[a,s]:[s,a]:o[e]=a}function Fn(t,e,n){var r=Rn(t,":"+e)||Rn(t,"v-bind:"+e);if(null!=r)return jn(r);if(n!==!1){var i=Rn(t,e);if(null!=i)return JSON.stringify(i)}}function Rn(t,e){var n;if(null!=(n=t.attrsMap[e]))for(var r=t.attrsList,i=0,o=r.length;i<o;i++)if(r[i].name===e){r.splice(i,1);break}return n}function Bn(t){if(ts=t,Qa=ts.length,ns=rs=is=0,t.indexOf("[")<0||t.lastIndexOf("]")<Qa-1)return{exp:t,idx:null};for(;!zn();)es=Dn(),In(es)?qn(es):91===es&&Ln(es);return{exp:t.substring(0,rs),idx:t.substring(rs+1,is)}}function Dn(){return ts.charCodeAt(++ns)}function zn(){return ns>=Qa}function In(t){return 34===t||39===t}function Ln(t){var e=1;for(rs=ns;!zn();)if(t=Dn(),In(t))qn(t);else if(91===t&&e++,93===t&&e--,0===e){is=ns;break}}function qn(t){for(var e=t;!zn()&&(t=Dn(),t!==e););}function Vn(t,e){os=e.warn||Sn,as=e.getTagNamespace||ki,ss=e.mustUseProp||ki,ls=e.isPreTag||ki,cs=On(e.modules,"preTransformNode"),fs=On(e.modules,"transformNode"),us=On(e.modules,"postTransformNode"),hs=e.delimiters;var n,r,i=[],o=e.preserveWhitespace!==!1,a=!1,s=!1,l=!1;return Tn(t,{expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,shouldDecodeNewlines:e.shouldDecodeNewlines,start:function(o,c,f){function u(e){l||("slot"!==e.tag&&"template"!==e.tag||(l=!0,os("Cannot use <"+e.tag+"> as component root element because it may contain multiple nodes:\n"+t)),e.attrsMap.hasOwnProperty("v-for")&&(l=!0,os("Cannot use v-for on stateful component root element because it renders multiple elements:\n"+t)))}var h=r&&r.ns||as(o);Oi&&"svg"===h&&(c=sr(c));var p={type:1,tag:o,attrsList:c,attrsMap:or(c),parent:r,children:[]};h&&(p.ns=h),ar(p)&&!Fi()&&(p.forbidden=!0,os("Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <"+o+">, as they will not be parsed."));for(var d=0;d<cs.length;d++)cs[d](p,e);if(a||(Hn(p),p.pre&&(a=!0)),ls(p.tag)&&(s=!0),a)Un(p);else{Jn(p),Gn(p),Qn(p),Wn(p),p.plain=!p.key&&!c.length,Zn(p),tr(p),er(p);for(var g=0;g<fs.length;g++)fs[g](p,e);nr(p)}if(n?i.length||(n.if&&(p.elseif||p.else)?(u(p),Kn(n,{exp:p.elseif,block:p})):l||(l=!0,os("Component template should contain exactly one root element:\n\n"+t+"\n\nIf you are using v-if on multiple elements, use v-else-if to chain them instead."))):(n=p,u(n)),r&&!p.forbidden)if(p.elseif||p.else)Xn(p,r);else if(p.slotScope){r.plain=!1;var v=p.slotTarget||"default";(r.scopedSlots||(r.scopedSlots={}))[v]=p}else r.children.push(p),p.parent=r;f||(r=p,i.push(p));for(var m=0;m<us.length;m++)us[m](p,e)},end:function(){var t=i[i.length-1],e=t.children[t.children.length-1];e&&3===e.type&&" "===e.text&&t.children.pop(),i.length-=1,r=i[i.length-1],t.pre&&(a=!1),ls(t.tag)&&(s=!1)},chars:function(e){if(!r)return void(l||e!==t||(l=!0,os("Component template requires a root element, rather than just text:\n\n"+t)));if(!Oi||"textarea"!==r.tag||r.attrsMap.placeholder!==e){var n=r.children;if(e=s||e.trim()?Ls(e):o&&n.length?" ":""){var i;!a&&" "!==e&&(i=An(e,hs))?n.push({type:2,expression:i,text:e}):" "===e&&" "===n[n.length-1].text||r.children.push({type:3,text:e})}}}}),n}function Hn(t){null!=Rn(t,"v-pre")&&(t.pre=!0)}function Un(t){var e=t.attrsList.length;if(e)for(var n=t.attrs=new Array(e),r=0;r<e;r++)n[r]={name:t.attrsList[r].name,value:JSON.stringify(t.attrsList[r].value)};else t.pre||(t.plain=!0)}function Wn(t){var e=Fn(t,"key");e&&("template"===t.tag&&os("<template> cannot be keyed. Place the key on real elements instead."),t.key=e)}function Zn(t){var e=Fn(t,"ref");e&&(t.ref=e,t.refInFor=rr(t))}function Jn(t){var e;if(e=Rn(t,"v-for")){var n=e.match(Fs);if(!n)return void os("Invalid v-for expression: "+e);t.for=n[2].trim();var r=n[1].trim(),i=r.match(Rs);i?(t.alias=i[1].trim(),t.iterator1=i[2].trim(),i[3]&&(t.iterator2=i[3].trim())):t.alias=r}}function Gn(t){var e=Rn(t,"v-if");if(e)t.if=e,Kn(t,{exp:e,block:t});else{null!=Rn(t,"v-else")&&(t.else=!0);var n=Rn(t,"v-else-if");n&&(t.elseif=n)}}function Xn(t,e){var n=Yn(e.children);n&&n.if?Kn(n,{exp:t.elseif,block:t}):os("v-"+(t.elseif?'else-if="'+t.elseif+'"':"else")+" used on element <"+t.tag+"> without corresponding v-if.")}function Yn(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];" "!==t[e].text&&os('text "'+t[e].text.trim()+'" between v-if and v-else(-if) will be ignored.'),t.pop()}}function Kn(t,e){t.ifConditions||(t.ifConditions=[]),t.ifConditions.push(e)}function Qn(t){var e=Rn(t,"v-once");null!=e&&(t.once=!0)}function tr(t){if("slot"===t.tag)t.slotName=Fn(t,"name"),t.key&&os("`key` does not work on <slot> because slots are abstract outlets and can possibly expand into multiple elements. Use the key on a wrapping element instead.");else{var e=Fn(t,"slot");e&&(t.slotTarget='""'===e?'"default"':e),"template"===t.tag&&(t.slotScope=Rn(t,"scope"))}}function er(t){var e;(e=Fn(t,"is"))&&(t.component=e),null!=Rn(t,"inline-template")&&(t.inlineTemplate=!0)}function nr(t){var e,n,r,i,o,a,s,l,c=t.attrsList;for(e=0,n=c.length;e<n;e++)if(r=i=c[e].name,o=c[e].value,Ns.test(r))if(t.hasBindings=!0,s=ir(r),s&&(r=r.replace(Is,"")),Bs.test(r))r=r.replace(Bs,""),o=jn(o),l=!1,s&&(s.prop&&(l=!0,r=mi(r),"innerHtml"===r&&(r="innerHTML")),s.camel&&(r=mi(r))),l||ss(t.tag,t.attrsMap.type,r)?Mn(t,r,o):En(t,r,o);else if(Ds.test(r))r=r.replace(Ds,""),Nn(t,r,o,s);else{r=r.replace(Ns,"");var f=r.match(zs);f&&(a=f[1])&&(r=r.slice(0,-(a.length+1))),Pn(t,r,i,o,a,s),"model"===r&&lr(t,o)}else{var u=An(o,hs);u&&os(r+'="'+o+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.'),En(t,r,JSON.stringify(o))}}function rr(t){for(var e=t;e;){if(void 0!==e.for)return!0;e=e.parent}return!1}function ir(t){var e=t.match(Is);if(e){var n={};return e.forEach(function(t){n[t.slice(1)]=!0}),n}}function or(t){for(var e={},n=0,r=t.length;n<r;n++)e[t[n].name]&&!Oi&&os("duplicate attribute: "+t[n].name),e[t[n].name]=t[n].value;return e}function ar(t){return"style"===t.tag||"script"===t.tag&&(!t.attrsMap.type||"text/javascript"===t.attrsMap.type)}function sr(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];qs.test(r.name)||(r.name=r.name.replace(Vs,""),e.push(r))}return e}function lr(t,e){for(var n=t;n;)n.for&&n.alias===e&&os("<"+t.tag+' v-model="'+e+'">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.'),n=n.parent}function cr(t,e){t&&(ps=Hs(e.staticKeys||""),ds=e.isReservedTag||ki,ur(t),hr(t,!1))}function fr(t){return r("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(t?","+t:""))}function ur(t){if(t.static=dr(t),1===t.type){if(!ds(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e<n;e++){var r=t.children[e];ur(r),r.static||(t.static=!1)}}}function hr(t,e){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=e),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var n=0,r=t.children.length;n<r;n++)hr(t.children[n],e||!!t.for);t.ifConditions&&pr(t.ifConditions,e)}}function pr(t,e){for(var n=1,r=t.length;n<r;n++)hr(t[n].block,e)}function dr(t){return 2!==t.type&&(3===t.type||!(!t.pre&&(t.hasBindings||t.if||t.for||di(t.tag)||!ds(t.tag)||gr(t)||!Object.keys(t).every(ps))))}function gr(t){for(;t.parent;){if(t=t.parent,"template"!==t.tag)return!1;if(t.for)return!0}return!1}function vr(t,e){var n=e?"nativeOn:{":"on:{";for(var r in t)n+='"'+r+'":'+mr(r,t[r])+",";return n.slice(0,-1)+"}"}function mr(t,e){if(e){if(Array.isArray(e))return"["+e.map(function(e){return mr(t,e)}).join(",")+"]";if(e.modifiers){var n="",r=[];for(var i in e.modifiers)Js[i]?n+=Js[i]:r.push(i);r.length&&(n=yr(r)+n);var o=Ws.test(e.value)?e.value+"($event)":e.value;return"function($event){"+n+o+"}"}return Us.test(e.value)||Ws.test(e.value)?e.value:"function($event){"+e.value+"}"}return"function(){}"}function yr(t){return"if("+t.map(br).join("&&")+")return;"}function br(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=Zs[t];return"_k($event.keyCode,"+JSON.stringify(t)+(n?","+JSON.stringify(n):"")+")"}function _r(t,e){t.wrapData=function(n){return"_b("+n+",'"+t.tag+"',"+e.value+(e.modifiers&&e.modifiers.prop?",true":"")+")"}}function xr(t,e){var n=_s,r=_s=[],i=xs;xs=0,ws=e,gs=e.warn||Sn,vs=On(e.modules,"transformCode"),ms=On(e.modules,"genData"),ys=e.directives||{},bs=e.isReservedTag||ki;var o=t?wr(t):'_c("div")';return _s=n,xs=i,{render:"with(this){return "+o+"}",staticRenderFns:r}}function wr(t){if(t.staticRoot&&!t.staticProcessed)return kr(t);if(t.once&&!t.onceProcessed)return Cr(t);if(t.for&&!t.forProcessed)return $r(t);if(t.if&&!t.ifProcessed)return Tr(t);if("template"!==t.tag||t.slotTarget){if("slot"===t.tag)return zr(t);var e;if(t.component)e=Ir(t.component,t);else{var n=t.plain?void 0:Ar(t),r=t.inlineTemplate?null:Pr(t,!0);e="_c('"+t.tag+"'"+(n?","+n:"")+(r?","+r:"")+")"}for(var i=0;i<vs.length;i++)e=vs[i](t,e);return e}return Pr(t)||"void 0"}function kr(t){return t.staticProcessed=!0,_s.push("with(this){return "+wr(t)+"}"),"_m("+(_s.length-1)+(t.staticInFor?",true":"")+")"}function Cr(t){if(t.onceProcessed=!0,t.if&&!t.ifProcessed)return Tr(t);if(t.staticInFor){for(var e="",n=t.parent;n;){if(n.for){e=n.key;break}n=n.parent}return e?"_o("+wr(t)+","+xs++ +(e?","+e:"")+")":(gs("v-once can only be used inside v-for that is keyed. "),wr(t))}return kr(t)}function Tr(t){return t.ifProcessed=!0,jr(t.ifConditions.slice())}function jr(t){function e(t){return t.once?Cr(t):wr(t)}if(!t.length)return"_e()";var n=t.shift();return n.exp?"("+n.exp+")?"+e(n.block)+":"+jr(t):""+e(n.block)}function $r(t){var e=t.for,n=t.alias,r=t.iterator1?","+t.iterator1:"",i=t.iterator2?","+t.iterator2:"";return t.forProcessed=!0,"_l(("+e+"),function("+n+r+i+"){return "+wr(t)+"})"}function Ar(t){var e="{",n=Sr(t);n&&(e+=n+","),t.key&&(e+="key:"+t.key+","),t.ref&&(e+="ref:"+t.ref+","),t.refInFor&&(e+="refInFor:true,"),t.pre&&(e+="pre:true,"),t.component&&(e+='tag:"'+t.tag+'",');for(var r=0;r<ms.length;r++)e+=ms[r](t);if(t.attrs&&(e+="attrs:{"+Lr(t.attrs)+"},"),t.props&&(e+="domProps:{"+Lr(t.props)+"},"),t.events&&(e+=vr(t.events)+","),t.nativeEvents&&(e+=vr(t.nativeEvents,!0)+","),t.slotTarget&&(e+="slot:"+t.slotTarget+","),t.scopedSlots&&(e+=Mr(t.scopedSlots)+","),t.inlineTemplate){var i=Or(t);i&&(e+=i+",")}return e=e.replace(/,$/,"")+"}",t.wrapData&&(e=t.wrapData(e)),e}function Sr(t){var e=t.directives;if(e){var n,r,i,o,a="directives:[",s=!1;for(n=0,r=e.length;n<r;n++){i=e[n],o=!0;var l=ys[i.name]||Gs[i.name];l&&(o=!!l(t,i,gs)),o&&(s=!0,a+='{name:"'+i.name+'",rawName:"'+i.rawName+'"'+(i.value?",value:("+i.value+"),expression:"+JSON.stringify(i.value):"")+(i.arg?',arg:"'+i.arg+'"':"")+(i.modifiers?",modifiers:"+JSON.stringify(i.modifiers):"")+"},")}return s?a.slice(0,-1)+"]":void 0}}function Or(t){var e=t.children[0];if((t.children.length>1||1!==e.type)&&gs("Inline-template components must have exactly one child element."),1===e.type){var n=xr(e,ws);return"inlineTemplate:{render:function(){"+n.render+"},staticRenderFns:["+n.staticRenderFns.map(function(t){return"function(){"+t+"}"}).join(",")+"]}"}}function Mr(t){return"scopedSlots:{"+Object.keys(t).map(function(e){return Er(e,t[e])}).join(",")+"}"}function Er(t,e){return t+":function("+String(e.attrsMap.scope)+"){return "+("template"===e.tag?Pr(e)||"void 0":wr(e))+"}"}function Pr(t,e){var n=t.children;if(n.length){var r=n[0];if(1===n.length&&r.for&&"template"!==r.tag&&"slot"!==r.tag)return wr(r);var i=Nr(n);return"["+n.map(Br).join(",")+"]"+(e&&i?","+i:"")}}function Nr(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];if(1===r.type){if(Fr(r)||r.ifConditions&&r.ifConditions.some(function(t){return Fr(t.block)})){e=2;break}(Rr(r)||r.ifConditions&&r.ifConditions.some(function(t){return Rr(t.block)}))&&(e=1)}}return e}function Fr(t){return void 0!==t.for||"template"===t.tag||"slot"===t.tag}function Rr(t){return!bs(t.tag)}function Br(t){return 1===t.type?wr(t):Dr(t)}function Dr(t){return"_v("+(2===t.type?t.expression:qr(JSON.stringify(t.text)))+")"}function zr(t){var e=t.slotName||'"default"',n=Pr(t),r="_t("+e+(n?","+n:""),i=t.attrs&&"{"+t.attrs.map(function(t){return mi(t.name)+":"+t.value}).join(",")+"}",o=t.attrsMap["v-bind"];return!i&&!o||n||(r+=",null"),i&&(r+=","+i),o&&(r+=(i?"":",null")+","+o),r+")"}function Ir(t,e){var n=e.inlineTemplate?null:Pr(e,!0);return"_c("+t+","+Ar(e)+(n?","+n:"")+")"}function Lr(t){for(var e="",n=0;n<t.length;n++){var r=t[n];e+='"'+r.name+'":'+qr(r.value)+","}return e.slice(0,-1)}function qr(t){return t.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Vr(t,e){var n=Vn(t.trim(),e);cr(n,e);var r=xr(n,e);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}}function Hr(t){var e=[];return t&&Ur(t,e),e}function Ur(t,e){if(1===t.type){for(var n in t.attrsMap)if(Ns.test(n)){var r=t.attrsMap[n];r&&("v-for"===n?Wr(t,'v-for="'+r+'"',e):Jr(r,n+'="'+r+'"',e))}if(t.children)for(var i=0;i<t.children.length;i++)Ur(t.children[i],e)}else 2===t.type&&Jr(t.expression,t.text,e)}function Wr(t,e,n){Jr(t.for||"",e,n),Zr(t.alias,"v-for alias",e,n),Zr(t.iterator1,"v-for iterator",e,n),Zr(t.iterator2,"v-for iterator",e,n)}function Zr(t,e,n,r){"string"!=typeof t||Ys.test(t)||r.push("- invalid "+e+' "'+t+'" in expression: '+n)}function Jr(t,e,n){try{new Function("return "+t)}catch(i){var r=t.replace(Ks,"").match(Xs);r?n.push('- avoid using JavaScript keyword as property name: "'+r[0]+'" in expression '+e):n.push("- invalid expression: "+e)}}function Gr(t,e){var n=e.warn||Sn,r=Rn(t,"class");if(r){var i=An(r,e.delimiters);i&&n('class="'+r+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div class="{{ val }}">, use <div :class="val">.')}r&&(t.staticClass=JSON.stringify(r));var o=Fn(t,"class",!1);o&&(t.classBinding=o)}function Xr(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}function Yr(t,e){var n=e.warn||Sn,r=Rn(t,"style");if(r){var i=An(r,e.delimiters);i&&n('style="'+r+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div style="{{ val }}">, use <div :style="val">.'),t.staticStyle=JSON.stringify(oa(r))}var o=Fn(t,"style",!1);o&&(t.styleBinding=o)}function Kr(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}function Qr(t,e,n){ks=n;var r=e.value,i=e.modifiers,o=t.tag,a=t.attrsMap.type,s=t.attrsMap["v-bind:type"]||t.attrsMap[":type"];return"input"===o&&s&&ks('<input :type="'+s+'" v-model="'+r+'">:\nv-model does not support dynamic input types. Use v-if branches instead.'),"select"===o?ri(t,r,i):"input"===o&&"checkbox"===a?ti(t,r,i):"input"===o&&"radio"===a?ei(t,r,i):ni(t,r,i),!0}function ti(t,e,n){null!=t.attrsMap.checked&&ks("<"+t.tag+' v-model="'+e+"\" checked>:\ninline checked attributes will be ignored when using v-model. Declare initial values in the component's data option instead.");var r=n&&n.number,i=Fn(t,"value")||"null",o=Fn(t,"true-value")||"true",a=Fn(t,"false-value")||"false";Mn(t,"checked","Array.isArray("+e+")?_i("+e+","+i+")>-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),Nn(t,"click","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+e+"=$$a.concat($$v))}else{$$i>-1&&("+e+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+e+"=$$c}",null,!0)}function ei(t,e,n){null!=t.attrsMap.checked&&ks("<"+t.tag+' v-model="'+e+"\" checked>:\ninline checked attributes will be ignored when using v-model. Declare initial values in the component's data option instead.");var r=n&&n.number,i=Fn(t,"value")||"null";i=r?"_n("+i+")":i,Mn(t,"checked","_q("+e+","+i+")"),Nn(t,"click",oi(e,i),null,!0)}function ni(t,e,n){"input"===t.tag&&t.attrsMap.value&&ks("<"+t.tag+' v-model="'+e+'" value="'+t.attrsMap.value+"\">:\ninline value attributes will be ignored when using v-model. Declare initial values in the component's data option instead."),"textarea"===t.tag&&t.children.length&&ks('<textarea v-model="'+e+"\">:\ninline content inside <textarea> will be ignored when using v-model. Declare initial values in the component's data option instead.");var r=t.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,l=o||Oi&&"range"===r?"change":"input",c=!o&&"range"!==r,f="input"===t.tag||"textarea"===t.tag,u=f?"$event.target.value"+(s?".trim()":""):s?"(typeof $event === 'string' ? $event.trim() : $event)":"$event";u=a||"number"===r?"_n("+u+")":u;var h=oi(e,u);f&&c&&(h="if($event.target.composing)return;"+h),"file"===r&&ks("<"+t.tag+' v-model="'+e+'" type="file">:\nFile inputs are read only. Use a v-on:change listener instead.'),Mn(t,"value",f?"_s("+e+")":"("+e+")"),Nn(t,l,h,null,!0),(s||a||"number"===r)&&Nn(t,"blur","$forceUpdate()")}function ri(t,e,n){t.children.some(ii);var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})"+(null==t.attrsMap.multiple?"[0]":""),o=oi(e,i);Nn(t,"change",o,null,!0)}function ii(t){return 1===t.type&&"option"===t.tag&&null!=t.attrsMap.selected&&(ks('<select v-model="'+t.parent.attrsMap["v-model"]+"\">:\ninline selected attributes on <option> will be ignored when using v-model. Declare initial values in the component's data option instead."),!0)}function oi(t,e){var n=Bn(t);return null===n.idx?t+"="+e:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+t+"="+e+"}else{$$exp.splice($$idx, 1, "+e+")}"}function ai(t,e){e.value&&Mn(t,"textContent","_s("+e.value+")")}function si(t,e){e.value&&Mn(t,"innerHTML","_s("+e.value+")")}function li(t,e){return e=e?f(f({},il),e):il,Vr(t,e)}function ci(t,e,n){var r=e&&e.warn||zi;try{new Function("return 1")}catch(t){t.toString().match(/unsafe-eval|CSP/)&&r("It seems you are using the standalone build of Vue.js in an environment with Content Security Policy that prohibits unsafe-eval. The template compiler cannot work in this environment. Consider relaxing the policy to allow unsafe-eval or pre-compiling your templates into render functions.")}var i=e&&e.delimiters?String(e.delimiters)+t:t;if(rl[i])return rl[i];var o={},a=li(t,e);o.render=fi(a.render);var s=a.staticRenderFns.length;o.staticRenderFns=new Array(s);for(var l=0;l<s;l++)o.staticRenderFns[l]=fi(a.staticRenderFns[l]);return(o.render===d||o.staticRenderFns.some(function(t){return t===d}))&&r("failed to compile template:\n\n"+t+"\n\n"+Hr(a.ast).join("\n")+"\n\n",n),rl[i]=o}function fi(t){try{return new Function(t)}catch(t){return d}}function ui(t){
+if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}var hi,pi,di=r("slot,component",!0),gi=Object.prototype.hasOwnProperty,vi=/-(\w)/g,mi=s(function(t){return t.replace(vi,function(t,e){return e?e.toUpperCase():""})}),yi=s(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),bi=/([^-])([A-Z])/g,_i=s(function(t){return t.replace(bi,"$1-$2").replace(bi,"$1-$2").toLowerCase()}),xi=Object.prototype.toString,wi="[object Object]",ki=function(){return!1},Ci=function(t){return t},Ti={optionMergeStrategies:Object.create(null),silent:!1,devtools:!0,errorHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:ki,isUnknownElement:ki,getTagNamespace:d,parsePlatformTagName:Ci,mustUseProp:ki,_assetTypes:["component","directive","filter"],_lifecycleHooks:["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated"],_maxUpdateCount:100},ji=/[^\w.$]/,$i="__proto__"in{},Ai="undefined"!=typeof window,Si=Ai&&window.navigator.userAgent.toLowerCase(),Oi=Si&&/msie|trident/.test(Si),Mi=Si&&Si.indexOf("msie 9.0")>0,Ei=Si&&Si.indexOf("edge/")>0,Pi=Si&&Si.indexOf("android")>0,Ni=Si&&/iphone|ipad|ipod|ios/.test(Si),Fi=function(){return void 0===hi&&(hi=!Ai&&"undefined"!=typeof e&&"server"===e.process.env.VUE_ENV),hi},Ri=Ai&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Bi=function(){function t(){r=!1;var t=n.slice(0);n.length=0;for(var e=0;e<t.length;e++)t[e]()}var e,n=[],r=!1;if("undefined"!=typeof Promise&&x(Promise)){var i=Promise.resolve(),o=function(t){console.error(t)};e=function(){i.then(t).catch(o),Ni&&setTimeout(d)}}else if("undefined"==typeof MutationObserver||!x(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())e=function(){setTimeout(t,0)};else{var a=1,s=new MutationObserver(t),l=document.createTextNode(String(a));s.observe(l,{characterData:!0}),e=function(){a=(a+1)%2,l.data=String(a)}}return function(t,i){var o;if(n.push(function(){t&&t.call(i),o&&o(i)}),r||(r=!0,e()),!t&&"undefined"!=typeof Promise)return new Promise(function(t){o=t})}}();pi="undefined"!=typeof Set&&x(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return this.set[t]===!0},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var Di,zi=d,Ii="undefined"!=typeof console;zi=function(t,e){Ii&&!Ti.silent&&console.error("[Vue warn]: "+t+" "+(e?Li(Di(e)):""))},Di=function(t){if(t.$root===t)return"root instance";var e=t._isVue?t.$options.name||t.$options._componentTag:t.name;return(e?"component <"+e+">":"anonymous component")+(t._isVue&&t.$options.__file?" at "+t.$options.__file:"")};var Li=function(t){return"anonymous component"===t&&(t+=' - use the "name" option for better debugging messages.'),"\n(found in "+t+")"},qi=0,Vi=function(){this.id=qi++,this.subs=[]};Vi.prototype.addSub=function(t){this.subs.push(t)},Vi.prototype.removeSub=function(t){i(this.subs,t)},Vi.prototype.depend=function(){Vi.target&&Vi.target.addDep(this)},Vi.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e<n;e++)t[e].update()},Vi.target=null;var Hi=[],Ui=Array.prototype,Wi=Object.create(Ui);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){var e=Ui[t];b(Wi,t,function(){for(var n=arguments,r=arguments.length,i=new Array(r);r--;)i[r]=n[r];var o,a=e.apply(this,i),s=this.__ob__;switch(t){case"push":o=i;break;case"unshift":o=i;break;case"splice":o=i.slice(2)}return o&&s.observeArray(o),s.dep.notify(),a})});var Zi=Object.getOwnPropertyNames(Wi),Ji={shouldConvert:!0,isSettingProps:!1},Gi=function(t){if(this.value=t,this.dep=new Vi,this.vmCount=0,b(t,"__ob__",this),Array.isArray(t)){var e=$i?C:T;e(t,Wi,Zi),this.observeArray(t)}else this.walk(t)};Gi.prototype.walk=function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)$(t,e[n],t[e[n]])},Gi.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)j(t[e])};var Xi=Ti.optionMergeStrategies;Xi.el=Xi.propsData=function(t,e,n,r){return n||zi('option "'+r+'" can only be used during instance creation with the `new` keyword.'),Ki(t,e)},Xi.data=function(t,e,n){return n?t||e?function(){var r="function"==typeof e?e.call(n):e,i="function"==typeof t?t.call(n):void 0;return r?M(r,i):i}:void 0:e?"function"!=typeof e?(zi('The "data" option should be a function that returns a per-instance value in component definitions.',n),t):t?function(){return M(e.call(this),t.call(this))}:e:t},Ti._lifecycleHooks.forEach(function(t){Xi[t]=E}),Ti._assetTypes.forEach(function(t){Xi[t+"s"]=P}),Xi.watch=function(t,e){if(!e)return t;if(!t)return e;var n={};f(n,t);for(var r in e){var i=n[r],o=e[r];i&&!Array.isArray(i)&&(i=[i]),n[r]=i?i.concat(o):[o]}return n},Xi.props=Xi.methods=Xi.computed=function(t,e){if(!e)return t;if(!t)return e;var n=Object.create(null);return f(n,t),f(n,e),n};var Yi,Ki=function(t,e){return void 0===e?t:e},Qi=Object.freeze({defineReactive:$,_toString:t,toNumber:n,makeMap:r,isBuiltInTag:di,remove:i,hasOwn:o,isPrimitive:a,cached:s,camelize:mi,capitalize:yi,hyphenate:_i,bind:l,toArray:c,extend:f,isObject:u,isPlainObject:h,toObject:p,noop:d,no:ki,identity:Ci,genStaticKeys:g,looseEqual:v,looseIndexOf:m,isReserved:y,def:b,parsePath:_,hasProto:$i,inBrowser:Ai,UA:Si,isIE:Oi,isIE9:Mi,isEdge:Ei,isAndroid:Pi,isIOS:Ni,isServerRendering:Fi,devtools:Ri,nextTick:Bi,get _Set(){return pi},mergeOptions:B,resolveAsset:D,get warn(){return zi},get formatComponentName(){return Di},validateProp:z}),to=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,require"),eo=function(t,e){zi('Property or method "'+e+'" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.',t)},no="undefined"!=typeof Proxy&&Proxy.toString().match(/native code/);if(no){var ro=r("stop,prevent,self,ctrl,shift,alt,meta");Ti.keyCodes=new Proxy(Ti.keyCodes,{set:function(t,e,n){return ro(e)?(zi("Avoid overwriting built-in modifier in config.keyCodes: ."+e),!1):(t[e]=n,!0)}})}var io={has:function t(e,n){var t=n in e,r=to(n)||"_"===n.charAt(0);return t||r||eo(e,n),t||!r}},oo={get:function(t,e){return"string"!=typeof e||e in t||eo(t,e),t[e]}};Yi=function(t){if(no){var e=t.$options,n=e.render&&e.render._withStripped?oo:io;t._renderProxy=new Proxy(t,n)}else t._renderProxy=t};var ao=function(t,e,n,r,i,o,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.functionalContext=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1},so={child:{}};so.child.get=function(){return this.componentInstance},Object.defineProperties(ao.prototype,so);var lo,co=function(){var t=new ao;return t.text="",t.isComment=!0,t},fo={init:Y,prepatch:K,insert:Q,destroy:tt},uo=Object.keys(fo),ho=s(function(t){var e="~"===t.charAt(0);t=e?t.slice(1):t;var n="!"===t.charAt(0);return t=n?t.slice(1):t,{name:t,once:e,capture:n}}),po=1,go=2,vo=null,mo=[],yo={},bo={},_o=!1,xo=!1,wo=0,ko=0,Co=function(t,e,n,r){this.vm=t,t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ko,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new pi,this.newDepIds=new pi,this.expression=e.toString(),"function"==typeof e?this.getter=e:(this.getter=_(e),this.getter||(this.getter=function(){},zi('Failed watching path: "'+e+'" Watcher only accepts simple dot-delimited paths. For full control, use a function instead.',t))),this.value=this.lazy?void 0:this.get()};Co.prototype.get=function(){w(this);var t=this.getter.call(this.vm,this.vm);return this.deep&&Ot(t),k(),this.cleanupDeps(),t},Co.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},Co.prototype.cleanupDeps=function(){for(var t=this,e=this.deps.length;e--;){var n=t.deps[e];t.newDepIds.has(n.id)||n.removeSub(t)}var r=this.depIds;this.depIds=this.newDepIds,this.newDepIds=r,this.newDepIds.clear(),r=this.deps,this.deps=this.newDeps,this.newDeps=r,this.newDeps.length=0},Co.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():St(this)},Co.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||u(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){if(!Ti.errorHandler)throw zi('Error in watcher "'+this.expression+'"',this.vm),t;Ti.errorHandler.call(null,t,this.vm)}else this.cb.call(this.vm,t,e)}}},Co.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Co.prototype.depend=function(){for(var t=this,e=this.deps.length;e--;)t.deps[e].depend()},Co.prototype.teardown=function(){var t=this;if(this.active){this.vm._isBeingDestroyed||i(this.vm._watchers,this);for(var e=this.deps.length;e--;)t.deps[e].removeSub(t);this.active=!1}};var To=new pi,jo={key:1,ref:1,slot:1},$o={enumerable:!0,configurable:!0,get:d,set:d},Ao=0;qt(Ut),It(Ut),kt(Ut),Tt(Ut),mt(Ut);var So=[String,RegExp],Oo={name:"keep-alive",abstract:!0,props:{include:So,exclude:So},created:function(){this.cache=Object.create(null)},destroyed:function(){var t=this;for(var e in this.cache)Qt(t.cache[e])},watch:{include:function(t){Kt(this.cache,function(e){return Yt(t,e)})},exclude:function(t){Kt(this.cache,function(e){return!Yt(t,e)})}},render:function(){var t=ht(this.$slots.default),e=t&&t.componentOptions;if(e){var n=Xt(e);if(n&&(this.include&&!Yt(this.include,n)||this.exclude&&Yt(this.exclude,n)))return t;var r=null==t.key?e.Ctor.cid+(e.tag?"::"+e.tag:""):t.key;this.cache[r]?t.componentInstance=this.cache[r].componentInstance:this.cache[r]=t,t.data.keepAlive=!0}return t}},Mo={KeepAlive:Oo};te(Ut),Object.defineProperty(Ut.prototype,"$isServer",{get:Fi}),Ut.version="2.1.10";var Eo,Po,No=r("input,textarea,option,select"),Fo=function(t,e,n){return"value"===n&&No(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Ro=r("contenteditable,draggable,spellcheck"),Bo=r("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Do="http://www.w3.org/1999/xlink",zo=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Io=function(t){return zo(t)?t.slice(6,t.length):""},Lo=function(t){return null==t||t===!1},qo={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Vo=r("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template"),Ho=r("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Uo=function(t){return"pre"===t},Wo=function(t){return Vo(t)||Ho(t)},Zo=Object.create(null),Jo=Object.freeze({createElement:ce,createElementNS:fe,createTextNode:ue,createComment:he,insertBefore:pe,removeChild:de,appendChild:ge,parentNode:ve,nextSibling:me,tagName:ye,setTextContent:be,setAttribute:_e}),Go={create:function(t,e){xe(e)},update:function(t,e){t.data.ref!==e.data.ref&&(xe(t,!0),xe(e))},destroy:function(t){xe(t,!0)}},Xo=new ao("",{},[]),Yo=["create","activate","update","remove","destroy"],Ko={create:$e,update:$e,destroy:function(t){$e(t,Xo)}},Qo=Object.create(null),ta=[Go,Ko],ea={create:Ee,update:Ee},na={create:Ne,update:Ne},ra={create:Be,update:Be},ia={create:De,update:De},oa=s(function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach(function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}),aa=/^--/,sa=/\s*!important$/,la=function(t,e,n){aa.test(e)?t.style.setProperty(e,n):sa.test(n)?t.style.setProperty(e,n.replace(sa,""),"important"):t.style[fa(e)]=n},ca=["Webkit","Moz","ms"],fa=s(function(t){if(Po=Po||document.createElement("div"),t=mi(t),"filter"!==t&&t in Po.style)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<ca.length;n++){var r=ca[n]+e;if(r in Po.style)return r}}),ua={create:Ue,update:Ue},ha=Ai&&!Mi,pa="transition",da="animation",ga="transition",va="transitionend",ma="animation",ya="animationend";ha&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ga="WebkitTransition",va="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ma="WebkitAnimation",ya="webkitAnimationEnd"));var ba=Ai&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout,_a=/\b(transform|all)(,|$)/,xa=s(function(t){return{enterClass:t+"-enter",leaveClass:t+"-leave",appearClass:t+"-enter",enterToClass:t+"-enter-to",leaveToClass:t+"-leave-to",appearToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveActiveClass:t+"-leave-active",appearActiveClass:t+"-enter-active"}}),wa=Ai?{create:an,activate:an,remove:function(t,e){t.data.show?e():nn(t,e)}}:{},ka=[ea,na,ra,ia,ua,wa],Ca=ka.concat(ta),Ta=je({nodeOps:Jo,modules:Ca}),ja=/^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;Mi&&document.addEventListener("selectionchange",function(){var t=document.activeElement;t&&t.vmodel&&hn(t,"input")});var $a={inserted:function(t,e,n){if(ja.test(n.tag)||zi("v-model is not supported on element type: <"+n.tag+">. If you are working with contenteditable, it's recommended to wrap a library dedicated for that purpose inside a custom component.",n.context),"select"===n.tag){var r=function(){sn(t,e,n.context)};r(),(Oi||Ei)&&setTimeout(r,0)}else"textarea"!==n.tag&&"text"!==t.type||(t._vModifiers=e.modifiers,e.modifiers.lazy||(Pi||(t.addEventListener("compositionstart",fn),t.addEventListener("compositionend",un)),Mi&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){sn(t,e,n.context);var r=t.multiple?e.value.some(function(e){return ln(e,t.options)}):e.value!==e.oldValue&&ln(e.value,t.options);r&&hn(t,"change")}}},Aa={bind:function(t,e,n){var r=e.value;n=pn(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i&&!Mi?(n.data.show=!0,en(n,function(){t.style.display=o})):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value,i=e.oldValue;if(r!==i){n=pn(n);var o=n.data&&n.data.transition;o&&!Mi?(n.data.show=!0,r?en(n,function(){t.style.display=t.__vOriginalDisplay}):nn(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},Sa={model:$a,show:Aa},Oa={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String},Ma={name:"transition",props:Oa,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(function(t){return t.tag}),n.length)){n.length>1&&zi("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;r&&"in-out"!==r&&"out-in"!==r&&zi("invalid <transition> mode: "+r,this.$parent);var i=n[0];if(mn(this.$vnode))return i;var o=dn(i);if(!o)return i;if(this._leaving)return vn(t,i);var s="__transition-"+this._uid+"-",l=o.key=null==o.key?s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key,c=(o.data||(o.data={})).transition=gn(this),u=this._vnode,h=dn(u);if(o.data.directives&&o.data.directives.some(function(t){return"show"===t.name})&&(o.data.show=!0),h&&h.data&&!yn(o,h)){var p=h&&(h.data.transition=f({},c));if("out-in"===r)return this._leaving=!0,at(p,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()},l),vn(t,i);if("in-out"===r){var d,g=function(){d()};at(c,"afterEnter",g,l),at(c,"enterCancelled",g,l),at(p,"delayLeave",function(t){d=t},l)}}return i}}},Ea=f({tag:String,moveClass:String},Oa);delete Ea.mode;var Pa={props:Ea,render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=gn(this),s=0;s<i.length;s++){var l=i[s];if(l.tag)if(null!=l.key&&0!==String(l.key).indexOf("__vlist"))o.push(l),n[l.key]=l,(l.data||(l.data={})).transition=a;else{var c=l.componentOptions,f=c?c.Ctor.options.name||c.tag:l.tag;zi("<transition-group> children must be keyed: <"+f+">")}}if(r){for(var u=[],h=[],p=0;p<r.length;p++){var d=r[p];d.data.transition=a,d.data.pos=d.elm.getBoundingClientRect(),n[d.key]?u.push(d):h.push(d)}this.kept=t(e,null,u),this.removed=h}return t(e,null,o)},beforeUpdate:function(){this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";if(t.length&&this.hasMove(t[0].elm,e)){t.forEach(bn),t.forEach(_n),t.forEach(xn);document.body.offsetHeight;t.forEach(function(t){if(t.data.moved){var n=t.elm,r=n.style;Ge(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(va,n._moveCb=function t(r){r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(va,t),n._moveCb=null,Xe(n,e))})}})}},methods:{hasMove:function(t,e){if(!ha)return!1;if(null!=this._hasMove)return this._hasMove;Ge(t,e);var n=Ke(t);return Xe(t,e),this._hasMove=n.hasTransform}}},Na={Transition:Ma,TransitionGroup:Pa};Ut.config.isUnknownElement=se,Ut.config.isReservedTag=Wo,Ut.config.getTagNamespace=ae,Ut.config.mustUseProp=Fo,f(Ut.options.directives,Sa),f(Ut.options.components,Na),Ut.prototype.__patch__=Ai?Ta:d,Ut.prototype.$mount=function(t,e){return t=t&&Ai?le(t):void 0,this._mount(t,e)},Ai&&"undefined"!=typeof console&&console[console.info?"info":"log"]("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html"),setTimeout(function(){Ti.devtools&&(Ri?Ri.emit("init",Ut):Ai&&!Ei&&/Chrome\/\d+/.test(window.navigator.userAgent)&&console[console.info?"info":"log"]("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools"))},0);var Fa,Ra=!!Ai&&wn("\n"," "),Ba=r("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr",!0),Da=r("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source",!0),za=r("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track",!0),Ia=/([^\s"'<>\/=]+)/,La=/(?:=)/,qa=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],Va=new RegExp("^\\s*"+Ia.source+"(?:\\s*("+La.source+")\\s*(?:"+qa.join("|")+"))?"),Ha="[a-zA-Z_][\\w\\-\\.]*",Ua="((?:"+Ha+"\\:)?"+Ha+")",Wa=new RegExp("^<"+Ua),Za=/^\s*(\/?)>/,Ja=new RegExp("^<\\/"+Ua+"[^>]*>"),Ga=/^<!DOCTYPE [^>]+>/i,Xa=/^<!--/,Ya=/^<!\[/,Ka=!1;"x".replace(/x(.)?/g,function(t,e){Ka=""===e});var Qa,ts,es,ns,rs,is,os,as,ss,ls,cs,fs,us,hs,ps,ds,gs,vs,ms,ys,bs,_s,xs,ws,ks,Cs=r("script,style",!0),Ts={},js=/</g,$s=/>/g,As=/ /g,Ss=/&/g,Os=/"/g,Ms=/\{\{((?:.|\n)+?)\}\}/g,Es=/[-.*+?^${}()|[\]\/\\]/g,Ps=s(function(t){var e=t[0].replace(Es,"\\$&"),n=t[1].replace(Es,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")}),Ns=/^v-|^@|^:/,Fs=/(.*?)\s+(?:in|of)\s+(.*)/,Rs=/\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/,Bs=/^:|^v-bind:/,Ds=/^@|^v-on:/,zs=/:(.*)$/,Is=/\.[^.]+/g,Ls=s(kn),qs=/^xmlns:NS\d+/,Vs=/^NS\d+:/,Hs=s(fr),Us=/^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/,Ws=/^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/,Zs={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Js={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:"if($event.target !== $event.currentTarget)return;",ctrl:"if(!$event.ctrlKey)return;",shift:"if(!$event.shiftKey)return;",alt:"if(!$event.altKey)return;",meta:"if(!$event.metaKey)return;"},Gs={bind:_r,cloak:d},Xs=new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),Ys=/[A-Za-z_$][\w$]*/,Ks=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g,Qs={staticKeys:["staticClass"],transformNode:Gr,genData:Xr},tl={staticKeys:["staticStyle"],transformNode:Yr,genData:Kr},el=[Qs,tl],nl={model:Qr,text:ai,html:si},rl=Object.create(null),il={expectHTML:!0,modules:el,staticKeys:g(el),directives:nl,isReservedTag:Wo,isUnaryTag:Ba,mustUseProp:Fo,getTagNamespace:ae,isPreTag:Uo},ol=s(function(t){var e=le(t);return e&&e.innerHTML}),al=Ut.prototype.$mount;return Ut.prototype.$mount=function(t,e){if(t=t&&le(t),t===document.body||t===document.documentElement)return zi("Do not mount Vue to <html> or <body> - mount to normal elements instead."),this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ol(r),r||zi("Template element not found or is empty: "+n.template,this));else{if(!r.nodeType)return zi("invalid template option:"+r,this),this;r=r.innerHTML}else t&&(r=ui(t));if(r){var i=ci(r,{warn:zi,shouldDecodeNewlines:Ra,delimiters:n.delimiters},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return al.call(this,t,e)},Ut.compile=ci,Ut})}).call(e,function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}}]);
//# sourceMappingURL=iconolab.js.map
\ No newline at end of file