View | Details | Raw Unified | Return to bug 15883
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-2.2.3.js (+9842 lines)
Line 0 Link Here
1
/*!
2
 * jQuery JavaScript Library v2.2.3
3
 * http://jquery.com/
4
 *
5
 * Includes Sizzle.js
6
 * http://sizzlejs.com/
7
 *
8
 * Copyright jQuery Foundation and other contributors
9
 * Released under the MIT license
10
 * http://jquery.org/license
11
 *
12
 * Date: 2016-04-05T19:26Z
13
 */
14
15
(function( global, factory ) {
16
17
	if ( typeof module === "object" && typeof module.exports === "object" ) {
18
		// For CommonJS and CommonJS-like environments where a proper `window`
19
		// is present, execute the factory and get jQuery.
20
		// For environments that do not have a `window` with a `document`
21
		// (such as Node.js), expose a factory as module.exports.
22
		// This accentuates the need for the creation of a real `window`.
23
		// e.g. var jQuery = require("jquery")(window);
24
		// See ticket #14549 for more info.
25
		module.exports = global.document ?
26
			factory( global, true ) :
27
			function( w ) {
28
				if ( !w.document ) {
29
					throw new Error( "jQuery requires a window with a document" );
30
				}
31
				return factory( w );
32
			};
33
	} else {
34
		factory( global );
35
	}
36
37
// Pass this if window is not defined yet
38
}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
39
40
// Support: Firefox 18+
41
// Can't be in strict mode, several libs including ASP.NET trace
42
// the stack via arguments.caller.callee and Firefox dies if
43
// you try to trace through "use strict" call chains. (#13335)
44
//"use strict";
45
var arr = [];
46
47
var document = window.document;
48
49
var slice = arr.slice;
50
51
var concat = arr.concat;
52
53
var push = arr.push;
54
55
var indexOf = arr.indexOf;
56
57
var class2type = {};
58
59
var toString = class2type.toString;
60
61
var hasOwn = class2type.hasOwnProperty;
62
63
var support = {};
64
65
66
67
var
68
	version = "2.2.3",
69
70
	// Define a local copy of jQuery
71
	jQuery = function( selector, context ) {
72
73
		// The jQuery object is actually just the init constructor 'enhanced'
74
		// Need init if jQuery is called (just allow error to be thrown if not included)
75
		return new jQuery.fn.init( selector, context );
76
	},
77
78
	// Support: Android<4.1
79
	// Make sure we trim BOM and NBSP
80
	rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
81
82
	// Matches dashed string for camelizing
83
	rmsPrefix = /^-ms-/,
84
	rdashAlpha = /-([\da-z])/gi,
85
86
	// Used by jQuery.camelCase as callback to replace()
87
	fcamelCase = function( all, letter ) {
88
		return letter.toUpperCase();
89
	};
90
91
jQuery.fn = jQuery.prototype = {
92
93
	// The current version of jQuery being used
94
	jquery: version,
95
96
	constructor: jQuery,
97
98
	// Start with an empty selector
99
	selector: "",
100
101
	// The default length of a jQuery object is 0
102
	length: 0,
103
104
	toArray: function() {
105
		return slice.call( this );
106
	},
107
108
	// Get the Nth element in the matched element set OR
109
	// Get the whole matched element set as a clean array
110
	get: function( num ) {
111
		return num != null ?
112
113
			// Return just the one element from the set
114
			( num < 0 ? this[ num + this.length ] : this[ num ] ) :
115
116
			// Return all the elements in a clean array
117
			slice.call( this );
118
	},
119
120
	// Take an array of elements and push it onto the stack
121
	// (returning the new matched element set)
122
	pushStack: function( elems ) {
123
124
		// Build a new jQuery matched element set
125
		var ret = jQuery.merge( this.constructor(), elems );
126
127
		// Add the old object onto the stack (as a reference)
128
		ret.prevObject = this;
129
		ret.context = this.context;
130
131
		// Return the newly-formed element set
132
		return ret;
133
	},
134
135
	// Execute a callback for every element in the matched set.
136
	each: function( callback ) {
137
		return jQuery.each( this, callback );
138
	},
139
140
	map: function( callback ) {
141
		return this.pushStack( jQuery.map( this, function( elem, i ) {
142
			return callback.call( elem, i, elem );
143
		} ) );
144
	},
145
146
	slice: function() {
147
		return this.pushStack( slice.apply( this, arguments ) );
148
	},
149
150
	first: function() {
151
		return this.eq( 0 );
152
	},
153
154
	last: function() {
155
		return this.eq( -1 );
156
	},
157
158
	eq: function( i ) {
159
		var len = this.length,
160
			j = +i + ( i < 0 ? len : 0 );
161
		return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
162
	},
163
164
	end: function() {
165
		return this.prevObject || this.constructor();
166
	},
167
168
	// For internal use only.
169
	// Behaves like an Array's method, not like a jQuery method.
170
	push: push,
171
	sort: arr.sort,
172
	splice: arr.splice
173
};
174
175
jQuery.extend = jQuery.fn.extend = function() {
176
	var options, name, src, copy, copyIsArray, clone,
177
		target = arguments[ 0 ] || {},
178
		i = 1,
179
		length = arguments.length,
180
		deep = false;
181
182
	// Handle a deep copy situation
183
	if ( typeof target === "boolean" ) {
184
		deep = target;
185
186
		// Skip the boolean and the target
187
		target = arguments[ i ] || {};
188
		i++;
189
	}
190
191
	// Handle case when target is a string or something (possible in deep copy)
192
	if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
193
		target = {};
194
	}
195
196
	// Extend jQuery itself if only one argument is passed
197
	if ( i === length ) {
198
		target = this;
199
		i--;
200
	}
201
202
	for ( ; i < length; i++ ) {
203
204
		// Only deal with non-null/undefined values
205
		if ( ( options = arguments[ i ] ) != null ) {
206
207
			// Extend the base object
208
			for ( name in options ) {
209
				src = target[ name ];
210
				copy = options[ name ];
211
212
				// Prevent never-ending loop
213
				if ( target === copy ) {
214
					continue;
215
				}
216
217
				// Recurse if we're merging plain objects or arrays
218
				if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
219
					( copyIsArray = jQuery.isArray( copy ) ) ) ) {
220
221
					if ( copyIsArray ) {
222
						copyIsArray = false;
223
						clone = src && jQuery.isArray( src ) ? src : [];
224
225
					} else {
226
						clone = src && jQuery.isPlainObject( src ) ? src : {};
227
					}
228
229
					// Never move original objects, clone them
230
					target[ name ] = jQuery.extend( deep, clone, copy );
231
232
				// Don't bring in undefined values
233
				} else if ( copy !== undefined ) {
234
					target[ name ] = copy;
235
				}
236
			}
237
		}
238
	}
239
240
	// Return the modified object
241
	return target;
242
};
243
244
jQuery.extend( {
245
246
	// Unique for each copy of jQuery on the page
247
	expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
248
249
	// Assume jQuery is ready without the ready module
250
	isReady: true,
251
252
	error: function( msg ) {
253
		throw new Error( msg );
254
	},
255
256
	noop: function() {},
257
258
	isFunction: function( obj ) {
259
		return jQuery.type( obj ) === "function";
260
	},
261
262
	isArray: Array.isArray,
263
264
	isWindow: function( obj ) {
265
		return obj != null && obj === obj.window;
266
	},
267
268
	isNumeric: function( obj ) {
269
270
		// parseFloat NaNs numeric-cast false positives (null|true|false|"")
271
		// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
272
		// subtraction forces infinities to NaN
273
		// adding 1 corrects loss of precision from parseFloat (#15100)
274
		var realStringObj = obj && obj.toString();
275
		return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
276
	},
277
278
	isPlainObject: function( obj ) {
279
		var key;
280
281
		// Not plain objects:
282
		// - Any object or value whose internal [[Class]] property is not "[object Object]"
283
		// - DOM nodes
284
		// - window
285
		if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
286
			return false;
287
		}
288
289
		// Not own constructor property must be Object
290
		if ( obj.constructor &&
291
				!hasOwn.call( obj, "constructor" ) &&
292
				!hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) {
293
			return false;
294
		}
295
296
		// Own properties are enumerated firstly, so to speed up,
297
		// if last one is own, then all properties are own
298
		for ( key in obj ) {}
299
300
		return key === undefined || hasOwn.call( obj, key );
301
	},
302
303
	isEmptyObject: function( obj ) {
304
		var name;
305
		for ( name in obj ) {
306
			return false;
307
		}
308
		return true;
309
	},
310
311
	type: function( obj ) {
312
		if ( obj == null ) {
313
			return obj + "";
314
		}
315
316
		// Support: Android<4.0, iOS<6 (functionish RegExp)
317
		return typeof obj === "object" || typeof obj === "function" ?
318
			class2type[ toString.call( obj ) ] || "object" :
319
			typeof obj;
320
	},
321
322
	// Evaluates a script in a global context
323
	globalEval: function( code ) {
324
		var script,
325
			indirect = eval;
326
327
		code = jQuery.trim( code );
328
329
		if ( code ) {
330
331
			// If the code includes a valid, prologue position
332
			// strict mode pragma, execute code by injecting a
333
			// script tag into the document.
334
			if ( code.indexOf( "use strict" ) === 1 ) {
335
				script = document.createElement( "script" );
336
				script.text = code;
337
				document.head.appendChild( script ).parentNode.removeChild( script );
338
			} else {
339
340
				// Otherwise, avoid the DOM node creation, insertion
341
				// and removal by using an indirect global eval
342
343
				indirect( code );
344
			}
345
		}
346
	},
347
348
	// Convert dashed to camelCase; used by the css and data modules
349
	// Support: IE9-11+
350
	// Microsoft forgot to hump their vendor prefix (#9572)
351
	camelCase: function( string ) {
352
		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
353
	},
354
355
	nodeName: function( elem, name ) {
356
		return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
357
	},
358
359
	each: function( obj, callback ) {
360
		var length, i = 0;
361
362
		if ( isArrayLike( obj ) ) {
363
			length = obj.length;
364
			for ( ; i < length; i++ ) {
365
				if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
366
					break;
367
				}
368
			}
369
		} else {
370
			for ( i in obj ) {
371
				if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
372
					break;
373
				}
374
			}
375
		}
376
377
		return obj;
378
	},
379
380
	// Support: Android<4.1
381
	trim: function( text ) {
382
		return text == null ?
383
			"" :
384
			( text + "" ).replace( rtrim, "" );
385
	},
386
387
	// results is for internal usage only
388
	makeArray: function( arr, results ) {
389
		var ret = results || [];
390
391
		if ( arr != null ) {
392
			if ( isArrayLike( Object( arr ) ) ) {
393
				jQuery.merge( ret,
394
					typeof arr === "string" ?
395
					[ arr ] : arr
396
				);
397
			} else {
398
				push.call( ret, arr );
399
			}
400
		}
401
402
		return ret;
403
	},
404
405
	inArray: function( elem, arr, i ) {
406
		return arr == null ? -1 : indexOf.call( arr, elem, i );
407
	},
408
409
	merge: function( first, second ) {
410
		var len = +second.length,
411
			j = 0,
412
			i = first.length;
413
414
		for ( ; j < len; j++ ) {
415
			first[ i++ ] = second[ j ];
416
		}
417
418
		first.length = i;
419
420
		return first;
421
	},
422
423
	grep: function( elems, callback, invert ) {
424
		var callbackInverse,
425
			matches = [],
426
			i = 0,
427
			length = elems.length,
428
			callbackExpect = !invert;
429
430
		// Go through the array, only saving the items
431
		// that pass the validator function
432
		for ( ; i < length; i++ ) {
433
			callbackInverse = !callback( elems[ i ], i );
434
			if ( callbackInverse !== callbackExpect ) {
435
				matches.push( elems[ i ] );
436
			}
437
		}
438
439
		return matches;
440
	},
441
442
	// arg is for internal usage only
443
	map: function( elems, callback, arg ) {
444
		var length, value,
445
			i = 0,
446
			ret = [];
447
448
		// Go through the array, translating each of the items to their new values
449
		if ( isArrayLike( elems ) ) {
450
			length = elems.length;
451
			for ( ; i < length; i++ ) {
452
				value = callback( elems[ i ], i, arg );
453
454
				if ( value != null ) {
455
					ret.push( value );
456
				}
457
			}
458
459
		// Go through every key on the object,
460
		} else {
461
			for ( i in elems ) {
462
				value = callback( elems[ i ], i, arg );
463
464
				if ( value != null ) {
465
					ret.push( value );
466
				}
467
			}
468
		}
469
470
		// Flatten any nested arrays
471
		return concat.apply( [], ret );
472
	},
473
474
	// A global GUID counter for objects
475
	guid: 1,
476
477
	// Bind a function to a context, optionally partially applying any
478
	// arguments.
479
	proxy: function( fn, context ) {
480
		var tmp, args, proxy;
481
482
		if ( typeof context === "string" ) {
483
			tmp = fn[ context ];
484
			context = fn;
485
			fn = tmp;
486
		}
487
488
		// Quick check to determine if target is callable, in the spec
489
		// this throws a TypeError, but we will just return undefined.
490
		if ( !jQuery.isFunction( fn ) ) {
491
			return undefined;
492
		}
493
494
		// Simulated bind
495
		args = slice.call( arguments, 2 );
496
		proxy = function() {
497
			return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
498
		};
499
500
		// Set the guid of unique handler to the same of original handler, so it can be removed
501
		proxy.guid = fn.guid = fn.guid || jQuery.guid++;
502
503
		return proxy;
504
	},
505
506
	now: Date.now,
507
508
	// jQuery.support is not used in Core but other projects attach their
509
	// properties to it so it needs to exist.
510
	support: support
511
} );
512
513
// JSHint would error on this code due to the Symbol not being defined in ES5.
514
// Defining this global in .jshintrc would create a danger of using the global
515
// unguarded in another place, it seems safer to just disable JSHint for these
516
// three lines.
517
/* jshint ignore: start */
518
if ( typeof Symbol === "function" ) {
519
	jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
520
}
521
/* jshint ignore: end */
522
523
// Populate the class2type map
524
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
525
function( i, name ) {
526
	class2type[ "[object " + name + "]" ] = name.toLowerCase();
527
} );
528
529
function isArrayLike( obj ) {
530
531
	// Support: iOS 8.2 (not reproducible in simulator)
532
	// `in` check used to prevent JIT error (gh-2145)
533
	// hasOwn isn't used here due to false negatives
534
	// regarding Nodelist length in IE
535
	var length = !!obj && "length" in obj && obj.length,
536
		type = jQuery.type( obj );
537
538
	if ( type === "function" || jQuery.isWindow( obj ) ) {
539
		return false;
540
	}
541
542
	return type === "array" || length === 0 ||
543
		typeof length === "number" && length > 0 && ( length - 1 ) in obj;
544
}
545
var Sizzle =
546
/*!
547
 * Sizzle CSS Selector Engine v2.2.1
548
 * http://sizzlejs.com/
549
 *
550
 * Copyright jQuery Foundation and other contributors
551
 * Released under the MIT license
552
 * http://jquery.org/license
553
 *
554
 * Date: 2015-10-17
555
 */
556
(function( window ) {
557
558
var i,
559
	support,
560
	Expr,
561
	getText,
562
	isXML,
563
	tokenize,
564
	compile,
565
	select,
566
	outermostContext,
567
	sortInput,
568
	hasDuplicate,
569
570
	// Local document vars
571
	setDocument,
572
	document,
573
	docElem,
574
	documentIsHTML,
575
	rbuggyQSA,
576
	rbuggyMatches,
577
	matches,
578
	contains,
579
580
	// Instance-specific data
581
	expando = "sizzle" + 1 * new Date(),
582
	preferredDoc = window.document,
583
	dirruns = 0,
584
	done = 0,
585
	classCache = createCache(),
586
	tokenCache = createCache(),
587
	compilerCache = createCache(),
588
	sortOrder = function( a, b ) {
589
		if ( a === b ) {
590
			hasDuplicate = true;
591
		}
592
		return 0;
593
	},
594
595
	// General-purpose constants
596
	MAX_NEGATIVE = 1 << 31,
597
598
	// Instance methods
599
	hasOwn = ({}).hasOwnProperty,
600
	arr = [],
601
	pop = arr.pop,
602
	push_native = arr.push,
603
	push = arr.push,
604
	slice = arr.slice,
605
	// Use a stripped-down indexOf as it's faster than native
606
	// http://jsperf.com/thor-indexof-vs-for/5
607
	indexOf = function( list, elem ) {
608
		var i = 0,
609
			len = list.length;
610
		for ( ; i < len; i++ ) {
611
			if ( list[i] === elem ) {
612
				return i;
613
			}
614
		}
615
		return -1;
616
	},
617
618
	booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
619
620
	// Regular expressions
621
622
	// http://www.w3.org/TR/css3-selectors/#whitespace
623
	whitespace = "[\\x20\\t\\r\\n\\f]",
624
625
	// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
626
	identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
627
628
	// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
629
	attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
630
		// Operator (capture 2)
631
		"*([*^$|!~]?=)" + whitespace +
632
		// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
633
		"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
634
		"*\\]",
635
636
	pseudos = ":(" + identifier + ")(?:\\((" +
637
		// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
638
		// 1. quoted (capture 3; capture 4 or capture 5)
639
		"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
640
		// 2. simple (capture 6)
641
		"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
642
		// 3. anything else (capture 2)
643
		".*" +
644
		")\\)|)",
645
646
	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
647
	rwhitespace = new RegExp( whitespace + "+", "g" ),
648
	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
649
650
	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
651
	rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
652
653
	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
654
655
	rpseudo = new RegExp( pseudos ),
656
	ridentifier = new RegExp( "^" + identifier + "$" ),
657
658
	matchExpr = {
659
		"ID": new RegExp( "^#(" + identifier + ")" ),
660
		"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
661
		"TAG": new RegExp( "^(" + identifier + "|[*])" ),
662
		"ATTR": new RegExp( "^" + attributes ),
663
		"PSEUDO": new RegExp( "^" + pseudos ),
664
		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
665
			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
666
			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
667
		"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
668
		// For use in libraries implementing .is()
669
		// We use this for POS matching in `select`
670
		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
671
			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
672
	},
673
674
	rinputs = /^(?:input|select|textarea|button)$/i,
675
	rheader = /^h\d$/i,
676
677
	rnative = /^[^{]+\{\s*\[native \w/,
678
679
	// Easily-parseable/retrievable ID or TAG or CLASS selectors
680
	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
681
682
	rsibling = /[+~]/,
683
	rescape = /'|\\/g,
684
685
	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
686
	runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
687
	funescape = function( _, escaped, escapedWhitespace ) {
688
		var high = "0x" + escaped - 0x10000;
689
		// NaN means non-codepoint
690
		// Support: Firefox<24
691
		// Workaround erroneous numeric interpretation of +"0x"
692
		return high !== high || escapedWhitespace ?
693
			escaped :
694
			high < 0 ?
695
				// BMP codepoint
696
				String.fromCharCode( high + 0x10000 ) :
697
				// Supplemental Plane codepoint (surrogate pair)
698
				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
699
	},
700
701
	// Used for iframes
702
	// See setDocument()
703
	// Removing the function wrapper causes a "Permission Denied"
704
	// error in IE
705
	unloadHandler = function() {
706
		setDocument();
707
	};
708
709
// Optimize for push.apply( _, NodeList )
710
try {
711
	push.apply(
712
		(arr = slice.call( preferredDoc.childNodes )),
713
		preferredDoc.childNodes
714
	);
715
	// Support: Android<4.0
716
	// Detect silently failing push.apply
717
	arr[ preferredDoc.childNodes.length ].nodeType;
718
} catch ( e ) {
719
	push = { apply: arr.length ?
720
721
		// Leverage slice if possible
722
		function( target, els ) {
723
			push_native.apply( target, slice.call(els) );
724
		} :
725
726
		// Support: IE<9
727
		// Otherwise append directly
728
		function( target, els ) {
729
			var j = target.length,
730
				i = 0;
731
			// Can't trust NodeList.length
732
			while ( (target[j++] = els[i++]) ) {}
733
			target.length = j - 1;
734
		}
735
	};
736
}
737
738
function Sizzle( selector, context, results, seed ) {
739
	var m, i, elem, nid, nidselect, match, groups, newSelector,
740
		newContext = context && context.ownerDocument,
741
742
		// nodeType defaults to 9, since context defaults to document
743
		nodeType = context ? context.nodeType : 9;
744
745
	results = results || [];
746
747
	// Return early from calls with invalid selector or context
748
	if ( typeof selector !== "string" || !selector ||
749
		nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
750
751
		return results;
752
	}
753
754
	// Try to shortcut find operations (as opposed to filters) in HTML documents
755
	if ( !seed ) {
756
757
		if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
758
			setDocument( context );
759
		}
760
		context = context || document;
761
762
		if ( documentIsHTML ) {
763
764
			// If the selector is sufficiently simple, try using a "get*By*" DOM method
765
			// (excepting DocumentFragment context, where the methods don't exist)
766
			if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
767
768
				// ID selector
769
				if ( (m = match[1]) ) {
770
771
					// Document context
772
					if ( nodeType === 9 ) {
773
						if ( (elem = context.getElementById( m )) ) {
774
775
							// Support: IE, Opera, Webkit
776
							// TODO: identify versions
777
							// getElementById can match elements by name instead of ID
778
							if ( elem.id === m ) {
779
								results.push( elem );
780
								return results;
781
							}
782
						} else {
783
							return results;
784
						}
785
786
					// Element context
787
					} else {
788
789
						// Support: IE, Opera, Webkit
790
						// TODO: identify versions
791
						// getElementById can match elements by name instead of ID
792
						if ( newContext && (elem = newContext.getElementById( m )) &&
793
							contains( context, elem ) &&
794
							elem.id === m ) {
795
796
							results.push( elem );
797
							return results;
798
						}
799
					}
800
801
				// Type selector
802
				} else if ( match[2] ) {
803
					push.apply( results, context.getElementsByTagName( selector ) );
804
					return results;
805
806
				// Class selector
807
				} else if ( (m = match[3]) && support.getElementsByClassName &&
808
					context.getElementsByClassName ) {
809
810
					push.apply( results, context.getElementsByClassName( m ) );
811
					return results;
812
				}
813
			}
814
815
			// Take advantage of querySelectorAll
816
			if ( support.qsa &&
817
				!compilerCache[ selector + " " ] &&
818
				(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
819
820
				if ( nodeType !== 1 ) {
821
					newContext = context;
822
					newSelector = selector;
823
824
				// qSA looks outside Element context, which is not what we want
825
				// Thanks to Andrew Dupont for this workaround technique
826
				// Support: IE <=8
827
				// Exclude object elements
828
				} else if ( context.nodeName.toLowerCase() !== "object" ) {
829
830
					// Capture the context ID, setting it first if necessary
831
					if ( (nid = context.getAttribute( "id" )) ) {
832
						nid = nid.replace( rescape, "\\$&" );
833
					} else {
834
						context.setAttribute( "id", (nid = expando) );
835
					}
836
837
					// Prefix every selector in the list
838
					groups = tokenize( selector );
839
					i = groups.length;
840
					nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
841
					while ( i-- ) {
842
						groups[i] = nidselect + " " + toSelector( groups[i] );
843
					}
844
					newSelector = groups.join( "," );
845
846
					// Expand context for sibling selectors
847
					newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
848
						context;
849
				}
850
851
				if ( newSelector ) {
852
					try {
853
						push.apply( results,
854
							newContext.querySelectorAll( newSelector )
855
						);
856
						return results;
857
					} catch ( qsaError ) {
858
					} finally {
859
						if ( nid === expando ) {
860
							context.removeAttribute( "id" );
861
						}
862
					}
863
				}
864
			}
865
		}
866
	}
867
868
	// All others
869
	return select( selector.replace( rtrim, "$1" ), context, results, seed );
870
}
871
872
/**
873
 * Create key-value caches of limited size
874
 * @returns {function(string, object)} Returns the Object data after storing it on itself with
875
 *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
876
 *	deleting the oldest entry
877
 */
878
function createCache() {
879
	var keys = [];
880
881
	function cache( key, value ) {
882
		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
883
		if ( keys.push( key + " " ) > Expr.cacheLength ) {
884
			// Only keep the most recent entries
885
			delete cache[ keys.shift() ];
886
		}
887
		return (cache[ key + " " ] = value);
888
	}
889
	return cache;
890
}
891
892
/**
893
 * Mark a function for special use by Sizzle
894
 * @param {Function} fn The function to mark
895
 */
896
function markFunction( fn ) {
897
	fn[ expando ] = true;
898
	return fn;
899
}
900
901
/**
902
 * Support testing using an element
903
 * @param {Function} fn Passed the created div and expects a boolean result
904
 */
905
function assert( fn ) {
906
	var div = document.createElement("div");
907
908
	try {
909
		return !!fn( div );
910
	} catch (e) {
911
		return false;
912
	} finally {
913
		// Remove from its parent by default
914
		if ( div.parentNode ) {
915
			div.parentNode.removeChild( div );
916
		}
917
		// release memory in IE
918
		div = null;
919
	}
920
}
921
922
/**
923
 * Adds the same handler for all of the specified attrs
924
 * @param {String} attrs Pipe-separated list of attributes
925
 * @param {Function} handler The method that will be applied
926
 */
927
function addHandle( attrs, handler ) {
928
	var arr = attrs.split("|"),
929
		i = arr.length;
930
931
	while ( i-- ) {
932
		Expr.attrHandle[ arr[i] ] = handler;
933
	}
934
}
935
936
/**
937
 * Checks document order of two siblings
938
 * @param {Element} a
939
 * @param {Element} b
940
 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
941
 */
942
function siblingCheck( a, b ) {
943
	var cur = b && a,
944
		diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
945
			( ~b.sourceIndex || MAX_NEGATIVE ) -
946
			( ~a.sourceIndex || MAX_NEGATIVE );
947
948
	// Use IE sourceIndex if available on both nodes
949
	if ( diff ) {
950
		return diff;
951
	}
952
953
	// Check if b follows a
954
	if ( cur ) {
955
		while ( (cur = cur.nextSibling) ) {
956
			if ( cur === b ) {
957
				return -1;
958
			}
959
		}
960
	}
961
962
	return a ? 1 : -1;
963
}
964
965
/**
966
 * Returns a function to use in pseudos for input types
967
 * @param {String} type
968
 */
969
function createInputPseudo( type ) {
970
	return function( elem ) {
971
		var name = elem.nodeName.toLowerCase();
972
		return name === "input" && elem.type === type;
973
	};
974
}
975
976
/**
977
 * Returns a function to use in pseudos for buttons
978
 * @param {String} type
979
 */
980
function createButtonPseudo( type ) {
981
	return function( elem ) {
982
		var name = elem.nodeName.toLowerCase();
983
		return (name === "input" || name === "button") && elem.type === type;
984
	};
985
}
986
987
/**
988
 * Returns a function to use in pseudos for positionals
989
 * @param {Function} fn
990
 */
991
function createPositionalPseudo( fn ) {
992
	return markFunction(function( argument ) {
993
		argument = +argument;
994
		return markFunction(function( seed, matches ) {
995
			var j,
996
				matchIndexes = fn( [], seed.length, argument ),
997
				i = matchIndexes.length;
998
999
			// Match elements found at the specified indexes
1000
			while ( i-- ) {
1001
				if ( seed[ (j = matchIndexes[i]) ] ) {
1002
					seed[j] = !(matches[j] = seed[j]);
1003
				}
1004
			}
1005
		});
1006
	});
1007
}
1008
1009
/**
1010
 * Checks a node for validity as a Sizzle context
1011
 * @param {Element|Object=} context
1012
 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1013
 */
1014
function testContext( context ) {
1015
	return context && typeof context.getElementsByTagName !== "undefined" && context;
1016
}
1017
1018
// Expose support vars for convenience
1019
support = Sizzle.support = {};
1020
1021
/**
1022
 * Detects XML nodes
1023
 * @param {Element|Object} elem An element or a document
1024
 * @returns {Boolean} True iff elem is a non-HTML XML node
1025
 */
1026
isXML = Sizzle.isXML = function( elem ) {
1027
	// documentElement is verified for cases where it doesn't yet exist
1028
	// (such as loading iframes in IE - #4833)
1029
	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1030
	return documentElement ? documentElement.nodeName !== "HTML" : false;
1031
};
1032
1033
/**
1034
 * Sets document-related variables once based on the current document
1035
 * @param {Element|Object} [doc] An element or document object to use to set the document
1036
 * @returns {Object} Returns the current document
1037
 */
1038
setDocument = Sizzle.setDocument = function( node ) {
1039
	var hasCompare, parent,
1040
		doc = node ? node.ownerDocument || node : preferredDoc;
1041
1042
	// Return early if doc is invalid or already selected
1043
	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1044
		return document;
1045
	}
1046
1047
	// Update global variables
1048
	document = doc;
1049
	docElem = document.documentElement;
1050
	documentIsHTML = !isXML( document );
1051
1052
	// Support: IE 9-11, Edge
1053
	// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1054
	if ( (parent = document.defaultView) && parent.top !== parent ) {
1055
		// Support: IE 11
1056
		if ( parent.addEventListener ) {
1057
			parent.addEventListener( "unload", unloadHandler, false );
1058
1059
		// Support: IE 9 - 10 only
1060
		} else if ( parent.attachEvent ) {
1061
			parent.attachEvent( "onunload", unloadHandler );
1062
		}
1063
	}
1064
1065
	/* Attributes
1066
	---------------------------------------------------------------------- */
1067
1068
	// Support: IE<8
1069
	// Verify that getAttribute really returns attributes and not properties
1070
	// (excepting IE8 booleans)
1071
	support.attributes = assert(function( div ) {
1072
		div.className = "i";
1073
		return !div.getAttribute("className");
1074
	});
1075
1076
	/* getElement(s)By*
1077
	---------------------------------------------------------------------- */
1078
1079
	// Check if getElementsByTagName("*") returns only elements
1080
	support.getElementsByTagName = assert(function( div ) {
1081
		div.appendChild( document.createComment("") );
1082
		return !div.getElementsByTagName("*").length;
1083
	});
1084
1085
	// Support: IE<9
1086
	support.getElementsByClassName = rnative.test( document.getElementsByClassName );
1087
1088
	// Support: IE<10
1089
	// Check if getElementById returns elements by name
1090
	// The broken getElementById methods don't pick up programatically-set names,
1091
	// so use a roundabout getElementsByName test
1092
	support.getById = assert(function( div ) {
1093
		docElem.appendChild( div ).id = expando;
1094
		return !document.getElementsByName || !document.getElementsByName( expando ).length;
1095
	});
1096
1097
	// ID find and filter
1098
	if ( support.getById ) {
1099
		Expr.find["ID"] = function( id, context ) {
1100
			if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1101
				var m = context.getElementById( id );
1102
				return m ? [ m ] : [];
1103
			}
1104
		};
1105
		Expr.filter["ID"] = function( id ) {
1106
			var attrId = id.replace( runescape, funescape );
1107
			return function( elem ) {
1108
				return elem.getAttribute("id") === attrId;
1109
			};
1110
		};
1111
	} else {
1112
		// Support: IE6/7
1113
		// getElementById is not reliable as a find shortcut
1114
		delete Expr.find["ID"];
1115
1116
		Expr.filter["ID"] =  function( id ) {
1117
			var attrId = id.replace( runescape, funescape );
1118
			return function( elem ) {
1119
				var node = typeof elem.getAttributeNode !== "undefined" &&
1120
					elem.getAttributeNode("id");
1121
				return node && node.value === attrId;
1122
			};
1123
		};
1124
	}
1125
1126
	// Tag
1127
	Expr.find["TAG"] = support.getElementsByTagName ?
1128
		function( tag, context ) {
1129
			if ( typeof context.getElementsByTagName !== "undefined" ) {
1130
				return context.getElementsByTagName( tag );
1131
1132
			// DocumentFragment nodes don't have gEBTN
1133
			} else if ( support.qsa ) {
1134
				return context.querySelectorAll( tag );
1135
			}
1136
		} :
1137
1138
		function( tag, context ) {
1139
			var elem,
1140
				tmp = [],
1141
				i = 0,
1142
				// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1143
				results = context.getElementsByTagName( tag );
1144
1145
			// Filter out possible comments
1146
			if ( tag === "*" ) {
1147
				while ( (elem = results[i++]) ) {
1148
					if ( elem.nodeType === 1 ) {
1149
						tmp.push( elem );
1150
					}
1151
				}
1152
1153
				return tmp;
1154
			}
1155
			return results;
1156
		};
1157
1158
	// Class
1159
	Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1160
		if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
1161
			return context.getElementsByClassName( className );
1162
		}
1163
	};
1164
1165
	/* QSA/matchesSelector
1166
	---------------------------------------------------------------------- */
1167
1168
	// QSA and matchesSelector support
1169
1170
	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1171
	rbuggyMatches = [];
1172
1173
	// qSa(:focus) reports false when true (Chrome 21)
1174
	// We allow this because of a bug in IE8/9 that throws an error
1175
	// whenever `document.activeElement` is accessed on an iframe
1176
	// So, we allow :focus to pass through QSA all the time to avoid the IE error
1177
	// See http://bugs.jquery.com/ticket/13378
1178
	rbuggyQSA = [];
1179
1180
	if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
1181
		// Build QSA regex
1182
		// Regex strategy adopted from Diego Perini
1183
		assert(function( div ) {
1184
			// Select is set to empty string on purpose
1185
			// This is to test IE's treatment of not explicitly
1186
			// setting a boolean content attribute,
1187
			// since its presence should be enough
1188
			// http://bugs.jquery.com/ticket/12359
1189
			docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
1190
				"<select id='" + expando + "-\r\\' msallowcapture=''>" +
1191
				"<option selected=''></option></select>";
1192
1193
			// Support: IE8, Opera 11-12.16
1194
			// Nothing should be selected when empty strings follow ^= or $= or *=
1195
			// The test attribute must be unknown in Opera but "safe" for WinRT
1196
			// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1197
			if ( div.querySelectorAll("[msallowcapture^='']").length ) {
1198
				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1199
			}
1200
1201
			// Support: IE8
1202
			// Boolean attributes and "value" are not treated correctly
1203
			if ( !div.querySelectorAll("[selected]").length ) {
1204
				rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1205
			}
1206
1207
			// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1208
			if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1209
				rbuggyQSA.push("~=");
1210
			}
1211
1212
			// Webkit/Opera - :checked should return selected option elements
1213
			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1214
			// IE8 throws error here and will not see later tests
1215
			if ( !div.querySelectorAll(":checked").length ) {
1216
				rbuggyQSA.push(":checked");
1217
			}
1218
1219
			// Support: Safari 8+, iOS 8+
1220
			// https://bugs.webkit.org/show_bug.cgi?id=136851
1221
			// In-page `selector#id sibing-combinator selector` fails
1222
			if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
1223
				rbuggyQSA.push(".#.+[+~]");
1224
			}
1225
		});
1226
1227
		assert(function( div ) {
1228
			// Support: Windows 8 Native Apps
1229
			// The type and name attributes are restricted during .innerHTML assignment
1230
			var input = document.createElement("input");
1231
			input.setAttribute( "type", "hidden" );
1232
			div.appendChild( input ).setAttribute( "name", "D" );
1233
1234
			// Support: IE8
1235
			// Enforce case-sensitivity of name attribute
1236
			if ( div.querySelectorAll("[name=d]").length ) {
1237
				rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1238
			}
1239
1240
			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1241
			// IE8 throws error here and will not see later tests
1242
			if ( !div.querySelectorAll(":enabled").length ) {
1243
				rbuggyQSA.push( ":enabled", ":disabled" );
1244
			}
1245
1246
			// Opera 10-11 does not throw on post-comma invalid pseudos
1247
			div.querySelectorAll("*,:x");
1248
			rbuggyQSA.push(",.*:");
1249
		});
1250
	}
1251
1252
	if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1253
		docElem.webkitMatchesSelector ||
1254
		docElem.mozMatchesSelector ||
1255
		docElem.oMatchesSelector ||
1256
		docElem.msMatchesSelector) )) ) {
1257
1258
		assert(function( div ) {
1259
			// Check to see if it's possible to do matchesSelector
1260
			// on a disconnected node (IE 9)
1261
			support.disconnectedMatch = matches.call( div, "div" );
1262
1263
			// This should fail with an exception
1264
			// Gecko does not error, returns false instead
1265
			matches.call( div, "[s!='']:x" );
1266
			rbuggyMatches.push( "!=", pseudos );
1267
		});
1268
	}
1269
1270
	rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1271
	rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1272
1273
	/* Contains
1274
	---------------------------------------------------------------------- */
1275
	hasCompare = rnative.test( docElem.compareDocumentPosition );
1276
1277
	// Element contains another
1278
	// Purposefully self-exclusive
1279
	// As in, an element does not contain itself
1280
	contains = hasCompare || rnative.test( docElem.contains ) ?
1281
		function( a, b ) {
1282
			var adown = a.nodeType === 9 ? a.documentElement : a,
1283
				bup = b && b.parentNode;
1284
			return a === bup || !!( bup && bup.nodeType === 1 && (
1285
				adown.contains ?
1286
					adown.contains( bup ) :
1287
					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1288
			));
1289
		} :
1290
		function( a, b ) {
1291
			if ( b ) {
1292
				while ( (b = b.parentNode) ) {
1293
					if ( b === a ) {
1294
						return true;
1295
					}
1296
				}
1297
			}
1298
			return false;
1299
		};
1300
1301
	/* Sorting
1302
	---------------------------------------------------------------------- */
1303
1304
	// Document order sorting
1305
	sortOrder = hasCompare ?
1306
	function( a, b ) {
1307
1308
		// Flag for duplicate removal
1309
		if ( a === b ) {
1310
			hasDuplicate = true;
1311
			return 0;
1312
		}
1313
1314
		// Sort on method existence if only one input has compareDocumentPosition
1315
		var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1316
		if ( compare ) {
1317
			return compare;
1318
		}
1319
1320
		// Calculate position if both inputs belong to the same document
1321
		compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1322
			a.compareDocumentPosition( b ) :
1323
1324
			// Otherwise we know they are disconnected
1325
			1;
1326
1327
		// Disconnected nodes
1328
		if ( compare & 1 ||
1329
			(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1330
1331
			// Choose the first element that is related to our preferred document
1332
			if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1333
				return -1;
1334
			}
1335
			if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1336
				return 1;
1337
			}
1338
1339
			// Maintain original order
1340
			return sortInput ?
1341
				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1342
				0;
1343
		}
1344
1345
		return compare & 4 ? -1 : 1;
1346
	} :
1347
	function( a, b ) {
1348
		// Exit early if the nodes are identical
1349
		if ( a === b ) {
1350
			hasDuplicate = true;
1351
			return 0;
1352
		}
1353
1354
		var cur,
1355
			i = 0,
1356
			aup = a.parentNode,
1357
			bup = b.parentNode,
1358
			ap = [ a ],
1359
			bp = [ b ];
1360
1361
		// Parentless nodes are either documents or disconnected
1362
		if ( !aup || !bup ) {
1363
			return a === document ? -1 :
1364
				b === document ? 1 :
1365
				aup ? -1 :
1366
				bup ? 1 :
1367
				sortInput ?
1368
				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1369
				0;
1370
1371
		// If the nodes are siblings, we can do a quick check
1372
		} else if ( aup === bup ) {
1373
			return siblingCheck( a, b );
1374
		}
1375
1376
		// Otherwise we need full lists of their ancestors for comparison
1377
		cur = a;
1378
		while ( (cur = cur.parentNode) ) {
1379
			ap.unshift( cur );
1380
		}
1381
		cur = b;
1382
		while ( (cur = cur.parentNode) ) {
1383
			bp.unshift( cur );
1384
		}
1385
1386
		// Walk down the tree looking for a discrepancy
1387
		while ( ap[i] === bp[i] ) {
1388
			i++;
1389
		}
1390
1391
		return i ?
1392
			// Do a sibling check if the nodes have a common ancestor
1393
			siblingCheck( ap[i], bp[i] ) :
1394
1395
			// Otherwise nodes in our document sort first
1396
			ap[i] === preferredDoc ? -1 :
1397
			bp[i] === preferredDoc ? 1 :
1398
			0;
1399
	};
1400
1401
	return document;
1402
};
1403
1404
Sizzle.matches = function( expr, elements ) {
1405
	return Sizzle( expr, null, null, elements );
1406
};
1407
1408
Sizzle.matchesSelector = function( elem, expr ) {
1409
	// Set document vars if needed
1410
	if ( ( elem.ownerDocument || elem ) !== document ) {
1411
		setDocument( elem );
1412
	}
1413
1414
	// Make sure that attribute selectors are quoted
1415
	expr = expr.replace( rattributeQuotes, "='$1']" );
1416
1417
	if ( support.matchesSelector && documentIsHTML &&
1418
		!compilerCache[ expr + " " ] &&
1419
		( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1420
		( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
1421
1422
		try {
1423
			var ret = matches.call( elem, expr );
1424
1425
			// IE 9's matchesSelector returns false on disconnected nodes
1426
			if ( ret || support.disconnectedMatch ||
1427
					// As well, disconnected nodes are said to be in a document
1428
					// fragment in IE 9
1429
					elem.document && elem.document.nodeType !== 11 ) {
1430
				return ret;
1431
			}
1432
		} catch (e) {}
1433
	}
1434
1435
	return Sizzle( expr, document, null, [ elem ] ).length > 0;
1436
};
1437
1438
Sizzle.contains = function( context, elem ) {
1439
	// Set document vars if needed
1440
	if ( ( context.ownerDocument || context ) !== document ) {
1441
		setDocument( context );
1442
	}
1443
	return contains( context, elem );
1444
};
1445
1446
Sizzle.attr = function( elem, name ) {
1447
	// Set document vars if needed
1448
	if ( ( elem.ownerDocument || elem ) !== document ) {
1449
		setDocument( elem );
1450
	}
1451
1452
	var fn = Expr.attrHandle[ name.toLowerCase() ],
1453
		// Don't get fooled by Object.prototype properties (jQuery #13807)
1454
		val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1455
			fn( elem, name, !documentIsHTML ) :
1456
			undefined;
1457
1458
	return val !== undefined ?
1459
		val :
1460
		support.attributes || !documentIsHTML ?
1461
			elem.getAttribute( name ) :
1462
			(val = elem.getAttributeNode(name)) && val.specified ?
1463
				val.value :
1464
				null;
1465
};
1466
1467
Sizzle.error = function( msg ) {
1468
	throw new Error( "Syntax error, unrecognized expression: " + msg );
1469
};
1470
1471
/**
1472
 * Document sorting and removing duplicates
1473
 * @param {ArrayLike} results
1474
 */
1475
Sizzle.uniqueSort = function( results ) {
1476
	var elem,
1477
		duplicates = [],
1478
		j = 0,
1479
		i = 0;
1480
1481
	// Unless we *know* we can detect duplicates, assume their presence
1482
	hasDuplicate = !support.detectDuplicates;
1483
	sortInput = !support.sortStable && results.slice( 0 );
1484
	results.sort( sortOrder );
1485
1486
	if ( hasDuplicate ) {
1487
		while ( (elem = results[i++]) ) {
1488
			if ( elem === results[ i ] ) {
1489
				j = duplicates.push( i );
1490
			}
1491
		}
1492
		while ( j-- ) {
1493
			results.splice( duplicates[ j ], 1 );
1494
		}
1495
	}
1496
1497
	// Clear input after sorting to release objects
1498
	// See https://github.com/jquery/sizzle/pull/225
1499
	sortInput = null;
1500
1501
	return results;
1502
};
1503
1504
/**
1505
 * Utility function for retrieving the text value of an array of DOM nodes
1506
 * @param {Array|Element} elem
1507
 */
1508
getText = Sizzle.getText = function( elem ) {
1509
	var node,
1510
		ret = "",
1511
		i = 0,
1512
		nodeType = elem.nodeType;
1513
1514
	if ( !nodeType ) {
1515
		// If no nodeType, this is expected to be an array
1516
		while ( (node = elem[i++]) ) {
1517
			// Do not traverse comment nodes
1518
			ret += getText( node );
1519
		}
1520
	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1521
		// Use textContent for elements
1522
		// innerText usage removed for consistency of new lines (jQuery #11153)
1523
		if ( typeof elem.textContent === "string" ) {
1524
			return elem.textContent;
1525
		} else {
1526
			// Traverse its children
1527
			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1528
				ret += getText( elem );
1529
			}
1530
		}
1531
	} else if ( nodeType === 3 || nodeType === 4 ) {
1532
		return elem.nodeValue;
1533
	}
1534
	// Do not include comment or processing instruction nodes
1535
1536
	return ret;
1537
};
1538
1539
Expr = Sizzle.selectors = {
1540
1541
	// Can be adjusted by the user
1542
	cacheLength: 50,
1543
1544
	createPseudo: markFunction,
1545
1546
	match: matchExpr,
1547
1548
	attrHandle: {},
1549
1550
	find: {},
1551
1552
	relative: {
1553
		">": { dir: "parentNode", first: true },
1554
		" ": { dir: "parentNode" },
1555
		"+": { dir: "previousSibling", first: true },
1556
		"~": { dir: "previousSibling" }
1557
	},
1558
1559
	preFilter: {
1560
		"ATTR": function( match ) {
1561
			match[1] = match[1].replace( runescape, funescape );
1562
1563
			// Move the given value to match[3] whether quoted or unquoted
1564
			match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1565
1566
			if ( match[2] === "~=" ) {
1567
				match[3] = " " + match[3] + " ";
1568
			}
1569
1570
			return match.slice( 0, 4 );
1571
		},
1572
1573
		"CHILD": function( match ) {
1574
			/* matches from matchExpr["CHILD"]
1575
				1 type (only|nth|...)
1576
				2 what (child|of-type)
1577
				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1578
				4 xn-component of xn+y argument ([+-]?\d*n|)
1579
				5 sign of xn-component
1580
				6 x of xn-component
1581
				7 sign of y-component
1582
				8 y of y-component
1583
			*/
1584
			match[1] = match[1].toLowerCase();
1585
1586
			if ( match[1].slice( 0, 3 ) === "nth" ) {
1587
				// nth-* requires argument
1588
				if ( !match[3] ) {
1589
					Sizzle.error( match[0] );
1590
				}
1591
1592
				// numeric x and y parameters for Expr.filter.CHILD
1593
				// remember that false/true cast respectively to 0/1
1594
				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1595
				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1596
1597
			// other types prohibit arguments
1598
			} else if ( match[3] ) {
1599
				Sizzle.error( match[0] );
1600
			}
1601
1602
			return match;
1603
		},
1604
1605
		"PSEUDO": function( match ) {
1606
			var excess,
1607
				unquoted = !match[6] && match[2];
1608
1609
			if ( matchExpr["CHILD"].test( match[0] ) ) {
1610
				return null;
1611
			}
1612
1613
			// Accept quoted arguments as-is
1614
			if ( match[3] ) {
1615
				match[2] = match[4] || match[5] || "";
1616
1617
			// Strip excess characters from unquoted arguments
1618
			} else if ( unquoted && rpseudo.test( unquoted ) &&
1619
				// Get excess from tokenize (recursively)
1620
				(excess = tokenize( unquoted, true )) &&
1621
				// advance to the next closing parenthesis
1622
				(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1623
1624
				// excess is a negative index
1625
				match[0] = match[0].slice( 0, excess );
1626
				match[2] = unquoted.slice( 0, excess );
1627
			}
1628
1629
			// Return only captures needed by the pseudo filter method (type and argument)
1630
			return match.slice( 0, 3 );
1631
		}
1632
	},
1633
1634
	filter: {
1635
1636
		"TAG": function( nodeNameSelector ) {
1637
			var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1638
			return nodeNameSelector === "*" ?
1639
				function() { return true; } :
1640
				function( elem ) {
1641
					return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1642
				};
1643
		},
1644
1645
		"CLASS": function( className ) {
1646
			var pattern = classCache[ className + " " ];
1647
1648
			return pattern ||
1649
				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1650
				classCache( className, function( elem ) {
1651
					return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1652
				});
1653
		},
1654
1655
		"ATTR": function( name, operator, check ) {
1656
			return function( elem ) {
1657
				var result = Sizzle.attr( elem, name );
1658
1659
				if ( result == null ) {
1660
					return operator === "!=";
1661
				}
1662
				if ( !operator ) {
1663
					return true;
1664
				}
1665
1666
				result += "";
1667
1668
				return operator === "=" ? result === check :
1669
					operator === "!=" ? result !== check :
1670
					operator === "^=" ? check && result.indexOf( check ) === 0 :
1671
					operator === "*=" ? check && result.indexOf( check ) > -1 :
1672
					operator === "$=" ? check && result.slice( -check.length ) === check :
1673
					operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1674
					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1675
					false;
1676
			};
1677
		},
1678
1679
		"CHILD": function( type, what, argument, first, last ) {
1680
			var simple = type.slice( 0, 3 ) !== "nth",
1681
				forward = type.slice( -4 ) !== "last",
1682
				ofType = what === "of-type";
1683
1684
			return first === 1 && last === 0 ?
1685
1686
				// Shortcut for :nth-*(n)
1687
				function( elem ) {
1688
					return !!elem.parentNode;
1689
				} :
1690
1691
				function( elem, context, xml ) {
1692
					var cache, uniqueCache, outerCache, node, nodeIndex, start,
1693
						dir = simple !== forward ? "nextSibling" : "previousSibling",
1694
						parent = elem.parentNode,
1695
						name = ofType && elem.nodeName.toLowerCase(),
1696
						useCache = !xml && !ofType,
1697
						diff = false;
1698
1699
					if ( parent ) {
1700
1701
						// :(first|last|only)-(child|of-type)
1702
						if ( simple ) {
1703
							while ( dir ) {
1704
								node = elem;
1705
								while ( (node = node[ dir ]) ) {
1706
									if ( ofType ?
1707
										node.nodeName.toLowerCase() === name :
1708
										node.nodeType === 1 ) {
1709
1710
										return false;
1711
									}
1712
								}
1713
								// Reverse direction for :only-* (if we haven't yet done so)
1714
								start = dir = type === "only" && !start && "nextSibling";
1715
							}
1716
							return true;
1717
						}
1718
1719
						start = [ forward ? parent.firstChild : parent.lastChild ];
1720
1721
						// non-xml :nth-child(...) stores cache data on `parent`
1722
						if ( forward && useCache ) {
1723
1724
							// Seek `elem` from a previously-cached index
1725
1726
							// ...in a gzip-friendly way
1727
							node = parent;
1728
							outerCache = node[ expando ] || (node[ expando ] = {});
1729
1730
							// Support: IE <9 only
1731
							// Defend against cloned attroperties (jQuery gh-1709)
1732
							uniqueCache = outerCache[ node.uniqueID ] ||
1733
								(outerCache[ node.uniqueID ] = {});
1734
1735
							cache = uniqueCache[ type ] || [];
1736
							nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1737
							diff = nodeIndex && cache[ 2 ];
1738
							node = nodeIndex && parent.childNodes[ nodeIndex ];
1739
1740
							while ( (node = ++nodeIndex && node && node[ dir ] ||
1741
1742
								// Fallback to seeking `elem` from the start
1743
								(diff = nodeIndex = 0) || start.pop()) ) {
1744
1745
								// When found, cache indexes on `parent` and break
1746
								if ( node.nodeType === 1 && ++diff && node === elem ) {
1747
									uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
1748
									break;
1749
								}
1750
							}
1751
1752
						} else {
1753
							// Use previously-cached element index if available
1754
							if ( useCache ) {
1755
								// ...in a gzip-friendly way
1756
								node = elem;
1757
								outerCache = node[ expando ] || (node[ expando ] = {});
1758
1759
								// Support: IE <9 only
1760
								// Defend against cloned attroperties (jQuery gh-1709)
1761
								uniqueCache = outerCache[ node.uniqueID ] ||
1762
									(outerCache[ node.uniqueID ] = {});
1763
1764
								cache = uniqueCache[ type ] || [];
1765
								nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1766
								diff = nodeIndex;
1767
							}
1768
1769
							// xml :nth-child(...)
1770
							// or :nth-last-child(...) or :nth(-last)?-of-type(...)
1771
							if ( diff === false ) {
1772
								// Use the same loop as above to seek `elem` from the start
1773
								while ( (node = ++nodeIndex && node && node[ dir ] ||
1774
									(diff = nodeIndex = 0) || start.pop()) ) {
1775
1776
									if ( ( ofType ?
1777
										node.nodeName.toLowerCase() === name :
1778
										node.nodeType === 1 ) &&
1779
										++diff ) {
1780
1781
										// Cache the index of each encountered element
1782
										if ( useCache ) {
1783
											outerCache = node[ expando ] || (node[ expando ] = {});
1784
1785
											// Support: IE <9 only
1786
											// Defend against cloned attroperties (jQuery gh-1709)
1787
											uniqueCache = outerCache[ node.uniqueID ] ||
1788
												(outerCache[ node.uniqueID ] = {});
1789
1790
											uniqueCache[ type ] = [ dirruns, diff ];
1791
										}
1792
1793
										if ( node === elem ) {
1794
											break;
1795
										}
1796
									}
1797
								}
1798
							}
1799
						}
1800
1801
						// Incorporate the offset, then check against cycle size
1802
						diff -= last;
1803
						return diff === first || ( diff % first === 0 && diff / first >= 0 );
1804
					}
1805
				};
1806
		},
1807
1808
		"PSEUDO": function( pseudo, argument ) {
1809
			// pseudo-class names are case-insensitive
1810
			// http://www.w3.org/TR/selectors/#pseudo-classes
1811
			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1812
			// Remember that setFilters inherits from pseudos
1813
			var args,
1814
				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1815
					Sizzle.error( "unsupported pseudo: " + pseudo );
1816
1817
			// The user may use createPseudo to indicate that
1818
			// arguments are needed to create the filter function
1819
			// just as Sizzle does
1820
			if ( fn[ expando ] ) {
1821
				return fn( argument );
1822
			}
1823
1824
			// But maintain support for old signatures
1825
			if ( fn.length > 1 ) {
1826
				args = [ pseudo, pseudo, "", argument ];
1827
				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1828
					markFunction(function( seed, matches ) {
1829
						var idx,
1830
							matched = fn( seed, argument ),
1831
							i = matched.length;
1832
						while ( i-- ) {
1833
							idx = indexOf( seed, matched[i] );
1834
							seed[ idx ] = !( matches[ idx ] = matched[i] );
1835
						}
1836
					}) :
1837
					function( elem ) {
1838
						return fn( elem, 0, args );
1839
					};
1840
			}
1841
1842
			return fn;
1843
		}
1844
	},
1845
1846
	pseudos: {
1847
		// Potentially complex pseudos
1848
		"not": markFunction(function( selector ) {
1849
			// Trim the selector passed to compile
1850
			// to avoid treating leading and trailing
1851
			// spaces as combinators
1852
			var input = [],
1853
				results = [],
1854
				matcher = compile( selector.replace( rtrim, "$1" ) );
1855
1856
			return matcher[ expando ] ?
1857
				markFunction(function( seed, matches, context, xml ) {
1858
					var elem,
1859
						unmatched = matcher( seed, null, xml, [] ),
1860
						i = seed.length;
1861
1862
					// Match elements unmatched by `matcher`
1863
					while ( i-- ) {
1864
						if ( (elem = unmatched[i]) ) {
1865
							seed[i] = !(matches[i] = elem);
1866
						}
1867
					}
1868
				}) :
1869
				function( elem, context, xml ) {
1870
					input[0] = elem;
1871
					matcher( input, null, xml, results );
1872
					// Don't keep the element (issue #299)
1873
					input[0] = null;
1874
					return !results.pop();
1875
				};
1876
		}),
1877
1878
		"has": markFunction(function( selector ) {
1879
			return function( elem ) {
1880
				return Sizzle( selector, elem ).length > 0;
1881
			};
1882
		}),
1883
1884
		"contains": markFunction(function( text ) {
1885
			text = text.replace( runescape, funescape );
1886
			return function( elem ) {
1887
				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1888
			};
1889
		}),
1890
1891
		// "Whether an element is represented by a :lang() selector
1892
		// is based solely on the element's language value
1893
		// being equal to the identifier C,
1894
		// or beginning with the identifier C immediately followed by "-".
1895
		// The matching of C against the element's language value is performed case-insensitively.
1896
		// The identifier C does not have to be a valid language name."
1897
		// http://www.w3.org/TR/selectors/#lang-pseudo
1898
		"lang": markFunction( function( lang ) {
1899
			// lang value must be a valid identifier
1900
			if ( !ridentifier.test(lang || "") ) {
1901
				Sizzle.error( "unsupported lang: " + lang );
1902
			}
1903
			lang = lang.replace( runescape, funescape ).toLowerCase();
1904
			return function( elem ) {
1905
				var elemLang;
1906
				do {
1907
					if ( (elemLang = documentIsHTML ?
1908
						elem.lang :
1909
						elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1910
1911
						elemLang = elemLang.toLowerCase();
1912
						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1913
					}
1914
				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1915
				return false;
1916
			};
1917
		}),
1918
1919
		// Miscellaneous
1920
		"target": function( elem ) {
1921
			var hash = window.location && window.location.hash;
1922
			return hash && hash.slice( 1 ) === elem.id;
1923
		},
1924
1925
		"root": function( elem ) {
1926
			return elem === docElem;
1927
		},
1928
1929
		"focus": function( elem ) {
1930
			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1931
		},
1932
1933
		// Boolean properties
1934
		"enabled": function( elem ) {
1935
			return elem.disabled === false;
1936
		},
1937
1938
		"disabled": function( elem ) {
1939
			return elem.disabled === true;
1940
		},
1941
1942
		"checked": function( elem ) {
1943
			// In CSS3, :checked should return both checked and selected elements
1944
			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1945
			var nodeName = elem.nodeName.toLowerCase();
1946
			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1947
		},
1948
1949
		"selected": function( elem ) {
1950
			// Accessing this property makes selected-by-default
1951
			// options in Safari work properly
1952
			if ( elem.parentNode ) {
1953
				elem.parentNode.selectedIndex;
1954
			}
1955
1956
			return elem.selected === true;
1957
		},
1958
1959
		// Contents
1960
		"empty": function( elem ) {
1961
			// http://www.w3.org/TR/selectors/#empty-pseudo
1962
			// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1963
			//   but not by others (comment: 8; processing instruction: 7; etc.)
1964
			// nodeType < 6 works because attributes (2) do not appear as children
1965
			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1966
				if ( elem.nodeType < 6 ) {
1967
					return false;
1968
				}
1969
			}
1970
			return true;
1971
		},
1972
1973
		"parent": function( elem ) {
1974
			return !Expr.pseudos["empty"]( elem );
1975
		},
1976
1977
		// Element/input types
1978
		"header": function( elem ) {
1979
			return rheader.test( elem.nodeName );
1980
		},
1981
1982
		"input": function( elem ) {
1983
			return rinputs.test( elem.nodeName );
1984
		},
1985
1986
		"button": function( elem ) {
1987
			var name = elem.nodeName.toLowerCase();
1988
			return name === "input" && elem.type === "button" || name === "button";
1989
		},
1990
1991
		"text": function( elem ) {
1992
			var attr;
1993
			return elem.nodeName.toLowerCase() === "input" &&
1994
				elem.type === "text" &&
1995
1996
				// Support: IE<8
1997
				// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1998
				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1999
		},
2000
2001
		// Position-in-collection
2002
		"first": createPositionalPseudo(function() {
2003
			return [ 0 ];
2004
		}),
2005
2006
		"last": createPositionalPseudo(function( matchIndexes, length ) {
2007
			return [ length - 1 ];
2008
		}),
2009
2010
		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2011
			return [ argument < 0 ? argument + length : argument ];
2012
		}),
2013
2014
		"even": createPositionalPseudo(function( matchIndexes, length ) {
2015
			var i = 0;
2016
			for ( ; i < length; i += 2 ) {
2017
				matchIndexes.push( i );
2018
			}
2019
			return matchIndexes;
2020
		}),
2021
2022
		"odd": createPositionalPseudo(function( matchIndexes, length ) {
2023
			var i = 1;
2024
			for ( ; i < length; i += 2 ) {
2025
				matchIndexes.push( i );
2026
			}
2027
			return matchIndexes;
2028
		}),
2029
2030
		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2031
			var i = argument < 0 ? argument + length : argument;
2032
			for ( ; --i >= 0; ) {
2033
				matchIndexes.push( i );
2034
			}
2035
			return matchIndexes;
2036
		}),
2037
2038
		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2039
			var i = argument < 0 ? argument + length : argument;
2040
			for ( ; ++i < length; ) {
2041
				matchIndexes.push( i );
2042
			}
2043
			return matchIndexes;
2044
		})
2045
	}
2046
};
2047
2048
Expr.pseudos["nth"] = Expr.pseudos["eq"];
2049
2050
// Add button/input type pseudos
2051
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2052
	Expr.pseudos[ i ] = createInputPseudo( i );
2053
}
2054
for ( i in { submit: true, reset: true } ) {
2055
	Expr.pseudos[ i ] = createButtonPseudo( i );
2056
}
2057
2058
// Easy API for creating new setFilters
2059
function setFilters() {}
2060
setFilters.prototype = Expr.filters = Expr.pseudos;
2061
Expr.setFilters = new setFilters();
2062
2063
tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2064
	var matched, match, tokens, type,
2065
		soFar, groups, preFilters,
2066
		cached = tokenCache[ selector + " " ];
2067
2068
	if ( cached ) {
2069
		return parseOnly ? 0 : cached.slice( 0 );
2070
	}
2071
2072
	soFar = selector;
2073
	groups = [];
2074
	preFilters = Expr.preFilter;
2075
2076
	while ( soFar ) {
2077
2078
		// Comma and first run
2079
		if ( !matched || (match = rcomma.exec( soFar )) ) {
2080
			if ( match ) {
2081
				// Don't consume trailing commas as valid
2082
				soFar = soFar.slice( match[0].length ) || soFar;
2083
			}
2084
			groups.push( (tokens = []) );
2085
		}
2086
2087
		matched = false;
2088
2089
		// Combinators
2090
		if ( (match = rcombinators.exec( soFar )) ) {
2091
			matched = match.shift();
2092
			tokens.push({
2093
				value: matched,
2094
				// Cast descendant combinators to space
2095
				type: match[0].replace( rtrim, " " )
2096
			});
2097
			soFar = soFar.slice( matched.length );
2098
		}
2099
2100
		// Filters
2101
		for ( type in Expr.filter ) {
2102
			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2103
				(match = preFilters[ type ]( match ))) ) {
2104
				matched = match.shift();
2105
				tokens.push({
2106
					value: matched,
2107
					type: type,
2108
					matches: match
2109
				});
2110
				soFar = soFar.slice( matched.length );
2111
			}
2112
		}
2113
2114
		if ( !matched ) {
2115
			break;
2116
		}
2117
	}
2118
2119
	// Return the length of the invalid excess
2120
	// if we're just parsing
2121
	// Otherwise, throw an error or return tokens
2122
	return parseOnly ?
2123
		soFar.length :
2124
		soFar ?
2125
			Sizzle.error( selector ) :
2126
			// Cache the tokens
2127
			tokenCache( selector, groups ).slice( 0 );
2128
};
2129
2130
function toSelector( tokens ) {
2131
	var i = 0,
2132
		len = tokens.length,
2133
		selector = "";
2134
	for ( ; i < len; i++ ) {
2135
		selector += tokens[i].value;
2136
	}
2137
	return selector;
2138
}
2139
2140
function addCombinator( matcher, combinator, base ) {
2141
	var dir = combinator.dir,
2142
		checkNonElements = base && dir === "parentNode",
2143
		doneName = done++;
2144
2145
	return combinator.first ?
2146
		// Check against closest ancestor/preceding element
2147
		function( elem, context, xml ) {
2148
			while ( (elem = elem[ dir ]) ) {
2149
				if ( elem.nodeType === 1 || checkNonElements ) {
2150
					return matcher( elem, context, xml );
2151
				}
2152
			}
2153
		} :
2154
2155
		// Check against all ancestor/preceding elements
2156
		function( elem, context, xml ) {
2157
			var oldCache, uniqueCache, outerCache,
2158
				newCache = [ dirruns, doneName ];
2159
2160
			// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2161
			if ( xml ) {
2162
				while ( (elem = elem[ dir ]) ) {
2163
					if ( elem.nodeType === 1 || checkNonElements ) {
2164
						if ( matcher( elem, context, xml ) ) {
2165
							return true;
2166
						}
2167
					}
2168
				}
2169
			} else {
2170
				while ( (elem = elem[ dir ]) ) {
2171
					if ( elem.nodeType === 1 || checkNonElements ) {
2172
						outerCache = elem[ expando ] || (elem[ expando ] = {});
2173
2174
						// Support: IE <9 only
2175
						// Defend against cloned attroperties (jQuery gh-1709)
2176
						uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
2177
2178
						if ( (oldCache = uniqueCache[ dir ]) &&
2179
							oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2180
2181
							// Assign to newCache so results back-propagate to previous elements
2182
							return (newCache[ 2 ] = oldCache[ 2 ]);
2183
						} else {
2184
							// Reuse newcache so results back-propagate to previous elements
2185
							uniqueCache[ dir ] = newCache;
2186
2187
							// A match means we're done; a fail means we have to keep checking
2188
							if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2189
								return true;
2190
							}
2191
						}
2192
					}
2193
				}
2194
			}
2195
		};
2196
}
2197
2198
function elementMatcher( matchers ) {
2199
	return matchers.length > 1 ?
2200
		function( elem, context, xml ) {
2201
			var i = matchers.length;
2202
			while ( i-- ) {
2203
				if ( !matchers[i]( elem, context, xml ) ) {
2204
					return false;
2205
				}
2206
			}
2207
			return true;
2208
		} :
2209
		matchers[0];
2210
}
2211
2212
function multipleContexts( selector, contexts, results ) {
2213
	var i = 0,
2214
		len = contexts.length;
2215
	for ( ; i < len; i++ ) {
2216
		Sizzle( selector, contexts[i], results );
2217
	}
2218
	return results;
2219
}
2220
2221
function condense( unmatched, map, filter, context, xml ) {
2222
	var elem,
2223
		newUnmatched = [],
2224
		i = 0,
2225
		len = unmatched.length,
2226
		mapped = map != null;
2227
2228
	for ( ; i < len; i++ ) {
2229
		if ( (elem = unmatched[i]) ) {
2230
			if ( !filter || filter( elem, context, xml ) ) {
2231
				newUnmatched.push( elem );
2232
				if ( mapped ) {
2233
					map.push( i );
2234
				}
2235
			}
2236
		}
2237
	}
2238
2239
	return newUnmatched;
2240
}
2241
2242
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2243
	if ( postFilter && !postFilter[ expando ] ) {
2244
		postFilter = setMatcher( postFilter );
2245
	}
2246
	if ( postFinder && !postFinder[ expando ] ) {
2247
		postFinder = setMatcher( postFinder, postSelector );
2248
	}
2249
	return markFunction(function( seed, results, context, xml ) {
2250
		var temp, i, elem,
2251
			preMap = [],
2252
			postMap = [],
2253
			preexisting = results.length,
2254
2255
			// Get initial elements from seed or context
2256
			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2257
2258
			// Prefilter to get matcher input, preserving a map for seed-results synchronization
2259
			matcherIn = preFilter && ( seed || !selector ) ?
2260
				condense( elems, preMap, preFilter, context, xml ) :
2261
				elems,
2262
2263
			matcherOut = matcher ?
2264
				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2265
				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2266
2267
					// ...intermediate processing is necessary
2268
					[] :
2269
2270
					// ...otherwise use results directly
2271
					results :
2272
				matcherIn;
2273
2274
		// Find primary matches
2275
		if ( matcher ) {
2276
			matcher( matcherIn, matcherOut, context, xml );
2277
		}
2278
2279
		// Apply postFilter
2280
		if ( postFilter ) {
2281
			temp = condense( matcherOut, postMap );
2282
			postFilter( temp, [], context, xml );
2283
2284
			// Un-match failing elements by moving them back to matcherIn
2285
			i = temp.length;
2286
			while ( i-- ) {
2287
				if ( (elem = temp[i]) ) {
2288
					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2289
				}
2290
			}
2291
		}
2292
2293
		if ( seed ) {
2294
			if ( postFinder || preFilter ) {
2295
				if ( postFinder ) {
2296
					// Get the final matcherOut by condensing this intermediate into postFinder contexts
2297
					temp = [];
2298
					i = matcherOut.length;
2299
					while ( i-- ) {
2300
						if ( (elem = matcherOut[i]) ) {
2301
							// Restore matcherIn since elem is not yet a final match
2302
							temp.push( (matcherIn[i] = elem) );
2303
						}
2304
					}
2305
					postFinder( null, (matcherOut = []), temp, xml );
2306
				}
2307
2308
				// Move matched elements from seed to results to keep them synchronized
2309
				i = matcherOut.length;
2310
				while ( i-- ) {
2311
					if ( (elem = matcherOut[i]) &&
2312
						(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2313
2314
						seed[temp] = !(results[temp] = elem);
2315
					}
2316
				}
2317
			}
2318
2319
		// Add elements to results, through postFinder if defined
2320
		} else {
2321
			matcherOut = condense(
2322
				matcherOut === results ?
2323
					matcherOut.splice( preexisting, matcherOut.length ) :
2324
					matcherOut
2325
			);
2326
			if ( postFinder ) {
2327
				postFinder( null, results, matcherOut, xml );
2328
			} else {
2329
				push.apply( results, matcherOut );
2330
			}
2331
		}
2332
	});
2333
}
2334
2335
function matcherFromTokens( tokens ) {
2336
	var checkContext, matcher, j,
2337
		len = tokens.length,
2338
		leadingRelative = Expr.relative[ tokens[0].type ],
2339
		implicitRelative = leadingRelative || Expr.relative[" "],
2340
		i = leadingRelative ? 1 : 0,
2341
2342
		// The foundational matcher ensures that elements are reachable from top-level context(s)
2343
		matchContext = addCombinator( function( elem ) {
2344
			return elem === checkContext;
2345
		}, implicitRelative, true ),
2346
		matchAnyContext = addCombinator( function( elem ) {
2347
			return indexOf( checkContext, elem ) > -1;
2348
		}, implicitRelative, true ),
2349
		matchers = [ function( elem, context, xml ) {
2350
			var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2351
				(checkContext = context).nodeType ?
2352
					matchContext( elem, context, xml ) :
2353
					matchAnyContext( elem, context, xml ) );
2354
			// Avoid hanging onto element (issue #299)
2355
			checkContext = null;
2356
			return ret;
2357
		} ];
2358
2359
	for ( ; i < len; i++ ) {
2360
		if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2361
			matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2362
		} else {
2363
			matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2364
2365
			// Return special upon seeing a positional matcher
2366
			if ( matcher[ expando ] ) {
2367
				// Find the next relative operator (if any) for proper handling
2368
				j = ++i;
2369
				for ( ; j < len; j++ ) {
2370
					if ( Expr.relative[ tokens[j].type ] ) {
2371
						break;
2372
					}
2373
				}
2374
				return setMatcher(
2375
					i > 1 && elementMatcher( matchers ),
2376
					i > 1 && toSelector(
2377
						// If the preceding token was a descendant combinator, insert an implicit any-element `*`
2378
						tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2379
					).replace( rtrim, "$1" ),
2380
					matcher,
2381
					i < j && matcherFromTokens( tokens.slice( i, j ) ),
2382
					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2383
					j < len && toSelector( tokens )
2384
				);
2385
			}
2386
			matchers.push( matcher );
2387
		}
2388
	}
2389
2390
	return elementMatcher( matchers );
2391
}
2392
2393
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2394
	var bySet = setMatchers.length > 0,
2395
		byElement = elementMatchers.length > 0,
2396
		superMatcher = function( seed, context, xml, results, outermost ) {
2397
			var elem, j, matcher,
2398
				matchedCount = 0,
2399
				i = "0",
2400
				unmatched = seed && [],
2401
				setMatched = [],
2402
				contextBackup = outermostContext,
2403
				// We must always have either seed elements or outermost context
2404
				elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2405
				// Use integer dirruns iff this is the outermost matcher
2406
				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2407
				len = elems.length;
2408
2409
			if ( outermost ) {
2410
				outermostContext = context === document || context || outermost;
2411
			}
2412
2413
			// Add elements passing elementMatchers directly to results
2414
			// Support: IE<9, Safari
2415
			// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2416
			for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2417
				if ( byElement && elem ) {
2418
					j = 0;
2419
					if ( !context && elem.ownerDocument !== document ) {
2420
						setDocument( elem );
2421
						xml = !documentIsHTML;
2422
					}
2423
					while ( (matcher = elementMatchers[j++]) ) {
2424
						if ( matcher( elem, context || document, xml) ) {
2425
							results.push( elem );
2426
							break;
2427
						}
2428
					}
2429
					if ( outermost ) {
2430
						dirruns = dirrunsUnique;
2431
					}
2432
				}
2433
2434
				// Track unmatched elements for set filters
2435
				if ( bySet ) {
2436
					// They will have gone through all possible matchers
2437
					if ( (elem = !matcher && elem) ) {
2438
						matchedCount--;
2439
					}
2440
2441
					// Lengthen the array for every element, matched or not
2442
					if ( seed ) {
2443
						unmatched.push( elem );
2444
					}
2445
				}
2446
			}
2447
2448
			// `i` is now the count of elements visited above, and adding it to `matchedCount`
2449
			// makes the latter nonnegative.
2450
			matchedCount += i;
2451
2452
			// Apply set filters to unmatched elements
2453
			// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
2454
			// equals `i`), unless we didn't visit _any_ elements in the above loop because we have
2455
			// no element matchers and no seed.
2456
			// Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
2457
			// case, which will result in a "00" `matchedCount` that differs from `i` but is also
2458
			// numerically zero.
2459
			if ( bySet && i !== matchedCount ) {
2460
				j = 0;
2461
				while ( (matcher = setMatchers[j++]) ) {
2462
					matcher( unmatched, setMatched, context, xml );
2463
				}
2464
2465
				if ( seed ) {
2466
					// Reintegrate element matches to eliminate the need for sorting
2467
					if ( matchedCount > 0 ) {
2468
						while ( i-- ) {
2469
							if ( !(unmatched[i] || setMatched[i]) ) {
2470
								setMatched[i] = pop.call( results );
2471
							}
2472
						}
2473
					}
2474
2475
					// Discard index placeholder values to get only actual matches
2476
					setMatched = condense( setMatched );
2477
				}
2478
2479
				// Add matches to results
2480
				push.apply( results, setMatched );
2481
2482
				// Seedless set matches succeeding multiple successful matchers stipulate sorting
2483
				if ( outermost && !seed && setMatched.length > 0 &&
2484
					( matchedCount + setMatchers.length ) > 1 ) {
2485
2486
					Sizzle.uniqueSort( results );
2487
				}
2488
			}
2489
2490
			// Override manipulation of globals by nested matchers
2491
			if ( outermost ) {
2492
				dirruns = dirrunsUnique;
2493
				outermostContext = contextBackup;
2494
			}
2495
2496
			return unmatched;
2497
		};
2498
2499
	return bySet ?
2500
		markFunction( superMatcher ) :
2501
		superMatcher;
2502
}
2503
2504
compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2505
	var i,
2506
		setMatchers = [],
2507
		elementMatchers = [],
2508
		cached = compilerCache[ selector + " " ];
2509
2510
	if ( !cached ) {
2511
		// Generate a function of recursive functions that can be used to check each element
2512
		if ( !match ) {
2513
			match = tokenize( selector );
2514
		}
2515
		i = match.length;
2516
		while ( i-- ) {
2517
			cached = matcherFromTokens( match[i] );
2518
			if ( cached[ expando ] ) {
2519
				setMatchers.push( cached );
2520
			} else {
2521
				elementMatchers.push( cached );
2522
			}
2523
		}
2524
2525
		// Cache the compiled function
2526
		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2527
2528
		// Save selector and tokenization
2529
		cached.selector = selector;
2530
	}
2531
	return cached;
2532
};
2533
2534
/**
2535
 * A low-level selection function that works with Sizzle's compiled
2536
 *  selector functions
2537
 * @param {String|Function} selector A selector or a pre-compiled
2538
 *  selector function built with Sizzle.compile
2539
 * @param {Element} context
2540
 * @param {Array} [results]
2541
 * @param {Array} [seed] A set of elements to match against
2542
 */
2543
select = Sizzle.select = function( selector, context, results, seed ) {
2544
	var i, tokens, token, type, find,
2545
		compiled = typeof selector === "function" && selector,
2546
		match = !seed && tokenize( (selector = compiled.selector || selector) );
2547
2548
	results = results || [];
2549
2550
	// Try to minimize operations if there is only one selector in the list and no seed
2551
	// (the latter of which guarantees us context)
2552
	if ( match.length === 1 ) {
2553
2554
		// Reduce context if the leading compound selector is an ID
2555
		tokens = match[0] = match[0].slice( 0 );
2556
		if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2557
				support.getById && context.nodeType === 9 && documentIsHTML &&
2558
				Expr.relative[ tokens[1].type ] ) {
2559
2560
			context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2561
			if ( !context ) {
2562
				return results;
2563
2564
			// Precompiled matchers will still verify ancestry, so step up a level
2565
			} else if ( compiled ) {
2566
				context = context.parentNode;
2567
			}
2568
2569
			selector = selector.slice( tokens.shift().value.length );
2570
		}
2571
2572
		// Fetch a seed set for right-to-left matching
2573
		i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2574
		while ( i-- ) {
2575
			token = tokens[i];
2576
2577
			// Abort if we hit a combinator
2578
			if ( Expr.relative[ (type = token.type) ] ) {
2579
				break;
2580
			}
2581
			if ( (find = Expr.find[ type ]) ) {
2582
				// Search, expanding context for leading sibling combinators
2583
				if ( (seed = find(
2584
					token.matches[0].replace( runescape, funescape ),
2585
					rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2586
				)) ) {
2587
2588
					// If seed is empty or no tokens remain, we can return early
2589
					tokens.splice( i, 1 );
2590
					selector = seed.length && toSelector( tokens );
2591
					if ( !selector ) {
2592
						push.apply( results, seed );
2593
						return results;
2594
					}
2595
2596
					break;
2597
				}
2598
			}
2599
		}
2600
	}
2601
2602
	// Compile and execute a filtering function if one is not provided
2603
	// Provide `match` to avoid retokenization if we modified the selector above
2604
	( compiled || compile( selector, match ) )(
2605
		seed,
2606
		context,
2607
		!documentIsHTML,
2608
		results,
2609
		!context || rsibling.test( selector ) && testContext( context.parentNode ) || context
2610
	);
2611
	return results;
2612
};
2613
2614
// One-time assignments
2615
2616
// Sort stability
2617
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2618
2619
// Support: Chrome 14-35+
2620
// Always assume duplicates if they aren't passed to the comparison function
2621
support.detectDuplicates = !!hasDuplicate;
2622
2623
// Initialize against the default document
2624
setDocument();
2625
2626
// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2627
// Detached nodes confoundingly follow *each other*
2628
support.sortDetached = assert(function( div1 ) {
2629
	// Should return 1, but returns 4 (following)
2630
	return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2631
});
2632
2633
// Support: IE<8
2634
// Prevent attribute/property "interpolation"
2635
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2636
if ( !assert(function( div ) {
2637
	div.innerHTML = "<a href='#'></a>";
2638
	return div.firstChild.getAttribute("href") === "#" ;
2639
}) ) {
2640
	addHandle( "type|href|height|width", function( elem, name, isXML ) {
2641
		if ( !isXML ) {
2642
			return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2643
		}
2644
	});
2645
}
2646
2647
// Support: IE<9
2648
// Use defaultValue in place of getAttribute("value")
2649
if ( !support.attributes || !assert(function( div ) {
2650
	div.innerHTML = "<input/>";
2651
	div.firstChild.setAttribute( "value", "" );
2652
	return div.firstChild.getAttribute( "value" ) === "";
2653
}) ) {
2654
	addHandle( "value", function( elem, name, isXML ) {
2655
		if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2656
			return elem.defaultValue;
2657
		}
2658
	});
2659
}
2660
2661
// Support: IE<9
2662
// Use getAttributeNode to fetch booleans when getAttribute lies
2663
if ( !assert(function( div ) {
2664
	return div.getAttribute("disabled") == null;
2665
}) ) {
2666
	addHandle( booleans, function( elem, name, isXML ) {
2667
		var val;
2668
		if ( !isXML ) {
2669
			return elem[ name ] === true ? name.toLowerCase() :
2670
					(val = elem.getAttributeNode( name )) && val.specified ?
2671
					val.value :
2672
				null;
2673
		}
2674
	});
2675
}
2676
2677
return Sizzle;
2678
2679
})( window );
2680
2681
2682
2683
jQuery.find = Sizzle;
2684
jQuery.expr = Sizzle.selectors;
2685
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
2686
jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
2687
jQuery.text = Sizzle.getText;
2688
jQuery.isXMLDoc = Sizzle.isXML;
2689
jQuery.contains = Sizzle.contains;
2690
2691
2692
2693
var dir = function( elem, dir, until ) {
2694
	var matched = [],
2695
		truncate = until !== undefined;
2696
2697
	while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
2698
		if ( elem.nodeType === 1 ) {
2699
			if ( truncate && jQuery( elem ).is( until ) ) {
2700
				break;
2701
			}
2702
			matched.push( elem );
2703
		}
2704
	}
2705
	return matched;
2706
};
2707
2708
2709
var siblings = function( n, elem ) {
2710
	var matched = [];
2711
2712
	for ( ; n; n = n.nextSibling ) {
2713
		if ( n.nodeType === 1 && n !== elem ) {
2714
			matched.push( n );
2715
		}
2716
	}
2717
2718
	return matched;
2719
};
2720
2721
2722
var rneedsContext = jQuery.expr.match.needsContext;
2723
2724
var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
2725
2726
2727
2728
var risSimple = /^.[^:#\[\.,]*$/;
2729
2730
// Implement the identical functionality for filter and not
2731
function winnow( elements, qualifier, not ) {
2732
	if ( jQuery.isFunction( qualifier ) ) {
2733
		return jQuery.grep( elements, function( elem, i ) {
2734
			/* jshint -W018 */
2735
			return !!qualifier.call( elem, i, elem ) !== not;
2736
		} );
2737
2738
	}
2739
2740
	if ( qualifier.nodeType ) {
2741
		return jQuery.grep( elements, function( elem ) {
2742
			return ( elem === qualifier ) !== not;
2743
		} );
2744
2745
	}
2746
2747
	if ( typeof qualifier === "string" ) {
2748
		if ( risSimple.test( qualifier ) ) {
2749
			return jQuery.filter( qualifier, elements, not );
2750
		}
2751
2752
		qualifier = jQuery.filter( qualifier, elements );
2753
	}
2754
2755
	return jQuery.grep( elements, function( elem ) {
2756
		return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
2757
	} );
2758
}
2759
2760
jQuery.filter = function( expr, elems, not ) {
2761
	var elem = elems[ 0 ];
2762
2763
	if ( not ) {
2764
		expr = ":not(" + expr + ")";
2765
	}
2766
2767
	return elems.length === 1 && elem.nodeType === 1 ?
2768
		jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2769
		jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2770
			return elem.nodeType === 1;
2771
		} ) );
2772
};
2773
2774
jQuery.fn.extend( {
2775
	find: function( selector ) {
2776
		var i,
2777
			len = this.length,
2778
			ret = [],
2779
			self = this;
2780
2781
		if ( typeof selector !== "string" ) {
2782
			return this.pushStack( jQuery( selector ).filter( function() {
2783
				for ( i = 0; i < len; i++ ) {
2784
					if ( jQuery.contains( self[ i ], this ) ) {
2785
						return true;
2786
					}
2787
				}
2788
			} ) );
2789
		}
2790
2791
		for ( i = 0; i < len; i++ ) {
2792
			jQuery.find( selector, self[ i ], ret );
2793
		}
2794
2795
		// Needed because $( selector, context ) becomes $( context ).find( selector )
2796
		ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2797
		ret.selector = this.selector ? this.selector + " " + selector : selector;
2798
		return ret;
2799
	},
2800
	filter: function( selector ) {
2801
		return this.pushStack( winnow( this, selector || [], false ) );
2802
	},
2803
	not: function( selector ) {
2804
		return this.pushStack( winnow( this, selector || [], true ) );
2805
	},
2806
	is: function( selector ) {
2807
		return !!winnow(
2808
			this,
2809
2810
			// If this is a positional/relative selector, check membership in the returned set
2811
			// so $("p:first").is("p:last") won't return true for a doc with two "p".
2812
			typeof selector === "string" && rneedsContext.test( selector ) ?
2813
				jQuery( selector ) :
2814
				selector || [],
2815
			false
2816
		).length;
2817
	}
2818
} );
2819
2820
2821
// Initialize a jQuery object
2822
2823
2824
// A central reference to the root jQuery(document)
2825
var rootjQuery,
2826
2827
	// A simple way to check for HTML strings
2828
	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2829
	// Strict HTML recognition (#11290: must start with <)
2830
	rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2831
2832
	init = jQuery.fn.init = function( selector, context, root ) {
2833
		var match, elem;
2834
2835
		// HANDLE: $(""), $(null), $(undefined), $(false)
2836
		if ( !selector ) {
2837
			return this;
2838
		}
2839
2840
		// Method init() accepts an alternate rootjQuery
2841
		// so migrate can support jQuery.sub (gh-2101)
2842
		root = root || rootjQuery;
2843
2844
		// Handle HTML strings
2845
		if ( typeof selector === "string" ) {
2846
			if ( selector[ 0 ] === "<" &&
2847
				selector[ selector.length - 1 ] === ">" &&
2848
				selector.length >= 3 ) {
2849
2850
				// Assume that strings that start and end with <> are HTML and skip the regex check
2851
				match = [ null, selector, null ];
2852
2853
			} else {
2854
				match = rquickExpr.exec( selector );
2855
			}
2856
2857
			// Match html or make sure no context is specified for #id
2858
			if ( match && ( match[ 1 ] || !context ) ) {
2859
2860
				// HANDLE: $(html) -> $(array)
2861
				if ( match[ 1 ] ) {
2862
					context = context instanceof jQuery ? context[ 0 ] : context;
2863
2864
					// Option to run scripts is true for back-compat
2865
					// Intentionally let the error be thrown if parseHTML is not present
2866
					jQuery.merge( this, jQuery.parseHTML(
2867
						match[ 1 ],
2868
						context && context.nodeType ? context.ownerDocument || context : document,
2869
						true
2870
					) );
2871
2872
					// HANDLE: $(html, props)
2873
					if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
2874
						for ( match in context ) {
2875
2876
							// Properties of context are called as methods if possible
2877
							if ( jQuery.isFunction( this[ match ] ) ) {
2878
								this[ match ]( context[ match ] );
2879
2880
							// ...and otherwise set as attributes
2881
							} else {
2882
								this.attr( match, context[ match ] );
2883
							}
2884
						}
2885
					}
2886
2887
					return this;
2888
2889
				// HANDLE: $(#id)
2890
				} else {
2891
					elem = document.getElementById( match[ 2 ] );
2892
2893
					// Support: Blackberry 4.6
2894
					// gEBID returns nodes no longer in the document (#6963)
2895
					if ( elem && elem.parentNode ) {
2896
2897
						// Inject the element directly into the jQuery object
2898
						this.length = 1;
2899
						this[ 0 ] = elem;
2900
					}
2901
2902
					this.context = document;
2903
					this.selector = selector;
2904
					return this;
2905
				}
2906
2907
			// HANDLE: $(expr, $(...))
2908
			} else if ( !context || context.jquery ) {
2909
				return ( context || root ).find( selector );
2910
2911
			// HANDLE: $(expr, context)
2912
			// (which is just equivalent to: $(context).find(expr)
2913
			} else {
2914
				return this.constructor( context ).find( selector );
2915
			}
2916
2917
		// HANDLE: $(DOMElement)
2918
		} else if ( selector.nodeType ) {
2919
			this.context = this[ 0 ] = selector;
2920
			this.length = 1;
2921
			return this;
2922
2923
		// HANDLE: $(function)
2924
		// Shortcut for document ready
2925
		} else if ( jQuery.isFunction( selector ) ) {
2926
			return root.ready !== undefined ?
2927
				root.ready( selector ) :
2928
2929
				// Execute immediately if ready is not present
2930
				selector( jQuery );
2931
		}
2932
2933
		if ( selector.selector !== undefined ) {
2934
			this.selector = selector.selector;
2935
			this.context = selector.context;
2936
		}
2937
2938
		return jQuery.makeArray( selector, this );
2939
	};
2940
2941
// Give the init function the jQuery prototype for later instantiation
2942
init.prototype = jQuery.fn;
2943
2944
// Initialize central reference
2945
rootjQuery = jQuery( document );
2946
2947
2948
var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2949
2950
	// Methods guaranteed to produce a unique set when starting from a unique set
2951
	guaranteedUnique = {
2952
		children: true,
2953
		contents: true,
2954
		next: true,
2955
		prev: true
2956
	};
2957
2958
jQuery.fn.extend( {
2959
	has: function( target ) {
2960
		var targets = jQuery( target, this ),
2961
			l = targets.length;
2962
2963
		return this.filter( function() {
2964
			var i = 0;
2965
			for ( ; i < l; i++ ) {
2966
				if ( jQuery.contains( this, targets[ i ] ) ) {
2967
					return true;
2968
				}
2969
			}
2970
		} );
2971
	},
2972
2973
	closest: function( selectors, context ) {
2974
		var cur,
2975
			i = 0,
2976
			l = this.length,
2977
			matched = [],
2978
			pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
2979
				jQuery( selectors, context || this.context ) :
2980
				0;
2981
2982
		for ( ; i < l; i++ ) {
2983
			for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
2984
2985
				// Always skip document fragments
2986
				if ( cur.nodeType < 11 && ( pos ?
2987
					pos.index( cur ) > -1 :
2988
2989
					// Don't pass non-elements to Sizzle
2990
					cur.nodeType === 1 &&
2991
						jQuery.find.matchesSelector( cur, selectors ) ) ) {
2992
2993
					matched.push( cur );
2994
					break;
2995
				}
2996
			}
2997
		}
2998
2999
		return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
3000
	},
3001
3002
	// Determine the position of an element within the set
3003
	index: function( elem ) {
3004
3005
		// No argument, return index in parent
3006
		if ( !elem ) {
3007
			return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
3008
		}
3009
3010
		// Index in selector
3011
		if ( typeof elem === "string" ) {
3012
			return indexOf.call( jQuery( elem ), this[ 0 ] );
3013
		}
3014
3015
		// Locate the position of the desired element
3016
		return indexOf.call( this,
3017
3018
			// If it receives a jQuery object, the first element is used
3019
			elem.jquery ? elem[ 0 ] : elem
3020
		);
3021
	},
3022
3023
	add: function( selector, context ) {
3024
		return this.pushStack(
3025
			jQuery.uniqueSort(
3026
				jQuery.merge( this.get(), jQuery( selector, context ) )
3027
			)
3028
		);
3029
	},
3030
3031
	addBack: function( selector ) {
3032
		return this.add( selector == null ?
3033
			this.prevObject : this.prevObject.filter( selector )
3034
		);
3035
	}
3036
} );
3037
3038
function sibling( cur, dir ) {
3039
	while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
3040
	return cur;
3041
}
3042
3043
jQuery.each( {
3044
	parent: function( elem ) {
3045
		var parent = elem.parentNode;
3046
		return parent && parent.nodeType !== 11 ? parent : null;
3047
	},
3048
	parents: function( elem ) {
3049
		return dir( elem, "parentNode" );
3050
	},
3051
	parentsUntil: function( elem, i, until ) {
3052
		return dir( elem, "parentNode", until );
3053
	},
3054
	next: function( elem ) {
3055
		return sibling( elem, "nextSibling" );
3056
	},
3057
	prev: function( elem ) {
3058
		return sibling( elem, "previousSibling" );
3059
	},
3060
	nextAll: function( elem ) {
3061
		return dir( elem, "nextSibling" );
3062
	},
3063
	prevAll: function( elem ) {
3064
		return dir( elem, "previousSibling" );
3065
	},
3066
	nextUntil: function( elem, i, until ) {
3067
		return dir( elem, "nextSibling", until );
3068
	},
3069
	prevUntil: function( elem, i, until ) {
3070
		return dir( elem, "previousSibling", until );
3071
	},
3072
	siblings: function( elem ) {
3073
		return siblings( ( elem.parentNode || {} ).firstChild, elem );
3074
	},
3075
	children: function( elem ) {
3076
		return siblings( elem.firstChild );
3077
	},
3078
	contents: function( elem ) {
3079
		return elem.contentDocument || jQuery.merge( [], elem.childNodes );
3080
	}
3081
}, function( name, fn ) {
3082
	jQuery.fn[ name ] = function( until, selector ) {
3083
		var matched = jQuery.map( this, fn, until );
3084
3085
		if ( name.slice( -5 ) !== "Until" ) {
3086
			selector = until;
3087
		}
3088
3089
		if ( selector && typeof selector === "string" ) {
3090
			matched = jQuery.filter( selector, matched );
3091
		}
3092
3093
		if ( this.length > 1 ) {
3094
3095
			// Remove duplicates
3096
			if ( !guaranteedUnique[ name ] ) {
3097
				jQuery.uniqueSort( matched );
3098
			}
3099
3100
			// Reverse order for parents* and prev-derivatives
3101
			if ( rparentsprev.test( name ) ) {
3102
				matched.reverse();
3103
			}
3104
		}
3105
3106
		return this.pushStack( matched );
3107
	};
3108
} );
3109
var rnotwhite = ( /\S+/g );
3110
3111
3112
3113
// Convert String-formatted options into Object-formatted ones
3114
function createOptions( options ) {
3115
	var object = {};
3116
	jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3117
		object[ flag ] = true;
3118
	} );
3119
	return object;
3120
}
3121
3122
/*
3123
 * Create a callback list using the following parameters:
3124
 *
3125
 *	options: an optional list of space-separated options that will change how
3126
 *			the callback list behaves or a more traditional option object
3127
 *
3128
 * By default a callback list will act like an event callback list and can be
3129
 * "fired" multiple times.
3130
 *
3131
 * Possible options:
3132
 *
3133
 *	once:			will ensure the callback list can only be fired once (like a Deferred)
3134
 *
3135
 *	memory:			will keep track of previous values and will call any callback added
3136
 *					after the list has been fired right away with the latest "memorized"
3137
 *					values (like a Deferred)
3138
 *
3139
 *	unique:			will ensure a callback can only be added once (no duplicate in the list)
3140
 *
3141
 *	stopOnFalse:	interrupt callings when a callback returns false
3142
 *
3143
 */
3144
jQuery.Callbacks = function( options ) {
3145
3146
	// Convert options from String-formatted to Object-formatted if needed
3147
	// (we check in cache first)
3148
	options = typeof options === "string" ?
3149
		createOptions( options ) :
3150
		jQuery.extend( {}, options );
3151
3152
	var // Flag to know if list is currently firing
3153
		firing,
3154
3155
		// Last fire value for non-forgettable lists
3156
		memory,
3157
3158
		// Flag to know if list was already fired
3159
		fired,
3160
3161
		// Flag to prevent firing
3162
		locked,
3163
3164
		// Actual callback list
3165
		list = [],
3166
3167
		// Queue of execution data for repeatable lists
3168
		queue = [],
3169
3170
		// Index of currently firing callback (modified by add/remove as needed)
3171
		firingIndex = -1,
3172
3173
		// Fire callbacks
3174
		fire = function() {
3175
3176
			// Enforce single-firing
3177
			locked = options.once;
3178
3179
			// Execute callbacks for all pending executions,
3180
			// respecting firingIndex overrides and runtime changes
3181
			fired = firing = true;
3182
			for ( ; queue.length; firingIndex = -1 ) {
3183
				memory = queue.shift();
3184
				while ( ++firingIndex < list.length ) {
3185
3186
					// Run callback and check for early termination
3187
					if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
3188
						options.stopOnFalse ) {
3189
3190
						// Jump to end and forget the data so .add doesn't re-fire
3191
						firingIndex = list.length;
3192
						memory = false;
3193
					}
3194
				}
3195
			}
3196
3197
			// Forget the data if we're done with it
3198
			if ( !options.memory ) {
3199
				memory = false;
3200
			}
3201
3202
			firing = false;
3203
3204
			// Clean up if we're done firing for good
3205
			if ( locked ) {
3206
3207
				// Keep an empty list if we have data for future add calls
3208
				if ( memory ) {
3209
					list = [];
3210
3211
				// Otherwise, this object is spent
3212
				} else {
3213
					list = "";
3214
				}
3215
			}
3216
		},
3217
3218
		// Actual Callbacks object
3219
		self = {
3220
3221
			// Add a callback or a collection of callbacks to the list
3222
			add: function() {
3223
				if ( list ) {
3224
3225
					// If we have memory from a past run, we should fire after adding
3226
					if ( memory && !firing ) {
3227
						firingIndex = list.length - 1;
3228
						queue.push( memory );
3229
					}
3230
3231
					( function add( args ) {
3232
						jQuery.each( args, function( _, arg ) {
3233
							if ( jQuery.isFunction( arg ) ) {
3234
								if ( !options.unique || !self.has( arg ) ) {
3235
									list.push( arg );
3236
								}
3237
							} else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
3238
3239
								// Inspect recursively
3240
								add( arg );
3241
							}
3242
						} );
3243
					} )( arguments );
3244
3245
					if ( memory && !firing ) {
3246
						fire();
3247
					}
3248
				}
3249
				return this;
3250
			},
3251
3252
			// Remove a callback from the list
3253
			remove: function() {
3254
				jQuery.each( arguments, function( _, arg ) {
3255
					var index;
3256
					while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3257
						list.splice( index, 1 );
3258
3259
						// Handle firing indexes
3260
						if ( index <= firingIndex ) {
3261
							firingIndex--;
3262
						}
3263
					}
3264
				} );
3265
				return this;
3266
			},
3267
3268
			// Check if a given callback is in the list.
3269
			// If no argument is given, return whether or not list has callbacks attached.
3270
			has: function( fn ) {
3271
				return fn ?
3272
					jQuery.inArray( fn, list ) > -1 :
3273
					list.length > 0;
3274
			},
3275
3276
			// Remove all callbacks from the list
3277
			empty: function() {
3278
				if ( list ) {
3279
					list = [];
3280
				}
3281
				return this;
3282
			},
3283
3284
			// Disable .fire and .add
3285
			// Abort any current/pending executions
3286
			// Clear all callbacks and values
3287
			disable: function() {
3288
				locked = queue = [];
3289
				list = memory = "";
3290
				return this;
3291
			},
3292
			disabled: function() {
3293
				return !list;
3294
			},
3295
3296
			// Disable .fire
3297
			// Also disable .add unless we have memory (since it would have no effect)
3298
			// Abort any pending executions
3299
			lock: function() {
3300
				locked = queue = [];
3301
				if ( !memory ) {
3302
					list = memory = "";
3303
				}
3304
				return this;
3305
			},
3306
			locked: function() {
3307
				return !!locked;
3308
			},
3309
3310
			// Call all callbacks with the given context and arguments
3311
			fireWith: function( context, args ) {
3312
				if ( !locked ) {
3313
					args = args || [];
3314
					args = [ context, args.slice ? args.slice() : args ];
3315
					queue.push( args );
3316
					if ( !firing ) {
3317
						fire();
3318
					}
3319
				}
3320
				return this;
3321
			},
3322
3323
			// Call all the callbacks with the given arguments
3324
			fire: function() {
3325
				self.fireWith( this, arguments );
3326
				return this;
3327
			},
3328
3329
			// To know if the callbacks have already been called at least once
3330
			fired: function() {
3331
				return !!fired;
3332
			}
3333
		};
3334
3335
	return self;
3336
};
3337
3338
3339
jQuery.extend( {
3340
3341
	Deferred: function( func ) {
3342
		var tuples = [
3343
3344
				// action, add listener, listener list, final state
3345
				[ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
3346
				[ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
3347
				[ "notify", "progress", jQuery.Callbacks( "memory" ) ]
3348
			],
3349
			state = "pending",
3350
			promise = {
3351
				state: function() {
3352
					return state;
3353
				},
3354
				always: function() {
3355
					deferred.done( arguments ).fail( arguments );
3356
					return this;
3357
				},
3358
				then: function( /* fnDone, fnFail, fnProgress */ ) {
3359
					var fns = arguments;
3360
					return jQuery.Deferred( function( newDefer ) {
3361
						jQuery.each( tuples, function( i, tuple ) {
3362
							var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3363
3364
							// deferred[ done | fail | progress ] for forwarding actions to newDefer
3365
							deferred[ tuple[ 1 ] ]( function() {
3366
								var returned = fn && fn.apply( this, arguments );
3367
								if ( returned && jQuery.isFunction( returned.promise ) ) {
3368
									returned.promise()
3369
										.progress( newDefer.notify )
3370
										.done( newDefer.resolve )
3371
										.fail( newDefer.reject );
3372
								} else {
3373
									newDefer[ tuple[ 0 ] + "With" ](
3374
										this === promise ? newDefer.promise() : this,
3375
										fn ? [ returned ] : arguments
3376
									);
3377
								}
3378
							} );
3379
						} );
3380
						fns = null;
3381
					} ).promise();
3382
				},
3383
3384
				// Get a promise for this deferred
3385
				// If obj is provided, the promise aspect is added to the object
3386
				promise: function( obj ) {
3387
					return obj != null ? jQuery.extend( obj, promise ) : promise;
3388
				}
3389
			},
3390
			deferred = {};
3391
3392
		// Keep pipe for back-compat
3393
		promise.pipe = promise.then;
3394
3395
		// Add list-specific methods
3396
		jQuery.each( tuples, function( i, tuple ) {
3397
			var list = tuple[ 2 ],
3398
				stateString = tuple[ 3 ];
3399
3400
			// promise[ done | fail | progress ] = list.add
3401
			promise[ tuple[ 1 ] ] = list.add;
3402
3403
			// Handle state
3404
			if ( stateString ) {
3405
				list.add( function() {
3406
3407
					// state = [ resolved | rejected ]
3408
					state = stateString;
3409
3410
				// [ reject_list | resolve_list ].disable; progress_list.lock
3411
				}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3412
			}
3413
3414
			// deferred[ resolve | reject | notify ]
3415
			deferred[ tuple[ 0 ] ] = function() {
3416
				deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
3417
				return this;
3418
			};
3419
			deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
3420
		} );
3421
3422
		// Make the deferred a promise
3423
		promise.promise( deferred );
3424
3425
		// Call given func if any
3426
		if ( func ) {
3427
			func.call( deferred, deferred );
3428
		}
3429
3430
		// All done!
3431
		return deferred;
3432
	},
3433
3434
	// Deferred helper
3435
	when: function( subordinate /* , ..., subordinateN */ ) {
3436
		var i = 0,
3437
			resolveValues = slice.call( arguments ),
3438
			length = resolveValues.length,
3439
3440
			// the count of uncompleted subordinates
3441
			remaining = length !== 1 ||
3442
				( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3443
3444
			// the master Deferred.
3445
			// If resolveValues consist of only a single Deferred, just use that.
3446
			deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3447
3448
			// Update function for both resolve and progress values
3449
			updateFunc = function( i, contexts, values ) {
3450
				return function( value ) {
3451
					contexts[ i ] = this;
3452
					values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3453
					if ( values === progressValues ) {
3454
						deferred.notifyWith( contexts, values );
3455
					} else if ( !( --remaining ) ) {
3456
						deferred.resolveWith( contexts, values );
3457
					}
3458
				};
3459
			},
3460
3461
			progressValues, progressContexts, resolveContexts;
3462
3463
		// Add listeners to Deferred subordinates; treat others as resolved
3464
		if ( length > 1 ) {
3465
			progressValues = new Array( length );
3466
			progressContexts = new Array( length );
3467
			resolveContexts = new Array( length );
3468
			for ( ; i < length; i++ ) {
3469
				if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3470
					resolveValues[ i ].promise()
3471
						.progress( updateFunc( i, progressContexts, progressValues ) )
3472
						.done( updateFunc( i, resolveContexts, resolveValues ) )
3473
						.fail( deferred.reject );
3474
				} else {
3475
					--remaining;
3476
				}
3477
			}
3478
		}
3479
3480
		// If we're not waiting on anything, resolve the master
3481
		if ( !remaining ) {
3482
			deferred.resolveWith( resolveContexts, resolveValues );
3483
		}
3484
3485
		return deferred.promise();
3486
	}
3487
} );
3488
3489
3490
// The deferred used on DOM ready
3491
var readyList;
3492
3493
jQuery.fn.ready = function( fn ) {
3494
3495
	// Add the callback
3496
	jQuery.ready.promise().done( fn );
3497
3498
	return this;
3499
};
3500
3501
jQuery.extend( {
3502
3503
	// Is the DOM ready to be used? Set to true once it occurs.
3504
	isReady: false,
3505
3506
	// A counter to track how many items to wait for before
3507
	// the ready event fires. See #6781
3508
	readyWait: 1,
3509
3510
	// Hold (or release) the ready event
3511
	holdReady: function( hold ) {
3512
		if ( hold ) {
3513
			jQuery.readyWait++;
3514
		} else {
3515
			jQuery.ready( true );
3516
		}
3517
	},
3518
3519
	// Handle when the DOM is ready
3520
	ready: function( wait ) {
3521
3522
		// Abort if there are pending holds or we're already ready
3523
		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3524
			return;
3525
		}
3526
3527
		// Remember that the DOM is ready
3528
		jQuery.isReady = true;
3529
3530
		// If a normal DOM Ready event fired, decrement, and wait if need be
3531
		if ( wait !== true && --jQuery.readyWait > 0 ) {
3532
			return;
3533
		}
3534
3535
		// If there are functions bound, to execute
3536
		readyList.resolveWith( document, [ jQuery ] );
3537
3538
		// Trigger any bound ready events
3539
		if ( jQuery.fn.triggerHandler ) {
3540
			jQuery( document ).triggerHandler( "ready" );
3541
			jQuery( document ).off( "ready" );
3542
		}
3543
	}
3544
} );
3545
3546
/**
3547
 * The ready event handler and self cleanup method
3548
 */
3549
function completed() {
3550
	document.removeEventListener( "DOMContentLoaded", completed );
3551
	window.removeEventListener( "load", completed );
3552
	jQuery.ready();
3553
}
3554
3555
jQuery.ready.promise = function( obj ) {
3556
	if ( !readyList ) {
3557
3558
		readyList = jQuery.Deferred();
3559
3560
		// Catch cases where $(document).ready() is called
3561
		// after the browser event has already occurred.
3562
		// Support: IE9-10 only
3563
		// Older IE sometimes signals "interactive" too soon
3564
		if ( document.readyState === "complete" ||
3565
			( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
3566
3567
			// Handle it asynchronously to allow scripts the opportunity to delay ready
3568
			window.setTimeout( jQuery.ready );
3569
3570
		} else {
3571
3572
			// Use the handy event callback
3573
			document.addEventListener( "DOMContentLoaded", completed );
3574
3575
			// A fallback to window.onload, that will always work
3576
			window.addEventListener( "load", completed );
3577
		}
3578
	}
3579
	return readyList.promise( obj );
3580
};
3581
3582
// Kick off the DOM ready check even if the user does not
3583
jQuery.ready.promise();
3584
3585
3586
3587
3588
// Multifunctional method to get and set values of a collection
3589
// The value/s can optionally be executed if it's a function
3590
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
3591
	var i = 0,
3592
		len = elems.length,
3593
		bulk = key == null;
3594
3595
	// Sets many values
3596
	if ( jQuery.type( key ) === "object" ) {
3597
		chainable = true;
3598
		for ( i in key ) {
3599
			access( elems, fn, i, key[ i ], true, emptyGet, raw );
3600
		}
3601
3602
	// Sets one value
3603
	} else if ( value !== undefined ) {
3604
		chainable = true;
3605
3606
		if ( !jQuery.isFunction( value ) ) {
3607
			raw = true;
3608
		}
3609
3610
		if ( bulk ) {
3611
3612
			// Bulk operations run against the entire set
3613
			if ( raw ) {
3614
				fn.call( elems, value );
3615
				fn = null;
3616
3617
			// ...except when executing function values
3618
			} else {
3619
				bulk = fn;
3620
				fn = function( elem, key, value ) {
3621
					return bulk.call( jQuery( elem ), value );
3622
				};
3623
			}
3624
		}
3625
3626
		if ( fn ) {
3627
			for ( ; i < len; i++ ) {
3628
				fn(
3629
					elems[ i ], key, raw ?
3630
					value :
3631
					value.call( elems[ i ], i, fn( elems[ i ], key ) )
3632
				);
3633
			}
3634
		}
3635
	}
3636
3637
	return chainable ?
3638
		elems :
3639
3640
		// Gets
3641
		bulk ?
3642
			fn.call( elems ) :
3643
			len ? fn( elems[ 0 ], key ) : emptyGet;
3644
};
3645
var acceptData = function( owner ) {
3646
3647
	// Accepts only:
3648
	//  - Node
3649
	//    - Node.ELEMENT_NODE
3650
	//    - Node.DOCUMENT_NODE
3651
	//  - Object
3652
	//    - Any
3653
	/* jshint -W018 */
3654
	return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
3655
};
3656
3657
3658
3659
3660
function Data() {
3661
	this.expando = jQuery.expando + Data.uid++;
3662
}
3663
3664
Data.uid = 1;
3665
3666
Data.prototype = {
3667
3668
	register: function( owner, initial ) {
3669
		var value = initial || {};
3670
3671
		// If it is a node unlikely to be stringify-ed or looped over
3672
		// use plain assignment
3673
		if ( owner.nodeType ) {
3674
			owner[ this.expando ] = value;
3675
3676
		// Otherwise secure it in a non-enumerable, non-writable property
3677
		// configurability must be true to allow the property to be
3678
		// deleted with the delete operator
3679
		} else {
3680
			Object.defineProperty( owner, this.expando, {
3681
				value: value,
3682
				writable: true,
3683
				configurable: true
3684
			} );
3685
		}
3686
		return owner[ this.expando ];
3687
	},
3688
	cache: function( owner ) {
3689
3690
		// We can accept data for non-element nodes in modern browsers,
3691
		// but we should not, see #8335.
3692
		// Always return an empty object.
3693
		if ( !acceptData( owner ) ) {
3694
			return {};
3695
		}
3696
3697
		// Check if the owner object already has a cache
3698
		var value = owner[ this.expando ];
3699
3700
		// If not, create one
3701
		if ( !value ) {
3702
			value = {};
3703
3704
			// We can accept data for non-element nodes in modern browsers,
3705
			// but we should not, see #8335.
3706
			// Always return an empty object.
3707
			if ( acceptData( owner ) ) {
3708
3709
				// If it is a node unlikely to be stringify-ed or looped over
3710
				// use plain assignment
3711
				if ( owner.nodeType ) {
3712
					owner[ this.expando ] = value;
3713
3714
				// Otherwise secure it in a non-enumerable property
3715
				// configurable must be true to allow the property to be
3716
				// deleted when data is removed
3717
				} else {
3718
					Object.defineProperty( owner, this.expando, {
3719
						value: value,
3720
						configurable: true
3721
					} );
3722
				}
3723
			}
3724
		}
3725
3726
		return value;
3727
	},
3728
	set: function( owner, data, value ) {
3729
		var prop,
3730
			cache = this.cache( owner );
3731
3732
		// Handle: [ owner, key, value ] args
3733
		if ( typeof data === "string" ) {
3734
			cache[ data ] = value;
3735
3736
		// Handle: [ owner, { properties } ] args
3737
		} else {
3738
3739
			// Copy the properties one-by-one to the cache object
3740
			for ( prop in data ) {
3741
				cache[ prop ] = data[ prop ];
3742
			}
3743
		}
3744
		return cache;
3745
	},
3746
	get: function( owner, key ) {
3747
		return key === undefined ?
3748
			this.cache( owner ) :
3749
			owner[ this.expando ] && owner[ this.expando ][ key ];
3750
	},
3751
	access: function( owner, key, value ) {
3752
		var stored;
3753
3754
		// In cases where either:
3755
		//
3756
		//   1. No key was specified
3757
		//   2. A string key was specified, but no value provided
3758
		//
3759
		// Take the "read" path and allow the get method to determine
3760
		// which value to return, respectively either:
3761
		//
3762
		//   1. The entire cache object
3763
		//   2. The data stored at the key
3764
		//
3765
		if ( key === undefined ||
3766
				( ( key && typeof key === "string" ) && value === undefined ) ) {
3767
3768
			stored = this.get( owner, key );
3769
3770
			return stored !== undefined ?
3771
				stored : this.get( owner, jQuery.camelCase( key ) );
3772
		}
3773
3774
		// When the key is not a string, or both a key and value
3775
		// are specified, set or extend (existing objects) with either:
3776
		//
3777
		//   1. An object of properties
3778
		//   2. A key and value
3779
		//
3780
		this.set( owner, key, value );
3781
3782
		// Since the "set" path can have two possible entry points
3783
		// return the expected data based on which path was taken[*]
3784
		return value !== undefined ? value : key;
3785
	},
3786
	remove: function( owner, key ) {
3787
		var i, name, camel,
3788
			cache = owner[ this.expando ];
3789
3790
		if ( cache === undefined ) {
3791
			return;
3792
		}
3793
3794
		if ( key === undefined ) {
3795
			this.register( owner );
3796
3797
		} else {
3798
3799
			// Support array or space separated string of keys
3800
			if ( jQuery.isArray( key ) ) {
3801
3802
				// If "name" is an array of keys...
3803
				// When data is initially created, via ("key", "val") signature,
3804
				// keys will be converted to camelCase.
3805
				// Since there is no way to tell _how_ a key was added, remove
3806
				// both plain key and camelCase key. #12786
3807
				// This will only penalize the array argument path.
3808
				name = key.concat( key.map( jQuery.camelCase ) );
3809
			} else {
3810
				camel = jQuery.camelCase( key );
3811
3812
				// Try the string as a key before any manipulation
3813
				if ( key in cache ) {
3814
					name = [ key, camel ];
3815
				} else {
3816
3817
					// If a key with the spaces exists, use it.
3818
					// Otherwise, create an array by matching non-whitespace
3819
					name = camel;
3820
					name = name in cache ?
3821
						[ name ] : ( name.match( rnotwhite ) || [] );
3822
				}
3823
			}
3824
3825
			i = name.length;
3826
3827
			while ( i-- ) {
3828
				delete cache[ name[ i ] ];
3829
			}
3830
		}
3831
3832
		// Remove the expando if there's no more data
3833
		if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
3834
3835
			// Support: Chrome <= 35-45+
3836
			// Webkit & Blink performance suffers when deleting properties
3837
			// from DOM nodes, so set to undefined instead
3838
			// https://code.google.com/p/chromium/issues/detail?id=378607
3839
			if ( owner.nodeType ) {
3840
				owner[ this.expando ] = undefined;
3841
			} else {
3842
				delete owner[ this.expando ];
3843
			}
3844
		}
3845
	},
3846
	hasData: function( owner ) {
3847
		var cache = owner[ this.expando ];
3848
		return cache !== undefined && !jQuery.isEmptyObject( cache );
3849
	}
3850
};
3851
var dataPriv = new Data();
3852
3853
var dataUser = new Data();
3854
3855
3856
3857
//	Implementation Summary
3858
//
3859
//	1. Enforce API surface and semantic compatibility with 1.9.x branch
3860
//	2. Improve the module's maintainability by reducing the storage
3861
//		paths to a single mechanism.
3862
//	3. Use the same single mechanism to support "private" and "user" data.
3863
//	4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
3864
//	5. Avoid exposing implementation details on user objects (eg. expando properties)
3865
//	6. Provide a clear path for implementation upgrade to WeakMap in 2014
3866
3867
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3868
	rmultiDash = /[A-Z]/g;
3869
3870
function dataAttr( elem, key, data ) {
3871
	var name;
3872
3873
	// If nothing was found internally, try to fetch any
3874
	// data from the HTML5 data-* attribute
3875
	if ( data === undefined && elem.nodeType === 1 ) {
3876
		name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
3877
		data = elem.getAttribute( name );
3878
3879
		if ( typeof data === "string" ) {
3880
			try {
3881
				data = data === "true" ? true :
3882
					data === "false" ? false :
3883
					data === "null" ? null :
3884
3885
					// Only convert to a number if it doesn't change the string
3886
					+data + "" === data ? +data :
3887
					rbrace.test( data ) ? jQuery.parseJSON( data ) :
3888
					data;
3889
			} catch ( e ) {}
3890
3891
			// Make sure we set the data so it isn't changed later
3892
			dataUser.set( elem, key, data );
3893
		} else {
3894
			data = undefined;
3895
		}
3896
	}
3897
	return data;
3898
}
3899
3900
jQuery.extend( {
3901
	hasData: function( elem ) {
3902
		return dataUser.hasData( elem ) || dataPriv.hasData( elem );
3903
	},
3904
3905
	data: function( elem, name, data ) {
3906
		return dataUser.access( elem, name, data );
3907
	},
3908
3909
	removeData: function( elem, name ) {
3910
		dataUser.remove( elem, name );
3911
	},
3912
3913
	// TODO: Now that all calls to _data and _removeData have been replaced
3914
	// with direct calls to dataPriv methods, these can be deprecated.
3915
	_data: function( elem, name, data ) {
3916
		return dataPriv.access( elem, name, data );
3917
	},
3918
3919
	_removeData: function( elem, name ) {
3920
		dataPriv.remove( elem, name );
3921
	}
3922
} );
3923
3924
jQuery.fn.extend( {
3925
	data: function( key, value ) {
3926
		var i, name, data,
3927
			elem = this[ 0 ],
3928
			attrs = elem && elem.attributes;
3929
3930
		// Gets all values
3931
		if ( key === undefined ) {
3932
			if ( this.length ) {
3933
				data = dataUser.get( elem );
3934
3935
				if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
3936
					i = attrs.length;
3937
					while ( i-- ) {
3938
3939
						// Support: IE11+
3940
						// The attrs elements can be null (#14894)
3941
						if ( attrs[ i ] ) {
3942
							name = attrs[ i ].name;
3943
							if ( name.indexOf( "data-" ) === 0 ) {
3944
								name = jQuery.camelCase( name.slice( 5 ) );
3945
								dataAttr( elem, name, data[ name ] );
3946
							}
3947
						}
3948
					}
3949
					dataPriv.set( elem, "hasDataAttrs", true );
3950
				}
3951
			}
3952
3953
			return data;
3954
		}
3955
3956
		// Sets multiple values
3957
		if ( typeof key === "object" ) {
3958
			return this.each( function() {
3959
				dataUser.set( this, key );
3960
			} );
3961
		}
3962
3963
		return access( this, function( value ) {
3964
			var data, camelKey;
3965
3966
			// The calling jQuery object (element matches) is not empty
3967
			// (and therefore has an element appears at this[ 0 ]) and the
3968
			// `value` parameter was not undefined. An empty jQuery object
3969
			// will result in `undefined` for elem = this[ 0 ] which will
3970
			// throw an exception if an attempt to read a data cache is made.
3971
			if ( elem && value === undefined ) {
3972
3973
				// Attempt to get data from the cache
3974
				// with the key as-is
3975
				data = dataUser.get( elem, key ) ||
3976
3977
					// Try to find dashed key if it exists (gh-2779)
3978
					// This is for 2.2.x only
3979
					dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() );
3980
3981
				if ( data !== undefined ) {
3982
					return data;
3983
				}
3984
3985
				camelKey = jQuery.camelCase( key );
3986
3987
				// Attempt to get data from the cache
3988
				// with the key camelized
3989
				data = dataUser.get( elem, camelKey );
3990
				if ( data !== undefined ) {
3991
					return data;
3992
				}
3993
3994
				// Attempt to "discover" the data in
3995
				// HTML5 custom data-* attrs
3996
				data = dataAttr( elem, camelKey, undefined );
3997
				if ( data !== undefined ) {
3998
					return data;
3999
				}
4000
4001
				// We tried really hard, but the data doesn't exist.
4002
				return;
4003
			}
4004
4005
			// Set the data...
4006
			camelKey = jQuery.camelCase( key );
4007
			this.each( function() {
4008
4009
				// First, attempt to store a copy or reference of any
4010
				// data that might've been store with a camelCased key.
4011
				var data = dataUser.get( this, camelKey );
4012
4013
				// For HTML5 data-* attribute interop, we have to
4014
				// store property names with dashes in a camelCase form.
4015
				// This might not apply to all properties...*
4016
				dataUser.set( this, camelKey, value );
4017
4018
				// *... In the case of properties that might _actually_
4019
				// have dashes, we need to also store a copy of that
4020
				// unchanged property.
4021
				if ( key.indexOf( "-" ) > -1 && data !== undefined ) {
4022
					dataUser.set( this, key, value );
4023
				}
4024
			} );
4025
		}, null, value, arguments.length > 1, null, true );
4026
	},
4027
4028
	removeData: function( key ) {
4029
		return this.each( function() {
4030
			dataUser.remove( this, key );
4031
		} );
4032
	}
4033
} );
4034
4035
4036
jQuery.extend( {
4037
	queue: function( elem, type, data ) {
4038
		var queue;
4039
4040
		if ( elem ) {
4041
			type = ( type || "fx" ) + "queue";
4042
			queue = dataPriv.get( elem, type );
4043
4044
			// Speed up dequeue by getting out quickly if this is just a lookup
4045
			if ( data ) {
4046
				if ( !queue || jQuery.isArray( data ) ) {
4047
					queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
4048
				} else {
4049
					queue.push( data );
4050
				}
4051
			}
4052
			return queue || [];
4053
		}
4054
	},
4055
4056
	dequeue: function( elem, type ) {
4057
		type = type || "fx";
4058
4059
		var queue = jQuery.queue( elem, type ),
4060
			startLength = queue.length,
4061
			fn = queue.shift(),
4062
			hooks = jQuery._queueHooks( elem, type ),
4063
			next = function() {
4064
				jQuery.dequeue( elem, type );
4065
			};
4066
4067
		// If the fx queue is dequeued, always remove the progress sentinel
4068
		if ( fn === "inprogress" ) {
4069
			fn = queue.shift();
4070
			startLength--;
4071
		}
4072
4073
		if ( fn ) {
4074
4075
			// Add a progress sentinel to prevent the fx queue from being
4076
			// automatically dequeued
4077
			if ( type === "fx" ) {
4078
				queue.unshift( "inprogress" );
4079
			}
4080
4081
			// Clear up the last queue stop function
4082
			delete hooks.stop;
4083
			fn.call( elem, next, hooks );
4084
		}
4085
4086
		if ( !startLength && hooks ) {
4087
			hooks.empty.fire();
4088
		}
4089
	},
4090
4091
	// Not public - generate a queueHooks object, or return the current one
4092
	_queueHooks: function( elem, type ) {
4093
		var key = type + "queueHooks";
4094
		return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
4095
			empty: jQuery.Callbacks( "once memory" ).add( function() {
4096
				dataPriv.remove( elem, [ type + "queue", key ] );
4097
			} )
4098
		} );
4099
	}
4100
} );
4101
4102
jQuery.fn.extend( {
4103
	queue: function( type, data ) {
4104
		var setter = 2;
4105
4106
		if ( typeof type !== "string" ) {
4107
			data = type;
4108
			type = "fx";
4109
			setter--;
4110
		}
4111
4112
		if ( arguments.length < setter ) {
4113
			return jQuery.queue( this[ 0 ], type );
4114
		}
4115
4116
		return data === undefined ?
4117
			this :
4118
			this.each( function() {
4119
				var queue = jQuery.queue( this, type, data );
4120
4121
				// Ensure a hooks for this queue
4122
				jQuery._queueHooks( this, type );
4123
4124
				if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
4125
					jQuery.dequeue( this, type );
4126
				}
4127
			} );
4128
	},
4129
	dequeue: function( type ) {
4130
		return this.each( function() {
4131
			jQuery.dequeue( this, type );
4132
		} );
4133
	},
4134
	clearQueue: function( type ) {
4135
		return this.queue( type || "fx", [] );
4136
	},
4137
4138
	// Get a promise resolved when queues of a certain type
4139
	// are emptied (fx is the type by default)
4140
	promise: function( type, obj ) {
4141
		var tmp,
4142
			count = 1,
4143
			defer = jQuery.Deferred(),
4144
			elements = this,
4145
			i = this.length,
4146
			resolve = function() {
4147
				if ( !( --count ) ) {
4148
					defer.resolveWith( elements, [ elements ] );
4149
				}
4150
			};
4151
4152
		if ( typeof type !== "string" ) {
4153
			obj = type;
4154
			type = undefined;
4155
		}
4156
		type = type || "fx";
4157
4158
		while ( i-- ) {
4159
			tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
4160
			if ( tmp && tmp.empty ) {
4161
				count++;
4162
				tmp.empty.add( resolve );
4163
			}
4164
		}
4165
		resolve();
4166
		return defer.promise( obj );
4167
	}
4168
} );
4169
var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
4170
4171
var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
4172
4173
4174
var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4175
4176
var isHidden = function( elem, el ) {
4177
4178
		// isHidden might be called from jQuery#filter function;
4179
		// in that case, element will be second argument
4180
		elem = el || elem;
4181
		return jQuery.css( elem, "display" ) === "none" ||
4182
			!jQuery.contains( elem.ownerDocument, elem );
4183
	};
4184
4185
4186
4187
function adjustCSS( elem, prop, valueParts, tween ) {
4188
	var adjusted,
4189
		scale = 1,
4190
		maxIterations = 20,
4191
		currentValue = tween ?
4192
			function() { return tween.cur(); } :
4193
			function() { return jQuery.css( elem, prop, "" ); },
4194
		initial = currentValue(),
4195
		unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
4196
4197
		// Starting value computation is required for potential unit mismatches
4198
		initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
4199
			rcssNum.exec( jQuery.css( elem, prop ) );
4200
4201
	if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
4202
4203
		// Trust units reported by jQuery.css
4204
		unit = unit || initialInUnit[ 3 ];
4205
4206
		// Make sure we update the tween properties later on
4207
		valueParts = valueParts || [];
4208
4209
		// Iteratively approximate from a nonzero starting point
4210
		initialInUnit = +initial || 1;
4211
4212
		do {
4213
4214
			// If previous iteration zeroed out, double until we get *something*.
4215
			// Use string for doubling so we don't accidentally see scale as unchanged below
4216
			scale = scale || ".5";
4217
4218
			// Adjust and apply
4219
			initialInUnit = initialInUnit / scale;
4220
			jQuery.style( elem, prop, initialInUnit + unit );
4221
4222
		// Update scale, tolerating zero or NaN from tween.cur()
4223
		// Break the loop if scale is unchanged or perfect, or if we've just had enough.
4224
		} while (
4225
			scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
4226
		);
4227
	}
4228
4229
	if ( valueParts ) {
4230
		initialInUnit = +initialInUnit || +initial || 0;
4231
4232
		// Apply relative offset (+=/-=) if specified
4233
		adjusted = valueParts[ 1 ] ?
4234
			initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
4235
			+valueParts[ 2 ];
4236
		if ( tween ) {
4237
			tween.unit = unit;
4238
			tween.start = initialInUnit;
4239
			tween.end = adjusted;
4240
		}
4241
	}
4242
	return adjusted;
4243
}
4244
var rcheckableType = ( /^(?:checkbox|radio)$/i );
4245
4246
var rtagName = ( /<([\w:-]+)/ );
4247
4248
var rscriptType = ( /^$|\/(?:java|ecma)script/i );
4249
4250
4251
4252
// We have to close these tags to support XHTML (#13200)
4253
var wrapMap = {
4254
4255
	// Support: IE9
4256
	option: [ 1, "<select multiple='multiple'>", "</select>" ],
4257
4258
	// XHTML parsers do not magically insert elements in the
4259
	// same way that tag soup parsers do. So we cannot shorten
4260
	// this by omitting <tbody> or other required elements.
4261
	thead: [ 1, "<table>", "</table>" ],
4262
	col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
4263
	tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4264
	td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4265
4266
	_default: [ 0, "", "" ]
4267
};
4268
4269
// Support: IE9
4270
wrapMap.optgroup = wrapMap.option;
4271
4272
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4273
wrapMap.th = wrapMap.td;
4274
4275
4276
function getAll( context, tag ) {
4277
4278
	// Support: IE9-11+
4279
	// Use typeof to avoid zero-argument method invocation on host objects (#15151)
4280
	var ret = typeof context.getElementsByTagName !== "undefined" ?
4281
			context.getElementsByTagName( tag || "*" ) :
4282
			typeof context.querySelectorAll !== "undefined" ?
4283
				context.querySelectorAll( tag || "*" ) :
4284
			[];
4285
4286
	return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
4287
		jQuery.merge( [ context ], ret ) :
4288
		ret;
4289
}
4290
4291
4292
// Mark scripts as having already been evaluated
4293
function setGlobalEval( elems, refElements ) {
4294
	var i = 0,
4295
		l = elems.length;
4296
4297
	for ( ; i < l; i++ ) {
4298
		dataPriv.set(
4299
			elems[ i ],
4300
			"globalEval",
4301
			!refElements || dataPriv.get( refElements[ i ], "globalEval" )
4302
		);
4303
	}
4304
}
4305
4306
4307
var rhtml = /<|&#?\w+;/;
4308
4309
function buildFragment( elems, context, scripts, selection, ignored ) {
4310
	var elem, tmp, tag, wrap, contains, j,
4311
		fragment = context.createDocumentFragment(),
4312
		nodes = [],
4313
		i = 0,
4314
		l = elems.length;
4315
4316
	for ( ; i < l; i++ ) {
4317
		elem = elems[ i ];
4318
4319
		if ( elem || elem === 0 ) {
4320
4321
			// Add nodes directly
4322
			if ( jQuery.type( elem ) === "object" ) {
4323
4324
				// Support: Android<4.1, PhantomJS<2
4325
				// push.apply(_, arraylike) throws on ancient WebKit
4326
				jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
4327
4328
			// Convert non-html into a text node
4329
			} else if ( !rhtml.test( elem ) ) {
4330
				nodes.push( context.createTextNode( elem ) );
4331
4332
			// Convert html into DOM nodes
4333
			} else {
4334
				tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
4335
4336
				// Deserialize a standard representation
4337
				tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
4338
				wrap = wrapMap[ tag ] || wrapMap._default;
4339
				tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
4340
4341
				// Descend through wrappers to the right content
4342
				j = wrap[ 0 ];
4343
				while ( j-- ) {
4344
					tmp = tmp.lastChild;
4345
				}
4346
4347
				// Support: Android<4.1, PhantomJS<2
4348
				// push.apply(_, arraylike) throws on ancient WebKit
4349
				jQuery.merge( nodes, tmp.childNodes );
4350
4351
				// Remember the top-level container
4352
				tmp = fragment.firstChild;
4353
4354
				// Ensure the created nodes are orphaned (#12392)
4355
				tmp.textContent = "";
4356
			}
4357
		}
4358
	}
4359
4360
	// Remove wrapper from fragment
4361
	fragment.textContent = "";
4362
4363
	i = 0;
4364
	while ( ( elem = nodes[ i++ ] ) ) {
4365
4366
		// Skip elements already in the context collection (trac-4087)
4367
		if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
4368
			if ( ignored ) {
4369
				ignored.push( elem );
4370
			}
4371
			continue;
4372
		}
4373
4374
		contains = jQuery.contains( elem.ownerDocument, elem );
4375
4376
		// Append to fragment
4377
		tmp = getAll( fragment.appendChild( elem ), "script" );
4378
4379
		// Preserve script evaluation history
4380
		if ( contains ) {
4381
			setGlobalEval( tmp );
4382
		}
4383
4384
		// Capture executables
4385
		if ( scripts ) {
4386
			j = 0;
4387
			while ( ( elem = tmp[ j++ ] ) ) {
4388
				if ( rscriptType.test( elem.type || "" ) ) {
4389
					scripts.push( elem );
4390
				}
4391
			}
4392
		}
4393
	}
4394
4395
	return fragment;
4396
}
4397
4398
4399
( function() {
4400
	var fragment = document.createDocumentFragment(),
4401
		div = fragment.appendChild( document.createElement( "div" ) ),
4402
		input = document.createElement( "input" );
4403
4404
	// Support: Android 4.0-4.3, Safari<=5.1
4405
	// Check state lost if the name is set (#11217)
4406
	// Support: Windows Web Apps (WWA)
4407
	// `name` and `type` must use .setAttribute for WWA (#14901)
4408
	input.setAttribute( "type", "radio" );
4409
	input.setAttribute( "checked", "checked" );
4410
	input.setAttribute( "name", "t" );
4411
4412
	div.appendChild( input );
4413
4414
	// Support: Safari<=5.1, Android<4.2
4415
	// Older WebKit doesn't clone checked state correctly in fragments
4416
	support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4417
4418
	// Support: IE<=11+
4419
	// Make sure textarea (and checkbox) defaultValue is properly cloned
4420
	div.innerHTML = "<textarea>x</textarea>";
4421
	support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4422
} )();
4423
4424
4425
var
4426
	rkeyEvent = /^key/,
4427
	rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
4428
	rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
4429
4430
function returnTrue() {
4431
	return true;
4432
}
4433
4434
function returnFalse() {
4435
	return false;
4436
}
4437
4438
// Support: IE9
4439
// See #13393 for more info
4440
function safeActiveElement() {
4441
	try {
4442
		return document.activeElement;
4443
	} catch ( err ) { }
4444
}
4445
4446
function on( elem, types, selector, data, fn, one ) {
4447
	var origFn, type;
4448
4449
	// Types can be a map of types/handlers
4450
	if ( typeof types === "object" ) {
4451
4452
		// ( types-Object, selector, data )
4453
		if ( typeof selector !== "string" ) {
4454
4455
			// ( types-Object, data )
4456
			data = data || selector;
4457
			selector = undefined;
4458
		}
4459
		for ( type in types ) {
4460
			on( elem, type, selector, data, types[ type ], one );
4461
		}
4462
		return elem;
4463
	}
4464
4465
	if ( data == null && fn == null ) {
4466
4467
		// ( types, fn )
4468
		fn = selector;
4469
		data = selector = undefined;
4470
	} else if ( fn == null ) {
4471
		if ( typeof selector === "string" ) {
4472
4473
			// ( types, selector, fn )
4474
			fn = data;
4475
			data = undefined;
4476
		} else {
4477
4478
			// ( types, data, fn )
4479
			fn = data;
4480
			data = selector;
4481
			selector = undefined;
4482
		}
4483
	}
4484
	if ( fn === false ) {
4485
		fn = returnFalse;
4486
	} else if ( !fn ) {
4487
		return elem;
4488
	}
4489
4490
	if ( one === 1 ) {
4491
		origFn = fn;
4492
		fn = function( event ) {
4493
4494
			// Can use an empty set, since event contains the info
4495
			jQuery().off( event );
4496
			return origFn.apply( this, arguments );
4497
		};
4498
4499
		// Use same guid so caller can remove using origFn
4500
		fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
4501
	}
4502
	return elem.each( function() {
4503
		jQuery.event.add( this, types, fn, data, selector );
4504
	} );
4505
}
4506
4507
/*
4508
 * Helper functions for managing events -- not part of the public interface.
4509
 * Props to Dean Edwards' addEvent library for many of the ideas.
4510
 */
4511
jQuery.event = {
4512
4513
	global: {},
4514
4515
	add: function( elem, types, handler, data, selector ) {
4516
4517
		var handleObjIn, eventHandle, tmp,
4518
			events, t, handleObj,
4519
			special, handlers, type, namespaces, origType,
4520
			elemData = dataPriv.get( elem );
4521
4522
		// Don't attach events to noData or text/comment nodes (but allow plain objects)
4523
		if ( !elemData ) {
4524
			return;
4525
		}
4526
4527
		// Caller can pass in an object of custom data in lieu of the handler
4528
		if ( handler.handler ) {
4529
			handleObjIn = handler;
4530
			handler = handleObjIn.handler;
4531
			selector = handleObjIn.selector;
4532
		}
4533
4534
		// Make sure that the handler has a unique ID, used to find/remove it later
4535
		if ( !handler.guid ) {
4536
			handler.guid = jQuery.guid++;
4537
		}
4538
4539
		// Init the element's event structure and main handler, if this is the first
4540
		if ( !( events = elemData.events ) ) {
4541
			events = elemData.events = {};
4542
		}
4543
		if ( !( eventHandle = elemData.handle ) ) {
4544
			eventHandle = elemData.handle = function( e ) {
4545
4546
				// Discard the second event of a jQuery.event.trigger() and
4547
				// when an event is called after a page has unloaded
4548
				return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
4549
					jQuery.event.dispatch.apply( elem, arguments ) : undefined;
4550
			};
4551
		}
4552
4553
		// Handle multiple events separated by a space
4554
		types = ( types || "" ).match( rnotwhite ) || [ "" ];
4555
		t = types.length;
4556
		while ( t-- ) {
4557
			tmp = rtypenamespace.exec( types[ t ] ) || [];
4558
			type = origType = tmp[ 1 ];
4559
			namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
4560
4561
			// There *must* be a type, no attaching namespace-only handlers
4562
			if ( !type ) {
4563
				continue;
4564
			}
4565
4566
			// If event changes its type, use the special event handlers for the changed type
4567
			special = jQuery.event.special[ type ] || {};
4568
4569
			// If selector defined, determine special event api type, otherwise given type
4570
			type = ( selector ? special.delegateType : special.bindType ) || type;
4571
4572
			// Update special based on newly reset type
4573
			special = jQuery.event.special[ type ] || {};
4574
4575
			// handleObj is passed to all event handlers
4576
			handleObj = jQuery.extend( {
4577
				type: type,
4578
				origType: origType,
4579
				data: data,
4580
				handler: handler,
4581
				guid: handler.guid,
4582
				selector: selector,
4583
				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4584
				namespace: namespaces.join( "." )
4585
			}, handleObjIn );
4586
4587
			// Init the event handler queue if we're the first
4588
			if ( !( handlers = events[ type ] ) ) {
4589
				handlers = events[ type ] = [];
4590
				handlers.delegateCount = 0;
4591
4592
				// Only use addEventListener if the special events handler returns false
4593
				if ( !special.setup ||
4594
					special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4595
4596
					if ( elem.addEventListener ) {
4597
						elem.addEventListener( type, eventHandle );
4598
					}
4599
				}
4600
			}
4601
4602
			if ( special.add ) {
4603
				special.add.call( elem, handleObj );
4604
4605
				if ( !handleObj.handler.guid ) {
4606
					handleObj.handler.guid = handler.guid;
4607
				}
4608
			}
4609
4610
			// Add to the element's handler list, delegates in front
4611
			if ( selector ) {
4612
				handlers.splice( handlers.delegateCount++, 0, handleObj );
4613
			} else {
4614
				handlers.push( handleObj );
4615
			}
4616
4617
			// Keep track of which events have ever been used, for event optimization
4618
			jQuery.event.global[ type ] = true;
4619
		}
4620
4621
	},
4622
4623
	// Detach an event or set of events from an element
4624
	remove: function( elem, types, handler, selector, mappedTypes ) {
4625
4626
		var j, origCount, tmp,
4627
			events, t, handleObj,
4628
			special, handlers, type, namespaces, origType,
4629
			elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
4630
4631
		if ( !elemData || !( events = elemData.events ) ) {
4632
			return;
4633
		}
4634
4635
		// Once for each type.namespace in types; type may be omitted
4636
		types = ( types || "" ).match( rnotwhite ) || [ "" ];
4637
		t = types.length;
4638
		while ( t-- ) {
4639
			tmp = rtypenamespace.exec( types[ t ] ) || [];
4640
			type = origType = tmp[ 1 ];
4641
			namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
4642
4643
			// Unbind all events (on this namespace, if provided) for the element
4644
			if ( !type ) {
4645
				for ( type in events ) {
4646
					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4647
				}
4648
				continue;
4649
			}
4650
4651
			special = jQuery.event.special[ type ] || {};
4652
			type = ( selector ? special.delegateType : special.bindType ) || type;
4653
			handlers = events[ type ] || [];
4654
			tmp = tmp[ 2 ] &&
4655
				new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
4656
4657
			// Remove matching events
4658
			origCount = j = handlers.length;
4659
			while ( j-- ) {
4660
				handleObj = handlers[ j ];
4661
4662
				if ( ( mappedTypes || origType === handleObj.origType ) &&
4663
					( !handler || handler.guid === handleObj.guid ) &&
4664
					( !tmp || tmp.test( handleObj.namespace ) ) &&
4665
					( !selector || selector === handleObj.selector ||
4666
						selector === "**" && handleObj.selector ) ) {
4667
					handlers.splice( j, 1 );
4668
4669
					if ( handleObj.selector ) {
4670
						handlers.delegateCount--;
4671
					}
4672
					if ( special.remove ) {
4673
						special.remove.call( elem, handleObj );
4674
					}
4675
				}
4676
			}
4677
4678
			// Remove generic event handler if we removed something and no more handlers exist
4679
			// (avoids potential for endless recursion during removal of special event handlers)
4680
			if ( origCount && !handlers.length ) {
4681
				if ( !special.teardown ||
4682
					special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4683
4684
					jQuery.removeEvent( elem, type, elemData.handle );
4685
				}
4686
4687
				delete events[ type ];
4688
			}
4689
		}
4690
4691
		// Remove data and the expando if it's no longer used
4692
		if ( jQuery.isEmptyObject( events ) ) {
4693
			dataPriv.remove( elem, "handle events" );
4694
		}
4695
	},
4696
4697
	dispatch: function( event ) {
4698
4699
		// Make a writable jQuery.Event from the native event object
4700
		event = jQuery.event.fix( event );
4701
4702
		var i, j, ret, matched, handleObj,
4703
			handlerQueue = [],
4704
			args = slice.call( arguments ),
4705
			handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
4706
			special = jQuery.event.special[ event.type ] || {};
4707
4708
		// Use the fix-ed jQuery.Event rather than the (read-only) native event
4709
		args[ 0 ] = event;
4710
		event.delegateTarget = this;
4711
4712
		// Call the preDispatch hook for the mapped type, and let it bail if desired
4713
		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
4714
			return;
4715
		}
4716
4717
		// Determine handlers
4718
		handlerQueue = jQuery.event.handlers.call( this, event, handlers );
4719
4720
		// Run delegates first; they may want to stop propagation beneath us
4721
		i = 0;
4722
		while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
4723
			event.currentTarget = matched.elem;
4724
4725
			j = 0;
4726
			while ( ( handleObj = matched.handlers[ j++ ] ) &&
4727
				!event.isImmediatePropagationStopped() ) {
4728
4729
				// Triggered event must either 1) have no namespace, or 2) have namespace(s)
4730
				// a subset or equal to those in the bound event (both can have no namespace).
4731
				if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
4732
4733
					event.handleObj = handleObj;
4734
					event.data = handleObj.data;
4735
4736
					ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
4737
						handleObj.handler ).apply( matched.elem, args );
4738
4739
					if ( ret !== undefined ) {
4740
						if ( ( event.result = ret ) === false ) {
4741
							event.preventDefault();
4742
							event.stopPropagation();
4743
						}
4744
					}
4745
				}
4746
			}
4747
		}
4748
4749
		// Call the postDispatch hook for the mapped type
4750
		if ( special.postDispatch ) {
4751
			special.postDispatch.call( this, event );
4752
		}
4753
4754
		return event.result;
4755
	},
4756
4757
	handlers: function( event, handlers ) {
4758
		var i, matches, sel, handleObj,
4759
			handlerQueue = [],
4760
			delegateCount = handlers.delegateCount,
4761
			cur = event.target;
4762
4763
		// Support (at least): Chrome, IE9
4764
		// Find delegate handlers
4765
		// Black-hole SVG <use> instance trees (#13180)
4766
		//
4767
		// Support: Firefox<=42+
4768
		// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
4769
		if ( delegateCount && cur.nodeType &&
4770
			( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
4771
4772
			for ( ; cur !== this; cur = cur.parentNode || this ) {
4773
4774
				// Don't check non-elements (#13208)
4775
				// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
4776
				if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
4777
					matches = [];
4778
					for ( i = 0; i < delegateCount; i++ ) {
4779
						handleObj = handlers[ i ];
4780
4781
						// Don't conflict with Object.prototype properties (#13203)
4782
						sel = handleObj.selector + " ";
4783
4784
						if ( matches[ sel ] === undefined ) {
4785
							matches[ sel ] = handleObj.needsContext ?
4786
								jQuery( sel, this ).index( cur ) > -1 :
4787
								jQuery.find( sel, this, null, [ cur ] ).length;
4788
						}
4789
						if ( matches[ sel ] ) {
4790
							matches.push( handleObj );
4791
						}
4792
					}
4793
					if ( matches.length ) {
4794
						handlerQueue.push( { elem: cur, handlers: matches } );
4795
					}
4796
				}
4797
			}
4798
		}
4799
4800
		// Add the remaining (directly-bound) handlers
4801
		if ( delegateCount < handlers.length ) {
4802
			handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
4803
		}
4804
4805
		return handlerQueue;
4806
	},
4807
4808
	// Includes some event props shared by KeyEvent and MouseEvent
4809
	props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
4810
		"metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
4811
4812
	fixHooks: {},
4813
4814
	keyHooks: {
4815
		props: "char charCode key keyCode".split( " " ),
4816
		filter: function( event, original ) {
4817
4818
			// Add which for key events
4819
			if ( event.which == null ) {
4820
				event.which = original.charCode != null ? original.charCode : original.keyCode;
4821
			}
4822
4823
			return event;
4824
		}
4825
	},
4826
4827
	mouseHooks: {
4828
		props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " +
4829
			"screenX screenY toElement" ).split( " " ),
4830
		filter: function( event, original ) {
4831
			var eventDoc, doc, body,
4832
				button = original.button;
4833
4834
			// Calculate pageX/Y if missing and clientX/Y available
4835
			if ( event.pageX == null && original.clientX != null ) {
4836
				eventDoc = event.target.ownerDocument || document;
4837
				doc = eventDoc.documentElement;
4838
				body = eventDoc.body;
4839
4840
				event.pageX = original.clientX +
4841
					( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
4842
					( doc && doc.clientLeft || body && body.clientLeft || 0 );
4843
				event.pageY = original.clientY +
4844
					( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) -
4845
					( doc && doc.clientTop  || body && body.clientTop  || 0 );
4846
			}
4847
4848
			// Add which for click: 1 === left; 2 === middle; 3 === right
4849
			// Note: button is not normalized, so don't use it
4850
			if ( !event.which && button !== undefined ) {
4851
				event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4852
			}
4853
4854
			return event;
4855
		}
4856
	},
4857
4858
	fix: function( event ) {
4859
		if ( event[ jQuery.expando ] ) {
4860
			return event;
4861
		}
4862
4863
		// Create a writable copy of the event object and normalize some properties
4864
		var i, prop, copy,
4865
			type = event.type,
4866
			originalEvent = event,
4867
			fixHook = this.fixHooks[ type ];
4868
4869
		if ( !fixHook ) {
4870
			this.fixHooks[ type ] = fixHook =
4871
				rmouseEvent.test( type ) ? this.mouseHooks :
4872
				rkeyEvent.test( type ) ? this.keyHooks :
4873
				{};
4874
		}
4875
		copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4876
4877
		event = new jQuery.Event( originalEvent );
4878
4879
		i = copy.length;
4880
		while ( i-- ) {
4881
			prop = copy[ i ];
4882
			event[ prop ] = originalEvent[ prop ];
4883
		}
4884
4885
		// Support: Cordova 2.5 (WebKit) (#13255)
4886
		// All events should have a target; Cordova deviceready doesn't
4887
		if ( !event.target ) {
4888
			event.target = document;
4889
		}
4890
4891
		// Support: Safari 6.0+, Chrome<28
4892
		// Target should not be a text node (#504, #13143)
4893
		if ( event.target.nodeType === 3 ) {
4894
			event.target = event.target.parentNode;
4895
		}
4896
4897
		return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4898
	},
4899
4900
	special: {
4901
		load: {
4902
4903
			// Prevent triggered image.load events from bubbling to window.load
4904
			noBubble: true
4905
		},
4906
		focus: {
4907
4908
			// Fire native event if possible so blur/focus sequence is correct
4909
			trigger: function() {
4910
				if ( this !== safeActiveElement() && this.focus ) {
4911
					this.focus();
4912
					return false;
4913
				}
4914
			},
4915
			delegateType: "focusin"
4916
		},
4917
		blur: {
4918
			trigger: function() {
4919
				if ( this === safeActiveElement() && this.blur ) {
4920
					this.blur();
4921
					return false;
4922
				}
4923
			},
4924
			delegateType: "focusout"
4925
		},
4926
		click: {
4927
4928
			// For checkbox, fire native event so checked state will be right
4929
			trigger: function() {
4930
				if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
4931
					this.click();
4932
					return false;
4933
				}
4934
			},
4935
4936
			// For cross-browser consistency, don't fire native .click() on links
4937
			_default: function( event ) {
4938
				return jQuery.nodeName( event.target, "a" );
4939
			}
4940
		},
4941
4942
		beforeunload: {
4943
			postDispatch: function( event ) {
4944
4945
				// Support: Firefox 20+
4946
				// Firefox doesn't alert if the returnValue field is not set.
4947
				if ( event.result !== undefined && event.originalEvent ) {
4948
					event.originalEvent.returnValue = event.result;
4949
				}
4950
			}
4951
		}
4952
	}
4953
};
4954
4955
jQuery.removeEvent = function( elem, type, handle ) {
4956
4957
	// This "if" is needed for plain objects
4958
	if ( elem.removeEventListener ) {
4959
		elem.removeEventListener( type, handle );
4960
	}
4961
};
4962
4963
jQuery.Event = function( src, props ) {
4964
4965
	// Allow instantiation without the 'new' keyword
4966
	if ( !( this instanceof jQuery.Event ) ) {
4967
		return new jQuery.Event( src, props );
4968
	}
4969
4970
	// Event object
4971
	if ( src && src.type ) {
4972
		this.originalEvent = src;
4973
		this.type = src.type;
4974
4975
		// Events bubbling up the document may have been marked as prevented
4976
		// by a handler lower down the tree; reflect the correct value.
4977
		this.isDefaultPrevented = src.defaultPrevented ||
4978
				src.defaultPrevented === undefined &&
4979
4980
				// Support: Android<4.0
4981
				src.returnValue === false ?
4982
			returnTrue :
4983
			returnFalse;
4984
4985
	// Event type
4986
	} else {
4987
		this.type = src;
4988
	}
4989
4990
	// Put explicitly provided properties onto the event object
4991
	if ( props ) {
4992
		jQuery.extend( this, props );
4993
	}
4994
4995
	// Create a timestamp if incoming event doesn't have one
4996
	this.timeStamp = src && src.timeStamp || jQuery.now();
4997
4998
	// Mark it as fixed
4999
	this[ jQuery.expando ] = true;
5000
};
5001
5002
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5003
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5004
jQuery.Event.prototype = {
5005
	constructor: jQuery.Event,
5006
	isDefaultPrevented: returnFalse,
5007
	isPropagationStopped: returnFalse,
5008
	isImmediatePropagationStopped: returnFalse,
5009
5010
	preventDefault: function() {
5011
		var e = this.originalEvent;
5012
5013
		this.isDefaultPrevented = returnTrue;
5014
5015
		if ( e ) {
5016
			e.preventDefault();
5017
		}
5018
	},
5019
	stopPropagation: function() {
5020
		var e = this.originalEvent;
5021
5022
		this.isPropagationStopped = returnTrue;
5023
5024
		if ( e ) {
5025
			e.stopPropagation();
5026
		}
5027
	},
5028
	stopImmediatePropagation: function() {
5029
		var e = this.originalEvent;
5030
5031
		this.isImmediatePropagationStopped = returnTrue;
5032
5033
		if ( e ) {
5034
			e.stopImmediatePropagation();
5035
		}
5036
5037
		this.stopPropagation();
5038
	}
5039
};
5040
5041
// Create mouseenter/leave events using mouseover/out and event-time checks
5042
// so that event delegation works in jQuery.
5043
// Do the same for pointerenter/pointerleave and pointerover/pointerout
5044
//
5045
// Support: Safari 7 only
5046
// Safari sends mouseenter too often; see:
5047
// https://code.google.com/p/chromium/issues/detail?id=470258
5048
// for the description of the bug (it existed in older Chrome versions as well).
5049
jQuery.each( {
5050
	mouseenter: "mouseover",
5051
	mouseleave: "mouseout",
5052
	pointerenter: "pointerover",
5053
	pointerleave: "pointerout"
5054
}, function( orig, fix ) {
5055
	jQuery.event.special[ orig ] = {
5056
		delegateType: fix,
5057
		bindType: fix,
5058
5059
		handle: function( event ) {
5060
			var ret,
5061
				target = this,
5062
				related = event.relatedTarget,
5063
				handleObj = event.handleObj;
5064
5065
			// For mouseenter/leave call the handler if related is outside the target.
5066
			// NB: No relatedTarget if the mouse left/entered the browser window
5067
			if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
5068
				event.type = handleObj.origType;
5069
				ret = handleObj.handler.apply( this, arguments );
5070
				event.type = fix;
5071
			}
5072
			return ret;
5073
		}
5074
	};
5075
} );
5076
5077
jQuery.fn.extend( {
5078
	on: function( types, selector, data, fn ) {
5079
		return on( this, types, selector, data, fn );
5080
	},
5081
	one: function( types, selector, data, fn ) {
5082
		return on( this, types, selector, data, fn, 1 );
5083
	},
5084
	off: function( types, selector, fn ) {
5085
		var handleObj, type;
5086
		if ( types && types.preventDefault && types.handleObj ) {
5087
5088
			// ( event )  dispatched jQuery.Event
5089
			handleObj = types.handleObj;
5090
			jQuery( types.delegateTarget ).off(
5091
				handleObj.namespace ?
5092
					handleObj.origType + "." + handleObj.namespace :
5093
					handleObj.origType,
5094
				handleObj.selector,
5095
				handleObj.handler
5096
			);
5097
			return this;
5098
		}
5099
		if ( typeof types === "object" ) {
5100
5101
			// ( types-object [, selector] )
5102
			for ( type in types ) {
5103
				this.off( type, selector, types[ type ] );
5104
			}
5105
			return this;
5106
		}
5107
		if ( selector === false || typeof selector === "function" ) {
5108
5109
			// ( types [, fn] )
5110
			fn = selector;
5111
			selector = undefined;
5112
		}
5113
		if ( fn === false ) {
5114
			fn = returnFalse;
5115
		}
5116
		return this.each( function() {
5117
			jQuery.event.remove( this, types, fn, selector );
5118
		} );
5119
	}
5120
} );
5121
5122
5123
var
5124
	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
5125
5126
	// Support: IE 10-11, Edge 10240+
5127
	// In IE/Edge using regex groups here causes severe slowdowns.
5128
	// See https://connect.microsoft.com/IE/feedback/details/1736512/
5129
	rnoInnerhtml = /<script|<style|<link/i,
5130
5131
	// checked="checked" or checked
5132
	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5133
	rscriptTypeMasked = /^true\/(.*)/,
5134
	rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5135
5136
// Manipulating tables requires a tbody
5137
function manipulationTarget( elem, content ) {
5138
	return jQuery.nodeName( elem, "table" ) &&
5139
		jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
5140
5141
		elem.getElementsByTagName( "tbody" )[ 0 ] ||
5142
			elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
5143
		elem;
5144
}
5145
5146
// Replace/restore the type attribute of script elements for safe DOM manipulation
5147
function disableScript( elem ) {
5148
	elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
5149
	return elem;
5150
}
5151
function restoreScript( elem ) {
5152
	var match = rscriptTypeMasked.exec( elem.type );
5153
5154
	if ( match ) {
5155
		elem.type = match[ 1 ];
5156
	} else {
5157
		elem.removeAttribute( "type" );
5158
	}
5159
5160
	return elem;
5161
}
5162
5163
function cloneCopyEvent( src, dest ) {
5164
	var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
5165
5166
	if ( dest.nodeType !== 1 ) {
5167
		return;
5168
	}
5169
5170
	// 1. Copy private data: events, handlers, etc.
5171
	if ( dataPriv.hasData( src ) ) {
5172
		pdataOld = dataPriv.access( src );
5173
		pdataCur = dataPriv.set( dest, pdataOld );
5174
		events = pdataOld.events;
5175
5176
		if ( events ) {
5177
			delete pdataCur.handle;
5178
			pdataCur.events = {};
5179
5180
			for ( type in events ) {
5181
				for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5182
					jQuery.event.add( dest, type, events[ type ][ i ] );
5183
				}
5184
			}
5185
		}
5186
	}
5187
5188
	// 2. Copy user data
5189
	if ( dataUser.hasData( src ) ) {
5190
		udataOld = dataUser.access( src );
5191
		udataCur = jQuery.extend( {}, udataOld );
5192
5193
		dataUser.set( dest, udataCur );
5194
	}
5195
}
5196
5197
// Fix IE bugs, see support tests
5198
function fixInput( src, dest ) {
5199
	var nodeName = dest.nodeName.toLowerCase();
5200
5201
	// Fails to persist the checked state of a cloned checkbox or radio button.
5202
	if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5203
		dest.checked = src.checked;
5204
5205
	// Fails to return the selected option to the default selected state when cloning options
5206
	} else if ( nodeName === "input" || nodeName === "textarea" ) {
5207
		dest.defaultValue = src.defaultValue;
5208
	}
5209
}
5210
5211
function domManip( collection, args, callback, ignored ) {
5212
5213
	// Flatten any nested arrays
5214
	args = concat.apply( [], args );
5215
5216
	var fragment, first, scripts, hasScripts, node, doc,
5217
		i = 0,
5218
		l = collection.length,
5219
		iNoClone = l - 1,
5220
		value = args[ 0 ],
5221
		isFunction = jQuery.isFunction( value );
5222
5223
	// We can't cloneNode fragments that contain checked, in WebKit
5224
	if ( isFunction ||
5225
			( l > 1 && typeof value === "string" &&
5226
				!support.checkClone && rchecked.test( value ) ) ) {
5227
		return collection.each( function( index ) {
5228
			var self = collection.eq( index );
5229
			if ( isFunction ) {
5230
				args[ 0 ] = value.call( this, index, self.html() );
5231
			}
5232
			domManip( self, args, callback, ignored );
5233
		} );
5234
	}
5235
5236
	if ( l ) {
5237
		fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
5238
		first = fragment.firstChild;
5239
5240
		if ( fragment.childNodes.length === 1 ) {
5241
			fragment = first;
5242
		}
5243
5244
		// Require either new content or an interest in ignored elements to invoke the callback
5245
		if ( first || ignored ) {
5246
			scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5247
			hasScripts = scripts.length;
5248
5249
			// Use the original fragment for the last item
5250
			// instead of the first because it can end up
5251
			// being emptied incorrectly in certain situations (#8070).
5252
			for ( ; i < l; i++ ) {
5253
				node = fragment;
5254
5255
				if ( i !== iNoClone ) {
5256
					node = jQuery.clone( node, true, true );
5257
5258
					// Keep references to cloned scripts for later restoration
5259
					if ( hasScripts ) {
5260
5261
						// Support: Android<4.1, PhantomJS<2
5262
						// push.apply(_, arraylike) throws on ancient WebKit
5263
						jQuery.merge( scripts, getAll( node, "script" ) );
5264
					}
5265
				}
5266
5267
				callback.call( collection[ i ], node, i );
5268
			}
5269
5270
			if ( hasScripts ) {
5271
				doc = scripts[ scripts.length - 1 ].ownerDocument;
5272
5273
				// Reenable scripts
5274
				jQuery.map( scripts, restoreScript );
5275
5276
				// Evaluate executable scripts on first document insertion
5277
				for ( i = 0; i < hasScripts; i++ ) {
5278
					node = scripts[ i ];
5279
					if ( rscriptType.test( node.type || "" ) &&
5280
						!dataPriv.access( node, "globalEval" ) &&
5281
						jQuery.contains( doc, node ) ) {
5282
5283
						if ( node.src ) {
5284
5285
							// Optional AJAX dependency, but won't run scripts if not present
5286
							if ( jQuery._evalUrl ) {
5287
								jQuery._evalUrl( node.src );
5288
							}
5289
						} else {
5290
							jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
5291
						}
5292
					}
5293
				}
5294
			}
5295
		}
5296
	}
5297
5298
	return collection;
5299
}
5300
5301
function remove( elem, selector, keepData ) {
5302
	var node,
5303
		nodes = selector ? jQuery.filter( selector, elem ) : elem,
5304
		i = 0;
5305
5306
	for ( ; ( node = nodes[ i ] ) != null; i++ ) {
5307
		if ( !keepData && node.nodeType === 1 ) {
5308
			jQuery.cleanData( getAll( node ) );
5309
		}
5310
5311
		if ( node.parentNode ) {
5312
			if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
5313
				setGlobalEval( getAll( node, "script" ) );
5314
			}
5315
			node.parentNode.removeChild( node );
5316
		}
5317
	}
5318
5319
	return elem;
5320
}
5321
5322
jQuery.extend( {
5323
	htmlPrefilter: function( html ) {
5324
		return html.replace( rxhtmlTag, "<$1></$2>" );
5325
	},
5326
5327
	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5328
		var i, l, srcElements, destElements,
5329
			clone = elem.cloneNode( true ),
5330
			inPage = jQuery.contains( elem.ownerDocument, elem );
5331
5332
		// Fix IE cloning issues
5333
		if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
5334
				!jQuery.isXMLDoc( elem ) ) {
5335
5336
			// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
5337
			destElements = getAll( clone );
5338
			srcElements = getAll( elem );
5339
5340
			for ( i = 0, l = srcElements.length; i < l; i++ ) {
5341
				fixInput( srcElements[ i ], destElements[ i ] );
5342
			}
5343
		}
5344
5345
		// Copy the events from the original to the clone
5346
		if ( dataAndEvents ) {
5347
			if ( deepDataAndEvents ) {
5348
				srcElements = srcElements || getAll( elem );
5349
				destElements = destElements || getAll( clone );
5350
5351
				for ( i = 0, l = srcElements.length; i < l; i++ ) {
5352
					cloneCopyEvent( srcElements[ i ], destElements[ i ] );
5353
				}
5354
			} else {
5355
				cloneCopyEvent( elem, clone );
5356
			}
5357
		}
5358
5359
		// Preserve script evaluation history
5360
		destElements = getAll( clone, "script" );
5361
		if ( destElements.length > 0 ) {
5362
			setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5363
		}
5364
5365
		// Return the cloned set
5366
		return clone;
5367
	},
5368
5369
	cleanData: function( elems ) {
5370
		var data, elem, type,
5371
			special = jQuery.event.special,
5372
			i = 0;
5373
5374
		for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
5375
			if ( acceptData( elem ) ) {
5376
				if ( ( data = elem[ dataPriv.expando ] ) ) {
5377
					if ( data.events ) {
5378
						for ( type in data.events ) {
5379
							if ( special[ type ] ) {
5380
								jQuery.event.remove( elem, type );
5381
5382
							// This is a shortcut to avoid jQuery.event.remove's overhead
5383
							} else {
5384
								jQuery.removeEvent( elem, type, data.handle );
5385
							}
5386
						}
5387
					}
5388
5389
					// Support: Chrome <= 35-45+
5390
					// Assign undefined instead of using delete, see Data#remove
5391
					elem[ dataPriv.expando ] = undefined;
5392
				}
5393
				if ( elem[ dataUser.expando ] ) {
5394
5395
					// Support: Chrome <= 35-45+
5396
					// Assign undefined instead of using delete, see Data#remove
5397
					elem[ dataUser.expando ] = undefined;
5398
				}
5399
			}
5400
		}
5401
	}
5402
} );
5403
5404
jQuery.fn.extend( {
5405
5406
	// Keep domManip exposed until 3.0 (gh-2225)
5407
	domManip: domManip,
5408
5409
	detach: function( selector ) {
5410
		return remove( this, selector, true );
5411
	},
5412
5413
	remove: function( selector ) {
5414
		return remove( this, selector );
5415
	},
5416
5417
	text: function( value ) {
5418
		return access( this, function( value ) {
5419
			return value === undefined ?
5420
				jQuery.text( this ) :
5421
				this.empty().each( function() {
5422
					if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5423
						this.textContent = value;
5424
					}
5425
				} );
5426
		}, null, value, arguments.length );
5427
	},
5428
5429
	append: function() {
5430
		return domManip( this, arguments, function( elem ) {
5431
			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5432
				var target = manipulationTarget( this, elem );
5433
				target.appendChild( elem );
5434
			}
5435
		} );
5436
	},
5437
5438
	prepend: function() {
5439
		return domManip( this, arguments, function( elem ) {
5440
			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5441
				var target = manipulationTarget( this, elem );
5442
				target.insertBefore( elem, target.firstChild );
5443
			}
5444
		} );
5445
	},
5446
5447
	before: function() {
5448
		return domManip( this, arguments, function( elem ) {
5449
			if ( this.parentNode ) {
5450
				this.parentNode.insertBefore( elem, this );
5451
			}
5452
		} );
5453
	},
5454
5455
	after: function() {
5456
		return domManip( this, arguments, function( elem ) {
5457
			if ( this.parentNode ) {
5458
				this.parentNode.insertBefore( elem, this.nextSibling );
5459
			}
5460
		} );
5461
	},
5462
5463
	empty: function() {
5464
		var elem,
5465
			i = 0;
5466
5467
		for ( ; ( elem = this[ i ] ) != null; i++ ) {
5468
			if ( elem.nodeType === 1 ) {
5469
5470
				// Prevent memory leaks
5471
				jQuery.cleanData( getAll( elem, false ) );
5472
5473
				// Remove any remaining nodes
5474
				elem.textContent = "";
5475
			}
5476
		}
5477
5478
		return this;
5479
	},
5480
5481
	clone: function( dataAndEvents, deepDataAndEvents ) {
5482
		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5483
		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5484
5485
		return this.map( function() {
5486
			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5487
		} );
5488
	},
5489
5490
	html: function( value ) {
5491
		return access( this, function( value ) {
5492
			var elem = this[ 0 ] || {},
5493
				i = 0,
5494
				l = this.length;
5495
5496
			if ( value === undefined && elem.nodeType === 1 ) {
5497
				return elem.innerHTML;
5498
			}
5499
5500
			// See if we can take a shortcut and just use innerHTML
5501
			if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5502
				!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
5503
5504
				value = jQuery.htmlPrefilter( value );
5505
5506
				try {
5507
					for ( ; i < l; i++ ) {
5508
						elem = this[ i ] || {};
5509
5510
						// Remove element nodes and prevent memory leaks
5511
						if ( elem.nodeType === 1 ) {
5512
							jQuery.cleanData( getAll( elem, false ) );
5513
							elem.innerHTML = value;
5514
						}
5515
					}
5516
5517
					elem = 0;
5518
5519
				// If using innerHTML throws an exception, use the fallback method
5520
				} catch ( e ) {}
5521
			}
5522
5523
			if ( elem ) {
5524
				this.empty().append( value );
5525
			}
5526
		}, null, value, arguments.length );
5527
	},
5528
5529
	replaceWith: function() {
5530
		var ignored = [];
5531
5532
		// Make the changes, replacing each non-ignored context element with the new content
5533
		return domManip( this, arguments, function( elem ) {
5534
			var parent = this.parentNode;
5535
5536
			if ( jQuery.inArray( this, ignored ) < 0 ) {
5537
				jQuery.cleanData( getAll( this ) );
5538
				if ( parent ) {
5539
					parent.replaceChild( elem, this );
5540
				}
5541
			}
5542
5543
		// Force callback invocation
5544
		}, ignored );
5545
	}
5546
} );
5547
5548
jQuery.each( {
5549
	appendTo: "append",
5550
	prependTo: "prepend",
5551
	insertBefore: "before",
5552
	insertAfter: "after",
5553
	replaceAll: "replaceWith"
5554
}, function( name, original ) {
5555
	jQuery.fn[ name ] = function( selector ) {
5556
		var elems,
5557
			ret = [],
5558
			insert = jQuery( selector ),
5559
			last = insert.length - 1,
5560
			i = 0;
5561
5562
		for ( ; i <= last; i++ ) {
5563
			elems = i === last ? this : this.clone( true );
5564
			jQuery( insert[ i ] )[ original ]( elems );
5565
5566
			// Support: QtWebKit
5567
			// .get() because push.apply(_, arraylike) throws
5568
			push.apply( ret, elems.get() );
5569
		}
5570
5571
		return this.pushStack( ret );
5572
	};
5573
} );
5574
5575
5576
var iframe,
5577
	elemdisplay = {
5578
5579
		// Support: Firefox
5580
		// We have to pre-define these values for FF (#10227)
5581
		HTML: "block",
5582
		BODY: "block"
5583
	};
5584
5585
/**
5586
 * Retrieve the actual display of a element
5587
 * @param {String} name nodeName of the element
5588
 * @param {Object} doc Document object
5589
 */
5590
5591
// Called only from within defaultDisplay
5592
function actualDisplay( name, doc ) {
5593
	var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
5594
5595
		display = jQuery.css( elem[ 0 ], "display" );
5596
5597
	// We don't have any data stored on the element,
5598
	// so use "detach" method as fast way to get rid of the element
5599
	elem.detach();
5600
5601
	return display;
5602
}
5603
5604
/**
5605
 * Try to determine the default display value of an element
5606
 * @param {String} nodeName
5607
 */
5608
function defaultDisplay( nodeName ) {
5609
	var doc = document,
5610
		display = elemdisplay[ nodeName ];
5611
5612
	if ( !display ) {
5613
		display = actualDisplay( nodeName, doc );
5614
5615
		// If the simple way fails, read from inside an iframe
5616
		if ( display === "none" || !display ) {
5617
5618
			// Use the already-created iframe if possible
5619
			iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
5620
				.appendTo( doc.documentElement );
5621
5622
			// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
5623
			doc = iframe[ 0 ].contentDocument;
5624
5625
			// Support: IE
5626
			doc.write();
5627
			doc.close();
5628
5629
			display = actualDisplay( nodeName, doc );
5630
			iframe.detach();
5631
		}
5632
5633
		// Store the correct default display
5634
		elemdisplay[ nodeName ] = display;
5635
	}
5636
5637
	return display;
5638
}
5639
var rmargin = ( /^margin/ );
5640
5641
var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
5642
5643
var getStyles = function( elem ) {
5644
5645
		// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
5646
		// IE throws on elements created in popups
5647
		// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
5648
		var view = elem.ownerDocument.defaultView;
5649
5650
		if ( !view || !view.opener ) {
5651
			view = window;
5652
		}
5653
5654
		return view.getComputedStyle( elem );
5655
	};
5656
5657
var swap = function( elem, options, callback, args ) {
5658
	var ret, name,
5659
		old = {};
5660
5661
	// Remember the old values, and insert the new ones
5662
	for ( name in options ) {
5663
		old[ name ] = elem.style[ name ];
5664
		elem.style[ name ] = options[ name ];
5665
	}
5666
5667
	ret = callback.apply( elem, args || [] );
5668
5669
	// Revert the old values
5670
	for ( name in options ) {
5671
		elem.style[ name ] = old[ name ];
5672
	}
5673
5674
	return ret;
5675
};
5676
5677
5678
var documentElement = document.documentElement;
5679
5680
5681
5682
( function() {
5683
	var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
5684
		container = document.createElement( "div" ),
5685
		div = document.createElement( "div" );
5686
5687
	// Finish early in limited (non-browser) environments
5688
	if ( !div.style ) {
5689
		return;
5690
	}
5691
5692
	// Support: IE9-11+
5693
	// Style of cloned element affects source element cloned (#8908)
5694
	div.style.backgroundClip = "content-box";
5695
	div.cloneNode( true ).style.backgroundClip = "";
5696
	support.clearCloneStyle = div.style.backgroundClip === "content-box";
5697
5698
	container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
5699
		"padding:0;margin-top:1px;position:absolute";
5700
	container.appendChild( div );
5701
5702
	// Executing both pixelPosition & boxSizingReliable tests require only one layout
5703
	// so they're executed at the same time to save the second computation.
5704
	function computeStyleTests() {
5705
		div.style.cssText =
5706
5707
			// Support: Firefox<29, Android 2.3
5708
			// Vendor-prefix box-sizing
5709
			"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
5710
			"position:relative;display:block;" +
5711
			"margin:auto;border:1px;padding:1px;" +
5712
			"top:1%;width:50%";
5713
		div.innerHTML = "";
5714
		documentElement.appendChild( container );
5715
5716
		var divStyle = window.getComputedStyle( div );
5717
		pixelPositionVal = divStyle.top !== "1%";
5718
		reliableMarginLeftVal = divStyle.marginLeft === "2px";
5719
		boxSizingReliableVal = divStyle.width === "4px";
5720
5721
		// Support: Android 4.0 - 4.3 only
5722
		// Some styles come back with percentage values, even though they shouldn't
5723
		div.style.marginRight = "50%";
5724
		pixelMarginRightVal = divStyle.marginRight === "4px";
5725
5726
		documentElement.removeChild( container );
5727
	}
5728
5729
	jQuery.extend( support, {
5730
		pixelPosition: function() {
5731
5732
			// This test is executed only once but we still do memoizing
5733
			// since we can use the boxSizingReliable pre-computing.
5734
			// No need to check if the test was already performed, though.
5735
			computeStyleTests();
5736
			return pixelPositionVal;
5737
		},
5738
		boxSizingReliable: function() {
5739
			if ( boxSizingReliableVal == null ) {
5740
				computeStyleTests();
5741
			}
5742
			return boxSizingReliableVal;
5743
		},
5744
		pixelMarginRight: function() {
5745
5746
			// Support: Android 4.0-4.3
5747
			// We're checking for boxSizingReliableVal here instead of pixelMarginRightVal
5748
			// since that compresses better and they're computed together anyway.
5749
			if ( boxSizingReliableVal == null ) {
5750
				computeStyleTests();
5751
			}
5752
			return pixelMarginRightVal;
5753
		},
5754
		reliableMarginLeft: function() {
5755
5756
			// Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
5757
			if ( boxSizingReliableVal == null ) {
5758
				computeStyleTests();
5759
			}
5760
			return reliableMarginLeftVal;
5761
		},
5762
		reliableMarginRight: function() {
5763
5764
			// Support: Android 2.3
5765
			// Check if div with explicit width and no margin-right incorrectly
5766
			// gets computed margin-right based on width of container. (#3333)
5767
			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
5768
			// This support function is only executed once so no memoizing is needed.
5769
			var ret,
5770
				marginDiv = div.appendChild( document.createElement( "div" ) );
5771
5772
			// Reset CSS: box-sizing; display; margin; border; padding
5773
			marginDiv.style.cssText = div.style.cssText =
5774
5775
				// Support: Android 2.3
5776
				// Vendor-prefix box-sizing
5777
				"-webkit-box-sizing:content-box;box-sizing:content-box;" +
5778
				"display:block;margin:0;border:0;padding:0";
5779
			marginDiv.style.marginRight = marginDiv.style.width = "0";
5780
			div.style.width = "1px";
5781
			documentElement.appendChild( container );
5782
5783
			ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
5784
5785
			documentElement.removeChild( container );
5786
			div.removeChild( marginDiv );
5787
5788
			return ret;
5789
		}
5790
	} );
5791
} )();
5792
5793
5794
function curCSS( elem, name, computed ) {
5795
	var width, minWidth, maxWidth, ret,
5796
		style = elem.style;
5797
5798
	computed = computed || getStyles( elem );
5799
	ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
5800
5801
	// Support: Opera 12.1x only
5802
	// Fall back to style even without computed
5803
	// computed is undefined for elems on document fragments
5804
	if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
5805
		ret = jQuery.style( elem, name );
5806
	}
5807
5808
	// Support: IE9
5809
	// getPropertyValue is only needed for .css('filter') (#12537)
5810
	if ( computed ) {
5811
5812
		// A tribute to the "awesome hack by Dean Edwards"
5813
		// Android Browser returns percentage for some values,
5814
		// but width seems to be reliably pixels.
5815
		// This is against the CSSOM draft spec:
5816
		// http://dev.w3.org/csswg/cssom/#resolved-values
5817
		if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
5818
5819
			// Remember the original values
5820
			width = style.width;
5821
			minWidth = style.minWidth;
5822
			maxWidth = style.maxWidth;
5823
5824
			// Put in the new values to get a computed value out
5825
			style.minWidth = style.maxWidth = style.width = ret;
5826
			ret = computed.width;
5827
5828
			// Revert the changed values
5829
			style.width = width;
5830
			style.minWidth = minWidth;
5831
			style.maxWidth = maxWidth;
5832
		}
5833
	}
5834
5835
	return ret !== undefined ?
5836
5837
		// Support: IE9-11+
5838
		// IE returns zIndex value as an integer.
5839
		ret + "" :
5840
		ret;
5841
}
5842
5843
5844
function addGetHookIf( conditionFn, hookFn ) {
5845
5846
	// Define the hook, we'll check on the first run if it's really needed.
5847
	return {
5848
		get: function() {
5849
			if ( conditionFn() ) {
5850
5851
				// Hook not needed (or it's not possible to use it due
5852
				// to missing dependency), remove it.
5853
				delete this.get;
5854
				return;
5855
			}
5856
5857
			// Hook needed; redefine it so that the support test is not executed again.
5858
			return ( this.get = hookFn ).apply( this, arguments );
5859
		}
5860
	};
5861
}
5862
5863
5864
var
5865
5866
	// Swappable if display is none or starts with table
5867
	// except "table", "table-cell", or "table-caption"
5868
	// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
5869
	rdisplayswap = /^(none|table(?!-c[ea]).+)/,
5870
5871
	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
5872
	cssNormalTransform = {
5873
		letterSpacing: "0",
5874
		fontWeight: "400"
5875
	},
5876
5877
	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
5878
	emptyStyle = document.createElement( "div" ).style;
5879
5880
// Return a css property mapped to a potentially vendor prefixed property
5881
function vendorPropName( name ) {
5882
5883
	// Shortcut for names that are not vendor prefixed
5884
	if ( name in emptyStyle ) {
5885
		return name;
5886
	}
5887
5888
	// Check for vendor prefixed names
5889
	var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
5890
		i = cssPrefixes.length;
5891
5892
	while ( i-- ) {
5893
		name = cssPrefixes[ i ] + capName;
5894
		if ( name in emptyStyle ) {
5895
			return name;
5896
		}
5897
	}
5898
}
5899
5900
function setPositiveNumber( elem, value, subtract ) {
5901
5902
	// Any relative (+/-) values have already been
5903
	// normalized at this point
5904
	var matches = rcssNum.exec( value );
5905
	return matches ?
5906
5907
		// Guard against undefined "subtract", e.g., when used as in cssHooks
5908
		Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
5909
		value;
5910
}
5911
5912
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
5913
	var i = extra === ( isBorderBox ? "border" : "content" ) ?
5914
5915
		// If we already have the right measurement, avoid augmentation
5916
		4 :
5917
5918
		// Otherwise initialize for horizontal or vertical properties
5919
		name === "width" ? 1 : 0,
5920
5921
		val = 0;
5922
5923
	for ( ; i < 4; i += 2 ) {
5924
5925
		// Both box models exclude margin, so add it if we want it
5926
		if ( extra === "margin" ) {
5927
			val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
5928
		}
5929
5930
		if ( isBorderBox ) {
5931
5932
			// border-box includes padding, so remove it if we want content
5933
			if ( extra === "content" ) {
5934
				val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
5935
			}
5936
5937
			// At this point, extra isn't border nor margin, so remove border
5938
			if ( extra !== "margin" ) {
5939
				val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
5940
			}
5941
		} else {
5942
5943
			// At this point, extra isn't content, so add padding
5944
			val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
5945
5946
			// At this point, extra isn't content nor padding, so add border
5947
			if ( extra !== "padding" ) {
5948
				val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
5949
			}
5950
		}
5951
	}
5952
5953
	return val;
5954
}
5955
5956
function getWidthOrHeight( elem, name, extra ) {
5957
5958
	// Start with offset property, which is equivalent to the border-box value
5959
	var valueIsBorderBox = true,
5960
		val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
5961
		styles = getStyles( elem ),
5962
		isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
5963
5964
	// Support: IE11 only
5965
	// In IE 11 fullscreen elements inside of an iframe have
5966
	// 100x too small dimensions (gh-1764).
5967
	if ( document.msFullscreenElement && window.top !== window ) {
5968
5969
		// Support: IE11 only
5970
		// Running getBoundingClientRect on a disconnected node
5971
		// in IE throws an error.
5972
		if ( elem.getClientRects().length ) {
5973
			val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
5974
		}
5975
	}
5976
5977
	// Some non-html elements return undefined for offsetWidth, so check for null/undefined
5978
	// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
5979
	// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
5980
	if ( val <= 0 || val == null ) {
5981
5982
		// Fall back to computed then uncomputed css if necessary
5983
		val = curCSS( elem, name, styles );
5984
		if ( val < 0 || val == null ) {
5985
			val = elem.style[ name ];
5986
		}
5987
5988
		// Computed unit is not pixels. Stop here and return.
5989
		if ( rnumnonpx.test( val ) ) {
5990
			return val;
5991
		}
5992
5993
		// Check for style in case a browser which returns unreliable values
5994
		// for getComputedStyle silently falls back to the reliable elem.style
5995
		valueIsBorderBox = isBorderBox &&
5996
			( support.boxSizingReliable() || val === elem.style[ name ] );
5997
5998
		// Normalize "", auto, and prepare for extra
5999
		val = parseFloat( val ) || 0;
6000
	}
6001
6002
	// Use the active box-sizing model to add/subtract irrelevant styles
6003
	return ( val +
6004
		augmentWidthOrHeight(
6005
			elem,
6006
			name,
6007
			extra || ( isBorderBox ? "border" : "content" ),
6008
			valueIsBorderBox,
6009
			styles
6010
		)
6011
	) + "px";
6012
}
6013
6014
function showHide( elements, show ) {
6015
	var display, elem, hidden,
6016
		values = [],
6017
		index = 0,
6018
		length = elements.length;
6019
6020
	for ( ; index < length; index++ ) {
6021
		elem = elements[ index ];
6022
		if ( !elem.style ) {
6023
			continue;
6024
		}
6025
6026
		values[ index ] = dataPriv.get( elem, "olddisplay" );
6027
		display = elem.style.display;
6028
		if ( show ) {
6029
6030
			// Reset the inline display of this element to learn if it is
6031
			// being hidden by cascaded rules or not
6032
			if ( !values[ index ] && display === "none" ) {
6033
				elem.style.display = "";
6034
			}
6035
6036
			// Set elements which have been overridden with display: none
6037
			// in a stylesheet to whatever the default browser style is
6038
			// for such an element
6039
			if ( elem.style.display === "" && isHidden( elem ) ) {
6040
				values[ index ] = dataPriv.access(
6041
					elem,
6042
					"olddisplay",
6043
					defaultDisplay( elem.nodeName )
6044
				);
6045
			}
6046
		} else {
6047
			hidden = isHidden( elem );
6048
6049
			if ( display !== "none" || !hidden ) {
6050
				dataPriv.set(
6051
					elem,
6052
					"olddisplay",
6053
					hidden ? display : jQuery.css( elem, "display" )
6054
				);
6055
			}
6056
		}
6057
	}
6058
6059
	// Set the display of most of the elements in a second loop
6060
	// to avoid the constant reflow
6061
	for ( index = 0; index < length; index++ ) {
6062
		elem = elements[ index ];
6063
		if ( !elem.style ) {
6064
			continue;
6065
		}
6066
		if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6067
			elem.style.display = show ? values[ index ] || "" : "none";
6068
		}
6069
	}
6070
6071
	return elements;
6072
}
6073
6074
jQuery.extend( {
6075
6076
	// Add in style property hooks for overriding the default
6077
	// behavior of getting and setting a style property
6078
	cssHooks: {
6079
		opacity: {
6080
			get: function( elem, computed ) {
6081
				if ( computed ) {
6082
6083
					// We should always get a number back from opacity
6084
					var ret = curCSS( elem, "opacity" );
6085
					return ret === "" ? "1" : ret;
6086
				}
6087
			}
6088
		}
6089
	},
6090
6091
	// Don't automatically add "px" to these possibly-unitless properties
6092
	cssNumber: {
6093
		"animationIterationCount": true,
6094
		"columnCount": true,
6095
		"fillOpacity": true,
6096
		"flexGrow": true,
6097
		"flexShrink": true,
6098
		"fontWeight": true,
6099
		"lineHeight": true,
6100
		"opacity": true,
6101
		"order": true,
6102
		"orphans": true,
6103
		"widows": true,
6104
		"zIndex": true,
6105
		"zoom": true
6106
	},
6107
6108
	// Add in properties whose names you wish to fix before
6109
	// setting or getting the value
6110
	cssProps: {
6111
		"float": "cssFloat"
6112
	},
6113
6114
	// Get and set the style property on a DOM Node
6115
	style: function( elem, name, value, extra ) {
6116
6117
		// Don't set styles on text and comment nodes
6118
		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6119
			return;
6120
		}
6121
6122
		// Make sure that we're working with the right name
6123
		var ret, type, hooks,
6124
			origName = jQuery.camelCase( name ),
6125
			style = elem.style;
6126
6127
		name = jQuery.cssProps[ origName ] ||
6128
			( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
6129
6130
		// Gets hook for the prefixed version, then unprefixed version
6131
		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6132
6133
		// Check if we're setting a value
6134
		if ( value !== undefined ) {
6135
			type = typeof value;
6136
6137
			// Convert "+=" or "-=" to relative numbers (#7345)
6138
			if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6139
				value = adjustCSS( elem, name, ret );
6140
6141
				// Fixes bug #9237
6142
				type = "number";
6143
			}
6144
6145
			// Make sure that null and NaN values aren't set (#7116)
6146
			if ( value == null || value !== value ) {
6147
				return;
6148
			}
6149
6150
			// If a number was passed in, add the unit (except for certain CSS properties)
6151
			if ( type === "number" ) {
6152
				value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
6153
			}
6154
6155
			// Support: IE9-11+
6156
			// background-* props affect original clone's values
6157
			if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
6158
				style[ name ] = "inherit";
6159
			}
6160
6161
			// If a hook was provided, use that value, otherwise just set the specified value
6162
			if ( !hooks || !( "set" in hooks ) ||
6163
				( value = hooks.set( elem, value, extra ) ) !== undefined ) {
6164
6165
				style[ name ] = value;
6166
			}
6167
6168
		} else {
6169
6170
			// If a hook was provided get the non-computed value from there
6171
			if ( hooks && "get" in hooks &&
6172
				( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
6173
6174
				return ret;
6175
			}
6176
6177
			// Otherwise just get the value from the style object
6178
			return style[ name ];
6179
		}
6180
	},
6181
6182
	css: function( elem, name, extra, styles ) {
6183
		var val, num, hooks,
6184
			origName = jQuery.camelCase( name );
6185
6186
		// Make sure that we're working with the right name
6187
		name = jQuery.cssProps[ origName ] ||
6188
			( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
6189
6190
		// Try prefixed name followed by the unprefixed name
6191
		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6192
6193
		// If a hook was provided get the computed value from there
6194
		if ( hooks && "get" in hooks ) {
6195
			val = hooks.get( elem, true, extra );
6196
		}
6197
6198
		// Otherwise, if a way to get the computed value exists, use that
6199
		if ( val === undefined ) {
6200
			val = curCSS( elem, name, styles );
6201
		}
6202
6203
		// Convert "normal" to computed value
6204
		if ( val === "normal" && name in cssNormalTransform ) {
6205
			val = cssNormalTransform[ name ];
6206
		}
6207
6208
		// Make numeric if forced or a qualifier was provided and val looks numeric
6209
		if ( extra === "" || extra ) {
6210
			num = parseFloat( val );
6211
			return extra === true || isFinite( num ) ? num || 0 : val;
6212
		}
6213
		return val;
6214
	}
6215
} );
6216
6217
jQuery.each( [ "height", "width" ], function( i, name ) {
6218
	jQuery.cssHooks[ name ] = {
6219
		get: function( elem, computed, extra ) {
6220
			if ( computed ) {
6221
6222
				// Certain elements can have dimension info if we invisibly show them
6223
				// but it must have a current display style that would benefit
6224
				return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
6225
					elem.offsetWidth === 0 ?
6226
						swap( elem, cssShow, function() {
6227
							return getWidthOrHeight( elem, name, extra );
6228
						} ) :
6229
						getWidthOrHeight( elem, name, extra );
6230
			}
6231
		},
6232
6233
		set: function( elem, value, extra ) {
6234
			var matches,
6235
				styles = extra && getStyles( elem ),
6236
				subtract = extra && augmentWidthOrHeight(
6237
					elem,
6238
					name,
6239
					extra,
6240
					jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6241
					styles
6242
				);
6243
6244
			// Convert to pixels if value adjustment is needed
6245
			if ( subtract && ( matches = rcssNum.exec( value ) ) &&
6246
				( matches[ 3 ] || "px" ) !== "px" ) {
6247
6248
				elem.style[ name ] = value;
6249
				value = jQuery.css( elem, name );
6250
			}
6251
6252
			return setPositiveNumber( elem, value, subtract );
6253
		}
6254
	};
6255
} );
6256
6257
jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
6258
	function( elem, computed ) {
6259
		if ( computed ) {
6260
			return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
6261
				elem.getBoundingClientRect().left -
6262
					swap( elem, { marginLeft: 0 }, function() {
6263
						return elem.getBoundingClientRect().left;
6264
					} )
6265
				) + "px";
6266
		}
6267
	}
6268
);
6269
6270
// Support: Android 2.3
6271
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
6272
	function( elem, computed ) {
6273
		if ( computed ) {
6274
			return swap( elem, { "display": "inline-block" },
6275
				curCSS, [ elem, "marginRight" ] );
6276
		}
6277
	}
6278
);
6279
6280
// These hooks are used by animate to expand properties
6281
jQuery.each( {
6282
	margin: "",
6283
	padding: "",
6284
	border: "Width"
6285
}, function( prefix, suffix ) {
6286
	jQuery.cssHooks[ prefix + suffix ] = {
6287
		expand: function( value ) {
6288
			var i = 0,
6289
				expanded = {},
6290
6291
				// Assumes a single number if not a string
6292
				parts = typeof value === "string" ? value.split( " " ) : [ value ];
6293
6294
			for ( ; i < 4; i++ ) {
6295
				expanded[ prefix + cssExpand[ i ] + suffix ] =
6296
					parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6297
			}
6298
6299
			return expanded;
6300
		}
6301
	};
6302
6303
	if ( !rmargin.test( prefix ) ) {
6304
		jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6305
	}
6306
} );
6307
6308
jQuery.fn.extend( {
6309
	css: function( name, value ) {
6310
		return access( this, function( elem, name, value ) {
6311
			var styles, len,
6312
				map = {},
6313
				i = 0;
6314
6315
			if ( jQuery.isArray( name ) ) {
6316
				styles = getStyles( elem );
6317
				len = name.length;
6318
6319
				for ( ; i < len; i++ ) {
6320
					map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6321
				}
6322
6323
				return map;
6324
			}
6325
6326
			return value !== undefined ?
6327
				jQuery.style( elem, name, value ) :
6328
				jQuery.css( elem, name );
6329
		}, name, value, arguments.length > 1 );
6330
	},
6331
	show: function() {
6332
		return showHide( this, true );
6333
	},
6334
	hide: function() {
6335
		return showHide( this );
6336
	},
6337
	toggle: function( state ) {
6338
		if ( typeof state === "boolean" ) {
6339
			return state ? this.show() : this.hide();
6340
		}
6341
6342
		return this.each( function() {
6343
			if ( isHidden( this ) ) {
6344
				jQuery( this ).show();
6345
			} else {
6346
				jQuery( this ).hide();
6347
			}
6348
		} );
6349
	}
6350
} );
6351
6352
6353
function Tween( elem, options, prop, end, easing ) {
6354
	return new Tween.prototype.init( elem, options, prop, end, easing );
6355
}
6356
jQuery.Tween = Tween;
6357
6358
Tween.prototype = {
6359
	constructor: Tween,
6360
	init: function( elem, options, prop, end, easing, unit ) {
6361
		this.elem = elem;
6362
		this.prop = prop;
6363
		this.easing = easing || jQuery.easing._default;
6364
		this.options = options;
6365
		this.start = this.now = this.cur();
6366
		this.end = end;
6367
		this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6368
	},
6369
	cur: function() {
6370
		var hooks = Tween.propHooks[ this.prop ];
6371
6372
		return hooks && hooks.get ?
6373
			hooks.get( this ) :
6374
			Tween.propHooks._default.get( this );
6375
	},
6376
	run: function( percent ) {
6377
		var eased,
6378
			hooks = Tween.propHooks[ this.prop ];
6379
6380
		if ( this.options.duration ) {
6381
			this.pos = eased = jQuery.easing[ this.easing ](
6382
				percent, this.options.duration * percent, 0, 1, this.options.duration
6383
			);
6384
		} else {
6385
			this.pos = eased = percent;
6386
		}
6387
		this.now = ( this.end - this.start ) * eased + this.start;
6388
6389
		if ( this.options.step ) {
6390
			this.options.step.call( this.elem, this.now, this );
6391
		}
6392
6393
		if ( hooks && hooks.set ) {
6394
			hooks.set( this );
6395
		} else {
6396
			Tween.propHooks._default.set( this );
6397
		}
6398
		return this;
6399
	}
6400
};
6401
6402
Tween.prototype.init.prototype = Tween.prototype;
6403
6404
Tween.propHooks = {
6405
	_default: {
6406
		get: function( tween ) {
6407
			var result;
6408
6409
			// Use a property on the element directly when it is not a DOM element,
6410
			// or when there is no matching style property that exists.
6411
			if ( tween.elem.nodeType !== 1 ||
6412
				tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
6413
				return tween.elem[ tween.prop ];
6414
			}
6415
6416
			// Passing an empty string as a 3rd parameter to .css will automatically
6417
			// attempt a parseFloat and fallback to a string if the parse fails.
6418
			// Simple values such as "10px" are parsed to Float;
6419
			// complex values such as "rotate(1rad)" are returned as-is.
6420
			result = jQuery.css( tween.elem, tween.prop, "" );
6421
6422
			// Empty strings, null, undefined and "auto" are converted to 0.
6423
			return !result || result === "auto" ? 0 : result;
6424
		},
6425
		set: function( tween ) {
6426
6427
			// Use step hook for back compat.
6428
			// Use cssHook if its there.
6429
			// Use .style if available and use plain properties where available.
6430
			if ( jQuery.fx.step[ tween.prop ] ) {
6431
				jQuery.fx.step[ tween.prop ]( tween );
6432
			} else if ( tween.elem.nodeType === 1 &&
6433
				( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
6434
					jQuery.cssHooks[ tween.prop ] ) ) {
6435
				jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
6436
			} else {
6437
				tween.elem[ tween.prop ] = tween.now;
6438
			}
6439
		}
6440
	}
6441
};
6442
6443
// Support: IE9
6444
// Panic based approach to setting things on disconnected nodes
6445
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
6446
	set: function( tween ) {
6447
		if ( tween.elem.nodeType && tween.elem.parentNode ) {
6448
			tween.elem[ tween.prop ] = tween.now;
6449
		}
6450
	}
6451
};
6452
6453
jQuery.easing = {
6454
	linear: function( p ) {
6455
		return p;
6456
	},
6457
	swing: function( p ) {
6458
		return 0.5 - Math.cos( p * Math.PI ) / 2;
6459
	},
6460
	_default: "swing"
6461
};
6462
6463
jQuery.fx = Tween.prototype.init;
6464
6465
// Back Compat <1.8 extension point
6466
jQuery.fx.step = {};
6467
6468
6469
6470
6471
var
6472
	fxNow, timerId,
6473
	rfxtypes = /^(?:toggle|show|hide)$/,
6474
	rrun = /queueHooks$/;
6475
6476
// Animations created synchronously will run synchronously
6477
function createFxNow() {
6478
	window.setTimeout( function() {
6479
		fxNow = undefined;
6480
	} );
6481
	return ( fxNow = jQuery.now() );
6482
}
6483
6484
// Generate parameters to create a standard animation
6485
function genFx( type, includeWidth ) {
6486
	var which,
6487
		i = 0,
6488
		attrs = { height: type };
6489
6490
	// If we include width, step value is 1 to do all cssExpand values,
6491
	// otherwise step value is 2 to skip over Left and Right
6492
	includeWidth = includeWidth ? 1 : 0;
6493
	for ( ; i < 4 ; i += 2 - includeWidth ) {
6494
		which = cssExpand[ i ];
6495
		attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
6496
	}
6497
6498
	if ( includeWidth ) {
6499
		attrs.opacity = attrs.width = type;
6500
	}
6501
6502
	return attrs;
6503
}
6504
6505
function createTween( value, prop, animation ) {
6506
	var tween,
6507
		collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
6508
		index = 0,
6509
		length = collection.length;
6510
	for ( ; index < length; index++ ) {
6511
		if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
6512
6513
			// We're done with this property
6514
			return tween;
6515
		}
6516
	}
6517
}
6518
6519
function defaultPrefilter( elem, props, opts ) {
6520
	/* jshint validthis: true */
6521
	var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
6522
		anim = this,
6523
		orig = {},
6524
		style = elem.style,
6525
		hidden = elem.nodeType && isHidden( elem ),
6526
		dataShow = dataPriv.get( elem, "fxshow" );
6527
6528
	// Handle queue: false promises
6529
	if ( !opts.queue ) {
6530
		hooks = jQuery._queueHooks( elem, "fx" );
6531
		if ( hooks.unqueued == null ) {
6532
			hooks.unqueued = 0;
6533
			oldfire = hooks.empty.fire;
6534
			hooks.empty.fire = function() {
6535
				if ( !hooks.unqueued ) {
6536
					oldfire();
6537
				}
6538
			};
6539
		}
6540
		hooks.unqueued++;
6541
6542
		anim.always( function() {
6543
6544
			// Ensure the complete handler is called before this completes
6545
			anim.always( function() {
6546
				hooks.unqueued--;
6547
				if ( !jQuery.queue( elem, "fx" ).length ) {
6548
					hooks.empty.fire();
6549
				}
6550
			} );
6551
		} );
6552
	}
6553
6554
	// Height/width overflow pass
6555
	if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
6556
6557
		// Make sure that nothing sneaks out
6558
		// Record all 3 overflow attributes because IE9-10 do not
6559
		// change the overflow attribute when overflowX and
6560
		// overflowY are set to the same value
6561
		opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
6562
6563
		// Set display property to inline-block for height/width
6564
		// animations on inline elements that are having width/height animated
6565
		display = jQuery.css( elem, "display" );
6566
6567
		// Test default display if display is currently "none"
6568
		checkDisplay = display === "none" ?
6569
			dataPriv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
6570
6571
		if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
6572
			style.display = "inline-block";
6573
		}
6574
	}
6575
6576
	if ( opts.overflow ) {
6577
		style.overflow = "hidden";
6578
		anim.always( function() {
6579
			style.overflow = opts.overflow[ 0 ];
6580
			style.overflowX = opts.overflow[ 1 ];
6581
			style.overflowY = opts.overflow[ 2 ];
6582
		} );
6583
	}
6584
6585
	// show/hide pass
6586
	for ( prop in props ) {
6587
		value = props[ prop ];
6588
		if ( rfxtypes.exec( value ) ) {
6589
			delete props[ prop ];
6590
			toggle = toggle || value === "toggle";
6591
			if ( value === ( hidden ? "hide" : "show" ) ) {
6592
6593
				// If there is dataShow left over from a stopped hide or show
6594
				// and we are going to proceed with show, we should pretend to be hidden
6595
				if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
6596
					hidden = true;
6597
				} else {
6598
					continue;
6599
				}
6600
			}
6601
			orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
6602
6603
		// Any non-fx value stops us from restoring the original display value
6604
		} else {
6605
			display = undefined;
6606
		}
6607
	}
6608
6609
	if ( !jQuery.isEmptyObject( orig ) ) {
6610
		if ( dataShow ) {
6611
			if ( "hidden" in dataShow ) {
6612
				hidden = dataShow.hidden;
6613
			}
6614
		} else {
6615
			dataShow = dataPriv.access( elem, "fxshow", {} );
6616
		}
6617
6618
		// Store state if its toggle - enables .stop().toggle() to "reverse"
6619
		if ( toggle ) {
6620
			dataShow.hidden = !hidden;
6621
		}
6622
		if ( hidden ) {
6623
			jQuery( elem ).show();
6624
		} else {
6625
			anim.done( function() {
6626
				jQuery( elem ).hide();
6627
			} );
6628
		}
6629
		anim.done( function() {
6630
			var prop;
6631
6632
			dataPriv.remove( elem, "fxshow" );
6633
			for ( prop in orig ) {
6634
				jQuery.style( elem, prop, orig[ prop ] );
6635
			}
6636
		} );
6637
		for ( prop in orig ) {
6638
			tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
6639
6640
			if ( !( prop in dataShow ) ) {
6641
				dataShow[ prop ] = tween.start;
6642
				if ( hidden ) {
6643
					tween.end = tween.start;
6644
					tween.start = prop === "width" || prop === "height" ? 1 : 0;
6645
				}
6646
			}
6647
		}
6648
6649
	// If this is a noop like .hide().hide(), restore an overwritten display value
6650
	} else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) {
6651
		style.display = display;
6652
	}
6653
}
6654
6655
function propFilter( props, specialEasing ) {
6656
	var index, name, easing, value, hooks;
6657
6658
	// camelCase, specialEasing and expand cssHook pass
6659
	for ( index in props ) {
6660
		name = jQuery.camelCase( index );
6661
		easing = specialEasing[ name ];
6662
		value = props[ index ];
6663
		if ( jQuery.isArray( value ) ) {
6664
			easing = value[ 1 ];
6665
			value = props[ index ] = value[ 0 ];
6666
		}
6667
6668
		if ( index !== name ) {
6669
			props[ name ] = value;
6670
			delete props[ index ];
6671
		}
6672
6673
		hooks = jQuery.cssHooks[ name ];
6674
		if ( hooks && "expand" in hooks ) {
6675
			value = hooks.expand( value );
6676
			delete props[ name ];
6677
6678
			// Not quite $.extend, this won't overwrite existing keys.
6679
			// Reusing 'index' because we have the correct "name"
6680
			for ( index in value ) {
6681
				if ( !( index in props ) ) {
6682
					props[ index ] = value[ index ];
6683
					specialEasing[ index ] = easing;
6684
				}
6685
			}
6686
		} else {
6687
			specialEasing[ name ] = easing;
6688
		}
6689
	}
6690
}
6691
6692
function Animation( elem, properties, options ) {
6693
	var result,
6694
		stopped,
6695
		index = 0,
6696
		length = Animation.prefilters.length,
6697
		deferred = jQuery.Deferred().always( function() {
6698
6699
			// Don't match elem in the :animated selector
6700
			delete tick.elem;
6701
		} ),
6702
		tick = function() {
6703
			if ( stopped ) {
6704
				return false;
6705
			}
6706
			var currentTime = fxNow || createFxNow(),
6707
				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
6708
6709
				// Support: Android 2.3
6710
				// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
6711
				temp = remaining / animation.duration || 0,
6712
				percent = 1 - temp,
6713
				index = 0,
6714
				length = animation.tweens.length;
6715
6716
			for ( ; index < length ; index++ ) {
6717
				animation.tweens[ index ].run( percent );
6718
			}
6719
6720
			deferred.notifyWith( elem, [ animation, percent, remaining ] );
6721
6722
			if ( percent < 1 && length ) {
6723
				return remaining;
6724
			} else {
6725
				deferred.resolveWith( elem, [ animation ] );
6726
				return false;
6727
			}
6728
		},
6729
		animation = deferred.promise( {
6730
			elem: elem,
6731
			props: jQuery.extend( {}, properties ),
6732
			opts: jQuery.extend( true, {
6733
				specialEasing: {},
6734
				easing: jQuery.easing._default
6735
			}, options ),
6736
			originalProperties: properties,
6737
			originalOptions: options,
6738
			startTime: fxNow || createFxNow(),
6739
			duration: options.duration,
6740
			tweens: [],
6741
			createTween: function( prop, end ) {
6742
				var tween = jQuery.Tween( elem, animation.opts, prop, end,
6743
						animation.opts.specialEasing[ prop ] || animation.opts.easing );
6744
				animation.tweens.push( tween );
6745
				return tween;
6746
			},
6747
			stop: function( gotoEnd ) {
6748
				var index = 0,
6749
6750
					// If we are going to the end, we want to run all the tweens
6751
					// otherwise we skip this part
6752
					length = gotoEnd ? animation.tweens.length : 0;
6753
				if ( stopped ) {
6754
					return this;
6755
				}
6756
				stopped = true;
6757
				for ( ; index < length ; index++ ) {
6758
					animation.tweens[ index ].run( 1 );
6759
				}
6760
6761
				// Resolve when we played the last frame; otherwise, reject
6762
				if ( gotoEnd ) {
6763
					deferred.notifyWith( elem, [ animation, 1, 0 ] );
6764
					deferred.resolveWith( elem, [ animation, gotoEnd ] );
6765
				} else {
6766
					deferred.rejectWith( elem, [ animation, gotoEnd ] );
6767
				}
6768
				return this;
6769
			}
6770
		} ),
6771
		props = animation.props;
6772
6773
	propFilter( props, animation.opts.specialEasing );
6774
6775
	for ( ; index < length ; index++ ) {
6776
		result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
6777
		if ( result ) {
6778
			if ( jQuery.isFunction( result.stop ) ) {
6779
				jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
6780
					jQuery.proxy( result.stop, result );
6781
			}
6782
			return result;
6783
		}
6784
	}
6785
6786
	jQuery.map( props, createTween, animation );
6787
6788
	if ( jQuery.isFunction( animation.opts.start ) ) {
6789
		animation.opts.start.call( elem, animation );
6790
	}
6791
6792
	jQuery.fx.timer(
6793
		jQuery.extend( tick, {
6794
			elem: elem,
6795
			anim: animation,
6796
			queue: animation.opts.queue
6797
		} )
6798
	);
6799
6800
	// attach callbacks from options
6801
	return animation.progress( animation.opts.progress )
6802
		.done( animation.opts.done, animation.opts.complete )
6803
		.fail( animation.opts.fail )
6804
		.always( animation.opts.always );
6805
}
6806
6807
jQuery.Animation = jQuery.extend( Animation, {
6808
	tweeners: {
6809
		"*": [ function( prop, value ) {
6810
			var tween = this.createTween( prop, value );
6811
			adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
6812
			return tween;
6813
		} ]
6814
	},
6815
6816
	tweener: function( props, callback ) {
6817
		if ( jQuery.isFunction( props ) ) {
6818
			callback = props;
6819
			props = [ "*" ];
6820
		} else {
6821
			props = props.match( rnotwhite );
6822
		}
6823
6824
		var prop,
6825
			index = 0,
6826
			length = props.length;
6827
6828
		for ( ; index < length ; index++ ) {
6829
			prop = props[ index ];
6830
			Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
6831
			Animation.tweeners[ prop ].unshift( callback );
6832
		}
6833
	},
6834
6835
	prefilters: [ defaultPrefilter ],
6836
6837
	prefilter: function( callback, prepend ) {
6838
		if ( prepend ) {
6839
			Animation.prefilters.unshift( callback );
6840
		} else {
6841
			Animation.prefilters.push( callback );
6842
		}
6843
	}
6844
} );
6845
6846
jQuery.speed = function( speed, easing, fn ) {
6847
	var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
6848
		complete: fn || !fn && easing ||
6849
			jQuery.isFunction( speed ) && speed,
6850
		duration: speed,
6851
		easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
6852
	};
6853
6854
	opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ?
6855
		opt.duration : opt.duration in jQuery.fx.speeds ?
6856
			jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
6857
6858
	// Normalize opt.queue - true/undefined/null -> "fx"
6859
	if ( opt.queue == null || opt.queue === true ) {
6860
		opt.queue = "fx";
6861
	}
6862
6863
	// Queueing
6864
	opt.old = opt.complete;
6865
6866
	opt.complete = function() {
6867
		if ( jQuery.isFunction( opt.old ) ) {
6868
			opt.old.call( this );
6869
		}
6870
6871
		if ( opt.queue ) {
6872
			jQuery.dequeue( this, opt.queue );
6873
		}
6874
	};
6875
6876
	return opt;
6877
};
6878
6879
jQuery.fn.extend( {
6880
	fadeTo: function( speed, to, easing, callback ) {
6881
6882
		// Show any hidden elements after setting opacity to 0
6883
		return this.filter( isHidden ).css( "opacity", 0 ).show()
6884
6885
			// Animate to the value specified
6886
			.end().animate( { opacity: to }, speed, easing, callback );
6887
	},
6888
	animate: function( prop, speed, easing, callback ) {
6889
		var empty = jQuery.isEmptyObject( prop ),
6890
			optall = jQuery.speed( speed, easing, callback ),
6891
			doAnimation = function() {
6892
6893
				// Operate on a copy of prop so per-property easing won't be lost
6894
				var anim = Animation( this, jQuery.extend( {}, prop ), optall );
6895
6896
				// Empty animations, or finishing resolves immediately
6897
				if ( empty || dataPriv.get( this, "finish" ) ) {
6898
					anim.stop( true );
6899
				}
6900
			};
6901
			doAnimation.finish = doAnimation;
6902
6903
		return empty || optall.queue === false ?
6904
			this.each( doAnimation ) :
6905
			this.queue( optall.queue, doAnimation );
6906
	},
6907
	stop: function( type, clearQueue, gotoEnd ) {
6908
		var stopQueue = function( hooks ) {
6909
			var stop = hooks.stop;
6910
			delete hooks.stop;
6911
			stop( gotoEnd );
6912
		};
6913
6914
		if ( typeof type !== "string" ) {
6915
			gotoEnd = clearQueue;
6916
			clearQueue = type;
6917
			type = undefined;
6918
		}
6919
		if ( clearQueue && type !== false ) {
6920
			this.queue( type || "fx", [] );
6921
		}
6922
6923
		return this.each( function() {
6924
			var dequeue = true,
6925
				index = type != null && type + "queueHooks",
6926
				timers = jQuery.timers,
6927
				data = dataPriv.get( this );
6928
6929
			if ( index ) {
6930
				if ( data[ index ] && data[ index ].stop ) {
6931
					stopQueue( data[ index ] );
6932
				}
6933
			} else {
6934
				for ( index in data ) {
6935
					if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
6936
						stopQueue( data[ index ] );
6937
					}
6938
				}
6939
			}
6940
6941
			for ( index = timers.length; index--; ) {
6942
				if ( timers[ index ].elem === this &&
6943
					( type == null || timers[ index ].queue === type ) ) {
6944
6945
					timers[ index ].anim.stop( gotoEnd );
6946
					dequeue = false;
6947
					timers.splice( index, 1 );
6948
				}
6949
			}
6950
6951
			// Start the next in the queue if the last step wasn't forced.
6952
			// Timers currently will call their complete callbacks, which
6953
			// will dequeue but only if they were gotoEnd.
6954
			if ( dequeue || !gotoEnd ) {
6955
				jQuery.dequeue( this, type );
6956
			}
6957
		} );
6958
	},
6959
	finish: function( type ) {
6960
		if ( type !== false ) {
6961
			type = type || "fx";
6962
		}
6963
		return this.each( function() {
6964
			var index,
6965
				data = dataPriv.get( this ),
6966
				queue = data[ type + "queue" ],
6967
				hooks = data[ type + "queueHooks" ],
6968
				timers = jQuery.timers,
6969
				length = queue ? queue.length : 0;
6970
6971
			// Enable finishing flag on private data
6972
			data.finish = true;
6973
6974
			// Empty the queue first
6975
			jQuery.queue( this, type, [] );
6976
6977
			if ( hooks && hooks.stop ) {
6978
				hooks.stop.call( this, true );
6979
			}
6980
6981
			// Look for any active animations, and finish them
6982
			for ( index = timers.length; index--; ) {
6983
				if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
6984
					timers[ index ].anim.stop( true );
6985
					timers.splice( index, 1 );
6986
				}
6987
			}
6988
6989
			// Look for any animations in the old queue and finish them
6990
			for ( index = 0; index < length; index++ ) {
6991
				if ( queue[ index ] && queue[ index ].finish ) {
6992
					queue[ index ].finish.call( this );
6993
				}
6994
			}
6995
6996
			// Turn off finishing flag
6997
			delete data.finish;
6998
		} );
6999
	}
7000
} );
7001
7002
jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
7003
	var cssFn = jQuery.fn[ name ];
7004
	jQuery.fn[ name ] = function( speed, easing, callback ) {
7005
		return speed == null || typeof speed === "boolean" ?
7006
			cssFn.apply( this, arguments ) :
7007
			this.animate( genFx( name, true ), speed, easing, callback );
7008
	};
7009
} );
7010
7011
// Generate shortcuts for custom animations
7012
jQuery.each( {
7013
	slideDown: genFx( "show" ),
7014
	slideUp: genFx( "hide" ),
7015
	slideToggle: genFx( "toggle" ),
7016
	fadeIn: { opacity: "show" },
7017
	fadeOut: { opacity: "hide" },
7018
	fadeToggle: { opacity: "toggle" }
7019
}, function( name, props ) {
7020
	jQuery.fn[ name ] = function( speed, easing, callback ) {
7021
		return this.animate( props, speed, easing, callback );
7022
	};
7023
} );
7024
7025
jQuery.timers = [];
7026
jQuery.fx.tick = function() {
7027
	var timer,
7028
		i = 0,
7029
		timers = jQuery.timers;
7030
7031
	fxNow = jQuery.now();
7032
7033
	for ( ; i < timers.length; i++ ) {
7034
		timer = timers[ i ];
7035
7036
		// Checks the timer has not already been removed
7037
		if ( !timer() && timers[ i ] === timer ) {
7038
			timers.splice( i--, 1 );
7039
		}
7040
	}
7041
7042
	if ( !timers.length ) {
7043
		jQuery.fx.stop();
7044
	}
7045
	fxNow = undefined;
7046
};
7047
7048
jQuery.fx.timer = function( timer ) {
7049
	jQuery.timers.push( timer );
7050
	if ( timer() ) {
7051
		jQuery.fx.start();
7052
	} else {
7053
		jQuery.timers.pop();
7054
	}
7055
};
7056
7057
jQuery.fx.interval = 13;
7058
jQuery.fx.start = function() {
7059
	if ( !timerId ) {
7060
		timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
7061
	}
7062
};
7063
7064
jQuery.fx.stop = function() {
7065
	window.clearInterval( timerId );
7066
7067
	timerId = null;
7068
};
7069
7070
jQuery.fx.speeds = {
7071
	slow: 600,
7072
	fast: 200,
7073
7074
	// Default speed
7075
	_default: 400
7076
};
7077
7078
7079
// Based off of the plugin by Clint Helfers, with permission.
7080
// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7081
jQuery.fn.delay = function( time, type ) {
7082
	time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7083
	type = type || "fx";
7084
7085
	return this.queue( type, function( next, hooks ) {
7086
		var timeout = window.setTimeout( next, time );
7087
		hooks.stop = function() {
7088
			window.clearTimeout( timeout );
7089
		};
7090
	} );
7091
};
7092
7093
7094
( function() {
7095
	var input = document.createElement( "input" ),
7096
		select = document.createElement( "select" ),
7097
		opt = select.appendChild( document.createElement( "option" ) );
7098
7099
	input.type = "checkbox";
7100
7101
	// Support: iOS<=5.1, Android<=4.2+
7102
	// Default value for a checkbox should be "on"
7103
	support.checkOn = input.value !== "";
7104
7105
	// Support: IE<=11+
7106
	// Must access selectedIndex to make default options select
7107
	support.optSelected = opt.selected;
7108
7109
	// Support: Android<=2.3
7110
	// Options inside disabled selects are incorrectly marked as disabled
7111
	select.disabled = true;
7112
	support.optDisabled = !opt.disabled;
7113
7114
	// Support: IE<=11+
7115
	// An input loses its value after becoming a radio
7116
	input = document.createElement( "input" );
7117
	input.value = "t";
7118
	input.type = "radio";
7119
	support.radioValue = input.value === "t";
7120
} )();
7121
7122
7123
var boolHook,
7124
	attrHandle = jQuery.expr.attrHandle;
7125
7126
jQuery.fn.extend( {
7127
	attr: function( name, value ) {
7128
		return access( this, jQuery.attr, name, value, arguments.length > 1 );
7129
	},
7130
7131
	removeAttr: function( name ) {
7132
		return this.each( function() {
7133
			jQuery.removeAttr( this, name );
7134
		} );
7135
	}
7136
} );
7137
7138
jQuery.extend( {
7139
	attr: function( elem, name, value ) {
7140
		var ret, hooks,
7141
			nType = elem.nodeType;
7142
7143
		// Don't get/set attributes on text, comment and attribute nodes
7144
		if ( nType === 3 || nType === 8 || nType === 2 ) {
7145
			return;
7146
		}
7147
7148
		// Fallback to prop when attributes are not supported
7149
		if ( typeof elem.getAttribute === "undefined" ) {
7150
			return jQuery.prop( elem, name, value );
7151
		}
7152
7153
		// All attributes are lowercase
7154
		// Grab necessary hook if one is defined
7155
		if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7156
			name = name.toLowerCase();
7157
			hooks = jQuery.attrHooks[ name ] ||
7158
				( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
7159
		}
7160
7161
		if ( value !== undefined ) {
7162
			if ( value === null ) {
7163
				jQuery.removeAttr( elem, name );
7164
				return;
7165
			}
7166
7167
			if ( hooks && "set" in hooks &&
7168
				( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7169
				return ret;
7170
			}
7171
7172
			elem.setAttribute( name, value + "" );
7173
			return value;
7174
		}
7175
7176
		if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7177
			return ret;
7178
		}
7179
7180
		ret = jQuery.find.attr( elem, name );
7181
7182
		// Non-existent attributes return null, we normalize to undefined
7183
		return ret == null ? undefined : ret;
7184
	},
7185
7186
	attrHooks: {
7187
		type: {
7188
			set: function( elem, value ) {
7189
				if ( !support.radioValue && value === "radio" &&
7190
					jQuery.nodeName( elem, "input" ) ) {
7191
					var val = elem.value;
7192
					elem.setAttribute( "type", value );
7193
					if ( val ) {
7194
						elem.value = val;
7195
					}
7196
					return value;
7197
				}
7198
			}
7199
		}
7200
	},
7201
7202
	removeAttr: function( elem, value ) {
7203
		var name, propName,
7204
			i = 0,
7205
			attrNames = value && value.match( rnotwhite );
7206
7207
		if ( attrNames && elem.nodeType === 1 ) {
7208
			while ( ( name = attrNames[ i++ ] ) ) {
7209
				propName = jQuery.propFix[ name ] || name;
7210
7211
				// Boolean attributes get special treatment (#10870)
7212
				if ( jQuery.expr.match.bool.test( name ) ) {
7213
7214
					// Set corresponding property to false
7215
					elem[ propName ] = false;
7216
				}
7217
7218
				elem.removeAttribute( name );
7219
			}
7220
		}
7221
	}
7222
} );
7223
7224
// Hooks for boolean attributes
7225
boolHook = {
7226
	set: function( elem, value, name ) {
7227
		if ( value === false ) {
7228
7229
			// Remove boolean attributes when set to false
7230
			jQuery.removeAttr( elem, name );
7231
		} else {
7232
			elem.setAttribute( name, name );
7233
		}
7234
		return name;
7235
	}
7236
};
7237
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
7238
	var getter = attrHandle[ name ] || jQuery.find.attr;
7239
7240
	attrHandle[ name ] = function( elem, name, isXML ) {
7241
		var ret, handle;
7242
		if ( !isXML ) {
7243
7244
			// Avoid an infinite loop by temporarily removing this function from the getter
7245
			handle = attrHandle[ name ];
7246
			attrHandle[ name ] = ret;
7247
			ret = getter( elem, name, isXML ) != null ?
7248
				name.toLowerCase() :
7249
				null;
7250
			attrHandle[ name ] = handle;
7251
		}
7252
		return ret;
7253
	};
7254
} );
7255
7256
7257
7258
7259
var rfocusable = /^(?:input|select|textarea|button)$/i,
7260
	rclickable = /^(?:a|area)$/i;
7261
7262
jQuery.fn.extend( {
7263
	prop: function( name, value ) {
7264
		return access( this, jQuery.prop, name, value, arguments.length > 1 );
7265
	},
7266
7267
	removeProp: function( name ) {
7268
		return this.each( function() {
7269
			delete this[ jQuery.propFix[ name ] || name ];
7270
		} );
7271
	}
7272
} );
7273
7274
jQuery.extend( {
7275
	prop: function( elem, name, value ) {
7276
		var ret, hooks,
7277
			nType = elem.nodeType;
7278
7279
		// Don't get/set properties on text, comment and attribute nodes
7280
		if ( nType === 3 || nType === 8 || nType === 2 ) {
7281
			return;
7282
		}
7283
7284
		if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7285
7286
			// Fix name and attach hooks
7287
			name = jQuery.propFix[ name ] || name;
7288
			hooks = jQuery.propHooks[ name ];
7289
		}
7290
7291
		if ( value !== undefined ) {
7292
			if ( hooks && "set" in hooks &&
7293
				( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7294
				return ret;
7295
			}
7296
7297
			return ( elem[ name ] = value );
7298
		}
7299
7300
		if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7301
			return ret;
7302
		}
7303
7304
		return elem[ name ];
7305
	},
7306
7307
	propHooks: {
7308
		tabIndex: {
7309
			get: function( elem ) {
7310
7311
				// elem.tabIndex doesn't always return the
7312
				// correct value when it hasn't been explicitly set
7313
				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
7314
				// Use proper attribute retrieval(#12072)
7315
				var tabindex = jQuery.find.attr( elem, "tabindex" );
7316
7317
				return tabindex ?
7318
					parseInt( tabindex, 10 ) :
7319
					rfocusable.test( elem.nodeName ) ||
7320
						rclickable.test( elem.nodeName ) && elem.href ?
7321
							0 :
7322
							-1;
7323
			}
7324
		}
7325
	},
7326
7327
	propFix: {
7328
		"for": "htmlFor",
7329
		"class": "className"
7330
	}
7331
} );
7332
7333
// Support: IE <=11 only
7334
// Accessing the selectedIndex property
7335
// forces the browser to respect setting selected
7336
// on the option
7337
// The getter ensures a default option is selected
7338
// when in an optgroup
7339
if ( !support.optSelected ) {
7340
	jQuery.propHooks.selected = {
7341
		get: function( elem ) {
7342
			var parent = elem.parentNode;
7343
			if ( parent && parent.parentNode ) {
7344
				parent.parentNode.selectedIndex;
7345
			}
7346
			return null;
7347
		},
7348
		set: function( elem ) {
7349
			var parent = elem.parentNode;
7350
			if ( parent ) {
7351
				parent.selectedIndex;
7352
7353
				if ( parent.parentNode ) {
7354
					parent.parentNode.selectedIndex;
7355
				}
7356
			}
7357
		}
7358
	};
7359
}
7360
7361
jQuery.each( [
7362
	"tabIndex",
7363
	"readOnly",
7364
	"maxLength",
7365
	"cellSpacing",
7366
	"cellPadding",
7367
	"rowSpan",
7368
	"colSpan",
7369
	"useMap",
7370
	"frameBorder",
7371
	"contentEditable"
7372
], function() {
7373
	jQuery.propFix[ this.toLowerCase() ] = this;
7374
} );
7375
7376
7377
7378
7379
var rclass = /[\t\r\n\f]/g;
7380
7381
function getClass( elem ) {
7382
	return elem.getAttribute && elem.getAttribute( "class" ) || "";
7383
}
7384
7385
jQuery.fn.extend( {
7386
	addClass: function( value ) {
7387
		var classes, elem, cur, curValue, clazz, j, finalValue,
7388
			i = 0;
7389
7390
		if ( jQuery.isFunction( value ) ) {
7391
			return this.each( function( j ) {
7392
				jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
7393
			} );
7394
		}
7395
7396
		if ( typeof value === "string" && value ) {
7397
			classes = value.match( rnotwhite ) || [];
7398
7399
			while ( ( elem = this[ i++ ] ) ) {
7400
				curValue = getClass( elem );
7401
				cur = elem.nodeType === 1 &&
7402
					( " " + curValue + " " ).replace( rclass, " " );
7403
7404
				if ( cur ) {
7405
					j = 0;
7406
					while ( ( clazz = classes[ j++ ] ) ) {
7407
						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
7408
							cur += clazz + " ";
7409
						}
7410
					}
7411
7412
					// Only assign if different to avoid unneeded rendering.
7413
					finalValue = jQuery.trim( cur );
7414
					if ( curValue !== finalValue ) {
7415
						elem.setAttribute( "class", finalValue );
7416
					}
7417
				}
7418
			}
7419
		}
7420
7421
		return this;
7422
	},
7423
7424
	removeClass: function( value ) {
7425
		var classes, elem, cur, curValue, clazz, j, finalValue,
7426
			i = 0;
7427
7428
		if ( jQuery.isFunction( value ) ) {
7429
			return this.each( function( j ) {
7430
				jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
7431
			} );
7432
		}
7433
7434
		if ( !arguments.length ) {
7435
			return this.attr( "class", "" );
7436
		}
7437
7438
		if ( typeof value === "string" && value ) {
7439
			classes = value.match( rnotwhite ) || [];
7440
7441
			while ( ( elem = this[ i++ ] ) ) {
7442
				curValue = getClass( elem );
7443
7444
				// This expression is here for better compressibility (see addClass)
7445
				cur = elem.nodeType === 1 &&
7446
					( " " + curValue + " " ).replace( rclass, " " );
7447
7448
				if ( cur ) {
7449
					j = 0;
7450
					while ( ( clazz = classes[ j++ ] ) ) {
7451
7452
						// Remove *all* instances
7453
						while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
7454
							cur = cur.replace( " " + clazz + " ", " " );
7455
						}
7456
					}
7457
7458
					// Only assign if different to avoid unneeded rendering.
7459
					finalValue = jQuery.trim( cur );
7460
					if ( curValue !== finalValue ) {
7461
						elem.setAttribute( "class", finalValue );
7462
					}
7463
				}
7464
			}
7465
		}
7466
7467
		return this;
7468
	},
7469
7470
	toggleClass: function( value, stateVal ) {
7471
		var type = typeof value;
7472
7473
		if ( typeof stateVal === "boolean" && type === "string" ) {
7474
			return stateVal ? this.addClass( value ) : this.removeClass( value );
7475
		}
7476
7477
		if ( jQuery.isFunction( value ) ) {
7478
			return this.each( function( i ) {
7479
				jQuery( this ).toggleClass(
7480
					value.call( this, i, getClass( this ), stateVal ),
7481
					stateVal
7482
				);
7483
			} );
7484
		}
7485
7486
		return this.each( function() {
7487
			var className, i, self, classNames;
7488
7489
			if ( type === "string" ) {
7490
7491
				// Toggle individual class names
7492
				i = 0;
7493
				self = jQuery( this );
7494
				classNames = value.match( rnotwhite ) || [];
7495
7496
				while ( ( className = classNames[ i++ ] ) ) {
7497
7498
					// Check each className given, space separated list
7499
					if ( self.hasClass( className ) ) {
7500
						self.removeClass( className );
7501
					} else {
7502
						self.addClass( className );
7503
					}
7504
				}
7505
7506
			// Toggle whole class name
7507
			} else if ( value === undefined || type === "boolean" ) {
7508
				className = getClass( this );
7509
				if ( className ) {
7510
7511
					// Store className if set
7512
					dataPriv.set( this, "__className__", className );
7513
				}
7514
7515
				// If the element has a class name or if we're passed `false`,
7516
				// then remove the whole classname (if there was one, the above saved it).
7517
				// Otherwise bring back whatever was previously saved (if anything),
7518
				// falling back to the empty string if nothing was stored.
7519
				if ( this.setAttribute ) {
7520
					this.setAttribute( "class",
7521
						className || value === false ?
7522
						"" :
7523
						dataPriv.get( this, "__className__" ) || ""
7524
					);
7525
				}
7526
			}
7527
		} );
7528
	},
7529
7530
	hasClass: function( selector ) {
7531
		var className, elem,
7532
			i = 0;
7533
7534
		className = " " + selector + " ";
7535
		while ( ( elem = this[ i++ ] ) ) {
7536
			if ( elem.nodeType === 1 &&
7537
				( " " + getClass( elem ) + " " ).replace( rclass, " " )
7538
					.indexOf( className ) > -1
7539
			) {
7540
				return true;
7541
			}
7542
		}
7543
7544
		return false;
7545
	}
7546
} );
7547
7548
7549
7550
7551
var rreturn = /\r/g,
7552
	rspaces = /[\x20\t\r\n\f]+/g;
7553
7554
jQuery.fn.extend( {
7555
	val: function( value ) {
7556
		var hooks, ret, isFunction,
7557
			elem = this[ 0 ];
7558
7559
		if ( !arguments.length ) {
7560
			if ( elem ) {
7561
				hooks = jQuery.valHooks[ elem.type ] ||
7562
					jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7563
7564
				if ( hooks &&
7565
					"get" in hooks &&
7566
					( ret = hooks.get( elem, "value" ) ) !== undefined
7567
				) {
7568
					return ret;
7569
				}
7570
7571
				ret = elem.value;
7572
7573
				return typeof ret === "string" ?
7574
7575
					// Handle most common string cases
7576
					ret.replace( rreturn, "" ) :
7577
7578
					// Handle cases where value is null/undef or number
7579
					ret == null ? "" : ret;
7580
			}
7581
7582
			return;
7583
		}
7584
7585
		isFunction = jQuery.isFunction( value );
7586
7587
		return this.each( function( i ) {
7588
			var val;
7589
7590
			if ( this.nodeType !== 1 ) {
7591
				return;
7592
			}
7593
7594
			if ( isFunction ) {
7595
				val = value.call( this, i, jQuery( this ).val() );
7596
			} else {
7597
				val = value;
7598
			}
7599
7600
			// Treat null/undefined as ""; convert numbers to string
7601
			if ( val == null ) {
7602
				val = "";
7603
7604
			} else if ( typeof val === "number" ) {
7605
				val += "";
7606
7607
			} else if ( jQuery.isArray( val ) ) {
7608
				val = jQuery.map( val, function( value ) {
7609
					return value == null ? "" : value + "";
7610
				} );
7611
			}
7612
7613
			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7614
7615
			// If set returns undefined, fall back to normal setting
7616
			if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
7617
				this.value = val;
7618
			}
7619
		} );
7620
	}
7621
} );
7622
7623
jQuery.extend( {
7624
	valHooks: {
7625
		option: {
7626
			get: function( elem ) {
7627
7628
				var val = jQuery.find.attr( elem, "value" );
7629
				return val != null ?
7630
					val :
7631
7632
					// Support: IE10-11+
7633
					// option.text throws exceptions (#14686, #14858)
7634
					// Strip and collapse whitespace
7635
					// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
7636
					jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
7637
			}
7638
		},
7639
		select: {
7640
			get: function( elem ) {
7641
				var value, option,
7642
					options = elem.options,
7643
					index = elem.selectedIndex,
7644
					one = elem.type === "select-one" || index < 0,
7645
					values = one ? null : [],
7646
					max = one ? index + 1 : options.length,
7647
					i = index < 0 ?
7648
						max :
7649
						one ? index : 0;
7650
7651
				// Loop through all the selected options
7652
				for ( ; i < max; i++ ) {
7653
					option = options[ i ];
7654
7655
					// IE8-9 doesn't update selected after form reset (#2551)
7656
					if ( ( option.selected || i === index ) &&
7657
7658
							// Don't return options that are disabled or in a disabled optgroup
7659
							( support.optDisabled ?
7660
								!option.disabled : option.getAttribute( "disabled" ) === null ) &&
7661
							( !option.parentNode.disabled ||
7662
								!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
7663
7664
						// Get the specific value for the option
7665
						value = jQuery( option ).val();
7666
7667
						// We don't need an array for one selects
7668
						if ( one ) {
7669
							return value;
7670
						}
7671
7672
						// Multi-Selects return an array
7673
						values.push( value );
7674
					}
7675
				}
7676
7677
				return values;
7678
			},
7679
7680
			set: function( elem, value ) {
7681
				var optionSet, option,
7682
					options = elem.options,
7683
					values = jQuery.makeArray( value ),
7684
					i = options.length;
7685
7686
				while ( i-- ) {
7687
					option = options[ i ];
7688
					if ( option.selected =
7689
						jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
7690
					) {
7691
						optionSet = true;
7692
					}
7693
				}
7694
7695
				// Force browsers to behave consistently when non-matching value is set
7696
				if ( !optionSet ) {
7697
					elem.selectedIndex = -1;
7698
				}
7699
				return values;
7700
			}
7701
		}
7702
	}
7703
} );
7704
7705
// Radios and checkboxes getter/setter
7706
jQuery.each( [ "radio", "checkbox" ], function() {
7707
	jQuery.valHooks[ this ] = {
7708
		set: function( elem, value ) {
7709
			if ( jQuery.isArray( value ) ) {
7710
				return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
7711
			}
7712
		}
7713
	};
7714
	if ( !support.checkOn ) {
7715
		jQuery.valHooks[ this ].get = function( elem ) {
7716
			return elem.getAttribute( "value" ) === null ? "on" : elem.value;
7717
		};
7718
	}
7719
} );
7720
7721
7722
7723
7724
// Return jQuery for attributes-only inclusion
7725
7726
7727
var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
7728
7729
jQuery.extend( jQuery.event, {
7730
7731
	trigger: function( event, data, elem, onlyHandlers ) {
7732
7733
		var i, cur, tmp, bubbleType, ontype, handle, special,
7734
			eventPath = [ elem || document ],
7735
			type = hasOwn.call( event, "type" ) ? event.type : event,
7736
			namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
7737
7738
		cur = tmp = elem = elem || document;
7739
7740
		// Don't do events on text and comment nodes
7741
		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
7742
			return;
7743
		}
7744
7745
		// focus/blur morphs to focusin/out; ensure we're not firing them right now
7746
		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
7747
			return;
7748
		}
7749
7750
		if ( type.indexOf( "." ) > -1 ) {
7751
7752
			// Namespaced trigger; create a regexp to match event type in handle()
7753
			namespaces = type.split( "." );
7754
			type = namespaces.shift();
7755
			namespaces.sort();
7756
		}
7757
		ontype = type.indexOf( ":" ) < 0 && "on" + type;
7758
7759
		// Caller can pass in a jQuery.Event object, Object, or just an event type string
7760
		event = event[ jQuery.expando ] ?
7761
			event :
7762
			new jQuery.Event( type, typeof event === "object" && event );
7763
7764
		// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
7765
		event.isTrigger = onlyHandlers ? 2 : 3;
7766
		event.namespace = namespaces.join( "." );
7767
		event.rnamespace = event.namespace ?
7768
			new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
7769
			null;
7770
7771
		// Clean up the event in case it is being reused
7772
		event.result = undefined;
7773
		if ( !event.target ) {
7774
			event.target = elem;
7775
		}
7776
7777
		// Clone any incoming data and prepend the event, creating the handler arg list
7778
		data = data == null ?
7779
			[ event ] :
7780
			jQuery.makeArray( data, [ event ] );
7781
7782
		// Allow special events to draw outside the lines
7783
		special = jQuery.event.special[ type ] || {};
7784
		if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
7785
			return;
7786
		}
7787
7788
		// Determine event propagation path in advance, per W3C events spec (#9951)
7789
		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
7790
		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
7791
7792
			bubbleType = special.delegateType || type;
7793
			if ( !rfocusMorph.test( bubbleType + type ) ) {
7794
				cur = cur.parentNode;
7795
			}
7796
			for ( ; cur; cur = cur.parentNode ) {
7797
				eventPath.push( cur );
7798
				tmp = cur;
7799
			}
7800
7801
			// Only add window if we got to document (e.g., not plain obj or detached DOM)
7802
			if ( tmp === ( elem.ownerDocument || document ) ) {
7803
				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
7804
			}
7805
		}
7806
7807
		// Fire handlers on the event path
7808
		i = 0;
7809
		while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
7810
7811
			event.type = i > 1 ?
7812
				bubbleType :
7813
				special.bindType || type;
7814
7815
			// jQuery handler
7816
			handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
7817
				dataPriv.get( cur, "handle" );
7818
			if ( handle ) {
7819
				handle.apply( cur, data );
7820
			}
7821
7822
			// Native handler
7823
			handle = ontype && cur[ ontype ];
7824
			if ( handle && handle.apply && acceptData( cur ) ) {
7825
				event.result = handle.apply( cur, data );
7826
				if ( event.result === false ) {
7827
					event.preventDefault();
7828
				}
7829
			}
7830
		}
7831
		event.type = type;
7832
7833
		// If nobody prevented the default action, do it now
7834
		if ( !onlyHandlers && !event.isDefaultPrevented() ) {
7835
7836
			if ( ( !special._default ||
7837
				special._default.apply( eventPath.pop(), data ) === false ) &&
7838
				acceptData( elem ) ) {
7839
7840
				// Call a native DOM method on the target with the same name name as the event.
7841
				// Don't do default actions on window, that's where global variables be (#6170)
7842
				if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
7843
7844
					// Don't re-trigger an onFOO event when we call its FOO() method
7845
					tmp = elem[ ontype ];
7846
7847
					if ( tmp ) {
7848
						elem[ ontype ] = null;
7849
					}
7850
7851
					// Prevent re-triggering of the same event, since we already bubbled it above
7852
					jQuery.event.triggered = type;
7853
					elem[ type ]();
7854
					jQuery.event.triggered = undefined;
7855
7856
					if ( tmp ) {
7857
						elem[ ontype ] = tmp;
7858
					}
7859
				}
7860
			}
7861
		}
7862
7863
		return event.result;
7864
	},
7865
7866
	// Piggyback on a donor event to simulate a different one
7867
	simulate: function( type, elem, event ) {
7868
		var e = jQuery.extend(
7869
			new jQuery.Event(),
7870
			event,
7871
			{
7872
				type: type,
7873
				isSimulated: true
7874
7875
				// Previously, `originalEvent: {}` was set here, so stopPropagation call
7876
				// would not be triggered on donor event, since in our own
7877
				// jQuery.event.stopPropagation function we had a check for existence of
7878
				// originalEvent.stopPropagation method, so, consequently it would be a noop.
7879
				//
7880
				// But now, this "simulate" function is used only for events
7881
				// for which stopPropagation() is noop, so there is no need for that anymore.
7882
				//
7883
				// For the 1.x branch though, guard for "click" and "submit"
7884
				// events is still used, but was moved to jQuery.event.stopPropagation function
7885
				// because `originalEvent` should point to the original event for the constancy
7886
				// with other events and for more focused logic
7887
			}
7888
		);
7889
7890
		jQuery.event.trigger( e, null, elem );
7891
7892
		if ( e.isDefaultPrevented() ) {
7893
			event.preventDefault();
7894
		}
7895
	}
7896
7897
} );
7898
7899
jQuery.fn.extend( {
7900
7901
	trigger: function( type, data ) {
7902
		return this.each( function() {
7903
			jQuery.event.trigger( type, data, this );
7904
		} );
7905
	},
7906
	triggerHandler: function( type, data ) {
7907
		var elem = this[ 0 ];
7908
		if ( elem ) {
7909
			return jQuery.event.trigger( type, data, elem, true );
7910
		}
7911
	}
7912
} );
7913
7914
7915
jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
7916
	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
7917
	"change select submit keydown keypress keyup error contextmenu" ).split( " " ),
7918
	function( i, name ) {
7919
7920
	// Handle event binding
7921
	jQuery.fn[ name ] = function( data, fn ) {
7922
		return arguments.length > 0 ?
7923
			this.on( name, null, data, fn ) :
7924
			this.trigger( name );
7925
	};
7926
} );
7927
7928
jQuery.fn.extend( {
7929
	hover: function( fnOver, fnOut ) {
7930
		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
7931
	}
7932
} );
7933
7934
7935
7936
7937
support.focusin = "onfocusin" in window;
7938
7939
7940
// Support: Firefox
7941
// Firefox doesn't have focus(in | out) events
7942
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
7943
//
7944
// Support: Chrome, Safari
7945
// focus(in | out) events fire after focus & blur events,
7946
// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
7947
// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
7948
if ( !support.focusin ) {
7949
	jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
7950
7951
		// Attach a single capturing handler on the document while someone wants focusin/focusout
7952
		var handler = function( event ) {
7953
			jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
7954
		};
7955
7956
		jQuery.event.special[ fix ] = {
7957
			setup: function() {
7958
				var doc = this.ownerDocument || this,
7959
					attaches = dataPriv.access( doc, fix );
7960
7961
				if ( !attaches ) {
7962
					doc.addEventListener( orig, handler, true );
7963
				}
7964
				dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
7965
			},
7966
			teardown: function() {
7967
				var doc = this.ownerDocument || this,
7968
					attaches = dataPriv.access( doc, fix ) - 1;
7969
7970
				if ( !attaches ) {
7971
					doc.removeEventListener( orig, handler, true );
7972
					dataPriv.remove( doc, fix );
7973
7974
				} else {
7975
					dataPriv.access( doc, fix, attaches );
7976
				}
7977
			}
7978
		};
7979
	} );
7980
}
7981
var location = window.location;
7982
7983
var nonce = jQuery.now();
7984
7985
var rquery = ( /\?/ );
7986
7987
7988
7989
// Support: Android 2.3
7990
// Workaround failure to string-cast null input
7991
jQuery.parseJSON = function( data ) {
7992
	return JSON.parse( data + "" );
7993
};
7994
7995
7996
// Cross-browser xml parsing
7997
jQuery.parseXML = function( data ) {
7998
	var xml;
7999
	if ( !data || typeof data !== "string" ) {
8000
		return null;
8001
	}
8002
8003
	// Support: IE9
8004
	try {
8005
		xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8006
	} catch ( e ) {
8007
		xml = undefined;
8008
	}
8009
8010
	if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
8011
		jQuery.error( "Invalid XML: " + data );
8012
	}
8013
	return xml;
8014
};
8015
8016
8017
var
8018
	rhash = /#.*$/,
8019
	rts = /([?&])_=[^&]*/,
8020
	rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8021
8022
	// #7653, #8125, #8152: local protocol detection
8023
	rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8024
	rnoContent = /^(?:GET|HEAD)$/,
8025
	rprotocol = /^\/\//,
8026
8027
	/* Prefilters
8028
	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8029
	 * 2) These are called:
8030
	 *    - BEFORE asking for a transport
8031
	 *    - AFTER param serialization (s.data is a string if s.processData is true)
8032
	 * 3) key is the dataType
8033
	 * 4) the catchall symbol "*" can be used
8034
	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8035
	 */
8036
	prefilters = {},
8037
8038
	/* Transports bindings
8039
	 * 1) key is the dataType
8040
	 * 2) the catchall symbol "*" can be used
8041
	 * 3) selection will start with transport dataType and THEN go to "*" if needed
8042
	 */
8043
	transports = {},
8044
8045
	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8046
	allTypes = "*/".concat( "*" ),
8047
8048
	// Anchor tag for parsing the document origin
8049
	originAnchor = document.createElement( "a" );
8050
	originAnchor.href = location.href;
8051
8052
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8053
function addToPrefiltersOrTransports( structure ) {
8054
8055
	// dataTypeExpression is optional and defaults to "*"
8056
	return function( dataTypeExpression, func ) {
8057
8058
		if ( typeof dataTypeExpression !== "string" ) {
8059
			func = dataTypeExpression;
8060
			dataTypeExpression = "*";
8061
		}
8062
8063
		var dataType,
8064
			i = 0,
8065
			dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
8066
8067
		if ( jQuery.isFunction( func ) ) {
8068
8069
			// For each dataType in the dataTypeExpression
8070
			while ( ( dataType = dataTypes[ i++ ] ) ) {
8071
8072
				// Prepend if requested
8073
				if ( dataType[ 0 ] === "+" ) {
8074
					dataType = dataType.slice( 1 ) || "*";
8075
					( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
8076
8077
				// Otherwise append
8078
				} else {
8079
					( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
8080
				}
8081
			}
8082
		}
8083
	};
8084
}
8085
8086
// Base inspection function for prefilters and transports
8087
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8088
8089
	var inspected = {},
8090
		seekingTransport = ( structure === transports );
8091
8092
	function inspect( dataType ) {
8093
		var selected;
8094
		inspected[ dataType ] = true;
8095
		jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8096
			var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8097
			if ( typeof dataTypeOrTransport === "string" &&
8098
				!seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8099
8100
				options.dataTypes.unshift( dataTypeOrTransport );
8101
				inspect( dataTypeOrTransport );
8102
				return false;
8103
			} else if ( seekingTransport ) {
8104
				return !( selected = dataTypeOrTransport );
8105
			}
8106
		} );
8107
		return selected;
8108
	}
8109
8110
	return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8111
}
8112
8113
// A special extend for ajax options
8114
// that takes "flat" options (not to be deep extended)
8115
// Fixes #9887
8116
function ajaxExtend( target, src ) {
8117
	var key, deep,
8118
		flatOptions = jQuery.ajaxSettings.flatOptions || {};
8119
8120
	for ( key in src ) {
8121
		if ( src[ key ] !== undefined ) {
8122
			( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
8123
		}
8124
	}
8125
	if ( deep ) {
8126
		jQuery.extend( true, target, deep );
8127
	}
8128
8129
	return target;
8130
}
8131
8132
/* Handles responses to an ajax request:
8133
 * - finds the right dataType (mediates between content-type and expected dataType)
8134
 * - returns the corresponding response
8135
 */
8136
function ajaxHandleResponses( s, jqXHR, responses ) {
8137
8138
	var ct, type, finalDataType, firstDataType,
8139
		contents = s.contents,
8140
		dataTypes = s.dataTypes;
8141
8142
	// Remove auto dataType and get content-type in the process
8143
	while ( dataTypes[ 0 ] === "*" ) {
8144
		dataTypes.shift();
8145
		if ( ct === undefined ) {
8146
			ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
8147
		}
8148
	}
8149
8150
	// Check if we're dealing with a known content-type
8151
	if ( ct ) {
8152
		for ( type in contents ) {
8153
			if ( contents[ type ] && contents[ type ].test( ct ) ) {
8154
				dataTypes.unshift( type );
8155
				break;
8156
			}
8157
		}
8158
	}
8159
8160
	// Check to see if we have a response for the expected dataType
8161
	if ( dataTypes[ 0 ] in responses ) {
8162
		finalDataType = dataTypes[ 0 ];
8163
	} else {
8164
8165
		// Try convertible dataTypes
8166
		for ( type in responses ) {
8167
			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
8168
				finalDataType = type;
8169
				break;
8170
			}
8171
			if ( !firstDataType ) {
8172
				firstDataType = type;
8173
			}
8174
		}
8175
8176
		// Or just use first one
8177
		finalDataType = finalDataType || firstDataType;
8178
	}
8179
8180
	// If we found a dataType
8181
	// We add the dataType to the list if needed
8182
	// and return the corresponding response
8183
	if ( finalDataType ) {
8184
		if ( finalDataType !== dataTypes[ 0 ] ) {
8185
			dataTypes.unshift( finalDataType );
8186
		}
8187
		return responses[ finalDataType ];
8188
	}
8189
}
8190
8191
/* Chain conversions given the request and the original response
8192
 * Also sets the responseXXX fields on the jqXHR instance
8193
 */
8194
function ajaxConvert( s, response, jqXHR, isSuccess ) {
8195
	var conv2, current, conv, tmp, prev,
8196
		converters = {},
8197
8198
		// Work with a copy of dataTypes in case we need to modify it for conversion
8199
		dataTypes = s.dataTypes.slice();
8200
8201
	// Create converters map with lowercased keys
8202
	if ( dataTypes[ 1 ] ) {
8203
		for ( conv in s.converters ) {
8204
			converters[ conv.toLowerCase() ] = s.converters[ conv ];
8205
		}
8206
	}
8207
8208
	current = dataTypes.shift();
8209
8210
	// Convert to each sequential dataType
8211
	while ( current ) {
8212
8213
		if ( s.responseFields[ current ] ) {
8214
			jqXHR[ s.responseFields[ current ] ] = response;
8215
		}
8216
8217
		// Apply the dataFilter if provided
8218
		if ( !prev && isSuccess && s.dataFilter ) {
8219
			response = s.dataFilter( response, s.dataType );
8220
		}
8221
8222
		prev = current;
8223
		current = dataTypes.shift();
8224
8225
		if ( current ) {
8226
8227
		// There's only work to do if current dataType is non-auto
8228
			if ( current === "*" ) {
8229
8230
				current = prev;
8231
8232
			// Convert response if prev dataType is non-auto and differs from current
8233
			} else if ( prev !== "*" && prev !== current ) {
8234
8235
				// Seek a direct converter
8236
				conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8237
8238
				// If none found, seek a pair
8239
				if ( !conv ) {
8240
					for ( conv2 in converters ) {
8241
8242
						// If conv2 outputs current
8243
						tmp = conv2.split( " " );
8244
						if ( tmp[ 1 ] === current ) {
8245
8246
							// If prev can be converted to accepted input
8247
							conv = converters[ prev + " " + tmp[ 0 ] ] ||
8248
								converters[ "* " + tmp[ 0 ] ];
8249
							if ( conv ) {
8250
8251
								// Condense equivalence converters
8252
								if ( conv === true ) {
8253
									conv = converters[ conv2 ];
8254
8255
								// Otherwise, insert the intermediate dataType
8256
								} else if ( converters[ conv2 ] !== true ) {
8257
									current = tmp[ 0 ];
8258
									dataTypes.unshift( tmp[ 1 ] );
8259
								}
8260
								break;
8261
							}
8262
						}
8263
					}
8264
				}
8265
8266
				// Apply converter (if not an equivalence)
8267
				if ( conv !== true ) {
8268
8269
					// Unless errors are allowed to bubble, catch and return them
8270
					if ( conv && s.throws ) {
8271
						response = conv( response );
8272
					} else {
8273
						try {
8274
							response = conv( response );
8275
						} catch ( e ) {
8276
							return {
8277
								state: "parsererror",
8278
								error: conv ? e : "No conversion from " + prev + " to " + current
8279
							};
8280
						}
8281
					}
8282
				}
8283
			}
8284
		}
8285
	}
8286
8287
	return { state: "success", data: response };
8288
}
8289
8290
jQuery.extend( {
8291
8292
	// Counter for holding the number of active queries
8293
	active: 0,
8294
8295
	// Last-Modified header cache for next request
8296
	lastModified: {},
8297
	etag: {},
8298
8299
	ajaxSettings: {
8300
		url: location.href,
8301
		type: "GET",
8302
		isLocal: rlocalProtocol.test( location.protocol ),
8303
		global: true,
8304
		processData: true,
8305
		async: true,
8306
		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8307
		/*
8308
		timeout: 0,
8309
		data: null,
8310
		dataType: null,
8311
		username: null,
8312
		password: null,
8313
		cache: null,
8314
		throws: false,
8315
		traditional: false,
8316
		headers: {},
8317
		*/
8318
8319
		accepts: {
8320
			"*": allTypes,
8321
			text: "text/plain",
8322
			html: "text/html",
8323
			xml: "application/xml, text/xml",
8324
			json: "application/json, text/javascript"
8325
		},
8326
8327
		contents: {
8328
			xml: /\bxml\b/,
8329
			html: /\bhtml/,
8330
			json: /\bjson\b/
8331
		},
8332
8333
		responseFields: {
8334
			xml: "responseXML",
8335
			text: "responseText",
8336
			json: "responseJSON"
8337
		},
8338
8339
		// Data converters
8340
		// Keys separate source (or catchall "*") and destination types with a single space
8341
		converters: {
8342
8343
			// Convert anything to text
8344
			"* text": String,
8345
8346
			// Text to html (true = no transformation)
8347
			"text html": true,
8348
8349
			// Evaluate text as a json expression
8350
			"text json": jQuery.parseJSON,
8351
8352
			// Parse text as xml
8353
			"text xml": jQuery.parseXML
8354
		},
8355
8356
		// For options that shouldn't be deep extended:
8357
		// you can add your own custom options here if
8358
		// and when you create one that shouldn't be
8359
		// deep extended (see ajaxExtend)
8360
		flatOptions: {
8361
			url: true,
8362
			context: true
8363
		}
8364
	},
8365
8366
	// Creates a full fledged settings object into target
8367
	// with both ajaxSettings and settings fields.
8368
	// If target is omitted, writes into ajaxSettings.
8369
	ajaxSetup: function( target, settings ) {
8370
		return settings ?
8371
8372
			// Building a settings object
8373
			ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8374
8375
			// Extending ajaxSettings
8376
			ajaxExtend( jQuery.ajaxSettings, target );
8377
	},
8378
8379
	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8380
	ajaxTransport: addToPrefiltersOrTransports( transports ),
8381
8382
	// Main method
8383
	ajax: function( url, options ) {
8384
8385
		// If url is an object, simulate pre-1.5 signature
8386
		if ( typeof url === "object" ) {
8387
			options = url;
8388
			url = undefined;
8389
		}
8390
8391
		// Force options to be an object
8392
		options = options || {};
8393
8394
		var transport,
8395
8396
			// URL without anti-cache param
8397
			cacheURL,
8398
8399
			// Response headers
8400
			responseHeadersString,
8401
			responseHeaders,
8402
8403
			// timeout handle
8404
			timeoutTimer,
8405
8406
			// Url cleanup var
8407
			urlAnchor,
8408
8409
			// To know if global events are to be dispatched
8410
			fireGlobals,
8411
8412
			// Loop variable
8413
			i,
8414
8415
			// Create the final options object
8416
			s = jQuery.ajaxSetup( {}, options ),
8417
8418
			// Callbacks context
8419
			callbackContext = s.context || s,
8420
8421
			// Context for global events is callbackContext if it is a DOM node or jQuery collection
8422
			globalEventContext = s.context &&
8423
				( callbackContext.nodeType || callbackContext.jquery ) ?
8424
					jQuery( callbackContext ) :
8425
					jQuery.event,
8426
8427
			// Deferreds
8428
			deferred = jQuery.Deferred(),
8429
			completeDeferred = jQuery.Callbacks( "once memory" ),
8430
8431
			// Status-dependent callbacks
8432
			statusCode = s.statusCode || {},
8433
8434
			// Headers (they are sent all at once)
8435
			requestHeaders = {},
8436
			requestHeadersNames = {},
8437
8438
			// The jqXHR state
8439
			state = 0,
8440
8441
			// Default abort message
8442
			strAbort = "canceled",
8443
8444
			// Fake xhr
8445
			jqXHR = {
8446
				readyState: 0,
8447
8448
				// Builds headers hashtable if needed
8449
				getResponseHeader: function( key ) {
8450
					var match;
8451
					if ( state === 2 ) {
8452
						if ( !responseHeaders ) {
8453
							responseHeaders = {};
8454
							while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
8455
								responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
8456
							}
8457
						}
8458
						match = responseHeaders[ key.toLowerCase() ];
8459
					}
8460
					return match == null ? null : match;
8461
				},
8462
8463
				// Raw string
8464
				getAllResponseHeaders: function() {
8465
					return state === 2 ? responseHeadersString : null;
8466
				},
8467
8468
				// Caches the header
8469
				setRequestHeader: function( name, value ) {
8470
					var lname = name.toLowerCase();
8471
					if ( !state ) {
8472
						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
8473
						requestHeaders[ name ] = value;
8474
					}
8475
					return this;
8476
				},
8477
8478
				// Overrides response content-type header
8479
				overrideMimeType: function( type ) {
8480
					if ( !state ) {
8481
						s.mimeType = type;
8482
					}
8483
					return this;
8484
				},
8485
8486
				// Status-dependent callbacks
8487
				statusCode: function( map ) {
8488
					var code;
8489
					if ( map ) {
8490
						if ( state < 2 ) {
8491
							for ( code in map ) {
8492
8493
								// Lazy-add the new callback in a way that preserves old ones
8494
								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
8495
							}
8496
						} else {
8497
8498
							// Execute the appropriate callbacks
8499
							jqXHR.always( map[ jqXHR.status ] );
8500
						}
8501
					}
8502
					return this;
8503
				},
8504
8505
				// Cancel the request
8506
				abort: function( statusText ) {
8507
					var finalText = statusText || strAbort;
8508
					if ( transport ) {
8509
						transport.abort( finalText );
8510
					}
8511
					done( 0, finalText );
8512
					return this;
8513
				}
8514
			};
8515
8516
		// Attach deferreds
8517
		deferred.promise( jqXHR ).complete = completeDeferred.add;
8518
		jqXHR.success = jqXHR.done;
8519
		jqXHR.error = jqXHR.fail;
8520
8521
		// Remove hash character (#7531: and string promotion)
8522
		// Add protocol if not provided (prefilters might expect it)
8523
		// Handle falsy url in the settings object (#10093: consistency with old signature)
8524
		// We also use the url parameter if available
8525
		s.url = ( ( url || s.url || location.href ) + "" ).replace( rhash, "" )
8526
			.replace( rprotocol, location.protocol + "//" );
8527
8528
		// Alias method option to type as per ticket #12004
8529
		s.type = options.method || options.type || s.method || s.type;
8530
8531
		// Extract dataTypes list
8532
		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
8533
8534
		// A cross-domain request is in order when the origin doesn't match the current origin.
8535
		if ( s.crossDomain == null ) {
8536
			urlAnchor = document.createElement( "a" );
8537
8538
			// Support: IE8-11+
8539
			// IE throws exception if url is malformed, e.g. http://example.com:80x/
8540
			try {
8541
				urlAnchor.href = s.url;
8542
8543
				// Support: IE8-11+
8544
				// Anchor's host property isn't correctly set when s.url is relative
8545
				urlAnchor.href = urlAnchor.href;
8546
				s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
8547
					urlAnchor.protocol + "//" + urlAnchor.host;
8548
			} catch ( e ) {
8549
8550
				// If there is an error parsing the URL, assume it is crossDomain,
8551
				// it can be rejected by the transport if it is invalid
8552
				s.crossDomain = true;
8553
			}
8554
		}
8555
8556
		// Convert data if not already a string
8557
		if ( s.data && s.processData && typeof s.data !== "string" ) {
8558
			s.data = jQuery.param( s.data, s.traditional );
8559
		}
8560
8561
		// Apply prefilters
8562
		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
8563
8564
		// If request was aborted inside a prefilter, stop there
8565
		if ( state === 2 ) {
8566
			return jqXHR;
8567
		}
8568
8569
		// We can fire global events as of now if asked to
8570
		// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
8571
		fireGlobals = jQuery.event && s.global;
8572
8573
		// Watch for a new set of requests
8574
		if ( fireGlobals && jQuery.active++ === 0 ) {
8575
			jQuery.event.trigger( "ajaxStart" );
8576
		}
8577
8578
		// Uppercase the type
8579
		s.type = s.type.toUpperCase();
8580
8581
		// Determine if request has content
8582
		s.hasContent = !rnoContent.test( s.type );
8583
8584
		// Save the URL in case we're toying with the If-Modified-Since
8585
		// and/or If-None-Match header later on
8586
		cacheURL = s.url;
8587
8588
		// More options handling for requests with no content
8589
		if ( !s.hasContent ) {
8590
8591
			// If data is available, append data to url
8592
			if ( s.data ) {
8593
				cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
8594
8595
				// #9682: remove data so that it's not used in an eventual retry
8596
				delete s.data;
8597
			}
8598
8599
			// Add anti-cache in url if needed
8600
			if ( s.cache === false ) {
8601
				s.url = rts.test( cacheURL ) ?
8602
8603
					// If there is already a '_' parameter, set its value
8604
					cacheURL.replace( rts, "$1_=" + nonce++ ) :
8605
8606
					// Otherwise add one to the end
8607
					cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
8608
			}
8609
		}
8610
8611
		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8612
		if ( s.ifModified ) {
8613
			if ( jQuery.lastModified[ cacheURL ] ) {
8614
				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
8615
			}
8616
			if ( jQuery.etag[ cacheURL ] ) {
8617
				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
8618
			}
8619
		}
8620
8621
		// Set the correct header, if data is being sent
8622
		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
8623
			jqXHR.setRequestHeader( "Content-Type", s.contentType );
8624
		}
8625
8626
		// Set the Accepts header for the server, depending on the dataType
8627
		jqXHR.setRequestHeader(
8628
			"Accept",
8629
			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
8630
				s.accepts[ s.dataTypes[ 0 ] ] +
8631
					( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
8632
				s.accepts[ "*" ]
8633
		);
8634
8635
		// Check for headers option
8636
		for ( i in s.headers ) {
8637
			jqXHR.setRequestHeader( i, s.headers[ i ] );
8638
		}
8639
8640
		// Allow custom headers/mimetypes and early abort
8641
		if ( s.beforeSend &&
8642
			( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
8643
8644
			// Abort if not done already and return
8645
			return jqXHR.abort();
8646
		}
8647
8648
		// Aborting is no longer a cancellation
8649
		strAbort = "abort";
8650
8651
		// Install callbacks on deferreds
8652
		for ( i in { success: 1, error: 1, complete: 1 } ) {
8653
			jqXHR[ i ]( s[ i ] );
8654
		}
8655
8656
		// Get transport
8657
		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
8658
8659
		// If no transport, we auto-abort
8660
		if ( !transport ) {
8661
			done( -1, "No Transport" );
8662
		} else {
8663
			jqXHR.readyState = 1;
8664
8665
			// Send global event
8666
			if ( fireGlobals ) {
8667
				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
8668
			}
8669
8670
			// If request was aborted inside ajaxSend, stop there
8671
			if ( state === 2 ) {
8672
				return jqXHR;
8673
			}
8674
8675
			// Timeout
8676
			if ( s.async && s.timeout > 0 ) {
8677
				timeoutTimer = window.setTimeout( function() {
8678
					jqXHR.abort( "timeout" );
8679
				}, s.timeout );
8680
			}
8681
8682
			try {
8683
				state = 1;
8684
				transport.send( requestHeaders, done );
8685
			} catch ( e ) {
8686
8687
				// Propagate exception as error if not done
8688
				if ( state < 2 ) {
8689
					done( -1, e );
8690
8691
				// Simply rethrow otherwise
8692
				} else {
8693
					throw e;
8694
				}
8695
			}
8696
		}
8697
8698
		// Callback for when everything is done
8699
		function done( status, nativeStatusText, responses, headers ) {
8700
			var isSuccess, success, error, response, modified,
8701
				statusText = nativeStatusText;
8702
8703
			// Called once
8704
			if ( state === 2 ) {
8705
				return;
8706
			}
8707
8708
			// State is "done" now
8709
			state = 2;
8710
8711
			// Clear timeout if it exists
8712
			if ( timeoutTimer ) {
8713
				window.clearTimeout( timeoutTimer );
8714
			}
8715
8716
			// Dereference transport for early garbage collection
8717
			// (no matter how long the jqXHR object will be used)
8718
			transport = undefined;
8719
8720
			// Cache response headers
8721
			responseHeadersString = headers || "";
8722
8723
			// Set readyState
8724
			jqXHR.readyState = status > 0 ? 4 : 0;
8725
8726
			// Determine if successful
8727
			isSuccess = status >= 200 && status < 300 || status === 304;
8728
8729
			// Get response data
8730
			if ( responses ) {
8731
				response = ajaxHandleResponses( s, jqXHR, responses );
8732
			}
8733
8734
			// Convert no matter what (that way responseXXX fields are always set)
8735
			response = ajaxConvert( s, response, jqXHR, isSuccess );
8736
8737
			// If successful, handle type chaining
8738
			if ( isSuccess ) {
8739
8740
				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8741
				if ( s.ifModified ) {
8742
					modified = jqXHR.getResponseHeader( "Last-Modified" );
8743
					if ( modified ) {
8744
						jQuery.lastModified[ cacheURL ] = modified;
8745
					}
8746
					modified = jqXHR.getResponseHeader( "etag" );
8747
					if ( modified ) {
8748
						jQuery.etag[ cacheURL ] = modified;
8749
					}
8750
				}
8751
8752
				// if no content
8753
				if ( status === 204 || s.type === "HEAD" ) {
8754
					statusText = "nocontent";
8755
8756
				// if not modified
8757
				} else if ( status === 304 ) {
8758
					statusText = "notmodified";
8759
8760
				// If we have data, let's convert it
8761
				} else {
8762
					statusText = response.state;
8763
					success = response.data;
8764
					error = response.error;
8765
					isSuccess = !error;
8766
				}
8767
			} else {
8768
8769
				// Extract error from statusText and normalize for non-aborts
8770
				error = statusText;
8771
				if ( status || !statusText ) {
8772
					statusText = "error";
8773
					if ( status < 0 ) {
8774
						status = 0;
8775
					}
8776
				}
8777
			}
8778
8779
			// Set data for the fake xhr object
8780
			jqXHR.status = status;
8781
			jqXHR.statusText = ( nativeStatusText || statusText ) + "";
8782
8783
			// Success/Error
8784
			if ( isSuccess ) {
8785
				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
8786
			} else {
8787
				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
8788
			}
8789
8790
			// Status-dependent callbacks
8791
			jqXHR.statusCode( statusCode );
8792
			statusCode = undefined;
8793
8794
			if ( fireGlobals ) {
8795
				globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
8796
					[ jqXHR, s, isSuccess ? success : error ] );
8797
			}
8798
8799
			// Complete
8800
			completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
8801
8802
			if ( fireGlobals ) {
8803
				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
8804
8805
				// Handle the global AJAX counter
8806
				if ( !( --jQuery.active ) ) {
8807
					jQuery.event.trigger( "ajaxStop" );
8808
				}
8809
			}
8810
		}
8811
8812
		return jqXHR;
8813
	},
8814
8815
	getJSON: function( url, data, callback ) {
8816
		return jQuery.get( url, data, callback, "json" );
8817
	},
8818
8819
	getScript: function( url, callback ) {
8820
		return jQuery.get( url, undefined, callback, "script" );
8821
	}
8822
} );
8823
8824
jQuery.each( [ "get", "post" ], function( i, method ) {
8825
	jQuery[ method ] = function( url, data, callback, type ) {
8826
8827
		// Shift arguments if data argument was omitted
8828
		if ( jQuery.isFunction( data ) ) {
8829
			type = type || callback;
8830
			callback = data;
8831
			data = undefined;
8832
		}
8833
8834
		// The url can be an options object (which then must have .url)
8835
		return jQuery.ajax( jQuery.extend( {
8836
			url: url,
8837
			type: method,
8838
			dataType: type,
8839
			data: data,
8840
			success: callback
8841
		}, jQuery.isPlainObject( url ) && url ) );
8842
	};
8843
} );
8844
8845
8846
jQuery._evalUrl = function( url ) {
8847
	return jQuery.ajax( {
8848
		url: url,
8849
8850
		// Make this explicit, since user can override this through ajaxSetup (#11264)
8851
		type: "GET",
8852
		dataType: "script",
8853
		async: false,
8854
		global: false,
8855
		"throws": true
8856
	} );
8857
};
8858
8859
8860
jQuery.fn.extend( {
8861
	wrapAll: function( html ) {
8862
		var wrap;
8863
8864
		if ( jQuery.isFunction( html ) ) {
8865
			return this.each( function( i ) {
8866
				jQuery( this ).wrapAll( html.call( this, i ) );
8867
			} );
8868
		}
8869
8870
		if ( this[ 0 ] ) {
8871
8872
			// The elements to wrap the target around
8873
			wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
8874
8875
			if ( this[ 0 ].parentNode ) {
8876
				wrap.insertBefore( this[ 0 ] );
8877
			}
8878
8879
			wrap.map( function() {
8880
				var elem = this;
8881
8882
				while ( elem.firstElementChild ) {
8883
					elem = elem.firstElementChild;
8884
				}
8885
8886
				return elem;
8887
			} ).append( this );
8888
		}
8889
8890
		return this;
8891
	},
8892
8893
	wrapInner: function( html ) {
8894
		if ( jQuery.isFunction( html ) ) {
8895
			return this.each( function( i ) {
8896
				jQuery( this ).wrapInner( html.call( this, i ) );
8897
			} );
8898
		}
8899
8900
		return this.each( function() {
8901
			var self = jQuery( this ),
8902
				contents = self.contents();
8903
8904
			if ( contents.length ) {
8905
				contents.wrapAll( html );
8906
8907
			} else {
8908
				self.append( html );
8909
			}
8910
		} );
8911
	},
8912
8913
	wrap: function( html ) {
8914
		var isFunction = jQuery.isFunction( html );
8915
8916
		return this.each( function( i ) {
8917
			jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
8918
		} );
8919
	},
8920
8921
	unwrap: function() {
8922
		return this.parent().each( function() {
8923
			if ( !jQuery.nodeName( this, "body" ) ) {
8924
				jQuery( this ).replaceWith( this.childNodes );
8925
			}
8926
		} ).end();
8927
	}
8928
} );
8929
8930
8931
jQuery.expr.filters.hidden = function( elem ) {
8932
	return !jQuery.expr.filters.visible( elem );
8933
};
8934
jQuery.expr.filters.visible = function( elem ) {
8935
8936
	// Support: Opera <= 12.12
8937
	// Opera reports offsetWidths and offsetHeights less than zero on some elements
8938
	// Use OR instead of AND as the element is not visible if either is true
8939
	// See tickets #10406 and #13132
8940
	return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
8941
};
8942
8943
8944
8945
8946
var r20 = /%20/g,
8947
	rbracket = /\[\]$/,
8948
	rCRLF = /\r?\n/g,
8949
	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8950
	rsubmittable = /^(?:input|select|textarea|keygen)/i;
8951
8952
function buildParams( prefix, obj, traditional, add ) {
8953
	var name;
8954
8955
	if ( jQuery.isArray( obj ) ) {
8956
8957
		// Serialize array item.
8958
		jQuery.each( obj, function( i, v ) {
8959
			if ( traditional || rbracket.test( prefix ) ) {
8960
8961
				// Treat each array item as a scalar.
8962
				add( prefix, v );
8963
8964
			} else {
8965
8966
				// Item is non-scalar (array or object), encode its numeric index.
8967
				buildParams(
8968
					prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
8969
					v,
8970
					traditional,
8971
					add
8972
				);
8973
			}
8974
		} );
8975
8976
	} else if ( !traditional && jQuery.type( obj ) === "object" ) {
8977
8978
		// Serialize object item.
8979
		for ( name in obj ) {
8980
			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8981
		}
8982
8983
	} else {
8984
8985
		// Serialize scalar item.
8986
		add( prefix, obj );
8987
	}
8988
}
8989
8990
// Serialize an array of form elements or a set of
8991
// key/values into a query string
8992
jQuery.param = function( a, traditional ) {
8993
	var prefix,
8994
		s = [],
8995
		add = function( key, value ) {
8996
8997
			// If value is a function, invoke it and return its value
8998
			value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
8999
			s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
9000
		};
9001
9002
	// Set traditional to true for jQuery <= 1.3.2 behavior.
9003
	if ( traditional === undefined ) {
9004
		traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
9005
	}
9006
9007
	// If an array was passed in, assume that it is an array of form elements.
9008
	if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
9009
9010
		// Serialize the form elements
9011
		jQuery.each( a, function() {
9012
			add( this.name, this.value );
9013
		} );
9014
9015
	} else {
9016
9017
		// If traditional, encode the "old" way (the way 1.3.2 or older
9018
		// did it), otherwise encode params recursively.
9019
		for ( prefix in a ) {
9020
			buildParams( prefix, a[ prefix ], traditional, add );
9021
		}
9022
	}
9023
9024
	// Return the resulting serialization
9025
	return s.join( "&" ).replace( r20, "+" );
9026
};
9027
9028
jQuery.fn.extend( {
9029
	serialize: function() {
9030
		return jQuery.param( this.serializeArray() );
9031
	},
9032
	serializeArray: function() {
9033
		return this.map( function() {
9034
9035
			// Can add propHook for "elements" to filter or add form elements
9036
			var elements = jQuery.prop( this, "elements" );
9037
			return elements ? jQuery.makeArray( elements ) : this;
9038
		} )
9039
		.filter( function() {
9040
			var type = this.type;
9041
9042
			// Use .is( ":disabled" ) so that fieldset[disabled] works
9043
			return this.name && !jQuery( this ).is( ":disabled" ) &&
9044
				rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
9045
				( this.checked || !rcheckableType.test( type ) );
9046
		} )
9047
		.map( function( i, elem ) {
9048
			var val = jQuery( this ).val();
9049
9050
			return val == null ?
9051
				null :
9052
				jQuery.isArray( val ) ?
9053
					jQuery.map( val, function( val ) {
9054
						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9055
					} ) :
9056
					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9057
		} ).get();
9058
	}
9059
} );
9060
9061
9062
jQuery.ajaxSettings.xhr = function() {
9063
	try {
9064
		return new window.XMLHttpRequest();
9065
	} catch ( e ) {}
9066
};
9067
9068
var xhrSuccessStatus = {
9069
9070
		// File protocol always yields status code 0, assume 200
9071
		0: 200,
9072
9073
		// Support: IE9
9074
		// #1450: sometimes IE returns 1223 when it should be 204
9075
		1223: 204
9076
	},
9077
	xhrSupported = jQuery.ajaxSettings.xhr();
9078
9079
support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9080
support.ajax = xhrSupported = !!xhrSupported;
9081
9082
jQuery.ajaxTransport( function( options ) {
9083
	var callback, errorCallback;
9084
9085
	// Cross domain only allowed if supported through XMLHttpRequest
9086
	if ( support.cors || xhrSupported && !options.crossDomain ) {
9087
		return {
9088
			send: function( headers, complete ) {
9089
				var i,
9090
					xhr = options.xhr();
9091
9092
				xhr.open(
9093
					options.type,
9094
					options.url,
9095
					options.async,
9096
					options.username,
9097
					options.password
9098
				);
9099
9100
				// Apply custom fields if provided
9101
				if ( options.xhrFields ) {
9102
					for ( i in options.xhrFields ) {
9103
						xhr[ i ] = options.xhrFields[ i ];
9104
					}
9105
				}
9106
9107
				// Override mime type if needed
9108
				if ( options.mimeType && xhr.overrideMimeType ) {
9109
					xhr.overrideMimeType( options.mimeType );
9110
				}
9111
9112
				// X-Requested-With header
9113
				// For cross-domain requests, seeing as conditions for a preflight are
9114
				// akin to a jigsaw puzzle, we simply never set it to be sure.
9115
				// (it can always be set on a per-request basis or even using ajaxSetup)
9116
				// For same-domain requests, won't change header if already provided.
9117
				if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
9118
					headers[ "X-Requested-With" ] = "XMLHttpRequest";
9119
				}
9120
9121
				// Set headers
9122
				for ( i in headers ) {
9123
					xhr.setRequestHeader( i, headers[ i ] );
9124
				}
9125
9126
				// Callback
9127
				callback = function( type ) {
9128
					return function() {
9129
						if ( callback ) {
9130
							callback = errorCallback = xhr.onload =
9131
								xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
9132
9133
							if ( type === "abort" ) {
9134
								xhr.abort();
9135
							} else if ( type === "error" ) {
9136
9137
								// Support: IE9
9138
								// On a manual native abort, IE9 throws
9139
								// errors on any property access that is not readyState
9140
								if ( typeof xhr.status !== "number" ) {
9141
									complete( 0, "error" );
9142
								} else {
9143
									complete(
9144
9145
										// File: protocol always yields status 0; see #8605, #14207
9146
										xhr.status,
9147
										xhr.statusText
9148
									);
9149
								}
9150
							} else {
9151
								complete(
9152
									xhrSuccessStatus[ xhr.status ] || xhr.status,
9153
									xhr.statusText,
9154
9155
									// Support: IE9 only
9156
									// IE9 has no XHR2 but throws on binary (trac-11426)
9157
									// For XHR2 non-text, let the caller handle it (gh-2498)
9158
									( xhr.responseType || "text" ) !== "text"  ||
9159
									typeof xhr.responseText !== "string" ?
9160
										{ binary: xhr.response } :
9161
										{ text: xhr.responseText },
9162
									xhr.getAllResponseHeaders()
9163
								);
9164
							}
9165
						}
9166
					};
9167
				};
9168
9169
				// Listen to events
9170
				xhr.onload = callback();
9171
				errorCallback = xhr.onerror = callback( "error" );
9172
9173
				// Support: IE9
9174
				// Use onreadystatechange to replace onabort
9175
				// to handle uncaught aborts
9176
				if ( xhr.onabort !== undefined ) {
9177
					xhr.onabort = errorCallback;
9178
				} else {
9179
					xhr.onreadystatechange = function() {
9180
9181
						// Check readyState before timeout as it changes
9182
						if ( xhr.readyState === 4 ) {
9183
9184
							// Allow onerror to be called first,
9185
							// but that will not handle a native abort
9186
							// Also, save errorCallback to a variable
9187
							// as xhr.onerror cannot be accessed
9188
							window.setTimeout( function() {
9189
								if ( callback ) {
9190
									errorCallback();
9191
								}
9192
							} );
9193
						}
9194
					};
9195
				}
9196
9197
				// Create the abort callback
9198
				callback = callback( "abort" );
9199
9200
				try {
9201
9202
					// Do send the request (this may raise an exception)
9203
					xhr.send( options.hasContent && options.data || null );
9204
				} catch ( e ) {
9205
9206
					// #14683: Only rethrow if this hasn't been notified as an error yet
9207
					if ( callback ) {
9208
						throw e;
9209
					}
9210
				}
9211
			},
9212
9213
			abort: function() {
9214
				if ( callback ) {
9215
					callback();
9216
				}
9217
			}
9218
		};
9219
	}
9220
} );
9221
9222
9223
9224
9225
// Install script dataType
9226
jQuery.ajaxSetup( {
9227
	accepts: {
9228
		script: "text/javascript, application/javascript, " +
9229
			"application/ecmascript, application/x-ecmascript"
9230
	},
9231
	contents: {
9232
		script: /\b(?:java|ecma)script\b/
9233
	},
9234
	converters: {
9235
		"text script": function( text ) {
9236
			jQuery.globalEval( text );
9237
			return text;
9238
		}
9239
	}
9240
} );
9241
9242
// Handle cache's special case and crossDomain
9243
jQuery.ajaxPrefilter( "script", function( s ) {
9244
	if ( s.cache === undefined ) {
9245
		s.cache = false;
9246
	}
9247
	if ( s.crossDomain ) {
9248
		s.type = "GET";
9249
	}
9250
} );
9251
9252
// Bind script tag hack transport
9253
jQuery.ajaxTransport( "script", function( s ) {
9254
9255
	// This transport only deals with cross domain requests
9256
	if ( s.crossDomain ) {
9257
		var script, callback;
9258
		return {
9259
			send: function( _, complete ) {
9260
				script = jQuery( "<script>" ).prop( {
9261
					charset: s.scriptCharset,
9262
					src: s.url
9263
				} ).on(
9264
					"load error",
9265
					callback = function( evt ) {
9266
						script.remove();
9267
						callback = null;
9268
						if ( evt ) {
9269
							complete( evt.type === "error" ? 404 : 200, evt.type );
9270
						}
9271
					}
9272
				);
9273
9274
				// Use native DOM manipulation to avoid our domManip AJAX trickery
9275
				document.head.appendChild( script[ 0 ] );
9276
			},
9277
			abort: function() {
9278
				if ( callback ) {
9279
					callback();
9280
				}
9281
			}
9282
		};
9283
	}
9284
} );
9285
9286
9287
9288
9289
var oldCallbacks = [],
9290
	rjsonp = /(=)\?(?=&|$)|\?\?/;
9291
9292
// Default jsonp settings
9293
jQuery.ajaxSetup( {
9294
	jsonp: "callback",
9295
	jsonpCallback: function() {
9296
		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
9297
		this[ callback ] = true;
9298
		return callback;
9299
	}
9300
} );
9301
9302
// Detect, normalize options and install callbacks for jsonp requests
9303
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
9304
9305
	var callbackName, overwritten, responseContainer,
9306
		jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
9307
			"url" :
9308
			typeof s.data === "string" &&
9309
				( s.contentType || "" )
9310
					.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
9311
				rjsonp.test( s.data ) && "data"
9312
		);
9313
9314
	// Handle iff the expected data type is "jsonp" or we have a parameter to set
9315
	if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
9316
9317
		// Get callback name, remembering preexisting value associated with it
9318
		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9319
			s.jsonpCallback() :
9320
			s.jsonpCallback;
9321
9322
		// Insert callback into url or form data
9323
		if ( jsonProp ) {
9324
			s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
9325
		} else if ( s.jsonp !== false ) {
9326
			s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
9327
		}
9328
9329
		// Use data converter to retrieve json after script execution
9330
		s.converters[ "script json" ] = function() {
9331
			if ( !responseContainer ) {
9332
				jQuery.error( callbackName + " was not called" );
9333
			}
9334
			return responseContainer[ 0 ];
9335
		};
9336
9337
		// Force json dataType
9338
		s.dataTypes[ 0 ] = "json";
9339
9340
		// Install callback
9341
		overwritten = window[ callbackName ];
9342
		window[ callbackName ] = function() {
9343
			responseContainer = arguments;
9344
		};
9345
9346
		// Clean-up function (fires after converters)
9347
		jqXHR.always( function() {
9348
9349
			// If previous value didn't exist - remove it
9350
			if ( overwritten === undefined ) {
9351
				jQuery( window ).removeProp( callbackName );
9352
9353
			// Otherwise restore preexisting value
9354
			} else {
9355
				window[ callbackName ] = overwritten;
9356
			}
9357
9358
			// Save back as free
9359
			if ( s[ callbackName ] ) {
9360
9361
				// Make sure that re-using the options doesn't screw things around
9362
				s.jsonpCallback = originalSettings.jsonpCallback;
9363
9364
				// Save the callback name for future use
9365
				oldCallbacks.push( callbackName );
9366
			}
9367
9368
			// Call if it was a function and we have a response
9369
			if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9370
				overwritten( responseContainer[ 0 ] );
9371
			}
9372
9373
			responseContainer = overwritten = undefined;
9374
		} );
9375
9376
		// Delegate to script
9377
		return "script";
9378
	}
9379
} );
9380
9381
9382
9383
9384
// Argument "data" should be string of html
9385
// context (optional): If specified, the fragment will be created in this context,
9386
// defaults to document
9387
// keepScripts (optional): If true, will include scripts passed in the html string
9388
jQuery.parseHTML = function( data, context, keepScripts ) {
9389
	if ( !data || typeof data !== "string" ) {
9390
		return null;
9391
	}
9392
	if ( typeof context === "boolean" ) {
9393
		keepScripts = context;
9394
		context = false;
9395
	}
9396
	context = context || document;
9397
9398
	var parsed = rsingleTag.exec( data ),
9399
		scripts = !keepScripts && [];
9400
9401
	// Single tag
9402
	if ( parsed ) {
9403
		return [ context.createElement( parsed[ 1 ] ) ];
9404
	}
9405
9406
	parsed = buildFragment( [ data ], context, scripts );
9407
9408
	if ( scripts && scripts.length ) {
9409
		jQuery( scripts ).remove();
9410
	}
9411
9412
	return jQuery.merge( [], parsed.childNodes );
9413
};
9414
9415
9416
// Keep a copy of the old load method
9417
var _load = jQuery.fn.load;
9418
9419
/**
9420
 * Load a url into a page
9421
 */
9422
jQuery.fn.load = function( url, params, callback ) {
9423
	if ( typeof url !== "string" && _load ) {
9424
		return _load.apply( this, arguments );
9425
	}
9426
9427
	var selector, type, response,
9428
		self = this,
9429
		off = url.indexOf( " " );
9430
9431
	if ( off > -1 ) {
9432
		selector = jQuery.trim( url.slice( off ) );
9433
		url = url.slice( 0, off );
9434
	}
9435
9436
	// If it's a function
9437
	if ( jQuery.isFunction( params ) ) {
9438
9439
		// We assume that it's the callback
9440
		callback = params;
9441
		params = undefined;
9442
9443
	// Otherwise, build a param string
9444
	} else if ( params && typeof params === "object" ) {
9445
		type = "POST";
9446
	}
9447
9448
	// If we have elements to modify, make the request
9449
	if ( self.length > 0 ) {
9450
		jQuery.ajax( {
9451
			url: url,
9452
9453
			// If "type" variable is undefined, then "GET" method will be used.
9454
			// Make value of this field explicit since
9455
			// user can override it through ajaxSetup method
9456
			type: type || "GET",
9457
			dataType: "html",
9458
			data: params
9459
		} ).done( function( responseText ) {
9460
9461
			// Save response for use in complete callback
9462
			response = arguments;
9463
9464
			self.html( selector ?
9465
9466
				// If a selector was specified, locate the right elements in a dummy div
9467
				// Exclude scripts to avoid IE 'Permission Denied' errors
9468
				jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
9469
9470
				// Otherwise use the full result
9471
				responseText );
9472
9473
		// If the request succeeds, this function gets "data", "status", "jqXHR"
9474
		// but they are ignored because response was set above.
9475
		// If it fails, this function gets "jqXHR", "status", "error"
9476
		} ).always( callback && function( jqXHR, status ) {
9477
			self.each( function() {
9478
				callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
9479
			} );
9480
		} );
9481
	}
9482
9483
	return this;
9484
};
9485
9486
9487
9488
9489
// Attach a bunch of functions for handling common AJAX events
9490
jQuery.each( [
9491
	"ajaxStart",
9492
	"ajaxStop",
9493
	"ajaxComplete",
9494
	"ajaxError",
9495
	"ajaxSuccess",
9496
	"ajaxSend"
9497
], function( i, type ) {
9498
	jQuery.fn[ type ] = function( fn ) {
9499
		return this.on( type, fn );
9500
	};
9501
} );
9502
9503
9504
9505
9506
jQuery.expr.filters.animated = function( elem ) {
9507
	return jQuery.grep( jQuery.timers, function( fn ) {
9508
		return elem === fn.elem;
9509
	} ).length;
9510
};
9511
9512
9513
9514
9515
/**
9516
 * Gets a window from an element
9517
 */
9518
function getWindow( elem ) {
9519
	return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
9520
}
9521
9522
jQuery.offset = {
9523
	setOffset: function( elem, options, i ) {
9524
		var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
9525
			position = jQuery.css( elem, "position" ),
9526
			curElem = jQuery( elem ),
9527
			props = {};
9528
9529
		// Set position first, in-case top/left are set even on static elem
9530
		if ( position === "static" ) {
9531
			elem.style.position = "relative";
9532
		}
9533
9534
		curOffset = curElem.offset();
9535
		curCSSTop = jQuery.css( elem, "top" );
9536
		curCSSLeft = jQuery.css( elem, "left" );
9537
		calculatePosition = ( position === "absolute" || position === "fixed" ) &&
9538
			( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
9539
9540
		// Need to be able to calculate position if either
9541
		// top or left is auto and position is either absolute or fixed
9542
		if ( calculatePosition ) {
9543
			curPosition = curElem.position();
9544
			curTop = curPosition.top;
9545
			curLeft = curPosition.left;
9546
9547
		} else {
9548
			curTop = parseFloat( curCSSTop ) || 0;
9549
			curLeft = parseFloat( curCSSLeft ) || 0;
9550
		}
9551
9552
		if ( jQuery.isFunction( options ) ) {
9553
9554
			// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
9555
			options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
9556
		}
9557
9558
		if ( options.top != null ) {
9559
			props.top = ( options.top - curOffset.top ) + curTop;
9560
		}
9561
		if ( options.left != null ) {
9562
			props.left = ( options.left - curOffset.left ) + curLeft;
9563
		}
9564
9565
		if ( "using" in options ) {
9566
			options.using.call( elem, props );
9567
9568
		} else {
9569
			curElem.css( props );
9570
		}
9571
	}
9572
};
9573
9574
jQuery.fn.extend( {
9575
	offset: function( options ) {
9576
		if ( arguments.length ) {
9577
			return options === undefined ?
9578
				this :
9579
				this.each( function( i ) {
9580
					jQuery.offset.setOffset( this, options, i );
9581
				} );
9582
		}
9583
9584
		var docElem, win,
9585
			elem = this[ 0 ],
9586
			box = { top: 0, left: 0 },
9587
			doc = elem && elem.ownerDocument;
9588
9589
		if ( !doc ) {
9590
			return;
9591
		}
9592
9593
		docElem = doc.documentElement;
9594
9595
		// Make sure it's not a disconnected DOM node
9596
		if ( !jQuery.contains( docElem, elem ) ) {
9597
			return box;
9598
		}
9599
9600
		box = elem.getBoundingClientRect();
9601
		win = getWindow( doc );
9602
		return {
9603
			top: box.top + win.pageYOffset - docElem.clientTop,
9604
			left: box.left + win.pageXOffset - docElem.clientLeft
9605
		};
9606
	},
9607
9608
	position: function() {
9609
		if ( !this[ 0 ] ) {
9610
			return;
9611
		}
9612
9613
		var offsetParent, offset,
9614
			elem = this[ 0 ],
9615
			parentOffset = { top: 0, left: 0 };
9616
9617
		// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
9618
		// because it is its only offset parent
9619
		if ( jQuery.css( elem, "position" ) === "fixed" ) {
9620
9621
			// Assume getBoundingClientRect is there when computed position is fixed
9622
			offset = elem.getBoundingClientRect();
9623
9624
		} else {
9625
9626
			// Get *real* offsetParent
9627
			offsetParent = this.offsetParent();
9628
9629
			// Get correct offsets
9630
			offset = this.offset();
9631
			if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
9632
				parentOffset = offsetParent.offset();
9633
			}
9634
9635
			// Add offsetParent borders
9636
			parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
9637
			parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
9638
		}
9639
9640
		// Subtract parent offsets and element margins
9641
		return {
9642
			top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
9643
			left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
9644
		};
9645
	},
9646
9647
	// This method will return documentElement in the following cases:
9648
	// 1) For the element inside the iframe without offsetParent, this method will return
9649
	//    documentElement of the parent window
9650
	// 2) For the hidden or detached element
9651
	// 3) For body or html element, i.e. in case of the html node - it will return itself
9652
	//
9653
	// but those exceptions were never presented as a real life use-cases
9654
	// and might be considered as more preferable results.
9655
	//
9656
	// This logic, however, is not guaranteed and can change at any point in the future
9657
	offsetParent: function() {
9658
		return this.map( function() {
9659
			var offsetParent = this.offsetParent;
9660
9661
			while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
9662
				offsetParent = offsetParent.offsetParent;
9663
			}
9664
9665
			return offsetParent || documentElement;
9666
		} );
9667
	}
9668
} );
9669
9670
// Create scrollLeft and scrollTop methods
9671
jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
9672
	var top = "pageYOffset" === prop;
9673
9674
	jQuery.fn[ method ] = function( val ) {
9675
		return access( this, function( elem, method, val ) {
9676
			var win = getWindow( elem );
9677
9678
			if ( val === undefined ) {
9679
				return win ? win[ prop ] : elem[ method ];
9680
			}
9681
9682
			if ( win ) {
9683
				win.scrollTo(
9684
					!top ? val : win.pageXOffset,
9685
					top ? val : win.pageYOffset
9686
				);
9687
9688
			} else {
9689
				elem[ method ] = val;
9690
			}
9691
		}, method, val, arguments.length );
9692
	};
9693
} );
9694
9695
// Support: Safari<7-8+, Chrome<37-44+
9696
// Add the top/left cssHooks using jQuery.fn.position
9697
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
9698
// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
9699
// getComputedStyle returns percent when specified for top/left/bottom/right;
9700
// rather than make the css module depend on the offset module, just check for it here
9701
jQuery.each( [ "top", "left" ], function( i, prop ) {
9702
	jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
9703
		function( elem, computed ) {
9704
			if ( computed ) {
9705
				computed = curCSS( elem, prop );
9706
9707
				// If curCSS returns percentage, fallback to offset
9708
				return rnumnonpx.test( computed ) ?
9709
					jQuery( elem ).position()[ prop ] + "px" :
9710
					computed;
9711
			}
9712
		}
9713
	);
9714
} );
9715
9716
9717
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
9718
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9719
	jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
9720
		function( defaultExtra, funcName ) {
9721
9722
		// Margin is only for outerHeight, outerWidth
9723
		jQuery.fn[ funcName ] = function( margin, value ) {
9724
			var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
9725
				extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
9726
9727
			return access( this, function( elem, type, value ) {
9728
				var doc;
9729
9730
				if ( jQuery.isWindow( elem ) ) {
9731
9732
					// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
9733
					// isn't a whole lot we can do. See pull request at this URL for discussion:
9734
					// https://github.com/jquery/jquery/pull/764
9735
					return elem.document.documentElement[ "client" + name ];
9736
				}
9737
9738
				// Get document width or height
9739
				if ( elem.nodeType === 9 ) {
9740
					doc = elem.documentElement;
9741
9742
					// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
9743
					// whichever is greatest
9744
					return Math.max(
9745
						elem.body[ "scroll" + name ], doc[ "scroll" + name ],
9746
						elem.body[ "offset" + name ], doc[ "offset" + name ],
9747
						doc[ "client" + name ]
9748
					);
9749
				}
9750
9751
				return value === undefined ?
9752
9753
					// Get width or height on the element, requesting but not forcing parseFloat
9754
					jQuery.css( elem, type, extra ) :
9755
9756
					// Set width or height on the element
9757
					jQuery.style( elem, type, value, extra );
9758
			}, type, chainable ? margin : undefined, chainable, null );
9759
		};
9760
	} );
9761
} );
9762
9763
9764
jQuery.fn.extend( {
9765
9766
	bind: function( types, data, fn ) {
9767
		return this.on( types, null, data, fn );
9768
	},
9769
	unbind: function( types, fn ) {
9770
		return this.off( types, null, fn );
9771
	},
9772
9773
	delegate: function( selector, types, data, fn ) {
9774
		return this.on( types, selector, data, fn );
9775
	},
9776
	undelegate: function( selector, types, fn ) {
9777
9778
		// ( namespace ) or ( selector, types [, fn] )
9779
		return arguments.length === 1 ?
9780
			this.off( selector, "**" ) :
9781
			this.off( types, selector || "**", fn );
9782
	},
9783
	size: function() {
9784
		return this.length;
9785
	}
9786
} );
9787
9788
jQuery.fn.andSelf = jQuery.fn.addBack;
9789
9790
9791
9792
9793
// Register as a named AMD module, since jQuery can be concatenated with other
9794
// files that may use define, but not via a proper concatenation script that
9795
// understands anonymous AMD modules. A named AMD is safest and most robust
9796
// way to register. Lowercase jquery is used because AMD module names are
9797
// derived from file names, and jQuery is normally delivered in a lowercase
9798
// file name. Do this after creating the global so that if an AMD module wants
9799
// to call noConflict to hide this version of jQuery, it will work.
9800
9801
// Note that for maximum portability, libraries that are not jQuery should
9802
// declare themselves as anonymous modules, and avoid setting a global if an
9803
// AMD loader is present. jQuery is a special case. For more information, see
9804
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
9805
9806
if ( typeof define === "function" && define.amd ) {
9807
	define( "jquery", [], function() {
9808
		return jQuery;
9809
	} );
9810
}
9811
9812
9813
9814
var
9815
9816
	// Map over jQuery in case of overwrite
9817
	_jQuery = window.jQuery,
9818
9819
	// Map over the $ in case of overwrite
9820
	_$ = window.$;
9821
9822
jQuery.noConflict = function( deep ) {
9823
	if ( window.$ === jQuery ) {
9824
		window.$ = _$;
9825
	}
9826
9827
	if ( deep && window.jQuery === jQuery ) {
9828
		window.jQuery = _jQuery;
9829
	}
9830
9831
	return jQuery;
9832
};
9833
9834
// Expose jQuery and $ identifiers, even in AMD
9835
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
9836
// and CommonJS for browser emulators (#13566)
9837
if ( !noGlobal ) {
9838
	window.jQuery = window.$ = jQuery;
9839
}
9840
9841
return jQuery;
9842
}));
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-2.2.3.min.js (+4 lines)
Line 0 Link Here
1
/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */
2
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
3
}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],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,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,
4
e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,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"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-migrate-1.3.0.js (+702 lines)
Line 0 Link Here
1
/*!
2
 * jQuery Migrate - v1.3.0 - 2016-01-13
3
 * Copyright jQuery Foundation and other contributors
4
 */
5
(function( jQuery, window, undefined ) {
6
// See http://bugs.jquery.com/ticket/13335
7
// "use strict";
8
9
10
jQuery.migrateVersion = "1.3.0";
11
12
13
var warnedAbout = {};
14
15
// List of warnings already given; public read only
16
jQuery.migrateWarnings = [];
17
18
// Set to true to prevent console output; migrateWarnings still maintained
19
// jQuery.migrateMute = false;
20
21
// Show a message on the console so devs know we're active
22
if ( !jQuery.migrateMute && window.console && window.console.log ) {
23
	window.console.log("JQMIGRATE: Logging is active");
24
}
25
26
// Set to false to disable traces that appear with warnings
27
if ( jQuery.migrateTrace === undefined ) {
28
	jQuery.migrateTrace = true;
29
}
30
31
// Forget any warnings we've already given; public
32
jQuery.migrateReset = function() {
33
	warnedAbout = {};
34
	jQuery.migrateWarnings.length = 0;
35
};
36
37
function migrateWarn( msg) {
38
	var console = window.console;
39
	if ( !warnedAbout[ msg ] ) {
40
		warnedAbout[ msg ] = true;
41
		jQuery.migrateWarnings.push( msg );
42
		if ( console && console.warn && !jQuery.migrateMute ) {
43
			console.warn( "JQMIGRATE: " + msg );
44
			if ( jQuery.migrateTrace && console.trace ) {
45
				console.trace();
46
			}
47
		}
48
	}
49
}
50
51
function migrateWarnProp( obj, prop, value, msg ) {
52
	if ( Object.defineProperty ) {
53
		// On ES5 browsers (non-oldIE), warn if the code tries to get prop;
54
		// allow property to be overwritten in case some other plugin wants it
55
		try {
56
			Object.defineProperty( obj, prop, {
57
				configurable: true,
58
				enumerable: true,
59
				get: function() {
60
					migrateWarn( msg );
61
					return value;
62
				},
63
				set: function( newValue ) {
64
					migrateWarn( msg );
65
					value = newValue;
66
				}
67
			});
68
			return;
69
		} catch( err ) {
70
			// IE8 is a dope about Object.defineProperty, can't warn there
71
		}
72
	}
73
74
	// Non-ES5 (or broken) browser; just set the property
75
	jQuery._definePropertyBroken = true;
76
	obj[ prop ] = value;
77
}
78
79
if ( document.compatMode === "BackCompat" ) {
80
	// jQuery has never supported or tested Quirks Mode
81
	migrateWarn( "jQuery is not compatible with Quirks Mode" );
82
}
83
84
85
var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
86
	oldAttr = jQuery.attr,
87
	valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
88
		function() { return null; },
89
	valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
90
		function() { return undefined; },
91
	rnoType = /^(?:input|button)$/i,
92
	rnoAttrNodeType = /^[238]$/,
93
	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
94
	ruseDefault = /^(?:checked|selected)$/i;
95
96
// jQuery.attrFn
97
migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
98
99
jQuery.attr = function( elem, name, value, pass ) {
100
	var lowerName = name.toLowerCase(),
101
		nType = elem && elem.nodeType;
102
103
	if ( pass ) {
104
		// Since pass is used internally, we only warn for new jQuery
105
		// versions where there isn't a pass arg in the formal params
106
		if ( oldAttr.length < 4 ) {
107
			migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
108
		}
109
		if ( elem && !rnoAttrNodeType.test( nType ) &&
110
			(attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
111
			return jQuery( elem )[ name ]( value );
112
		}
113
	}
114
115
	// Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
116
	// for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
117
	if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
118
		migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
119
	}
120
121
	// Restore boolHook for boolean property/attribute synchronization
122
	if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
123
		jQuery.attrHooks[ lowerName ] = {
124
			get: function( elem, name ) {
125
				// Align boolean attributes with corresponding properties
126
				// Fall back to attribute presence where some booleans are not supported
127
				var attrNode,
128
					property = jQuery.prop( elem, name );
129
				return property === true || typeof property !== "boolean" &&
130
					( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
131
132
					name.toLowerCase() :
133
					undefined;
134
			},
135
			set: function( elem, value, name ) {
136
				var propName;
137
				if ( value === false ) {
138
					// Remove boolean attributes when set to false
139
					jQuery.removeAttr( elem, name );
140
				} else {
141
					// value is true since we know at this point it's type boolean and not false
142
					// Set boolean attributes to the same name and set the DOM property
143
					propName = jQuery.propFix[ name ] || name;
144
					if ( propName in elem ) {
145
						// Only set the IDL specifically if it already exists on the element
146
						elem[ propName ] = true;
147
					}
148
149
					elem.setAttribute( name, name.toLowerCase() );
150
				}
151
				return name;
152
			}
153
		};
154
155
		// Warn only for attributes that can remain distinct from their properties post-1.9
156
		if ( ruseDefault.test( lowerName ) ) {
157
			migrateWarn( "jQuery.fn.attr('" + lowerName + "') might use property instead of attribute" );
158
		}
159
	}
160
161
	return oldAttr.call( jQuery, elem, name, value );
162
};
163
164
// attrHooks: value
165
jQuery.attrHooks.value = {
166
	get: function( elem, name ) {
167
		var nodeName = ( elem.nodeName || "" ).toLowerCase();
168
		if ( nodeName === "button" ) {
169
			return valueAttrGet.apply( this, arguments );
170
		}
171
		if ( nodeName !== "input" && nodeName !== "option" ) {
172
			migrateWarn("jQuery.fn.attr('value') no longer gets properties");
173
		}
174
		return name in elem ?
175
			elem.value :
176
			null;
177
	},
178
	set: function( elem, value ) {
179
		var nodeName = ( elem.nodeName || "" ).toLowerCase();
180
		if ( nodeName === "button" ) {
181
			return valueAttrSet.apply( this, arguments );
182
		}
183
		if ( nodeName !== "input" && nodeName !== "option" ) {
184
			migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
185
		}
186
		// Does not return so that setAttribute is also used
187
		elem.value = value;
188
	}
189
};
190
191
192
var matched, browser,
193
	oldInit = jQuery.fn.init,
194
	oldParseJSON = jQuery.parseJSON,
195
	rspaceAngle = /^\s*</,
196
	// Note: XSS check is done below after string is trimmed
197
	rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
198
199
// $(html) "looks like html" rule change
200
jQuery.fn.init = function( selector, context, rootjQuery ) {
201
	var match, ret;
202
203
	if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
204
			(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
205
		// This is an HTML string according to the "old" rules; is it still?
206
		if ( !rspaceAngle.test( selector ) ) {
207
			migrateWarn("$(html) HTML strings must start with '<' character");
208
		}
209
		if ( match[ 3 ] ) {
210
			migrateWarn("$(html) HTML text after last tag is ignored");
211
		}
212
213
		// Consistently reject any HTML-like string starting with a hash (#9521)
214
		// Note that this may break jQuery 1.6.x code that otherwise would work.
215
		if ( match[ 0 ].charAt( 0 ) === "#" ) {
216
			migrateWarn("HTML string cannot start with a '#' character");
217
			jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
218
		}
219
		// Now process using loose rules; let pre-1.8 play too
220
		if ( context && context.context ) {
221
			// jQuery object as context; parseHTML expects a DOM object
222
			context = context.context;
223
		}
224
		if ( jQuery.parseHTML ) {
225
			return oldInit.call( this,
226
					jQuery.parseHTML( match[ 2 ], context && context.ownerDocument ||
227
						context || document, true ), context, rootjQuery );
228
		}
229
	}
230
231
	// jQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
232
	if ( selector === "#" ) {
233
		migrateWarn( "jQuery( '#' ) is not a valid selector" );
234
		selector = [];
235
	}
236
237
	ret = oldInit.apply( this, arguments );
238
239
	// Fill in selector and context properties so .live() works
240
	if ( selector && selector.selector !== undefined ) {
241
		// A jQuery object, copy its properties
242
		ret.selector = selector.selector;
243
		ret.context = selector.context;
244
245
	} else {
246
		ret.selector = typeof selector === "string" ? selector : "";
247
		if ( selector ) {
248
			ret.context = selector.nodeType? selector : context || document;
249
		}
250
	}
251
252
	return ret;
253
};
254
jQuery.fn.init.prototype = jQuery.fn;
255
256
// Let $.parseJSON(falsy_value) return null
257
jQuery.parseJSON = function( json ) {
258
	if ( !json ) {
259
		migrateWarn("jQuery.parseJSON requires a valid JSON string");
260
		return null;
261
	}
262
	return oldParseJSON.apply( this, arguments );
263
};
264
265
jQuery.uaMatch = function( ua ) {
266
	ua = ua.toLowerCase();
267
268
	var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
269
		/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
270
		/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
271
		/(msie) ([\w.]+)/.exec( ua ) ||
272
		ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
273
		[];
274
275
	return {
276
		browser: match[ 1 ] || "",
277
		version: match[ 2 ] || "0"
278
	};
279
};
280
281
// Don't clobber any existing jQuery.browser in case it's different
282
if ( !jQuery.browser ) {
283
	matched = jQuery.uaMatch( navigator.userAgent );
284
	browser = {};
285
286
	if ( matched.browser ) {
287
		browser[ matched.browser ] = true;
288
		browser.version = matched.version;
289
	}
290
291
	// Chrome is Webkit, but Webkit is also Safari.
292
	if ( browser.chrome ) {
293
		browser.webkit = true;
294
	} else if ( browser.webkit ) {
295
		browser.safari = true;
296
	}
297
298
	jQuery.browser = browser;
299
}
300
301
// Warn if the code tries to get jQuery.browser
302
migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
303
304
// jQuery.boxModel deprecated in 1.3, jQuery.support.boxModel deprecated in 1.7
305
jQuery.boxModel = jQuery.support.boxModel = (document.compatMode === "CSS1Compat");
306
migrateWarnProp( jQuery, "boxModel", jQuery.boxModel, "jQuery.boxModel is deprecated" );
307
migrateWarnProp( jQuery.support, "boxModel", jQuery.support.boxModel, "jQuery.support.boxModel is deprecated" );
308
309
jQuery.sub = function() {
310
	function jQuerySub( selector, context ) {
311
		return new jQuerySub.fn.init( selector, context );
312
	}
313
	jQuery.extend( true, jQuerySub, this );
314
	jQuerySub.superclass = this;
315
	jQuerySub.fn = jQuerySub.prototype = this();
316
	jQuerySub.fn.constructor = jQuerySub;
317
	jQuerySub.sub = this.sub;
318
	jQuerySub.fn.init = function init( selector, context ) {
319
		var instance = jQuery.fn.init.call( this, selector, context, rootjQuerySub );
320
		return instance instanceof jQuerySub ?
321
			instance :
322
			jQuerySub( instance );
323
	};
324
	jQuerySub.fn.init.prototype = jQuerySub.fn;
325
	var rootjQuerySub = jQuerySub(document);
326
	migrateWarn( "jQuery.sub() is deprecated" );
327
	return jQuerySub;
328
};
329
330
// The number of elements contained in the matched element set
331
jQuery.fn.size = function() {
332
	migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" );
333
	return this.length;
334
};
335
336
337
var internalSwapCall = false;
338
339
// If this version of jQuery has .swap(), don't false-alarm on internal uses
340
if ( jQuery.swap ) {
341
	jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
342
		var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;
343
344
		if ( oldHook ) {
345
			jQuery.cssHooks[ name ].get = function() {
346
				var ret;
347
348
				internalSwapCall = true;
349
				ret = oldHook.apply( this, arguments );
350
				internalSwapCall = false;
351
				return ret;
352
			};
353
		}
354
	});
355
}
356
357
jQuery.swap = function( elem, options, callback, args ) {
358
	var ret, name,
359
		old = {};
360
361
	if ( !internalSwapCall ) {
362
		migrateWarn( "jQuery.swap() is undocumented and deprecated" );
363
	}
364
365
	// Remember the old values, and insert the new ones
366
	for ( name in options ) {
367
		old[ name ] = elem.style[ name ];
368
		elem.style[ name ] = options[ name ];
369
	}
370
371
	ret = callback.apply( elem, args || [] );
372
373
	// Revert the old values
374
	for ( name in options ) {
375
		elem.style[ name ] = old[ name ];
376
	}
377
378
	return ret;
379
};
380
381
382
// Ensure that $.ajax gets the new parseJSON defined in core.js
383
jQuery.ajaxSetup({
384
	converters: {
385
		"text json": jQuery.parseJSON
386
	}
387
});
388
389
390
var oldFnData = jQuery.fn.data;
391
392
jQuery.fn.data = function( name ) {
393
	var ret, evt,
394
		elem = this[0];
395
396
	// Handles 1.7 which has this behavior and 1.8 which doesn't
397
	if ( elem && name === "events" && arguments.length === 1 ) {
398
		ret = jQuery.data( elem, name );
399
		evt = jQuery._data( elem, name );
400
		if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
401
			migrateWarn("Use of jQuery.fn.data('events') is deprecated");
402
			return evt;
403
		}
404
	}
405
	return oldFnData.apply( this, arguments );
406
};
407
408
409
var rscriptType = /\/(java|ecma)script/i;
410
411
// Since jQuery.clean is used internally on older versions, we only shim if it's missing
412
if ( !jQuery.clean ) {
413
	jQuery.clean = function( elems, context, fragment, scripts ) {
414
		// Set context per 1.8 logic
415
		context = context || document;
416
		context = !context.nodeType && context[0] || context;
417
		context = context.ownerDocument || context;
418
419
		migrateWarn("jQuery.clean() is deprecated");
420
421
		var i, elem, handleScript, jsTags,
422
			ret = [];
423
424
		jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );
425
426
		// Complex logic lifted directly from jQuery 1.8
427
		if ( fragment ) {
428
			// Special handling of each script element
429
			handleScript = function( elem ) {
430
				// Check if we consider it executable
431
				if ( !elem.type || rscriptType.test( elem.type ) ) {
432
					// Detach the script and store it in the scripts array (if provided) or the fragment
433
					// Return truthy to indicate that it has been handled
434
					return scripts ?
435
						scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
436
						fragment.appendChild( elem );
437
				}
438
			};
439
440
			for ( i = 0; (elem = ret[i]) != null; i++ ) {
441
				// Check if we're done after handling an executable script
442
				if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
443
					// Append to fragment and handle embedded scripts
444
					fragment.appendChild( elem );
445
					if ( typeof elem.getElementsByTagName !== "undefined" ) {
446
						// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
447
						jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
448
449
						// Splice the scripts into ret after their former ancestor and advance our index beyond them
450
						ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
451
						i += jsTags.length;
452
					}
453
				}
454
			}
455
		}
456
457
		return ret;
458
	};
459
}
460
461
var eventAdd = jQuery.event.add,
462
	eventRemove = jQuery.event.remove,
463
	eventTrigger = jQuery.event.trigger,
464
	oldToggle = jQuery.fn.toggle,
465
	oldLive = jQuery.fn.live,
466
	oldDie = jQuery.fn.die,
467
	oldLoad = jQuery.fn.load,
468
	ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
469
	rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
470
	rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
471
	hoverHack = function( events ) {
472
		if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
473
			return events;
474
		}
475
		if ( rhoverHack.test( events ) ) {
476
			migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
477
		}
478
		return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
479
	};
480
481
// Event props removed in 1.9, put them back if needed; no practical way to warn them
482
if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
483
	jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );
484
}
485
486
// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
487
if ( jQuery.event.dispatch ) {
488
	migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
489
}
490
491
// Support for 'hover' pseudo-event and ajax event warnings
492
jQuery.event.add = function( elem, types, handler, data, selector ){
493
	if ( elem !== document && rajaxEvent.test( types ) ) {
494
		migrateWarn( "AJAX events should be attached to document: " + types );
495
	}
496
	eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );
497
};
498
jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
499
	eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
500
};
501
502
jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
503
504
	jQuery.fn[ name ] = function() {
505
		var args = Array.prototype.slice.call( arguments, 0 );
506
		migrateWarn( "jQuery.fn." + name + "() is deprecated" );
507
508
		// If this is an ajax load() the first arg should be the string URL;
509
		// technically this could also be the "Anything" arg of the event .load()
510
		// which just goes to show why this dumb signature has been deprecated!
511
		// jQuery custom builds that exclude the Ajax module justifiably die here.
512
		if ( name === "load" && typeof arguments[ 0 ] === "string" ) {
513
			return oldLoad.apply( this, arguments );
514
		}
515
516
		args.splice( 0, 0, name );
517
		if ( arguments.length ) {
518
			return this.bind.apply( this, args );
519
		}
520
521
		// Use .triggerHandler here because:
522
		// - load and unload events don't need to bubble, only applied to window or image
523
		// - error event should not bubble to window, although it does pre-1.7
524
		// See http://bugs.jquery.com/ticket/11820
525
		this.triggerHandler.apply( this, args );
526
		return this;
527
	};
528
529
});
530
531
jQuery.fn.toggle = function( fn, fn2 ) {
532
533
	// Don't mess with animation or css toggles
534
	if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
535
		return oldToggle.apply( this, arguments );
536
	}
537
	migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
538
539
	// Save reference to arguments for access in closure
540
	var args = arguments,
541
		guid = fn.guid || jQuery.guid++,
542
		i = 0,
543
		toggler = function( event ) {
544
			// Figure out which function to execute
545
			var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
546
			jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
547
548
			// Make sure that clicks stop
549
			event.preventDefault();
550
551
			// and execute the function
552
			return args[ lastToggle ].apply( this, arguments ) || false;
553
		};
554
555
	// link all the functions, so any of them can unbind this click handler
556
	toggler.guid = guid;
557
	while ( i < args.length ) {
558
		args[ i++ ].guid = guid;
559
	}
560
561
	return this.click( toggler );
562
};
563
564
jQuery.fn.live = function( types, data, fn ) {
565
	migrateWarn("jQuery.fn.live() is deprecated");
566
	if ( oldLive ) {
567
		return oldLive.apply( this, arguments );
568
	}
569
	jQuery( this.context ).on( types, this.selector, data, fn );
570
	return this;
571
};
572
573
jQuery.fn.die = function( types, fn ) {
574
	migrateWarn("jQuery.fn.die() is deprecated");
575
	if ( oldDie ) {
576
		return oldDie.apply( this, arguments );
577
	}
578
	jQuery( this.context ).off( types, this.selector || "**", fn );
579
	return this;
580
};
581
582
// Turn global events into document-triggered events
583
jQuery.event.trigger = function( event, data, elem, onlyHandlers  ){
584
	if ( !elem && !rajaxEvent.test( event ) ) {
585
		migrateWarn( "Global events are undocumented and deprecated" );
586
	}
587
	return eventTrigger.call( this,  event, data, elem || document, onlyHandlers  );
588
};
589
jQuery.each( ajaxEvents.split("|"),
590
	function( _, name ) {
591
		jQuery.event.special[ name ] = {
592
			setup: function() {
593
				var elem = this;
594
595
				// The document needs no shimming; must be !== for oldIE
596
				if ( elem !== document ) {
597
					jQuery.event.add( document, name + "." + jQuery.guid, function() {
598
						jQuery.event.trigger( name, Array.prototype.slice.call( arguments, 1 ), elem, true );
599
					});
600
					jQuery._data( this, name, jQuery.guid++ );
601
				}
602
				return false;
603
			},
604
			teardown: function() {
605
				if ( this !== document ) {
606
					jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
607
				}
608
				return false;
609
			}
610
		};
611
	}
612
);
613
614
jQuery.event.special.ready = {
615
	setup: function() { migrateWarn( "'ready' event is deprecated" ); }
616
};
617
618
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
619
	oldFind = jQuery.fn.find;
620
621
jQuery.fn.andSelf = function() {
622
	migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
623
	return oldSelf.apply( this, arguments );
624
};
625
626
jQuery.fn.find = function( selector ) {
627
	var ret = oldFind.apply( this, arguments );
628
	ret.context = this.context;
629
	ret.selector = this.selector ? this.selector + " " + selector : selector;
630
	return ret;
631
};
632
633
634
// jQuery 1.6 did not support Callbacks, do not warn there
635
if ( jQuery.Callbacks ) {
636
637
	var oldDeferred = jQuery.Deferred,
638
		tuples = [
639
			// action, add listener, callbacks, .then handlers, final state
640
			[ "resolve", "done", jQuery.Callbacks("once memory"),
641
				jQuery.Callbacks("once memory"), "resolved" ],
642
			[ "reject", "fail", jQuery.Callbacks("once memory"),
643
				jQuery.Callbacks("once memory"), "rejected" ],
644
			[ "notify", "progress", jQuery.Callbacks("memory"),
645
				jQuery.Callbacks("memory") ]
646
		];
647
648
	jQuery.Deferred = function( func ) {
649
		var deferred = oldDeferred(),
650
			promise = deferred.promise();
651
652
		deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
653
			var fns = arguments;
654
655
			migrateWarn( "deferred.pipe() is deprecated" );
656
657
			return jQuery.Deferred(function( newDefer ) {
658
				jQuery.each( tuples, function( i, tuple ) {
659
					var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
660
					// deferred.done(function() { bind to newDefer or newDefer.resolve })
661
					// deferred.fail(function() { bind to newDefer or newDefer.reject })
662
					// deferred.progress(function() { bind to newDefer or newDefer.notify })
663
					deferred[ tuple[1] ](function() {
664
						var returned = fn && fn.apply( this, arguments );
665
						if ( returned && jQuery.isFunction( returned.promise ) ) {
666
							returned.promise()
667
								.done( newDefer.resolve )
668
								.fail( newDefer.reject )
669
								.progress( newDefer.notify );
670
						} else {
671
							newDefer[ tuple[ 0 ] + "With" ](
672
								this === promise ? newDefer.promise() : this,
673
								fn ? [ returned ] : arguments
674
							);
675
						}
676
					});
677
				});
678
				fns = null;
679
			}).promise();
680
681
		};
682
683
		deferred.isResolved = function() {
684
			migrateWarn( "deferred.isResolved is deprecated" );
685
			return deferred.state() === "resolved";
686
		};
687
688
		deferred.isRejected = function() {
689
			migrateWarn( "deferred.isRejected is deprecated" );
690
			return deferred.state() === "rejected";
691
		};
692
693
		if ( func ) {
694
			func.call( deferred, deferred );
695
		}
696
697
		return deferred;
698
	};
699
700
}
701
702
})( jQuery, window );
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-migrate-1.3.0.min.js (+2 lines)
Line 0 Link Here
1
/*! jQuery Migrate v1.3.0 | (c) jQuery Foundation and other contributors | jquery.org/license */
2
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(a,b,c){function d(c){var d=b.console;f[c]||(f[c]=!0,a.migrateWarnings.push(c),d&&d.warn&&!a.migrateMute&&(d.warn("JQMIGRATE: "+c),a.migrateTrace&&d.trace&&d.trace()))}function e(b,c,e,f){if(Object.defineProperty)try{return void Object.defineProperty(b,c,{configurable:!0,enumerable:!0,get:function(){return d(f),e},set:function(a){d(f),e=a}})}catch(g){}a._definePropertyBroken=!0,b[c]=e}a.migrateVersion="1.3.0";var f={};a.migrateWarnings=[],!a.migrateMute&&b.console&&b.console.log&&b.console.log("JQMIGRATE: Logging is active"),a.migrateTrace===c&&(a.migrateTrace=!0),a.migrateReset=function(){f={},a.migrateWarnings.length=0},"BackCompat"===document.compatMode&&d("jQuery is not compatible with Quirks Mode");var g=a("<input/>",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr( props, pass ) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.parseJSON,s=/^\s*</,t=/^([^<]*)(<[\w\W]+>)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=t.exec(a.trim(b)))&&g[0]&&(s.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):("#"===b&&(d("jQuery( '#' ) is not a valid selector"),b=[]),h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.parseJSON=function(a){return a?r.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var u=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return u=!0,a=d.apply(this,arguments),u=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};u||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var v=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?v.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var w=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||w.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var x=a.event.add,y=a.event.remove,z=a.event.trigger,A=a.fn.toggle,B=a.fn.live,C=a.fn.die,D=a.fn.load,E="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",F=new RegExp("\\b(?:"+E+")\\b"),G=/(?:^|\s)hover(\.\S+|)\b/,H=function(b){return"string"!=typeof b||a.event.special.hover?b:(G.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(G,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&F.test(b)&&d("AJAX events should be attached to document: "+b),x.call(this,a,H(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){y.call(this,a,H(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return d("jQuery.fn."+c+"() is deprecated"),"load"===c&&"string"==typeof arguments[0]?D.apply(this,arguments):(a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return A.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;g<e.length;)e[g++].guid=f;return this.click(h)},a.fn.live=function(b,c,e){return d("jQuery.fn.live() is deprecated"),B?B.apply(this,arguments):(a(this.context).on(b,this.selector,c,e),this)},a.fn.die=function(b,c){return d("jQuery.fn.die() is deprecated"),C?C.apply(this,arguments):(a(this.context).off(b,this.selector||"**",c),this)},a.event.trigger=function(a,b,c,e){return c||F.test(a)||d("Global events are undocumented and deprecated"),z.call(this,a,b,c||document,e)},a.each(E.split("|"),function(b,c){a.event.special[c]={setup:function(){var b=this;return b!==document&&(a.event.add(document,c+"."+a.guid,function(){a.event.trigger(c,Array.prototype.slice.call(arguments,1),b,!0)}),a._data(this,c,a.guid++)),!1},teardown:function(){return this!==document&&a.event.remove(document,c+"."+a._data(this,c)),!1}}}),a.event.special.ready={setup:function(){d("'ready' event is deprecated")}};var I=a.fn.andSelf||a.fn.addBack,J=a.fn.find;if(a.fn.andSelf=function(){return d("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),I.apply(this,arguments)},a.fn.find=function(a){var b=J.apply(this,arguments);return b.context=this.context,b.selector=this.selector?this.selector+" "+a:a,b},a.Callbacks){var K=a.Deferred,L=[["resolve","done",a.Callbacks("once memory"),a.Callbacks("once memory"),"resolved"],["reject","fail",a.Callbacks("once memory"),a.Callbacks("once memory"),"rejected"],["notify","progress",a.Callbacks("memory"),a.Callbacks("memory")]];a.Deferred=function(b){var c=K(),e=c.promise();return c.pipe=e.pipe=function(){var b=arguments;return d("deferred.pipe() is deprecated"),a.Deferred(function(d){a.each(L,function(f,g){var h=a.isFunction(b[f])&&b[f];c[g[1]](function(){var b=h&&h.apply(this,arguments);b&&a.isFunction(b.promise)?b.promise().done(d.resolve).fail(d.reject).progress(d.notify):d[g[0]+"With"](this===e?d.promise():this,h?[b]:arguments)})}),b=null}).promise()},c.isResolved=function(){return d("deferred.isResolved is deprecated"),"resolved"===c.state()},c.isRejected=function(){return d("deferred.isRejected is deprecated"),"rejected"===c.state()},b&&b.call(c,c),c}}}(jQuery,window);
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-ui-1.11.4.css (+971 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.11.4 - 2016-02-22
2
* http://jqueryui.com
3
* Includes: core.css, draggable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, menu.css, progressbar.css, slider.css, tabs.css, theme.css
4
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
* Copyright jQuery Foundation and other contributors; Licensed MIT */
6
7
/* Layout helpers
8
----------------------------------*/
9
.ui-helper-hidden {
10
	display: none;
11
}
12
.ui-helper-hidden-accessible {
13
	border: 0;
14
	clip: rect(0 0 0 0);
15
	height: 1px;
16
	margin: -1px;
17
	overflow: hidden;
18
	padding: 0;
19
	position: absolute;
20
	width: 1px;
21
}
22
.ui-helper-reset {
23
	margin: 0;
24
	padding: 0;
25
	border: 0;
26
	outline: 0;
27
	line-height: 1.3;
28
	text-decoration: none;
29
	font-size: 100%;
30
	list-style: none;
31
}
32
.ui-helper-clearfix:before,
33
.ui-helper-clearfix:after {
34
	content: "";
35
	display: table;
36
	border-collapse: collapse;
37
}
38
.ui-helper-clearfix:after {
39
	clear: both;
40
}
41
.ui-helper-clearfix {
42
	min-height: 0; /* support: IE7 */
43
}
44
.ui-helper-zfix {
45
	width: 100%;
46
	height: 100%;
47
	top: 0;
48
	left: 0;
49
	position: absolute;
50
	opacity: 0;
51
	filter:Alpha(Opacity=0); /* support: IE8 */
52
}
53
54
.ui-front {
55
	z-index: 100;
56
}
57
58
59
/* Interaction Cues
60
----------------------------------*/
61
.ui-state-disabled {
62
	cursor: default !important;
63
}
64
65
66
/* Icons
67
----------------------------------*/
68
69
/* states and images */
70
.ui-icon {
71
	display: block;
72
	text-indent: -99999px;
73
	overflow: hidden;
74
	background-repeat: no-repeat;
75
}
76
77
78
/* Misc visuals
79
----------------------------------*/
80
81
/* Overlays */
82
.ui-widget-overlay {
83
	position: fixed;
84
	top: 0;
85
	left: 0;
86
	width: 100%;
87
	height: 100%;
88
}
89
.ui-draggable-handle {
90
	-ms-touch-action: none;
91
	touch-action: none;
92
}
93
.ui-sortable-handle {
94
	-ms-touch-action: none;
95
	touch-action: none;
96
}
97
.ui-accordion .ui-accordion-header {
98
	display: block;
99
	cursor: pointer;
100
	position: relative;
101
	margin: 2px 0 0 0;
102
	padding: .5em .5em .5em .7em;
103
	min-height: 0; /* support: IE7 */
104
	font-size: 100%;
105
}
106
.ui-accordion .ui-accordion-icons {
107
	padding-left: 2.2em;
108
}
109
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
110
	padding-left: 2.2em;
111
}
112
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
113
	position: absolute;
114
	left: .5em;
115
	top: 50%;
116
	margin-top: -8px;
117
}
118
.ui-accordion .ui-accordion-content {
119
	padding: 1em 2.2em;
120
	border-top: 0;
121
	overflow: auto;
122
}
123
.ui-autocomplete {
124
	position: absolute;
125
	top: 0;
126
	left: 0;
127
	cursor: default;
128
}
129
.ui-button {
130
	display: inline-block;
131
	position: relative;
132
	padding: 0;
133
	line-height: normal;
134
	margin-right: .1em;
135
	cursor: pointer;
136
	vertical-align: middle;
137
	text-align: center;
138
	overflow: visible; /* removes extra width in IE */
139
}
140
.ui-button,
141
.ui-button:link,
142
.ui-button:visited,
143
.ui-button:hover,
144
.ui-button:active {
145
	text-decoration: none;
146
}
147
/* to make room for the icon, a width needs to be set here */
148
.ui-button-icon-only {
149
	width: 2.2em;
150
}
151
/* button elements seem to need a little more width */
152
button.ui-button-icon-only {
153
	width: 2.4em;
154
}
155
.ui-button-icons-only {
156
	width: 3.4em;
157
}
158
button.ui-button-icons-only {
159
	width: 3.7em;
160
}
161
162
/* button text element */
163
.ui-button .ui-button-text {
164
	display: block;
165
	line-height: normal;
166
}
167
.ui-button-text-only .ui-button-text {
168
	padding: .4em 1em;
169
}
170
.ui-button-icon-only .ui-button-text,
171
.ui-button-icons-only .ui-button-text {
172
	padding: .4em;
173
	text-indent: -9999999px;
174
}
175
.ui-button-text-icon-primary .ui-button-text,
176
.ui-button-text-icons .ui-button-text {
177
	padding: .4em 1em .4em 2.1em;
178
}
179
.ui-button-text-icon-secondary .ui-button-text,
180
.ui-button-text-icons .ui-button-text {
181
	padding: .4em 2.1em .4em 1em;
182
}
183
.ui-button-text-icons .ui-button-text {
184
	padding-left: 2.1em;
185
	padding-right: 2.1em;
186
}
187
/* no icon support for input elements, provide padding by default */
188
input.ui-button {
189
	padding: .4em 1em;
190
}
191
192
/* button icon element(s) */
193
.ui-button-icon-only .ui-icon,
194
.ui-button-text-icon-primary .ui-icon,
195
.ui-button-text-icon-secondary .ui-icon,
196
.ui-button-text-icons .ui-icon,
197
.ui-button-icons-only .ui-icon {
198
	position: absolute;
199
	top: 50%;
200
	margin-top: -8px;
201
}
202
.ui-button-icon-only .ui-icon {
203
	left: 50%;
204
	margin-left: -8px;
205
}
206
.ui-button-text-icon-primary .ui-button-icon-primary,
207
.ui-button-text-icons .ui-button-icon-primary,
208
.ui-button-icons-only .ui-button-icon-primary {
209
	left: .5em;
210
}
211
.ui-button-text-icon-secondary .ui-button-icon-secondary,
212
.ui-button-text-icons .ui-button-icon-secondary,
213
.ui-button-icons-only .ui-button-icon-secondary {
214
	right: .5em;
215
}
216
217
/* button sets */
218
.ui-buttonset {
219
	margin-right: 7px;
220
}
221
.ui-buttonset .ui-button {
222
	margin-left: 0;
223
	margin-right: -.3em;
224
}
225
226
/* workarounds */
227
/* reset extra padding in Firefox, see h5bp.com/l */
228
input.ui-button::-moz-focus-inner,
229
button.ui-button::-moz-focus-inner {
230
	border: 0;
231
	padding: 0;
232
}
233
.ui-datepicker {
234
	width: 17em;
235
	padding: .2em .2em 0;
236
	display: none;
237
}
238
.ui-datepicker .ui-datepicker-header {
239
	position: relative;
240
	padding: .2em 0;
241
}
242
.ui-datepicker .ui-datepicker-prev,
243
.ui-datepicker .ui-datepicker-next {
244
	position: absolute;
245
	top: 2px;
246
	width: 1.8em;
247
	height: 1.8em;
248
}
249
.ui-datepicker .ui-datepicker-prev-hover,
250
.ui-datepicker .ui-datepicker-next-hover {
251
	top: 1px;
252
}
253
.ui-datepicker .ui-datepicker-prev {
254
	left: 2px;
255
}
256
.ui-datepicker .ui-datepicker-next {
257
	right: 2px;
258
}
259
.ui-datepicker .ui-datepicker-prev-hover {
260
	left: 1px;
261
}
262
.ui-datepicker .ui-datepicker-next-hover {
263
	right: 1px;
264
}
265
.ui-datepicker .ui-datepicker-prev span,
266
.ui-datepicker .ui-datepicker-next span {
267
	display: block;
268
	position: absolute;
269
	left: 50%;
270
	margin-left: -8px;
271
	top: 50%;
272
	margin-top: -8px;
273
}
274
.ui-datepicker .ui-datepicker-title {
275
	margin: 0 2.3em;
276
	line-height: 1.8em;
277
	text-align: center;
278
}
279
.ui-datepicker .ui-datepicker-title select {
280
	font-size: 1em;
281
	margin: 1px 0;
282
}
283
.ui-datepicker select.ui-datepicker-month,
284
.ui-datepicker select.ui-datepicker-year {
285
	width: 45%;
286
}
287
.ui-datepicker table {
288
	width: 100%;
289
	font-size: .9em;
290
	border-collapse: collapse;
291
	margin: 0 0 .4em;
292
}
293
.ui-datepicker th {
294
	padding: .7em .3em;
295
	text-align: center;
296
	font-weight: bold;
297
	border: 0;
298
}
299
.ui-datepicker td {
300
	border: 0;
301
	padding: 1px;
302
}
303
.ui-datepicker td span,
304
.ui-datepicker td a {
305
	display: block;
306
	padding: .2em;
307
	text-align: right;
308
	text-decoration: none;
309
}
310
.ui-datepicker .ui-datepicker-buttonpane {
311
	background-image: none;
312
	margin: .7em 0 0 0;
313
	padding: 0 .2em;
314
	border-left: 0;
315
	border-right: 0;
316
	border-bottom: 0;
317
}
318
.ui-datepicker .ui-datepicker-buttonpane button {
319
	float: right;
320
	margin: .5em .2em .4em;
321
	cursor: pointer;
322
	padding: .2em .6em .3em .6em;
323
	width: auto;
324
	overflow: visible;
325
}
326
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
327
	float: left;
328
}
329
330
/* with multiple calendars */
331
.ui-datepicker.ui-datepicker-multi {
332
	width: auto;
333
}
334
.ui-datepicker-multi .ui-datepicker-group {
335
	float: left;
336
}
337
.ui-datepicker-multi .ui-datepicker-group table {
338
	width: 95%;
339
	margin: 0 auto .4em;
340
}
341
.ui-datepicker-multi-2 .ui-datepicker-group {
342
	width: 50%;
343
}
344
.ui-datepicker-multi-3 .ui-datepicker-group {
345
	width: 33.3%;
346
}
347
.ui-datepicker-multi-4 .ui-datepicker-group {
348
	width: 25%;
349
}
350
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
351
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
352
	border-left-width: 0;
353
}
354
.ui-datepicker-multi .ui-datepicker-buttonpane {
355
	clear: left;
356
}
357
.ui-datepicker-row-break {
358
	clear: both;
359
	width: 100%;
360
	font-size: 0;
361
}
362
363
/* RTL support */
364
.ui-datepicker-rtl {
365
	direction: rtl;
366
}
367
.ui-datepicker-rtl .ui-datepicker-prev {
368
	right: 2px;
369
	left: auto;
370
}
371
.ui-datepicker-rtl .ui-datepicker-next {
372
	left: 2px;
373
	right: auto;
374
}
375
.ui-datepicker-rtl .ui-datepicker-prev:hover {
376
	right: 1px;
377
	left: auto;
378
}
379
.ui-datepicker-rtl .ui-datepicker-next:hover {
380
	left: 1px;
381
	right: auto;
382
}
383
.ui-datepicker-rtl .ui-datepicker-buttonpane {
384
	clear: right;
385
}
386
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
387
	float: left;
388
}
389
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
390
.ui-datepicker-rtl .ui-datepicker-group {
391
	float: right;
392
}
393
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
394
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
395
	border-right-width: 0;
396
	border-left-width: 1px;
397
}
398
.ui-menu {
399
	list-style: none;
400
	padding: 0;
401
	margin: 0;
402
	display: block;
403
	outline: none;
404
}
405
.ui-menu .ui-menu {
406
	position: absolute;
407
}
408
.ui-menu .ui-menu-item {
409
	position: relative;
410
	margin: 0;
411
	padding: 3px 1em 3px .4em;
412
	cursor: pointer;
413
	min-height: 0; /* support: IE7 */
414
	/* support: IE10, see #8844 */
415
	list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
416
}
417
.ui-menu .ui-menu-divider {
418
	margin: 5px 0;
419
	height: 0;
420
	font-size: 0;
421
	line-height: 0;
422
	border-width: 1px 0 0 0;
423
}
424
.ui-menu .ui-state-focus,
425
.ui-menu .ui-state-active {
426
	margin: -1px;
427
}
428
429
/* icon support */
430
.ui-menu-icons {
431
	position: relative;
432
}
433
.ui-menu-icons .ui-menu-item {
434
	padding-left: 2em;
435
}
436
437
/* left-aligned */
438
.ui-menu .ui-icon {
439
	position: absolute;
440
	top: 0;
441
	bottom: 0;
442
	left: .2em;
443
	margin: auto 0;
444
}
445
446
/* right-aligned */
447
.ui-menu .ui-menu-icon {
448
	left: auto;
449
	right: 0;
450
}
451
.ui-progressbar {
452
	height: 2em;
453
	text-align: left;
454
	overflow: hidden;
455
}
456
.ui-progressbar .ui-progressbar-value {
457
	margin: -1px;
458
	height: 100%;
459
}
460
.ui-progressbar .ui-progressbar-overlay {
461
	background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
462
	height: 100%;
463
	filter: alpha(opacity=25); /* support: IE8 */
464
	opacity: 0.25;
465
}
466
.ui-progressbar-indeterminate .ui-progressbar-value {
467
	background-image: none;
468
}
469
.ui-slider {
470
	position: relative;
471
	text-align: left;
472
}
473
.ui-slider .ui-slider-handle {
474
	position: absolute;
475
	z-index: 2;
476
	width: 1.2em;
477
	height: 1.2em;
478
	cursor: default;
479
	-ms-touch-action: none;
480
	touch-action: none;
481
}
482
.ui-slider .ui-slider-range {
483
	position: absolute;
484
	z-index: 1;
485
	font-size: .7em;
486
	display: block;
487
	border: 0;
488
	background-position: 0 0;
489
}
490
491
/* support: IE8 - See #6727 */
492
.ui-slider.ui-state-disabled .ui-slider-handle,
493
.ui-slider.ui-state-disabled .ui-slider-range {
494
	filter: inherit;
495
}
496
497
.ui-slider-horizontal {
498
	height: .8em;
499
}
500
.ui-slider-horizontal .ui-slider-handle {
501
	top: -.3em;
502
	margin-left: -.6em;
503
}
504
.ui-slider-horizontal .ui-slider-range {
505
	top: 0;
506
	height: 100%;
507
}
508
.ui-slider-horizontal .ui-slider-range-min {
509
	left: 0;
510
}
511
.ui-slider-horizontal .ui-slider-range-max {
512
	right: 0;
513
}
514
515
.ui-slider-vertical {
516
	width: .8em;
517
	height: 100px;
518
}
519
.ui-slider-vertical .ui-slider-handle {
520
	left: -.3em;
521
	margin-left: 0;
522
	margin-bottom: -.6em;
523
}
524
.ui-slider-vertical .ui-slider-range {
525
	left: 0;
526
	width: 100%;
527
}
528
.ui-slider-vertical .ui-slider-range-min {
529
	bottom: 0;
530
}
531
.ui-slider-vertical .ui-slider-range-max {
532
	top: 0;
533
}
534
.ui-tabs {
535
	position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
536
	padding: .2em;
537
}
538
.ui-tabs .ui-tabs-nav {
539
	margin: 0;
540
	padding: .2em .2em 0;
541
}
542
.ui-tabs .ui-tabs-nav li {
543
	list-style: none;
544
	float: left;
545
	position: relative;
546
	top: 0;
547
	margin: 1px .2em 0 0;
548
	border-bottom-width: 0;
549
	padding: 0;
550
	white-space: nowrap;
551
}
552
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
553
	float: left;
554
	padding: .5em 1em;
555
	text-decoration: none;
556
}
557
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
558
	margin-bottom: -1px;
559
	padding-bottom: 1px;
560
}
561
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
562
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
563
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
564
	cursor: text;
565
}
566
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
567
	cursor: pointer;
568
}
569
.ui-tabs .ui-tabs-panel {
570
	display: block;
571
	border-width: 0;
572
	padding: 1em 1.4em;
573
	background: none;
574
}
575
576
/* Component containers
577
----------------------------------*/
578
.ui-widget {
579
	font-family: Verdana,Arial,sans-serif;
580
	font-size: 1.1em;
581
}
582
.ui-widget .ui-widget {
583
	font-size: 1em;
584
}
585
.ui-widget input,
586
.ui-widget select,
587
.ui-widget textarea,
588
.ui-widget button {
589
	font-family: Verdana,Arial,sans-serif;
590
	font-size: 1em;
591
}
592
.ui-widget-content {
593
	border: 1px solid #aaaaaa;
594
	background: #ffffff;
595
	color: #222222;
596
}
597
.ui-widget-content a {
598
	color: #222222;
599
}
600
.ui-widget-header {
601
	border: 1px solid #aaaaaa;
602
	background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
603
	color: #222222;
604
	font-weight: bold;
605
}
606
.ui-widget-header a {
607
	color: #222222;
608
}
609
610
/* Interaction states
611
----------------------------------*/
612
.ui-state-default,
613
.ui-widget-content .ui-state-default,
614
.ui-widget-header .ui-state-default {
615
	border: 1px solid #d3d3d3;
616
	background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
617
	font-weight: normal;
618
	color: #555555;
619
}
620
.ui-state-default a,
621
.ui-state-default a:link,
622
.ui-state-default a:visited {
623
	color: #555555;
624
	text-decoration: none;
625
}
626
.ui-state-hover,
627
.ui-widget-content .ui-state-hover,
628
.ui-widget-header .ui-state-hover,
629
.ui-state-focus,
630
.ui-widget-content .ui-state-focus,
631
.ui-widget-header .ui-state-focus {
632
	border: 1px solid #999999;
633
	background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
634
	font-weight: normal;
635
	color: #212121;
636
}
637
.ui-state-hover a,
638
.ui-state-hover a:hover,
639
.ui-state-hover a:link,
640
.ui-state-hover a:visited,
641
.ui-state-focus a,
642
.ui-state-focus a:hover,
643
.ui-state-focus a:link,
644
.ui-state-focus a:visited {
645
	color: #212121;
646
	text-decoration: none;
647
}
648
.ui-state-active,
649
.ui-widget-content .ui-state-active,
650
.ui-widget-header .ui-state-active {
651
	border: 1px solid #aaaaaa;
652
	background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
653
	font-weight: normal;
654
	color: #212121;
655
}
656
.ui-state-active a,
657
.ui-state-active a:link,
658
.ui-state-active a:visited {
659
	color: #212121;
660
	text-decoration: none;
661
}
662
663
/* Interaction Cues
664
----------------------------------*/
665
.ui-state-highlight,
666
.ui-widget-content .ui-state-highlight,
667
.ui-widget-header .ui-state-highlight {
668
	border: 1px solid #fcefa1;
669
	background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
670
	color: #363636;
671
}
672
.ui-state-highlight a,
673
.ui-widget-content .ui-state-highlight a,
674
.ui-widget-header .ui-state-highlight a {
675
	color: #363636;
676
}
677
.ui-state-error,
678
.ui-widget-content .ui-state-error,
679
.ui-widget-header .ui-state-error {
680
	border: 1px solid #cd0a0a;
681
	background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
682
	color: #cd0a0a;
683
}
684
.ui-state-error a,
685
.ui-widget-content .ui-state-error a,
686
.ui-widget-header .ui-state-error a {
687
	color: #cd0a0a;
688
}
689
.ui-state-error-text,
690
.ui-widget-content .ui-state-error-text,
691
.ui-widget-header .ui-state-error-text {
692
	color: #cd0a0a;
693
}
694
.ui-priority-primary,
695
.ui-widget-content .ui-priority-primary,
696
.ui-widget-header .ui-priority-primary {
697
	font-weight: bold;
698
}
699
.ui-priority-secondary,
700
.ui-widget-content .ui-priority-secondary,
701
.ui-widget-header .ui-priority-secondary {
702
	opacity: .7;
703
	filter:Alpha(Opacity=70); /* support: IE8 */
704
	font-weight: normal;
705
}
706
.ui-state-disabled,
707
.ui-widget-content .ui-state-disabled,
708
.ui-widget-header .ui-state-disabled {
709
	opacity: .35;
710
	filter:Alpha(Opacity=35); /* support: IE8 */
711
	background-image: none;
712
}
713
.ui-state-disabled .ui-icon {
714
	filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
715
}
716
717
/* Icons
718
----------------------------------*/
719
720
/* states and images */
721
.ui-icon {
722
	width: 16px;
723
	height: 16px;
724
}
725
.ui-icon,
726
.ui-widget-content .ui-icon {
727
	background-image: url("images/ui-icons_222222_256x240.png");
728
}
729
.ui-widget-header .ui-icon {
730
	background-image: url("images/ui-icons_222222_256x240.png");
731
}
732
.ui-state-default .ui-icon {
733
	background-image: url("images/ui-icons_888888_256x240.png");
734
}
735
.ui-state-hover .ui-icon,
736
.ui-state-focus .ui-icon {
737
	background-image: url("images/ui-icons_454545_256x240.png");
738
}
739
.ui-state-active .ui-icon {
740
	background-image: url("images/ui-icons_454545_256x240.png");
741
}
742
.ui-state-highlight .ui-icon {
743
	background-image: url("images/ui-icons_2e83ff_256x240.png");
744
}
745
.ui-state-error .ui-icon,
746
.ui-state-error-text .ui-icon {
747
	background-image: url("images/ui-icons_cd0a0a_256x240.png");
748
}
749
750
/* positioning */
751
.ui-icon-blank { background-position: 16px 16px; }
752
.ui-icon-carat-1-n { background-position: 0 0; }
753
.ui-icon-carat-1-ne { background-position: -16px 0; }
754
.ui-icon-carat-1-e { background-position: -32px 0; }
755
.ui-icon-carat-1-se { background-position: -48px 0; }
756
.ui-icon-carat-1-s { background-position: -64px 0; }
757
.ui-icon-carat-1-sw { background-position: -80px 0; }
758
.ui-icon-carat-1-w { background-position: -96px 0; }
759
.ui-icon-carat-1-nw { background-position: -112px 0; }
760
.ui-icon-carat-2-n-s { background-position: -128px 0; }
761
.ui-icon-carat-2-e-w { background-position: -144px 0; }
762
.ui-icon-triangle-1-n { background-position: 0 -16px; }
763
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
764
.ui-icon-triangle-1-e { background-position: -32px -16px; }
765
.ui-icon-triangle-1-se { background-position: -48px -16px; }
766
.ui-icon-triangle-1-s { background-position: -64px -16px; }
767
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
768
.ui-icon-triangle-1-w { background-position: -96px -16px; }
769
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
770
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
771
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
772
.ui-icon-arrow-1-n { background-position: 0 -32px; }
773
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
774
.ui-icon-arrow-1-e { background-position: -32px -32px; }
775
.ui-icon-arrow-1-se { background-position: -48px -32px; }
776
.ui-icon-arrow-1-s { background-position: -64px -32px; }
777
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
778
.ui-icon-arrow-1-w { background-position: -96px -32px; }
779
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
780
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
781
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
782
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
783
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
784
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
785
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
786
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
787
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
788
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
789
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
790
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
791
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
792
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
793
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
794
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
795
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
796
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
797
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
798
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
799
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
800
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
801
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
802
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
803
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
804
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
805
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
806
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
807
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
808
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
809
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
810
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
811
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
812
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
813
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
814
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
815
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
816
.ui-icon-arrow-4 { background-position: 0 -80px; }
817
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
818
.ui-icon-extlink { background-position: -32px -80px; }
819
.ui-icon-newwin { background-position: -48px -80px; }
820
.ui-icon-refresh { background-position: -64px -80px; }
821
.ui-icon-shuffle { background-position: -80px -80px; }
822
.ui-icon-transfer-e-w { background-position: -96px -80px; }
823
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
824
.ui-icon-folder-collapsed { background-position: 0 -96px; }
825
.ui-icon-folder-open { background-position: -16px -96px; }
826
.ui-icon-document { background-position: -32px -96px; }
827
.ui-icon-document-b { background-position: -48px -96px; }
828
.ui-icon-note { background-position: -64px -96px; }
829
.ui-icon-mail-closed { background-position: -80px -96px; }
830
.ui-icon-mail-open { background-position: -96px -96px; }
831
.ui-icon-suitcase { background-position: -112px -96px; }
832
.ui-icon-comment { background-position: -128px -96px; }
833
.ui-icon-person { background-position: -144px -96px; }
834
.ui-icon-print { background-position: -160px -96px; }
835
.ui-icon-trash { background-position: -176px -96px; }
836
.ui-icon-locked { background-position: -192px -96px; }
837
.ui-icon-unlocked { background-position: -208px -96px; }
838
.ui-icon-bookmark { background-position: -224px -96px; }
839
.ui-icon-tag { background-position: -240px -96px; }
840
.ui-icon-home { background-position: 0 -112px; }
841
.ui-icon-flag { background-position: -16px -112px; }
842
.ui-icon-calendar { background-position: -32px -112px; }
843
.ui-icon-cart { background-position: -48px -112px; }
844
.ui-icon-pencil { background-position: -64px -112px; }
845
.ui-icon-clock { background-position: -80px -112px; }
846
.ui-icon-disk { background-position: -96px -112px; }
847
.ui-icon-calculator { background-position: -112px -112px; }
848
.ui-icon-zoomin { background-position: -128px -112px; }
849
.ui-icon-zoomout { background-position: -144px -112px; }
850
.ui-icon-search { background-position: -160px -112px; }
851
.ui-icon-wrench { background-position: -176px -112px; }
852
.ui-icon-gear { background-position: -192px -112px; }
853
.ui-icon-heart { background-position: -208px -112px; }
854
.ui-icon-star { background-position: -224px -112px; }
855
.ui-icon-link { background-position: -240px -112px; }
856
.ui-icon-cancel { background-position: 0 -128px; }
857
.ui-icon-plus { background-position: -16px -128px; }
858
.ui-icon-plusthick { background-position: -32px -128px; }
859
.ui-icon-minus { background-position: -48px -128px; }
860
.ui-icon-minusthick { background-position: -64px -128px; }
861
.ui-icon-close { background-position: -80px -128px; }
862
.ui-icon-closethick { background-position: -96px -128px; }
863
.ui-icon-key { background-position: -112px -128px; }
864
.ui-icon-lightbulb { background-position: -128px -128px; }
865
.ui-icon-scissors { background-position: -144px -128px; }
866
.ui-icon-clipboard { background-position: -160px -128px; }
867
.ui-icon-copy { background-position: -176px -128px; }
868
.ui-icon-contact { background-position: -192px -128px; }
869
.ui-icon-image { background-position: -208px -128px; }
870
.ui-icon-video { background-position: -224px -128px; }
871
.ui-icon-script { background-position: -240px -128px; }
872
.ui-icon-alert { background-position: 0 -144px; }
873
.ui-icon-info { background-position: -16px -144px; }
874
.ui-icon-notice { background-position: -32px -144px; }
875
.ui-icon-help { background-position: -48px -144px; }
876
.ui-icon-check { background-position: -64px -144px; }
877
.ui-icon-bullet { background-position: -80px -144px; }
878
.ui-icon-radio-on { background-position: -96px -144px; }
879
.ui-icon-radio-off { background-position: -112px -144px; }
880
.ui-icon-pin-w { background-position: -128px -144px; }
881
.ui-icon-pin-s { background-position: -144px -144px; }
882
.ui-icon-play { background-position: 0 -160px; }
883
.ui-icon-pause { background-position: -16px -160px; }
884
.ui-icon-seek-next { background-position: -32px -160px; }
885
.ui-icon-seek-prev { background-position: -48px -160px; }
886
.ui-icon-seek-end { background-position: -64px -160px; }
887
.ui-icon-seek-start { background-position: -80px -160px; }
888
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
889
.ui-icon-seek-first { background-position: -80px -160px; }
890
.ui-icon-stop { background-position: -96px -160px; }
891
.ui-icon-eject { background-position: -112px -160px; }
892
.ui-icon-volume-off { background-position: -128px -160px; }
893
.ui-icon-volume-on { background-position: -144px -160px; }
894
.ui-icon-power { background-position: 0 -176px; }
895
.ui-icon-signal-diag { background-position: -16px -176px; }
896
.ui-icon-signal { background-position: -32px -176px; }
897
.ui-icon-battery-0 { background-position: -48px -176px; }
898
.ui-icon-battery-1 { background-position: -64px -176px; }
899
.ui-icon-battery-2 { background-position: -80px -176px; }
900
.ui-icon-battery-3 { background-position: -96px -176px; }
901
.ui-icon-circle-plus { background-position: 0 -192px; }
902
.ui-icon-circle-minus { background-position: -16px -192px; }
903
.ui-icon-circle-close { background-position: -32px -192px; }
904
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
905
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
906
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
907
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
908
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
909
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
910
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
911
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
912
.ui-icon-circle-zoomin { background-position: -176px -192px; }
913
.ui-icon-circle-zoomout { background-position: -192px -192px; }
914
.ui-icon-circle-check { background-position: -208px -192px; }
915
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
916
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
917
.ui-icon-circlesmall-close { background-position: -32px -208px; }
918
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
919
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
920
.ui-icon-squaresmall-close { background-position: -80px -208px; }
921
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
922
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
923
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
924
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
925
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
926
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
927
928
929
/* Misc visuals
930
----------------------------------*/
931
932
/* Corner radius */
933
.ui-corner-all,
934
.ui-corner-top,
935
.ui-corner-left,
936
.ui-corner-tl {
937
	border-top-left-radius: 4px;
938
}
939
.ui-corner-all,
940
.ui-corner-top,
941
.ui-corner-right,
942
.ui-corner-tr {
943
	border-top-right-radius: 4px;
944
}
945
.ui-corner-all,
946
.ui-corner-bottom,
947
.ui-corner-left,
948
.ui-corner-bl {
949
	border-bottom-left-radius: 4px;
950
}
951
.ui-corner-all,
952
.ui-corner-bottom,
953
.ui-corner-right,
954
.ui-corner-br {
955
	border-bottom-right-radius: 4px;
956
}
957
958
/* Overlays */
959
.ui-widget-overlay {
960
	background: #aaaaaa;
961
	opacity: .3;
962
	filter: Alpha(Opacity=30); /* support: IE8 */
963
}
964
.ui-widget-shadow {
965
	margin: -8px 0 0 -8px;
966
	padding: 8px;
967
	background: #aaaaaa;
968
	opacity: .3;
969
	filter: Alpha(Opacity=30); /* support: IE8 */
970
	border-radius: 8px;
971
}
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-ui-1.11.4.js (+11711 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.11.4 - 2016-02-22
2
* http://jqueryui.com
3
* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, menu.js, progressbar.js, slider.js, tabs.js, effect.js, effect-highlight.js
4
* Copyright jQuery Foundation and other contributors; Licensed MIT */
5
6
(function( factory ) {
7
	if ( typeof define === "function" && define.amd ) {
8
9
		// AMD. Register as an anonymous module.
10
		define([ "jquery" ], factory );
11
	} else {
12
13
		// Browser globals
14
		factory( jQuery );
15
	}
16
}(function( $ ) {
17
/*!
18
 * jQuery UI Core 1.11.4
19
 * http://jqueryui.com
20
 *
21
 * Copyright jQuery Foundation and other contributors
22
 * Released under the MIT license.
23
 * http://jquery.org/license
24
 *
25
 * http://api.jqueryui.com/category/ui-core/
26
 */
27
28
29
// $.ui might exist from components with no dependencies, e.g., $.ui.position
30
$.ui = $.ui || {};
31
32
$.extend( $.ui, {
33
	version: "1.11.4",
34
35
	keyCode: {
36
		BACKSPACE: 8,
37
		COMMA: 188,
38
		DELETE: 46,
39
		DOWN: 40,
40
		END: 35,
41
		ENTER: 13,
42
		ESCAPE: 27,
43
		HOME: 36,
44
		LEFT: 37,
45
		PAGE_DOWN: 34,
46
		PAGE_UP: 33,
47
		PERIOD: 190,
48
		RIGHT: 39,
49
		SPACE: 32,
50
		TAB: 9,
51
		UP: 38
52
	}
53
});
54
55
// plugins
56
$.fn.extend({
57
	scrollParent: function( includeHidden ) {
58
		var position = this.css( "position" ),
59
			excludeStaticParent = position === "absolute",
60
			overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
61
			scrollParent = this.parents().filter( function() {
62
				var parent = $( this );
63
				if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
64
					return false;
65
				}
66
				return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
67
			}).eq( 0 );
68
69
		return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
70
	},
71
72
	uniqueId: (function() {
73
		var uuid = 0;
74
75
		return function() {
76
			return this.each(function() {
77
				if ( !this.id ) {
78
					this.id = "ui-id-" + ( ++uuid );
79
				}
80
			});
81
		};
82
	})(),
83
84
	removeUniqueId: function() {
85
		return this.each(function() {
86
			if ( /^ui-id-\d+$/.test( this.id ) ) {
87
				$( this ).removeAttr( "id" );
88
			}
89
		});
90
	}
91
});
92
93
// selectors
94
function focusable( element, isTabIndexNotNaN ) {
95
	var map, mapName, img,
96
		nodeName = element.nodeName.toLowerCase();
97
	if ( "area" === nodeName ) {
98
		map = element.parentNode;
99
		mapName = map.name;
100
		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
101
			return false;
102
		}
103
		img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
104
		return !!img && visible( img );
105
	}
106
	return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
107
		!element.disabled :
108
		"a" === nodeName ?
109
			element.href || isTabIndexNotNaN :
110
			isTabIndexNotNaN) &&
111
		// the element and all of its ancestors must be visible
112
		visible( element );
113
}
114
115
function visible( element ) {
116
	return $.expr.filters.visible( element ) &&
117
		!$( element ).parents().addBack().filter(function() {
118
			return $.css( this, "visibility" ) === "hidden";
119
		}).length;
120
}
121
122
$.extend( $.expr[ ":" ], {
123
	data: $.expr.createPseudo ?
124
		$.expr.createPseudo(function( dataName ) {
125
			return function( elem ) {
126
				return !!$.data( elem, dataName );
127
			};
128
		}) :
129
		// support: jQuery <1.8
130
		function( elem, i, match ) {
131
			return !!$.data( elem, match[ 3 ] );
132
		},
133
134
	focusable: function( element ) {
135
		return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
136
	},
137
138
	tabbable: function( element ) {
139
		var tabIndex = $.attr( element, "tabindex" ),
140
			isTabIndexNaN = isNaN( tabIndex );
141
		return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
142
	}
143
});
144
145
// support: jQuery <1.8
146
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
147
	$.each( [ "Width", "Height" ], function( i, name ) {
148
		var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
149
			type = name.toLowerCase(),
150
			orig = {
151
				innerWidth: $.fn.innerWidth,
152
				innerHeight: $.fn.innerHeight,
153
				outerWidth: $.fn.outerWidth,
154
				outerHeight: $.fn.outerHeight
155
			};
156
157
		function reduce( elem, size, border, margin ) {
158
			$.each( side, function() {
159
				size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
160
				if ( border ) {
161
					size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
162
				}
163
				if ( margin ) {
164
					size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
165
				}
166
			});
167
			return size;
168
		}
169
170
		$.fn[ "inner" + name ] = function( size ) {
171
			if ( size === undefined ) {
172
				return orig[ "inner" + name ].call( this );
173
			}
174
175
			return this.each(function() {
176
				$( this ).css( type, reduce( this, size ) + "px" );
177
			});
178
		};
179
180
		$.fn[ "outer" + name] = function( size, margin ) {
181
			if ( typeof size !== "number" ) {
182
				return orig[ "outer" + name ].call( this, size );
183
			}
184
185
			return this.each(function() {
186
				$( this).css( type, reduce( this, size, true, margin ) + "px" );
187
			});
188
		};
189
	});
190
}
191
192
// support: jQuery <1.8
193
if ( !$.fn.addBack ) {
194
	$.fn.addBack = function( selector ) {
195
		return this.add( selector == null ?
196
			this.prevObject : this.prevObject.filter( selector )
197
		);
198
	};
199
}
200
201
// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
202
if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
203
	$.fn.removeData = (function( removeData ) {
204
		return function( key ) {
205
			if ( arguments.length ) {
206
				return removeData.call( this, $.camelCase( key ) );
207
			} else {
208
				return removeData.call( this );
209
			}
210
		};
211
	})( $.fn.removeData );
212
}
213
214
// deprecated
215
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
216
217
$.fn.extend({
218
	focus: (function( orig ) {
219
		return function( delay, fn ) {
220
			return typeof delay === "number" ?
221
				this.each(function() {
222
					var elem = this;
223
					setTimeout(function() {
224
						$( elem ).focus();
225
						if ( fn ) {
226
							fn.call( elem );
227
						}
228
					}, delay );
229
				}) :
230
				orig.apply( this, arguments );
231
		};
232
	})( $.fn.focus ),
233
234
	disableSelection: (function() {
235
		var eventType = "onselectstart" in document.createElement( "div" ) ?
236
			"selectstart" :
237
			"mousedown";
238
239
		return function() {
240
			return this.bind( eventType + ".ui-disableSelection", function( event ) {
241
				event.preventDefault();
242
			});
243
		};
244
	})(),
245
246
	enableSelection: function() {
247
		return this.unbind( ".ui-disableSelection" );
248
	},
249
250
	zIndex: function( zIndex ) {
251
		if ( zIndex !== undefined ) {
252
			return this.css( "zIndex", zIndex );
253
		}
254
255
		if ( this.length ) {
256
			var elem = $( this[ 0 ] ), position, value;
257
			while ( elem.length && elem[ 0 ] !== document ) {
258
				// Ignore z-index if position is set to a value where z-index is ignored by the browser
259
				// This makes behavior of this function consistent across browsers
260
				// WebKit always returns auto if the element is positioned
261
				position = elem.css( "position" );
262
				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
263
					// IE returns 0 when zIndex is not specified
264
					// other browsers return a string
265
					// we ignore the case of nested elements with an explicit value of 0
266
					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
267
					value = parseInt( elem.css( "zIndex" ), 10 );
268
					if ( !isNaN( value ) && value !== 0 ) {
269
						return value;
270
					}
271
				}
272
				elem = elem.parent();
273
			}
274
		}
275
276
		return 0;
277
	}
278
});
279
280
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
281
$.ui.plugin = {
282
	add: function( module, option, set ) {
283
		var i,
284
			proto = $.ui[ module ].prototype;
285
		for ( i in set ) {
286
			proto.plugins[ i ] = proto.plugins[ i ] || [];
287
			proto.plugins[ i ].push( [ option, set[ i ] ] );
288
		}
289
	},
290
	call: function( instance, name, args, allowDisconnected ) {
291
		var i,
292
			set = instance.plugins[ name ];
293
294
		if ( !set ) {
295
			return;
296
		}
297
298
		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
299
			return;
300
		}
301
302
		for ( i = 0; i < set.length; i++ ) {
303
			if ( instance.options[ set[ i ][ 0 ] ] ) {
304
				set[ i ][ 1 ].apply( instance.element, args );
305
			}
306
		}
307
	}
308
};
309
310
311
/*!
312
 * jQuery UI Widget 1.11.4
313
 * http://jqueryui.com
314
 *
315
 * Copyright jQuery Foundation and other contributors
316
 * Released under the MIT license.
317
 * http://jquery.org/license
318
 *
319
 * http://api.jqueryui.com/jQuery.widget/
320
 */
321
322
323
var widget_uuid = 0,
324
	widget_slice = Array.prototype.slice;
325
326
$.cleanData = (function( orig ) {
327
	return function( elems ) {
328
		var events, elem, i;
329
		for ( i = 0; (elem = elems[i]) != null; i++ ) {
330
			try {
331
332
				// Only trigger remove when necessary to save time
333
				events = $._data( elem, "events" );
334
				if ( events && events.remove ) {
335
					$( elem ).triggerHandler( "remove" );
336
				}
337
338
			// http://bugs.jquery.com/ticket/8235
339
			} catch ( e ) {}
340
		}
341
		orig( elems );
342
	};
343
})( $.cleanData );
344
345
$.widget = function( name, base, prototype ) {
346
	var fullName, existingConstructor, constructor, basePrototype,
347
		// proxiedPrototype allows the provided prototype to remain unmodified
348
		// so that it can be used as a mixin for multiple widgets (#8876)
349
		proxiedPrototype = {},
350
		namespace = name.split( "." )[ 0 ];
351
352
	name = name.split( "." )[ 1 ];
353
	fullName = namespace + "-" + name;
354
355
	if ( !prototype ) {
356
		prototype = base;
357
		base = $.Widget;
358
	}
359
360
	// create selector for plugin
361
	$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
362
		return !!$.data( elem, fullName );
363
	};
364
365
	$[ namespace ] = $[ namespace ] || {};
366
	existingConstructor = $[ namespace ][ name ];
367
	constructor = $[ namespace ][ name ] = function( options, element ) {
368
		// allow instantiation without "new" keyword
369
		if ( !this._createWidget ) {
370
			return new constructor( options, element );
371
		}
372
373
		// allow instantiation without initializing for simple inheritance
374
		// must use "new" keyword (the code above always passes args)
375
		if ( arguments.length ) {
376
			this._createWidget( options, element );
377
		}
378
	};
379
	// extend with the existing constructor to carry over any static properties
380
	$.extend( constructor, existingConstructor, {
381
		version: prototype.version,
382
		// copy the object used to create the prototype in case we need to
383
		// redefine the widget later
384
		_proto: $.extend( {}, prototype ),
385
		// track widgets that inherit from this widget in case this widget is
386
		// redefined after a widget inherits from it
387
		_childConstructors: []
388
	});
389
390
	basePrototype = new base();
391
	// we need to make the options hash a property directly on the new instance
392
	// otherwise we'll modify the options hash on the prototype that we're
393
	// inheriting from
394
	basePrototype.options = $.widget.extend( {}, basePrototype.options );
395
	$.each( prototype, function( prop, value ) {
396
		if ( !$.isFunction( value ) ) {
397
			proxiedPrototype[ prop ] = value;
398
			return;
399
		}
400
		proxiedPrototype[ prop ] = (function() {
401
			var _super = function() {
402
					return base.prototype[ prop ].apply( this, arguments );
403
				},
404
				_superApply = function( args ) {
405
					return base.prototype[ prop ].apply( this, args );
406
				};
407
			return function() {
408
				var __super = this._super,
409
					__superApply = this._superApply,
410
					returnValue;
411
412
				this._super = _super;
413
				this._superApply = _superApply;
414
415
				returnValue = value.apply( this, arguments );
416
417
				this._super = __super;
418
				this._superApply = __superApply;
419
420
				return returnValue;
421
			};
422
		})();
423
	});
424
	constructor.prototype = $.widget.extend( basePrototype, {
425
		// TODO: remove support for widgetEventPrefix
426
		// always use the name + a colon as the prefix, e.g., draggable:start
427
		// don't prefix for widgets that aren't DOM-based
428
		widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
429
	}, proxiedPrototype, {
430
		constructor: constructor,
431
		namespace: namespace,
432
		widgetName: name,
433
		widgetFullName: fullName
434
	});
435
436
	// If this widget is being redefined then we need to find all widgets that
437
	// are inheriting from it and redefine all of them so that they inherit from
438
	// the new version of this widget. We're essentially trying to replace one
439
	// level in the prototype chain.
440
	if ( existingConstructor ) {
441
		$.each( existingConstructor._childConstructors, function( i, child ) {
442
			var childPrototype = child.prototype;
443
444
			// redefine the child widget using the same prototype that was
445
			// originally used, but inherit from the new version of the base
446
			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
447
		});
448
		// remove the list of existing child constructors from the old constructor
449
		// so the old child constructors can be garbage collected
450
		delete existingConstructor._childConstructors;
451
	} else {
452
		base._childConstructors.push( constructor );
453
	}
454
455
	$.widget.bridge( name, constructor );
456
457
	return constructor;
458
};
459
460
$.widget.extend = function( target ) {
461
	var input = widget_slice.call( arguments, 1 ),
462
		inputIndex = 0,
463
		inputLength = input.length,
464
		key,
465
		value;
466
	for ( ; inputIndex < inputLength; inputIndex++ ) {
467
		for ( key in input[ inputIndex ] ) {
468
			value = input[ inputIndex ][ key ];
469
			if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
470
				// Clone objects
471
				if ( $.isPlainObject( value ) ) {
472
					target[ key ] = $.isPlainObject( target[ key ] ) ?
473
						$.widget.extend( {}, target[ key ], value ) :
474
						// Don't extend strings, arrays, etc. with objects
475
						$.widget.extend( {}, value );
476
				// Copy everything else by reference
477
				} else {
478
					target[ key ] = value;
479
				}
480
			}
481
		}
482
	}
483
	return target;
484
};
485
486
$.widget.bridge = function( name, object ) {
487
	var fullName = object.prototype.widgetFullName || name;
488
	$.fn[ name ] = function( options ) {
489
		var isMethodCall = typeof options === "string",
490
			args = widget_slice.call( arguments, 1 ),
491
			returnValue = this;
492
493
		if ( isMethodCall ) {
494
			this.each(function() {
495
				var methodValue,
496
					instance = $.data( this, fullName );
497
				if ( options === "instance" ) {
498
					returnValue = instance;
499
					return false;
500
				}
501
				if ( !instance ) {
502
					return $.error( "cannot call methods on " + name + " prior to initialization; " +
503
						"attempted to call method '" + options + "'" );
504
				}
505
				if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
506
					return $.error( "no such method '" + options + "' for " + name + " widget instance" );
507
				}
508
				methodValue = instance[ options ].apply( instance, args );
509
				if ( methodValue !== instance && methodValue !== undefined ) {
510
					returnValue = methodValue && methodValue.jquery ?
511
						returnValue.pushStack( methodValue.get() ) :
512
						methodValue;
513
					return false;
514
				}
515
			});
516
		} else {
517
518
			// Allow multiple hashes to be passed on init
519
			if ( args.length ) {
520
				options = $.widget.extend.apply( null, [ options ].concat(args) );
521
			}
522
523
			this.each(function() {
524
				var instance = $.data( this, fullName );
525
				if ( instance ) {
526
					instance.option( options || {} );
527
					if ( instance._init ) {
528
						instance._init();
529
					}
530
				} else {
531
					$.data( this, fullName, new object( options, this ) );
532
				}
533
			});
534
		}
535
536
		return returnValue;
537
	};
538
};
539
540
$.Widget = function( /* options, element */ ) {};
541
$.Widget._childConstructors = [];
542
543
$.Widget.prototype = {
544
	widgetName: "widget",
545
	widgetEventPrefix: "",
546
	defaultElement: "<div>",
547
	options: {
548
		disabled: false,
549
550
		// callbacks
551
		create: null
552
	},
553
	_createWidget: function( options, element ) {
554
		element = $( element || this.defaultElement || this )[ 0 ];
555
		this.element = $( element );
556
		this.uuid = widget_uuid++;
557
		this.eventNamespace = "." + this.widgetName + this.uuid;
558
559
		this.bindings = $();
560
		this.hoverable = $();
561
		this.focusable = $();
562
563
		if ( element !== this ) {
564
			$.data( element, this.widgetFullName, this );
565
			this._on( true, this.element, {
566
				remove: function( event ) {
567
					if ( event.target === element ) {
568
						this.destroy();
569
					}
570
				}
571
			});
572
			this.document = $( element.style ?
573
				// element within the document
574
				element.ownerDocument :
575
				// element is window or document
576
				element.document || element );
577
			this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
578
		}
579
580
		this.options = $.widget.extend( {},
581
			this.options,
582
			this._getCreateOptions(),
583
			options );
584
585
		this._create();
586
		this._trigger( "create", null, this._getCreateEventData() );
587
		this._init();
588
	},
589
	_getCreateOptions: $.noop,
590
	_getCreateEventData: $.noop,
591
	_create: $.noop,
592
	_init: $.noop,
593
594
	destroy: function() {
595
		this._destroy();
596
		// we can probably remove the unbind calls in 2.0
597
		// all event bindings should go through this._on()
598
		this.element
599
			.unbind( this.eventNamespace )
600
			.removeData( this.widgetFullName )
601
			// support: jquery <1.6.3
602
			// http://bugs.jquery.com/ticket/9413
603
			.removeData( $.camelCase( this.widgetFullName ) );
604
		this.widget()
605
			.unbind( this.eventNamespace )
606
			.removeAttr( "aria-disabled" )
607
			.removeClass(
608
				this.widgetFullName + "-disabled " +
609
				"ui-state-disabled" );
610
611
		// clean up events and states
612
		this.bindings.unbind( this.eventNamespace );
613
		this.hoverable.removeClass( "ui-state-hover" );
614
		this.focusable.removeClass( "ui-state-focus" );
615
	},
616
	_destroy: $.noop,
617
618
	widget: function() {
619
		return this.element;
620
	},
621
622
	option: function( key, value ) {
623
		var options = key,
624
			parts,
625
			curOption,
626
			i;
627
628
		if ( arguments.length === 0 ) {
629
			// don't return a reference to the internal hash
630
			return $.widget.extend( {}, this.options );
631
		}
632
633
		if ( typeof key === "string" ) {
634
			// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
635
			options = {};
636
			parts = key.split( "." );
637
			key = parts.shift();
638
			if ( parts.length ) {
639
				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
640
				for ( i = 0; i < parts.length - 1; i++ ) {
641
					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
642
					curOption = curOption[ parts[ i ] ];
643
				}
644
				key = parts.pop();
645
				if ( arguments.length === 1 ) {
646
					return curOption[ key ] === undefined ? null : curOption[ key ];
647
				}
648
				curOption[ key ] = value;
649
			} else {
650
				if ( arguments.length === 1 ) {
651
					return this.options[ key ] === undefined ? null : this.options[ key ];
652
				}
653
				options[ key ] = value;
654
			}
655
		}
656
657
		this._setOptions( options );
658
659
		return this;
660
	},
661
	_setOptions: function( options ) {
662
		var key;
663
664
		for ( key in options ) {
665
			this._setOption( key, options[ key ] );
666
		}
667
668
		return this;
669
	},
670
	_setOption: function( key, value ) {
671
		this.options[ key ] = value;
672
673
		if ( key === "disabled" ) {
674
			this.widget()
675
				.toggleClass( this.widgetFullName + "-disabled", !!value );
676
677
			// If the widget is becoming disabled, then nothing is interactive
678
			if ( value ) {
679
				this.hoverable.removeClass( "ui-state-hover" );
680
				this.focusable.removeClass( "ui-state-focus" );
681
			}
682
		}
683
684
		return this;
685
	},
686
687
	enable: function() {
688
		return this._setOptions({ disabled: false });
689
	},
690
	disable: function() {
691
		return this._setOptions({ disabled: true });
692
	},
693
694
	_on: function( suppressDisabledCheck, element, handlers ) {
695
		var delegateElement,
696
			instance = this;
697
698
		// no suppressDisabledCheck flag, shuffle arguments
699
		if ( typeof suppressDisabledCheck !== "boolean" ) {
700
			handlers = element;
701
			element = suppressDisabledCheck;
702
			suppressDisabledCheck = false;
703
		}
704
705
		// no element argument, shuffle and use this.element
706
		if ( !handlers ) {
707
			handlers = element;
708
			element = this.element;
709
			delegateElement = this.widget();
710
		} else {
711
			element = delegateElement = $( element );
712
			this.bindings = this.bindings.add( element );
713
		}
714
715
		$.each( handlers, function( event, handler ) {
716
			function handlerProxy() {
717
				// allow widgets to customize the disabled handling
718
				// - disabled as an array instead of boolean
719
				// - disabled class as method for disabling individual parts
720
				if ( !suppressDisabledCheck &&
721
						( instance.options.disabled === true ||
722
							$( this ).hasClass( "ui-state-disabled" ) ) ) {
723
					return;
724
				}
725
				return ( typeof handler === "string" ? instance[ handler ] : handler )
726
					.apply( instance, arguments );
727
			}
728
729
			// copy the guid so direct unbinding works
730
			if ( typeof handler !== "string" ) {
731
				handlerProxy.guid = handler.guid =
732
					handler.guid || handlerProxy.guid || $.guid++;
733
			}
734
735
			var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
736
				eventName = match[1] + instance.eventNamespace,
737
				selector = match[2];
738
			if ( selector ) {
739
				delegateElement.delegate( selector, eventName, handlerProxy );
740
			} else {
741
				element.bind( eventName, handlerProxy );
742
			}
743
		});
744
	},
745
746
	_off: function( element, eventName ) {
747
		eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
748
			this.eventNamespace;
749
		element.unbind( eventName ).undelegate( eventName );
750
751
		// Clear the stack to avoid memory leaks (#10056)
752
		this.bindings = $( this.bindings.not( element ).get() );
753
		this.focusable = $( this.focusable.not( element ).get() );
754
		this.hoverable = $( this.hoverable.not( element ).get() );
755
	},
756
757
	_delay: function( handler, delay ) {
758
		function handlerProxy() {
759
			return ( typeof handler === "string" ? instance[ handler ] : handler )
760
				.apply( instance, arguments );
761
		}
762
		var instance = this;
763
		return setTimeout( handlerProxy, delay || 0 );
764
	},
765
766
	_hoverable: function( element ) {
767
		this.hoverable = this.hoverable.add( element );
768
		this._on( element, {
769
			mouseenter: function( event ) {
770
				$( event.currentTarget ).addClass( "ui-state-hover" );
771
			},
772
			mouseleave: function( event ) {
773
				$( event.currentTarget ).removeClass( "ui-state-hover" );
774
			}
775
		});
776
	},
777
778
	_focusable: function( element ) {
779
		this.focusable = this.focusable.add( element );
780
		this._on( element, {
781
			focusin: function( event ) {
782
				$( event.currentTarget ).addClass( "ui-state-focus" );
783
			},
784
			focusout: function( event ) {
785
				$( event.currentTarget ).removeClass( "ui-state-focus" );
786
			}
787
		});
788
	},
789
790
	_trigger: function( type, event, data ) {
791
		var prop, orig,
792
			callback = this.options[ type ];
793
794
		data = data || {};
795
		event = $.Event( event );
796
		event.type = ( type === this.widgetEventPrefix ?
797
			type :
798
			this.widgetEventPrefix + type ).toLowerCase();
799
		// the original event may come from any element
800
		// so we need to reset the target on the new event
801
		event.target = this.element[ 0 ];
802
803
		// copy original event properties over to the new event
804
		orig = event.originalEvent;
805
		if ( orig ) {
806
			for ( prop in orig ) {
807
				if ( !( prop in event ) ) {
808
					event[ prop ] = orig[ prop ];
809
				}
810
			}
811
		}
812
813
		this.element.trigger( event, data );
814
		return !( $.isFunction( callback ) &&
815
			callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
816
			event.isDefaultPrevented() );
817
	}
818
};
819
820
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
821
	$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
822
		if ( typeof options === "string" ) {
823
			options = { effect: options };
824
		}
825
		var hasOptions,
826
			effectName = !options ?
827
				method :
828
				options === true || typeof options === "number" ?
829
					defaultEffect :
830
					options.effect || defaultEffect;
831
		options = options || {};
832
		if ( typeof options === "number" ) {
833
			options = { duration: options };
834
		}
835
		hasOptions = !$.isEmptyObject( options );
836
		options.complete = callback;
837
		if ( options.delay ) {
838
			element.delay( options.delay );
839
		}
840
		if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
841
			element[ method ]( options );
842
		} else if ( effectName !== method && element[ effectName ] ) {
843
			element[ effectName ]( options.duration, options.easing, callback );
844
		} else {
845
			element.queue(function( next ) {
846
				$( this )[ method ]();
847
				if ( callback ) {
848
					callback.call( element[ 0 ] );
849
				}
850
				next();
851
			});
852
		}
853
	};
854
});
855
856
var widget = $.widget;
857
858
859
/*!
860
 * jQuery UI Mouse 1.11.4
861
 * http://jqueryui.com
862
 *
863
 * Copyright jQuery Foundation and other contributors
864
 * Released under the MIT license.
865
 * http://jquery.org/license
866
 *
867
 * http://api.jqueryui.com/mouse/
868
 */
869
870
871
var mouseHandled = false;
872
$( document ).mouseup( function() {
873
	mouseHandled = false;
874
});
875
876
var mouse = $.widget("ui.mouse", {
877
	version: "1.11.4",
878
	options: {
879
		cancel: "input,textarea,button,select,option",
880
		distance: 1,
881
		delay: 0
882
	},
883
	_mouseInit: function() {
884
		var that = this;
885
886
		this.element
887
			.bind("mousedown." + this.widgetName, function(event) {
888
				return that._mouseDown(event);
889
			})
890
			.bind("click." + this.widgetName, function(event) {
891
				if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
892
					$.removeData(event.target, that.widgetName + ".preventClickEvent");
893
					event.stopImmediatePropagation();
894
					return false;
895
				}
896
			});
897
898
		this.started = false;
899
	},
900
901
	// TODO: make sure destroying one instance of mouse doesn't mess with
902
	// other instances of mouse
903
	_mouseDestroy: function() {
904
		this.element.unbind("." + this.widgetName);
905
		if ( this._mouseMoveDelegate ) {
906
			this.document
907
				.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
908
				.unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
909
		}
910
	},
911
912
	_mouseDown: function(event) {
913
		// don't let more than one widget handle mouseStart
914
		if ( mouseHandled ) {
915
			return;
916
		}
917
918
		this._mouseMoved = false;
919
920
		// we may have missed mouseup (out of window)
921
		(this._mouseStarted && this._mouseUp(event));
922
923
		this._mouseDownEvent = event;
924
925
		var that = this,
926
			btnIsLeft = (event.which === 1),
927
			// event.target.nodeName works around a bug in IE 8 with
928
			// disabled inputs (#7620)
929
			elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
930
		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
931
			return true;
932
		}
933
934
		this.mouseDelayMet = !this.options.delay;
935
		if (!this.mouseDelayMet) {
936
			this._mouseDelayTimer = setTimeout(function() {
937
				that.mouseDelayMet = true;
938
			}, this.options.delay);
939
		}
940
941
		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
942
			this._mouseStarted = (this._mouseStart(event) !== false);
943
			if (!this._mouseStarted) {
944
				event.preventDefault();
945
				return true;
946
			}
947
		}
948
949
		// Click event may never have fired (Gecko & Opera)
950
		if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
951
			$.removeData(event.target, this.widgetName + ".preventClickEvent");
952
		}
953
954
		// these delegates are required to keep context
955
		this._mouseMoveDelegate = function(event) {
956
			return that._mouseMove(event);
957
		};
958
		this._mouseUpDelegate = function(event) {
959
			return that._mouseUp(event);
960
		};
961
962
		this.document
963
			.bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
964
			.bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
965
966
		event.preventDefault();
967
968
		mouseHandled = true;
969
		return true;
970
	},
971
972
	_mouseMove: function(event) {
973
		// Only check for mouseups outside the document if you've moved inside the document
974
		// at least once. This prevents the firing of mouseup in the case of IE<9, which will
975
		// fire a mousemove event if content is placed under the cursor. See #7778
976
		// Support: IE <9
977
		if ( this._mouseMoved ) {
978
			// IE mouseup check - mouseup happened when mouse was out of window
979
			if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
980
				return this._mouseUp(event);
981
982
			// Iframe mouseup check - mouseup occurred in another document
983
			} else if ( !event.which ) {
984
				return this._mouseUp( event );
985
			}
986
		}
987
988
		if ( event.which || event.button ) {
989
			this._mouseMoved = true;
990
		}
991
992
		if (this._mouseStarted) {
993
			this._mouseDrag(event);
994
			return event.preventDefault();
995
		}
996
997
		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
998
			this._mouseStarted =
999
				(this._mouseStart(this._mouseDownEvent, event) !== false);
1000
			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
1001
		}
1002
1003
		return !this._mouseStarted;
1004
	},
1005
1006
	_mouseUp: function(event) {
1007
		this.document
1008
			.unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
1009
			.unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
1010
1011
		if (this._mouseStarted) {
1012
			this._mouseStarted = false;
1013
1014
			if (event.target === this._mouseDownEvent.target) {
1015
				$.data(event.target, this.widgetName + ".preventClickEvent", true);
1016
			}
1017
1018
			this._mouseStop(event);
1019
		}
1020
1021
		mouseHandled = false;
1022
		return false;
1023
	},
1024
1025
	_mouseDistanceMet: function(event) {
1026
		return (Math.max(
1027
				Math.abs(this._mouseDownEvent.pageX - event.pageX),
1028
				Math.abs(this._mouseDownEvent.pageY - event.pageY)
1029
			) >= this.options.distance
1030
		);
1031
	},
1032
1033
	_mouseDelayMet: function(/* event */) {
1034
		return this.mouseDelayMet;
1035
	},
1036
1037
	// These are placeholder methods, to be overriden by extending plugin
1038
	_mouseStart: function(/* event */) {},
1039
	_mouseDrag: function(/* event */) {},
1040
	_mouseStop: function(/* event */) {},
1041
	_mouseCapture: function(/* event */) { return true; }
1042
});
1043
1044
1045
/*!
1046
 * jQuery UI Position 1.11.4
1047
 * http://jqueryui.com
1048
 *
1049
 * Copyright jQuery Foundation and other contributors
1050
 * Released under the MIT license.
1051
 * http://jquery.org/license
1052
 *
1053
 * http://api.jqueryui.com/position/
1054
 */
1055
1056
(function() {
1057
1058
$.ui = $.ui || {};
1059
1060
var cachedScrollbarWidth, supportsOffsetFractions,
1061
	max = Math.max,
1062
	abs = Math.abs,
1063
	round = Math.round,
1064
	rhorizontal = /left|center|right/,
1065
	rvertical = /top|center|bottom/,
1066
	roffset = /[\+\-]\d+(\.[\d]+)?%?/,
1067
	rposition = /^\w+/,
1068
	rpercent = /%$/,
1069
	_position = $.fn.position;
1070
1071
function getOffsets( offsets, width, height ) {
1072
	return [
1073
		parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
1074
		parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
1075
	];
1076
}
1077
1078
function parseCss( element, property ) {
1079
	return parseInt( $.css( element, property ), 10 ) || 0;
1080
}
1081
1082
function getDimensions( elem ) {
1083
	var raw = elem[0];
1084
	if ( raw.nodeType === 9 ) {
1085
		return {
1086
			width: elem.width(),
1087
			height: elem.height(),
1088
			offset: { top: 0, left: 0 }
1089
		};
1090
	}
1091
	if ( $.isWindow( raw ) ) {
1092
		return {
1093
			width: elem.width(),
1094
			height: elem.height(),
1095
			offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
1096
		};
1097
	}
1098
	if ( raw.preventDefault ) {
1099
		return {
1100
			width: 0,
1101
			height: 0,
1102
			offset: { top: raw.pageY, left: raw.pageX }
1103
		};
1104
	}
1105
	return {
1106
		width: elem.outerWidth(),
1107
		height: elem.outerHeight(),
1108
		offset: elem.offset()
1109
	};
1110
}
1111
1112
$.position = {
1113
	scrollbarWidth: function() {
1114
		if ( cachedScrollbarWidth !== undefined ) {
1115
			return cachedScrollbarWidth;
1116
		}
1117
		var w1, w2,
1118
			div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
1119
			innerDiv = div.children()[0];
1120
1121
		$( "body" ).append( div );
1122
		w1 = innerDiv.offsetWidth;
1123
		div.css( "overflow", "scroll" );
1124
1125
		w2 = innerDiv.offsetWidth;
1126
1127
		if ( w1 === w2 ) {
1128
			w2 = div[0].clientWidth;
1129
		}
1130
1131
		div.remove();
1132
1133
		return (cachedScrollbarWidth = w1 - w2);
1134
	},
1135
	getScrollInfo: function( within ) {
1136
		var overflowX = within.isWindow || within.isDocument ? "" :
1137
				within.element.css( "overflow-x" ),
1138
			overflowY = within.isWindow || within.isDocument ? "" :
1139
				within.element.css( "overflow-y" ),
1140
			hasOverflowX = overflowX === "scroll" ||
1141
				( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
1142
			hasOverflowY = overflowY === "scroll" ||
1143
				( overflowY === "auto" && within.height < within.element[0].scrollHeight );
1144
		return {
1145
			width: hasOverflowY ? $.position.scrollbarWidth() : 0,
1146
			height: hasOverflowX ? $.position.scrollbarWidth() : 0
1147
		};
1148
	},
1149
	getWithinInfo: function( element ) {
1150
		var withinElement = $( element || window ),
1151
			isWindow = $.isWindow( withinElement[0] ),
1152
			isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
1153
		return {
1154
			element: withinElement,
1155
			isWindow: isWindow,
1156
			isDocument: isDocument,
1157
			offset: withinElement.offset() || { left: 0, top: 0 },
1158
			scrollLeft: withinElement.scrollLeft(),
1159
			scrollTop: withinElement.scrollTop(),
1160
1161
			// support: jQuery 1.6.x
1162
			// jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
1163
			width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
1164
			height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
1165
		};
1166
	}
1167
};
1168
1169
$.fn.position = function( options ) {
1170
	if ( !options || !options.of ) {
1171
		return _position.apply( this, arguments );
1172
	}
1173
1174
	// make a copy, we don't want to modify arguments
1175
	options = $.extend( {}, options );
1176
1177
	var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
1178
		target = $( options.of ),
1179
		within = $.position.getWithinInfo( options.within ),
1180
		scrollInfo = $.position.getScrollInfo( within ),
1181
		collision = ( options.collision || "flip" ).split( " " ),
1182
		offsets = {};
1183
1184
	dimensions = getDimensions( target );
1185
	if ( target[0].preventDefault ) {
1186
		// force left top to allow flipping
1187
		options.at = "left top";
1188
	}
1189
	targetWidth = dimensions.width;
1190
	targetHeight = dimensions.height;
1191
	targetOffset = dimensions.offset;
1192
	// clone to reuse original targetOffset later
1193
	basePosition = $.extend( {}, targetOffset );
1194
1195
	// force my and at to have valid horizontal and vertical positions
1196
	// if a value is missing or invalid, it will be converted to center
1197
	$.each( [ "my", "at" ], function() {
1198
		var pos = ( options[ this ] || "" ).split( " " ),
1199
			horizontalOffset,
1200
			verticalOffset;
1201
1202
		if ( pos.length === 1) {
1203
			pos = rhorizontal.test( pos[ 0 ] ) ?
1204
				pos.concat( [ "center" ] ) :
1205
				rvertical.test( pos[ 0 ] ) ?
1206
					[ "center" ].concat( pos ) :
1207
					[ "center", "center" ];
1208
		}
1209
		pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
1210
		pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
1211
1212
		// calculate offsets
1213
		horizontalOffset = roffset.exec( pos[ 0 ] );
1214
		verticalOffset = roffset.exec( pos[ 1 ] );
1215
		offsets[ this ] = [
1216
			horizontalOffset ? horizontalOffset[ 0 ] : 0,
1217
			verticalOffset ? verticalOffset[ 0 ] : 0
1218
		];
1219
1220
		// reduce to just the positions without the offsets
1221
		options[ this ] = [
1222
			rposition.exec( pos[ 0 ] )[ 0 ],
1223
			rposition.exec( pos[ 1 ] )[ 0 ]
1224
		];
1225
	});
1226
1227
	// normalize collision option
1228
	if ( collision.length === 1 ) {
1229
		collision[ 1 ] = collision[ 0 ];
1230
	}
1231
1232
	if ( options.at[ 0 ] === "right" ) {
1233
		basePosition.left += targetWidth;
1234
	} else if ( options.at[ 0 ] === "center" ) {
1235
		basePosition.left += targetWidth / 2;
1236
	}
1237
1238
	if ( options.at[ 1 ] === "bottom" ) {
1239
		basePosition.top += targetHeight;
1240
	} else if ( options.at[ 1 ] === "center" ) {
1241
		basePosition.top += targetHeight / 2;
1242
	}
1243
1244
	atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
1245
	basePosition.left += atOffset[ 0 ];
1246
	basePosition.top += atOffset[ 1 ];
1247
1248
	return this.each(function() {
1249
		var collisionPosition, using,
1250
			elem = $( this ),
1251
			elemWidth = elem.outerWidth(),
1252
			elemHeight = elem.outerHeight(),
1253
			marginLeft = parseCss( this, "marginLeft" ),
1254
			marginTop = parseCss( this, "marginTop" ),
1255
			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
1256
			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
1257
			position = $.extend( {}, basePosition ),
1258
			myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
1259
1260
		if ( options.my[ 0 ] === "right" ) {
1261
			position.left -= elemWidth;
1262
		} else if ( options.my[ 0 ] === "center" ) {
1263
			position.left -= elemWidth / 2;
1264
		}
1265
1266
		if ( options.my[ 1 ] === "bottom" ) {
1267
			position.top -= elemHeight;
1268
		} else if ( options.my[ 1 ] === "center" ) {
1269
			position.top -= elemHeight / 2;
1270
		}
1271
1272
		position.left += myOffset[ 0 ];
1273
		position.top += myOffset[ 1 ];
1274
1275
		// if the browser doesn't support fractions, then round for consistent results
1276
		if ( !supportsOffsetFractions ) {
1277
			position.left = round( position.left );
1278
			position.top = round( position.top );
1279
		}
1280
1281
		collisionPosition = {
1282
			marginLeft: marginLeft,
1283
			marginTop: marginTop
1284
		};
1285
1286
		$.each( [ "left", "top" ], function( i, dir ) {
1287
			if ( $.ui.position[ collision[ i ] ] ) {
1288
				$.ui.position[ collision[ i ] ][ dir ]( position, {
1289
					targetWidth: targetWidth,
1290
					targetHeight: targetHeight,
1291
					elemWidth: elemWidth,
1292
					elemHeight: elemHeight,
1293
					collisionPosition: collisionPosition,
1294
					collisionWidth: collisionWidth,
1295
					collisionHeight: collisionHeight,
1296
					offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
1297
					my: options.my,
1298
					at: options.at,
1299
					within: within,
1300
					elem: elem
1301
				});
1302
			}
1303
		});
1304
1305
		if ( options.using ) {
1306
			// adds feedback as second argument to using callback, if present
1307
			using = function( props ) {
1308
				var left = targetOffset.left - position.left,
1309
					right = left + targetWidth - elemWidth,
1310
					top = targetOffset.top - position.top,
1311
					bottom = top + targetHeight - elemHeight,
1312
					feedback = {
1313
						target: {
1314
							element: target,
1315
							left: targetOffset.left,
1316
							top: targetOffset.top,
1317
							width: targetWidth,
1318
							height: targetHeight
1319
						},
1320
						element: {
1321
							element: elem,
1322
							left: position.left,
1323
							top: position.top,
1324
							width: elemWidth,
1325
							height: elemHeight
1326
						},
1327
						horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
1328
						vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
1329
					};
1330
				if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
1331
					feedback.horizontal = "center";
1332
				}
1333
				if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
1334
					feedback.vertical = "middle";
1335
				}
1336
				if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
1337
					feedback.important = "horizontal";
1338
				} else {
1339
					feedback.important = "vertical";
1340
				}
1341
				options.using.call( this, props, feedback );
1342
			};
1343
		}
1344
1345
		elem.offset( $.extend( position, { using: using } ) );
1346
	});
1347
};
1348
1349
$.ui.position = {
1350
	fit: {
1351
		left: function( position, data ) {
1352
			var within = data.within,
1353
				withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
1354
				outerWidth = within.width,
1355
				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1356
				overLeft = withinOffset - collisionPosLeft,
1357
				overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1358
				newOverRight;
1359
1360
			// element is wider than within
1361
			if ( data.collisionWidth > outerWidth ) {
1362
				// element is initially over the left side of within
1363
				if ( overLeft > 0 && overRight <= 0 ) {
1364
					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
1365
					position.left += overLeft - newOverRight;
1366
				// element is initially over right side of within
1367
				} else if ( overRight > 0 && overLeft <= 0 ) {
1368
					position.left = withinOffset;
1369
				// element is initially over both left and right sides of within
1370
				} else {
1371
					if ( overLeft > overRight ) {
1372
						position.left = withinOffset + outerWidth - data.collisionWidth;
1373
					} else {
1374
						position.left = withinOffset;
1375
					}
1376
				}
1377
			// too far left -> align with left edge
1378
			} else if ( overLeft > 0 ) {
1379
				position.left += overLeft;
1380
			// too far right -> align with right edge
1381
			} else if ( overRight > 0 ) {
1382
				position.left -= overRight;
1383
			// adjust based on position and margin
1384
			} else {
1385
				position.left = max( position.left - collisionPosLeft, position.left );
1386
			}
1387
		},
1388
		top: function( position, data ) {
1389
			var within = data.within,
1390
				withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
1391
				outerHeight = data.within.height,
1392
				collisionPosTop = position.top - data.collisionPosition.marginTop,
1393
				overTop = withinOffset - collisionPosTop,
1394
				overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1395
				newOverBottom;
1396
1397
			// element is taller than within
1398
			if ( data.collisionHeight > outerHeight ) {
1399
				// element is initially over the top of within
1400
				if ( overTop > 0 && overBottom <= 0 ) {
1401
					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
1402
					position.top += overTop - newOverBottom;
1403
				// element is initially over bottom of within
1404
				} else if ( overBottom > 0 && overTop <= 0 ) {
1405
					position.top = withinOffset;
1406
				// element is initially over both top and bottom of within
1407
				} else {
1408
					if ( overTop > overBottom ) {
1409
						position.top = withinOffset + outerHeight - data.collisionHeight;
1410
					} else {
1411
						position.top = withinOffset;
1412
					}
1413
				}
1414
			// too far up -> align with top
1415
			} else if ( overTop > 0 ) {
1416
				position.top += overTop;
1417
			// too far down -> align with bottom edge
1418
			} else if ( overBottom > 0 ) {
1419
				position.top -= overBottom;
1420
			// adjust based on position and margin
1421
			} else {
1422
				position.top = max( position.top - collisionPosTop, position.top );
1423
			}
1424
		}
1425
	},
1426
	flip: {
1427
		left: function( position, data ) {
1428
			var within = data.within,
1429
				withinOffset = within.offset.left + within.scrollLeft,
1430
				outerWidth = within.width,
1431
				offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
1432
				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1433
				overLeft = collisionPosLeft - offsetLeft,
1434
				overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1435
				myOffset = data.my[ 0 ] === "left" ?
1436
					-data.elemWidth :
1437
					data.my[ 0 ] === "right" ?
1438
						data.elemWidth :
1439
						0,
1440
				atOffset = data.at[ 0 ] === "left" ?
1441
					data.targetWidth :
1442
					data.at[ 0 ] === "right" ?
1443
						-data.targetWidth :
1444
						0,
1445
				offset = -2 * data.offset[ 0 ],
1446
				newOverRight,
1447
				newOverLeft;
1448
1449
			if ( overLeft < 0 ) {
1450
				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
1451
				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
1452
					position.left += myOffset + atOffset + offset;
1453
				}
1454
			} else if ( overRight > 0 ) {
1455
				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
1456
				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
1457
					position.left += myOffset + atOffset + offset;
1458
				}
1459
			}
1460
		},
1461
		top: function( position, data ) {
1462
			var within = data.within,
1463
				withinOffset = within.offset.top + within.scrollTop,
1464
				outerHeight = within.height,
1465
				offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1466
				collisionPosTop = position.top - data.collisionPosition.marginTop,
1467
				overTop = collisionPosTop - offsetTop,
1468
				overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1469
				top = data.my[ 1 ] === "top",
1470
				myOffset = top ?
1471
					-data.elemHeight :
1472
					data.my[ 1 ] === "bottom" ?
1473
						data.elemHeight :
1474
						0,
1475
				atOffset = data.at[ 1 ] === "top" ?
1476
					data.targetHeight :
1477
					data.at[ 1 ] === "bottom" ?
1478
						-data.targetHeight :
1479
						0,
1480
				offset = -2 * data.offset[ 1 ],
1481
				newOverTop,
1482
				newOverBottom;
1483
			if ( overTop < 0 ) {
1484
				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
1485
				if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
1486
					position.top += myOffset + atOffset + offset;
1487
				}
1488
			} else if ( overBottom > 0 ) {
1489
				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
1490
				if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
1491
					position.top += myOffset + atOffset + offset;
1492
				}
1493
			}
1494
		}
1495
	},
1496
	flipfit: {
1497
		left: function() {
1498
			$.ui.position.flip.left.apply( this, arguments );
1499
			$.ui.position.fit.left.apply( this, arguments );
1500
		},
1501
		top: function() {
1502
			$.ui.position.flip.top.apply( this, arguments );
1503
			$.ui.position.fit.top.apply( this, arguments );
1504
		}
1505
	}
1506
};
1507
1508
// fraction support test
1509
(function() {
1510
	var testElement, testElementParent, testElementStyle, offsetLeft, i,
1511
		body = document.getElementsByTagName( "body" )[ 0 ],
1512
		div = document.createElement( "div" );
1513
1514
	//Create a "fake body" for testing based on method used in jQuery.support
1515
	testElement = document.createElement( body ? "div" : "body" );
1516
	testElementStyle = {
1517
		visibility: "hidden",
1518
		width: 0,
1519
		height: 0,
1520
		border: 0,
1521
		margin: 0,
1522
		background: "none"
1523
	};
1524
	if ( body ) {
1525
		$.extend( testElementStyle, {
1526
			position: "absolute",
1527
			left: "-1000px",
1528
			top: "-1000px"
1529
		});
1530
	}
1531
	for ( i in testElementStyle ) {
1532
		testElement.style[ i ] = testElementStyle[ i ];
1533
	}
1534
	testElement.appendChild( div );
1535
	testElementParent = body || document.documentElement;
1536
	testElementParent.insertBefore( testElement, testElementParent.firstChild );
1537
1538
	div.style.cssText = "position: absolute; left: 10.7432222px;";
1539
1540
	offsetLeft = $( div ).offset().left;
1541
	supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
1542
1543
	testElement.innerHTML = "";
1544
	testElementParent.removeChild( testElement );
1545
})();
1546
1547
})();
1548
1549
var position = $.ui.position;
1550
1551
1552
/*!
1553
 * jQuery UI Draggable 1.11.4
1554
 * http://jqueryui.com
1555
 *
1556
 * Copyright jQuery Foundation and other contributors
1557
 * Released under the MIT license.
1558
 * http://jquery.org/license
1559
 *
1560
 * http://api.jqueryui.com/draggable/
1561
 */
1562
1563
1564
$.widget("ui.draggable", $.ui.mouse, {
1565
	version: "1.11.4",
1566
	widgetEventPrefix: "drag",
1567
	options: {
1568
		addClasses: true,
1569
		appendTo: "parent",
1570
		axis: false,
1571
		connectToSortable: false,
1572
		containment: false,
1573
		cursor: "auto",
1574
		cursorAt: false,
1575
		grid: false,
1576
		handle: false,
1577
		helper: "original",
1578
		iframeFix: false,
1579
		opacity: false,
1580
		refreshPositions: false,
1581
		revert: false,
1582
		revertDuration: 500,
1583
		scope: "default",
1584
		scroll: true,
1585
		scrollSensitivity: 20,
1586
		scrollSpeed: 20,
1587
		snap: false,
1588
		snapMode: "both",
1589
		snapTolerance: 20,
1590
		stack: false,
1591
		zIndex: false,
1592
1593
		// callbacks
1594
		drag: null,
1595
		start: null,
1596
		stop: null
1597
	},
1598
	_create: function() {
1599
1600
		if ( this.options.helper === "original" ) {
1601
			this._setPositionRelative();
1602
		}
1603
		if (this.options.addClasses){
1604
			this.element.addClass("ui-draggable");
1605
		}
1606
		if (this.options.disabled){
1607
			this.element.addClass("ui-draggable-disabled");
1608
		}
1609
		this._setHandleClassName();
1610
1611
		this._mouseInit();
1612
	},
1613
1614
	_setOption: function( key, value ) {
1615
		this._super( key, value );
1616
		if ( key === "handle" ) {
1617
			this._removeHandleClassName();
1618
			this._setHandleClassName();
1619
		}
1620
	},
1621
1622
	_destroy: function() {
1623
		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
1624
			this.destroyOnClear = true;
1625
			return;
1626
		}
1627
		this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
1628
		this._removeHandleClassName();
1629
		this._mouseDestroy();
1630
	},
1631
1632
	_mouseCapture: function(event) {
1633
		var o = this.options;
1634
1635
		this._blurActiveElement( event );
1636
1637
		// among others, prevent a drag on a resizable-handle
1638
		if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
1639
			return false;
1640
		}
1641
1642
		//Quit if we're not on a valid handle
1643
		this.handle = this._getHandle(event);
1644
		if (!this.handle) {
1645
			return false;
1646
		}
1647
1648
		this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
1649
1650
		return true;
1651
1652
	},
1653
1654
	_blockFrames: function( selector ) {
1655
		this.iframeBlocks = this.document.find( selector ).map(function() {
1656
			var iframe = $( this );
1657
1658
			return $( "<div>" )
1659
				.css( "position", "absolute" )
1660
				.appendTo( iframe.parent() )
1661
				.outerWidth( iframe.outerWidth() )
1662
				.outerHeight( iframe.outerHeight() )
1663
				.offset( iframe.offset() )[ 0 ];
1664
		});
1665
	},
1666
1667
	_unblockFrames: function() {
1668
		if ( this.iframeBlocks ) {
1669
			this.iframeBlocks.remove();
1670
			delete this.iframeBlocks;
1671
		}
1672
	},
1673
1674
	_blurActiveElement: function( event ) {
1675
		var document = this.document[ 0 ];
1676
1677
		// Only need to blur if the event occurred on the draggable itself, see #10527
1678
		if ( !this.handleElement.is( event.target ) ) {
1679
			return;
1680
		}
1681
1682
		// support: IE9
1683
		// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
1684
		try {
1685
1686
			// Support: IE9, IE10
1687
			// If the <body> is blurred, IE will switch windows, see #9520
1688
			if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
1689
1690
				// Blur any element that currently has focus, see #4261
1691
				$( document.activeElement ).blur();
1692
			}
1693
		} catch ( error ) {}
1694
	},
1695
1696
	_mouseStart: function(event) {
1697
1698
		var o = this.options;
1699
1700
		//Create and append the visible helper
1701
		this.helper = this._createHelper(event);
1702
1703
		this.helper.addClass("ui-draggable-dragging");
1704
1705
		//Cache the helper size
1706
		this._cacheHelperProportions();
1707
1708
		//If ddmanager is used for droppables, set the global draggable
1709
		if ($.ui.ddmanager) {
1710
			$.ui.ddmanager.current = this;
1711
		}
1712
1713
		/*
1714
		 * - Position generation -
1715
		 * This block generates everything position related - it's the core of draggables.
1716
		 */
1717
1718
		//Cache the margins of the original element
1719
		this._cacheMargins();
1720
1721
		//Store the helper's css position
1722
		this.cssPosition = this.helper.css( "position" );
1723
		this.scrollParent = this.helper.scrollParent( true );
1724
		this.offsetParent = this.helper.offsetParent();
1725
		this.hasFixedAncestor = this.helper.parents().filter(function() {
1726
				return $( this ).css( "position" ) === "fixed";
1727
			}).length > 0;
1728
1729
		//The element's absolute position on the page minus margins
1730
		this.positionAbs = this.element.offset();
1731
		this._refreshOffsets( event );
1732
1733
		//Generate the original position
1734
		this.originalPosition = this.position = this._generatePosition( event, false );
1735
		this.originalPageX = event.pageX;
1736
		this.originalPageY = event.pageY;
1737
1738
		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
1739
		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
1740
1741
		//Set a containment if given in the options
1742
		this._setContainment();
1743
1744
		//Trigger event + callbacks
1745
		if (this._trigger("start", event) === false) {
1746
			this._clear();
1747
			return false;
1748
		}
1749
1750
		//Recache the helper size
1751
		this._cacheHelperProportions();
1752
1753
		//Prepare the droppable offsets
1754
		if ($.ui.ddmanager && !o.dropBehaviour) {
1755
			$.ui.ddmanager.prepareOffsets(this, event);
1756
		}
1757
1758
		// Reset helper's right/bottom css if they're set and set explicit width/height instead
1759
		// as this prevents resizing of elements with right/bottom set (see #7772)
1760
		this._normalizeRightBottom();
1761
1762
		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
1763
1764
		//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
1765
		if ( $.ui.ddmanager ) {
1766
			$.ui.ddmanager.dragStart(this, event);
1767
		}
1768
1769
		return true;
1770
	},
1771
1772
	_refreshOffsets: function( event ) {
1773
		this.offset = {
1774
			top: this.positionAbs.top - this.margins.top,
1775
			left: this.positionAbs.left - this.margins.left,
1776
			scroll: false,
1777
			parent: this._getParentOffset(),
1778
			relative: this._getRelativeOffset()
1779
		};
1780
1781
		this.offset.click = {
1782
			left: event.pageX - this.offset.left,
1783
			top: event.pageY - this.offset.top
1784
		};
1785
	},
1786
1787
	_mouseDrag: function(event, noPropagation) {
1788
		// reset any necessary cached properties (see #5009)
1789
		if ( this.hasFixedAncestor ) {
1790
			this.offset.parent = this._getParentOffset();
1791
		}
1792
1793
		//Compute the helpers position
1794
		this.position = this._generatePosition( event, true );
1795
		this.positionAbs = this._convertPositionTo("absolute");
1796
1797
		//Call plugins and callbacks and use the resulting position if something is returned
1798
		if (!noPropagation) {
1799
			var ui = this._uiHash();
1800
			if (this._trigger("drag", event, ui) === false) {
1801
				this._mouseUp({});
1802
				return false;
1803
			}
1804
			this.position = ui.position;
1805
		}
1806
1807
		this.helper[ 0 ].style.left = this.position.left + "px";
1808
		this.helper[ 0 ].style.top = this.position.top + "px";
1809
1810
		if ($.ui.ddmanager) {
1811
			$.ui.ddmanager.drag(this, event);
1812
		}
1813
1814
		return false;
1815
	},
1816
1817
	_mouseStop: function(event) {
1818
1819
		//If we are using droppables, inform the manager about the drop
1820
		var that = this,
1821
			dropped = false;
1822
		if ($.ui.ddmanager && !this.options.dropBehaviour) {
1823
			dropped = $.ui.ddmanager.drop(this, event);
1824
		}
1825
1826
		//if a drop comes from outside (a sortable)
1827
		if (this.dropped) {
1828
			dropped = this.dropped;
1829
			this.dropped = false;
1830
		}
1831
1832
		if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
1833
			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
1834
				if (that._trigger("stop", event) !== false) {
1835
					that._clear();
1836
				}
1837
			});
1838
		} else {
1839
			if (this._trigger("stop", event) !== false) {
1840
				this._clear();
1841
			}
1842
		}
1843
1844
		return false;
1845
	},
1846
1847
	_mouseUp: function( event ) {
1848
		this._unblockFrames();
1849
1850
		//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
1851
		if ( $.ui.ddmanager ) {
1852
			$.ui.ddmanager.dragStop(this, event);
1853
		}
1854
1855
		// Only need to focus if the event occurred on the draggable itself, see #10527
1856
		if ( this.handleElement.is( event.target ) ) {
1857
			// The interaction is over; whether or not the click resulted in a drag, focus the element
1858
			this.element.focus();
1859
		}
1860
1861
		return $.ui.mouse.prototype._mouseUp.call(this, event);
1862
	},
1863
1864
	cancel: function() {
1865
1866
		if (this.helper.is(".ui-draggable-dragging")) {
1867
			this._mouseUp({});
1868
		} else {
1869
			this._clear();
1870
		}
1871
1872
		return this;
1873
1874
	},
1875
1876
	_getHandle: function(event) {
1877
		return this.options.handle ?
1878
			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
1879
			true;
1880
	},
1881
1882
	_setHandleClassName: function() {
1883
		this.handleElement = this.options.handle ?
1884
			this.element.find( this.options.handle ) : this.element;
1885
		this.handleElement.addClass( "ui-draggable-handle" );
1886
	},
1887
1888
	_removeHandleClassName: function() {
1889
		this.handleElement.removeClass( "ui-draggable-handle" );
1890
	},
1891
1892
	_createHelper: function(event) {
1893
1894
		var o = this.options,
1895
			helperIsFunction = $.isFunction( o.helper ),
1896
			helper = helperIsFunction ?
1897
				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
1898
				( o.helper === "clone" ?
1899
					this.element.clone().removeAttr( "id" ) :
1900
					this.element );
1901
1902
		if (!helper.parents("body").length) {
1903
			helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
1904
		}
1905
1906
		// http://bugs.jqueryui.com/ticket/9446
1907
		// a helper function can return the original element
1908
		// which wouldn't have been set to relative in _create
1909
		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
1910
			this._setPositionRelative();
1911
		}
1912
1913
		if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
1914
			helper.css("position", "absolute");
1915
		}
1916
1917
		return helper;
1918
1919
	},
1920
1921
	_setPositionRelative: function() {
1922
		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
1923
			this.element[ 0 ].style.position = "relative";
1924
		}
1925
	},
1926
1927
	_adjustOffsetFromHelper: function(obj) {
1928
		if (typeof obj === "string") {
1929
			obj = obj.split(" ");
1930
		}
1931
		if ($.isArray(obj)) {
1932
			obj = { left: +obj[0], top: +obj[1] || 0 };
1933
		}
1934
		if ("left" in obj) {
1935
			this.offset.click.left = obj.left + this.margins.left;
1936
		}
1937
		if ("right" in obj) {
1938
			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
1939
		}
1940
		if ("top" in obj) {
1941
			this.offset.click.top = obj.top + this.margins.top;
1942
		}
1943
		if ("bottom" in obj) {
1944
			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
1945
		}
1946
	},
1947
1948
	_isRootNode: function( element ) {
1949
		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
1950
	},
1951
1952
	_getParentOffset: function() {
1953
1954
		//Get the offsetParent and cache its position
1955
		var po = this.offsetParent.offset(),
1956
			document = this.document[ 0 ];
1957
1958
		// This is a special case where we need to modify a offset calculated on start, since the following happened:
1959
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
1960
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
1961
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
1962
		if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
1963
			po.left += this.scrollParent.scrollLeft();
1964
			po.top += this.scrollParent.scrollTop();
1965
		}
1966
1967
		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
1968
			po = { top: 0, left: 0 };
1969
		}
1970
1971
		return {
1972
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
1973
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
1974
		};
1975
1976
	},
1977
1978
	_getRelativeOffset: function() {
1979
		if ( this.cssPosition !== "relative" ) {
1980
			return { top: 0, left: 0 };
1981
		}
1982
1983
		var p = this.element.position(),
1984
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
1985
1986
		return {
1987
			top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
1988
			left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
1989
		};
1990
1991
	},
1992
1993
	_cacheMargins: function() {
1994
		this.margins = {
1995
			left: (parseInt(this.element.css("marginLeft"), 10) || 0),
1996
			top: (parseInt(this.element.css("marginTop"), 10) || 0),
1997
			right: (parseInt(this.element.css("marginRight"), 10) || 0),
1998
			bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
1999
		};
2000
	},
2001
2002
	_cacheHelperProportions: function() {
2003
		this.helperProportions = {
2004
			width: this.helper.outerWidth(),
2005
			height: this.helper.outerHeight()
2006
		};
2007
	},
2008
2009
	_setContainment: function() {
2010
2011
		var isUserScrollable, c, ce,
2012
			o = this.options,
2013
			document = this.document[ 0 ];
2014
2015
		this.relativeContainer = null;
2016
2017
		if ( !o.containment ) {
2018
			this.containment = null;
2019
			return;
2020
		}
2021
2022
		if ( o.containment === "window" ) {
2023
			this.containment = [
2024
				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
2025
				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
2026
				$( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
2027
				$( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
2028
			];
2029
			return;
2030
		}
2031
2032
		if ( o.containment === "document") {
2033
			this.containment = [
2034
				0,
2035
				0,
2036
				$( document ).width() - this.helperProportions.width - this.margins.left,
2037
				( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
2038
			];
2039
			return;
2040
		}
2041
2042
		if ( o.containment.constructor === Array ) {
2043
			this.containment = o.containment;
2044
			return;
2045
		}
2046
2047
		if ( o.containment === "parent" ) {
2048
			o.containment = this.helper[ 0 ].parentNode;
2049
		}
2050
2051
		c = $( o.containment );
2052
		ce = c[ 0 ];
2053
2054
		if ( !ce ) {
2055
			return;
2056
		}
2057
2058
		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
2059
2060
		this.containment = [
2061
			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
2062
			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
2063
			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
2064
				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
2065
				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
2066
				this.helperProportions.width -
2067
				this.margins.left -
2068
				this.margins.right,
2069
			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
2070
				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
2071
				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
2072
				this.helperProportions.height -
2073
				this.margins.top -
2074
				this.margins.bottom
2075
		];
2076
		this.relativeContainer = c;
2077
	},
2078
2079
	_convertPositionTo: function(d, pos) {
2080
2081
		if (!pos) {
2082
			pos = this.position;
2083
		}
2084
2085
		var mod = d === "absolute" ? 1 : -1,
2086
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
2087
2088
		return {
2089
			top: (
2090
				pos.top	+																// The absolute mouse position
2091
				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
2092
				this.offset.parent.top * mod -										// The offsetParent's offset without borders (offset + border)
2093
				( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
2094
			),
2095
			left: (
2096
				pos.left +																// The absolute mouse position
2097
				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
2098
				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
2099
				( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
2100
			)
2101
		};
2102
2103
	},
2104
2105
	_generatePosition: function( event, constrainPosition ) {
2106
2107
		var containment, co, top, left,
2108
			o = this.options,
2109
			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
2110
			pageX = event.pageX,
2111
			pageY = event.pageY;
2112
2113
		// Cache the scroll
2114
		if ( !scrollIsRootNode || !this.offset.scroll ) {
2115
			this.offset.scroll = {
2116
				top: this.scrollParent.scrollTop(),
2117
				left: this.scrollParent.scrollLeft()
2118
			};
2119
		}
2120
2121
		/*
2122
		 * - Position constraining -
2123
		 * Constrain the position to a mix of grid, containment.
2124
		 */
2125
2126
		// If we are not dragging yet, we won't check for options
2127
		if ( constrainPosition ) {
2128
			if ( this.containment ) {
2129
				if ( this.relativeContainer ){
2130
					co = this.relativeContainer.offset();
2131
					containment = [
2132
						this.containment[ 0 ] + co.left,
2133
						this.containment[ 1 ] + co.top,
2134
						this.containment[ 2 ] + co.left,
2135
						this.containment[ 3 ] + co.top
2136
					];
2137
				} else {
2138
					containment = this.containment;
2139
				}
2140
2141
				if (event.pageX - this.offset.click.left < containment[0]) {
2142
					pageX = containment[0] + this.offset.click.left;
2143
				}
2144
				if (event.pageY - this.offset.click.top < containment[1]) {
2145
					pageY = containment[1] + this.offset.click.top;
2146
				}
2147
				if (event.pageX - this.offset.click.left > containment[2]) {
2148
					pageX = containment[2] + this.offset.click.left;
2149
				}
2150
				if (event.pageY - this.offset.click.top > containment[3]) {
2151
					pageY = containment[3] + this.offset.click.top;
2152
				}
2153
			}
2154
2155
			if (o.grid) {
2156
				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
2157
				top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
2158
				pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
2159
2160
				left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
2161
				pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
2162
			}
2163
2164
			if ( o.axis === "y" ) {
2165
				pageX = this.originalPageX;
2166
			}
2167
2168
			if ( o.axis === "x" ) {
2169
				pageY = this.originalPageY;
2170
			}
2171
		}
2172
2173
		return {
2174
			top: (
2175
				pageY -																	// The absolute mouse position
2176
				this.offset.click.top	-												// Click offset (relative to the element)
2177
				this.offset.relative.top -												// Only for relative positioned nodes: Relative offset from element to offset parent
2178
				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
2179
				( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
2180
			),
2181
			left: (
2182
				pageX -																	// The absolute mouse position
2183
				this.offset.click.left -												// Click offset (relative to the element)
2184
				this.offset.relative.left -												// Only for relative positioned nodes: Relative offset from element to offset parent
2185
				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
2186
				( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
2187
			)
2188
		};
2189
2190
	},
2191
2192
	_clear: function() {
2193
		this.helper.removeClass("ui-draggable-dragging");
2194
		if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
2195
			this.helper.remove();
2196
		}
2197
		this.helper = null;
2198
		this.cancelHelperRemoval = false;
2199
		if ( this.destroyOnClear ) {
2200
			this.destroy();
2201
		}
2202
	},
2203
2204
	_normalizeRightBottom: function() {
2205
		if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
2206
			this.helper.width( this.helper.width() );
2207
			this.helper.css( "right", "auto" );
2208
		}
2209
		if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
2210
			this.helper.height( this.helper.height() );
2211
			this.helper.css( "bottom", "auto" );
2212
		}
2213
	},
2214
2215
	// From now on bulk stuff - mainly helpers
2216
2217
	_trigger: function( type, event, ui ) {
2218
		ui = ui || this._uiHash();
2219
		$.ui.plugin.call( this, type, [ event, ui, this ], true );
2220
2221
		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
2222
		if ( /^(drag|start|stop)/.test( type ) ) {
2223
			this.positionAbs = this._convertPositionTo( "absolute" );
2224
			ui.offset = this.positionAbs;
2225
		}
2226
		return $.Widget.prototype._trigger.call( this, type, event, ui );
2227
	},
2228
2229
	plugins: {},
2230
2231
	_uiHash: function() {
2232
		return {
2233
			helper: this.helper,
2234
			position: this.position,
2235
			originalPosition: this.originalPosition,
2236
			offset: this.positionAbs
2237
		};
2238
	}
2239
2240
});
2241
2242
$.ui.plugin.add( "draggable", "connectToSortable", {
2243
	start: function( event, ui, draggable ) {
2244
		var uiSortable = $.extend( {}, ui, {
2245
			item: draggable.element
2246
		});
2247
2248
		draggable.sortables = [];
2249
		$( draggable.options.connectToSortable ).each(function() {
2250
			var sortable = $( this ).sortable( "instance" );
2251
2252
			if ( sortable && !sortable.options.disabled ) {
2253
				draggable.sortables.push( sortable );
2254
2255
				// refreshPositions is called at drag start to refresh the containerCache
2256
				// which is used in drag. This ensures it's initialized and synchronized
2257
				// with any changes that might have happened on the page since initialization.
2258
				sortable.refreshPositions();
2259
				sortable._trigger("activate", event, uiSortable);
2260
			}
2261
		});
2262
	},
2263
	stop: function( event, ui, draggable ) {
2264
		var uiSortable = $.extend( {}, ui, {
2265
			item: draggable.element
2266
		});
2267
2268
		draggable.cancelHelperRemoval = false;
2269
2270
		$.each( draggable.sortables, function() {
2271
			var sortable = this;
2272
2273
			if ( sortable.isOver ) {
2274
				sortable.isOver = 0;
2275
2276
				// Allow this sortable to handle removing the helper
2277
				draggable.cancelHelperRemoval = true;
2278
				sortable.cancelHelperRemoval = false;
2279
2280
				// Use _storedCSS To restore properties in the sortable,
2281
				// as this also handles revert (#9675) since the draggable
2282
				// may have modified them in unexpected ways (#8809)
2283
				sortable._storedCSS = {
2284
					position: sortable.placeholder.css( "position" ),
2285
					top: sortable.placeholder.css( "top" ),
2286
					left: sortable.placeholder.css( "left" )
2287
				};
2288
2289
				sortable._mouseStop(event);
2290
2291
				// Once drag has ended, the sortable should return to using
2292
				// its original helper, not the shared helper from draggable
2293
				sortable.options.helper = sortable.options._helper;
2294
			} else {
2295
				// Prevent this Sortable from removing the helper.
2296
				// However, don't set the draggable to remove the helper
2297
				// either as another connected Sortable may yet handle the removal.
2298
				sortable.cancelHelperRemoval = true;
2299
2300
				sortable._trigger( "deactivate", event, uiSortable );
2301
			}
2302
		});
2303
	},
2304
	drag: function( event, ui, draggable ) {
2305
		$.each( draggable.sortables, function() {
2306
			var innermostIntersecting = false,
2307
				sortable = this;
2308
2309
			// Copy over variables that sortable's _intersectsWith uses
2310
			sortable.positionAbs = draggable.positionAbs;
2311
			sortable.helperProportions = draggable.helperProportions;
2312
			sortable.offset.click = draggable.offset.click;
2313
2314
			if ( sortable._intersectsWith( sortable.containerCache ) ) {
2315
				innermostIntersecting = true;
2316
2317
				$.each( draggable.sortables, function() {
2318
					// Copy over variables that sortable's _intersectsWith uses
2319
					this.positionAbs = draggable.positionAbs;
2320
					this.helperProportions = draggable.helperProportions;
2321
					this.offset.click = draggable.offset.click;
2322
2323
					if ( this !== sortable &&
2324
							this._intersectsWith( this.containerCache ) &&
2325
							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
2326
						innermostIntersecting = false;
2327
					}
2328
2329
					return innermostIntersecting;
2330
				});
2331
			}
2332
2333
			if ( innermostIntersecting ) {
2334
				// If it intersects, we use a little isOver variable and set it once,
2335
				// so that the move-in stuff gets fired only once.
2336
				if ( !sortable.isOver ) {
2337
					sortable.isOver = 1;
2338
2339
					// Store draggable's parent in case we need to reappend to it later.
2340
					draggable._parent = ui.helper.parent();
2341
2342
					sortable.currentItem = ui.helper
2343
						.appendTo( sortable.element )
2344
						.data( "ui-sortable-item", true );
2345
2346
					// Store helper option to later restore it
2347
					sortable.options._helper = sortable.options.helper;
2348
2349
					sortable.options.helper = function() {
2350
						return ui.helper[ 0 ];
2351
					};
2352
2353
					// Fire the start events of the sortable with our passed browser event,
2354
					// and our own helper (so it doesn't create a new one)
2355
					event.target = sortable.currentItem[ 0 ];
2356
					sortable._mouseCapture( event, true );
2357
					sortable._mouseStart( event, true, true );
2358
2359
					// Because the browser event is way off the new appended portlet,
2360
					// modify necessary variables to reflect the changes
2361
					sortable.offset.click.top = draggable.offset.click.top;
2362
					sortable.offset.click.left = draggable.offset.click.left;
2363
					sortable.offset.parent.left -= draggable.offset.parent.left -
2364
						sortable.offset.parent.left;
2365
					sortable.offset.parent.top -= draggable.offset.parent.top -
2366
						sortable.offset.parent.top;
2367
2368
					draggable._trigger( "toSortable", event );
2369
2370
					// Inform draggable that the helper is in a valid drop zone,
2371
					// used solely in the revert option to handle "valid/invalid".
2372
					draggable.dropped = sortable.element;
2373
2374
					// Need to refreshPositions of all sortables in the case that
2375
					// adding to one sortable changes the location of the other sortables (#9675)
2376
					$.each( draggable.sortables, function() {
2377
						this.refreshPositions();
2378
					});
2379
2380
					// hack so receive/update callbacks work (mostly)
2381
					draggable.currentItem = draggable.element;
2382
					sortable.fromOutside = draggable;
2383
				}
2384
2385
				if ( sortable.currentItem ) {
2386
					sortable._mouseDrag( event );
2387
					// Copy the sortable's position because the draggable's can potentially reflect
2388
					// a relative position, while sortable is always absolute, which the dragged
2389
					// element has now become. (#8809)
2390
					ui.position = sortable.position;
2391
				}
2392
			} else {
2393
				// If it doesn't intersect with the sortable, and it intersected before,
2394
				// we fake the drag stop of the sortable, but make sure it doesn't remove
2395
				// the helper by using cancelHelperRemoval.
2396
				if ( sortable.isOver ) {
2397
2398
					sortable.isOver = 0;
2399
					sortable.cancelHelperRemoval = true;
2400
2401
					// Calling sortable's mouseStop would trigger a revert,
2402
					// so revert must be temporarily false until after mouseStop is called.
2403
					sortable.options._revert = sortable.options.revert;
2404
					sortable.options.revert = false;
2405
2406
					sortable._trigger( "out", event, sortable._uiHash( sortable ) );
2407
					sortable._mouseStop( event, true );
2408
2409
					// restore sortable behaviors that were modfied
2410
					// when the draggable entered the sortable area (#9481)
2411
					sortable.options.revert = sortable.options._revert;
2412
					sortable.options.helper = sortable.options._helper;
2413
2414
					if ( sortable.placeholder ) {
2415
						sortable.placeholder.remove();
2416
					}
2417
2418
					// Restore and recalculate the draggable's offset considering the sortable
2419
					// may have modified them in unexpected ways. (#8809, #10669)
2420
					ui.helper.appendTo( draggable._parent );
2421
					draggable._refreshOffsets( event );
2422
					ui.position = draggable._generatePosition( event, true );
2423
2424
					draggable._trigger( "fromSortable", event );
2425
2426
					// Inform draggable that the helper is no longer in a valid drop zone
2427
					draggable.dropped = false;
2428
2429
					// Need to refreshPositions of all sortables just in case removing
2430
					// from one sortable changes the location of other sortables (#9675)
2431
					$.each( draggable.sortables, function() {
2432
						this.refreshPositions();
2433
					});
2434
				}
2435
			}
2436
		});
2437
	}
2438
});
2439
2440
$.ui.plugin.add("draggable", "cursor", {
2441
	start: function( event, ui, instance ) {
2442
		var t = $( "body" ),
2443
			o = instance.options;
2444
2445
		if (t.css("cursor")) {
2446
			o._cursor = t.css("cursor");
2447
		}
2448
		t.css("cursor", o.cursor);
2449
	},
2450
	stop: function( event, ui, instance ) {
2451
		var o = instance.options;
2452
		if (o._cursor) {
2453
			$("body").css("cursor", o._cursor);
2454
		}
2455
	}
2456
});
2457
2458
$.ui.plugin.add("draggable", "opacity", {
2459
	start: function( event, ui, instance ) {
2460
		var t = $( ui.helper ),
2461
			o = instance.options;
2462
		if (t.css("opacity")) {
2463
			o._opacity = t.css("opacity");
2464
		}
2465
		t.css("opacity", o.opacity);
2466
	},
2467
	stop: function( event, ui, instance ) {
2468
		var o = instance.options;
2469
		if (o._opacity) {
2470
			$(ui.helper).css("opacity", o._opacity);
2471
		}
2472
	}
2473
});
2474
2475
$.ui.plugin.add("draggable", "scroll", {
2476
	start: function( event, ui, i ) {
2477
		if ( !i.scrollParentNotHidden ) {
2478
			i.scrollParentNotHidden = i.helper.scrollParent( false );
2479
		}
2480
2481
		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
2482
			i.overflowOffset = i.scrollParentNotHidden.offset();
2483
		}
2484
	},
2485
	drag: function( event, ui, i  ) {
2486
2487
		var o = i.options,
2488
			scrolled = false,
2489
			scrollParent = i.scrollParentNotHidden[ 0 ],
2490
			document = i.document[ 0 ];
2491
2492
		if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
2493
			if ( !o.axis || o.axis !== "x" ) {
2494
				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
2495
					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
2496
				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
2497
					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
2498
				}
2499
			}
2500
2501
			if ( !o.axis || o.axis !== "y" ) {
2502
				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
2503
					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
2504
				} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
2505
					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
2506
				}
2507
			}
2508
2509
		} else {
2510
2511
			if (!o.axis || o.axis !== "x") {
2512
				if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
2513
					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
2514
				} else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
2515
					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
2516
				}
2517
			}
2518
2519
			if (!o.axis || o.axis !== "y") {
2520
				if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
2521
					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
2522
				} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
2523
					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
2524
				}
2525
			}
2526
2527
		}
2528
2529
		if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
2530
			$.ui.ddmanager.prepareOffsets(i, event);
2531
		}
2532
2533
	}
2534
});
2535
2536
$.ui.plugin.add("draggable", "snap", {
2537
	start: function( event, ui, i ) {
2538
2539
		var o = i.options;
2540
2541
		i.snapElements = [];
2542
2543
		$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
2544
			var $t = $(this),
2545
				$o = $t.offset();
2546
			if (this !== i.element[0]) {
2547
				i.snapElements.push({
2548
					item: this,
2549
					width: $t.outerWidth(), height: $t.outerHeight(),
2550
					top: $o.top, left: $o.left
2551
				});
2552
			}
2553
		});
2554
2555
	},
2556
	drag: function( event, ui, inst ) {
2557
2558
		var ts, bs, ls, rs, l, r, t, b, i, first,
2559
			o = inst.options,
2560
			d = o.snapTolerance,
2561
			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
2562
			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
2563
2564
		for (i = inst.snapElements.length - 1; i >= 0; i--){
2565
2566
			l = inst.snapElements[i].left - inst.margins.left;
2567
			r = l + inst.snapElements[i].width;
2568
			t = inst.snapElements[i].top - inst.margins.top;
2569
			b = t + inst.snapElements[i].height;
2570
2571
			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
2572
				if (inst.snapElements[i].snapping) {
2573
					(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
2574
				}
2575
				inst.snapElements[i].snapping = false;
2576
				continue;
2577
			}
2578
2579
			if (o.snapMode !== "inner") {
2580
				ts = Math.abs(t - y2) <= d;
2581
				bs = Math.abs(b - y1) <= d;
2582
				ls = Math.abs(l - x2) <= d;
2583
				rs = Math.abs(r - x1) <= d;
2584
				if (ts) {
2585
					ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
2586
				}
2587
				if (bs) {
2588
					ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
2589
				}
2590
				if (ls) {
2591
					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
2592
				}
2593
				if (rs) {
2594
					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
2595
				}
2596
			}
2597
2598
			first = (ts || bs || ls || rs);
2599
2600
			if (o.snapMode !== "outer") {
2601
				ts = Math.abs(t - y1) <= d;
2602
				bs = Math.abs(b - y2) <= d;
2603
				ls = Math.abs(l - x1) <= d;
2604
				rs = Math.abs(r - x2) <= d;
2605
				if (ts) {
2606
					ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
2607
				}
2608
				if (bs) {
2609
					ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
2610
				}
2611
				if (ls) {
2612
					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
2613
				}
2614
				if (rs) {
2615
					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
2616
				}
2617
			}
2618
2619
			if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
2620
				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
2621
			}
2622
			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
2623
2624
		}
2625
2626
	}
2627
});
2628
2629
$.ui.plugin.add("draggable", "stack", {
2630
	start: function( event, ui, instance ) {
2631
		var min,
2632
			o = instance.options,
2633
			group = $.makeArray($(o.stack)).sort(function(a, b) {
2634
				return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
2635
			});
2636
2637
		if (!group.length) { return; }
2638
2639
		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
2640
		$(group).each(function(i) {
2641
			$(this).css("zIndex", min + i);
2642
		});
2643
		this.css("zIndex", (min + group.length));
2644
	}
2645
});
2646
2647
$.ui.plugin.add("draggable", "zIndex", {
2648
	start: function( event, ui, instance ) {
2649
		var t = $( ui.helper ),
2650
			o = instance.options;
2651
2652
		if (t.css("zIndex")) {
2653
			o._zIndex = t.css("zIndex");
2654
		}
2655
		t.css("zIndex", o.zIndex);
2656
	},
2657
	stop: function( event, ui, instance ) {
2658
		var o = instance.options;
2659
2660
		if (o._zIndex) {
2661
			$(ui.helper).css("zIndex", o._zIndex);
2662
		}
2663
	}
2664
});
2665
2666
var draggable = $.ui.draggable;
2667
2668
2669
/*!
2670
 * jQuery UI Droppable 1.11.4
2671
 * http://jqueryui.com
2672
 *
2673
 * Copyright jQuery Foundation and other contributors
2674
 * Released under the MIT license.
2675
 * http://jquery.org/license
2676
 *
2677
 * http://api.jqueryui.com/droppable/
2678
 */
2679
2680
2681
$.widget( "ui.droppable", {
2682
	version: "1.11.4",
2683
	widgetEventPrefix: "drop",
2684
	options: {
2685
		accept: "*",
2686
		activeClass: false,
2687
		addClasses: true,
2688
		greedy: false,
2689
		hoverClass: false,
2690
		scope: "default",
2691
		tolerance: "intersect",
2692
2693
		// callbacks
2694
		activate: null,
2695
		deactivate: null,
2696
		drop: null,
2697
		out: null,
2698
		over: null
2699
	},
2700
	_create: function() {
2701
2702
		var proportions,
2703
			o = this.options,
2704
			accept = o.accept;
2705
2706
		this.isover = false;
2707
		this.isout = true;
2708
2709
		this.accept = $.isFunction( accept ) ? accept : function( d ) {
2710
			return d.is( accept );
2711
		};
2712
2713
		this.proportions = function( /* valueToWrite */ ) {
2714
			if ( arguments.length ) {
2715
				// Store the droppable's proportions
2716
				proportions = arguments[ 0 ];
2717
			} else {
2718
				// Retrieve or derive the droppable's proportions
2719
				return proportions ?
2720
					proportions :
2721
					proportions = {
2722
						width: this.element[ 0 ].offsetWidth,
2723
						height: this.element[ 0 ].offsetHeight
2724
					};
2725
			}
2726
		};
2727
2728
		this._addToManager( o.scope );
2729
2730
		o.addClasses && this.element.addClass( "ui-droppable" );
2731
2732
	},
2733
2734
	_addToManager: function( scope ) {
2735
		// Add the reference and positions to the manager
2736
		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
2737
		$.ui.ddmanager.droppables[ scope ].push( this );
2738
	},
2739
2740
	_splice: function( drop ) {
2741
		var i = 0;
2742
		for ( ; i < drop.length; i++ ) {
2743
			if ( drop[ i ] === this ) {
2744
				drop.splice( i, 1 );
2745
			}
2746
		}
2747
	},
2748
2749
	_destroy: function() {
2750
		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
2751
2752
		this._splice( drop );
2753
2754
		this.element.removeClass( "ui-droppable ui-droppable-disabled" );
2755
	},
2756
2757
	_setOption: function( key, value ) {
2758
2759
		if ( key === "accept" ) {
2760
			this.accept = $.isFunction( value ) ? value : function( d ) {
2761
				return d.is( value );
2762
			};
2763
		} else if ( key === "scope" ) {
2764
			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
2765
2766
			this._splice( drop );
2767
			this._addToManager( value );
2768
		}
2769
2770
		this._super( key, value );
2771
	},
2772
2773
	_activate: function( event ) {
2774
		var draggable = $.ui.ddmanager.current;
2775
		if ( this.options.activeClass ) {
2776
			this.element.addClass( this.options.activeClass );
2777
		}
2778
		if ( draggable ){
2779
			this._trigger( "activate", event, this.ui( draggable ) );
2780
		}
2781
	},
2782
2783
	_deactivate: function( event ) {
2784
		var draggable = $.ui.ddmanager.current;
2785
		if ( this.options.activeClass ) {
2786
			this.element.removeClass( this.options.activeClass );
2787
		}
2788
		if ( draggable ){
2789
			this._trigger( "deactivate", event, this.ui( draggable ) );
2790
		}
2791
	},
2792
2793
	_over: function( event ) {
2794
2795
		var draggable = $.ui.ddmanager.current;
2796
2797
		// Bail if draggable and droppable are same element
2798
		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2799
			return;
2800
		}
2801
2802
		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2803
			if ( this.options.hoverClass ) {
2804
				this.element.addClass( this.options.hoverClass );
2805
			}
2806
			this._trigger( "over", event, this.ui( draggable ) );
2807
		}
2808
2809
	},
2810
2811
	_out: function( event ) {
2812
2813
		var draggable = $.ui.ddmanager.current;
2814
2815
		// Bail if draggable and droppable are same element
2816
		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2817
			return;
2818
		}
2819
2820
		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2821
			if ( this.options.hoverClass ) {
2822
				this.element.removeClass( this.options.hoverClass );
2823
			}
2824
			this._trigger( "out", event, this.ui( draggable ) );
2825
		}
2826
2827
	},
2828
2829
	_drop: function( event, custom ) {
2830
2831
		var draggable = custom || $.ui.ddmanager.current,
2832
			childrenIntersection = false;
2833
2834
		// Bail if draggable and droppable are same element
2835
		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2836
			return false;
2837
		}
2838
2839
		this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
2840
			var inst = $( this ).droppable( "instance" );
2841
			if (
2842
				inst.options.greedy &&
2843
				!inst.options.disabled &&
2844
				inst.options.scope === draggable.options.scope &&
2845
				inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
2846
				$.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
2847
			) { childrenIntersection = true; return false; }
2848
		});
2849
		if ( childrenIntersection ) {
2850
			return false;
2851
		}
2852
2853
		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2854
			if ( this.options.activeClass ) {
2855
				this.element.removeClass( this.options.activeClass );
2856
			}
2857
			if ( this.options.hoverClass ) {
2858
				this.element.removeClass( this.options.hoverClass );
2859
			}
2860
			this._trigger( "drop", event, this.ui( draggable ) );
2861
			return this.element;
2862
		}
2863
2864
		return false;
2865
2866
	},
2867
2868
	ui: function( c ) {
2869
		return {
2870
			draggable: ( c.currentItem || c.element ),
2871
			helper: c.helper,
2872
			position: c.position,
2873
			offset: c.positionAbs
2874
		};
2875
	}
2876
2877
});
2878
2879
$.ui.intersect = (function() {
2880
	function isOverAxis( x, reference, size ) {
2881
		return ( x >= reference ) && ( x < ( reference + size ) );
2882
	}
2883
2884
	return function( draggable, droppable, toleranceMode, event ) {
2885
2886
		if ( !droppable.offset ) {
2887
			return false;
2888
		}
2889
2890
		var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
2891
			y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
2892
			x2 = x1 + draggable.helperProportions.width,
2893
			y2 = y1 + draggable.helperProportions.height,
2894
			l = droppable.offset.left,
2895
			t = droppable.offset.top,
2896
			r = l + droppable.proportions().width,
2897
			b = t + droppable.proportions().height;
2898
2899
		switch ( toleranceMode ) {
2900
		case "fit":
2901
			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
2902
		case "intersect":
2903
			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
2904
				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
2905
				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
2906
				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
2907
		case "pointer":
2908
			return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
2909
		case "touch":
2910
			return (
2911
				( y1 >= t && y1 <= b ) || // Top edge touching
2912
				( y2 >= t && y2 <= b ) || // Bottom edge touching
2913
				( y1 < t && y2 > b ) // Surrounded vertically
2914
			) && (
2915
				( x1 >= l && x1 <= r ) || // Left edge touching
2916
				( x2 >= l && x2 <= r ) || // Right edge touching
2917
				( x1 < l && x2 > r ) // Surrounded horizontally
2918
			);
2919
		default:
2920
			return false;
2921
		}
2922
	};
2923
})();
2924
2925
/*
2926
	This manager tracks offsets of draggables and droppables
2927
*/
2928
$.ui.ddmanager = {
2929
	current: null,
2930
	droppables: { "default": [] },
2931
	prepareOffsets: function( t, event ) {
2932
2933
		var i, j,
2934
			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
2935
			type = event ? event.type : null, // workaround for #2317
2936
			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
2937
2938
		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
2939
2940
			// No disabled and non-accepted
2941
			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
2942
				continue;
2943
			}
2944
2945
			// Filter out elements in the current dragged item
2946
			for ( j = 0; j < list.length; j++ ) {
2947
				if ( list[ j ] === m[ i ].element[ 0 ] ) {
2948
					m[ i ].proportions().height = 0;
2949
					continue droppablesLoop;
2950
				}
2951
			}
2952
2953
			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
2954
			if ( !m[ i ].visible ) {
2955
				continue;
2956
			}
2957
2958
			// Activate the droppable if used directly from draggables
2959
			if ( type === "mousedown" ) {
2960
				m[ i ]._activate.call( m[ i ], event );
2961
			}
2962
2963
			m[ i ].offset = m[ i ].element.offset();
2964
			m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
2965
2966
		}
2967
2968
	},
2969
	drop: function( draggable, event ) {
2970
2971
		var dropped = false;
2972
		// Create a copy of the droppables in case the list changes during the drop (#9116)
2973
		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
2974
2975
			if ( !this.options ) {
2976
				return;
2977
			}
2978
			if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
2979
				dropped = this._drop.call( this, event ) || dropped;
2980
			}
2981
2982
			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2983
				this.isout = true;
2984
				this.isover = false;
2985
				this._deactivate.call( this, event );
2986
			}
2987
2988
		});
2989
		return dropped;
2990
2991
	},
2992
	dragStart: function( draggable, event ) {
2993
		// Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
2994
		draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
2995
			if ( !draggable.options.refreshPositions ) {
2996
				$.ui.ddmanager.prepareOffsets( draggable, event );
2997
			}
2998
		});
2999
	},
3000
	drag: function( draggable, event ) {
3001
3002
		// If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
3003
		if ( draggable.options.refreshPositions ) {
3004
			$.ui.ddmanager.prepareOffsets( draggable, event );
3005
		}
3006
3007
		// Run through all droppables and check their positions based on specific tolerance options
3008
		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
3009
3010
			if ( this.options.disabled || this.greedyChild || !this.visible ) {
3011
				return;
3012
			}
3013
3014
			var parentInstance, scope, parent,
3015
				intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
3016
				c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
3017
			if ( !c ) {
3018
				return;
3019
			}
3020
3021
			if ( this.options.greedy ) {
3022
				// find droppable parents with same scope
3023
				scope = this.options.scope;
3024
				parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
3025
					return $( this ).droppable( "instance" ).options.scope === scope;
3026
				});
3027
3028
				if ( parent.length ) {
3029
					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
3030
					parentInstance.greedyChild = ( c === "isover" );
3031
				}
3032
			}
3033
3034
			// we just moved into a greedy child
3035
			if ( parentInstance && c === "isover" ) {
3036
				parentInstance.isover = false;
3037
				parentInstance.isout = true;
3038
				parentInstance._out.call( parentInstance, event );
3039
			}
3040
3041
			this[ c ] = true;
3042
			this[c === "isout" ? "isover" : "isout"] = false;
3043
			this[c === "isover" ? "_over" : "_out"].call( this, event );
3044
3045
			// we just moved out of a greedy child
3046
			if ( parentInstance && c === "isout" ) {
3047
				parentInstance.isout = false;
3048
				parentInstance.isover = true;
3049
				parentInstance._over.call( parentInstance, event );
3050
			}
3051
		});
3052
3053
	},
3054
	dragStop: function( draggable, event ) {
3055
		draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
3056
		// Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
3057
		if ( !draggable.options.refreshPositions ) {
3058
			$.ui.ddmanager.prepareOffsets( draggable, event );
3059
		}
3060
	}
3061
};
3062
3063
var droppable = $.ui.droppable;
3064
3065
3066
/*!
3067
 * jQuery UI Sortable 1.11.4
3068
 * http://jqueryui.com
3069
 *
3070
 * Copyright jQuery Foundation and other contributors
3071
 * Released under the MIT license.
3072
 * http://jquery.org/license
3073
 *
3074
 * http://api.jqueryui.com/sortable/
3075
 */
3076
3077
3078
var sortable = $.widget("ui.sortable", $.ui.mouse, {
3079
	version: "1.11.4",
3080
	widgetEventPrefix: "sort",
3081
	ready: false,
3082
	options: {
3083
		appendTo: "parent",
3084
		axis: false,
3085
		connectWith: false,
3086
		containment: false,
3087
		cursor: "auto",
3088
		cursorAt: false,
3089
		dropOnEmpty: true,
3090
		forcePlaceholderSize: false,
3091
		forceHelperSize: false,
3092
		grid: false,
3093
		handle: false,
3094
		helper: "original",
3095
		items: "> *",
3096
		opacity: false,
3097
		placeholder: false,
3098
		revert: false,
3099
		scroll: true,
3100
		scrollSensitivity: 20,
3101
		scrollSpeed: 20,
3102
		scope: "default",
3103
		tolerance: "intersect",
3104
		zIndex: 1000,
3105
3106
		// callbacks
3107
		activate: null,
3108
		beforeStop: null,
3109
		change: null,
3110
		deactivate: null,
3111
		out: null,
3112
		over: null,
3113
		receive: null,
3114
		remove: null,
3115
		sort: null,
3116
		start: null,
3117
		stop: null,
3118
		update: null
3119
	},
3120
3121
	_isOverAxis: function( x, reference, size ) {
3122
		return ( x >= reference ) && ( x < ( reference + size ) );
3123
	},
3124
3125
	_isFloating: function( item ) {
3126
		return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
3127
	},
3128
3129
	_create: function() {
3130
		this.containerCache = {};
3131
		this.element.addClass("ui-sortable");
3132
3133
		//Get the items
3134
		this.refresh();
3135
3136
		//Let's determine the parent's offset
3137
		this.offset = this.element.offset();
3138
3139
		//Initialize mouse events for interaction
3140
		this._mouseInit();
3141
3142
		this._setHandleClassName();
3143
3144
		//We're ready to go
3145
		this.ready = true;
3146
3147
	},
3148
3149
	_setOption: function( key, value ) {
3150
		this._super( key, value );
3151
3152
		if ( key === "handle" ) {
3153
			this._setHandleClassName();
3154
		}
3155
	},
3156
3157
	_setHandleClassName: function() {
3158
		this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
3159
		$.each( this.items, function() {
3160
			( this.instance.options.handle ?
3161
				this.item.find( this.instance.options.handle ) : this.item )
3162
				.addClass( "ui-sortable-handle" );
3163
		});
3164
	},
3165
3166
	_destroy: function() {
3167
		this.element
3168
			.removeClass( "ui-sortable ui-sortable-disabled" )
3169
			.find( ".ui-sortable-handle" )
3170
				.removeClass( "ui-sortable-handle" );
3171
		this._mouseDestroy();
3172
3173
		for ( var i = this.items.length - 1; i >= 0; i-- ) {
3174
			this.items[i].item.removeData(this.widgetName + "-item");
3175
		}
3176
3177
		return this;
3178
	},
3179
3180
	_mouseCapture: function(event, overrideHandle) {
3181
		var currentItem = null,
3182
			validHandle = false,
3183
			that = this;
3184
3185
		if (this.reverting) {
3186
			return false;
3187
		}
3188
3189
		if(this.options.disabled || this.options.type === "static") {
3190
			return false;
3191
		}
3192
3193
		//We have to refresh the items data once first
3194
		this._refreshItems(event);
3195
3196
		//Find out if the clicked node (or one of its parents) is a actual item in this.items
3197
		$(event.target).parents().each(function() {
3198
			if($.data(this, that.widgetName + "-item") === that) {
3199
				currentItem = $(this);
3200
				return false;
3201
			}
3202
		});
3203
		if($.data(event.target, that.widgetName + "-item") === that) {
3204
			currentItem = $(event.target);
3205
		}
3206
3207
		if(!currentItem) {
3208
			return false;
3209
		}
3210
		if(this.options.handle && !overrideHandle) {
3211
			$(this.options.handle, currentItem).find("*").addBack().each(function() {
3212
				if(this === event.target) {
3213
					validHandle = true;
3214
				}
3215
			});
3216
			if(!validHandle) {
3217
				return false;
3218
			}
3219
		}
3220
3221
		this.currentItem = currentItem;
3222
		this._removeCurrentsFromItems();
3223
		return true;
3224
3225
	},
3226
3227
	_mouseStart: function(event, overrideHandle, noActivation) {
3228
3229
		var i, body,
3230
			o = this.options;
3231
3232
		this.currentContainer = this;
3233
3234
		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
3235
		this.refreshPositions();
3236
3237
		//Create and append the visible helper
3238
		this.helper = this._createHelper(event);
3239
3240
		//Cache the helper size
3241
		this._cacheHelperProportions();
3242
3243
		/*
3244
		 * - Position generation -
3245
		 * This block generates everything position related - it's the core of draggables.
3246
		 */
3247
3248
		//Cache the margins of the original element
3249
		this._cacheMargins();
3250
3251
		//Get the next scrolling parent
3252
		this.scrollParent = this.helper.scrollParent();
3253
3254
		//The element's absolute position on the page minus margins
3255
		this.offset = this.currentItem.offset();
3256
		this.offset = {
3257
			top: this.offset.top - this.margins.top,
3258
			left: this.offset.left - this.margins.left
3259
		};
3260
3261
		$.extend(this.offset, {
3262
			click: { //Where the click happened, relative to the element
3263
				left: event.pageX - this.offset.left,
3264
				top: event.pageY - this.offset.top
3265
			},
3266
			parent: this._getParentOffset(),
3267
			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
3268
		});
3269
3270
		// Only after we got the offset, we can change the helper's position to absolute
3271
		// TODO: Still need to figure out a way to make relative sorting possible
3272
		this.helper.css("position", "absolute");
3273
		this.cssPosition = this.helper.css("position");
3274
3275
		//Generate the original position
3276
		this.originalPosition = this._generatePosition(event);
3277
		this.originalPageX = event.pageX;
3278
		this.originalPageY = event.pageY;
3279
3280
		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
3281
		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
3282
3283
		//Cache the former DOM position
3284
		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
3285
3286
		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
3287
		if(this.helper[0] !== this.currentItem[0]) {
3288
			this.currentItem.hide();
3289
		}
3290
3291
		//Create the placeholder
3292
		this._createPlaceholder();
3293
3294
		//Set a containment if given in the options
3295
		if(o.containment) {
3296
			this._setContainment();
3297
		}
3298
3299
		if( o.cursor && o.cursor !== "auto" ) { // cursor option
3300
			body = this.document.find( "body" );
3301
3302
			// support: IE
3303
			this.storedCursor = body.css( "cursor" );
3304
			body.css( "cursor", o.cursor );
3305
3306
			this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
3307
		}
3308
3309
		if(o.opacity) { // opacity option
3310
			if (this.helper.css("opacity")) {
3311
				this._storedOpacity = this.helper.css("opacity");
3312
			}
3313
			this.helper.css("opacity", o.opacity);
3314
		}
3315
3316
		if(o.zIndex) { // zIndex option
3317
			if (this.helper.css("zIndex")) {
3318
				this._storedZIndex = this.helper.css("zIndex");
3319
			}
3320
			this.helper.css("zIndex", o.zIndex);
3321
		}
3322
3323
		//Prepare scrolling
3324
		if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
3325
			this.overflowOffset = this.scrollParent.offset();
3326
		}
3327
3328
		//Call callbacks
3329
		this._trigger("start", event, this._uiHash());
3330
3331
		//Recache the helper size
3332
		if(!this._preserveHelperProportions) {
3333
			this._cacheHelperProportions();
3334
		}
3335
3336
3337
		//Post "activate" events to possible containers
3338
		if( !noActivation ) {
3339
			for ( i = this.containers.length - 1; i >= 0; i-- ) {
3340
				this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
3341
			}
3342
		}
3343
3344
		//Prepare possible droppables
3345
		if($.ui.ddmanager) {
3346
			$.ui.ddmanager.current = this;
3347
		}
3348
3349
		if ($.ui.ddmanager && !o.dropBehaviour) {
3350
			$.ui.ddmanager.prepareOffsets(this, event);
3351
		}
3352
3353
		this.dragging = true;
3354
3355
		this.helper.addClass("ui-sortable-helper");
3356
		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
3357
		return true;
3358
3359
	},
3360
3361
	_mouseDrag: function(event) {
3362
		var i, item, itemElement, intersection,
3363
			o = this.options,
3364
			scrolled = false;
3365
3366
		//Compute the helpers position
3367
		this.position = this._generatePosition(event);
3368
		this.positionAbs = this._convertPositionTo("absolute");
3369
3370
		if (!this.lastPositionAbs) {
3371
			this.lastPositionAbs = this.positionAbs;
3372
		}
3373
3374
		//Do scrolling
3375
		if(this.options.scroll) {
3376
			if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
3377
3378
				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
3379
					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
3380
				} else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
3381
					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
3382
				}
3383
3384
				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
3385
					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
3386
				} else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
3387
					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
3388
				}
3389
3390
			} else {
3391
3392
				if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
3393
					scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
3394
				} else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
3395
					scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
3396
				}
3397
3398
				if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
3399
					scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
3400
				} else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
3401
					scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
3402
				}
3403
3404
			}
3405
3406
			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
3407
				$.ui.ddmanager.prepareOffsets(this, event);
3408
			}
3409
		}
3410
3411
		//Regenerate the absolute position used for position checks
3412
		this.positionAbs = this._convertPositionTo("absolute");
3413
3414
		//Set the helper position
3415
		if(!this.options.axis || this.options.axis !== "y") {
3416
			this.helper[0].style.left = this.position.left+"px";
3417
		}
3418
		if(!this.options.axis || this.options.axis !== "x") {
3419
			this.helper[0].style.top = this.position.top+"px";
3420
		}
3421
3422
		//Rearrange
3423
		for (i = this.items.length - 1; i >= 0; i--) {
3424
3425
			//Cache variables and intersection, continue if no intersection
3426
			item = this.items[i];
3427
			itemElement = item.item[0];
3428
			intersection = this._intersectsWithPointer(item);
3429
			if (!intersection) {
3430
				continue;
3431
			}
3432
3433
			// Only put the placeholder inside the current Container, skip all
3434
			// items from other containers. This works because when moving
3435
			// an item from one container to another the
3436
			// currentContainer is switched before the placeholder is moved.
3437
			//
3438
			// Without this, moving items in "sub-sortables" can cause
3439
			// the placeholder to jitter between the outer and inner container.
3440
			if (item.instance !== this.currentContainer) {
3441
				continue;
3442
			}
3443
3444
			// cannot intersect with itself
3445
			// no useless actions that have been done before
3446
			// no action if the item moved is the parent of the item checked
3447
			if (itemElement !== this.currentItem[0] &&
3448
				this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
3449
				!$.contains(this.placeholder[0], itemElement) &&
3450
				(this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
3451
			) {
3452
3453
				this.direction = intersection === 1 ? "down" : "up";
3454
3455
				if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
3456
					this._rearrange(event, item);
3457
				} else {
3458
					break;
3459
				}
3460
3461
				this._trigger("change", event, this._uiHash());
3462
				break;
3463
			}
3464
		}
3465
3466
		//Post events to containers
3467
		this._contactContainers(event);
3468
3469
		//Interconnect with droppables
3470
		if($.ui.ddmanager) {
3471
			$.ui.ddmanager.drag(this, event);
3472
		}
3473
3474
		//Call callbacks
3475
		this._trigger("sort", event, this._uiHash());
3476
3477
		this.lastPositionAbs = this.positionAbs;
3478
		return false;
3479
3480
	},
3481
3482
	_mouseStop: function(event, noPropagation) {
3483
3484
		if(!event) {
3485
			return;
3486
		}
3487
3488
		//If we are using droppables, inform the manager about the drop
3489
		if ($.ui.ddmanager && !this.options.dropBehaviour) {
3490
			$.ui.ddmanager.drop(this, event);
3491
		}
3492
3493
		if(this.options.revert) {
3494
			var that = this,
3495
				cur = this.placeholder.offset(),
3496
				axis = this.options.axis,
3497
				animation = {};
3498
3499
			if ( !axis || axis === "x" ) {
3500
				animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
3501
			}
3502
			if ( !axis || axis === "y" ) {
3503
				animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
3504
			}
3505
			this.reverting = true;
3506
			$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
3507
				that._clear(event);
3508
			});
3509
		} else {
3510
			this._clear(event, noPropagation);
3511
		}
3512
3513
		return false;
3514
3515
	},
3516
3517
	cancel: function() {
3518
3519
		if(this.dragging) {
3520
3521
			this._mouseUp({ target: null });
3522
3523
			if(this.options.helper === "original") {
3524
				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
3525
			} else {
3526
				this.currentItem.show();
3527
			}
3528
3529
			//Post deactivating events to containers
3530
			for (var i = this.containers.length - 1; i >= 0; i--){
3531
				this.containers[i]._trigger("deactivate", null, this._uiHash(this));
3532
				if(this.containers[i].containerCache.over) {
3533
					this.containers[i]._trigger("out", null, this._uiHash(this));
3534
					this.containers[i].containerCache.over = 0;
3535
				}
3536
			}
3537
3538
		}
3539
3540
		if (this.placeholder) {
3541
			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
3542
			if(this.placeholder[0].parentNode) {
3543
				this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
3544
			}
3545
			if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
3546
				this.helper.remove();
3547
			}
3548
3549
			$.extend(this, {
3550
				helper: null,
3551
				dragging: false,
3552
				reverting: false,
3553
				_noFinalSort: null
3554
			});
3555
3556
			if(this.domPosition.prev) {
3557
				$(this.domPosition.prev).after(this.currentItem);
3558
			} else {
3559
				$(this.domPosition.parent).prepend(this.currentItem);
3560
			}
3561
		}
3562
3563
		return this;
3564
3565
	},
3566
3567
	serialize: function(o) {
3568
3569
		var items = this._getItemsAsjQuery(o && o.connected),
3570
			str = [];
3571
		o = o || {};
3572
3573
		$(items).each(function() {
3574
			var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
3575
			if (res) {
3576
				str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
3577
			}
3578
		});
3579
3580
		if(!str.length && o.key) {
3581
			str.push(o.key + "=");
3582
		}
3583
3584
		return str.join("&");
3585
3586
	},
3587
3588
	toArray: function(o) {
3589
3590
		var items = this._getItemsAsjQuery(o && o.connected),
3591
			ret = [];
3592
3593
		o = o || {};
3594
3595
		items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
3596
		return ret;
3597
3598
	},
3599
3600
	/* Be careful with the following core functions */
3601
	_intersectsWith: function(item) {
3602
3603
		var x1 = this.positionAbs.left,
3604
			x2 = x1 + this.helperProportions.width,
3605
			y1 = this.positionAbs.top,
3606
			y2 = y1 + this.helperProportions.height,
3607
			l = item.left,
3608
			r = l + item.width,
3609
			t = item.top,
3610
			b = t + item.height,
3611
			dyClick = this.offset.click.top,
3612
			dxClick = this.offset.click.left,
3613
			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
3614
			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
3615
			isOverElement = isOverElementHeight && isOverElementWidth;
3616
3617
		if ( this.options.tolerance === "pointer" ||
3618
			this.options.forcePointerForContainers ||
3619
			(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
3620
		) {
3621
			return isOverElement;
3622
		} else {
3623
3624
			return (l < x1 + (this.helperProportions.width / 2) && // Right Half
3625
				x2 - (this.helperProportions.width / 2) < r && // Left Half
3626
				t < y1 + (this.helperProportions.height / 2) && // Bottom Half
3627
				y2 - (this.helperProportions.height / 2) < b ); // Top Half
3628
3629
		}
3630
	},
3631
3632
	_intersectsWithPointer: function(item) {
3633
3634
		var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
3635
			isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
3636
			isOverElement = isOverElementHeight && isOverElementWidth,
3637
			verticalDirection = this._getDragVerticalDirection(),
3638
			horizontalDirection = this._getDragHorizontalDirection();
3639
3640
		if (!isOverElement) {
3641
			return false;
3642
		}
3643
3644
		return this.floating ?
3645
			( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
3646
			: ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
3647
3648
	},
3649
3650
	_intersectsWithSides: function(item) {
3651
3652
		var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
3653
			isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
3654
			verticalDirection = this._getDragVerticalDirection(),
3655
			horizontalDirection = this._getDragHorizontalDirection();
3656
3657
		if (this.floating && horizontalDirection) {
3658
			return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
3659
		} else {
3660
			return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
3661
		}
3662
3663
	},
3664
3665
	_getDragVerticalDirection: function() {
3666
		var delta = this.positionAbs.top - this.lastPositionAbs.top;
3667
		return delta !== 0 && (delta > 0 ? "down" : "up");
3668
	},
3669
3670
	_getDragHorizontalDirection: function() {
3671
		var delta = this.positionAbs.left - this.lastPositionAbs.left;
3672
		return delta !== 0 && (delta > 0 ? "right" : "left");
3673
	},
3674
3675
	refresh: function(event) {
3676
		this._refreshItems(event);
3677
		this._setHandleClassName();
3678
		this.refreshPositions();
3679
		return this;
3680
	},
3681
3682
	_connectWith: function() {
3683
		var options = this.options;
3684
		return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
3685
	},
3686
3687
	_getItemsAsjQuery: function(connected) {
3688
3689
		var i, j, cur, inst,
3690
			items = [],
3691
			queries = [],
3692
			connectWith = this._connectWith();
3693
3694
		if(connectWith && connected) {
3695
			for (i = connectWith.length - 1; i >= 0; i--){
3696
				cur = $(connectWith[i], this.document[0]);
3697
				for ( j = cur.length - 1; j >= 0; j--){
3698
					inst = $.data(cur[j], this.widgetFullName);
3699
					if(inst && inst !== this && !inst.options.disabled) {
3700
						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
3701
					}
3702
				}
3703
			}
3704
		}
3705
3706
		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
3707
3708
		function addItems() {
3709
			items.push( this );
3710
		}
3711
		for (i = queries.length - 1; i >= 0; i--){
3712
			queries[i][0].each( addItems );
3713
		}
3714
3715
		return $(items);
3716
3717
	},
3718
3719
	_removeCurrentsFromItems: function() {
3720
3721
		var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
3722
3723
		this.items = $.grep(this.items, function (item) {
3724
			for (var j=0; j < list.length; j++) {
3725
				if(list[j] === item.item[0]) {
3726
					return false;
3727
				}
3728
			}
3729
			return true;
3730
		});
3731
3732
	},
3733
3734
	_refreshItems: function(event) {
3735
3736
		this.items = [];
3737
		this.containers = [this];
3738
3739
		var i, j, cur, inst, targetData, _queries, item, queriesLength,
3740
			items = this.items,
3741
			queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
3742
			connectWith = this._connectWith();
3743
3744
		if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
3745
			for (i = connectWith.length - 1; i >= 0; i--){
3746
				cur = $(connectWith[i], this.document[0]);
3747
				for (j = cur.length - 1; j >= 0; j--){
3748
					inst = $.data(cur[j], this.widgetFullName);
3749
					if(inst && inst !== this && !inst.options.disabled) {
3750
						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
3751
						this.containers.push(inst);
3752
					}
3753
				}
3754
			}
3755
		}
3756
3757
		for (i = queries.length - 1; i >= 0; i--) {
3758
			targetData = queries[i][1];
3759
			_queries = queries[i][0];
3760
3761
			for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
3762
				item = $(_queries[j]);
3763
3764
				item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
3765
3766
				items.push({
3767
					item: item,
3768
					instance: targetData,
3769
					width: 0, height: 0,
3770
					left: 0, top: 0
3771
				});
3772
			}
3773
		}
3774
3775
	},
3776
3777
	refreshPositions: function(fast) {
3778
3779
		// Determine whether items are being displayed horizontally
3780
		this.floating = this.items.length ?
3781
			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
3782
			false;
3783
3784
		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
3785
		if(this.offsetParent && this.helper) {
3786
			this.offset.parent = this._getParentOffset();
3787
		}
3788
3789
		var i, item, t, p;
3790
3791
		for (i = this.items.length - 1; i >= 0; i--){
3792
			item = this.items[i];
3793
3794
			//We ignore calculating positions of all connected containers when we're not over them
3795
			if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
3796
				continue;
3797
			}
3798
3799
			t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
3800
3801
			if (!fast) {
3802
				item.width = t.outerWidth();
3803
				item.height = t.outerHeight();
3804
			}
3805
3806
			p = t.offset();
3807
			item.left = p.left;
3808
			item.top = p.top;
3809
		}
3810
3811
		if(this.options.custom && this.options.custom.refreshContainers) {
3812
			this.options.custom.refreshContainers.call(this);
3813
		} else {
3814
			for (i = this.containers.length - 1; i >= 0; i--){
3815
				p = this.containers[i].element.offset();
3816
				this.containers[i].containerCache.left = p.left;
3817
				this.containers[i].containerCache.top = p.top;
3818
				this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
3819
				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
3820
			}
3821
		}
3822
3823
		return this;
3824
	},
3825
3826
	_createPlaceholder: function(that) {
3827
		that = that || this;
3828
		var className,
3829
			o = that.options;
3830
3831
		if(!o.placeholder || o.placeholder.constructor === String) {
3832
			className = o.placeholder;
3833
			o.placeholder = {
3834
				element: function() {
3835
3836
					var nodeName = that.currentItem[0].nodeName.toLowerCase(),
3837
						element = $( "<" + nodeName + ">", that.document[0] )
3838
							.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
3839
							.removeClass("ui-sortable-helper");
3840
3841
					if ( nodeName === "tbody" ) {
3842
						that._createTrPlaceholder(
3843
							that.currentItem.find( "tr" ).eq( 0 ),
3844
							$( "<tr>", that.document[ 0 ] ).appendTo( element )
3845
						);
3846
					} else if ( nodeName === "tr" ) {
3847
						that._createTrPlaceholder( that.currentItem, element );
3848
					} else if ( nodeName === "img" ) {
3849
						element.attr( "src", that.currentItem.attr( "src" ) );
3850
					}
3851
3852
					if ( !className ) {
3853
						element.css( "visibility", "hidden" );
3854
					}
3855
3856
					return element;
3857
				},
3858
				update: function(container, p) {
3859
3860
					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
3861
					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
3862
					if(className && !o.forcePlaceholderSize) {
3863
						return;
3864
					}
3865
3866
					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
3867
					if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
3868
					if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
3869
				}
3870
			};
3871
		}
3872
3873
		//Create the placeholder
3874
		that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
3875
3876
		//Append it after the actual current item
3877
		that.currentItem.after(that.placeholder);
3878
3879
		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
3880
		o.placeholder.update(that, that.placeholder);
3881
3882
	},
3883
3884
	_createTrPlaceholder: function( sourceTr, targetTr ) {
3885
		var that = this;
3886
3887
		sourceTr.children().each(function() {
3888
			$( "<td>&#160;</td>", that.document[ 0 ] )
3889
				.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
3890
				.appendTo( targetTr );
3891
		});
3892
	},
3893
3894
	_contactContainers: function(event) {
3895
		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
3896
			innermostContainer = null,
3897
			innermostIndex = null;
3898
3899
		// get innermost container that intersects with item
3900
		for (i = this.containers.length - 1; i >= 0; i--) {
3901
3902
			// never consider a container that's located within the item itself
3903
			if($.contains(this.currentItem[0], this.containers[i].element[0])) {
3904
				continue;
3905
			}
3906
3907
			if(this._intersectsWith(this.containers[i].containerCache)) {
3908
3909
				// if we've already found a container and it's more "inner" than this, then continue
3910
				if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
3911
					continue;
3912
				}
3913
3914
				innermostContainer = this.containers[i];
3915
				innermostIndex = i;
3916
3917
			} else {
3918
				// container doesn't intersect. trigger "out" event if necessary
3919
				if(this.containers[i].containerCache.over) {
3920
					this.containers[i]._trigger("out", event, this._uiHash(this));
3921
					this.containers[i].containerCache.over = 0;
3922
				}
3923
			}
3924
3925
		}
3926
3927
		// if no intersecting containers found, return
3928
		if(!innermostContainer) {
3929
			return;
3930
		}
3931
3932
		// move the item into the container if it's not there already
3933
		if(this.containers.length === 1) {
3934
			if (!this.containers[innermostIndex].containerCache.over) {
3935
				this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
3936
				this.containers[innermostIndex].containerCache.over = 1;
3937
			}
3938
		} else {
3939
3940
			//When entering a new container, we will find the item with the least distance and append our item near it
3941
			dist = 10000;
3942
			itemWithLeastDistance = null;
3943
			floating = innermostContainer.floating || this._isFloating(this.currentItem);
3944
			posProperty = floating ? "left" : "top";
3945
			sizeProperty = floating ? "width" : "height";
3946
			axis = floating ? "clientX" : "clientY";
3947
3948
			for (j = this.items.length - 1; j >= 0; j--) {
3949
				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
3950
					continue;
3951
				}
3952
				if(this.items[j].item[0] === this.currentItem[0]) {
3953
					continue;
3954
				}
3955
3956
				cur = this.items[j].item.offset()[posProperty];
3957
				nearBottom = false;
3958
				if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
3959
					nearBottom = true;
3960
				}
3961
3962
				if ( Math.abs( event[ axis ] - cur ) < dist ) {
3963
					dist = Math.abs( event[ axis ] - cur );
3964
					itemWithLeastDistance = this.items[ j ];
3965
					this.direction = nearBottom ? "up": "down";
3966
				}
3967
			}
3968
3969
			//Check if dropOnEmpty is enabled
3970
			if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
3971
				return;
3972
			}
3973
3974
			if(this.currentContainer === this.containers[innermostIndex]) {
3975
				if ( !this.currentContainer.containerCache.over ) {
3976
					this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
3977
					this.currentContainer.containerCache.over = 1;
3978
				}
3979
				return;
3980
			}
3981
3982
			itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
3983
			this._trigger("change", event, this._uiHash());
3984
			this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
3985
			this.currentContainer = this.containers[innermostIndex];
3986
3987
			//Update the placeholder
3988
			this.options.placeholder.update(this.currentContainer, this.placeholder);
3989
3990
			this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
3991
			this.containers[innermostIndex].containerCache.over = 1;
3992
		}
3993
3994
3995
	},
3996
3997
	_createHelper: function(event) {
3998
3999
		var o = this.options,
4000
			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
4001
4002
		//Add the helper to the DOM if that didn't happen already
4003
		if(!helper.parents("body").length) {
4004
			$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
4005
		}
4006
4007
		if(helper[0] === this.currentItem[0]) {
4008
			this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
4009
		}
4010
4011
		if(!helper[0].style.width || o.forceHelperSize) {
4012
			helper.width(this.currentItem.width());
4013
		}
4014
		if(!helper[0].style.height || o.forceHelperSize) {
4015
			helper.height(this.currentItem.height());
4016
		}
4017
4018
		return helper;
4019
4020
	},
4021
4022
	_adjustOffsetFromHelper: function(obj) {
4023
		if (typeof obj === "string") {
4024
			obj = obj.split(" ");
4025
		}
4026
		if ($.isArray(obj)) {
4027
			obj = {left: +obj[0], top: +obj[1] || 0};
4028
		}
4029
		if ("left" in obj) {
4030
			this.offset.click.left = obj.left + this.margins.left;
4031
		}
4032
		if ("right" in obj) {
4033
			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
4034
		}
4035
		if ("top" in obj) {
4036
			this.offset.click.top = obj.top + this.margins.top;
4037
		}
4038
		if ("bottom" in obj) {
4039
			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
4040
		}
4041
	},
4042
4043
	_getParentOffset: function() {
4044
4045
4046
		//Get the offsetParent and cache its position
4047
		this.offsetParent = this.helper.offsetParent();
4048
		var po = this.offsetParent.offset();
4049
4050
		// This is a special case where we need to modify a offset calculated on start, since the following happened:
4051
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
4052
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
4053
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
4054
		if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
4055
			po.left += this.scrollParent.scrollLeft();
4056
			po.top += this.scrollParent.scrollTop();
4057
		}
4058
4059
		// This needs to be actually done for all browsers, since pageX/pageY includes this information
4060
		// with an ugly IE fix
4061
		if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
4062
			po = { top: 0, left: 0 };
4063
		}
4064
4065
		return {
4066
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
4067
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
4068
		};
4069
4070
	},
4071
4072
	_getRelativeOffset: function() {
4073
4074
		if(this.cssPosition === "relative") {
4075
			var p = this.currentItem.position();
4076
			return {
4077
				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
4078
				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
4079
			};
4080
		} else {
4081
			return { top: 0, left: 0 };
4082
		}
4083
4084
	},
4085
4086
	_cacheMargins: function() {
4087
		this.margins = {
4088
			left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
4089
			top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
4090
		};
4091
	},
4092
4093
	_cacheHelperProportions: function() {
4094
		this.helperProportions = {
4095
			width: this.helper.outerWidth(),
4096
			height: this.helper.outerHeight()
4097
		};
4098
	},
4099
4100
	_setContainment: function() {
4101
4102
		var ce, co, over,
4103
			o = this.options;
4104
		if(o.containment === "parent") {
4105
			o.containment = this.helper[0].parentNode;
4106
		}
4107
		if(o.containment === "document" || o.containment === "window") {
4108
			this.containment = [
4109
				0 - this.offset.relative.left - this.offset.parent.left,
4110
				0 - this.offset.relative.top - this.offset.parent.top,
4111
				o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
4112
				(o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
4113
			];
4114
		}
4115
4116
		if(!(/^(document|window|parent)$/).test(o.containment)) {
4117
			ce = $(o.containment)[0];
4118
			co = $(o.containment).offset();
4119
			over = ($(ce).css("overflow") !== "hidden");
4120
4121
			this.containment = [
4122
				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
4123
				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
4124
				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
4125
				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
4126
			];
4127
		}
4128
4129
	},
4130
4131
	_convertPositionTo: function(d, pos) {
4132
4133
		if(!pos) {
4134
			pos = this.position;
4135
		}
4136
		var mod = d === "absolute" ? 1 : -1,
4137
			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
4138
			scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
4139
4140
		return {
4141
			top: (
4142
				pos.top	+																// The absolute mouse position
4143
				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
4144
				this.offset.parent.top * mod -											// The offsetParent's offset without borders (offset + border)
4145
				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
4146
			),
4147
			left: (
4148
				pos.left +																// The absolute mouse position
4149
				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
4150
				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
4151
				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
4152
			)
4153
		};
4154
4155
	},
4156
4157
	_generatePosition: function(event) {
4158
4159
		var top, left,
4160
			o = this.options,
4161
			pageX = event.pageX,
4162
			pageY = event.pageY,
4163
			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
4164
4165
		// This is another very weird special case that only happens for relative elements:
4166
		// 1. If the css position is relative
4167
		// 2. and the scroll parent is the document or similar to the offset parent
4168
		// we have to refresh the relative offset during the scroll so there are no jumps
4169
		if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
4170
			this.offset.relative = this._getRelativeOffset();
4171
		}
4172
4173
		/*
4174
		 * - Position constraining -
4175
		 * Constrain the position to a mix of grid, containment.
4176
		 */
4177
4178
		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
4179
4180
			if(this.containment) {
4181
				if(event.pageX - this.offset.click.left < this.containment[0]) {
4182
					pageX = this.containment[0] + this.offset.click.left;
4183
				}
4184
				if(event.pageY - this.offset.click.top < this.containment[1]) {
4185
					pageY = this.containment[1] + this.offset.click.top;
4186
				}
4187
				if(event.pageX - this.offset.click.left > this.containment[2]) {
4188
					pageX = this.containment[2] + this.offset.click.left;
4189
				}
4190
				if(event.pageY - this.offset.click.top > this.containment[3]) {
4191
					pageY = this.containment[3] + this.offset.click.top;
4192
				}
4193
			}
4194
4195
			if(o.grid) {
4196
				top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
4197
				pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
4198
4199
				left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
4200
				pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
4201
			}
4202
4203
		}
4204
4205
		return {
4206
			top: (
4207
				pageY -																// The absolute mouse position
4208
				this.offset.click.top -													// Click offset (relative to the element)
4209
				this.offset.relative.top	-											// Only for relative positioned nodes: Relative offset from element to offset parent
4210
				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
4211
				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
4212
			),
4213
			left: (
4214
				pageX -																// The absolute mouse position
4215
				this.offset.click.left -												// Click offset (relative to the element)
4216
				this.offset.relative.left	-											// Only for relative positioned nodes: Relative offset from element to offset parent
4217
				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
4218
				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
4219
			)
4220
		};
4221
4222
	},
4223
4224
	_rearrange: function(event, i, a, hardRefresh) {
4225
4226
		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
4227
4228
		//Various things done here to improve the performance:
4229
		// 1. we create a setTimeout, that calls refreshPositions
4230
		// 2. on the instance, we have a counter variable, that get's higher after every append
4231
		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
4232
		// 4. this lets only the last addition to the timeout stack through
4233
		this.counter = this.counter ? ++this.counter : 1;
4234
		var counter = this.counter;
4235
4236
		this._delay(function() {
4237
			if(counter === this.counter) {
4238
				this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
4239
			}
4240
		});
4241
4242
	},
4243
4244
	_clear: function(event, noPropagation) {
4245
4246
		this.reverting = false;
4247
		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
4248
		// everything else normalized again
4249
		var i,
4250
			delayedTriggers = [];
4251
4252
		// We first have to update the dom position of the actual currentItem
4253
		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
4254
		if(!this._noFinalSort && this.currentItem.parent().length) {
4255
			this.placeholder.before(this.currentItem);
4256
		}
4257
		this._noFinalSort = null;
4258
4259
		if(this.helper[0] === this.currentItem[0]) {
4260
			for(i in this._storedCSS) {
4261
				if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
4262
					this._storedCSS[i] = "";
4263
				}
4264
			}
4265
			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
4266
		} else {
4267
			this.currentItem.show();
4268
		}
4269
4270
		if(this.fromOutside && !noPropagation) {
4271
			delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
4272
		}
4273
		if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
4274
			delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
4275
		}
4276
4277
		// Check if the items Container has Changed and trigger appropriate
4278
		// events.
4279
		if (this !== this.currentContainer) {
4280
			if(!noPropagation) {
4281
				delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
4282
				delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
4283
				delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
4284
			}
4285
		}
4286
4287
4288
		//Post events to containers
4289
		function delayEvent( type, instance, container ) {
4290
			return function( event ) {
4291
				container._trigger( type, event, instance._uiHash( instance ) );
4292
			};
4293
		}
4294
		for (i = this.containers.length - 1; i >= 0; i--){
4295
			if (!noPropagation) {
4296
				delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
4297
			}
4298
			if(this.containers[i].containerCache.over) {
4299
				delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
4300
				this.containers[i].containerCache.over = 0;
4301
			}
4302
		}
4303
4304
		//Do what was originally in plugins
4305
		if ( this.storedCursor ) {
4306
			this.document.find( "body" ).css( "cursor", this.storedCursor );
4307
			this.storedStylesheet.remove();
4308
		}
4309
		if(this._storedOpacity) {
4310
			this.helper.css("opacity", this._storedOpacity);
4311
		}
4312
		if(this._storedZIndex) {
4313
			this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
4314
		}
4315
4316
		this.dragging = false;
4317
4318
		if(!noPropagation) {
4319
			this._trigger("beforeStop", event, this._uiHash());
4320
		}
4321
4322
		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
4323
		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
4324
4325
		if ( !this.cancelHelperRemoval ) {
4326
			if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
4327
				this.helper.remove();
4328
			}
4329
			this.helper = null;
4330
		}
4331
4332
		if(!noPropagation) {
4333
			for (i=0; i < delayedTriggers.length; i++) {
4334
				delayedTriggers[i].call(this, event);
4335
			} //Trigger all delayed events
4336
			this._trigger("stop", event, this._uiHash());
4337
		}
4338
4339
		this.fromOutside = false;
4340
		return !this.cancelHelperRemoval;
4341
4342
	},
4343
4344
	_trigger: function() {
4345
		if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
4346
			this.cancel();
4347
		}
4348
	},
4349
4350
	_uiHash: function(_inst) {
4351
		var inst = _inst || this;
4352
		return {
4353
			helper: inst.helper,
4354
			placeholder: inst.placeholder || $([]),
4355
			position: inst.position,
4356
			originalPosition: inst.originalPosition,
4357
			offset: inst.positionAbs,
4358
			item: inst.currentItem,
4359
			sender: _inst ? _inst.element : null
4360
		};
4361
	}
4362
4363
});
4364
4365
4366
/*!
4367
 * jQuery UI Accordion 1.11.4
4368
 * http://jqueryui.com
4369
 *
4370
 * Copyright jQuery Foundation and other contributors
4371
 * Released under the MIT license.
4372
 * http://jquery.org/license
4373
 *
4374
 * http://api.jqueryui.com/accordion/
4375
 */
4376
4377
4378
var accordion = $.widget( "ui.accordion", {
4379
	version: "1.11.4",
4380
	options: {
4381
		active: 0,
4382
		animate: {},
4383
		collapsible: false,
4384
		event: "click",
4385
		header: "> li > :first-child,> :not(li):even",
4386
		heightStyle: "auto",
4387
		icons: {
4388
			activeHeader: "ui-icon-triangle-1-s",
4389
			header: "ui-icon-triangle-1-e"
4390
		},
4391
4392
		// callbacks
4393
		activate: null,
4394
		beforeActivate: null
4395
	},
4396
4397
	hideProps: {
4398
		borderTopWidth: "hide",
4399
		borderBottomWidth: "hide",
4400
		paddingTop: "hide",
4401
		paddingBottom: "hide",
4402
		height: "hide"
4403
	},
4404
4405
	showProps: {
4406
		borderTopWidth: "show",
4407
		borderBottomWidth: "show",
4408
		paddingTop: "show",
4409
		paddingBottom: "show",
4410
		height: "show"
4411
	},
4412
4413
	_create: function() {
4414
		var options = this.options;
4415
		this.prevShow = this.prevHide = $();
4416
		this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
4417
			// ARIA
4418
			.attr( "role", "tablist" );
4419
4420
		// don't allow collapsible: false and active: false / null
4421
		if ( !options.collapsible && (options.active === false || options.active == null) ) {
4422
			options.active = 0;
4423
		}
4424
4425
		this._processPanels();
4426
		// handle negative values
4427
		if ( options.active < 0 ) {
4428
			options.active += this.headers.length;
4429
		}
4430
		this._refresh();
4431
	},
4432
4433
	_getCreateEventData: function() {
4434
		return {
4435
			header: this.active,
4436
			panel: !this.active.length ? $() : this.active.next()
4437
		};
4438
	},
4439
4440
	_createIcons: function() {
4441
		var icons = this.options.icons;
4442
		if ( icons ) {
4443
			$( "<span>" )
4444
				.addClass( "ui-accordion-header-icon ui-icon " + icons.header )
4445
				.prependTo( this.headers );
4446
			this.active.children( ".ui-accordion-header-icon" )
4447
				.removeClass( icons.header )
4448
				.addClass( icons.activeHeader );
4449
			this.headers.addClass( "ui-accordion-icons" );
4450
		}
4451
	},
4452
4453
	_destroyIcons: function() {
4454
		this.headers
4455
			.removeClass( "ui-accordion-icons" )
4456
			.children( ".ui-accordion-header-icon" )
4457
				.remove();
4458
	},
4459
4460
	_destroy: function() {
4461
		var contents;
4462
4463
		// clean up main element
4464
		this.element
4465
			.removeClass( "ui-accordion ui-widget ui-helper-reset" )
4466
			.removeAttr( "role" );
4467
4468
		// clean up headers
4469
		this.headers
4470
			.removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
4471
				"ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
4472
			.removeAttr( "role" )
4473
			.removeAttr( "aria-expanded" )
4474
			.removeAttr( "aria-selected" )
4475
			.removeAttr( "aria-controls" )
4476
			.removeAttr( "tabIndex" )
4477
			.removeUniqueId();
4478
4479
		this._destroyIcons();
4480
4481
		// clean up content panels
4482
		contents = this.headers.next()
4483
			.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
4484
				"ui-accordion-content ui-accordion-content-active ui-state-disabled" )
4485
			.css( "display", "" )
4486
			.removeAttr( "role" )
4487
			.removeAttr( "aria-hidden" )
4488
			.removeAttr( "aria-labelledby" )
4489
			.removeUniqueId();
4490
4491
		if ( this.options.heightStyle !== "content" ) {
4492
			contents.css( "height", "" );
4493
		}
4494
	},
4495
4496
	_setOption: function( key, value ) {
4497
		if ( key === "active" ) {
4498
			// _activate() will handle invalid values and update this.options
4499
			this._activate( value );
4500
			return;
4501
		}
4502
4503
		if ( key === "event" ) {
4504
			if ( this.options.event ) {
4505
				this._off( this.headers, this.options.event );
4506
			}
4507
			this._setupEvents( value );
4508
		}
4509
4510
		this._super( key, value );
4511
4512
		// setting collapsible: false while collapsed; open first panel
4513
		if ( key === "collapsible" && !value && this.options.active === false ) {
4514
			this._activate( 0 );
4515
		}
4516
4517
		if ( key === "icons" ) {
4518
			this._destroyIcons();
4519
			if ( value ) {
4520
				this._createIcons();
4521
			}
4522
		}
4523
4524
		// #5332 - opacity doesn't cascade to positioned elements in IE
4525
		// so we need to add the disabled class to the headers and panels
4526
		if ( key === "disabled" ) {
4527
			this.element
4528
				.toggleClass( "ui-state-disabled", !!value )
4529
				.attr( "aria-disabled", value );
4530
			this.headers.add( this.headers.next() )
4531
				.toggleClass( "ui-state-disabled", !!value );
4532
		}
4533
	},
4534
4535
	_keydown: function( event ) {
4536
		if ( event.altKey || event.ctrlKey ) {
4537
			return;
4538
		}
4539
4540
		var keyCode = $.ui.keyCode,
4541
			length = this.headers.length,
4542
			currentIndex = this.headers.index( event.target ),
4543
			toFocus = false;
4544
4545
		switch ( event.keyCode ) {
4546
			case keyCode.RIGHT:
4547
			case keyCode.DOWN:
4548
				toFocus = this.headers[ ( currentIndex + 1 ) % length ];
4549
				break;
4550
			case keyCode.LEFT:
4551
			case keyCode.UP:
4552
				toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
4553
				break;
4554
			case keyCode.SPACE:
4555
			case keyCode.ENTER:
4556
				this._eventHandler( event );
4557
				break;
4558
			case keyCode.HOME:
4559
				toFocus = this.headers[ 0 ];
4560
				break;
4561
			case keyCode.END:
4562
				toFocus = this.headers[ length - 1 ];
4563
				break;
4564
		}
4565
4566
		if ( toFocus ) {
4567
			$( event.target ).attr( "tabIndex", -1 );
4568
			$( toFocus ).attr( "tabIndex", 0 );
4569
			toFocus.focus();
4570
			event.preventDefault();
4571
		}
4572
	},
4573
4574
	_panelKeyDown: function( event ) {
4575
		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
4576
			$( event.currentTarget ).prev().focus();
4577
		}
4578
	},
4579
4580
	refresh: function() {
4581
		var options = this.options;
4582
		this._processPanels();
4583
4584
		// was collapsed or no panel
4585
		if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
4586
			options.active = false;
4587
			this.active = $();
4588
		// active false only when collapsible is true
4589
		} else if ( options.active === false ) {
4590
			this._activate( 0 );
4591
		// was active, but active panel is gone
4592
		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
4593
			// all remaining panel are disabled
4594
			if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
4595
				options.active = false;
4596
				this.active = $();
4597
			// activate previous panel
4598
			} else {
4599
				this._activate( Math.max( 0, options.active - 1 ) );
4600
			}
4601
		// was active, active panel still exists
4602
		} else {
4603
			// make sure active index is correct
4604
			options.active = this.headers.index( this.active );
4605
		}
4606
4607
		this._destroyIcons();
4608
4609
		this._refresh();
4610
	},
4611
4612
	_processPanels: function() {
4613
		var prevHeaders = this.headers,
4614
			prevPanels = this.panels;
4615
4616
		this.headers = this.element.find( this.options.header )
4617
			.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
4618
4619
		this.panels = this.headers.next()
4620
			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
4621
			.filter( ":not(.ui-accordion-content-active)" )
4622
			.hide();
4623
4624
		// Avoid memory leaks (#10056)
4625
		if ( prevPanels ) {
4626
			this._off( prevHeaders.not( this.headers ) );
4627
			this._off( prevPanels.not( this.panels ) );
4628
		}
4629
	},
4630
4631
	_refresh: function() {
4632
		var maxHeight,
4633
			options = this.options,
4634
			heightStyle = options.heightStyle,
4635
			parent = this.element.parent();
4636
4637
		this.active = this._findActive( options.active )
4638
			.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
4639
			.removeClass( "ui-corner-all" );
4640
		this.active.next()
4641
			.addClass( "ui-accordion-content-active" )
4642
			.show();
4643
4644
		this.headers
4645
			.attr( "role", "tab" )
4646
			.each(function() {
4647
				var header = $( this ),
4648
					headerId = header.uniqueId().attr( "id" ),
4649
					panel = header.next(),
4650
					panelId = panel.uniqueId().attr( "id" );
4651
				header.attr( "aria-controls", panelId );
4652
				panel.attr( "aria-labelledby", headerId );
4653
			})
4654
			.next()
4655
				.attr( "role", "tabpanel" );
4656
4657
		this.headers
4658
			.not( this.active )
4659
			.attr({
4660
				"aria-selected": "false",
4661
				"aria-expanded": "false",
4662
				tabIndex: -1
4663
			})
4664
			.next()
4665
				.attr({
4666
					"aria-hidden": "true"
4667
				})
4668
				.hide();
4669
4670
		// make sure at least one header is in the tab order
4671
		if ( !this.active.length ) {
4672
			this.headers.eq( 0 ).attr( "tabIndex", 0 );
4673
		} else {
4674
			this.active.attr({
4675
				"aria-selected": "true",
4676
				"aria-expanded": "true",
4677
				tabIndex: 0
4678
			})
4679
			.next()
4680
				.attr({
4681
					"aria-hidden": "false"
4682
				});
4683
		}
4684
4685
		this._createIcons();
4686
4687
		this._setupEvents( options.event );
4688
4689
		if ( heightStyle === "fill" ) {
4690
			maxHeight = parent.height();
4691
			this.element.siblings( ":visible" ).each(function() {
4692
				var elem = $( this ),
4693
					position = elem.css( "position" );
4694
4695
				if ( position === "absolute" || position === "fixed" ) {
4696
					return;
4697
				}
4698
				maxHeight -= elem.outerHeight( true );
4699
			});
4700
4701
			this.headers.each(function() {
4702
				maxHeight -= $( this ).outerHeight( true );
4703
			});
4704
4705
			this.headers.next()
4706
				.each(function() {
4707
					$( this ).height( Math.max( 0, maxHeight -
4708
						$( this ).innerHeight() + $( this ).height() ) );
4709
				})
4710
				.css( "overflow", "auto" );
4711
		} else if ( heightStyle === "auto" ) {
4712
			maxHeight = 0;
4713
			this.headers.next()
4714
				.each(function() {
4715
					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
4716
				})
4717
				.height( maxHeight );
4718
		}
4719
	},
4720
4721
	_activate: function( index ) {
4722
		var active = this._findActive( index )[ 0 ];
4723
4724
		// trying to activate the already active panel
4725
		if ( active === this.active[ 0 ] ) {
4726
			return;
4727
		}
4728
4729
		// trying to collapse, simulate a click on the currently active header
4730
		active = active || this.active[ 0 ];
4731
4732
		this._eventHandler({
4733
			target: active,
4734
			currentTarget: active,
4735
			preventDefault: $.noop
4736
		});
4737
	},
4738
4739
	_findActive: function( selector ) {
4740
		return typeof selector === "number" ? this.headers.eq( selector ) : $();
4741
	},
4742
4743
	_setupEvents: function( event ) {
4744
		var events = {
4745
			keydown: "_keydown"
4746
		};
4747
		if ( event ) {
4748
			$.each( event.split( " " ), function( index, eventName ) {
4749
				events[ eventName ] = "_eventHandler";
4750
			});
4751
		}
4752
4753
		this._off( this.headers.add( this.headers.next() ) );
4754
		this._on( this.headers, events );
4755
		this._on( this.headers.next(), { keydown: "_panelKeyDown" });
4756
		this._hoverable( this.headers );
4757
		this._focusable( this.headers );
4758
	},
4759
4760
	_eventHandler: function( event ) {
4761
		var options = this.options,
4762
			active = this.active,
4763
			clicked = $( event.currentTarget ),
4764
			clickedIsActive = clicked[ 0 ] === active[ 0 ],
4765
			collapsing = clickedIsActive && options.collapsible,
4766
			toShow = collapsing ? $() : clicked.next(),
4767
			toHide = active.next(),
4768
			eventData = {
4769
				oldHeader: active,
4770
				oldPanel: toHide,
4771
				newHeader: collapsing ? $() : clicked,
4772
				newPanel: toShow
4773
			};
4774
4775
		event.preventDefault();
4776
4777
		if (
4778
				// click on active header, but not collapsible
4779
				( clickedIsActive && !options.collapsible ) ||
4780
				// allow canceling activation
4781
				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
4782
			return;
4783
		}
4784
4785
		options.active = collapsing ? false : this.headers.index( clicked );
4786
4787
		// when the call to ._toggle() comes after the class changes
4788
		// it causes a very odd bug in IE 8 (see #6720)
4789
		this.active = clickedIsActive ? $() : clicked;
4790
		this._toggle( eventData );
4791
4792
		// switch classes
4793
		// corner classes on the previously active header stay after the animation
4794
		active.removeClass( "ui-accordion-header-active ui-state-active" );
4795
		if ( options.icons ) {
4796
			active.children( ".ui-accordion-header-icon" )
4797
				.removeClass( options.icons.activeHeader )
4798
				.addClass( options.icons.header );
4799
		}
4800
4801
		if ( !clickedIsActive ) {
4802
			clicked
4803
				.removeClass( "ui-corner-all" )
4804
				.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
4805
			if ( options.icons ) {
4806
				clicked.children( ".ui-accordion-header-icon" )
4807
					.removeClass( options.icons.header )
4808
					.addClass( options.icons.activeHeader );
4809
			}
4810
4811
			clicked
4812
				.next()
4813
				.addClass( "ui-accordion-content-active" );
4814
		}
4815
	},
4816
4817
	_toggle: function( data ) {
4818
		var toShow = data.newPanel,
4819
			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
4820
4821
		// handle activating a panel during the animation for another activation
4822
		this.prevShow.add( this.prevHide ).stop( true, true );
4823
		this.prevShow = toShow;
4824
		this.prevHide = toHide;
4825
4826
		if ( this.options.animate ) {
4827
			this._animate( toShow, toHide, data );
4828
		} else {
4829
			toHide.hide();
4830
			toShow.show();
4831
			this._toggleComplete( data );
4832
		}
4833
4834
		toHide.attr({
4835
			"aria-hidden": "true"
4836
		});
4837
		toHide.prev().attr({
4838
			"aria-selected": "false",
4839
			"aria-expanded": "false"
4840
		});
4841
		// if we're switching panels, remove the old header from the tab order
4842
		// if we're opening from collapsed state, remove the previous header from the tab order
4843
		// if we're collapsing, then keep the collapsing header in the tab order
4844
		if ( toShow.length && toHide.length ) {
4845
			toHide.prev().attr({
4846
				"tabIndex": -1,
4847
				"aria-expanded": "false"
4848
			});
4849
		} else if ( toShow.length ) {
4850
			this.headers.filter(function() {
4851
				return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
4852
			})
4853
			.attr( "tabIndex", -1 );
4854
		}
4855
4856
		toShow
4857
			.attr( "aria-hidden", "false" )
4858
			.prev()
4859
				.attr({
4860
					"aria-selected": "true",
4861
					"aria-expanded": "true",
4862
					tabIndex: 0
4863
				});
4864
	},
4865
4866
	_animate: function( toShow, toHide, data ) {
4867
		var total, easing, duration,
4868
			that = this,
4869
			adjust = 0,
4870
			boxSizing = toShow.css( "box-sizing" ),
4871
			down = toShow.length &&
4872
				( !toHide.length || ( toShow.index() < toHide.index() ) ),
4873
			animate = this.options.animate || {},
4874
			options = down && animate.down || animate,
4875
			complete = function() {
4876
				that._toggleComplete( data );
4877
			};
4878
4879
		if ( typeof options === "number" ) {
4880
			duration = options;
4881
		}
4882
		if ( typeof options === "string" ) {
4883
			easing = options;
4884
		}
4885
		// fall back from options to animation in case of partial down settings
4886
		easing = easing || options.easing || animate.easing;
4887
		duration = duration || options.duration || animate.duration;
4888
4889
		if ( !toHide.length ) {
4890
			return toShow.animate( this.showProps, duration, easing, complete );
4891
		}
4892
		if ( !toShow.length ) {
4893
			return toHide.animate( this.hideProps, duration, easing, complete );
4894
		}
4895
4896
		total = toShow.show().outerHeight();
4897
		toHide.animate( this.hideProps, {
4898
			duration: duration,
4899
			easing: easing,
4900
			step: function( now, fx ) {
4901
				fx.now = Math.round( now );
4902
			}
4903
		});
4904
		toShow
4905
			.hide()
4906
			.animate( this.showProps, {
4907
				duration: duration,
4908
				easing: easing,
4909
				complete: complete,
4910
				step: function( now, fx ) {
4911
					fx.now = Math.round( now );
4912
					if ( fx.prop !== "height" ) {
4913
						if ( boxSizing === "content-box" ) {
4914
							adjust += fx.now;
4915
						}
4916
					} else if ( that.options.heightStyle !== "content" ) {
4917
						fx.now = Math.round( total - toHide.outerHeight() - adjust );
4918
						adjust = 0;
4919
					}
4920
				}
4921
			});
4922
	},
4923
4924
	_toggleComplete: function( data ) {
4925
		var toHide = data.oldPanel;
4926
4927
		toHide
4928
			.removeClass( "ui-accordion-content-active" )
4929
			.prev()
4930
				.removeClass( "ui-corner-top" )
4931
				.addClass( "ui-corner-all" );
4932
4933
		// Work around for rendering bug in IE (#5421)
4934
		if ( toHide.length ) {
4935
			toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
4936
		}
4937
		this._trigger( "activate", null, data );
4938
	}
4939
});
4940
4941
4942
/*!
4943
 * jQuery UI Menu 1.11.4
4944
 * http://jqueryui.com
4945
 *
4946
 * Copyright jQuery Foundation and other contributors
4947
 * Released under the MIT license.
4948
 * http://jquery.org/license
4949
 *
4950
 * http://api.jqueryui.com/menu/
4951
 */
4952
4953
4954
var menu = $.widget( "ui.menu", {
4955
	version: "1.11.4",
4956
	defaultElement: "<ul>",
4957
	delay: 300,
4958
	options: {
4959
		icons: {
4960
			submenu: "ui-icon-carat-1-e"
4961
		},
4962
		items: "> *",
4963
		menus: "ul",
4964
		position: {
4965
			my: "left-1 top",
4966
			at: "right top"
4967
		},
4968
		role: "menu",
4969
4970
		// callbacks
4971
		blur: null,
4972
		focus: null,
4973
		select: null
4974
	},
4975
4976
	_create: function() {
4977
		this.activeMenu = this.element;
4978
4979
		// Flag used to prevent firing of the click handler
4980
		// as the event bubbles up through nested menus
4981
		this.mouseHandled = false;
4982
		this.element
4983
			.uniqueId()
4984
			.addClass( "ui-menu ui-widget ui-widget-content" )
4985
			.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
4986
			.attr({
4987
				role: this.options.role,
4988
				tabIndex: 0
4989
			});
4990
4991
		if ( this.options.disabled ) {
4992
			this.element
4993
				.addClass( "ui-state-disabled" )
4994
				.attr( "aria-disabled", "true" );
4995
		}
4996
4997
		this._on({
4998
			// Prevent focus from sticking to links inside menu after clicking
4999
			// them (focus should always stay on UL during navigation).
5000
			"mousedown .ui-menu-item": function( event ) {
5001
				event.preventDefault();
5002
			},
5003
			"click .ui-menu-item": function( event ) {
5004
				var target = $( event.target );
5005
				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
5006
					this.select( event );
5007
5008
					// Only set the mouseHandled flag if the event will bubble, see #9469.
5009
					if ( !event.isPropagationStopped() ) {
5010
						this.mouseHandled = true;
5011
					}
5012
5013
					// Open submenu on click
5014
					if ( target.has( ".ui-menu" ).length ) {
5015
						this.expand( event );
5016
					} else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
5017
5018
						// Redirect focus to the menu
5019
						this.element.trigger( "focus", [ true ] );
5020
5021
						// If the active item is on the top level, let it stay active.
5022
						// Otherwise, blur the active item since it is no longer visible.
5023
						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
5024
							clearTimeout( this.timer );
5025
						}
5026
					}
5027
				}
5028
			},
5029
			"mouseenter .ui-menu-item": function( event ) {
5030
				// Ignore mouse events while typeahead is active, see #10458.
5031
				// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
5032
				// is over an item in the menu
5033
				if ( this.previousFilter ) {
5034
					return;
5035
				}
5036
				var target = $( event.currentTarget );
5037
				// Remove ui-state-active class from siblings of the newly focused menu item
5038
				// to avoid a jump caused by adjacent elements both having a class with a border
5039
				target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
5040
				this.focus( event, target );
5041
			},
5042
			mouseleave: "collapseAll",
5043
			"mouseleave .ui-menu": "collapseAll",
5044
			focus: function( event, keepActiveItem ) {
5045
				// If there's already an active item, keep it active
5046
				// If not, activate the first item
5047
				var item = this.active || this.element.find( this.options.items ).eq( 0 );
5048
5049
				if ( !keepActiveItem ) {
5050
					this.focus( event, item );
5051
				}
5052
			},
5053
			blur: function( event ) {
5054
				this._delay(function() {
5055
					if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
5056
						this.collapseAll( event );
5057
					}
5058
				});
5059
			},
5060
			keydown: "_keydown"
5061
		});
5062
5063
		this.refresh();
5064
5065
		// Clicks outside of a menu collapse any open menus
5066
		this._on( this.document, {
5067
			click: function( event ) {
5068
				if ( this._closeOnDocumentClick( event ) ) {
5069
					this.collapseAll( event );
5070
				}
5071
5072
				// Reset the mouseHandled flag
5073
				this.mouseHandled = false;
5074
			}
5075
		});
5076
	},
5077
5078
	_destroy: function() {
5079
		// Destroy (sub)menus
5080
		this.element
5081
			.removeAttr( "aria-activedescendant" )
5082
			.find( ".ui-menu" ).addBack()
5083
				.removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
5084
				.removeAttr( "role" )
5085
				.removeAttr( "tabIndex" )
5086
				.removeAttr( "aria-labelledby" )
5087
				.removeAttr( "aria-expanded" )
5088
				.removeAttr( "aria-hidden" )
5089
				.removeAttr( "aria-disabled" )
5090
				.removeUniqueId()
5091
				.show();
5092
5093
		// Destroy menu items
5094
		this.element.find( ".ui-menu-item" )
5095
			.removeClass( "ui-menu-item" )
5096
			.removeAttr( "role" )
5097
			.removeAttr( "aria-disabled" )
5098
			.removeUniqueId()
5099
			.removeClass( "ui-state-hover" )
5100
			.removeAttr( "tabIndex" )
5101
			.removeAttr( "role" )
5102
			.removeAttr( "aria-haspopup" )
5103
			.children().each( function() {
5104
				var elem = $( this );
5105
				if ( elem.data( "ui-menu-submenu-carat" ) ) {
5106
					elem.remove();
5107
				}
5108
			});
5109
5110
		// Destroy menu dividers
5111
		this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
5112
	},
5113
5114
	_keydown: function( event ) {
5115
		var match, prev, character, skip,
5116
			preventDefault = true;
5117
5118
		switch ( event.keyCode ) {
5119
		case $.ui.keyCode.PAGE_UP:
5120
			this.previousPage( event );
5121
			break;
5122
		case $.ui.keyCode.PAGE_DOWN:
5123
			this.nextPage( event );
5124
			break;
5125
		case $.ui.keyCode.HOME:
5126
			this._move( "first", "first", event );
5127
			break;
5128
		case $.ui.keyCode.END:
5129
			this._move( "last", "last", event );
5130
			break;
5131
		case $.ui.keyCode.UP:
5132
			this.previous( event );
5133
			break;
5134
		case $.ui.keyCode.DOWN:
5135
			this.next( event );
5136
			break;
5137
		case $.ui.keyCode.LEFT:
5138
			this.collapse( event );
5139
			break;
5140
		case $.ui.keyCode.RIGHT:
5141
			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
5142
				this.expand( event );
5143
			}
5144
			break;
5145
		case $.ui.keyCode.ENTER:
5146
		case $.ui.keyCode.SPACE:
5147
			this._activate( event );
5148
			break;
5149
		case $.ui.keyCode.ESCAPE:
5150
			this.collapse( event );
5151
			break;
5152
		default:
5153
			preventDefault = false;
5154
			prev = this.previousFilter || "";
5155
			character = String.fromCharCode( event.keyCode );
5156
			skip = false;
5157
5158
			clearTimeout( this.filterTimer );
5159
5160
			if ( character === prev ) {
5161
				skip = true;
5162
			} else {
5163
				character = prev + character;
5164
			}
5165
5166
			match = this._filterMenuItems( character );
5167
			match = skip && match.index( this.active.next() ) !== -1 ?
5168
				this.active.nextAll( ".ui-menu-item" ) :
5169
				match;
5170
5171
			// If no matches on the current filter, reset to the last character pressed
5172
			// to move down the menu to the first item that starts with that character
5173
			if ( !match.length ) {
5174
				character = String.fromCharCode( event.keyCode );
5175
				match = this._filterMenuItems( character );
5176
			}
5177
5178
			if ( match.length ) {
5179
				this.focus( event, match );
5180
				this.previousFilter = character;
5181
				this.filterTimer = this._delay(function() {
5182
					delete this.previousFilter;
5183
				}, 1000 );
5184
			} else {
5185
				delete this.previousFilter;
5186
			}
5187
		}
5188
5189
		if ( preventDefault ) {
5190
			event.preventDefault();
5191
		}
5192
	},
5193
5194
	_activate: function( event ) {
5195
		if ( !this.active.is( ".ui-state-disabled" ) ) {
5196
			if ( this.active.is( "[aria-haspopup='true']" ) ) {
5197
				this.expand( event );
5198
			} else {
5199
				this.select( event );
5200
			}
5201
		}
5202
	},
5203
5204
	refresh: function() {
5205
		var menus, items,
5206
			that = this,
5207
			icon = this.options.icons.submenu,
5208
			submenus = this.element.find( this.options.menus );
5209
5210
		this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
5211
5212
		// Initialize nested menus
5213
		submenus.filter( ":not(.ui-menu)" )
5214
			.addClass( "ui-menu ui-widget ui-widget-content ui-front" )
5215
			.hide()
5216
			.attr({
5217
				role: this.options.role,
5218
				"aria-hidden": "true",
5219
				"aria-expanded": "false"
5220
			})
5221
			.each(function() {
5222
				var menu = $( this ),
5223
					item = menu.parent(),
5224
					submenuCarat = $( "<span>" )
5225
						.addClass( "ui-menu-icon ui-icon " + icon )
5226
						.data( "ui-menu-submenu-carat", true );
5227
5228
				item
5229
					.attr( "aria-haspopup", "true" )
5230
					.prepend( submenuCarat );
5231
				menu.attr( "aria-labelledby", item.attr( "id" ) );
5232
			});
5233
5234
		menus = submenus.add( this.element );
5235
		items = menus.find( this.options.items );
5236
5237
		// Initialize menu-items containing spaces and/or dashes only as dividers
5238
		items.not( ".ui-menu-item" ).each(function() {
5239
			var item = $( this );
5240
			if ( that._isDivider( item ) ) {
5241
				item.addClass( "ui-widget-content ui-menu-divider" );
5242
			}
5243
		});
5244
5245
		// Don't refresh list items that are already adapted
5246
		items.not( ".ui-menu-item, .ui-menu-divider" )
5247
			.addClass( "ui-menu-item" )
5248
			.uniqueId()
5249
			.attr({
5250
				tabIndex: -1,
5251
				role: this._itemRole()
5252
			});
5253
5254
		// Add aria-disabled attribute to any disabled menu item
5255
		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
5256
5257
		// If the active item has been removed, blur the menu
5258
		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
5259
			this.blur();
5260
		}
5261
	},
5262
5263
	_itemRole: function() {
5264
		return {
5265
			menu: "menuitem",
5266
			listbox: "option"
5267
		}[ this.options.role ];
5268
	},
5269
5270
	_setOption: function( key, value ) {
5271
		if ( key === "icons" ) {
5272
			this.element.find( ".ui-menu-icon" )
5273
				.removeClass( this.options.icons.submenu )
5274
				.addClass( value.submenu );
5275
		}
5276
		if ( key === "disabled" ) {
5277
			this.element
5278
				.toggleClass( "ui-state-disabled", !!value )
5279
				.attr( "aria-disabled", value );
5280
		}
5281
		this._super( key, value );
5282
	},
5283
5284
	focus: function( event, item ) {
5285
		var nested, focused;
5286
		this.blur( event, event && event.type === "focus" );
5287
5288
		this._scrollIntoView( item );
5289
5290
		this.active = item.first();
5291
		focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
5292
		// Only update aria-activedescendant if there's a role
5293
		// otherwise we assume focus is managed elsewhere
5294
		if ( this.options.role ) {
5295
			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
5296
		}
5297
5298
		// Highlight active parent menu item, if any
5299
		this.active
5300
			.parent()
5301
			.closest( ".ui-menu-item" )
5302
			.addClass( "ui-state-active" );
5303
5304
		if ( event && event.type === "keydown" ) {
5305
			this._close();
5306
		} else {
5307
			this.timer = this._delay(function() {
5308
				this._close();
5309
			}, this.delay );
5310
		}
5311
5312
		nested = item.children( ".ui-menu" );
5313
		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
5314
			this._startOpening(nested);
5315
		}
5316
		this.activeMenu = item.parent();
5317
5318
		this._trigger( "focus", event, { item: item } );
5319
	},
5320
5321
	_scrollIntoView: function( item ) {
5322
		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
5323
		if ( this._hasScroll() ) {
5324
			borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
5325
			paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
5326
			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
5327
			scroll = this.activeMenu.scrollTop();
5328
			elementHeight = this.activeMenu.height();
5329
			itemHeight = item.outerHeight();
5330
5331
			if ( offset < 0 ) {
5332
				this.activeMenu.scrollTop( scroll + offset );
5333
			} else if ( offset + itemHeight > elementHeight ) {
5334
				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
5335
			}
5336
		}
5337
	},
5338
5339
	blur: function( event, fromFocus ) {
5340
		if ( !fromFocus ) {
5341
			clearTimeout( this.timer );
5342
		}
5343
5344
		if ( !this.active ) {
5345
			return;
5346
		}
5347
5348
		this.active.removeClass( "ui-state-focus" );
5349
		this.active = null;
5350
5351
		this._trigger( "blur", event, { item: this.active } );
5352
	},
5353
5354
	_startOpening: function( submenu ) {
5355
		clearTimeout( this.timer );
5356
5357
		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
5358
		// shift in the submenu position when mousing over the carat icon
5359
		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
5360
			return;
5361
		}
5362
5363
		this.timer = this._delay(function() {
5364
			this._close();
5365
			this._open( submenu );
5366
		}, this.delay );
5367
	},
5368
5369
	_open: function( submenu ) {
5370
		var position = $.extend({
5371
			of: this.active
5372
		}, this.options.position );
5373
5374
		clearTimeout( this.timer );
5375
		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
5376
			.hide()
5377
			.attr( "aria-hidden", "true" );
5378
5379
		submenu
5380
			.show()
5381
			.removeAttr( "aria-hidden" )
5382
			.attr( "aria-expanded", "true" )
5383
			.position( position );
5384
	},
5385
5386
	collapseAll: function( event, all ) {
5387
		clearTimeout( this.timer );
5388
		this.timer = this._delay(function() {
5389
			// If we were passed an event, look for the submenu that contains the event
5390
			var currentMenu = all ? this.element :
5391
				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
5392
5393
			// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
5394
			if ( !currentMenu.length ) {
5395
				currentMenu = this.element;
5396
			}
5397
5398
			this._close( currentMenu );
5399
5400
			this.blur( event );
5401
			this.activeMenu = currentMenu;
5402
		}, this.delay );
5403
	},
5404
5405
	// With no arguments, closes the currently active menu - if nothing is active
5406
	// it closes all menus.  If passed an argument, it will search for menus BELOW
5407
	_close: function( startMenu ) {
5408
		if ( !startMenu ) {
5409
			startMenu = this.active ? this.active.parent() : this.element;
5410
		}
5411
5412
		startMenu
5413
			.find( ".ui-menu" )
5414
				.hide()
5415
				.attr( "aria-hidden", "true" )
5416
				.attr( "aria-expanded", "false" )
5417
			.end()
5418
			.find( ".ui-state-active" ).not( ".ui-state-focus" )
5419
				.removeClass( "ui-state-active" );
5420
	},
5421
5422
	_closeOnDocumentClick: function( event ) {
5423
		return !$( event.target ).closest( ".ui-menu" ).length;
5424
	},
5425
5426
	_isDivider: function( item ) {
5427
5428
		// Match hyphen, em dash, en dash
5429
		return !/[^\-\u2014\u2013\s]/.test( item.text() );
5430
	},
5431
5432
	collapse: function( event ) {
5433
		var newItem = this.active &&
5434
			this.active.parent().closest( ".ui-menu-item", this.element );
5435
		if ( newItem && newItem.length ) {
5436
			this._close();
5437
			this.focus( event, newItem );
5438
		}
5439
	},
5440
5441
	expand: function( event ) {
5442
		var newItem = this.active &&
5443
			this.active
5444
				.children( ".ui-menu " )
5445
				.find( this.options.items )
5446
				.first();
5447
5448
		if ( newItem && newItem.length ) {
5449
			this._open( newItem.parent() );
5450
5451
			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
5452
			this._delay(function() {
5453
				this.focus( event, newItem );
5454
			});
5455
		}
5456
	},
5457
5458
	next: function( event ) {
5459
		this._move( "next", "first", event );
5460
	},
5461
5462
	previous: function( event ) {
5463
		this._move( "prev", "last", event );
5464
	},
5465
5466
	isFirstItem: function() {
5467
		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
5468
	},
5469
5470
	isLastItem: function() {
5471
		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
5472
	},
5473
5474
	_move: function( direction, filter, event ) {
5475
		var next;
5476
		if ( this.active ) {
5477
			if ( direction === "first" || direction === "last" ) {
5478
				next = this.active
5479
					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
5480
					.eq( -1 );
5481
			} else {
5482
				next = this.active
5483
					[ direction + "All" ]( ".ui-menu-item" )
5484
					.eq( 0 );
5485
			}
5486
		}
5487
		if ( !next || !next.length || !this.active ) {
5488
			next = this.activeMenu.find( this.options.items )[ filter ]();
5489
		}
5490
5491
		this.focus( event, next );
5492
	},
5493
5494
	nextPage: function( event ) {
5495
		var item, base, height;
5496
5497
		if ( !this.active ) {
5498
			this.next( event );
5499
			return;
5500
		}
5501
		if ( this.isLastItem() ) {
5502
			return;
5503
		}
5504
		if ( this._hasScroll() ) {
5505
			base = this.active.offset().top;
5506
			height = this.element.height();
5507
			this.active.nextAll( ".ui-menu-item" ).each(function() {
5508
				item = $( this );
5509
				return item.offset().top - base - height < 0;
5510
			});
5511
5512
			this.focus( event, item );
5513
		} else {
5514
			this.focus( event, this.activeMenu.find( this.options.items )
5515
				[ !this.active ? "first" : "last" ]() );
5516
		}
5517
	},
5518
5519
	previousPage: function( event ) {
5520
		var item, base, height;
5521
		if ( !this.active ) {
5522
			this.next( event );
5523
			return;
5524
		}
5525
		if ( this.isFirstItem() ) {
5526
			return;
5527
		}
5528
		if ( this._hasScroll() ) {
5529
			base = this.active.offset().top;
5530
			height = this.element.height();
5531
			this.active.prevAll( ".ui-menu-item" ).each(function() {
5532
				item = $( this );
5533
				return item.offset().top - base + height > 0;
5534
			});
5535
5536
			this.focus( event, item );
5537
		} else {
5538
			this.focus( event, this.activeMenu.find( this.options.items ).first() );
5539
		}
5540
	},
5541
5542
	_hasScroll: function() {
5543
		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
5544
	},
5545
5546
	select: function( event ) {
5547
		// TODO: It should never be possible to not have an active item at this
5548
		// point, but the tests don't trigger mouseenter before click.
5549
		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
5550
		var ui = { item: this.active };
5551
		if ( !this.active.has( ".ui-menu" ).length ) {
5552
			this.collapseAll( event, true );
5553
		}
5554
		this._trigger( "select", event, ui );
5555
	},
5556
5557
	_filterMenuItems: function(character) {
5558
		var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
5559
			regex = new RegExp( "^" + escapedCharacter, "i" );
5560
5561
		return this.activeMenu
5562
			.find( this.options.items )
5563
5564
			// Only match on items, not dividers or other content (#10571)
5565
			.filter( ".ui-menu-item" )
5566
			.filter(function() {
5567
				return regex.test( $.trim( $( this ).text() ) );
5568
			});
5569
	}
5570
});
5571
5572
5573
/*!
5574
 * jQuery UI Autocomplete 1.11.4
5575
 * http://jqueryui.com
5576
 *
5577
 * Copyright jQuery Foundation and other contributors
5578
 * Released under the MIT license.
5579
 * http://jquery.org/license
5580
 *
5581
 * http://api.jqueryui.com/autocomplete/
5582
 */
5583
5584
5585
$.widget( "ui.autocomplete", {
5586
	version: "1.11.4",
5587
	defaultElement: "<input>",
5588
	options: {
5589
		appendTo: null,
5590
		autoFocus: false,
5591
		delay: 300,
5592
		minLength: 1,
5593
		position: {
5594
			my: "left top",
5595
			at: "left bottom",
5596
			collision: "none"
5597
		},
5598
		source: null,
5599
5600
		// callbacks
5601
		change: null,
5602
		close: null,
5603
		focus: null,
5604
		open: null,
5605
		response: null,
5606
		search: null,
5607
		select: null
5608
	},
5609
5610
	requestIndex: 0,
5611
	pending: 0,
5612
5613
	_create: function() {
5614
		// Some browsers only repeat keydown events, not keypress events,
5615
		// so we use the suppressKeyPress flag to determine if we've already
5616
		// handled the keydown event. #7269
5617
		// Unfortunately the code for & in keypress is the same as the up arrow,
5618
		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
5619
		// events when we know the keydown event was used to modify the
5620
		// search term. #7799
5621
		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
5622
			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
5623
			isTextarea = nodeName === "textarea",
5624
			isInput = nodeName === "input";
5625
5626
		this.isMultiLine =
5627
			// Textareas are always multi-line
5628
			isTextarea ? true :
5629
			// Inputs are always single-line, even if inside a contentEditable element
5630
			// IE also treats inputs as contentEditable
5631
			isInput ? false :
5632
			// All other element types are determined by whether or not they're contentEditable
5633
			this.element.prop( "isContentEditable" );
5634
5635
		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
5636
		this.isNewMenu = true;
5637
5638
		this.element
5639
			.addClass( "ui-autocomplete-input" )
5640
			.attr( "autocomplete", "off" );
5641
5642
		this._on( this.element, {
5643
			keydown: function( event ) {
5644
				if ( this.element.prop( "readOnly" ) ) {
5645
					suppressKeyPress = true;
5646
					suppressInput = true;
5647
					suppressKeyPressRepeat = true;
5648
					return;
5649
				}
5650
5651
				suppressKeyPress = false;
5652
				suppressInput = false;
5653
				suppressKeyPressRepeat = false;
5654
				var keyCode = $.ui.keyCode;
5655
				switch ( event.keyCode ) {
5656
				case keyCode.PAGE_UP:
5657
					suppressKeyPress = true;
5658
					this._move( "previousPage", event );
5659
					break;
5660
				case keyCode.PAGE_DOWN:
5661
					suppressKeyPress = true;
5662
					this._move( "nextPage", event );
5663
					break;
5664
				case keyCode.UP:
5665
					suppressKeyPress = true;
5666
					this._keyEvent( "previous", event );
5667
					break;
5668
				case keyCode.DOWN:
5669
					suppressKeyPress = true;
5670
					this._keyEvent( "next", event );
5671
					break;
5672
				case keyCode.ENTER:
5673
					// when menu is open and has focus
5674
					if ( this.menu.active ) {
5675
						// #6055 - Opera still allows the keypress to occur
5676
						// which causes forms to submit
5677
						suppressKeyPress = true;
5678
						event.preventDefault();
5679
						this.menu.select( event );
5680
					}
5681
					break;
5682
				case keyCode.TAB:
5683
					if ( this.menu.active ) {
5684
						this.menu.select( event );
5685
					}
5686
					break;
5687
				case keyCode.ESCAPE:
5688
					if ( this.menu.element.is( ":visible" ) ) {
5689
						if ( !this.isMultiLine ) {
5690
							this._value( this.term );
5691
						}
5692
						this.close( event );
5693
						// Different browsers have different default behavior for escape
5694
						// Single press can mean undo or clear
5695
						// Double press in IE means clear the whole form
5696
						event.preventDefault();
5697
					}
5698
					break;
5699
				default:
5700
					suppressKeyPressRepeat = true;
5701
					// search timeout should be triggered before the input value is changed
5702
					this._searchTimeout( event );
5703
					break;
5704
				}
5705
			},
5706
			keypress: function( event ) {
5707
				if ( suppressKeyPress ) {
5708
					suppressKeyPress = false;
5709
					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
5710
						event.preventDefault();
5711
					}
5712
					return;
5713
				}
5714
				if ( suppressKeyPressRepeat ) {
5715
					return;
5716
				}
5717
5718
				// replicate some key handlers to allow them to repeat in Firefox and Opera
5719
				var keyCode = $.ui.keyCode;
5720
				switch ( event.keyCode ) {
5721
				case keyCode.PAGE_UP:
5722
					this._move( "previousPage", event );
5723
					break;
5724
				case keyCode.PAGE_DOWN:
5725
					this._move( "nextPage", event );
5726
					break;
5727
				case keyCode.UP:
5728
					this._keyEvent( "previous", event );
5729
					break;
5730
				case keyCode.DOWN:
5731
					this._keyEvent( "next", event );
5732
					break;
5733
				}
5734
			},
5735
			input: function( event ) {
5736
				if ( suppressInput ) {
5737
					suppressInput = false;
5738
					event.preventDefault();
5739
					return;
5740
				}
5741
				this._searchTimeout( event );
5742
			},
5743
			focus: function() {
5744
				this.selectedItem = null;
5745
				this.previous = this._value();
5746
			},
5747
			blur: function( event ) {
5748
				if ( this.cancelBlur ) {
5749
					delete this.cancelBlur;
5750
					return;
5751
				}
5752
5753
				clearTimeout( this.searching );
5754
				this.close( event );
5755
				this._change( event );
5756
			}
5757
		});
5758
5759
		this._initSource();
5760
		this.menu = $( "<ul>" )
5761
			.addClass( "ui-autocomplete ui-front" )
5762
			.appendTo( this._appendTo() )
5763
			.menu({
5764
				// disable ARIA support, the live region takes care of that
5765
				role: null
5766
			})
5767
			.hide()
5768
			.menu( "instance" );
5769
5770
		this._on( this.menu.element, {
5771
			mousedown: function( event ) {
5772
				// prevent moving focus out of the text field
5773
				event.preventDefault();
5774
5775
				// IE doesn't prevent moving focus even with event.preventDefault()
5776
				// so we set a flag to know when we should ignore the blur event
5777
				this.cancelBlur = true;
5778
				this._delay(function() {
5779
					delete this.cancelBlur;
5780
				});
5781
5782
				// clicking on the scrollbar causes focus to shift to the body
5783
				// but we can't detect a mouseup or a click immediately afterward
5784
				// so we have to track the next mousedown and close the menu if
5785
				// the user clicks somewhere outside of the autocomplete
5786
				var menuElement = this.menu.element[ 0 ];
5787
				if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
5788
					this._delay(function() {
5789
						var that = this;
5790
						this.document.one( "mousedown", function( event ) {
5791
							if ( event.target !== that.element[ 0 ] &&
5792
									event.target !== menuElement &&
5793
									!$.contains( menuElement, event.target ) ) {
5794
								that.close();
5795
							}
5796
						});
5797
					});
5798
				}
5799
			},
5800
			menufocus: function( event, ui ) {
5801
				var label, item;
5802
				// support: Firefox
5803
				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
5804
				if ( this.isNewMenu ) {
5805
					this.isNewMenu = false;
5806
					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
5807
						this.menu.blur();
5808
5809
						this.document.one( "mousemove", function() {
5810
							$( event.target ).trigger( event.originalEvent );
5811
						});
5812
5813
						return;
5814
					}
5815
				}
5816
5817
				item = ui.item.data( "ui-autocomplete-item" );
5818
				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
5819
					// use value to match what will end up in the input, if it was a key event
5820
					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
5821
						this._value( item.value );
5822
					}
5823
				}
5824
5825
				// Announce the value in the liveRegion
5826
				label = ui.item.attr( "aria-label" ) || item.value;
5827
				if ( label && $.trim( label ).length ) {
5828
					this.liveRegion.children().hide();
5829
					$( "<div>" ).text( label ).appendTo( this.liveRegion );
5830
				}
5831
			},
5832
			menuselect: function( event, ui ) {
5833
				var item = ui.item.data( "ui-autocomplete-item" ),
5834
					previous = this.previous;
5835
5836
				// only trigger when focus was lost (click on menu)
5837
				if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
5838
					this.element.focus();
5839
					this.previous = previous;
5840
					// #6109 - IE triggers two focus events and the second
5841
					// is asynchronous, so we need to reset the previous
5842
					// term synchronously and asynchronously :-(
5843
					this._delay(function() {
5844
						this.previous = previous;
5845
						this.selectedItem = item;
5846
					});
5847
				}
5848
5849
				if ( false !== this._trigger( "select", event, { item: item } ) ) {
5850
					this._value( item.value );
5851
				}
5852
				// reset the term after the select event
5853
				// this allows custom select handling to work properly
5854
				this.term = this._value();
5855
5856
				this.close( event );
5857
				this.selectedItem = item;
5858
			}
5859
		});
5860
5861
		this.liveRegion = $( "<span>", {
5862
				role: "status",
5863
				"aria-live": "assertive",
5864
				"aria-relevant": "additions"
5865
			})
5866
			.addClass( "ui-helper-hidden-accessible" )
5867
			.appendTo( this.document[ 0 ].body );
5868
5869
		// turning off autocomplete prevents the browser from remembering the
5870
		// value when navigating through history, so we re-enable autocomplete
5871
		// if the page is unloaded before the widget is destroyed. #7790
5872
		this._on( this.window, {
5873
			beforeunload: function() {
5874
				this.element.removeAttr( "autocomplete" );
5875
			}
5876
		});
5877
	},
5878
5879
	_destroy: function() {
5880
		clearTimeout( this.searching );
5881
		this.element
5882
			.removeClass( "ui-autocomplete-input" )
5883
			.removeAttr( "autocomplete" );
5884
		this.menu.element.remove();
5885
		this.liveRegion.remove();
5886
	},
5887
5888
	_setOption: function( key, value ) {
5889
		this._super( key, value );
5890
		if ( key === "source" ) {
5891
			this._initSource();
5892
		}
5893
		if ( key === "appendTo" ) {
5894
			this.menu.element.appendTo( this._appendTo() );
5895
		}
5896
		if ( key === "disabled" && value && this.xhr ) {
5897
			this.xhr.abort();
5898
		}
5899
	},
5900
5901
	_appendTo: function() {
5902
		var element = this.options.appendTo;
5903
5904
		if ( element ) {
5905
			element = element.jquery || element.nodeType ?
5906
				$( element ) :
5907
				this.document.find( element ).eq( 0 );
5908
		}
5909
5910
		if ( !element || !element[ 0 ] ) {
5911
			element = this.element.closest( ".ui-front" );
5912
		}
5913
5914
		if ( !element.length ) {
5915
			element = this.document[ 0 ].body;
5916
		}
5917
5918
		return element;
5919
	},
5920
5921
	_initSource: function() {
5922
		var array, url,
5923
			that = this;
5924
		if ( $.isArray( this.options.source ) ) {
5925
			array = this.options.source;
5926
			this.source = function( request, response ) {
5927
				response( $.ui.autocomplete.filter( array, request.term ) );
5928
			};
5929
		} else if ( typeof this.options.source === "string" ) {
5930
			url = this.options.source;
5931
			this.source = function( request, response ) {
5932
				if ( that.xhr ) {
5933
					that.xhr.abort();
5934
				}
5935
				that.xhr = $.ajax({
5936
					url: url,
5937
					data: request,
5938
					dataType: "json",
5939
					success: function( data ) {
5940
						response( data );
5941
					},
5942
					error: function() {
5943
						response([]);
5944
					}
5945
				});
5946
			};
5947
		} else {
5948
			this.source = this.options.source;
5949
		}
5950
	},
5951
5952
	_searchTimeout: function( event ) {
5953
		clearTimeout( this.searching );
5954
		this.searching = this._delay(function() {
5955
5956
			// Search if the value has changed, or if the user retypes the same value (see #7434)
5957
			var equalValues = this.term === this._value(),
5958
				menuVisible = this.menu.element.is( ":visible" ),
5959
				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
5960
5961
			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
5962
				this.selectedItem = null;
5963
				this.search( null, event );
5964
			}
5965
		}, this.options.delay );
5966
	},
5967
5968
	search: function( value, event ) {
5969
		value = value != null ? value : this._value();
5970
5971
		// always save the actual value, not the one passed as an argument
5972
		this.term = this._value();
5973
5974
		if ( value.length < this.options.minLength ) {
5975
			return this.close( event );
5976
		}
5977
5978
		if ( this._trigger( "search", event ) === false ) {
5979
			return;
5980
		}
5981
5982
		return this._search( value );
5983
	},
5984
5985
	_search: function( value ) {
5986
		this.pending++;
5987
		this.element.addClass( "ui-autocomplete-loading" );
5988
		this.cancelSearch = false;
5989
5990
		this.source( { term: value }, this._response() );
5991
	},
5992
5993
	_response: function() {
5994
		var index = ++this.requestIndex;
5995
5996
		return $.proxy(function( content ) {
5997
			if ( index === this.requestIndex ) {
5998
				this.__response( content );
5999
			}
6000
6001
			this.pending--;
6002
			if ( !this.pending ) {
6003
				this.element.removeClass( "ui-autocomplete-loading" );
6004
			}
6005
		}, this );
6006
	},
6007
6008
	__response: function( content ) {
6009
		if ( content ) {
6010
			content = this._normalize( content );
6011
		}
6012
		this._trigger( "response", null, { content: content } );
6013
		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
6014
			this._suggest( content );
6015
			this._trigger( "open" );
6016
		} else {
6017
			// use ._close() instead of .close() so we don't cancel future searches
6018
			this._close();
6019
		}
6020
	},
6021
6022
	close: function( event ) {
6023
		this.cancelSearch = true;
6024
		this._close( event );
6025
	},
6026
6027
	_close: function( event ) {
6028
		if ( this.menu.element.is( ":visible" ) ) {
6029
			this.menu.element.hide();
6030
			this.menu.blur();
6031
			this.isNewMenu = true;
6032
			this._trigger( "close", event );
6033
		}
6034
	},
6035
6036
	_change: function( event ) {
6037
		if ( this.previous !== this._value() ) {
6038
			this._trigger( "change", event, { item: this.selectedItem } );
6039
		}
6040
	},
6041
6042
	_normalize: function( items ) {
6043
		// assume all items have the right format when the first item is complete
6044
		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
6045
			return items;
6046
		}
6047
		return $.map( items, function( item ) {
6048
			if ( typeof item === "string" ) {
6049
				return {
6050
					label: item,
6051
					value: item
6052
				};
6053
			}
6054
			return $.extend( {}, item, {
6055
				label: item.label || item.value,
6056
				value: item.value || item.label
6057
			});
6058
		});
6059
	},
6060
6061
	_suggest: function( items ) {
6062
		var ul = this.menu.element.empty();
6063
		this._renderMenu( ul, items );
6064
		this.isNewMenu = true;
6065
		this.menu.refresh();
6066
6067
		// size and position menu
6068
		ul.show();
6069
		this._resizeMenu();
6070
		ul.position( $.extend({
6071
			of: this.element
6072
		}, this.options.position ) );
6073
6074
		if ( this.options.autoFocus ) {
6075
			this.menu.next();
6076
		}
6077
	},
6078
6079
	_resizeMenu: function() {
6080
		var ul = this.menu.element;
6081
		ul.outerWidth( Math.max(
6082
			// Firefox wraps long text (possibly a rounding bug)
6083
			// so we add 1px to avoid the wrapping (#7513)
6084
			ul.width( "" ).outerWidth() + 1,
6085
			this.element.outerWidth()
6086
		) );
6087
	},
6088
6089
	_renderMenu: function( ul, items ) {
6090
		var that = this;
6091
		$.each( items, function( index, item ) {
6092
			that._renderItemData( ul, item );
6093
		});
6094
	},
6095
6096
	_renderItemData: function( ul, item ) {
6097
		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
6098
	},
6099
6100
	_renderItem: function( ul, item ) {
6101
		return $( "<li>" ).text( item.label ).appendTo( ul );
6102
	},
6103
6104
	_move: function( direction, event ) {
6105
		if ( !this.menu.element.is( ":visible" ) ) {
6106
			this.search( null, event );
6107
			return;
6108
		}
6109
		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
6110
				this.menu.isLastItem() && /^next/.test( direction ) ) {
6111
6112
			if ( !this.isMultiLine ) {
6113
				this._value( this.term );
6114
			}
6115
6116
			this.menu.blur();
6117
			return;
6118
		}
6119
		this.menu[ direction ]( event );
6120
	},
6121
6122
	widget: function() {
6123
		return this.menu.element;
6124
	},
6125
6126
	_value: function() {
6127
		return this.valueMethod.apply( this.element, arguments );
6128
	},
6129
6130
	_keyEvent: function( keyEvent, event ) {
6131
		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
6132
			this._move( keyEvent, event );
6133
6134
			// prevents moving cursor to beginning/end of the text field in some browsers
6135
			event.preventDefault();
6136
		}
6137
	}
6138
});
6139
6140
$.extend( $.ui.autocomplete, {
6141
	escapeRegex: function( value ) {
6142
		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
6143
	},
6144
	filter: function( array, term ) {
6145
		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
6146
		return $.grep( array, function( value ) {
6147
			return matcher.test( value.label || value.value || value );
6148
		});
6149
	}
6150
});
6151
6152
// live region extension, adding a `messages` option
6153
// NOTE: This is an experimental API. We are still investigating
6154
// a full solution for string manipulation and internationalization.
6155
$.widget( "ui.autocomplete", $.ui.autocomplete, {
6156
	options: {
6157
		messages: {
6158
			noResults: "No search results.",
6159
			results: function( amount ) {
6160
				return amount + ( amount > 1 ? " results are" : " result is" ) +
6161
					" available, use up and down arrow keys to navigate.";
6162
			}
6163
		}
6164
	},
6165
6166
	__response: function( content ) {
6167
		var message;
6168
		this._superApply( arguments );
6169
		if ( this.options.disabled || this.cancelSearch ) {
6170
			return;
6171
		}
6172
		if ( content && content.length ) {
6173
			message = this.options.messages.results( content.length );
6174
		} else {
6175
			message = this.options.messages.noResults;
6176
		}
6177
		this.liveRegion.children().hide();
6178
		$( "<div>" ).text( message ).appendTo( this.liveRegion );
6179
	}
6180
});
6181
6182
var autocomplete = $.ui.autocomplete;
6183
6184
6185
/*!
6186
 * jQuery UI Button 1.11.4
6187
 * http://jqueryui.com
6188
 *
6189
 * Copyright jQuery Foundation and other contributors
6190
 * Released under the MIT license.
6191
 * http://jquery.org/license
6192
 *
6193
 * http://api.jqueryui.com/button/
6194
 */
6195
6196
6197
var lastActive,
6198
	baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
6199
	typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
6200
	formResetHandler = function() {
6201
		var form = $( this );
6202
		setTimeout(function() {
6203
			form.find( ":ui-button" ).button( "refresh" );
6204
		}, 1 );
6205
	},
6206
	radioGroup = function( radio ) {
6207
		var name = radio.name,
6208
			form = radio.form,
6209
			radios = $( [] );
6210
		if ( name ) {
6211
			name = name.replace( /'/g, "\\'" );
6212
			if ( form ) {
6213
				radios = $( form ).find( "[name='" + name + "'][type=radio]" );
6214
			} else {
6215
				radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
6216
					.filter(function() {
6217
						return !this.form;
6218
					});
6219
			}
6220
		}
6221
		return radios;
6222
	};
6223
6224
$.widget( "ui.button", {
6225
	version: "1.11.4",
6226
	defaultElement: "<button>",
6227
	options: {
6228
		disabled: null,
6229
		text: true,
6230
		label: null,
6231
		icons: {
6232
			primary: null,
6233
			secondary: null
6234
		}
6235
	},
6236
	_create: function() {
6237
		this.element.closest( "form" )
6238
			.unbind( "reset" + this.eventNamespace )
6239
			.bind( "reset" + this.eventNamespace, formResetHandler );
6240
6241
		if ( typeof this.options.disabled !== "boolean" ) {
6242
			this.options.disabled = !!this.element.prop( "disabled" );
6243
		} else {
6244
			this.element.prop( "disabled", this.options.disabled );
6245
		}
6246
6247
		this._determineButtonType();
6248
		this.hasTitle = !!this.buttonElement.attr( "title" );
6249
6250
		var that = this,
6251
			options = this.options,
6252
			toggleButton = this.type === "checkbox" || this.type === "radio",
6253
			activeClass = !toggleButton ? "ui-state-active" : "";
6254
6255
		if ( options.label === null ) {
6256
			options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
6257
		}
6258
6259
		this._hoverable( this.buttonElement );
6260
6261
		this.buttonElement
6262
			.addClass( baseClasses )
6263
			.attr( "role", "button" )
6264
			.bind( "mouseenter" + this.eventNamespace, function() {
6265
				if ( options.disabled ) {
6266
					return;
6267
				}
6268
				if ( this === lastActive ) {
6269
					$( this ).addClass( "ui-state-active" );
6270
				}
6271
			})
6272
			.bind( "mouseleave" + this.eventNamespace, function() {
6273
				if ( options.disabled ) {
6274
					return;
6275
				}
6276
				$( this ).removeClass( activeClass );
6277
			})
6278
			.bind( "click" + this.eventNamespace, function( event ) {
6279
				if ( options.disabled ) {
6280
					event.preventDefault();
6281
					event.stopImmediatePropagation();
6282
				}
6283
			});
6284
6285
		// Can't use _focusable() because the element that receives focus
6286
		// and the element that gets the ui-state-focus class are different
6287
		this._on({
6288
			focus: function() {
6289
				this.buttonElement.addClass( "ui-state-focus" );
6290
			},
6291
			blur: function() {
6292
				this.buttonElement.removeClass( "ui-state-focus" );
6293
			}
6294
		});
6295
6296
		if ( toggleButton ) {
6297
			this.element.bind( "change" + this.eventNamespace, function() {
6298
				that.refresh();
6299
			});
6300
		}
6301
6302
		if ( this.type === "checkbox" ) {
6303
			this.buttonElement.bind( "click" + this.eventNamespace, function() {
6304
				if ( options.disabled ) {
6305
					return false;
6306
				}
6307
			});
6308
		} else if ( this.type === "radio" ) {
6309
			this.buttonElement.bind( "click" + this.eventNamespace, function() {
6310
				if ( options.disabled ) {
6311
					return false;
6312
				}
6313
				$( this ).addClass( "ui-state-active" );
6314
				that.buttonElement.attr( "aria-pressed", "true" );
6315
6316
				var radio = that.element[ 0 ];
6317
				radioGroup( radio )
6318
					.not( radio )
6319
					.map(function() {
6320
						return $( this ).button( "widget" )[ 0 ];
6321
					})
6322
					.removeClass( "ui-state-active" )
6323
					.attr( "aria-pressed", "false" );
6324
			});
6325
		} else {
6326
			this.buttonElement
6327
				.bind( "mousedown" + this.eventNamespace, function() {
6328
					if ( options.disabled ) {
6329
						return false;
6330
					}
6331
					$( this ).addClass( "ui-state-active" );
6332
					lastActive = this;
6333
					that.document.one( "mouseup", function() {
6334
						lastActive = null;
6335
					});
6336
				})
6337
				.bind( "mouseup" + this.eventNamespace, function() {
6338
					if ( options.disabled ) {
6339
						return false;
6340
					}
6341
					$( this ).removeClass( "ui-state-active" );
6342
				})
6343
				.bind( "keydown" + this.eventNamespace, function(event) {
6344
					if ( options.disabled ) {
6345
						return false;
6346
					}
6347
					if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
6348
						$( this ).addClass( "ui-state-active" );
6349
					}
6350
				})
6351
				// see #8559, we bind to blur here in case the button element loses
6352
				// focus between keydown and keyup, it would be left in an "active" state
6353
				.bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
6354
					$( this ).removeClass( "ui-state-active" );
6355
				});
6356
6357
			if ( this.buttonElement.is("a") ) {
6358
				this.buttonElement.keyup(function(event) {
6359
					if ( event.keyCode === $.ui.keyCode.SPACE ) {
6360
						// TODO pass through original event correctly (just as 2nd argument doesn't work)
6361
						$( this ).click();
6362
					}
6363
				});
6364
			}
6365
		}
6366
6367
		this._setOption( "disabled", options.disabled );
6368
		this._resetButton();
6369
	},
6370
6371
	_determineButtonType: function() {
6372
		var ancestor, labelSelector, checked;
6373
6374
		if ( this.element.is("[type=checkbox]") ) {
6375
			this.type = "checkbox";
6376
		} else if ( this.element.is("[type=radio]") ) {
6377
			this.type = "radio";
6378
		} else if ( this.element.is("input") ) {
6379
			this.type = "input";
6380
		} else {
6381
			this.type = "button";
6382
		}
6383
6384
		if ( this.type === "checkbox" || this.type === "radio" ) {
6385
			// we don't search against the document in case the element
6386
			// is disconnected from the DOM
6387
			ancestor = this.element.parents().last();
6388
			labelSelector = "label[for='" + this.element.attr("id") + "']";
6389
			this.buttonElement = ancestor.find( labelSelector );
6390
			if ( !this.buttonElement.length ) {
6391
				ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
6392
				this.buttonElement = ancestor.filter( labelSelector );
6393
				if ( !this.buttonElement.length ) {
6394
					this.buttonElement = ancestor.find( labelSelector );
6395
				}
6396
			}
6397
			this.element.addClass( "ui-helper-hidden-accessible" );
6398
6399
			checked = this.element.is( ":checked" );
6400
			if ( checked ) {
6401
				this.buttonElement.addClass( "ui-state-active" );
6402
			}
6403
			this.buttonElement.prop( "aria-pressed", checked );
6404
		} else {
6405
			this.buttonElement = this.element;
6406
		}
6407
	},
6408
6409
	widget: function() {
6410
		return this.buttonElement;
6411
	},
6412
6413
	_destroy: function() {
6414
		this.element
6415
			.removeClass( "ui-helper-hidden-accessible" );
6416
		this.buttonElement
6417
			.removeClass( baseClasses + " ui-state-active " + typeClasses )
6418
			.removeAttr( "role" )
6419
			.removeAttr( "aria-pressed" )
6420
			.html( this.buttonElement.find(".ui-button-text").html() );
6421
6422
		if ( !this.hasTitle ) {
6423
			this.buttonElement.removeAttr( "title" );
6424
		}
6425
	},
6426
6427
	_setOption: function( key, value ) {
6428
		this._super( key, value );
6429
		if ( key === "disabled" ) {
6430
			this.widget().toggleClass( "ui-state-disabled", !!value );
6431
			this.element.prop( "disabled", !!value );
6432
			if ( value ) {
6433
				if ( this.type === "checkbox" || this.type === "radio" ) {
6434
					this.buttonElement.removeClass( "ui-state-focus" );
6435
				} else {
6436
					this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
6437
				}
6438
			}
6439
			return;
6440
		}
6441
		this._resetButton();
6442
	},
6443
6444
	refresh: function() {
6445
		//See #8237 & #8828
6446
		var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
6447
6448
		if ( isDisabled !== this.options.disabled ) {
6449
			this._setOption( "disabled", isDisabled );
6450
		}
6451
		if ( this.type === "radio" ) {
6452
			radioGroup( this.element[0] ).each(function() {
6453
				if ( $( this ).is( ":checked" ) ) {
6454
					$( this ).button( "widget" )
6455
						.addClass( "ui-state-active" )
6456
						.attr( "aria-pressed", "true" );
6457
				} else {
6458
					$( this ).button( "widget" )
6459
						.removeClass( "ui-state-active" )
6460
						.attr( "aria-pressed", "false" );
6461
				}
6462
			});
6463
		} else if ( this.type === "checkbox" ) {
6464
			if ( this.element.is( ":checked" ) ) {
6465
				this.buttonElement
6466
					.addClass( "ui-state-active" )
6467
					.attr( "aria-pressed", "true" );
6468
			} else {
6469
				this.buttonElement
6470
					.removeClass( "ui-state-active" )
6471
					.attr( "aria-pressed", "false" );
6472
			}
6473
		}
6474
	},
6475
6476
	_resetButton: function() {
6477
		if ( this.type === "input" ) {
6478
			if ( this.options.label ) {
6479
				this.element.val( this.options.label );
6480
			}
6481
			return;
6482
		}
6483
		var buttonElement = this.buttonElement.removeClass( typeClasses ),
6484
			buttonText = $( "<span></span>", this.document[0] )
6485
				.addClass( "ui-button-text" )
6486
				.html( this.options.label )
6487
				.appendTo( buttonElement.empty() )
6488
				.text(),
6489
			icons = this.options.icons,
6490
			multipleIcons = icons.primary && icons.secondary,
6491
			buttonClasses = [];
6492
6493
		if ( icons.primary || icons.secondary ) {
6494
			if ( this.options.text ) {
6495
				buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
6496
			}
6497
6498
			if ( icons.primary ) {
6499
				buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
6500
			}
6501
6502
			if ( icons.secondary ) {
6503
				buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
6504
			}
6505
6506
			if ( !this.options.text ) {
6507
				buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
6508
6509
				if ( !this.hasTitle ) {
6510
					buttonElement.attr( "title", $.trim( buttonText ) );
6511
				}
6512
			}
6513
		} else {
6514
			buttonClasses.push( "ui-button-text-only" );
6515
		}
6516
		buttonElement.addClass( buttonClasses.join( " " ) );
6517
	}
6518
});
6519
6520
$.widget( "ui.buttonset", {
6521
	version: "1.11.4",
6522
	options: {
6523
		items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
6524
	},
6525
6526
	_create: function() {
6527
		this.element.addClass( "ui-buttonset" );
6528
	},
6529
6530
	_init: function() {
6531
		this.refresh();
6532
	},
6533
6534
	_setOption: function( key, value ) {
6535
		if ( key === "disabled" ) {
6536
			this.buttons.button( "option", key, value );
6537
		}
6538
6539
		this._super( key, value );
6540
	},
6541
6542
	refresh: function() {
6543
		var rtl = this.element.css( "direction" ) === "rtl",
6544
			allButtons = this.element.find( this.options.items ),
6545
			existingButtons = allButtons.filter( ":ui-button" );
6546
6547
		// Initialize new buttons
6548
		allButtons.not( ":ui-button" ).button();
6549
6550
		// Refresh existing buttons
6551
		existingButtons.button( "refresh" );
6552
6553
		this.buttons = allButtons
6554
			.map(function() {
6555
				return $( this ).button( "widget" )[ 0 ];
6556
			})
6557
				.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
6558
				.filter( ":first" )
6559
					.addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
6560
				.end()
6561
				.filter( ":last" )
6562
					.addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
6563
				.end()
6564
			.end();
6565
	},
6566
6567
	_destroy: function() {
6568
		this.element.removeClass( "ui-buttonset" );
6569
		this.buttons
6570
			.map(function() {
6571
				return $( this ).button( "widget" )[ 0 ];
6572
			})
6573
				.removeClass( "ui-corner-left ui-corner-right" )
6574
			.end()
6575
			.button( "destroy" );
6576
	}
6577
});
6578
6579
var button = $.ui.button;
6580
6581
6582
/*!
6583
 * jQuery UI Datepicker 1.11.4
6584
 * http://jqueryui.com
6585
 *
6586
 * Copyright jQuery Foundation and other contributors
6587
 * Released under the MIT license.
6588
 * http://jquery.org/license
6589
 *
6590
 * http://api.jqueryui.com/datepicker/
6591
 */
6592
6593
6594
$.extend($.ui, { datepicker: { version: "1.11.4" } });
6595
6596
var datepicker_instActive;
6597
6598
function datepicker_getZindex( elem ) {
6599
	var position, value;
6600
	while ( elem.length && elem[ 0 ] !== document ) {
6601
		// Ignore z-index if position is set to a value where z-index is ignored by the browser
6602
		// This makes behavior of this function consistent across browsers
6603
		// WebKit always returns auto if the element is positioned
6604
		position = elem.css( "position" );
6605
		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
6606
			// IE returns 0 when zIndex is not specified
6607
			// other browsers return a string
6608
			// we ignore the case of nested elements with an explicit value of 0
6609
			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
6610
			value = parseInt( elem.css( "zIndex" ), 10 );
6611
			if ( !isNaN( value ) && value !== 0 ) {
6612
				return value;
6613
			}
6614
		}
6615
		elem = elem.parent();
6616
	}
6617
6618
	return 0;
6619
}
6620
/* Date picker manager.
6621
   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
6622
   Settings for (groups of) date pickers are maintained in an instance object,
6623
   allowing multiple different settings on the same page. */
6624
6625
function Datepicker() {
6626
	this._curInst = null; // The current instance in use
6627
	this._keyEvent = false; // If the last event was a key event
6628
	this._disabledInputs = []; // List of date picker inputs that have been disabled
6629
	this._datepickerShowing = false; // True if the popup picker is showing , false if not
6630
	this._inDialog = false; // True if showing within a "dialog", false if not
6631
	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
6632
	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
6633
	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
6634
	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
6635
	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
6636
	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
6637
	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
6638
	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
6639
	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
6640
	this.regional = []; // Available regional settings, indexed by language code
6641
	this.regional[""] = { // Default regional settings
6642
		closeText: "Done", // Display text for close link
6643
		prevText: "Prev", // Display text for previous month link
6644
		nextText: "Next", // Display text for next month link
6645
		currentText: "Today", // Display text for current month link
6646
		monthNames: ["January","February","March","April","May","June",
6647
			"July","August","September","October","November","December"], // Names of months for drop-down and formatting
6648
		monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
6649
		dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
6650
		dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
6651
		dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
6652
		weekHeader: "Wk", // Column header for week of the year
6653
		dateFormat: "mm/dd/yy", // See format options on parseDate
6654
		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
6655
		isRTL: false, // True if right-to-left language, false if left-to-right
6656
		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
6657
		yearSuffix: "" // Additional text to append to the year in the month headers
6658
	};
6659
	this._defaults = { // Global defaults for all the date picker instances
6660
		showOn: "focus", // "focus" for popup on focus,
6661
			// "button" for trigger button, or "both" for either
6662
		showAnim: "fadeIn", // Name of jQuery animation for popup
6663
		showOptions: {}, // Options for enhanced animations
6664
		defaultDate: null, // Used when field is blank: actual date,
6665
			// +/-number for offset from today, null for today
6666
		appendText: "", // Display text following the input box, e.g. showing the format
6667
		buttonText: "...", // Text for trigger button
6668
		buttonImage: "", // URL for trigger button image
6669
		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
6670
		hideIfNoPrevNext: false, // True to hide next/previous month links
6671
			// if not applicable, false to just disable them
6672
		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
6673
		gotoCurrent: false, // True if today link goes back to current selection instead
6674
		changeMonth: false, // True if month can be selected directly, false if only prev/next
6675
		changeYear: false, // True if year can be selected directly, false if only prev/next
6676
		yearRange: "c-10:c+10", // Range of years to display in drop-down,
6677
			// either relative to today's year (-nn:+nn), relative to currently displayed year
6678
			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
6679
		showOtherMonths: false, // True to show dates in other months, false to leave blank
6680
		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
6681
		showWeek: false, // True to show week of the year, false to not show it
6682
		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
6683
			// takes a Date and returns the number of the week for it
6684
		shortYearCutoff: "+10", // Short year values < this are in the current century,
6685
			// > this are in the previous century,
6686
			// string value starting with "+" for current year + value
6687
		minDate: null, // The earliest selectable date, or null for no limit
6688
		maxDate: null, // The latest selectable date, or null for no limit
6689
		duration: "fast", // Duration of display/closure
6690
		beforeShowDay: null, // Function that takes a date and returns an array with
6691
			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
6692
			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
6693
		beforeShow: null, // Function that takes an input field and
6694
			// returns a set of custom settings for the date picker
6695
		onSelect: null, // Define a callback function when a date is selected
6696
		onChangeMonthYear: null, // Define a callback function when the month or year is changed
6697
		onClose: null, // Define a callback function when the datepicker is closed
6698
		numberOfMonths: 1, // Number of months to show at a time
6699
		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
6700
		stepMonths: 1, // Number of months to step back/forward
6701
		stepBigMonths: 12, // Number of months to step back/forward for the big links
6702
		altField: "", // Selector for an alternate field to store selected dates into
6703
		altFormat: "", // The date format to use for the alternate field
6704
		constrainInput: true, // The input is constrained by the current date format
6705
		showButtonPanel: false, // True to show button panel, false to not show it
6706
		autoSize: false, // True to size the input for the date format, false to leave as is
6707
		disabled: false // The initial disabled state
6708
	};
6709
	$.extend(this._defaults, this.regional[""]);
6710
	this.regional.en = $.extend( true, {}, this.regional[ "" ]);
6711
	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
6712
	this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
6713
}
6714
6715
$.extend(Datepicker.prototype, {
6716
	/* Class name added to elements to indicate already configured with a date picker. */
6717
	markerClassName: "hasDatepicker",
6718
6719
	//Keep track of the maximum number of rows displayed (see #7043)
6720
	maxRows: 4,
6721
6722
	// TODO rename to "widget" when switching to widget factory
6723
	_widgetDatepicker: function() {
6724
		return this.dpDiv;
6725
	},
6726
6727
	/* Override the default settings for all instances of the date picker.
6728
	 * @param  settings  object - the new settings to use as defaults (anonymous object)
6729
	 * @return the manager object
6730
	 */
6731
	setDefaults: function(settings) {
6732
		datepicker_extendRemove(this._defaults, settings || {});
6733
		return this;
6734
	},
6735
6736
	/* Attach the date picker to a jQuery selection.
6737
	 * @param  target	element - the target input field or division or span
6738
	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
6739
	 */
6740
	_attachDatepicker: function(target, settings) {
6741
		var nodeName, inline, inst;
6742
		nodeName = target.nodeName.toLowerCase();
6743
		inline = (nodeName === "div" || nodeName === "span");
6744
		if (!target.id) {
6745
			this.uuid += 1;
6746
			target.id = "dp" + this.uuid;
6747
		}
6748
		inst = this._newInst($(target), inline);
6749
		inst.settings = $.extend({}, settings || {});
6750
		if (nodeName === "input") {
6751
			this._connectDatepicker(target, inst);
6752
		} else if (inline) {
6753
			this._inlineDatepicker(target, inst);
6754
		}
6755
	},
6756
6757
	/* Create a new instance object. */
6758
	_newInst: function(target, inline) {
6759
		var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
6760
		return {id: id, input: target, // associated target
6761
			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
6762
			drawMonth: 0, drawYear: 0, // month being drawn
6763
			inline: inline, // is datepicker inline or not
6764
			dpDiv: (!inline ? this.dpDiv : // presentation div
6765
			datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
6766
	},
6767
6768
	/* Attach the date picker to an input field. */
6769
	_connectDatepicker: function(target, inst) {
6770
		var input = $(target);
6771
		inst.append = $([]);
6772
		inst.trigger = $([]);
6773
		if (input.hasClass(this.markerClassName)) {
6774
			return;
6775
		}
6776
		this._attachments(input, inst);
6777
		input.addClass(this.markerClassName).keydown(this._doKeyDown).
6778
			keypress(this._doKeyPress).keyup(this._doKeyUp);
6779
		this._autoSize(inst);
6780
		$.data(target, "datepicker", inst);
6781
		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
6782
		if( inst.settings.disabled ) {
6783
			this._disableDatepicker( target );
6784
		}
6785
	},
6786
6787
	/* Make attachments based on settings. */
6788
	_attachments: function(input, inst) {
6789
		var showOn, buttonText, buttonImage,
6790
			appendText = this._get(inst, "appendText"),
6791
			isRTL = this._get(inst, "isRTL");
6792
6793
		if (inst.append) {
6794
			inst.append.remove();
6795
		}
6796
		if (appendText) {
6797
			inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
6798
			input[isRTL ? "before" : "after"](inst.append);
6799
		}
6800
6801
		input.unbind("focus", this._showDatepicker);
6802
6803
		if (inst.trigger) {
6804
			inst.trigger.remove();
6805
		}
6806
6807
		showOn = this._get(inst, "showOn");
6808
		if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
6809
			input.focus(this._showDatepicker);
6810
		}
6811
		if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
6812
			buttonText = this._get(inst, "buttonText");
6813
			buttonImage = this._get(inst, "buttonImage");
6814
			inst.trigger = $(this._get(inst, "buttonImageOnly") ?
6815
				$("<img/>").addClass(this._triggerClass).
6816
					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
6817
				$("<button type='button'></button>").addClass(this._triggerClass).
6818
					html(!buttonImage ? buttonText : $("<img/>").attr(
6819
					{ src:buttonImage, alt:buttonText, title:buttonText })));
6820
			input[isRTL ? "before" : "after"](inst.trigger);
6821
			inst.trigger.click(function() {
6822
				if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
6823
					$.datepicker._hideDatepicker();
6824
				} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
6825
					$.datepicker._hideDatepicker();
6826
					$.datepicker._showDatepicker(input[0]);
6827
				} else {
6828
					$.datepicker._showDatepicker(input[0]);
6829
				}
6830
				return false;
6831
			});
6832
		}
6833
	},
6834
6835
	/* Apply the maximum length for the date format. */
6836
	_autoSize: function(inst) {
6837
		if (this._get(inst, "autoSize") && !inst.inline) {
6838
			var findMax, max, maxI, i,
6839
				date = new Date(2009, 12 - 1, 20), // Ensure double digits
6840
				dateFormat = this._get(inst, "dateFormat");
6841
6842
			if (dateFormat.match(/[DM]/)) {
6843
				findMax = function(names) {
6844
					max = 0;
6845
					maxI = 0;
6846
					for (i = 0; i < names.length; i++) {
6847
						if (names[i].length > max) {
6848
							max = names[i].length;
6849
							maxI = i;
6850
						}
6851
					}
6852
					return maxI;
6853
				};
6854
				date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
6855
					"monthNames" : "monthNamesShort"))));
6856
				date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
6857
					"dayNames" : "dayNamesShort"))) + 20 - date.getDay());
6858
			}
6859
			inst.input.attr("size", this._formatDate(inst, date).length);
6860
		}
6861
	},
6862
6863
	/* Attach an inline date picker to a div. */
6864
	_inlineDatepicker: function(target, inst) {
6865
		var divSpan = $(target);
6866
		if (divSpan.hasClass(this.markerClassName)) {
6867
			return;
6868
		}
6869
		divSpan.addClass(this.markerClassName).append(inst.dpDiv);
6870
		$.data(target, "datepicker", inst);
6871
		this._setDate(inst, this._getDefaultDate(inst), true);
6872
		this._updateDatepicker(inst);
6873
		this._updateAlternate(inst);
6874
		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
6875
		if( inst.settings.disabled ) {
6876
			this._disableDatepicker( target );
6877
		}
6878
		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
6879
		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
6880
		inst.dpDiv.css( "display", "block" );
6881
	},
6882
6883
	/* Pop-up the date picker in a "dialog" box.
6884
	 * @param  input element - ignored
6885
	 * @param  date	string or Date - the initial date to display
6886
	 * @param  onSelect  function - the function to call when a date is selected
6887
	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
6888
	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
6889
	 *					event - with x/y coordinates or
6890
	 *					leave empty for default (screen centre)
6891
	 * @return the manager object
6892
	 */
6893
	_dialogDatepicker: function(input, date, onSelect, settings, pos) {
6894
		var id, browserWidth, browserHeight, scrollX, scrollY,
6895
			inst = this._dialogInst; // internal instance
6896
6897
		if (!inst) {
6898
			this.uuid += 1;
6899
			id = "dp" + this.uuid;
6900
			this._dialogInput = $("<input type='text' id='" + id +
6901
				"' style='position: absolute; top: -100px; width: 0px;'/>");
6902
			this._dialogInput.keydown(this._doKeyDown);
6903
			$("body").append(this._dialogInput);
6904
			inst = this._dialogInst = this._newInst(this._dialogInput, false);
6905
			inst.settings = {};
6906
			$.data(this._dialogInput[0], "datepicker", inst);
6907
		}
6908
		datepicker_extendRemove(inst.settings, settings || {});
6909
		date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
6910
		this._dialogInput.val(date);
6911
6912
		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
6913
		if (!this._pos) {
6914
			browserWidth = document.documentElement.clientWidth;
6915
			browserHeight = document.documentElement.clientHeight;
6916
			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
6917
			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
6918
			this._pos = // should use actual width/height below
6919
				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
6920
		}
6921
6922
		// move input on screen for focus, but hidden behind dialog
6923
		this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
6924
		inst.settings.onSelect = onSelect;
6925
		this._inDialog = true;
6926
		this.dpDiv.addClass(this._dialogClass);
6927
		this._showDatepicker(this._dialogInput[0]);
6928
		if ($.blockUI) {
6929
			$.blockUI(this.dpDiv);
6930
		}
6931
		$.data(this._dialogInput[0], "datepicker", inst);
6932
		return this;
6933
	},
6934
6935
	/* Detach a datepicker from its control.
6936
	 * @param  target	element - the target input field or division or span
6937
	 */
6938
	_destroyDatepicker: function(target) {
6939
		var nodeName,
6940
			$target = $(target),
6941
			inst = $.data(target, "datepicker");
6942
6943
		if (!$target.hasClass(this.markerClassName)) {
6944
			return;
6945
		}
6946
6947
		nodeName = target.nodeName.toLowerCase();
6948
		$.removeData(target, "datepicker");
6949
		if (nodeName === "input") {
6950
			inst.append.remove();
6951
			inst.trigger.remove();
6952
			$target.removeClass(this.markerClassName).
6953
				unbind("focus", this._showDatepicker).
6954
				unbind("keydown", this._doKeyDown).
6955
				unbind("keypress", this._doKeyPress).
6956
				unbind("keyup", this._doKeyUp);
6957
		} else if (nodeName === "div" || nodeName === "span") {
6958
			$target.removeClass(this.markerClassName).empty();
6959
		}
6960
6961
		if ( datepicker_instActive === inst ) {
6962
			datepicker_instActive = null;
6963
		}
6964
	},
6965
6966
	/* Enable the date picker to a jQuery selection.
6967
	 * @param  target	element - the target input field or division or span
6968
	 */
6969
	_enableDatepicker: function(target) {
6970
		var nodeName, inline,
6971
			$target = $(target),
6972
			inst = $.data(target, "datepicker");
6973
6974
		if (!$target.hasClass(this.markerClassName)) {
6975
			return;
6976
		}
6977
6978
		nodeName = target.nodeName.toLowerCase();
6979
		if (nodeName === "input") {
6980
			target.disabled = false;
6981
			inst.trigger.filter("button").
6982
				each(function() { this.disabled = false; }).end().
6983
				filter("img").css({opacity: "1.0", cursor: ""});
6984
		} else if (nodeName === "div" || nodeName === "span") {
6985
			inline = $target.children("." + this._inlineClass);
6986
			inline.children().removeClass("ui-state-disabled");
6987
			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
6988
				prop("disabled", false);
6989
		}
6990
		this._disabledInputs = $.map(this._disabledInputs,
6991
			function(value) { return (value === target ? null : value); }); // delete entry
6992
	},
6993
6994
	/* Disable the date picker to a jQuery selection.
6995
	 * @param  target	element - the target input field or division or span
6996
	 */
6997
	_disableDatepicker: function(target) {
6998
		var nodeName, inline,
6999
			$target = $(target),
7000
			inst = $.data(target, "datepicker");
7001
7002
		if (!$target.hasClass(this.markerClassName)) {
7003
			return;
7004
		}
7005
7006
		nodeName = target.nodeName.toLowerCase();
7007
		if (nodeName === "input") {
7008
			target.disabled = true;
7009
			inst.trigger.filter("button").
7010
				each(function() { this.disabled = true; }).end().
7011
				filter("img").css({opacity: "0.5", cursor: "default"});
7012
		} else if (nodeName === "div" || nodeName === "span") {
7013
			inline = $target.children("." + this._inlineClass);
7014
			inline.children().addClass("ui-state-disabled");
7015
			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
7016
				prop("disabled", true);
7017
		}
7018
		this._disabledInputs = $.map(this._disabledInputs,
7019
			function(value) { return (value === target ? null : value); }); // delete entry
7020
		this._disabledInputs[this._disabledInputs.length] = target;
7021
	},
7022
7023
	/* Is the first field in a jQuery collection disabled as a datepicker?
7024
	 * @param  target	element - the target input field or division or span
7025
	 * @return boolean - true if disabled, false if enabled
7026
	 */
7027
	_isDisabledDatepicker: function(target) {
7028
		if (!target) {
7029
			return false;
7030
		}
7031
		for (var i = 0; i < this._disabledInputs.length; i++) {
7032
			if (this._disabledInputs[i] === target) {
7033
				return true;
7034
			}
7035
		}
7036
		return false;
7037
	},
7038
7039
	/* Retrieve the instance data for the target control.
7040
	 * @param  target  element - the target input field or division or span
7041
	 * @return  object - the associated instance data
7042
	 * @throws  error if a jQuery problem getting data
7043
	 */
7044
	_getInst: function(target) {
7045
		try {
7046
			return $.data(target, "datepicker");
7047
		}
7048
		catch (err) {
7049
			throw "Missing instance data for this datepicker";
7050
		}
7051
	},
7052
7053
	/* Update or retrieve the settings for a date picker attached to an input field or division.
7054
	 * @param  target  element - the target input field or division or span
7055
	 * @param  name	object - the new settings to update or
7056
	 *				string - the name of the setting to change or retrieve,
7057
	 *				when retrieving also "all" for all instance settings or
7058
	 *				"defaults" for all global defaults
7059
	 * @param  value   any - the new value for the setting
7060
	 *				(omit if above is an object or to retrieve a value)
7061
	 */
7062
	_optionDatepicker: function(target, name, value) {
7063
		var settings, date, minDate, maxDate,
7064
			inst = this._getInst(target);
7065
7066
		if (arguments.length === 2 && typeof name === "string") {
7067
			return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
7068
				(inst ? (name === "all" ? $.extend({}, inst.settings) :
7069
				this._get(inst, name)) : null));
7070
		}
7071
7072
		settings = name || {};
7073
		if (typeof name === "string") {
7074
			settings = {};
7075
			settings[name] = value;
7076
		}
7077
7078
		if (inst) {
7079
			if (this._curInst === inst) {
7080
				this._hideDatepicker();
7081
			}
7082
7083
			date = this._getDateDatepicker(target, true);
7084
			minDate = this._getMinMaxDate(inst, "min");
7085
			maxDate = this._getMinMaxDate(inst, "max");
7086
			datepicker_extendRemove(inst.settings, settings);
7087
			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
7088
			if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
7089
				inst.settings.minDate = this._formatDate(inst, minDate);
7090
			}
7091
			if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
7092
				inst.settings.maxDate = this._formatDate(inst, maxDate);
7093
			}
7094
			if ( "disabled" in settings ) {
7095
				if ( settings.disabled ) {
7096
					this._disableDatepicker(target);
7097
				} else {
7098
					this._enableDatepicker(target);
7099
				}
7100
			}
7101
			this._attachments($(target), inst);
7102
			this._autoSize(inst);
7103
			this._setDate(inst, date);
7104
			this._updateAlternate(inst);
7105
			this._updateDatepicker(inst);
7106
		}
7107
	},
7108
7109
	// change method deprecated
7110
	_changeDatepicker: function(target, name, value) {
7111
		this._optionDatepicker(target, name, value);
7112
	},
7113
7114
	/* Redraw the date picker attached to an input field or division.
7115
	 * @param  target  element - the target input field or division or span
7116
	 */
7117
	_refreshDatepicker: function(target) {
7118
		var inst = this._getInst(target);
7119
		if (inst) {
7120
			this._updateDatepicker(inst);
7121
		}
7122
	},
7123
7124
	/* Set the dates for a jQuery selection.
7125
	 * @param  target element - the target input field or division or span
7126
	 * @param  date	Date - the new date
7127
	 */
7128
	_setDateDatepicker: function(target, date) {
7129
		var inst = this._getInst(target);
7130
		if (inst) {
7131
			this._setDate(inst, date);
7132
			this._updateDatepicker(inst);
7133
			this._updateAlternate(inst);
7134
		}
7135
	},
7136
7137
	/* Get the date(s) for the first entry in a jQuery selection.
7138
	 * @param  target element - the target input field or division or span
7139
	 * @param  noDefault boolean - true if no default date is to be used
7140
	 * @return Date - the current date
7141
	 */
7142
	_getDateDatepicker: function(target, noDefault) {
7143
		var inst = this._getInst(target);
7144
		if (inst && !inst.inline) {
7145
			this._setDateFromField(inst, noDefault);
7146
		}
7147
		return (inst ? this._getDate(inst) : null);
7148
	},
7149
7150
	/* Handle keystrokes. */
7151
	_doKeyDown: function(event) {
7152
		var onSelect, dateStr, sel,
7153
			inst = $.datepicker._getInst(event.target),
7154
			handled = true,
7155
			isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
7156
7157
		inst._keyEvent = true;
7158
		if ($.datepicker._datepickerShowing) {
7159
			switch (event.keyCode) {
7160
				case 9: $.datepicker._hideDatepicker();
7161
						handled = false;
7162
						break; // hide on tab out
7163
				case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
7164
									$.datepicker._currentClass + ")", inst.dpDiv);
7165
						if (sel[0]) {
7166
							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
7167
						}
7168
7169
						onSelect = $.datepicker._get(inst, "onSelect");
7170
						if (onSelect) {
7171
							dateStr = $.datepicker._formatDate(inst);
7172
7173
							// trigger custom callback
7174
							onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
7175
						} else {
7176
							$.datepicker._hideDatepicker();
7177
						}
7178
7179
						return false; // don't submit the form
7180
				case 27: $.datepicker._hideDatepicker();
7181
						break; // hide on escape
7182
				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7183
							-$.datepicker._get(inst, "stepBigMonths") :
7184
							-$.datepicker._get(inst, "stepMonths")), "M");
7185
						break; // previous month/year on page up/+ ctrl
7186
				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7187
							+$.datepicker._get(inst, "stepBigMonths") :
7188
							+$.datepicker._get(inst, "stepMonths")), "M");
7189
						break; // next month/year on page down/+ ctrl
7190
				case 35: if (event.ctrlKey || event.metaKey) {
7191
							$.datepicker._clearDate(event.target);
7192
						}
7193
						handled = event.ctrlKey || event.metaKey;
7194
						break; // clear on ctrl or command +end
7195
				case 36: if (event.ctrlKey || event.metaKey) {
7196
							$.datepicker._gotoToday(event.target);
7197
						}
7198
						handled = event.ctrlKey || event.metaKey;
7199
						break; // current on ctrl or command +home
7200
				case 37: if (event.ctrlKey || event.metaKey) {
7201
							$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
7202
						}
7203
						handled = event.ctrlKey || event.metaKey;
7204
						// -1 day on ctrl or command +left
7205
						if (event.originalEvent.altKey) {
7206
							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
7207
								-$.datepicker._get(inst, "stepBigMonths") :
7208
								-$.datepicker._get(inst, "stepMonths")), "M");
7209
						}
7210
						// next month/year on alt +left on Mac
7211
						break;
7212
				case 38: if (event.ctrlKey || event.metaKey) {
7213
							$.datepicker._adjustDate(event.target, -7, "D");
7214
						}
7215
						handled = event.ctrlKey || event.metaKey;
7216
						break; // -1 week on ctrl or command +up
7217
				case 39: if (event.ctrlKey || event.metaKey) {
7218
							$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
7219
						}
7220
						handled = event.ctrlKey || event.metaKey;
7221
						// +1 day on ctrl or command +right
7222
						if (event.originalEvent.altKey) {
7223
							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
7224
								+$.datepicker._get(inst, "stepBigMonths") :
7225
								+$.datepicker._get(inst, "stepMonths")), "M");
7226
						}
7227
						// next month/year on alt +right
7228
						break;
7229
				case 40: if (event.ctrlKey || event.metaKey) {
7230
							$.datepicker._adjustDate(event.target, +7, "D");
7231
						}
7232
						handled = event.ctrlKey || event.metaKey;
7233
						break; // +1 week on ctrl or command +down
7234
				default: handled = false;
7235
			}
7236
		} else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
7237
			$.datepicker._showDatepicker(this);
7238
		} else {
7239
			handled = false;
7240
		}
7241
7242
		if (handled) {
7243
			event.preventDefault();
7244
			event.stopPropagation();
7245
		}
7246
	},
7247
7248
	/* Filter entered characters - based on date format. */
7249
	_doKeyPress: function(event) {
7250
		var chars, chr,
7251
			inst = $.datepicker._getInst(event.target);
7252
7253
		if ($.datepicker._get(inst, "constrainInput")) {
7254
			chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
7255
			chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
7256
			return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
7257
		}
7258
	},
7259
7260
	/* Synchronise manual entry and field/alternate field. */
7261
	_doKeyUp: function(event) {
7262
		var date,
7263
			inst = $.datepicker._getInst(event.target);
7264
7265
		if (inst.input.val() !== inst.lastVal) {
7266
			try {
7267
				date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
7268
					(inst.input ? inst.input.val() : null),
7269
					$.datepicker._getFormatConfig(inst));
7270
7271
				if (date) { // only if valid
7272
					$.datepicker._setDateFromField(inst);
7273
					$.datepicker._updateAlternate(inst);
7274
					$.datepicker._updateDatepicker(inst);
7275
				}
7276
			}
7277
			catch (err) {
7278
			}
7279
		}
7280
		return true;
7281
	},
7282
7283
	/* Pop-up the date picker for a given input field.
7284
	 * If false returned from beforeShow event handler do not show.
7285
	 * @param  input  element - the input field attached to the date picker or
7286
	 *					event - if triggered by focus
7287
	 */
7288
	_showDatepicker: function(input) {
7289
		input = input.target || input;
7290
		if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
7291
			input = $("input", input.parentNode)[0];
7292
		}
7293
7294
		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
7295
			return;
7296
		}
7297
7298
		var inst, beforeShow, beforeShowSettings, isFixed,
7299
			offset, showAnim, duration;
7300
7301
		inst = $.datepicker._getInst(input);
7302
		if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
7303
			$.datepicker._curInst.dpDiv.stop(true, true);
7304
			if ( inst && $.datepicker._datepickerShowing ) {
7305
				$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
7306
			}
7307
		}
7308
7309
		beforeShow = $.datepicker._get(inst, "beforeShow");
7310
		beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
7311
		if(beforeShowSettings === false){
7312
			return;
7313
		}
7314
		datepicker_extendRemove(inst.settings, beforeShowSettings);
7315
7316
		inst.lastVal = null;
7317
		$.datepicker._lastInput = input;
7318
		$.datepicker._setDateFromField(inst);
7319
7320
		if ($.datepicker._inDialog) { // hide cursor
7321
			input.value = "";
7322
		}
7323
		if (!$.datepicker._pos) { // position below input
7324
			$.datepicker._pos = $.datepicker._findPos(input);
7325
			$.datepicker._pos[1] += input.offsetHeight; // add the height
7326
		}
7327
7328
		isFixed = false;
7329
		$(input).parents().each(function() {
7330
			isFixed |= $(this).css("position") === "fixed";
7331
			return !isFixed;
7332
		});
7333
7334
		offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
7335
		$.datepicker._pos = null;
7336
		//to avoid flashes on Firefox
7337
		inst.dpDiv.empty();
7338
		// determine sizing offscreen
7339
		inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
7340
		$.datepicker._updateDatepicker(inst);
7341
		// fix width for dynamic number of date pickers
7342
		// and adjust position before showing
7343
		offset = $.datepicker._checkOffset(inst, offset, isFixed);
7344
		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
7345
			"static" : (isFixed ? "fixed" : "absolute")), display: "none",
7346
			left: offset.left + "px", top: offset.top + "px"});
7347
7348
		if (!inst.inline) {
7349
			showAnim = $.datepicker._get(inst, "showAnim");
7350
			duration = $.datepicker._get(inst, "duration");
7351
			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
7352
			$.datepicker._datepickerShowing = true;
7353
7354
			if ( $.effects && $.effects.effect[ showAnim ] ) {
7355
				inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
7356
			} else {
7357
				inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
7358
			}
7359
7360
			if ( $.datepicker._shouldFocusInput( inst ) ) {
7361
				inst.input.focus();
7362
			}
7363
7364
			$.datepicker._curInst = inst;
7365
		}
7366
	},
7367
7368
	/* Generate the date picker content. */
7369
	_updateDatepicker: function(inst) {
7370
		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
7371
		datepicker_instActive = inst; // for delegate hover events
7372
		inst.dpDiv.empty().append(this._generateHTML(inst));
7373
		this._attachHandlers(inst);
7374
7375
		var origyearshtml,
7376
			numMonths = this._getNumberOfMonths(inst),
7377
			cols = numMonths[1],
7378
			width = 17,
7379
			activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
7380
7381
		if ( activeCell.length > 0 ) {
7382
			datepicker_handleMouseover.apply( activeCell.get( 0 ) );
7383
		}
7384
7385
		inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
7386
		if (cols > 1) {
7387
			inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
7388
		}
7389
		inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
7390
			"Class"]("ui-datepicker-multi");
7391
		inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
7392
			"Class"]("ui-datepicker-rtl");
7393
7394
		if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
7395
			inst.input.focus();
7396
		}
7397
7398
		// deffered render of the years select (to avoid flashes on Firefox)
7399
		if( inst.yearshtml ){
7400
			origyearshtml = inst.yearshtml;
7401
			setTimeout(function(){
7402
				//assure that inst.yearshtml didn't change.
7403
				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
7404
					inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
7405
				}
7406
				origyearshtml = inst.yearshtml = null;
7407
			}, 0);
7408
		}
7409
	},
7410
7411
	// #6694 - don't focus the input if it's already focused
7412
	// this breaks the change event in IE
7413
	// Support: IE and jQuery <1.9
7414
	_shouldFocusInput: function( inst ) {
7415
		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
7416
	},
7417
7418
	/* Check positioning to remain on screen. */
7419
	_checkOffset: function(inst, offset, isFixed) {
7420
		var dpWidth = inst.dpDiv.outerWidth(),
7421
			dpHeight = inst.dpDiv.outerHeight(),
7422
			inputWidth = inst.input ? inst.input.outerWidth() : 0,
7423
			inputHeight = inst.input ? inst.input.outerHeight() : 0,
7424
			viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
7425
			viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
7426
7427
		offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
7428
		offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
7429
		offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
7430
7431
		// now check if datepicker is showing outside window viewport - move to a better place if so.
7432
		offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
7433
			Math.abs(offset.left + dpWidth - viewWidth) : 0);
7434
		offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
7435
			Math.abs(dpHeight + inputHeight) : 0);
7436
7437
		return offset;
7438
	},
7439
7440
	/* Find an object's position on the screen. */
7441
	_findPos: function(obj) {
7442
		var position,
7443
			inst = this._getInst(obj),
7444
			isRTL = this._get(inst, "isRTL");
7445
7446
		while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
7447
			obj = obj[isRTL ? "previousSibling" : "nextSibling"];
7448
		}
7449
7450
		position = $(obj).offset();
7451
		return [position.left, position.top];
7452
	},
7453
7454
	/* Hide the date picker from view.
7455
	 * @param  input  element - the input field attached to the date picker
7456
	 */
7457
	_hideDatepicker: function(input) {
7458
		var showAnim, duration, postProcess, onClose,
7459
			inst = this._curInst;
7460
7461
		if (!inst || (input && inst !== $.data(input, "datepicker"))) {
7462
			return;
7463
		}
7464
7465
		if (this._datepickerShowing) {
7466
			showAnim = this._get(inst, "showAnim");
7467
			duration = this._get(inst, "duration");
7468
			postProcess = function() {
7469
				$.datepicker._tidyDialog(inst);
7470
			};
7471
7472
			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
7473
			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
7474
				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
7475
			} else {
7476
				inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
7477
					(showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
7478
			}
7479
7480
			if (!showAnim) {
7481
				postProcess();
7482
			}
7483
			this._datepickerShowing = false;
7484
7485
			onClose = this._get(inst, "onClose");
7486
			if (onClose) {
7487
				onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
7488
			}
7489
7490
			this._lastInput = null;
7491
			if (this._inDialog) {
7492
				this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
7493
				if ($.blockUI) {
7494
					$.unblockUI();
7495
					$("body").append(this.dpDiv);
7496
				}
7497
			}
7498
			this._inDialog = false;
7499
		}
7500
	},
7501
7502
	/* Tidy up after a dialog display. */
7503
	_tidyDialog: function(inst) {
7504
		inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
7505
	},
7506
7507
	/* Close date picker if clicked elsewhere. */
7508
	_checkExternalClick: function(event) {
7509
		if (!$.datepicker._curInst) {
7510
			return;
7511
		}
7512
7513
		var $target = $(event.target),
7514
			inst = $.datepicker._getInst($target[0]);
7515
7516
		if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
7517
				$target.parents("#" + $.datepicker._mainDivId).length === 0 &&
7518
				!$target.hasClass($.datepicker.markerClassName) &&
7519
				!$target.closest("." + $.datepicker._triggerClass).length &&
7520
				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
7521
			( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
7522
				$.datepicker._hideDatepicker();
7523
		}
7524
	},
7525
7526
	/* Adjust one of the date sub-fields. */
7527
	_adjustDate: function(id, offset, period) {
7528
		var target = $(id),
7529
			inst = this._getInst(target[0]);
7530
7531
		if (this._isDisabledDatepicker(target[0])) {
7532
			return;
7533
		}
7534
		this._adjustInstDate(inst, offset +
7535
			(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
7536
			period);
7537
		this._updateDatepicker(inst);
7538
	},
7539
7540
	/* Action for current link. */
7541
	_gotoToday: function(id) {
7542
		var date,
7543
			target = $(id),
7544
			inst = this._getInst(target[0]);
7545
7546
		if (this._get(inst, "gotoCurrent") && inst.currentDay) {
7547
			inst.selectedDay = inst.currentDay;
7548
			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
7549
			inst.drawYear = inst.selectedYear = inst.currentYear;
7550
		} else {
7551
			date = new Date();
7552
			inst.selectedDay = date.getDate();
7553
			inst.drawMonth = inst.selectedMonth = date.getMonth();
7554
			inst.drawYear = inst.selectedYear = date.getFullYear();
7555
		}
7556
		this._notifyChange(inst);
7557
		this._adjustDate(target);
7558
	},
7559
7560
	/* Action for selecting a new month/year. */
7561
	_selectMonthYear: function(id, select, period) {
7562
		var target = $(id),
7563
			inst = this._getInst(target[0]);
7564
7565
		inst["selected" + (period === "M" ? "Month" : "Year")] =
7566
		inst["draw" + (period === "M" ? "Month" : "Year")] =
7567
			parseInt(select.options[select.selectedIndex].value,10);
7568
7569
		this._notifyChange(inst);
7570
		this._adjustDate(target);
7571
	},
7572
7573
	/* Action for selecting a day. */
7574
	_selectDay: function(id, month, year, td) {
7575
		var inst,
7576
			target = $(id);
7577
7578
		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
7579
			return;
7580
		}
7581
7582
		inst = this._getInst(target[0]);
7583
		inst.selectedDay = inst.currentDay = $("a", td).html();
7584
		inst.selectedMonth = inst.currentMonth = month;
7585
		inst.selectedYear = inst.currentYear = year;
7586
		this._selectDate(id, this._formatDate(inst,
7587
			inst.currentDay, inst.currentMonth, inst.currentYear));
7588
	},
7589
7590
	/* Erase the input field and hide the date picker. */
7591
	_clearDate: function(id) {
7592
		var target = $(id);
7593
		this._selectDate(target, "");
7594
	},
7595
7596
	/* Update the input field with the selected date. */
7597
	_selectDate: function(id, dateStr) {
7598
		var onSelect,
7599
			target = $(id),
7600
			inst = this._getInst(target[0]);
7601
7602
		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
7603
		if (inst.input) {
7604
			inst.input.val(dateStr);
7605
		}
7606
		this._updateAlternate(inst);
7607
7608
		onSelect = this._get(inst, "onSelect");
7609
		if (onSelect) {
7610
			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
7611
		} else if (inst.input) {
7612
			inst.input.trigger("change"); // fire the change event
7613
		}
7614
7615
		if (inst.inline){
7616
			this._updateDatepicker(inst);
7617
		} else {
7618
			this._hideDatepicker();
7619
			this._lastInput = inst.input[0];
7620
			if (typeof(inst.input[0]) !== "object") {
7621
				inst.input.focus(); // restore focus
7622
			}
7623
			this._lastInput = null;
7624
		}
7625
	},
7626
7627
	/* Update any alternate field to synchronise with the main field. */
7628
	_updateAlternate: function(inst) {
7629
		var altFormat, date, dateStr,
7630
			altField = this._get(inst, "altField");
7631
7632
		if (altField) { // update alternate field too
7633
			altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
7634
			date = this._getDate(inst);
7635
			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
7636
			$(altField).each(function() { $(this).val(dateStr); });
7637
		}
7638
	},
7639
7640
	/* Set as beforeShowDay function to prevent selection of weekends.
7641
	 * @param  date  Date - the date to customise
7642
	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
7643
	 */
7644
	noWeekends: function(date) {
7645
		var day = date.getDay();
7646
		return [(day > 0 && day < 6), ""];
7647
	},
7648
7649
	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
7650
	 * @param  date  Date - the date to get the week for
7651
	 * @return  number - the number of the week within the year that contains this date
7652
	 */
7653
	iso8601Week: function(date) {
7654
		var time,
7655
			checkDate = new Date(date.getTime());
7656
7657
		// Find Thursday of this week starting on Monday
7658
		checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
7659
7660
		time = checkDate.getTime();
7661
		checkDate.setMonth(0); // Compare with Jan 1
7662
		checkDate.setDate(1);
7663
		return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
7664
	},
7665
7666
	/* Parse a string value into a date object.
7667
	 * See formatDate below for the possible formats.
7668
	 *
7669
	 * @param  format string - the expected format of the date
7670
	 * @param  value string - the date in the above format
7671
	 * @param  settings Object - attributes include:
7672
	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
7673
	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
7674
	 *					dayNames		string[7] - names of the days from Sunday (optional)
7675
	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
7676
	 *					monthNames		string[12] - names of the months (optional)
7677
	 * @return  Date - the extracted date value or null if value is blank
7678
	 */
7679
	parseDate: function (format, value, settings) {
7680
		if (format == null || value == null) {
7681
			throw "Invalid arguments";
7682
		}
7683
7684
		value = (typeof value === "object" ? value.toString() : value + "");
7685
		if (value === "") {
7686
			return null;
7687
		}
7688
7689
		var iFormat, dim, extra,
7690
			iValue = 0,
7691
			shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
7692
			shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
7693
				new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
7694
			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
7695
			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
7696
			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
7697
			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
7698
			year = -1,
7699
			month = -1,
7700
			day = -1,
7701
			doy = -1,
7702
			literal = false,
7703
			date,
7704
			// Check whether a format character is doubled
7705
			lookAhead = function(match) {
7706
				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
7707
				if (matches) {
7708
					iFormat++;
7709
				}
7710
				return matches;
7711
			},
7712
			// Extract a number from the string value
7713
			getNumber = function(match) {
7714
				var isDoubled = lookAhead(match),
7715
					size = (match === "@" ? 14 : (match === "!" ? 20 :
7716
					(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
7717
					minSize = (match === "y" ? size : 1),
7718
					digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
7719
					num = value.substring(iValue).match(digits);
7720
				if (!num) {
7721
					throw "Missing number at position " + iValue;
7722
				}
7723
				iValue += num[0].length;
7724
				return parseInt(num[0], 10);
7725
			},
7726
			// Extract a name from the string value and convert to an index
7727
			getName = function(match, shortNames, longNames) {
7728
				var index = -1,
7729
					names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
7730
						return [ [k, v] ];
7731
					}).sort(function (a, b) {
7732
						return -(a[1].length - b[1].length);
7733
					});
7734
7735
				$.each(names, function (i, pair) {
7736
					var name = pair[1];
7737
					if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
7738
						index = pair[0];
7739
						iValue += name.length;
7740
						return false;
7741
					}
7742
				});
7743
				if (index !== -1) {
7744
					return index + 1;
7745
				} else {
7746
					throw "Unknown name at position " + iValue;
7747
				}
7748
			},
7749
			// Confirm that a literal character matches the string value
7750
			checkLiteral = function() {
7751
				if (value.charAt(iValue) !== format.charAt(iFormat)) {
7752
					throw "Unexpected literal at position " + iValue;
7753
				}
7754
				iValue++;
7755
			};
7756
7757
		for (iFormat = 0; iFormat < format.length; iFormat++) {
7758
			if (literal) {
7759
				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
7760
					literal = false;
7761
				} else {
7762
					checkLiteral();
7763
				}
7764
			} else {
7765
				switch (format.charAt(iFormat)) {
7766
					case "d":
7767
						day = getNumber("d");
7768
						break;
7769
					case "D":
7770
						getName("D", dayNamesShort, dayNames);
7771
						break;
7772
					case "o":
7773
						doy = getNumber("o");
7774
						break;
7775
					case "m":
7776
						month = getNumber("m");
7777
						break;
7778
					case "M":
7779
						month = getName("M", monthNamesShort, monthNames);
7780
						break;
7781
					case "y":
7782
						year = getNumber("y");
7783
						break;
7784
					case "@":
7785
						date = new Date(getNumber("@"));
7786
						year = date.getFullYear();
7787
						month = date.getMonth() + 1;
7788
						day = date.getDate();
7789
						break;
7790
					case "!":
7791
						date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
7792
						year = date.getFullYear();
7793
						month = date.getMonth() + 1;
7794
						day = date.getDate();
7795
						break;
7796
					case "'":
7797
						if (lookAhead("'")){
7798
							checkLiteral();
7799
						} else {
7800
							literal = true;
7801
						}
7802
						break;
7803
					default:
7804
						checkLiteral();
7805
				}
7806
			}
7807
		}
7808
7809
		if (iValue < value.length){
7810
			extra = value.substr(iValue);
7811
			if (!/^\s+/.test(extra)) {
7812
				throw "Extra/unparsed characters found in date: " + extra;
7813
			}
7814
		}
7815
7816
		if (year === -1) {
7817
			year = new Date().getFullYear();
7818
		} else if (year < 100) {
7819
			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
7820
				(year <= shortYearCutoff ? 0 : -100);
7821
		}
7822
7823
		if (doy > -1) {
7824
			month = 1;
7825
			day = doy;
7826
			do {
7827
				dim = this._getDaysInMonth(year, month - 1);
7828
				if (day <= dim) {
7829
					break;
7830
				}
7831
				month++;
7832
				day -= dim;
7833
			} while (true);
7834
		}
7835
7836
		date = this._daylightSavingAdjust(new Date(year, month - 1, day));
7837
		if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
7838
			throw "Invalid date"; // E.g. 31/02/00
7839
		}
7840
		return date;
7841
	},
7842
7843
	/* Standard date formats. */
7844
	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
7845
	COOKIE: "D, dd M yy",
7846
	ISO_8601: "yy-mm-dd",
7847
	RFC_822: "D, d M y",
7848
	RFC_850: "DD, dd-M-y",
7849
	RFC_1036: "D, d M y",
7850
	RFC_1123: "D, d M yy",
7851
	RFC_2822: "D, d M yy",
7852
	RSS: "D, d M y", // RFC 822
7853
	TICKS: "!",
7854
	TIMESTAMP: "@",
7855
	W3C: "yy-mm-dd", // ISO 8601
7856
7857
	_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
7858
		Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
7859
7860
	/* Format a date object into a string value.
7861
	 * The format can be combinations of the following:
7862
	 * d  - day of month (no leading zero)
7863
	 * dd - day of month (two digit)
7864
	 * o  - day of year (no leading zeros)
7865
	 * oo - day of year (three digit)
7866
	 * D  - day name short
7867
	 * DD - day name long
7868
	 * m  - month of year (no leading zero)
7869
	 * mm - month of year (two digit)
7870
	 * M  - month name short
7871
	 * MM - month name long
7872
	 * y  - year (two digit)
7873
	 * yy - year (four digit)
7874
	 * @ - Unix timestamp (ms since 01/01/1970)
7875
	 * ! - Windows ticks (100ns since 01/01/0001)
7876
	 * "..." - literal text
7877
	 * '' - single quote
7878
	 *
7879
	 * @param  format string - the desired format of the date
7880
	 * @param  date Date - the date value to format
7881
	 * @param  settings Object - attributes include:
7882
	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
7883
	 *					dayNames		string[7] - names of the days from Sunday (optional)
7884
	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
7885
	 *					monthNames		string[12] - names of the months (optional)
7886
	 * @return  string - the date in the above format
7887
	 */
7888
	formatDate: function (format, date, settings) {
7889
		if (!date) {
7890
			return "";
7891
		}
7892
7893
		var iFormat,
7894
			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
7895
			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
7896
			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
7897
			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
7898
			// Check whether a format character is doubled
7899
			lookAhead = function(match) {
7900
				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
7901
				if (matches) {
7902
					iFormat++;
7903
				}
7904
				return matches;
7905
			},
7906
			// Format a number, with leading zero if necessary
7907
			formatNumber = function(match, value, len) {
7908
				var num = "" + value;
7909
				if (lookAhead(match)) {
7910
					while (num.length < len) {
7911
						num = "0" + num;
7912
					}
7913
				}
7914
				return num;
7915
			},
7916
			// Format a name, short or long as requested
7917
			formatName = function(match, value, shortNames, longNames) {
7918
				return (lookAhead(match) ? longNames[value] : shortNames[value]);
7919
			},
7920
			output = "",
7921
			literal = false;
7922
7923
		if (date) {
7924
			for (iFormat = 0; iFormat < format.length; iFormat++) {
7925
				if (literal) {
7926
					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
7927
						literal = false;
7928
					} else {
7929
						output += format.charAt(iFormat);
7930
					}
7931
				} else {
7932
					switch (format.charAt(iFormat)) {
7933
						case "d":
7934
							output += formatNumber("d", date.getDate(), 2);
7935
							break;
7936
						case "D":
7937
							output += formatName("D", date.getDay(), dayNamesShort, dayNames);
7938
							break;
7939
						case "o":
7940
							output += formatNumber("o",
7941
								Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
7942
							break;
7943
						case "m":
7944
							output += formatNumber("m", date.getMonth() + 1, 2);
7945
							break;
7946
						case "M":
7947
							output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
7948
							break;
7949
						case "y":
7950
							output += (lookAhead("y") ? date.getFullYear() :
7951
								(date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
7952
							break;
7953
						case "@":
7954
							output += date.getTime();
7955
							break;
7956
						case "!":
7957
							output += date.getTime() * 10000 + this._ticksTo1970;
7958
							break;
7959
						case "'":
7960
							if (lookAhead("'")) {
7961
								output += "'";
7962
							} else {
7963
								literal = true;
7964
							}
7965
							break;
7966
						default:
7967
							output += format.charAt(iFormat);
7968
					}
7969
				}
7970
			}
7971
		}
7972
		return output;
7973
	},
7974
7975
	/* Extract all possible characters from the date format. */
7976
	_possibleChars: function (format) {
7977
		var iFormat,
7978
			chars = "",
7979
			literal = false,
7980
			// Check whether a format character is doubled
7981
			lookAhead = function(match) {
7982
				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
7983
				if (matches) {
7984
					iFormat++;
7985
				}
7986
				return matches;
7987
			};
7988
7989
		for (iFormat = 0; iFormat < format.length; iFormat++) {
7990
			if (literal) {
7991
				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
7992
					literal = false;
7993
				} else {
7994
					chars += format.charAt(iFormat);
7995
				}
7996
			} else {
7997
				switch (format.charAt(iFormat)) {
7998
					case "d": case "m": case "y": case "@":
7999
						chars += "0123456789";
8000
						break;
8001
					case "D": case "M":
8002
						return null; // Accept anything
8003
					case "'":
8004
						if (lookAhead("'")) {
8005
							chars += "'";
8006
						} else {
8007
							literal = true;
8008
						}
8009
						break;
8010
					default:
8011
						chars += format.charAt(iFormat);
8012
				}
8013
			}
8014
		}
8015
		return chars;
8016
	},
8017
8018
	/* Get a setting value, defaulting if necessary. */
8019
	_get: function(inst, name) {
8020
		return inst.settings[name] !== undefined ?
8021
			inst.settings[name] : this._defaults[name];
8022
	},
8023
8024
	/* Parse existing date and initialise date picker. */
8025
	_setDateFromField: function(inst, noDefault) {
8026
		if (inst.input.val() === inst.lastVal) {
8027
			return;
8028
		}
8029
8030
		var dateFormat = this._get(inst, "dateFormat"),
8031
			dates = inst.lastVal = inst.input ? inst.input.val() : null,
8032
			defaultDate = this._getDefaultDate(inst),
8033
			date = defaultDate,
8034
			settings = this._getFormatConfig(inst);
8035
8036
		try {
8037
			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
8038
		} catch (event) {
8039
			dates = (noDefault ? "" : dates);
8040
		}
8041
		inst.selectedDay = date.getDate();
8042
		inst.drawMonth = inst.selectedMonth = date.getMonth();
8043
		inst.drawYear = inst.selectedYear = date.getFullYear();
8044
		inst.currentDay = (dates ? date.getDate() : 0);
8045
		inst.currentMonth = (dates ? date.getMonth() : 0);
8046
		inst.currentYear = (dates ? date.getFullYear() : 0);
8047
		this._adjustInstDate(inst);
8048
	},
8049
8050
	/* Retrieve the default date shown on opening. */
8051
	_getDefaultDate: function(inst) {
8052
		return this._restrictMinMax(inst,
8053
			this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
8054
	},
8055
8056
	/* A date may be specified as an exact value or a relative one. */
8057
	_determineDate: function(inst, date, defaultDate) {
8058
		var offsetNumeric = function(offset) {
8059
				var date = new Date();
8060
				date.setDate(date.getDate() + offset);
8061
				return date;
8062
			},
8063
			offsetString = function(offset) {
8064
				try {
8065
					return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
8066
						offset, $.datepicker._getFormatConfig(inst));
8067
				}
8068
				catch (e) {
8069
					// Ignore
8070
				}
8071
8072
				var date = (offset.toLowerCase().match(/^c/) ?
8073
					$.datepicker._getDate(inst) : null) || new Date(),
8074
					year = date.getFullYear(),
8075
					month = date.getMonth(),
8076
					day = date.getDate(),
8077
					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
8078
					matches = pattern.exec(offset);
8079
8080
				while (matches) {
8081
					switch (matches[2] || "d") {
8082
						case "d" : case "D" :
8083
							day += parseInt(matches[1],10); break;
8084
						case "w" : case "W" :
8085
							day += parseInt(matches[1],10) * 7; break;
8086
						case "m" : case "M" :
8087
							month += parseInt(matches[1],10);
8088
							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
8089
							break;
8090
						case "y": case "Y" :
8091
							year += parseInt(matches[1],10);
8092
							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
8093
							break;
8094
					}
8095
					matches = pattern.exec(offset);
8096
				}
8097
				return new Date(year, month, day);
8098
			},
8099
			newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
8100
				(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
8101
8102
		newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
8103
		if (newDate) {
8104
			newDate.setHours(0);
8105
			newDate.setMinutes(0);
8106
			newDate.setSeconds(0);
8107
			newDate.setMilliseconds(0);
8108
		}
8109
		return this._daylightSavingAdjust(newDate);
8110
	},
8111
8112
	/* Handle switch to/from daylight saving.
8113
	 * Hours may be non-zero on daylight saving cut-over:
8114
	 * > 12 when midnight changeover, but then cannot generate
8115
	 * midnight datetime, so jump to 1AM, otherwise reset.
8116
	 * @param  date  (Date) the date to check
8117
	 * @return  (Date) the corrected date
8118
	 */
8119
	_daylightSavingAdjust: function(date) {
8120
		if (!date) {
8121
			return null;
8122
		}
8123
		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
8124
		return date;
8125
	},
8126
8127
	/* Set the date(s) directly. */
8128
	_setDate: function(inst, date, noChange) {
8129
		var clear = !date,
8130
			origMonth = inst.selectedMonth,
8131
			origYear = inst.selectedYear,
8132
			newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
8133
8134
		inst.selectedDay = inst.currentDay = newDate.getDate();
8135
		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
8136
		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
8137
		if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
8138
			this._notifyChange(inst);
8139
		}
8140
		this._adjustInstDate(inst);
8141
		if (inst.input) {
8142
			inst.input.val(clear ? "" : this._formatDate(inst));
8143
		}
8144
	},
8145
8146
	/* Retrieve the date(s) directly. */
8147
	_getDate: function(inst) {
8148
		var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
8149
			this._daylightSavingAdjust(new Date(
8150
			inst.currentYear, inst.currentMonth, inst.currentDay)));
8151
			return startDate;
8152
	},
8153
8154
	/* Attach the onxxx handlers.  These are declared statically so
8155
	 * they work with static code transformers like Caja.
8156
	 */
8157
	_attachHandlers: function(inst) {
8158
		var stepMonths = this._get(inst, "stepMonths"),
8159
			id = "#" + inst.id.replace( /\\\\/g, "\\" );
8160
		inst.dpDiv.find("[data-handler]").map(function () {
8161
			var handler = {
8162
				prev: function () {
8163
					$.datepicker._adjustDate(id, -stepMonths, "M");
8164
				},
8165
				next: function () {
8166
					$.datepicker._adjustDate(id, +stepMonths, "M");
8167
				},
8168
				hide: function () {
8169
					$.datepicker._hideDatepicker();
8170
				},
8171
				today: function () {
8172
					$.datepicker._gotoToday(id);
8173
				},
8174
				selectDay: function () {
8175
					$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
8176
					return false;
8177
				},
8178
				selectMonth: function () {
8179
					$.datepicker._selectMonthYear(id, this, "M");
8180
					return false;
8181
				},
8182
				selectYear: function () {
8183
					$.datepicker._selectMonthYear(id, this, "Y");
8184
					return false;
8185
				}
8186
			};
8187
			$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
8188
		});
8189
	},
8190
8191
	/* Generate the HTML for the current state of the date picker. */
8192
	_generateHTML: function(inst) {
8193
		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
8194
			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
8195
			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
8196
			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
8197
			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
8198
			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
8199
			tempDate = new Date(),
8200
			today = this._daylightSavingAdjust(
8201
				new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
8202
			isRTL = this._get(inst, "isRTL"),
8203
			showButtonPanel = this._get(inst, "showButtonPanel"),
8204
			hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
8205
			navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
8206
			numMonths = this._getNumberOfMonths(inst),
8207
			showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
8208
			stepMonths = this._get(inst, "stepMonths"),
8209
			isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
8210
			currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
8211
				new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
8212
			minDate = this._getMinMaxDate(inst, "min"),
8213
			maxDate = this._getMinMaxDate(inst, "max"),
8214
			drawMonth = inst.drawMonth - showCurrentAtPos,
8215
			drawYear = inst.drawYear;
8216
8217
		if (drawMonth < 0) {
8218
			drawMonth += 12;
8219
			drawYear--;
8220
		}
8221
		if (maxDate) {
8222
			maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
8223
				maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
8224
			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
8225
			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
8226
				drawMonth--;
8227
				if (drawMonth < 0) {
8228
					drawMonth = 11;
8229
					drawYear--;
8230
				}
8231
			}
8232
		}
8233
		inst.drawMonth = drawMonth;
8234
		inst.drawYear = drawYear;
8235
8236
		prevText = this._get(inst, "prevText");
8237
		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
8238
			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
8239
			this._getFormatConfig(inst)));
8240
8241
		prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
8242
			"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
8243
			" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
8244
			(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
8245
8246
		nextText = this._get(inst, "nextText");
8247
		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
8248
			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
8249
			this._getFormatConfig(inst)));
8250
8251
		next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
8252
			"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
8253
			" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
8254
			(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
8255
8256
		currentText = this._get(inst, "currentText");
8257
		gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
8258
		currentText = (!navigationAsDateFormat ? currentText :
8259
			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
8260
8261
		controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
8262
			this._get(inst, "closeText") + "</button>" : "");
8263
8264
		buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
8265
			(this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
8266
			">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
8267
8268
		firstDay = parseInt(this._get(inst, "firstDay"),10);
8269
		firstDay = (isNaN(firstDay) ? 0 : firstDay);
8270
8271
		showWeek = this._get(inst, "showWeek");
8272
		dayNames = this._get(inst, "dayNames");
8273
		dayNamesMin = this._get(inst, "dayNamesMin");
8274
		monthNames = this._get(inst, "monthNames");
8275
		monthNamesShort = this._get(inst, "monthNamesShort");
8276
		beforeShowDay = this._get(inst, "beforeShowDay");
8277
		showOtherMonths = this._get(inst, "showOtherMonths");
8278
		selectOtherMonths = this._get(inst, "selectOtherMonths");
8279
		defaultDate = this._getDefaultDate(inst);
8280
		html = "";
8281
		dow;
8282
		for (row = 0; row < numMonths[0]; row++) {
8283
			group = "";
8284
			this.maxRows = 4;
8285
			for (col = 0; col < numMonths[1]; col++) {
8286
				selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
8287
				cornerClass = " ui-corner-all";
8288
				calender = "";
8289
				if (isMultiMonth) {
8290
					calender += "<div class='ui-datepicker-group";
8291
					if (numMonths[1] > 1) {
8292
						switch (col) {
8293
							case 0: calender += " ui-datepicker-group-first";
8294
								cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
8295
							case numMonths[1]-1: calender += " ui-datepicker-group-last";
8296
								cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
8297
							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
8298
						}
8299
					}
8300
					calender += "'>";
8301
				}
8302
				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
8303
					(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
8304
					(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
8305
					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
8306
					row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
8307
					"</div><table class='ui-datepicker-calendar'><thead>" +
8308
					"<tr>";
8309
				thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
8310
				for (dow = 0; dow < 7; dow++) { // days of the week
8311
					day = (dow + firstDay) % 7;
8312
					thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
8313
						"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
8314
				}
8315
				calender += thead + "</tr></thead><tbody>";
8316
				daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
8317
				if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
8318
					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
8319
				}
8320
				leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
8321
				curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
8322
				numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
8323
				this.maxRows = numRows;
8324
				printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
8325
				for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
8326
					calender += "<tr>";
8327
					tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
8328
						this._get(inst, "calculateWeek")(printDate) + "</td>");
8329
					for (dow = 0; dow < 7; dow++) { // create date picker days
8330
						daySettings = (beforeShowDay ?
8331
							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
8332
						otherMonth = (printDate.getMonth() !== drawMonth);
8333
						unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
8334
							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
8335
						tbody += "<td class='" +
8336
							((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
8337
							(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
8338
							((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
8339
							(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
8340
							// or defaultDate is current printedDate and defaultDate is selectedDate
8341
							" " + this._dayOverClass : "") + // highlight selected day
8342
							(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") +  // highlight unselectable days
8343
							(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
8344
							(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
8345
							(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
8346
							((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
8347
							(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
8348
							(otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
8349
							(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
8350
							(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
8351
							(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
8352
							(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
8353
							"' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
8354
						printDate.setDate(printDate.getDate() + 1);
8355
						printDate = this._daylightSavingAdjust(printDate);
8356
					}
8357
					calender += tbody + "</tr>";
8358
				}
8359
				drawMonth++;
8360
				if (drawMonth > 11) {
8361
					drawMonth = 0;
8362
					drawYear++;
8363
				}
8364
				calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
8365
							((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
8366
				group += calender;
8367
			}
8368
			html += group;
8369
		}
8370
		html += buttonPanel;
8371
		inst._keyEvent = false;
8372
		return html;
8373
	},
8374
8375
	/* Generate the month and year header. */
8376
	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
8377
			secondary, monthNames, monthNamesShort) {
8378
8379
		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
8380
			changeMonth = this._get(inst, "changeMonth"),
8381
			changeYear = this._get(inst, "changeYear"),
8382
			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
8383
			html = "<div class='ui-datepicker-title'>",
8384
			monthHtml = "";
8385
8386
		// month selection
8387
		if (secondary || !changeMonth) {
8388
			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
8389
		} else {
8390
			inMinYear = (minDate && minDate.getFullYear() === drawYear);
8391
			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
8392
			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
8393
			for ( month = 0; month < 12; month++) {
8394
				if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
8395
					monthHtml += "<option value='" + month + "'" +
8396
						(month === drawMonth ? " selected='selected'" : "") +
8397
						">" + monthNamesShort[month] + "</option>";
8398
				}
8399
			}
8400
			monthHtml += "</select>";
8401
		}
8402
8403
		if (!showMonthAfterYear) {
8404
			html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
8405
		}
8406
8407
		// year selection
8408
		if ( !inst.yearshtml ) {
8409
			inst.yearshtml = "";
8410
			if (secondary || !changeYear) {
8411
				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
8412
			} else {
8413
				// determine range of years to display
8414
				years = this._get(inst, "yearRange").split(":");
8415
				thisYear = new Date().getFullYear();
8416
				determineYear = function(value) {
8417
					var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
8418
						(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
8419
						parseInt(value, 10)));
8420
					return (isNaN(year) ? thisYear : year);
8421
				};
8422
				year = determineYear(years[0]);
8423
				endYear = Math.max(year, determineYear(years[1] || ""));
8424
				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
8425
				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
8426
				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
8427
				for (; year <= endYear; year++) {
8428
					inst.yearshtml += "<option value='" + year + "'" +
8429
						(year === drawYear ? " selected='selected'" : "") +
8430
						">" + year + "</option>";
8431
				}
8432
				inst.yearshtml += "</select>";
8433
8434
				html += inst.yearshtml;
8435
				inst.yearshtml = null;
8436
			}
8437
		}
8438
8439
		html += this._get(inst, "yearSuffix");
8440
		if (showMonthAfterYear) {
8441
			html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
8442
		}
8443
		html += "</div>"; // Close datepicker_header
8444
		return html;
8445
	},
8446
8447
	/* Adjust one of the date sub-fields. */
8448
	_adjustInstDate: function(inst, offset, period) {
8449
		var year = inst.drawYear + (period === "Y" ? offset : 0),
8450
			month = inst.drawMonth + (period === "M" ? offset : 0),
8451
			day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
8452
			date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
8453
8454
		inst.selectedDay = date.getDate();
8455
		inst.drawMonth = inst.selectedMonth = date.getMonth();
8456
		inst.drawYear = inst.selectedYear = date.getFullYear();
8457
		if (period === "M" || period === "Y") {
8458
			this._notifyChange(inst);
8459
		}
8460
	},
8461
8462
	/* Ensure a date is within any min/max bounds. */
8463
	_restrictMinMax: function(inst, date) {
8464
		var minDate = this._getMinMaxDate(inst, "min"),
8465
			maxDate = this._getMinMaxDate(inst, "max"),
8466
			newDate = (minDate && date < minDate ? minDate : date);
8467
		return (maxDate && newDate > maxDate ? maxDate : newDate);
8468
	},
8469
8470
	/* Notify change of month/year. */
8471
	_notifyChange: function(inst) {
8472
		var onChange = this._get(inst, "onChangeMonthYear");
8473
		if (onChange) {
8474
			onChange.apply((inst.input ? inst.input[0] : null),
8475
				[inst.selectedYear, inst.selectedMonth + 1, inst]);
8476
		}
8477
	},
8478
8479
	/* Determine the number of months to show. */
8480
	_getNumberOfMonths: function(inst) {
8481
		var numMonths = this._get(inst, "numberOfMonths");
8482
		return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
8483
	},
8484
8485
	/* Determine the current maximum date - ensure no time components are set. */
8486
	_getMinMaxDate: function(inst, minMax) {
8487
		return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
8488
	},
8489
8490
	/* Find the number of days in a given month. */
8491
	_getDaysInMonth: function(year, month) {
8492
		return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
8493
	},
8494
8495
	/* Find the day of the week of the first of a month. */
8496
	_getFirstDayOfMonth: function(year, month) {
8497
		return new Date(year, month, 1).getDay();
8498
	},
8499
8500
	/* Determines if we should allow a "next/prev" month display change. */
8501
	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
8502
		var numMonths = this._getNumberOfMonths(inst),
8503
			date = this._daylightSavingAdjust(new Date(curYear,
8504
			curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
8505
8506
		if (offset < 0) {
8507
			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
8508
		}
8509
		return this._isInRange(inst, date);
8510
	},
8511
8512
	/* Is the given date in the accepted range? */
8513
	_isInRange: function(inst, date) {
8514
		var yearSplit, currentYear,
8515
			minDate = this._getMinMaxDate(inst, "min"),
8516
			maxDate = this._getMinMaxDate(inst, "max"),
8517
			minYear = null,
8518
			maxYear = null,
8519
			years = this._get(inst, "yearRange");
8520
			if (years){
8521
				yearSplit = years.split(":");
8522
				currentYear = new Date().getFullYear();
8523
				minYear = parseInt(yearSplit[0], 10);
8524
				maxYear = parseInt(yearSplit[1], 10);
8525
				if ( yearSplit[0].match(/[+\-].*/) ) {
8526
					minYear += currentYear;
8527
				}
8528
				if ( yearSplit[1].match(/[+\-].*/) ) {
8529
					maxYear += currentYear;
8530
				}
8531
			}
8532
8533
		return ((!minDate || date.getTime() >= minDate.getTime()) &&
8534
			(!maxDate || date.getTime() <= maxDate.getTime()) &&
8535
			(!minYear || date.getFullYear() >= minYear) &&
8536
			(!maxYear || date.getFullYear() <= maxYear));
8537
	},
8538
8539
	/* Provide the configuration settings for formatting/parsing. */
8540
	_getFormatConfig: function(inst) {
8541
		var shortYearCutoff = this._get(inst, "shortYearCutoff");
8542
		shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
8543
			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
8544
		return {shortYearCutoff: shortYearCutoff,
8545
			dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
8546
			monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
8547
	},
8548
8549
	/* Format the given date for display. */
8550
	_formatDate: function(inst, day, month, year) {
8551
		if (!day) {
8552
			inst.currentDay = inst.selectedDay;
8553
			inst.currentMonth = inst.selectedMonth;
8554
			inst.currentYear = inst.selectedYear;
8555
		}
8556
		var date = (day ? (typeof day === "object" ? day :
8557
			this._daylightSavingAdjust(new Date(year, month, day))) :
8558
			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
8559
		return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
8560
	}
8561
});
8562
8563
/*
8564
 * Bind hover events for datepicker elements.
8565
 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
8566
 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
8567
 */
8568
function datepicker_bindHover(dpDiv) {
8569
	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
8570
	return dpDiv.delegate(selector, "mouseout", function() {
8571
			$(this).removeClass("ui-state-hover");
8572
			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
8573
				$(this).removeClass("ui-datepicker-prev-hover");
8574
			}
8575
			if (this.className.indexOf("ui-datepicker-next") !== -1) {
8576
				$(this).removeClass("ui-datepicker-next-hover");
8577
			}
8578
		})
8579
		.delegate( selector, "mouseover", datepicker_handleMouseover );
8580
}
8581
8582
function datepicker_handleMouseover() {
8583
	if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
8584
		$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
8585
		$(this).addClass("ui-state-hover");
8586
		if (this.className.indexOf("ui-datepicker-prev") !== -1) {
8587
			$(this).addClass("ui-datepicker-prev-hover");
8588
		}
8589
		if (this.className.indexOf("ui-datepicker-next") !== -1) {
8590
			$(this).addClass("ui-datepicker-next-hover");
8591
		}
8592
	}
8593
}
8594
8595
/* jQuery extend now ignores nulls! */
8596
function datepicker_extendRemove(target, props) {
8597
	$.extend(target, props);
8598
	for (var name in props) {
8599
		if (props[name] == null) {
8600
			target[name] = props[name];
8601
		}
8602
	}
8603
	return target;
8604
}
8605
8606
/* Invoke the datepicker functionality.
8607
   @param  options  string - a command, optionally followed by additional parameters or
8608
					Object - settings for attaching new datepicker functionality
8609
   @return  jQuery object */
8610
$.fn.datepicker = function(options){
8611
8612
	/* Verify an empty collection wasn't passed - Fixes #6976 */
8613
	if ( !this.length ) {
8614
		return this;
8615
	}
8616
8617
	/* Initialise the date picker. */
8618
	if (!$.datepicker.initialized) {
8619
		$(document).mousedown($.datepicker._checkExternalClick);
8620
		$.datepicker.initialized = true;
8621
	}
8622
8623
	/* Append datepicker main container to body if not exist. */
8624
	if ($("#"+$.datepicker._mainDivId).length === 0) {
8625
		$("body").append($.datepicker.dpDiv);
8626
	}
8627
8628
	var otherArgs = Array.prototype.slice.call(arguments, 1);
8629
	if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
8630
		return $.datepicker["_" + options + "Datepicker"].
8631
			apply($.datepicker, [this[0]].concat(otherArgs));
8632
	}
8633
	if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
8634
		return $.datepicker["_" + options + "Datepicker"].
8635
			apply($.datepicker, [this[0]].concat(otherArgs));
8636
	}
8637
	return this.each(function() {
8638
		typeof options === "string" ?
8639
			$.datepicker["_" + options + "Datepicker"].
8640
				apply($.datepicker, [this].concat(otherArgs)) :
8641
			$.datepicker._attachDatepicker(this, options);
8642
	});
8643
};
8644
8645
$.datepicker = new Datepicker(); // singleton instance
8646
$.datepicker.initialized = false;
8647
$.datepicker.uuid = new Date().getTime();
8648
$.datepicker.version = "1.11.4";
8649
8650
var datepicker = $.datepicker;
8651
8652
8653
/*!
8654
 * jQuery UI Progressbar 1.11.4
8655
 * http://jqueryui.com
8656
 *
8657
 * Copyright jQuery Foundation and other contributors
8658
 * Released under the MIT license.
8659
 * http://jquery.org/license
8660
 *
8661
 * http://api.jqueryui.com/progressbar/
8662
 */
8663
8664
8665
var progressbar = $.widget( "ui.progressbar", {
8666
	version: "1.11.4",
8667
	options: {
8668
		max: 100,
8669
		value: 0,
8670
8671
		change: null,
8672
		complete: null
8673
	},
8674
8675
	min: 0,
8676
8677
	_create: function() {
8678
		// Constrain initial value
8679
		this.oldValue = this.options.value = this._constrainedValue();
8680
8681
		this.element
8682
			.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
8683
			.attr({
8684
				// Only set static values, aria-valuenow and aria-valuemax are
8685
				// set inside _refreshValue()
8686
				role: "progressbar",
8687
				"aria-valuemin": this.min
8688
			});
8689
8690
		this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
8691
			.appendTo( this.element );
8692
8693
		this._refreshValue();
8694
	},
8695
8696
	_destroy: function() {
8697
		this.element
8698
			.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
8699
			.removeAttr( "role" )
8700
			.removeAttr( "aria-valuemin" )
8701
			.removeAttr( "aria-valuemax" )
8702
			.removeAttr( "aria-valuenow" );
8703
8704
		this.valueDiv.remove();
8705
	},
8706
8707
	value: function( newValue ) {
8708
		if ( newValue === undefined ) {
8709
			return this.options.value;
8710
		}
8711
8712
		this.options.value = this._constrainedValue( newValue );
8713
		this._refreshValue();
8714
	},
8715
8716
	_constrainedValue: function( newValue ) {
8717
		if ( newValue === undefined ) {
8718
			newValue = this.options.value;
8719
		}
8720
8721
		this.indeterminate = newValue === false;
8722
8723
		// sanitize value
8724
		if ( typeof newValue !== "number" ) {
8725
			newValue = 0;
8726
		}
8727
8728
		return this.indeterminate ? false :
8729
			Math.min( this.options.max, Math.max( this.min, newValue ) );
8730
	},
8731
8732
	_setOptions: function( options ) {
8733
		// Ensure "value" option is set after other values (like max)
8734
		var value = options.value;
8735
		delete options.value;
8736
8737
		this._super( options );
8738
8739
		this.options.value = this._constrainedValue( value );
8740
		this._refreshValue();
8741
	},
8742
8743
	_setOption: function( key, value ) {
8744
		if ( key === "max" ) {
8745
			// Don't allow a max less than min
8746
			value = Math.max( this.min, value );
8747
		}
8748
		if ( key === "disabled" ) {
8749
			this.element
8750
				.toggleClass( "ui-state-disabled", !!value )
8751
				.attr( "aria-disabled", value );
8752
		}
8753
		this._super( key, value );
8754
	},
8755
8756
	_percentage: function() {
8757
		return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
8758
	},
8759
8760
	_refreshValue: function() {
8761
		var value = this.options.value,
8762
			percentage = this._percentage();
8763
8764
		this.valueDiv
8765
			.toggle( this.indeterminate || value > this.min )
8766
			.toggleClass( "ui-corner-right", value === this.options.max )
8767
			.width( percentage.toFixed(0) + "%" );
8768
8769
		this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
8770
8771
		if ( this.indeterminate ) {
8772
			this.element.removeAttr( "aria-valuenow" );
8773
			if ( !this.overlayDiv ) {
8774
				this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
8775
			}
8776
		} else {
8777
			this.element.attr({
8778
				"aria-valuemax": this.options.max,
8779
				"aria-valuenow": value
8780
			});
8781
			if ( this.overlayDiv ) {
8782
				this.overlayDiv.remove();
8783
				this.overlayDiv = null;
8784
			}
8785
		}
8786
8787
		if ( this.oldValue !== value ) {
8788
			this.oldValue = value;
8789
			this._trigger( "change" );
8790
		}
8791
		if ( value === this.options.max ) {
8792
			this._trigger( "complete" );
8793
		}
8794
	}
8795
});
8796
8797
8798
/*!
8799
 * jQuery UI Slider 1.11.4
8800
 * http://jqueryui.com
8801
 *
8802
 * Copyright jQuery Foundation and other contributors
8803
 * Released under the MIT license.
8804
 * http://jquery.org/license
8805
 *
8806
 * http://api.jqueryui.com/slider/
8807
 */
8808
8809
8810
var slider = $.widget( "ui.slider", $.ui.mouse, {
8811
	version: "1.11.4",
8812
	widgetEventPrefix: "slide",
8813
8814
	options: {
8815
		animate: false,
8816
		distance: 0,
8817
		max: 100,
8818
		min: 0,
8819
		orientation: "horizontal",
8820
		range: false,
8821
		step: 1,
8822
		value: 0,
8823
		values: null,
8824
8825
		// callbacks
8826
		change: null,
8827
		slide: null,
8828
		start: null,
8829
		stop: null
8830
	},
8831
8832
	// number of pages in a slider
8833
	// (how many times can you page up/down to go through the whole range)
8834
	numPages: 5,
8835
8836
	_create: function() {
8837
		this._keySliding = false;
8838
		this._mouseSliding = false;
8839
		this._animateOff = true;
8840
		this._handleIndex = null;
8841
		this._detectOrientation();
8842
		this._mouseInit();
8843
		this._calculateNewMax();
8844
8845
		this.element
8846
			.addClass( "ui-slider" +
8847
				" ui-slider-" + this.orientation +
8848
				" ui-widget" +
8849
				" ui-widget-content" +
8850
				" ui-corner-all");
8851
8852
		this._refresh();
8853
		this._setOption( "disabled", this.options.disabled );
8854
8855
		this._animateOff = false;
8856
	},
8857
8858
	_refresh: function() {
8859
		this._createRange();
8860
		this._createHandles();
8861
		this._setupEvents();
8862
		this._refreshValue();
8863
	},
8864
8865
	_createHandles: function() {
8866
		var i, handleCount,
8867
			options = this.options,
8868
			existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
8869
			handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
8870
			handles = [];
8871
8872
		handleCount = ( options.values && options.values.length ) || 1;
8873
8874
		if ( existingHandles.length > handleCount ) {
8875
			existingHandles.slice( handleCount ).remove();
8876
			existingHandles = existingHandles.slice( 0, handleCount );
8877
		}
8878
8879
		for ( i = existingHandles.length; i < handleCount; i++ ) {
8880
			handles.push( handle );
8881
		}
8882
8883
		this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
8884
8885
		this.handle = this.handles.eq( 0 );
8886
8887
		this.handles.each(function( i ) {
8888
			$( this ).data( "ui-slider-handle-index", i );
8889
		});
8890
	},
8891
8892
	_createRange: function() {
8893
		var options = this.options,
8894
			classes = "";
8895
8896
		if ( options.range ) {
8897
			if ( options.range === true ) {
8898
				if ( !options.values ) {
8899
					options.values = [ this._valueMin(), this._valueMin() ];
8900
				} else if ( options.values.length && options.values.length !== 2 ) {
8901
					options.values = [ options.values[0], options.values[0] ];
8902
				} else if ( $.isArray( options.values ) ) {
8903
					options.values = options.values.slice(0);
8904
				}
8905
			}
8906
8907
			if ( !this.range || !this.range.length ) {
8908
				this.range = $( "<div></div>" )
8909
					.appendTo( this.element );
8910
8911
				classes = "ui-slider-range" +
8912
				// note: this isn't the most fittingly semantic framework class for this element,
8913
				// but worked best visually with a variety of themes
8914
				" ui-widget-header ui-corner-all";
8915
			} else {
8916
				this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
8917
					// Handle range switching from true to min/max
8918
					.css({
8919
						"left": "",
8920
						"bottom": ""
8921
					});
8922
			}
8923
8924
			this.range.addClass( classes +
8925
				( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
8926
		} else {
8927
			if ( this.range ) {
8928
				this.range.remove();
8929
			}
8930
			this.range = null;
8931
		}
8932
	},
8933
8934
	_setupEvents: function() {
8935
		this._off( this.handles );
8936
		this._on( this.handles, this._handleEvents );
8937
		this._hoverable( this.handles );
8938
		this._focusable( this.handles );
8939
	},
8940
8941
	_destroy: function() {
8942
		this.handles.remove();
8943
		if ( this.range ) {
8944
			this.range.remove();
8945
		}
8946
8947
		this.element
8948
			.removeClass( "ui-slider" +
8949
				" ui-slider-horizontal" +
8950
				" ui-slider-vertical" +
8951
				" ui-widget" +
8952
				" ui-widget-content" +
8953
				" ui-corner-all" );
8954
8955
		this._mouseDestroy();
8956
	},
8957
8958
	_mouseCapture: function( event ) {
8959
		var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
8960
			that = this,
8961
			o = this.options;
8962
8963
		if ( o.disabled ) {
8964
			return false;
8965
		}
8966
8967
		this.elementSize = {
8968
			width: this.element.outerWidth(),
8969
			height: this.element.outerHeight()
8970
		};
8971
		this.elementOffset = this.element.offset();
8972
8973
		position = { x: event.pageX, y: event.pageY };
8974
		normValue = this._normValueFromMouse( position );
8975
		distance = this._valueMax() - this._valueMin() + 1;
8976
		this.handles.each(function( i ) {
8977
			var thisDistance = Math.abs( normValue - that.values(i) );
8978
			if (( distance > thisDistance ) ||
8979
				( distance === thisDistance &&
8980
					(i === that._lastChangedValue || that.values(i) === o.min ))) {
8981
				distance = thisDistance;
8982
				closestHandle = $( this );
8983
				index = i;
8984
			}
8985
		});
8986
8987
		allowed = this._start( event, index );
8988
		if ( allowed === false ) {
8989
			return false;
8990
		}
8991
		this._mouseSliding = true;
8992
8993
		this._handleIndex = index;
8994
8995
		closestHandle
8996
			.addClass( "ui-state-active" )
8997
			.focus();
8998
8999
		offset = closestHandle.offset();
9000
		mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
9001
		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
9002
			left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
9003
			top: event.pageY - offset.top -
9004
				( closestHandle.height() / 2 ) -
9005
				( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
9006
				( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
9007
				( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
9008
		};
9009
9010
		if ( !this.handles.hasClass( "ui-state-hover" ) ) {
9011
			this._slide( event, index, normValue );
9012
		}
9013
		this._animateOff = true;
9014
		return true;
9015
	},
9016
9017
	_mouseStart: function() {
9018
		return true;
9019
	},
9020
9021
	_mouseDrag: function( event ) {
9022
		var position = { x: event.pageX, y: event.pageY },
9023
			normValue = this._normValueFromMouse( position );
9024
9025
		this._slide( event, this._handleIndex, normValue );
9026
9027
		return false;
9028
	},
9029
9030
	_mouseStop: function( event ) {
9031
		this.handles.removeClass( "ui-state-active" );
9032
		this._mouseSliding = false;
9033
9034
		this._stop( event, this._handleIndex );
9035
		this._change( event, this._handleIndex );
9036
9037
		this._handleIndex = null;
9038
		this._clickOffset = null;
9039
		this._animateOff = false;
9040
9041
		return false;
9042
	},
9043
9044
	_detectOrientation: function() {
9045
		this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
9046
	},
9047
9048
	_normValueFromMouse: function( position ) {
9049
		var pixelTotal,
9050
			pixelMouse,
9051
			percentMouse,
9052
			valueTotal,
9053
			valueMouse;
9054
9055
		if ( this.orientation === "horizontal" ) {
9056
			pixelTotal = this.elementSize.width;
9057
			pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
9058
		} else {
9059
			pixelTotal = this.elementSize.height;
9060
			pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
9061
		}
9062
9063
		percentMouse = ( pixelMouse / pixelTotal );
9064
		if ( percentMouse > 1 ) {
9065
			percentMouse = 1;
9066
		}
9067
		if ( percentMouse < 0 ) {
9068
			percentMouse = 0;
9069
		}
9070
		if ( this.orientation === "vertical" ) {
9071
			percentMouse = 1 - percentMouse;
9072
		}
9073
9074
		valueTotal = this._valueMax() - this._valueMin();
9075
		valueMouse = this._valueMin() + percentMouse * valueTotal;
9076
9077
		return this._trimAlignValue( valueMouse );
9078
	},
9079
9080
	_start: function( event, index ) {
9081
		var uiHash = {
9082
			handle: this.handles[ index ],
9083
			value: this.value()
9084
		};
9085
		if ( this.options.values && this.options.values.length ) {
9086
			uiHash.value = this.values( index );
9087
			uiHash.values = this.values();
9088
		}
9089
		return this._trigger( "start", event, uiHash );
9090
	},
9091
9092
	_slide: function( event, index, newVal ) {
9093
		var otherVal,
9094
			newValues,
9095
			allowed;
9096
9097
		if ( this.options.values && this.options.values.length ) {
9098
			otherVal = this.values( index ? 0 : 1 );
9099
9100
			if ( ( this.options.values.length === 2 && this.options.range === true ) &&
9101
					( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
9102
				) {
9103
				newVal = otherVal;
9104
			}
9105
9106
			if ( newVal !== this.values( index ) ) {
9107
				newValues = this.values();
9108
				newValues[ index ] = newVal;
9109
				// A slide can be canceled by returning false from the slide callback
9110
				allowed = this._trigger( "slide", event, {
9111
					handle: this.handles[ index ],
9112
					value: newVal,
9113
					values: newValues
9114
				} );
9115
				otherVal = this.values( index ? 0 : 1 );
9116
				if ( allowed !== false ) {
9117
					this.values( index, newVal );
9118
				}
9119
			}
9120
		} else {
9121
			if ( newVal !== this.value() ) {
9122
				// A slide can be canceled by returning false from the slide callback
9123
				allowed = this._trigger( "slide", event, {
9124
					handle: this.handles[ index ],
9125
					value: newVal
9126
				} );
9127
				if ( allowed !== false ) {
9128
					this.value( newVal );
9129
				}
9130
			}
9131
		}
9132
	},
9133
9134
	_stop: function( event, index ) {
9135
		var uiHash = {
9136
			handle: this.handles[ index ],
9137
			value: this.value()
9138
		};
9139
		if ( this.options.values && this.options.values.length ) {
9140
			uiHash.value = this.values( index );
9141
			uiHash.values = this.values();
9142
		}
9143
9144
		this._trigger( "stop", event, uiHash );
9145
	},
9146
9147
	_change: function( event, index ) {
9148
		if ( !this._keySliding && !this._mouseSliding ) {
9149
			var uiHash = {
9150
				handle: this.handles[ index ],
9151
				value: this.value()
9152
			};
9153
			if ( this.options.values && this.options.values.length ) {
9154
				uiHash.value = this.values( index );
9155
				uiHash.values = this.values();
9156
			}
9157
9158
			//store the last changed value index for reference when handles overlap
9159
			this._lastChangedValue = index;
9160
9161
			this._trigger( "change", event, uiHash );
9162
		}
9163
	},
9164
9165
	value: function( newValue ) {
9166
		if ( arguments.length ) {
9167
			this.options.value = this._trimAlignValue( newValue );
9168
			this._refreshValue();
9169
			this._change( null, 0 );
9170
			return;
9171
		}
9172
9173
		return this._value();
9174
	},
9175
9176
	values: function( index, newValue ) {
9177
		var vals,
9178
			newValues,
9179
			i;
9180
9181
		if ( arguments.length > 1 ) {
9182
			this.options.values[ index ] = this._trimAlignValue( newValue );
9183
			this._refreshValue();
9184
			this._change( null, index );
9185
			return;
9186
		}
9187
9188
		if ( arguments.length ) {
9189
			if ( $.isArray( arguments[ 0 ] ) ) {
9190
				vals = this.options.values;
9191
				newValues = arguments[ 0 ];
9192
				for ( i = 0; i < vals.length; i += 1 ) {
9193
					vals[ i ] = this._trimAlignValue( newValues[ i ] );
9194
					this._change( null, i );
9195
				}
9196
				this._refreshValue();
9197
			} else {
9198
				if ( this.options.values && this.options.values.length ) {
9199
					return this._values( index );
9200
				} else {
9201
					return this.value();
9202
				}
9203
			}
9204
		} else {
9205
			return this._values();
9206
		}
9207
	},
9208
9209
	_setOption: function( key, value ) {
9210
		var i,
9211
			valsLength = 0;
9212
9213
		if ( key === "range" && this.options.range === true ) {
9214
			if ( value === "min" ) {
9215
				this.options.value = this._values( 0 );
9216
				this.options.values = null;
9217
			} else if ( value === "max" ) {
9218
				this.options.value = this._values( this.options.values.length - 1 );
9219
				this.options.values = null;
9220
			}
9221
		}
9222
9223
		if ( $.isArray( this.options.values ) ) {
9224
			valsLength = this.options.values.length;
9225
		}
9226
9227
		if ( key === "disabled" ) {
9228
			this.element.toggleClass( "ui-state-disabled", !!value );
9229
		}
9230
9231
		this._super( key, value );
9232
9233
		switch ( key ) {
9234
			case "orientation":
9235
				this._detectOrientation();
9236
				this.element
9237
					.removeClass( "ui-slider-horizontal ui-slider-vertical" )
9238
					.addClass( "ui-slider-" + this.orientation );
9239
				this._refreshValue();
9240
9241
				// Reset positioning from previous orientation
9242
				this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
9243
				break;
9244
			case "value":
9245
				this._animateOff = true;
9246
				this._refreshValue();
9247
				this._change( null, 0 );
9248
				this._animateOff = false;
9249
				break;
9250
			case "values":
9251
				this._animateOff = true;
9252
				this._refreshValue();
9253
				for ( i = 0; i < valsLength; i += 1 ) {
9254
					this._change( null, i );
9255
				}
9256
				this._animateOff = false;
9257
				break;
9258
			case "step":
9259
			case "min":
9260
			case "max":
9261
				this._animateOff = true;
9262
				this._calculateNewMax();
9263
				this._refreshValue();
9264
				this._animateOff = false;
9265
				break;
9266
			case "range":
9267
				this._animateOff = true;
9268
				this._refresh();
9269
				this._animateOff = false;
9270
				break;
9271
		}
9272
	},
9273
9274
	//internal value getter
9275
	// _value() returns value trimmed by min and max, aligned by step
9276
	_value: function() {
9277
		var val = this.options.value;
9278
		val = this._trimAlignValue( val );
9279
9280
		return val;
9281
	},
9282
9283
	//internal values getter
9284
	// _values() returns array of values trimmed by min and max, aligned by step
9285
	// _values( index ) returns single value trimmed by min and max, aligned by step
9286
	_values: function( index ) {
9287
		var val,
9288
			vals,
9289
			i;
9290
9291
		if ( arguments.length ) {
9292
			val = this.options.values[ index ];
9293
			val = this._trimAlignValue( val );
9294
9295
			return val;
9296
		} else if ( this.options.values && this.options.values.length ) {
9297
			// .slice() creates a copy of the array
9298
			// this copy gets trimmed by min and max and then returned
9299
			vals = this.options.values.slice();
9300
			for ( i = 0; i < vals.length; i += 1) {
9301
				vals[ i ] = this._trimAlignValue( vals[ i ] );
9302
			}
9303
9304
			return vals;
9305
		} else {
9306
			return [];
9307
		}
9308
	},
9309
9310
	// returns the step-aligned value that val is closest to, between (inclusive) min and max
9311
	_trimAlignValue: function( val ) {
9312
		if ( val <= this._valueMin() ) {
9313
			return this._valueMin();
9314
		}
9315
		if ( val >= this._valueMax() ) {
9316
			return this._valueMax();
9317
		}
9318
		var step = ( this.options.step > 0 ) ? this.options.step : 1,
9319
			valModStep = (val - this._valueMin()) % step,
9320
			alignValue = val - valModStep;
9321
9322
		if ( Math.abs(valModStep) * 2 >= step ) {
9323
			alignValue += ( valModStep > 0 ) ? step : ( -step );
9324
		}
9325
9326
		// Since JavaScript has problems with large floats, round
9327
		// the final value to 5 digits after the decimal point (see #4124)
9328
		return parseFloat( alignValue.toFixed(5) );
9329
	},
9330
9331
	_calculateNewMax: function() {
9332
		var max = this.options.max,
9333
			min = this._valueMin(),
9334
			step = this.options.step,
9335
			aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
9336
		max = aboveMin + min;
9337
		this.max = parseFloat( max.toFixed( this._precision() ) );
9338
	},
9339
9340
	_precision: function() {
9341
		var precision = this._precisionOf( this.options.step );
9342
		if ( this.options.min !== null ) {
9343
			precision = Math.max( precision, this._precisionOf( this.options.min ) );
9344
		}
9345
		return precision;
9346
	},
9347
9348
	_precisionOf: function( num ) {
9349
		var str = num.toString(),
9350
			decimal = str.indexOf( "." );
9351
		return decimal === -1 ? 0 : str.length - decimal - 1;
9352
	},
9353
9354
	_valueMin: function() {
9355
		return this.options.min;
9356
	},
9357
9358
	_valueMax: function() {
9359
		return this.max;
9360
	},
9361
9362
	_refreshValue: function() {
9363
		var lastValPercent, valPercent, value, valueMin, valueMax,
9364
			oRange = this.options.range,
9365
			o = this.options,
9366
			that = this,
9367
			animate = ( !this._animateOff ) ? o.animate : false,
9368
			_set = {};
9369
9370
		if ( this.options.values && this.options.values.length ) {
9371
			this.handles.each(function( i ) {
9372
				valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
9373
				_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
9374
				$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
9375
				if ( that.options.range === true ) {
9376
					if ( that.orientation === "horizontal" ) {
9377
						if ( i === 0 ) {
9378
							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
9379
						}
9380
						if ( i === 1 ) {
9381
							that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
9382
						}
9383
					} else {
9384
						if ( i === 0 ) {
9385
							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
9386
						}
9387
						if ( i === 1 ) {
9388
							that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
9389
						}
9390
					}
9391
				}
9392
				lastValPercent = valPercent;
9393
			});
9394
		} else {
9395
			value = this.value();
9396
			valueMin = this._valueMin();
9397
			valueMax = this._valueMax();
9398
			valPercent = ( valueMax !== valueMin ) ?
9399
					( value - valueMin ) / ( valueMax - valueMin ) * 100 :
9400
					0;
9401
			_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
9402
			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
9403
9404
			if ( oRange === "min" && this.orientation === "horizontal" ) {
9405
				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
9406
			}
9407
			if ( oRange === "max" && this.orientation === "horizontal" ) {
9408
				this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
9409
			}
9410
			if ( oRange === "min" && this.orientation === "vertical" ) {
9411
				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
9412
			}
9413
			if ( oRange === "max" && this.orientation === "vertical" ) {
9414
				this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
9415
			}
9416
		}
9417
	},
9418
9419
	_handleEvents: {
9420
		keydown: function( event ) {
9421
			var allowed, curVal, newVal, step,
9422
				index = $( event.target ).data( "ui-slider-handle-index" );
9423
9424
			switch ( event.keyCode ) {
9425
				case $.ui.keyCode.HOME:
9426
				case $.ui.keyCode.END:
9427
				case $.ui.keyCode.PAGE_UP:
9428
				case $.ui.keyCode.PAGE_DOWN:
9429
				case $.ui.keyCode.UP:
9430
				case $.ui.keyCode.RIGHT:
9431
				case $.ui.keyCode.DOWN:
9432
				case $.ui.keyCode.LEFT:
9433
					event.preventDefault();
9434
					if ( !this._keySliding ) {
9435
						this._keySliding = true;
9436
						$( event.target ).addClass( "ui-state-active" );
9437
						allowed = this._start( event, index );
9438
						if ( allowed === false ) {
9439
							return;
9440
						}
9441
					}
9442
					break;
9443
			}
9444
9445
			step = this.options.step;
9446
			if ( this.options.values && this.options.values.length ) {
9447
				curVal = newVal = this.values( index );
9448
			} else {
9449
				curVal = newVal = this.value();
9450
			}
9451
9452
			switch ( event.keyCode ) {
9453
				case $.ui.keyCode.HOME:
9454
					newVal = this._valueMin();
9455
					break;
9456
				case $.ui.keyCode.END:
9457
					newVal = this._valueMax();
9458
					break;
9459
				case $.ui.keyCode.PAGE_UP:
9460
					newVal = this._trimAlignValue(
9461
						curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
9462
					);
9463
					break;
9464
				case $.ui.keyCode.PAGE_DOWN:
9465
					newVal = this._trimAlignValue(
9466
						curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
9467
					break;
9468
				case $.ui.keyCode.UP:
9469
				case $.ui.keyCode.RIGHT:
9470
					if ( curVal === this._valueMax() ) {
9471
						return;
9472
					}
9473
					newVal = this._trimAlignValue( curVal + step );
9474
					break;
9475
				case $.ui.keyCode.DOWN:
9476
				case $.ui.keyCode.LEFT:
9477
					if ( curVal === this._valueMin() ) {
9478
						return;
9479
					}
9480
					newVal = this._trimAlignValue( curVal - step );
9481
					break;
9482
			}
9483
9484
			this._slide( event, index, newVal );
9485
		},
9486
		keyup: function( event ) {
9487
			var index = $( event.target ).data( "ui-slider-handle-index" );
9488
9489
			if ( this._keySliding ) {
9490
				this._keySliding = false;
9491
				this._stop( event, index );
9492
				this._change( event, index );
9493
				$( event.target ).removeClass( "ui-state-active" );
9494
			}
9495
		}
9496
	}
9497
});
9498
9499
9500
/*!
9501
 * jQuery UI Tabs 1.11.4
9502
 * http://jqueryui.com
9503
 *
9504
 * Copyright jQuery Foundation and other contributors
9505
 * Released under the MIT license.
9506
 * http://jquery.org/license
9507
 *
9508
 * http://api.jqueryui.com/tabs/
9509
 */
9510
9511
9512
var tabs = $.widget( "ui.tabs", {
9513
	version: "1.11.4",
9514
	delay: 300,
9515
	options: {
9516
		active: null,
9517
		collapsible: false,
9518
		event: "click",
9519
		heightStyle: "content",
9520
		hide: null,
9521
		show: null,
9522
9523
		// callbacks
9524
		activate: null,
9525
		beforeActivate: null,
9526
		beforeLoad: null,
9527
		load: null
9528
	},
9529
9530
	_isLocal: (function() {
9531
		var rhash = /#.*$/;
9532
9533
		return function( anchor ) {
9534
			var anchorUrl, locationUrl;
9535
9536
			// support: IE7
9537
			// IE7 doesn't normalize the href property when set via script (#9317)
9538
			anchor = anchor.cloneNode( false );
9539
9540
			anchorUrl = anchor.href.replace( rhash, "" );
9541
			locationUrl = location.href.replace( rhash, "" );
9542
9543
			// decoding may throw an error if the URL isn't UTF-8 (#9518)
9544
			try {
9545
				anchorUrl = decodeURIComponent( anchorUrl );
9546
			} catch ( error ) {}
9547
			try {
9548
				locationUrl = decodeURIComponent( locationUrl );
9549
			} catch ( error ) {}
9550
9551
			return anchor.hash.length > 1 && anchorUrl === locationUrl;
9552
		};
9553
	})(),
9554
9555
	_create: function() {
9556
		var that = this,
9557
			options = this.options;
9558
9559
		this.running = false;
9560
9561
		this.element
9562
			.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
9563
			.toggleClass( "ui-tabs-collapsible", options.collapsible );
9564
9565
		this._processTabs();
9566
		options.active = this._initialActive();
9567
9568
		// Take disabling tabs via class attribute from HTML
9569
		// into account and update option properly.
9570
		if ( $.isArray( options.disabled ) ) {
9571
			options.disabled = $.unique( options.disabled.concat(
9572
				$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
9573
					return that.tabs.index( li );
9574
				})
9575
			) ).sort();
9576
		}
9577
9578
		// check for length avoids error when initializing empty list
9579
		if ( this.options.active !== false && this.anchors.length ) {
9580
			this.active = this._findActive( options.active );
9581
		} else {
9582
			this.active = $();
9583
		}
9584
9585
		this._refresh();
9586
9587
		if ( this.active.length ) {
9588
			this.load( options.active );
9589
		}
9590
	},
9591
9592
	_initialActive: function() {
9593
		var active = this.options.active,
9594
			collapsible = this.options.collapsible,
9595
			locationHash = location.hash.substring( 1 );
9596
9597
		if ( active === null ) {
9598
			// check the fragment identifier in the URL
9599
			if ( locationHash ) {
9600
				this.tabs.each(function( i, tab ) {
9601
					if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
9602
						active = i;
9603
						return false;
9604
					}
9605
				});
9606
			}
9607
9608
			// check for a tab marked active via a class
9609
			if ( active === null ) {
9610
				active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
9611
			}
9612
9613
			// no active tab, set to false
9614
			if ( active === null || active === -1 ) {
9615
				active = this.tabs.length ? 0 : false;
9616
			}
9617
		}
9618
9619
		// handle numbers: negative, out of range
9620
		if ( active !== false ) {
9621
			active = this.tabs.index( this.tabs.eq( active ) );
9622
			if ( active === -1 ) {
9623
				active = collapsible ? false : 0;
9624
			}
9625
		}
9626
9627
		// don't allow collapsible: false and active: false
9628
		if ( !collapsible && active === false && this.anchors.length ) {
9629
			active = 0;
9630
		}
9631
9632
		return active;
9633
	},
9634
9635
	_getCreateEventData: function() {
9636
		return {
9637
			tab: this.active,
9638
			panel: !this.active.length ? $() : this._getPanelForTab( this.active )
9639
		};
9640
	},
9641
9642
	_tabKeydown: function( event ) {
9643
		var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
9644
			selectedIndex = this.tabs.index( focusedTab ),
9645
			goingForward = true;
9646
9647
		if ( this._handlePageNav( event ) ) {
9648
			return;
9649
		}
9650
9651
		switch ( event.keyCode ) {
9652
			case $.ui.keyCode.RIGHT:
9653
			case $.ui.keyCode.DOWN:
9654
				selectedIndex++;
9655
				break;
9656
			case $.ui.keyCode.UP:
9657
			case $.ui.keyCode.LEFT:
9658
				goingForward = false;
9659
				selectedIndex--;
9660
				break;
9661
			case $.ui.keyCode.END:
9662
				selectedIndex = this.anchors.length - 1;
9663
				break;
9664
			case $.ui.keyCode.HOME:
9665
				selectedIndex = 0;
9666
				break;
9667
			case $.ui.keyCode.SPACE:
9668
				// Activate only, no collapsing
9669
				event.preventDefault();
9670
				clearTimeout( this.activating );
9671
				this._activate( selectedIndex );
9672
				return;
9673
			case $.ui.keyCode.ENTER:
9674
				// Toggle (cancel delayed activation, allow collapsing)
9675
				event.preventDefault();
9676
				clearTimeout( this.activating );
9677
				// Determine if we should collapse or activate
9678
				this._activate( selectedIndex === this.options.active ? false : selectedIndex );
9679
				return;
9680
			default:
9681
				return;
9682
		}
9683
9684
		// Focus the appropriate tab, based on which key was pressed
9685
		event.preventDefault();
9686
		clearTimeout( this.activating );
9687
		selectedIndex = this._focusNextTab( selectedIndex, goingForward );
9688
9689
		// Navigating with control/command key will prevent automatic activation
9690
		if ( !event.ctrlKey && !event.metaKey ) {
9691
9692
			// Update aria-selected immediately so that AT think the tab is already selected.
9693
			// Otherwise AT may confuse the user by stating that they need to activate the tab,
9694
			// but the tab will already be activated by the time the announcement finishes.
9695
			focusedTab.attr( "aria-selected", "false" );
9696
			this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
9697
9698
			this.activating = this._delay(function() {
9699
				this.option( "active", selectedIndex );
9700
			}, this.delay );
9701
		}
9702
	},
9703
9704
	_panelKeydown: function( event ) {
9705
		if ( this._handlePageNav( event ) ) {
9706
			return;
9707
		}
9708
9709
		// Ctrl+up moves focus to the current tab
9710
		if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
9711
			event.preventDefault();
9712
			this.active.focus();
9713
		}
9714
	},
9715
9716
	// Alt+page up/down moves focus to the previous/next tab (and activates)
9717
	_handlePageNav: function( event ) {
9718
		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
9719
			this._activate( this._focusNextTab( this.options.active - 1, false ) );
9720
			return true;
9721
		}
9722
		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
9723
			this._activate( this._focusNextTab( this.options.active + 1, true ) );
9724
			return true;
9725
		}
9726
	},
9727
9728
	_findNextTab: function( index, goingForward ) {
9729
		var lastTabIndex = this.tabs.length - 1;
9730
9731
		function constrain() {
9732
			if ( index > lastTabIndex ) {
9733
				index = 0;
9734
			}
9735
			if ( index < 0 ) {
9736
				index = lastTabIndex;
9737
			}
9738
			return index;
9739
		}
9740
9741
		while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
9742
			index = goingForward ? index + 1 : index - 1;
9743
		}
9744
9745
		return index;
9746
	},
9747
9748
	_focusNextTab: function( index, goingForward ) {
9749
		index = this._findNextTab( index, goingForward );
9750
		this.tabs.eq( index ).focus();
9751
		return index;
9752
	},
9753
9754
	_setOption: function( key, value ) {
9755
		if ( key === "active" ) {
9756
			// _activate() will handle invalid values and update this.options
9757
			this._activate( value );
9758
			return;
9759
		}
9760
9761
		if ( key === "disabled" ) {
9762
			// don't use the widget factory's disabled handling
9763
			this._setupDisabled( value );
9764
			return;
9765
		}
9766
9767
		this._super( key, value);
9768
9769
		if ( key === "collapsible" ) {
9770
			this.element.toggleClass( "ui-tabs-collapsible", value );
9771
			// Setting collapsible: false while collapsed; open first panel
9772
			if ( !value && this.options.active === false ) {
9773
				this._activate( 0 );
9774
			}
9775
		}
9776
9777
		if ( key === "event" ) {
9778
			this._setupEvents( value );
9779
		}
9780
9781
		if ( key === "heightStyle" ) {
9782
			this._setupHeightStyle( value );
9783
		}
9784
	},
9785
9786
	_sanitizeSelector: function( hash ) {
9787
		return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
9788
	},
9789
9790
	refresh: function() {
9791
		var options = this.options,
9792
			lis = this.tablist.children( ":has(a[href])" );
9793
9794
		// get disabled tabs from class attribute from HTML
9795
		// this will get converted to a boolean if needed in _refresh()
9796
		options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
9797
			return lis.index( tab );
9798
		});
9799
9800
		this._processTabs();
9801
9802
		// was collapsed or no tabs
9803
		if ( options.active === false || !this.anchors.length ) {
9804
			options.active = false;
9805
			this.active = $();
9806
		// was active, but active tab is gone
9807
		} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
9808
			// all remaining tabs are disabled
9809
			if ( this.tabs.length === options.disabled.length ) {
9810
				options.active = false;
9811
				this.active = $();
9812
			// activate previous tab
9813
			} else {
9814
				this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
9815
			}
9816
		// was active, active tab still exists
9817
		} else {
9818
			// make sure active index is correct
9819
			options.active = this.tabs.index( this.active );
9820
		}
9821
9822
		this._refresh();
9823
	},
9824
9825
	_refresh: function() {
9826
		this._setupDisabled( this.options.disabled );
9827
		this._setupEvents( this.options.event );
9828
		this._setupHeightStyle( this.options.heightStyle );
9829
9830
		this.tabs.not( this.active ).attr({
9831
			"aria-selected": "false",
9832
			"aria-expanded": "false",
9833
			tabIndex: -1
9834
		});
9835
		this.panels.not( this._getPanelForTab( this.active ) )
9836
			.hide()
9837
			.attr({
9838
				"aria-hidden": "true"
9839
			});
9840
9841
		// Make sure one tab is in the tab order
9842
		if ( !this.active.length ) {
9843
			this.tabs.eq( 0 ).attr( "tabIndex", 0 );
9844
		} else {
9845
			this.active
9846
				.addClass( "ui-tabs-active ui-state-active" )
9847
				.attr({
9848
					"aria-selected": "true",
9849
					"aria-expanded": "true",
9850
					tabIndex: 0
9851
				});
9852
			this._getPanelForTab( this.active )
9853
				.show()
9854
				.attr({
9855
					"aria-hidden": "false"
9856
				});
9857
		}
9858
	},
9859
9860
	_processTabs: function() {
9861
		var that = this,
9862
			prevTabs = this.tabs,
9863
			prevAnchors = this.anchors,
9864
			prevPanels = this.panels;
9865
9866
		this.tablist = this._getList()
9867
			.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
9868
			.attr( "role", "tablist" )
9869
9870
			// Prevent users from focusing disabled tabs via click
9871
			.delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
9872
				if ( $( this ).is( ".ui-state-disabled" ) ) {
9873
					event.preventDefault();
9874
				}
9875
			})
9876
9877
			// support: IE <9
9878
			// Preventing the default action in mousedown doesn't prevent IE
9879
			// from focusing the element, so if the anchor gets focused, blur.
9880
			// We don't have to worry about focusing the previously focused
9881
			// element since clicking on a non-focusable element should focus
9882
			// the body anyway.
9883
			.delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
9884
				if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
9885
					this.blur();
9886
				}
9887
			});
9888
9889
		this.tabs = this.tablist.find( "> li:has(a[href])" )
9890
			.addClass( "ui-state-default ui-corner-top" )
9891
			.attr({
9892
				role: "tab",
9893
				tabIndex: -1
9894
			});
9895
9896
		this.anchors = this.tabs.map(function() {
9897
				return $( "a", this )[ 0 ];
9898
			})
9899
			.addClass( "ui-tabs-anchor" )
9900
			.attr({
9901
				role: "presentation",
9902
				tabIndex: -1
9903
			});
9904
9905
		this.panels = $();
9906
9907
		this.anchors.each(function( i, anchor ) {
9908
			var selector, panel, panelId,
9909
				anchorId = $( anchor ).uniqueId().attr( "id" ),
9910
				tab = $( anchor ).closest( "li" ),
9911
				originalAriaControls = tab.attr( "aria-controls" );
9912
9913
			// inline tab
9914
			if ( that._isLocal( anchor ) ) {
9915
				selector = anchor.hash;
9916
				panelId = selector.substring( 1 );
9917
				panel = that.element.find( that._sanitizeSelector( selector ) );
9918
			// remote tab
9919
			} else {
9920
				// If the tab doesn't already have aria-controls,
9921
				// generate an id by using a throw-away element
9922
				panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
9923
				selector = "#" + panelId;
9924
				panel = that.element.find( selector );
9925
				if ( !panel.length ) {
9926
					panel = that._createPanel( panelId );
9927
					panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
9928
				}
9929
				panel.attr( "aria-live", "polite" );
9930
			}
9931
9932
			if ( panel.length) {
9933
				that.panels = that.panels.add( panel );
9934
			}
9935
			if ( originalAriaControls ) {
9936
				tab.data( "ui-tabs-aria-controls", originalAriaControls );
9937
			}
9938
			tab.attr({
9939
				"aria-controls": panelId,
9940
				"aria-labelledby": anchorId
9941
			});
9942
			panel.attr( "aria-labelledby", anchorId );
9943
		});
9944
9945
		this.panels
9946
			.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
9947
			.attr( "role", "tabpanel" );
9948
9949
		// Avoid memory leaks (#10056)
9950
		if ( prevTabs ) {
9951
			this._off( prevTabs.not( this.tabs ) );
9952
			this._off( prevAnchors.not( this.anchors ) );
9953
			this._off( prevPanels.not( this.panels ) );
9954
		}
9955
	},
9956
9957
	// allow overriding how to find the list for rare usage scenarios (#7715)
9958
	_getList: function() {
9959
		return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
9960
	},
9961
9962
	_createPanel: function( id ) {
9963
		return $( "<div>" )
9964
			.attr( "id", id )
9965
			.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
9966
			.data( "ui-tabs-destroy", true );
9967
	},
9968
9969
	_setupDisabled: function( disabled ) {
9970
		if ( $.isArray( disabled ) ) {
9971
			if ( !disabled.length ) {
9972
				disabled = false;
9973
			} else if ( disabled.length === this.anchors.length ) {
9974
				disabled = true;
9975
			}
9976
		}
9977
9978
		// disable tabs
9979
		for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
9980
			if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
9981
				$( li )
9982
					.addClass( "ui-state-disabled" )
9983
					.attr( "aria-disabled", "true" );
9984
			} else {
9985
				$( li )
9986
					.removeClass( "ui-state-disabled" )
9987
					.removeAttr( "aria-disabled" );
9988
			}
9989
		}
9990
9991
		this.options.disabled = disabled;
9992
	},
9993
9994
	_setupEvents: function( event ) {
9995
		var events = {};
9996
		if ( event ) {
9997
			$.each( event.split(" "), function( index, eventName ) {
9998
				events[ eventName ] = "_eventHandler";
9999
			});
10000
		}
10001
10002
		this._off( this.anchors.add( this.tabs ).add( this.panels ) );
10003
		// Always prevent the default action, even when disabled
10004
		this._on( true, this.anchors, {
10005
			click: function( event ) {
10006
				event.preventDefault();
10007
			}
10008
		});
10009
		this._on( this.anchors, events );
10010
		this._on( this.tabs, { keydown: "_tabKeydown" } );
10011
		this._on( this.panels, { keydown: "_panelKeydown" } );
10012
10013
		this._focusable( this.tabs );
10014
		this._hoverable( this.tabs );
10015
	},
10016
10017
	_setupHeightStyle: function( heightStyle ) {
10018
		var maxHeight,
10019
			parent = this.element.parent();
10020
10021
		if ( heightStyle === "fill" ) {
10022
			maxHeight = parent.height();
10023
			maxHeight -= this.element.outerHeight() - this.element.height();
10024
10025
			this.element.siblings( ":visible" ).each(function() {
10026
				var elem = $( this ),
10027
					position = elem.css( "position" );
10028
10029
				if ( position === "absolute" || position === "fixed" ) {
10030
					return;
10031
				}
10032
				maxHeight -= elem.outerHeight( true );
10033
			});
10034
10035
			this.element.children().not( this.panels ).each(function() {
10036
				maxHeight -= $( this ).outerHeight( true );
10037
			});
10038
10039
			this.panels.each(function() {
10040
				$( this ).height( Math.max( 0, maxHeight -
10041
					$( this ).innerHeight() + $( this ).height() ) );
10042
			})
10043
			.css( "overflow", "auto" );
10044
		} else if ( heightStyle === "auto" ) {
10045
			maxHeight = 0;
10046
			this.panels.each(function() {
10047
				maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
10048
			}).height( maxHeight );
10049
		}
10050
	},
10051
10052
	_eventHandler: function( event ) {
10053
		var options = this.options,
10054
			active = this.active,
10055
			anchor = $( event.currentTarget ),
10056
			tab = anchor.closest( "li" ),
10057
			clickedIsActive = tab[ 0 ] === active[ 0 ],
10058
			collapsing = clickedIsActive && options.collapsible,
10059
			toShow = collapsing ? $() : this._getPanelForTab( tab ),
10060
			toHide = !active.length ? $() : this._getPanelForTab( active ),
10061
			eventData = {
10062
				oldTab: active,
10063
				oldPanel: toHide,
10064
				newTab: collapsing ? $() : tab,
10065
				newPanel: toShow
10066
			};
10067
10068
		event.preventDefault();
10069
10070
		if ( tab.hasClass( "ui-state-disabled" ) ||
10071
				// tab is already loading
10072
				tab.hasClass( "ui-tabs-loading" ) ||
10073
				// can't switch durning an animation
10074
				this.running ||
10075
				// click on active header, but not collapsible
10076
				( clickedIsActive && !options.collapsible ) ||
10077
				// allow canceling activation
10078
				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
10079
			return;
10080
		}
10081
10082
		options.active = collapsing ? false : this.tabs.index( tab );
10083
10084
		this.active = clickedIsActive ? $() : tab;
10085
		if ( this.xhr ) {
10086
			this.xhr.abort();
10087
		}
10088
10089
		if ( !toHide.length && !toShow.length ) {
10090
			$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
10091
		}
10092
10093
		if ( toShow.length ) {
10094
			this.load( this.tabs.index( tab ), event );
10095
		}
10096
		this._toggle( event, eventData );
10097
	},
10098
10099
	// handles show/hide for selecting tabs
10100
	_toggle: function( event, eventData ) {
10101
		var that = this,
10102
			toShow = eventData.newPanel,
10103
			toHide = eventData.oldPanel;
10104
10105
		this.running = true;
10106
10107
		function complete() {
10108
			that.running = false;
10109
			that._trigger( "activate", event, eventData );
10110
		}
10111
10112
		function show() {
10113
			eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
10114
10115
			if ( toShow.length && that.options.show ) {
10116
				that._show( toShow, that.options.show, complete );
10117
			} else {
10118
				toShow.show();
10119
				complete();
10120
			}
10121
		}
10122
10123
		// start out by hiding, then showing, then completing
10124
		if ( toHide.length && this.options.hide ) {
10125
			this._hide( toHide, this.options.hide, function() {
10126
				eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
10127
				show();
10128
			});
10129
		} else {
10130
			eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
10131
			toHide.hide();
10132
			show();
10133
		}
10134
10135
		toHide.attr( "aria-hidden", "true" );
10136
		eventData.oldTab.attr({
10137
			"aria-selected": "false",
10138
			"aria-expanded": "false"
10139
		});
10140
		// If we're switching tabs, remove the old tab from the tab order.
10141
		// If we're opening from collapsed state, remove the previous tab from the tab order.
10142
		// If we're collapsing, then keep the collapsing tab in the tab order.
10143
		if ( toShow.length && toHide.length ) {
10144
			eventData.oldTab.attr( "tabIndex", -1 );
10145
		} else if ( toShow.length ) {
10146
			this.tabs.filter(function() {
10147
				return $( this ).attr( "tabIndex" ) === 0;
10148
			})
10149
			.attr( "tabIndex", -1 );
10150
		}
10151
10152
		toShow.attr( "aria-hidden", "false" );
10153
		eventData.newTab.attr({
10154
			"aria-selected": "true",
10155
			"aria-expanded": "true",
10156
			tabIndex: 0
10157
		});
10158
	},
10159
10160
	_activate: function( index ) {
10161
		var anchor,
10162
			active = this._findActive( index );
10163
10164
		// trying to activate the already active panel
10165
		if ( active[ 0 ] === this.active[ 0 ] ) {
10166
			return;
10167
		}
10168
10169
		// trying to collapse, simulate a click on the current active header
10170
		if ( !active.length ) {
10171
			active = this.active;
10172
		}
10173
10174
		anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
10175
		this._eventHandler({
10176
			target: anchor,
10177
			currentTarget: anchor,
10178
			preventDefault: $.noop
10179
		});
10180
	},
10181
10182
	_findActive: function( index ) {
10183
		return index === false ? $() : this.tabs.eq( index );
10184
	},
10185
10186
	_getIndex: function( index ) {
10187
		// meta-function to give users option to provide a href string instead of a numerical index.
10188
		if ( typeof index === "string" ) {
10189
			index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
10190
		}
10191
10192
		return index;
10193
	},
10194
10195
	_destroy: function() {
10196
		if ( this.xhr ) {
10197
			this.xhr.abort();
10198
		}
10199
10200
		this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
10201
10202
		this.tablist
10203
			.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
10204
			.removeAttr( "role" );
10205
10206
		this.anchors
10207
			.removeClass( "ui-tabs-anchor" )
10208
			.removeAttr( "role" )
10209
			.removeAttr( "tabIndex" )
10210
			.removeUniqueId();
10211
10212
		this.tablist.unbind( this.eventNamespace );
10213
10214
		this.tabs.add( this.panels ).each(function() {
10215
			if ( $.data( this, "ui-tabs-destroy" ) ) {
10216
				$( this ).remove();
10217
			} else {
10218
				$( this )
10219
					.removeClass( "ui-state-default ui-state-active ui-state-disabled " +
10220
						"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
10221
					.removeAttr( "tabIndex" )
10222
					.removeAttr( "aria-live" )
10223
					.removeAttr( "aria-busy" )
10224
					.removeAttr( "aria-selected" )
10225
					.removeAttr( "aria-labelledby" )
10226
					.removeAttr( "aria-hidden" )
10227
					.removeAttr( "aria-expanded" )
10228
					.removeAttr( "role" );
10229
			}
10230
		});
10231
10232
		this.tabs.each(function() {
10233
			var li = $( this ),
10234
				prev = li.data( "ui-tabs-aria-controls" );
10235
			if ( prev ) {
10236
				li
10237
					.attr( "aria-controls", prev )
10238
					.removeData( "ui-tabs-aria-controls" );
10239
			} else {
10240
				li.removeAttr( "aria-controls" );
10241
			}
10242
		});
10243
10244
		this.panels.show();
10245
10246
		if ( this.options.heightStyle !== "content" ) {
10247
			this.panels.css( "height", "" );
10248
		}
10249
	},
10250
10251
	enable: function( index ) {
10252
		var disabled = this.options.disabled;
10253
		if ( disabled === false ) {
10254
			return;
10255
		}
10256
10257
		if ( index === undefined ) {
10258
			disabled = false;
10259
		} else {
10260
			index = this._getIndex( index );
10261
			if ( $.isArray( disabled ) ) {
10262
				disabled = $.map( disabled, function( num ) {
10263
					return num !== index ? num : null;
10264
				});
10265
			} else {
10266
				disabled = $.map( this.tabs, function( li, num ) {
10267
					return num !== index ? num : null;
10268
				});
10269
			}
10270
		}
10271
		this._setupDisabled( disabled );
10272
	},
10273
10274
	disable: function( index ) {
10275
		var disabled = this.options.disabled;
10276
		if ( disabled === true ) {
10277
			return;
10278
		}
10279
10280
		if ( index === undefined ) {
10281
			disabled = true;
10282
		} else {
10283
			index = this._getIndex( index );
10284
			if ( $.inArray( index, disabled ) !== -1 ) {
10285
				return;
10286
			}
10287
			if ( $.isArray( disabled ) ) {
10288
				disabled = $.merge( [ index ], disabled ).sort();
10289
			} else {
10290
				disabled = [ index ];
10291
			}
10292
		}
10293
		this._setupDisabled( disabled );
10294
	},
10295
10296
	load: function( index, event ) {
10297
		index = this._getIndex( index );
10298
		var that = this,
10299
			tab = this.tabs.eq( index ),
10300
			anchor = tab.find( ".ui-tabs-anchor" ),
10301
			panel = this._getPanelForTab( tab ),
10302
			eventData = {
10303
				tab: tab,
10304
				panel: panel
10305
			},
10306
			complete = function( jqXHR, status ) {
10307
				if ( status === "abort" ) {
10308
					that.panels.stop( false, true );
10309
				}
10310
10311
				tab.removeClass( "ui-tabs-loading" );
10312
				panel.removeAttr( "aria-busy" );
10313
10314
				if ( jqXHR === that.xhr ) {
10315
					delete that.xhr;
10316
				}
10317
			};
10318
10319
		// not remote
10320
		if ( this._isLocal( anchor[ 0 ] ) ) {
10321
			return;
10322
		}
10323
10324
		this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
10325
10326
		// support: jQuery <1.8
10327
		// jQuery <1.8 returns false if the request is canceled in beforeSend,
10328
		// but as of 1.8, $.ajax() always returns a jqXHR object.
10329
		if ( this.xhr && this.xhr.statusText !== "canceled" ) {
10330
			tab.addClass( "ui-tabs-loading" );
10331
			panel.attr( "aria-busy", "true" );
10332
10333
			this.xhr
10334
				.done(function( response, status, jqXHR ) {
10335
					// support: jQuery <1.8
10336
					// http://bugs.jquery.com/ticket/11778
10337
					setTimeout(function() {
10338
						panel.html( response );
10339
						that._trigger( "load", event, eventData );
10340
10341
						complete( jqXHR, status );
10342
					}, 1 );
10343
				})
10344
				.fail(function( jqXHR, status ) {
10345
					// support: jQuery <1.8
10346
					// http://bugs.jquery.com/ticket/11778
10347
					setTimeout(function() {
10348
						complete( jqXHR, status );
10349
					}, 1 );
10350
				});
10351
		}
10352
	},
10353
10354
	_ajaxSettings: function( anchor, event, eventData ) {
10355
		var that = this;
10356
		return {
10357
			url: anchor.attr( "href" ),
10358
			beforeSend: function( jqXHR, settings ) {
10359
				return that._trigger( "beforeLoad", event,
10360
					$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
10361
			}
10362
		};
10363
	},
10364
10365
	_getPanelForTab: function( tab ) {
10366
		var id = $( tab ).attr( "aria-controls" );
10367
		return this.element.find( this._sanitizeSelector( "#" + id ) );
10368
	}
10369
});
10370
10371
10372
/*!
10373
 * jQuery UI Effects 1.11.4
10374
 * http://jqueryui.com
10375
 *
10376
 * Copyright jQuery Foundation and other contributors
10377
 * Released under the MIT license.
10378
 * http://jquery.org/license
10379
 *
10380
 * http://api.jqueryui.com/category/effects-core/
10381
 */
10382
10383
10384
var dataSpace = "ui-effects-",
10385
10386
	// Create a local jQuery because jQuery Color relies on it and the
10387
	// global may not exist with AMD and a custom build (#10199)
10388
	jQuery = $;
10389
10390
$.effects = {
10391
	effect: {}
10392
};
10393
10394
/*!
10395
 * jQuery Color Animations v2.1.2
10396
 * https://github.com/jquery/jquery-color
10397
 *
10398
 * Copyright 2014 jQuery Foundation and other contributors
10399
 * Released under the MIT license.
10400
 * http://jquery.org/license
10401
 *
10402
 * Date: Wed Jan 16 08:47:09 2013 -0600
10403
 */
10404
(function( jQuery, undefined ) {
10405
10406
	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
10407
10408
	// plusequals test for += 100 -= 100
10409
	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
10410
	// a set of RE's that can match strings and generate color tuples.
10411
	stringParsers = [ {
10412
			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
10413
			parse: function( execResult ) {
10414
				return [
10415
					execResult[ 1 ],
10416
					execResult[ 2 ],
10417
					execResult[ 3 ],
10418
					execResult[ 4 ]
10419
				];
10420
			}
10421
		}, {
10422
			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
10423
			parse: function( execResult ) {
10424
				return [
10425
					execResult[ 1 ] * 2.55,
10426
					execResult[ 2 ] * 2.55,
10427
					execResult[ 3 ] * 2.55,
10428
					execResult[ 4 ]
10429
				];
10430
			}
10431
		}, {
10432
			// this regex ignores A-F because it's compared against an already lowercased string
10433
			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
10434
			parse: function( execResult ) {
10435
				return [
10436
					parseInt( execResult[ 1 ], 16 ),
10437
					parseInt( execResult[ 2 ], 16 ),
10438
					parseInt( execResult[ 3 ], 16 )
10439
				];
10440
			}
10441
		}, {
10442
			// this regex ignores A-F because it's compared against an already lowercased string
10443
			re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
10444
			parse: function( execResult ) {
10445
				return [
10446
					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
10447
					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
10448
					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
10449
				];
10450
			}
10451
		}, {
10452
			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
10453
			space: "hsla",
10454
			parse: function( execResult ) {
10455
				return [
10456
					execResult[ 1 ],
10457
					execResult[ 2 ] / 100,
10458
					execResult[ 3 ] / 100,
10459
					execResult[ 4 ]
10460
				];
10461
			}
10462
		} ],
10463
10464
	// jQuery.Color( )
10465
	color = jQuery.Color = function( color, green, blue, alpha ) {
10466
		return new jQuery.Color.fn.parse( color, green, blue, alpha );
10467
	},
10468
	spaces = {
10469
		rgba: {
10470
			props: {
10471
				red: {
10472
					idx: 0,
10473
					type: "byte"
10474
				},
10475
				green: {
10476
					idx: 1,
10477
					type: "byte"
10478
				},
10479
				blue: {
10480
					idx: 2,
10481
					type: "byte"
10482
				}
10483
			}
10484
		},
10485
10486
		hsla: {
10487
			props: {
10488
				hue: {
10489
					idx: 0,
10490
					type: "degrees"
10491
				},
10492
				saturation: {
10493
					idx: 1,
10494
					type: "percent"
10495
				},
10496
				lightness: {
10497
					idx: 2,
10498
					type: "percent"
10499
				}
10500
			}
10501
		}
10502
	},
10503
	propTypes = {
10504
		"byte": {
10505
			floor: true,
10506
			max: 255
10507
		},
10508
		"percent": {
10509
			max: 1
10510
		},
10511
		"degrees": {
10512
			mod: 360,
10513
			floor: true
10514
		}
10515
	},
10516
	support = color.support = {},
10517
10518
	// element for support tests
10519
	supportElem = jQuery( "<p>" )[ 0 ],
10520
10521
	// colors = jQuery.Color.names
10522
	colors,
10523
10524
	// local aliases of functions called often
10525
	each = jQuery.each;
10526
10527
// determine rgba support immediately
10528
supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
10529
support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
10530
10531
// define cache name and alpha properties
10532
// for rgba and hsla spaces
10533
each( spaces, function( spaceName, space ) {
10534
	space.cache = "_" + spaceName;
10535
	space.props.alpha = {
10536
		idx: 3,
10537
		type: "percent",
10538
		def: 1
10539
	};
10540
});
10541
10542
function clamp( value, prop, allowEmpty ) {
10543
	var type = propTypes[ prop.type ] || {};
10544
10545
	if ( value == null ) {
10546
		return (allowEmpty || !prop.def) ? null : prop.def;
10547
	}
10548
10549
	// ~~ is an short way of doing floor for positive numbers
10550
	value = type.floor ? ~~value : parseFloat( value );
10551
10552
	// IE will pass in empty strings as value for alpha,
10553
	// which will hit this case
10554
	if ( isNaN( value ) ) {
10555
		return prop.def;
10556
	}
10557
10558
	if ( type.mod ) {
10559
		// we add mod before modding to make sure that negatives values
10560
		// get converted properly: -10 -> 350
10561
		return (value + type.mod) % type.mod;
10562
	}
10563
10564
	// for now all property types without mod have min and max
10565
	return 0 > value ? 0 : type.max < value ? type.max : value;
10566
}
10567
10568
function stringParse( string ) {
10569
	var inst = color(),
10570
		rgba = inst._rgba = [];
10571
10572
	string = string.toLowerCase();
10573
10574
	each( stringParsers, function( i, parser ) {
10575
		var parsed,
10576
			match = parser.re.exec( string ),
10577
			values = match && parser.parse( match ),
10578
			spaceName = parser.space || "rgba";
10579
10580
		if ( values ) {
10581
			parsed = inst[ spaceName ]( values );
10582
10583
			// if this was an rgba parse the assignment might happen twice
10584
			// oh well....
10585
			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
10586
			rgba = inst._rgba = parsed._rgba;
10587
10588
			// exit each( stringParsers ) here because we matched
10589
			return false;
10590
		}
10591
	});
10592
10593
	// Found a stringParser that handled it
10594
	if ( rgba.length ) {
10595
10596
		// if this came from a parsed string, force "transparent" when alpha is 0
10597
		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
10598
		if ( rgba.join() === "0,0,0,0" ) {
10599
			jQuery.extend( rgba, colors.transparent );
10600
		}
10601
		return inst;
10602
	}
10603
10604
	// named colors
10605
	return colors[ string ];
10606
}
10607
10608
color.fn = jQuery.extend( color.prototype, {
10609
	parse: function( red, green, blue, alpha ) {
10610
		if ( red === undefined ) {
10611
			this._rgba = [ null, null, null, null ];
10612
			return this;
10613
		}
10614
		if ( red.jquery || red.nodeType ) {
10615
			red = jQuery( red ).css( green );
10616
			green = undefined;
10617
		}
10618
10619
		var inst = this,
10620
			type = jQuery.type( red ),
10621
			rgba = this._rgba = [];
10622
10623
		// more than 1 argument specified - assume ( red, green, blue, alpha )
10624
		if ( green !== undefined ) {
10625
			red = [ red, green, blue, alpha ];
10626
			type = "array";
10627
		}
10628
10629
		if ( type === "string" ) {
10630
			return this.parse( stringParse( red ) || colors._default );
10631
		}
10632
10633
		if ( type === "array" ) {
10634
			each( spaces.rgba.props, function( key, prop ) {
10635
				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
10636
			});
10637
			return this;
10638
		}
10639
10640
		if ( type === "object" ) {
10641
			if ( red instanceof color ) {
10642
				each( spaces, function( spaceName, space ) {
10643
					if ( red[ space.cache ] ) {
10644
						inst[ space.cache ] = red[ space.cache ].slice();
10645
					}
10646
				});
10647
			} else {
10648
				each( spaces, function( spaceName, space ) {
10649
					var cache = space.cache;
10650
					each( space.props, function( key, prop ) {
10651
10652
						// if the cache doesn't exist, and we know how to convert
10653
						if ( !inst[ cache ] && space.to ) {
10654
10655
							// if the value was null, we don't need to copy it
10656
							// if the key was alpha, we don't need to copy it either
10657
							if ( key === "alpha" || red[ key ] == null ) {
10658
								return;
10659
							}
10660
							inst[ cache ] = space.to( inst._rgba );
10661
						}
10662
10663
						// this is the only case where we allow nulls for ALL properties.
10664
						// call clamp with alwaysAllowEmpty
10665
						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
10666
					});
10667
10668
					// everything defined but alpha?
10669
					if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
10670
						// use the default of 1
10671
						inst[ cache ][ 3 ] = 1;
10672
						if ( space.from ) {
10673
							inst._rgba = space.from( inst[ cache ] );
10674
						}
10675
					}
10676
				});
10677
			}
10678
			return this;
10679
		}
10680
	},
10681
	is: function( compare ) {
10682
		var is = color( compare ),
10683
			same = true,
10684
			inst = this;
10685
10686
		each( spaces, function( _, space ) {
10687
			var localCache,
10688
				isCache = is[ space.cache ];
10689
			if (isCache) {
10690
				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
10691
				each( space.props, function( _, prop ) {
10692
					if ( isCache[ prop.idx ] != null ) {
10693
						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
10694
						return same;
10695
					}
10696
				});
10697
			}
10698
			return same;
10699
		});
10700
		return same;
10701
	},
10702
	_space: function() {
10703
		var used = [],
10704
			inst = this;
10705
		each( spaces, function( spaceName, space ) {
10706
			if ( inst[ space.cache ] ) {
10707
				used.push( spaceName );
10708
			}
10709
		});
10710
		return used.pop();
10711
	},
10712
	transition: function( other, distance ) {
10713
		var end = color( other ),
10714
			spaceName = end._space(),
10715
			space = spaces[ spaceName ],
10716
			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
10717
			start = startColor[ space.cache ] || space.to( startColor._rgba ),
10718
			result = start.slice();
10719
10720
		end = end[ space.cache ];
10721
		each( space.props, function( key, prop ) {
10722
			var index = prop.idx,
10723
				startValue = start[ index ],
10724
				endValue = end[ index ],
10725
				type = propTypes[ prop.type ] || {};
10726
10727
			// if null, don't override start value
10728
			if ( endValue === null ) {
10729
				return;
10730
			}
10731
			// if null - use end
10732
			if ( startValue === null ) {
10733
				result[ index ] = endValue;
10734
			} else {
10735
				if ( type.mod ) {
10736
					if ( endValue - startValue > type.mod / 2 ) {
10737
						startValue += type.mod;
10738
					} else if ( startValue - endValue > type.mod / 2 ) {
10739
						startValue -= type.mod;
10740
					}
10741
				}
10742
				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
10743
			}
10744
		});
10745
		return this[ spaceName ]( result );
10746
	},
10747
	blend: function( opaque ) {
10748
		// if we are already opaque - return ourself
10749
		if ( this._rgba[ 3 ] === 1 ) {
10750
			return this;
10751
		}
10752
10753
		var rgb = this._rgba.slice(),
10754
			a = rgb.pop(),
10755
			blend = color( opaque )._rgba;
10756
10757
		return color( jQuery.map( rgb, function( v, i ) {
10758
			return ( 1 - a ) * blend[ i ] + a * v;
10759
		}));
10760
	},
10761
	toRgbaString: function() {
10762
		var prefix = "rgba(",
10763
			rgba = jQuery.map( this._rgba, function( v, i ) {
10764
				return v == null ? ( i > 2 ? 1 : 0 ) : v;
10765
			});
10766
10767
		if ( rgba[ 3 ] === 1 ) {
10768
			rgba.pop();
10769
			prefix = "rgb(";
10770
		}
10771
10772
		return prefix + rgba.join() + ")";
10773
	},
10774
	toHslaString: function() {
10775
		var prefix = "hsla(",
10776
			hsla = jQuery.map( this.hsla(), function( v, i ) {
10777
				if ( v == null ) {
10778
					v = i > 2 ? 1 : 0;
10779
				}
10780
10781
				// catch 1 and 2
10782
				if ( i && i < 3 ) {
10783
					v = Math.round( v * 100 ) + "%";
10784
				}
10785
				return v;
10786
			});
10787
10788
		if ( hsla[ 3 ] === 1 ) {
10789
			hsla.pop();
10790
			prefix = "hsl(";
10791
		}
10792
		return prefix + hsla.join() + ")";
10793
	},
10794
	toHexString: function( includeAlpha ) {
10795
		var rgba = this._rgba.slice(),
10796
			alpha = rgba.pop();
10797
10798
		if ( includeAlpha ) {
10799
			rgba.push( ~~( alpha * 255 ) );
10800
		}
10801
10802
		return "#" + jQuery.map( rgba, function( v ) {
10803
10804
			// default to 0 when nulls exist
10805
			v = ( v || 0 ).toString( 16 );
10806
			return v.length === 1 ? "0" + v : v;
10807
		}).join("");
10808
	},
10809
	toString: function() {
10810
		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
10811
	}
10812
});
10813
color.fn.parse.prototype = color.fn;
10814
10815
// hsla conversions adapted from:
10816
// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
10817
10818
function hue2rgb( p, q, h ) {
10819
	h = ( h + 1 ) % 1;
10820
	if ( h * 6 < 1 ) {
10821
		return p + ( q - p ) * h * 6;
10822
	}
10823
	if ( h * 2 < 1) {
10824
		return q;
10825
	}
10826
	if ( h * 3 < 2 ) {
10827
		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
10828
	}
10829
	return p;
10830
}
10831
10832
spaces.hsla.to = function( rgba ) {
10833
	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
10834
		return [ null, null, null, rgba[ 3 ] ];
10835
	}
10836
	var r = rgba[ 0 ] / 255,
10837
		g = rgba[ 1 ] / 255,
10838
		b = rgba[ 2 ] / 255,
10839
		a = rgba[ 3 ],
10840
		max = Math.max( r, g, b ),
10841
		min = Math.min( r, g, b ),
10842
		diff = max - min,
10843
		add = max + min,
10844
		l = add * 0.5,
10845
		h, s;
10846
10847
	if ( min === max ) {
10848
		h = 0;
10849
	} else if ( r === max ) {
10850
		h = ( 60 * ( g - b ) / diff ) + 360;
10851
	} else if ( g === max ) {
10852
		h = ( 60 * ( b - r ) / diff ) + 120;
10853
	} else {
10854
		h = ( 60 * ( r - g ) / diff ) + 240;
10855
	}
10856
10857
	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
10858
	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
10859
	if ( diff === 0 ) {
10860
		s = 0;
10861
	} else if ( l <= 0.5 ) {
10862
		s = diff / add;
10863
	} else {
10864
		s = diff / ( 2 - add );
10865
	}
10866
	return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
10867
};
10868
10869
spaces.hsla.from = function( hsla ) {
10870
	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
10871
		return [ null, null, null, hsla[ 3 ] ];
10872
	}
10873
	var h = hsla[ 0 ] / 360,
10874
		s = hsla[ 1 ],
10875
		l = hsla[ 2 ],
10876
		a = hsla[ 3 ],
10877
		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
10878
		p = 2 * l - q;
10879
10880
	return [
10881
		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
10882
		Math.round( hue2rgb( p, q, h ) * 255 ),
10883
		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
10884
		a
10885
	];
10886
};
10887
10888
each( spaces, function( spaceName, space ) {
10889
	var props = space.props,
10890
		cache = space.cache,
10891
		to = space.to,
10892
		from = space.from;
10893
10894
	// makes rgba() and hsla()
10895
	color.fn[ spaceName ] = function( value ) {
10896
10897
		// generate a cache for this space if it doesn't exist
10898
		if ( to && !this[ cache ] ) {
10899
			this[ cache ] = to( this._rgba );
10900
		}
10901
		if ( value === undefined ) {
10902
			return this[ cache ].slice();
10903
		}
10904
10905
		var ret,
10906
			type = jQuery.type( value ),
10907
			arr = ( type === "array" || type === "object" ) ? value : arguments,
10908
			local = this[ cache ].slice();
10909
10910
		each( props, function( key, prop ) {
10911
			var val = arr[ type === "object" ? key : prop.idx ];
10912
			if ( val == null ) {
10913
				val = local[ prop.idx ];
10914
			}
10915
			local[ prop.idx ] = clamp( val, prop );
10916
		});
10917
10918
		if ( from ) {
10919
			ret = color( from( local ) );
10920
			ret[ cache ] = local;
10921
			return ret;
10922
		} else {
10923
			return color( local );
10924
		}
10925
	};
10926
10927
	// makes red() green() blue() alpha() hue() saturation() lightness()
10928
	each( props, function( key, prop ) {
10929
		// alpha is included in more than one space
10930
		if ( color.fn[ key ] ) {
10931
			return;
10932
		}
10933
		color.fn[ key ] = function( value ) {
10934
			var vtype = jQuery.type( value ),
10935
				fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
10936
				local = this[ fn ](),
10937
				cur = local[ prop.idx ],
10938
				match;
10939
10940
			if ( vtype === "undefined" ) {
10941
				return cur;
10942
			}
10943
10944
			if ( vtype === "function" ) {
10945
				value = value.call( this, cur );
10946
				vtype = jQuery.type( value );
10947
			}
10948
			if ( value == null && prop.empty ) {
10949
				return this;
10950
			}
10951
			if ( vtype === "string" ) {
10952
				match = rplusequals.exec( value );
10953
				if ( match ) {
10954
					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
10955
				}
10956
			}
10957
			local[ prop.idx ] = value;
10958
			return this[ fn ]( local );
10959
		};
10960
	});
10961
});
10962
10963
// add cssHook and .fx.step function for each named hook.
10964
// accept a space separated string of properties
10965
color.hook = function( hook ) {
10966
	var hooks = hook.split( " " );
10967
	each( hooks, function( i, hook ) {
10968
		jQuery.cssHooks[ hook ] = {
10969
			set: function( elem, value ) {
10970
				var parsed, curElem,
10971
					backgroundColor = "";
10972
10973
				if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
10974
					value = color( parsed || value );
10975
					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
10976
						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
10977
						while (
10978
							(backgroundColor === "" || backgroundColor === "transparent") &&
10979
							curElem && curElem.style
10980
						) {
10981
							try {
10982
								backgroundColor = jQuery.css( curElem, "backgroundColor" );
10983
								curElem = curElem.parentNode;
10984
							} catch ( e ) {
10985
							}
10986
						}
10987
10988
						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
10989
							backgroundColor :
10990
							"_default" );
10991
					}
10992
10993
					value = value.toRgbaString();
10994
				}
10995
				try {
10996
					elem.style[ hook ] = value;
10997
				} catch ( e ) {
10998
					// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
10999
				}
11000
			}
11001
		};
11002
		jQuery.fx.step[ hook ] = function( fx ) {
11003
			if ( !fx.colorInit ) {
11004
				fx.start = color( fx.elem, hook );
11005
				fx.end = color( fx.end );
11006
				fx.colorInit = true;
11007
			}
11008
			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
11009
		};
11010
	});
11011
11012
};
11013
11014
color.hook( stepHooks );
11015
11016
jQuery.cssHooks.borderColor = {
11017
	expand: function( value ) {
11018
		var expanded = {};
11019
11020
		each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
11021
			expanded[ "border" + part + "Color" ] = value;
11022
		});
11023
		return expanded;
11024
	}
11025
};
11026
11027
// Basic color names only.
11028
// Usage of any of the other color names requires adding yourself or including
11029
// jquery.color.svg-names.js.
11030
colors = jQuery.Color.names = {
11031
	// 4.1. Basic color keywords
11032
	aqua: "#00ffff",
11033
	black: "#000000",
11034
	blue: "#0000ff",
11035
	fuchsia: "#ff00ff",
11036
	gray: "#808080",
11037
	green: "#008000",
11038
	lime: "#00ff00",
11039
	maroon: "#800000",
11040
	navy: "#000080",
11041
	olive: "#808000",
11042
	purple: "#800080",
11043
	red: "#ff0000",
11044
	silver: "#c0c0c0",
11045
	teal: "#008080",
11046
	white: "#ffffff",
11047
	yellow: "#ffff00",
11048
11049
	// 4.2.3. "transparent" color keyword
11050
	transparent: [ null, null, null, 0 ],
11051
11052
	_default: "#ffffff"
11053
};
11054
11055
})( jQuery );
11056
11057
/******************************************************************************/
11058
/****************************** CLASS ANIMATIONS ******************************/
11059
/******************************************************************************/
11060
(function() {
11061
11062
var classAnimationActions = [ "add", "remove", "toggle" ],
11063
	shorthandStyles = {
11064
		border: 1,
11065
		borderBottom: 1,
11066
		borderColor: 1,
11067
		borderLeft: 1,
11068
		borderRight: 1,
11069
		borderTop: 1,
11070
		borderWidth: 1,
11071
		margin: 1,
11072
		padding: 1
11073
	};
11074
11075
$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
11076
	$.fx.step[ prop ] = function( fx ) {
11077
		if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
11078
			jQuery.style( fx.elem, prop, fx.end );
11079
			fx.setAttr = true;
11080
		}
11081
	};
11082
});
11083
11084
function getElementStyles( elem ) {
11085
	var key, len,
11086
		style = elem.ownerDocument.defaultView ?
11087
			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
11088
			elem.currentStyle,
11089
		styles = {};
11090
11091
	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
11092
		len = style.length;
11093
		while ( len-- ) {
11094
			key = style[ len ];
11095
			if ( typeof style[ key ] === "string" ) {
11096
				styles[ $.camelCase( key ) ] = style[ key ];
11097
			}
11098
		}
11099
	// support: Opera, IE <9
11100
	} else {
11101
		for ( key in style ) {
11102
			if ( typeof style[ key ] === "string" ) {
11103
				styles[ key ] = style[ key ];
11104
			}
11105
		}
11106
	}
11107
11108
	return styles;
11109
}
11110
11111
function styleDifference( oldStyle, newStyle ) {
11112
	var diff = {},
11113
		name, value;
11114
11115
	for ( name in newStyle ) {
11116
		value = newStyle[ name ];
11117
		if ( oldStyle[ name ] !== value ) {
11118
			if ( !shorthandStyles[ name ] ) {
11119
				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
11120
					diff[ name ] = value;
11121
				}
11122
			}
11123
		}
11124
	}
11125
11126
	return diff;
11127
}
11128
11129
// support: jQuery <1.8
11130
if ( !$.fn.addBack ) {
11131
	$.fn.addBack = function( selector ) {
11132
		return this.add( selector == null ?
11133
			this.prevObject : this.prevObject.filter( selector )
11134
		);
11135
	};
11136
}
11137
11138
$.effects.animateClass = function( value, duration, easing, callback ) {
11139
	var o = $.speed( duration, easing, callback );
11140
11141
	return this.queue( function() {
11142
		var animated = $( this ),
11143
			baseClass = animated.attr( "class" ) || "",
11144
			applyClassChange,
11145
			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
11146
11147
		// map the animated objects to store the original styles.
11148
		allAnimations = allAnimations.map(function() {
11149
			var el = $( this );
11150
			return {
11151
				el: el,
11152
				start: getElementStyles( this )
11153
			};
11154
		});
11155
11156
		// apply class change
11157
		applyClassChange = function() {
11158
			$.each( classAnimationActions, function(i, action) {
11159
				if ( value[ action ] ) {
11160
					animated[ action + "Class" ]( value[ action ] );
11161
				}
11162
			});
11163
		};
11164
		applyClassChange();
11165
11166
		// map all animated objects again - calculate new styles and diff
11167
		allAnimations = allAnimations.map(function() {
11168
			this.end = getElementStyles( this.el[ 0 ] );
11169
			this.diff = styleDifference( this.start, this.end );
11170
			return this;
11171
		});
11172
11173
		// apply original class
11174
		animated.attr( "class", baseClass );
11175
11176
		// map all animated objects again - this time collecting a promise
11177
		allAnimations = allAnimations.map(function() {
11178
			var styleInfo = this,
11179
				dfd = $.Deferred(),
11180
				opts = $.extend({}, o, {
11181
					queue: false,
11182
					complete: function() {
11183
						dfd.resolve( styleInfo );
11184
					}
11185
				});
11186
11187
			this.el.animate( this.diff, opts );
11188
			return dfd.promise();
11189
		});
11190
11191
		// once all animations have completed:
11192
		$.when.apply( $, allAnimations.get() ).done(function() {
11193
11194
			// set the final class
11195
			applyClassChange();
11196
11197
			// for each animated element,
11198
			// clear all css properties that were animated
11199
			$.each( arguments, function() {
11200
				var el = this.el;
11201
				$.each( this.diff, function(key) {
11202
					el.css( key, "" );
11203
				});
11204
			});
11205
11206
			// this is guarnteed to be there if you use jQuery.speed()
11207
			// it also handles dequeuing the next anim...
11208
			o.complete.call( animated[ 0 ] );
11209
		});
11210
	});
11211
};
11212
11213
$.fn.extend({
11214
	addClass: (function( orig ) {
11215
		return function( classNames, speed, easing, callback ) {
11216
			return speed ?
11217
				$.effects.animateClass.call( this,
11218
					{ add: classNames }, speed, easing, callback ) :
11219
				orig.apply( this, arguments );
11220
		};
11221
	})( $.fn.addClass ),
11222
11223
	removeClass: (function( orig ) {
11224
		return function( classNames, speed, easing, callback ) {
11225
			return arguments.length > 1 ?
11226
				$.effects.animateClass.call( this,
11227
					{ remove: classNames }, speed, easing, callback ) :
11228
				orig.apply( this, arguments );
11229
		};
11230
	})( $.fn.removeClass ),
11231
11232
	toggleClass: (function( orig ) {
11233
		return function( classNames, force, speed, easing, callback ) {
11234
			if ( typeof force === "boolean" || force === undefined ) {
11235
				if ( !speed ) {
11236
					// without speed parameter
11237
					return orig.apply( this, arguments );
11238
				} else {
11239
					return $.effects.animateClass.call( this,
11240
						(force ? { add: classNames } : { remove: classNames }),
11241
						speed, easing, callback );
11242
				}
11243
			} else {
11244
				// without force parameter
11245
				return $.effects.animateClass.call( this,
11246
					{ toggle: classNames }, force, speed, easing );
11247
			}
11248
		};
11249
	})( $.fn.toggleClass ),
11250
11251
	switchClass: function( remove, add, speed, easing, callback) {
11252
		return $.effects.animateClass.call( this, {
11253
			add: add,
11254
			remove: remove
11255
		}, speed, easing, callback );
11256
	}
11257
});
11258
11259
})();
11260
11261
/******************************************************************************/
11262
/*********************************** EFFECTS **********************************/
11263
/******************************************************************************/
11264
11265
(function() {
11266
11267
$.extend( $.effects, {
11268
	version: "1.11.4",
11269
11270
	// Saves a set of properties in a data storage
11271
	save: function( element, set ) {
11272
		for ( var i = 0; i < set.length; i++ ) {
11273
			if ( set[ i ] !== null ) {
11274
				element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
11275
			}
11276
		}
11277
	},
11278
11279
	// Restores a set of previously saved properties from a data storage
11280
	restore: function( element, set ) {
11281
		var val, i;
11282
		for ( i = 0; i < set.length; i++ ) {
11283
			if ( set[ i ] !== null ) {
11284
				val = element.data( dataSpace + set[ i ] );
11285
				// support: jQuery 1.6.2
11286
				// http://bugs.jquery.com/ticket/9917
11287
				// jQuery 1.6.2 incorrectly returns undefined for any falsy value.
11288
				// We can't differentiate between "" and 0 here, so we just assume
11289
				// empty string since it's likely to be a more common value...
11290
				if ( val === undefined ) {
11291
					val = "";
11292
				}
11293
				element.css( set[ i ], val );
11294
			}
11295
		}
11296
	},
11297
11298
	setMode: function( el, mode ) {
11299
		if (mode === "toggle") {
11300
			mode = el.is( ":hidden" ) ? "show" : "hide";
11301
		}
11302
		return mode;
11303
	},
11304
11305
	// Translates a [top,left] array into a baseline value
11306
	// this should be a little more flexible in the future to handle a string & hash
11307
	getBaseline: function( origin, original ) {
11308
		var y, x;
11309
		switch ( origin[ 0 ] ) {
11310
			case "top": y = 0; break;
11311
			case "middle": y = 0.5; break;
11312
			case "bottom": y = 1; break;
11313
			default: y = origin[ 0 ] / original.height;
11314
		}
11315
		switch ( origin[ 1 ] ) {
11316
			case "left": x = 0; break;
11317
			case "center": x = 0.5; break;
11318
			case "right": x = 1; break;
11319
			default: x = origin[ 1 ] / original.width;
11320
		}
11321
		return {
11322
			x: x,
11323
			y: y
11324
		};
11325
	},
11326
11327
	// Wraps the element around a wrapper that copies position properties
11328
	createWrapper: function( element ) {
11329
11330
		// if the element is already wrapped, return it
11331
		if ( element.parent().is( ".ui-effects-wrapper" )) {
11332
			return element.parent();
11333
		}
11334
11335
		// wrap the element
11336
		var props = {
11337
				width: element.outerWidth(true),
11338
				height: element.outerHeight(true),
11339
				"float": element.css( "float" )
11340
			},
11341
			wrapper = $( "<div></div>" )
11342
				.addClass( "ui-effects-wrapper" )
11343
				.css({
11344
					fontSize: "100%",
11345
					background: "transparent",
11346
					border: "none",
11347
					margin: 0,
11348
					padding: 0
11349
				}),
11350
			// Store the size in case width/height are defined in % - Fixes #5245
11351
			size = {
11352
				width: element.width(),
11353
				height: element.height()
11354
			},
11355
			active = document.activeElement;
11356
11357
		// support: Firefox
11358
		// Firefox incorrectly exposes anonymous content
11359
		// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
11360
		try {
11361
			active.id;
11362
		} catch ( e ) {
11363
			active = document.body;
11364
		}
11365
11366
		element.wrap( wrapper );
11367
11368
		// Fixes #7595 - Elements lose focus when wrapped.
11369
		if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
11370
			$( active ).focus();
11371
		}
11372
11373
		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
11374
11375
		// transfer positioning properties to the wrapper
11376
		if ( element.css( "position" ) === "static" ) {
11377
			wrapper.css({ position: "relative" });
11378
			element.css({ position: "relative" });
11379
		} else {
11380
			$.extend( props, {
11381
				position: element.css( "position" ),
11382
				zIndex: element.css( "z-index" )
11383
			});
11384
			$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
11385
				props[ pos ] = element.css( pos );
11386
				if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
11387
					props[ pos ] = "auto";
11388
				}
11389
			});
11390
			element.css({
11391
				position: "relative",
11392
				top: 0,
11393
				left: 0,
11394
				right: "auto",
11395
				bottom: "auto"
11396
			});
11397
		}
11398
		element.css(size);
11399
11400
		return wrapper.css( props ).show();
11401
	},
11402
11403
	removeWrapper: function( element ) {
11404
		var active = document.activeElement;
11405
11406
		if ( element.parent().is( ".ui-effects-wrapper" ) ) {
11407
			element.parent().replaceWith( element );
11408
11409
			// Fixes #7595 - Elements lose focus when wrapped.
11410
			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
11411
				$( active ).focus();
11412
			}
11413
		}
11414
11415
		return element;
11416
	},
11417
11418
	setTransition: function( element, list, factor, value ) {
11419
		value = value || {};
11420
		$.each( list, function( i, x ) {
11421
			var unit = element.cssUnit( x );
11422
			if ( unit[ 0 ] > 0 ) {
11423
				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
11424
			}
11425
		});
11426
		return value;
11427
	}
11428
});
11429
11430
// return an effect options object for the given parameters:
11431
function _normalizeArguments( effect, options, speed, callback ) {
11432
11433
	// allow passing all options as the first parameter
11434
	if ( $.isPlainObject( effect ) ) {
11435
		options = effect;
11436
		effect = effect.effect;
11437
	}
11438
11439
	// convert to an object
11440
	effect = { effect: effect };
11441
11442
	// catch (effect, null, ...)
11443
	if ( options == null ) {
11444
		options = {};
11445
	}
11446
11447
	// catch (effect, callback)
11448
	if ( $.isFunction( options ) ) {
11449
		callback = options;
11450
		speed = null;
11451
		options = {};
11452
	}
11453
11454
	// catch (effect, speed, ?)
11455
	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
11456
		callback = speed;
11457
		speed = options;
11458
		options = {};
11459
	}
11460
11461
	// catch (effect, options, callback)
11462
	if ( $.isFunction( speed ) ) {
11463
		callback = speed;
11464
		speed = null;
11465
	}
11466
11467
	// add options to effect
11468
	if ( options ) {
11469
		$.extend( effect, options );
11470
	}
11471
11472
	speed = speed || options.duration;
11473
	effect.duration = $.fx.off ? 0 :
11474
		typeof speed === "number" ? speed :
11475
		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
11476
		$.fx.speeds._default;
11477
11478
	effect.complete = callback || options.complete;
11479
11480
	return effect;
11481
}
11482
11483
function standardAnimationOption( option ) {
11484
	// Valid standard speeds (nothing, number, named speed)
11485
	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
11486
		return true;
11487
	}
11488
11489
	// Invalid strings - treat as "normal" speed
11490
	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
11491
		return true;
11492
	}
11493
11494
	// Complete callback
11495
	if ( $.isFunction( option ) ) {
11496
		return true;
11497
	}
11498
11499
	// Options hash (but not naming an effect)
11500
	if ( typeof option === "object" && !option.effect ) {
11501
		return true;
11502
	}
11503
11504
	// Didn't match any standard API
11505
	return false;
11506
}
11507
11508
$.fn.extend({
11509
	effect: function( /* effect, options, speed, callback */ ) {
11510
		var args = _normalizeArguments.apply( this, arguments ),
11511
			mode = args.mode,
11512
			queue = args.queue,
11513
			effectMethod = $.effects.effect[ args.effect ];
11514
11515
		if ( $.fx.off || !effectMethod ) {
11516
			// delegate to the original method (e.g., .show()) if possible
11517
			if ( mode ) {
11518
				return this[ mode ]( args.duration, args.complete );
11519
			} else {
11520
				return this.each( function() {
11521
					if ( args.complete ) {
11522
						args.complete.call( this );
11523
					}
11524
				});
11525
			}
11526
		}
11527
11528
		function run( next ) {
11529
			var elem = $( this ),
11530
				complete = args.complete,
11531
				mode = args.mode;
11532
11533
			function done() {
11534
				if ( $.isFunction( complete ) ) {
11535
					complete.call( elem[0] );
11536
				}
11537
				if ( $.isFunction( next ) ) {
11538
					next();
11539
				}
11540
			}
11541
11542
			// If the element already has the correct final state, delegate to
11543
			// the core methods so the internal tracking of "olddisplay" works.
11544
			if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
11545
				elem[ mode ]();
11546
				done();
11547
			} else {
11548
				effectMethod.call( elem[0], args, done );
11549
			}
11550
		}
11551
11552
		return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
11553
	},
11554
11555
	show: (function( orig ) {
11556
		return function( option ) {
11557
			if ( standardAnimationOption( option ) ) {
11558
				return orig.apply( this, arguments );
11559
			} else {
11560
				var args = _normalizeArguments.apply( this, arguments );
11561
				args.mode = "show";
11562
				return this.effect.call( this, args );
11563
			}
11564
		};
11565
	})( $.fn.show ),
11566
11567
	hide: (function( orig ) {
11568
		return function( option ) {
11569
			if ( standardAnimationOption( option ) ) {
11570
				return orig.apply( this, arguments );
11571
			} else {
11572
				var args = _normalizeArguments.apply( this, arguments );
11573
				args.mode = "hide";
11574
				return this.effect.call( this, args );
11575
			}
11576
		};
11577
	})( $.fn.hide ),
11578
11579
	toggle: (function( orig ) {
11580
		return function( option ) {
11581
			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
11582
				return orig.apply( this, arguments );
11583
			} else {
11584
				var args = _normalizeArguments.apply( this, arguments );
11585
				args.mode = "toggle";
11586
				return this.effect.call( this, args );
11587
			}
11588
		};
11589
	})( $.fn.toggle ),
11590
11591
	// helper functions
11592
	cssUnit: function(key) {
11593
		var style = this.css( key ),
11594
			val = [];
11595
11596
		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
11597
			if ( style.indexOf( unit ) > 0 ) {
11598
				val = [ parseFloat( style ), unit ];
11599
			}
11600
		});
11601
		return val;
11602
	}
11603
});
11604
11605
})();
11606
11607
/******************************************************************************/
11608
/*********************************** EASING ***********************************/
11609
/******************************************************************************/
11610
11611
(function() {
11612
11613
// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
11614
11615
var baseEasings = {};
11616
11617
$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
11618
	baseEasings[ name ] = function( p ) {
11619
		return Math.pow( p, i + 2 );
11620
	};
11621
});
11622
11623
$.extend( baseEasings, {
11624
	Sine: function( p ) {
11625
		return 1 - Math.cos( p * Math.PI / 2 );
11626
	},
11627
	Circ: function( p ) {
11628
		return 1 - Math.sqrt( 1 - p * p );
11629
	},
11630
	Elastic: function( p ) {
11631
		return p === 0 || p === 1 ? p :
11632
			-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
11633
	},
11634
	Back: function( p ) {
11635
		return p * p * ( 3 * p - 2 );
11636
	},
11637
	Bounce: function( p ) {
11638
		var pow2,
11639
			bounce = 4;
11640
11641
		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
11642
		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
11643
	}
11644
});
11645
11646
$.each( baseEasings, function( name, easeIn ) {
11647
	$.easing[ "easeIn" + name ] = easeIn;
11648
	$.easing[ "easeOut" + name ] = function( p ) {
11649
		return 1 - easeIn( 1 - p );
11650
	};
11651
	$.easing[ "easeInOut" + name ] = function( p ) {
11652
		return p < 0.5 ?
11653
			easeIn( p * 2 ) / 2 :
11654
			1 - easeIn( p * -2 + 2 ) / 2;
11655
	};
11656
});
11657
11658
})();
11659
11660
var effect = $.effects;
11661
11662
11663
/*!
11664
 * jQuery UI Effects Highlight 1.11.4
11665
 * http://jqueryui.com
11666
 *
11667
 * Copyright jQuery Foundation and other contributors
11668
 * Released under the MIT license.
11669
 * http://jquery.org/license
11670
 *
11671
 * http://api.jqueryui.com/highlight-effect/
11672
 */
11673
11674
11675
var effectHighlight = $.effects.effect.highlight = function( o, done ) {
11676
	var elem = $( this ),
11677
		props = [ "backgroundImage", "backgroundColor", "opacity" ],
11678
		mode = $.effects.setMode( elem, o.mode || "show" ),
11679
		animation = {
11680
			backgroundColor: elem.css( "backgroundColor" )
11681
		};
11682
11683
	if (mode === "hide") {
11684
		animation.opacity = 0;
11685
	}
11686
11687
	$.effects.save( elem, props );
11688
11689
	elem
11690
		.show()
11691
		.css({
11692
			backgroundImage: "none",
11693
			backgroundColor: o.color || "#ffff99"
11694
		})
11695
		.animate( animation, {
11696
			queue: false,
11697
			duration: o.duration,
11698
			easing: o.easing,
11699
			complete: function() {
11700
				if ( mode === "hide" ) {
11701
					elem.hide();
11702
				}
11703
				$.effects.restore( elem, props );
11704
				done();
11705
			}
11706
		});
11707
};
11708
11709
11710
11711
}));
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-ui-1.11.4.min.css (+7 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.11.4 - 2016-02-22
2
* http://jqueryui.com
3
* Includes: core.css, draggable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, menu.css, progressbar.css, slider.css, tabs.css, theme.css
4
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
* Copyright jQuery Foundation and other contributors; Licensed MIT */
6
7
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/jquery-ui-1.11.4.min.js (+11 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.11.4 - 2016-02-22
2
* http://jqueryui.com
3
* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, menu.js, progressbar.js, slider.js, tabs.js, effect.js, effect-highlight.js
4
* Copyright jQuery Foundation and other contributors; Licensed MIT */
5
6
(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(g.inline?g.dpDiv.parent()[0]:g.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var h=0,l=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=l.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=l.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var u=!1;e(document).mouseup(function(){u=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!u){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),u=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),u=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,_,b,y=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),D={};return b=s(y),y[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,_=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=c.exec(i[0]),t=c.exec(i[1]),D[this]=[e?e[0]:0,t?t[0]:0],n[this]=[d.exec(i[0])[0],d.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?_.left+=m:"center"===n.at[0]&&(_.left+=m/2),"bottom"===n.at[1]?_.top+=g:"center"===n.at[1]&&(_.top+=g/2),p=t(D.at,m,g),_.left+=p[0],_.top+=p[1],this.each(function(){var s,l,u=e(this),c=u.outerWidth(),d=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),T=c+f+i(this,"marginRight")+w.width,S=d+b+i(this,"marginBottom")+w.height,M=e.extend({},_),N=t(D.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=c:"center"===n.my[0]&&(M.left-=c/2),"bottom"===n.my[1]?M.top-=d:"center"===n.my[1]&&(M.top-=d/2),M.left+=N[0],M.top+=N[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:c,elemHeight:d,collisionPosition:s,collisionWidth:T,collisionHeight:S,offset:[p[0]+N[0],p[1]+N[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-c,s=v.top-M.top,a=s+g-d,h={target:{element:y,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:c,height:d},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};c>m&&m>r(t+i)&&(h.horizontal="center"),d>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,c=l+t.collisionWidth-o-h,d="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+d+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=d+p+f)):c>0&&(s=e.left-t.collisionPosition.marginLeft+d+p+f-h,(s>0||c>r(s))&&(e.left+=d+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,c=l+t.collisionHeight-o-h,d="top"===t.my[1],p=d?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):c>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||c>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}
7
},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,c,d,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,_=i.offset.top,b=_+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,u=s.snapElements[d].top-s.margins.top,c=u+s.snapElements[d].height,h-m>v||g>l+m||u-m>b||_>c+m||!e.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(c-_),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-_),a=m>=Math.abs(c-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,c=l+i.proportions().width,d=u+i.proportions().height;switch(s){case"fit":return a>=l&&c>=r&&o>=u&&d>=h;case"intersect":return a+t.helperProportions.width/2>l&&c>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&d>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&d>=o||h>=u&&d>=h||u>o&&h>d)&&(a>=l&&c>=a||r>=l&&c>=r||l>a&&r>c);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable,e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,c="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||t+u>a&&o>t+u,p=c&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=e(d[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(c.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=c.length-1;i>=0;i--)for(o=c[i][1],r=c[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,c,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&e.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=d.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",c=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[c]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[c]-h)&&(n=Math.abs(t[c]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;
8
"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},c=l&&u.down||u,d=function(){o._toggleComplete(i)};return"number"==typeof c&&(a=c),"string"==typeof c&&(n=c),n=n||c.easing||u.easing,a=a||c.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:d,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,d):e.animate(this.showProps,a,n,d)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,d="ui-button ui-widget ui-state-default ui-corner-all",p="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},m=function(t){var i=t.name,s=t.form,n=e([]);
9
return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(d).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];m(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(d+" ui-state-active "+p).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?m(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(p),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var g;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,c,d=this._dialogInst;return d||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},e.data(this._dialogInput[0],"datepicker",d)),r(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),g===n&&(g=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,g=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),c=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,_=-1,b=!1,y=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=y(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(y(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||y("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",c,d);break;case"o":_=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":y("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),_>-1)for(g=1,v=_;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},c="",d=!1;if(t)for(s=0;e.length>s;s++)if(d)"'"!==e.charAt(s)||h("'")?c+=e.charAt(s):d=!1;else switch(e.charAt(s)){case"d":c+=l("d",t.getDate(),2);break;case"D":c+=u("D",t.getDay(),n,a);break;case"o":c+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":c+=l("m",t.getMonth()+1,2);break;case"M":c+=u("M",t.getMonth(),o,r);break;case"y":c+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?c+="'":d=!0;break;default:c+=e.charAt(s)}return c},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,c,d,p,f,m,g,v,_,b,y,x,w,k,D,T,S,M,N,C,P,A,I,H,z,F,E,W,O,L,R=new Date,j=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),K=this._get(e,"navigationAsDateFormat"),U=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),q=this._get(e,"stepMonths"),G=1!==U[0]||1!==U[1],X=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),Q=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),Q)for(t=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-U[0]*U[1]+1,Q.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-q,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+q,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?X:j,o=K?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,c=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),_=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),y="",w=0;U[0]>w;w++){for(k="",this.maxRows=4,D=0;U[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",G){if(M+="<div class='ui-datepicker-group",U[1]>1)switch(D){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");
10
break;case U[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,$,Q,w>0||D>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=c?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,N+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[C]+"'>"+p[C]+"</span></th>";for(M+=N+"</tr></thead><tbody>",P=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,P)),A=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((A+P)/7),H=G?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-A)),F=0;H>F;F++){for(M+="<tr>",E=c?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)W=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],O=z.getMonth()!==Z,L=O&&!_||!W[0]||$&&$>z||Q&&z>Q,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(z.getTime()===T.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===T.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+W[1]+(z.getTime()===X.getTime()?" "+this._currentClass:"")+(z.getTime()===j.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":L?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===j.getTime()?" ui-state-highlight":"")+(z.getTime()===X.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(G?"</div>"+(U[0]>0&&D===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}y+=k}return y+=l,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,c,d,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),_=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(a||!g)y+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(y+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");y+="</select>"}if(_||(b+=y+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(c=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10);return isNaN(t)?d:t},f=p(c[0]),m=Math.max(f,p(c[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),_&&(b+=(!a&&g&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===c.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}});var v="ui-effects-",_=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=c[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]
11
}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},c={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var c=this,d=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===d?(n instanceof l?f(u,function(e,t){n[t.cache]&&(c[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!c[a]&&s.to){if("alpha"===e||null==n[e])return;c[a]=s.to(c._rgba)}c[a][t.idx]=i(n[e],t,!0)}),c[a]&&0>e.inArray(null,c[a].slice(0,3))&&(c[a][3]=1,s.from&&(c._rgba=s.from(c[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=c[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,c=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=c?l/u:l/(2-u),[Math.round(t)%360,i,c,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),c="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(e,t){var s=c["object"===r?e:t.idx];null==s&&(s=d[t.idx]),d[t.idx]=i(s,t)}),u?(n=l(u(d)),n[o]=d,n):l(d)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(_),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(_.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(v+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(v+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})}});
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc (-3 / +4 lines)
Lines 18-32 Link Here
18
18
19
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
19
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
20
20
21
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui.css" />
21
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" />
22
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" />
22
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" />
23
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/font-awesome/css/font-awesome.min.css" />
23
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/font-awesome/css/font-awesome.min.css" />
24
<link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
24
<link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
25
[% INCLUDE intranetstylesheet.inc %]
25
[% INCLUDE intranetstylesheet.inc %]
26
[% IF ( bidi )            %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />[% END %]
26
[% IF ( bidi )            %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />[% END %]
27
27
28
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
28
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script>
29
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui.js"></script>
29
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script>
30
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script>
30
<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
31
<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
31
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
32
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
32
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script>
33
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc (-3 / +4 lines)
Lines 2-15 Link Here
2
<title>Online help</title>
2
<title>Online help</title>
3
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
3
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
4
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
5
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui.css" />
5
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" />
6
<link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
6
<link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
7
[% INCLUDE intranetstylesheet.inc %]
7
[% INCLUDE intranetstylesheet.inc %]
8
[% IF ( bidi ) %]
8
[% IF ( bidi ) %]
9
   <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />
9
   <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />
10
[% END %]
10
[% END %]
11
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
11
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script>
12
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui.js"></script>
12
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script>
13
<script type="text/javascript" src="[% interface %]/lib/jquery-ui-1.11.4.min.js"></script>
13
<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
14
<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
14
<!-- koha core js -->
15
<!-- koha core js -->
15
<script type="text/javascript" src="[% themelang %]/js/staff-global.js"></script>
16
<script type="text/javascript" src="[% themelang %]/js/staff-global.js"></script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline-mf.tt (-3 / +4 lines)
Lines 8-16 CACHE: Link Here
8
[% interface %]/lib/bootstrap/bootstrap.min.js
8
[% interface %]/lib/bootstrap/bootstrap.min.js
9
[% interface %]/lib/jquery/images/ui-icons_222222_256x240.png
9
[% interface %]/lib/jquery/images/ui-icons_222222_256x240.png
10
[% interface %]/lib/jquery/images/ui-icons_454545_256x240.png
10
[% interface %]/lib/jquery/images/ui-icons_454545_256x240.png
11
[% interface %]/lib/jquery/jquery-ui.css
11
[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css
12
[% interface %]/lib/jquery/jquery-ui.js
12
[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js
13
[% interface %]/lib/jquery/jquery.js
13
[% interface %]/lib/jquery/jquery-2.2.3.min.js
14
[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js
14
[% interface %]/lib/jquery/plugins/jquery.cookie.min.js
15
[% interface %]/lib/jquery/plugins/jquery.cookie.min.js
15
[% interface %]/lib/jquery/plugins/jquery.highlight-3.js
16
[% interface %]/lib/jquery/plugins/jquery.highlight-3.js
16
[% interface %]/lib/shortcut/shortcut.js
17
[% interface %]/lib/shortcut/shortcut.js
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt (-2 / +2 lines)
Lines 12-18 Link Here
12
	</style>
12
	</style>
13
[% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %]
13
[% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %]
14
[% IF ( IntranetUserJS ) %]
14
[% IF ( IntranetUserJS ) %]
15
    <script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
15
    <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script>
16
    <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script>
16
    <script type="text/javascript">
17
    <script type="text/javascript">
17
    //<![CDATA[
18
    //<![CDATA[
18
    [% IntranetUserJS %]
19
    [% IntranetUserJS %]
19
- 

Return to bug 15883