vendor: 4,408 bytes, lines 1-180
1/*! 2 * jQuery JavaScript Library v1.12.4 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-05-20T17:17Z 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"; 45var deletedIds = []; 46 47var document = window.document; 48 49var slice = deletedIds.slice; 50 51var concat = deletedIds.concat; 52 53var push = deletedIds.push; 54 55var indexOf = deletedIds.indexOf; 56 57var class2type = {}; 58 59var toString = class2type.toString; 60 61var hasOwn = class2type.hasOwnProperty; 62 63var support = {}; 64 65 66 67var 68 version = "1.12.4", 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, IE<9 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 91jQuery.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: deletedIds.sort, 172 splice: deletedIds.splice 173}; 174 175jQuery.extend = jQuery.fn.extend = function() { 176 var src, copyIsArray, copy, name, options, clone, 177 target = arguments[ 0 ] || {}, 178 i = 1, 179 length = arguments.length, 180 deep = false;
vendor: 8,863 bytes, lines 181-553
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 244jQuery.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 // See test/unit/core.js for details concerning isFunction. 259 // Since version 1.3, DOM methods and functions like alert 260 // aren't supported. They return false on IE (#2968). 261 isFunction: function( obj ) { 262 return jQuery.type( obj ) === "function"; 263 }, 264 265 isArray: Array.isArray || function( obj ) { 266 return jQuery.type( obj ) === "array"; 267 }, 268 269 isWindow: function( obj ) { 270 /* jshint eqeqeq: false */ 271 return obj != null && obj == obj.window; 272 }, 273 274 isNumeric: function( obj ) { 275 276 // parseFloat NaNs numeric-cast false positives (null|true|false|"") 277 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 278 // subtraction forces infinities to NaN 279 // adding 1 corrects loss of precision from parseFloat (#15100) 280 var realStringObj = obj && obj.toString(); 281 return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; 282 }, 283 284 isEmptyObject: function( obj ) { 285 var name; 286 for ( name in obj ) { 287 return false; 288 } 289 return true; 290 }, 291 292 isPlainObject: function( obj ) { 293 var key; 294 295 // Must be an Object. 296 // Because of IE, we also have to check the presence of the constructor property. 297 // Make sure that DOM nodes and window objects don't pass through, as well 298 if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 299 return false; 300 } 301 302 try { 303 304 // Not own constructor property must be Object 305 if ( obj.constructor && 306 !hasOwn.call( obj, "constructor" ) && 307 !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { 308 return false; 309 } 310 } catch ( e ) { 311 312 // IE8,9 Will throw exceptions on certain host objects #9897 313 return false; 314 } 315 316 // Support: IE<9 317 // Handle iteration over inherited properties before own properties. 318 if ( !support.ownFirst ) { 319 for ( key in obj ) { 320 return hasOwn.call( obj, key ); 321 } 322 } 323 324 // Own properties are enumerated firstly, so to speed up, 325 // if last one is own, then all properties are own. 326 for ( key in obj ) {} 327 328 return key === undefined || hasOwn.call( obj, key ); 329 }, 330 331 type: function( obj ) { 332 if ( obj == null ) { 333 return obj + ""; 334 } 335 return typeof obj === "object" || typeof obj === "function" ? 336 class2type[ toString.call( obj ) ] || "object" : 337 typeof obj; 338 }, 339 340 // Workarounds based on findings by Jim Driscoll 341 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context 342 globalEval: function( data ) { 343 if ( data && jQuery.trim( data ) ) { 344 345 // We use execScript on Internet Explorer 346 // We use an anonymous function so that context is window 347 // rather than jQuery in Firefox 348 ( window.execScript || function( data ) { 349 window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation 350 } )( data ); 351 } 352 }, 353 354 // Convert dashed to camelCase; used by the css and data modules 355 // Microsoft forgot to hump their vendor prefix (#9572) 356 camelCase: function( string ) { 357 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 358 }, 359 360 nodeName: function( elem, name ) { 361 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 362 }, 363 364 each: function( obj, callback ) { 365 var length, i = 0; 366 367 if ( isArrayLike( obj ) ) { 368 length = obj.length; 369 for ( ; i < length; i++ ) { 370 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 371 break; 372 } 373 } 374 } else { 375 for ( i in obj ) { 376 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 377 break; 378 } 379 } 380 } 381 382 return obj; 383 }, 384 385 // Support: Android<4.1, IE<9 386 trim: function( text ) { 387 return text == null ? 388 "" : 389 ( text + "" ).replace( rtrim, "" ); 390 }, 391 392 // results is for internal usage only 393 makeArray: function( arr, results ) { 394 var ret = results || []; 395 396 if ( arr != null ) { 397 if ( isArrayLike( Object( arr ) ) ) { 398 jQuery.merge( ret, 399 typeof arr === "string" ? 400 [ arr ] : arr 401 ); 402 } else { 403 push.call( ret, arr ); 404 } 405 } 406 407 return ret; 408 }, 409 410 inArray: function( elem, arr, i ) { 411 var len; 412 413 if ( arr ) { 414 if ( indexOf ) { 415 return indexOf.call( arr, elem, i ); 416 } 417 418 len = arr.length; 419 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; 420 421 for ( ; i < len; i++ ) { 422 423 // Skip accessing in sparse arrays 424 if ( i in arr && arr[ i ] === elem ) { 425 return i; 426 } 427 } 428 } 429 430 return -1; 431 }, 432 433 merge: function( first, second ) { 434 var len = +second.length, 435 j = 0, 436 i = first.length; 437 438 while ( j < len ) { 439 first[ i++ ] = second[ j++ ]; 440 } 441 442 // Support: IE<9 443 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) 444 if ( len !== len ) { 445 while ( second[ j ] !== undefined ) { 446 first[ i++ ] = second[ j++ ]; 447 } 448 } 449 450 first.length = i; 451 452 return first; 453 }, 454 455 grep: function( elems, callback, invert ) { 456 var callbackInverse, 457 matches = [], 458 i = 0, 459 length = elems.length, 460 callbackExpect = !invert; 461 462 // Go through the array, only saving the items 463 // that pass the validator function 464 for ( ; i < length; i++ ) { 465 callbackInverse = !callback( elems[ i ], i ); 466 if ( callbackInverse !== callbackExpect ) { 467 matches.push( elems[ i ] ); 468 } 469 } 470 471 return matches; 472 }, 473 474 // arg is for internal usage only 475 map: function( elems, callback, arg ) { 476 var length, value, 477 i = 0, 478 ret = []; 479 480 // Go through the array, translating each of the items to their new values 481 if ( isArrayLike( elems ) ) { 482 length = elems.length; 483 for ( ; i < length; i++ ) { 484 value = callback( elems[ i ], i, arg ); 485 486 if ( value != null ) { 487 ret.push( value ); 488 } 489 } 490 491 // Go through every key on the object, 492 } else { 493 for ( i in elems ) { 494 value = callback( elems[ i ], i, arg ); 495 496 if ( value != null ) { 497 ret.push( value ); 498 } 499 } 500 } 501 502 // Flatten any nested arrays 503 return concat.apply( [], ret ); 504 }, 505 506 // A global GUID counter for objects 507 guid: 1, 508 509 // Bind a function to a context, optionally partially applying any 510 // arguments. 511 proxy: function( fn, context ) { 512 var args, proxy, tmp; 513 514 if ( typeof context === "string" ) { 515 tmp = fn[ context ]; 516 context = fn; 517 fn = tmp; 518 } 519 520 // Quick check to determine if target is callable, in the spec 521 // this throws a TypeError, but we will just return undefined. 522 if ( !jQuery.isFunction( fn ) ) { 523 return undefined; 524 } 525 526 // Simulated bind 527 args = slice.call( arguments, 2 ); 528 proxy = function() { 529 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 530 }; 531 532 // Set the guid of unique handler to the same of original handler, so it can be removed 533 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 534 535 return proxy; 536 }, 537 538 now: function() { 539 return +( new Date() ); 540 }, 541 542 // jQuery.support is not used in Core but other projects attach their 543 // properties to it so it needs to exist. 544 support: support 545} ); 546 547// JSHint would error on this code due to the Symbol not being defined in ES5. 548// Defining this global in .jshintrc would create a danger of using the global 549// unguarded in another place, it seems safer to just disable JSHint for these 550// three lines. 551/* jshint ignore: start */ 552if ( typeof Symbol === "function" ) { 553 jQuery.fn[ Symbol.iterator ] = deletedIds
vendor: 63,327 bytes, lines 553-2790
553[ Symbol.iterator ]; 554} 555/* jshint ignore: end */ 556 557// Populate the class2type map 558jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 559function( i, name ) { 560 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 561} ); 562 563function isArrayLike( obj ) { 564 565 // Support: iOS 8.2 (not reproducible in simulator) 566 // `in` check used to prevent JIT error (gh-2145) 567 // hasOwn isn't used here due to false negatives 568 // regarding Nodelist length in IE 569 var length = !!obj && "length" in obj && obj.length, 570 type = jQuery.type( obj ); 571 572 if ( type === "function" || jQuery.isWindow( obj ) ) { 573 return false; 574 } 575 576 return type === "array" || length === 0 || 577 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 578} 579var Sizzle = 580/*! 581 * Sizzle CSS Selector Engine v2.2.1 582 * http://sizzlejs.com/ 583 * 584 * Copyright jQuery Foundation and other contributors 585 * Released under the MIT license 586 * http://jquery.org/license 587 * 588 * Date: 2015-10-17 589 */ 590(function( window ) { 591 592var i, 593 support, 594 Expr, 595 getText, 596 isXML, 597 tokenize, 598 compile, 599 select, 600 outermostContext, 601 sortInput, 602 hasDuplicate, 603 604 // Local document vars 605 setDocument, 606 document, 607 docElem, 608 documentIsHTML, 609 rbuggyQSA, 610 rbuggyMatches, 611 matches, 612 contains, 613 614 // Instance-specific data 615 expando = "sizzle" + 1 * new Date(), 616 preferredDoc = window.document, 617 dirruns = 0, 618 done = 0, 619 classCache = createCache(), 620 tokenCache = createCache(), 621 compilerCache = createCache(), 622 sortOrder = function( a, b ) { 623 if ( a === b ) { 624 hasDuplicate = true; 625 } 626 return 0; 627 }, 628 629 // General-purpose constants 630 MAX_NEGATIVE = 1 << 31, 631 632 // Instance methods 633 hasOwn = ({}).hasOwnProperty, 634 arr = [], 635 pop = arr.pop, 636 push_native = arr.push, 637 push = arr.push, 638 slice = arr.slice, 639 // Use a stripped-down indexOf as it's faster than native 640 // http://jsperf.com/thor-indexof-vs-for/5 641 indexOf = function( list, elem ) { 642 var i = 0, 643 len = list.length; 644 for ( ; i < len; i++ ) { 645 if ( list[i] === elem ) { 646 return i; 647 } 648 } 649 return -1; 650 }, 651 652 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 653 654 // Regular expressions 655 656 // http://www.w3.org/TR/css3-selectors/#whitespace 657 whitespace = "[\\x20\\t\\r\\n\\f]", 658 659 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 660 identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 661 662 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 663 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 664 // Operator (capture 2) 665 "*([*^$|!~]?=)" + whitespace + 666 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 667 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 668 "*\\]", 669 670 pseudos = ":(" + identifier + ")(?:\\((" + 671 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 672 // 1. quoted (capture 3; capture 4 or capture 5) 673 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 674 // 2. simple (capture 6) 675 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 676 // 3. anything else (capture 2) 677 ".*" + 678 ")\\)|)", 679 680 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 681 rwhitespace = new RegExp( whitespace + "+", "g" ), 682 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 683 684 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 685 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 686 687 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), 688 689 rpseudo = new RegExp( pseudos ), 690 ridentifier = new RegExp( "^" + identifier + "$" ), 691 692 matchExpr = { 693 "ID": new RegExp( "^#(" + identifier + ")" ), 694 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 695 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 696 "ATTR": new RegExp( "^" + attributes ), 697 "PSEUDO": new RegExp( "^" + pseudos ), 698 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 699 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 700 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 701 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 702 // For use in libraries implementing .is() 703 // We use this for POS matching in `select` 704 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 705 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 706 }, 707 708 rinputs = /^(?:input|select|textarea|button)$/i, 709 rheader = /^h\d$/i, 710 711 rnative = /^[^{]+\{\s*\[native \w/, 712 713 // Easily-parseable/retrievable ID or TAG or CLASS selectors 714 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 715 716 rsibling = /[+~]/, 717 rescape = /'|\\/g, 718 719 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 720 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 721 funescape = function( _, escaped, escapedWhitespace ) { 722 var high = "0x" + escaped - 0x10000; 723 // NaN means non-codepoint 724 // Support: Firefox<24 725 // Workaround erroneous numeric interpretation of +"0x" 726 return high !== high || escapedWhitespace ? 727 escaped : 728 high < 0 ? 729 // BMP codepoint 730 String.fromCharCode( high + 0x10000 ) : 731 // Supplemental Plane codepoint (surrogate pair) 732 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 733 }, 734 735 // Used for iframes 736 // See setDocument() 737 // Removing the function wrapper causes a "Permission Denied" 738 // error in IE 739 unloadHandler = function() { 740 setDocument(); 741 }; 742 743// Optimize for push.apply( _, NodeList ) 744try { 745 push.apply( 746 (arr = slice.call( preferredDoc.childNodes )), 747 preferredDoc.childNodes 748 ); 749 // Support: Android<4.0 750 // Detect silently failing push.apply 751 arr[ preferredDoc.childNodes.length ].nodeType; 752} catch ( e ) { 753 push = { apply: arr.length ? 754 755 // Leverage slice if possible 756 function( target, els ) { 757 push_native.apply( target, slice.call(els) ); 758 } : 759 760 // Support: IE<9 761 // Otherwise append directly 762 function( target, els ) { 763 var j = target.length, 764 i = 0; 765 // Can't trust NodeList.length 766 while ( (target[j++] = els[i++]) ) {} 767 target.length = j - 1; 768 } 769 }; 770} 771 772function Sizzle( selector, context, results, seed ) { 773 var m, i, elem, nid, nidselect, match, groups, newSelector, 774 newContext = context && context.ownerDocument, 775 776 // nodeType defaults to 9, since context defaults to document 777 nodeType = context ? context.nodeType : 9; 778 779 results = results || []; 780 781 // Return early from calls with invalid selector or context 782 if ( typeof selector !== "string" || !selector || 783 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 784 785 return results; 786 } 787 788 // Try to shortcut find operations (as opposed to filters) in HTML documents 789 if ( !seed ) { 790 791 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 792 setDocument( context ); 793 } 794 context = context || document; 795 796 if ( documentIsHTML ) { 797 798 // If the selector is sufficiently simple, try using a "get*By*" DOM method 799 // (excepting DocumentFragment context, where the methods don't exist) 800 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 801 802 // ID selector 803 if ( (m = match[1]) ) { 804 805 // Document context 806 if ( nodeType === 9 ) { 807 if ( (elem = context.getElementById( m )) ) { 808 809 // Support: IE, Opera, Webkit 810 // TODO: identify versions 811 // getElementById can match elements by name instead of ID 812 if ( elem.id === m ) { 813 results.push( elem ); 814 return results; 815 } 816 } else { 817 return results; 818 } 819 820 // Element context 821 } else { 822 823 // Support: IE, Opera, Webkit 824 // TODO: identify versions 825 // getElementById can match elements by name instead of ID 826 if ( newContext && (elem = newContext.getElementById( m )) && 827 contains( context, elem ) && 828 elem.id === m ) { 829 830 results.push( elem ); 831 return results; 832 } 833 } 834 835 // Type selector 836 } else if ( match[2] ) { 837 push.apply( results, context.getElementsByTagName( selector ) ); 838 return results; 839 840 // Class selector 841 } else if ( (m = match[3]) && support.getElementsByClassName && 842 context.getElementsByClassName ) { 843 844 push.apply( results, context.getElementsByClassName( m ) ); 845 return results; 846 } 847 } 848 849 // Take advantage of querySelectorAll 850 if ( support.qsa && 851 !compilerCache[ selector + " " ] && 852 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { 853 854 if ( nodeType !== 1 ) { 855 newContext = context; 856 newSelector = selector; 857 858 // qSA looks outside Element context, which is not what we want 859 // Thanks to Andrew Dupont for this workaround technique 860 // Support: IE <=8 861 // Exclude object elements 862 } else if ( context.nodeName.toLowerCase() !== "object" ) { 863 864 // Capture the context ID, setting it first if necessary 865 if ( (nid = context.getAttribute( "id" )) ) { 866 nid = nid.replace( rescape, "\\$&" ); 867 } else { 868 context.setAttribute( "id", (nid = expando) ); 869 } 870 871 // Prefix every selector in the list 872 groups = tokenize( selector ); 873 i = groups.length; 874 nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; 875 while ( i-- ) { 876 groups[i] = nidselect + " " + toSelector( groups[i] ); 877 } 878 newSelector = groups.join( "," ); 879 880 // Expand context for sibling selectors 881 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 882 context; 883 } 884 885 if ( newSelector ) { 886 try { 887 push.apply( results, 888 newContext.querySelectorAll( newSelector ) 889 ); 890 return results; 891 } catch ( qsaError ) { 892 } finally { 893 if ( nid === expando ) { 894 context.removeAttribute( "id" ); 895 } 896 } 897 } 898 } 899 } 900 } 901 902 // All others 903 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 904} 905 906/** 907 * Create key-value caches of limited size 908 * @returns {function(string, object)} Returns the Object data after storing it on itself with 909 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 910 * deleting the oldest entry 911 */ 912function createCache() { 913 var keys = []; 914 915 function cache( key, value ) { 916 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 917 if ( keys.push( key + " " ) > Expr.cacheLength ) { 918 // Only keep the most recent entries 919 delete cache[ keys.shift() ]; 920 } 921 return (cache[ key + " " ] = value); 922 } 923 return cache; 924} 925 926/** 927 * Mark a function for special use by Sizzle 928 * @param {Function} fn The function to mark 929 */ 930function markFunction( fn ) { 931 fn[ expando ] = true; 932 return fn; 933} 934 935/** 936 * Support testing using an element 937 * @param {Function} fn Passed the created div and expects a boolean result 938 */ 939function assert( fn ) { 940 var div = document.createElement("div"); 941 942 try { 943 return !!fn( div ); 944 } catch (e) { 945 return false; 946 } finally { 947 // Remove from its parent by default 948 if ( div.parentNode ) { 949 div.parentNode.removeChild( div ); 950 } 951 // release memory in IE 952 div = null; 953 } 954} 955 956/** 957 * Adds the same handler for all of the specified attrs 958 * @param {String} attrs Pipe-separated list of attributes 959 * @param {Function} handler The method that will be applied 960 */ 961function addHandle( attrs, handler ) { 962 var arr = attrs.split("|"), 963 i = arr.length; 964 965 while ( i-- ) { 966 Expr.attrHandle[ arr[i] ] = handler; 967 } 968} 969 970/** 971 * Checks document order of two siblings 972 * @param {Element} a 973 * @param {Element} b 974 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 975 */ 976function siblingCheck( a, b ) { 977 var cur = b && a, 978 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 979 ( ~b.sourceIndex || MAX_NEGATIVE ) - 980 ( ~a.sourceIndex || MAX_NEGATIVE ); 981 982 // Use IE sourceIndex if available on both nodes 983 if ( diff ) { 984 return diff; 985 } 986 987 // Check if b follows a 988 if ( cur ) { 989 while ( (cur = cur.nextSibling) ) { 990 if ( cur === b ) { 991 return -1; 992 } 993 } 994 } 995 996 return a ? 1 : -1; 997} 998 999/** 1000 * Returns a function to use in pseudos for input types 1001 * @param {String} type 1002 */ 1003function createInputPseudo( type ) { 1004 return function( elem ) { 1005 var name = elem.nodeName.toLowerCase(); 1006 return name === "input" && elem.type === type; 1007 }; 1008} 1009 1010/** 1011 * Returns a function to use in pseudos for buttons 1012 * @param {String} type 1013 */ 1014function createButtonPseudo( type ) { 1015 return function( elem ) { 1016 var name = elem.nodeName.toLowerCase(); 1017 return (name === "input" || name === "button") && elem.type === type; 1018 }; 1019} 1020 1021/** 1022 * Returns a function to use in pseudos for positionals 1023 * @param {Function} fn 1024 */ 1025function createPositionalPseudo( fn ) { 1026 return markFunction(function( argument ) { 1027 argument = +argument; 1028 return markFunction(function( seed, matches ) { 1029 var j, 1030 matchIndexes = fn( [], seed.length, argument ), 1031 i = matchIndexes.length; 1032 1033 // Match elements found at the specified indexes 1034 while ( i-- ) { 1035 if ( seed[ (j = matchIndexes[i]) ] ) { 1036 seed[j] = !(matches[j] = seed[j]); 1037 } 1038 } 1039 }); 1040 }); 1041} 1042 1043/** 1044 * Checks a node for validity as a Sizzle context 1045 * @param {Element|Object=} context 1046 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1047 */ 1048function testContext( context ) { 1049 return context && typeof context.getElementsByTagName !== "undefined" && context; 1050} 1051 1052// Expose support vars for convenience 1053support = Sizzle.support = {}; 1054 1055/** 1056 * Detects XML nodes 1057 * @param {Element|Object} elem An element or a document 1058 * @returns {Boolean} True iff elem is a non-HTML XML node 1059 */ 1060isXML = Sizzle.isXML = function( elem ) { 1061 // documentElement is verified for cases where it doesn't yet exist 1062 // (such as loading iframes in IE - #4833) 1063 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 1064 return documentElement ? documentElement.nodeName !== "HTML" : false; 1065}; 1066 1067/** 1068 * Sets document-related variables once based on the current document 1069 * @param {Element|Object} [doc] An element or document object to use to set the document 1070 * @returns {Object} Returns the current document 1071 */ 1072setDocument = Sizzle.setDocument = function( node ) { 1073 var hasCompare, parent, 1074 doc = node ? node.ownerDocument || node : preferredDoc; 1075 1076 // Return early if doc is invalid or already selected 1077 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 1078 return document; 1079 } 1080 1081 // Update global variables 1082 document = doc; 1083 docElem = document.documentElement; 1084 documentIsHTML = !isXML( document ); 1085 1086 // Support: IE 9-11, Edge 1087 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 1088 if ( (parent = document.defaultView) && parent.top !== parent ) { 1089 // Support: IE 11 1090 if ( parent.addEventListener ) { 1091 parent.addEventListener( "unload", unloadHandler, false ); 1092 1093 // Support: IE 9 - 10 only 1094 } else if ( parent.attachEvent ) { 1095 parent.attachEvent( "onunload", unloadHandler ); 1096 } 1097 } 1098 1099 /* Attributes 1100 ---------------------------------------------------------------------- */ 1101 1102 // Support: IE<8 1103 // Verify that getAttribute really returns attributes and not properties 1104 // (excepting IE8 booleans) 1105 support.attributes = assert(function( div ) { 1106 div.className = "i"; 1107 return !div.getAttribute("className"); 1108 }); 1109 1110 /* getElement(s)By* 1111 ---------------------------------------------------------------------- */ 1112 1113 // Check if getElementsByTagName("*") returns only elements 1114 support.getElementsByTagName = assert(function( div ) { 1115 div.appendChild( document.createComment("") ); 1116 return !div.getElementsByTagName("*").length; 1117 }); 1118 1119 // Support: IE<9 1120 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 1121 1122 // Support: IE<10 1123 // Check if getElementById returns elements by name 1124 // The broken getElementById methods don't pick up programatically-set names, 1125 // so use a roundabout getElementsByName test 1126 support.getById = assert(function( div ) { 1127 docElem.appendChild( div ).id = expando; 1128 return !document.getElementsByName || !document.getElementsByName( expando ).length; 1129 }); 1130 1131 // ID find and filter 1132 if ( support.getById ) { 1133 Expr.find["ID"] = function( id, context ) { 1134 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1135 var m = context.getElementById( id ); 1136 return m ? [ m ] : []; 1137 } 1138 }; 1139 Expr.filter["ID"] = function( id ) { 1140 var attrId = id.replace( runescape, funescape ); 1141 return function( elem ) { 1142 return elem.getAttribute("id") === attrId; 1143 }; 1144 }; 1145 } else { 1146 // Support: IE6/7 1147 // getElementById is not reliable as a find shortcut 1148 delete Expr.find["ID"]; 1149 1150 Expr.filter["ID"] = function( id ) { 1151 var attrId = id.replace( runescape, funescape ); 1152 return function( elem ) { 1153 var node = typeof elem.getAttributeNode !== "undefined" && 1154 elem.getAttributeNode("id"); 1155 return node && node.value === attrId; 1156 }; 1157 }; 1158 } 1159 1160 // Tag 1161 Expr.find["TAG"] = support.getElementsByTagName ? 1162 function( tag, context ) { 1163 if ( typeof context.getElementsByTagName !== "undefined" ) { 1164 return context.getElementsByTagName( tag ); 1165 1166 // DocumentFragment nodes don't have gEBTN 1167 } else if ( support.qsa ) { 1168 return context.querySelectorAll( tag ); 1169 } 1170 } : 1171 1172 function( tag, context ) { 1173 var elem, 1174 tmp = [], 1175 i = 0, 1176 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 1177 results = context.getElementsByTagName( tag ); 1178 1179 // Filter out possible comments 1180 if ( tag === "*" ) { 1181 while ( (elem = results[i++]) ) { 1182 if ( elem.nodeType === 1 ) { 1183 tmp.push( elem ); 1184 } 1185 } 1186 1187 return tmp; 1188 } 1189 return results; 1190 }; 1191 1192 // Class 1193 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 1194 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 1195 return context.getElementsByClassName( className ); 1196 } 1197 }; 1198 1199 /* QSA/matchesSelector 1200 ---------------------------------------------------------------------- */ 1201 1202 // QSA and matchesSelector support 1203 1204 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 1205 rbuggyMatches = []; 1206 1207 // qSa(:focus) reports false when true (Chrome 21) 1208 // We allow this because of a bug in IE8/9 that throws an error 1209 // whenever `document.activeElement` is accessed on an iframe 1210 // So, we allow :focus to pass through QSA all the time to avoid the IE error 1211 // See http://bugs.jquery.com/ticket/13378 1212 rbuggyQSA = []; 1213 1214 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { 1215 // Build QSA regex 1216 // Regex strategy adopted from Diego Perini 1217 assert(function( div ) { 1218 // Select is set to empty string on purpose 1219 // This is to test IE's treatment of not explicitly 1220 // setting a boolean content attribute, 1221 // since its presence should be enough 1222 // http://bugs.jquery.com/ticket/12359 1223 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + 1224 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 1225 "<option selected=''></option></select>"; 1226 1227 // Support: IE8, Opera 11-12.16 1228 // Nothing should be selected when empty strings follow ^= or $= or *= 1229 // The test attribute must be unknown in Opera but "safe" for WinRT 1230 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 1231 if ( div.querySelectorAll("[msallowcapture^='']").length ) { 1232 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 1233 } 1234 1235 // Support: IE8 1236 // Boolean attributes and "value" are not treated correctly 1237 if ( !div.querySelectorAll("[selected]").length ) { 1238 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 1239 } 1240 1241 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 1242 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 1243 rbuggyQSA.push("~="); 1244 } 1245 1246 // Webkit/Opera - :checked should return selected option elements 1247 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1248 // IE8 throws error here and will not see later tests 1249 if ( !div.querySelectorAll(":checked").length ) { 1250 rbuggyQSA.push(":checked"); 1251 } 1252 1253 // Support: Safari 8+, iOS 8+ 1254 // https://bugs.webkit.org/show_bug.cgi?id=136851 1255 // In-page `selector#id sibing-combinator selector` fails 1256 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { 1257 rbuggyQSA.push(".#.+[+~]"); 1258 } 1259 }); 1260 1261 assert(function( div ) { 1262 // Support: Windows 8 Native Apps 1263 // The type and name attributes are restricted during .innerHTML assignment 1264 var input = document.createElement("input"); 1265 input.setAttribute( "type", "hidden" ); 1266 div.appendChild( input ).setAttribute( "name", "D" ); 1267 1268 // Support: IE8 1269 // Enforce case-sensitivity of name attribute 1270 if ( div.querySelectorAll("[name=d]").length ) { 1271 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 1272 } 1273 1274 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 1275 // IE8 throws error here and will not see later tests 1276 if ( !div.querySelectorAll(":enabled").length ) { 1277 rbuggyQSA.push( ":enabled", ":disabled" ); 1278 } 1279 1280 // Opera 10-11 does not throw on post-comma invalid pseudos 1281 div.querySelectorAll("*,:x"); 1282 rbuggyQSA.push(",.*:"); 1283 }); 1284 } 1285 1286 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 1287 docElem.webkitMatchesSelector || 1288 docElem.mozMatchesSelector || 1289 docElem.oMatchesSelector || 1290 docElem.msMatchesSelector) )) ) { 1291 1292 assert(function( div ) { 1293 // Check to see if it's possible to do matchesSelector 1294 // on a disconnected node (IE 9) 1295 support.disconnectedMatch = matches.call( div, "div" ); 1296 1297 // This should fail with an exception 1298 // Gecko does not error, returns false instead 1299 matches.call( div, "[s!='']:x" ); 1300 rbuggyMatches.push( "!=", pseudos ); 1301 }); 1302 } 1303 1304 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 1305 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 1306 1307 /* Contains 1308 ---------------------------------------------------------------------- */ 1309 hasCompare = rnative.test( docElem.compareDocumentPosition ); 1310 1311 // Element contains another 1312 // Purposefully self-exclusive 1313 // As in, an element does not contain itself 1314 contains = hasCompare || rnative.test( docElem.contains ) ? 1315 function( a, b ) { 1316 var adown = a.nodeType === 9 ? a.documentElement : a, 1317 bup = b && b.parentNode; 1318 return a === bup || !!( bup && bup.nodeType === 1 && ( 1319 adown.contains ? 1320 adown.contains( bup ) : 1321 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 1322 )); 1323 } : 1324 function( a, b ) { 1325 if ( b ) { 1326 while ( (b = b.parentNode) ) { 1327 if ( b === a ) { 1328 return true; 1329 } 1330 } 1331 } 1332 return false; 1333 }; 1334 1335 /* Sorting 1336 ---------------------------------------------------------------------- */ 1337 1338 // Document order sorting 1339 sortOrder = hasCompare ? 1340 function( a, b ) { 1341 1342 // Flag for duplicate removal 1343 if ( a === b ) { 1344 hasDuplicate = true; 1345 return 0; 1346 } 1347 1348 // Sort on method existence if only one input has compareDocumentPosition 1349 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1350 if ( compare ) { 1351 return compare; 1352 } 1353 1354 // Calculate position if both inputs belong to the same document 1355 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 1356 a.compareDocumentPosition( b ) : 1357 1358 // Otherwise we know they are disconnected 1359 1; 1360 1361 // Disconnected nodes 1362 if ( compare & 1 || 1363 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 1364 1365 // Choose the first element that is related to our preferred document 1366 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 1367 return -1; 1368 } 1369 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 1370 return 1; 1371 } 1372 1373 // Maintain original order 1374 return sortInput ? 1375 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1376 0; 1377 } 1378 1379 return compare & 4 ? -1 : 1; 1380 } : 1381 function( a, b ) { 1382 // Exit early if the nodes are identical 1383 if ( a === b ) { 1384 hasDuplicate = true; 1385 return 0; 1386 } 1387 1388 var cur, 1389 i = 0, 1390 aup = a.parentNode, 1391 bup = b.parentNode, 1392 ap = [ a ], 1393 bp = [ b ]; 1394 1395 // Parentless nodes are either documents or disconnected 1396 if ( !aup || !bup ) { 1397 return a === document ? -1 : 1398 b === document ? 1 : 1399 aup ? -1 : 1400 bup ? 1 : 1401 sortInput ? 1402 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1403 0; 1404 1405 // If the nodes are siblings, we can do a quick check 1406 } else if ( aup === bup ) { 1407 return siblingCheck( a, b ); 1408 } 1409 1410 // Otherwise we need full lists of their ancestors for comparison 1411 cur = a; 1412 while ( (cur = cur.parentNode) ) { 1413 ap.unshift( cur ); 1414 } 1415 cur = b; 1416 while ( (cur = cur.parentNode) ) { 1417 bp.unshift( cur ); 1418 } 1419 1420 // Walk down the tree looking for a discrepancy 1421 while ( ap[i] === bp[i] ) { 1422 i++; 1423 } 1424 1425 return i ? 1426 // Do a sibling check if the nodes have a common ancestor 1427 siblingCheck( ap[i], bp[i] ) : 1428 1429 // Otherwise nodes in our document sort first 1430 ap[i] === preferredDoc ? -1 : 1431 bp[i] === preferredDoc ? 1 : 1432 0; 1433 }; 1434 1435 return document; 1436}; 1437 1438Sizzle.matches = function( expr, elements ) { 1439 return Sizzle( expr, null, null, elements ); 1440}; 1441 1442Sizzle.matchesSelector = function( elem, expr ) { 1443 // Set document vars if needed 1444 if ( ( elem.ownerDocument || elem ) !== document ) { 1445 setDocument( elem ); 1446 } 1447 1448 // Make sure that attribute selectors are quoted 1449 expr = expr.replace( rattributeQuotes, "='$1']" ); 1450 1451 if ( support.matchesSelector && documentIsHTML && 1452 !compilerCache[ expr + " " ] && 1453 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 1454 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 1455 1456 try { 1457 var ret = matches.call( elem, expr ); 1458 1459 // IE 9's matchesSelector returns false on disconnected nodes 1460 if ( ret || support.disconnectedMatch || 1461 // As well, disconnected nodes are said to be in a document 1462 // fragment in IE 9 1463 elem.document && elem.document.nodeType !== 11 ) { 1464 return ret; 1465 } 1466 } catch (e) {} 1467 } 1468 1469 return Sizzle( expr, document, null, [ elem ] ).length > 0; 1470}; 1471 1472Sizzle.contains = function( context, elem ) { 1473 // Set document vars if needed 1474 if ( ( context.ownerDocument || context ) !== document ) { 1475 setDocument( context ); 1476 } 1477 return contains( context, elem ); 1478}; 1479 1480Sizzle.attr = function( elem, name ) { 1481 // Set document vars if needed 1482 if ( ( elem.ownerDocument || elem ) !== document ) { 1483 setDocument( elem ); 1484 } 1485 1486 var fn = Expr.attrHandle[ name.toLowerCase() ], 1487 // Don't get fooled by Object.prototype properties (jQuery #13807) 1488 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 1489 fn( elem, name, !documentIsHTML ) : 1490 undefined; 1491 1492 return val !== undefined ? 1493 val : 1494 support.attributes || !documentIsHTML ? 1495 elem.getAttribute( name ) : 1496 (val = elem.getAttributeNode(name)) && val.specified ? 1497 val.value : 1498 null; 1499}; 1500 1501Sizzle.error = function( msg ) { 1502 throw new Error( "Syntax error, unrecognized expression: " + msg ); 1503}; 1504 1505/** 1506 * Document sorting and removing duplicates 1507 * @param {ArrayLike} results 1508 */ 1509Sizzle.uniqueSort = function( results ) { 1510 var elem, 1511 duplicates = [], 1512 j = 0, 1513 i = 0; 1514 1515 // Unless we *know* we can detect duplicates, assume their presence 1516 hasDuplicate = !support.detectDuplicates; 1517 sortInput = !support.sortStable && results.slice( 0 ); 1518 results.sort( sortOrder ); 1519 1520 if ( hasDuplicate ) { 1521 while ( (elem = results[i++]) ) { 1522 if ( elem === results[ i ] ) { 1523 j = duplicates.push( i ); 1524 } 1525 } 1526 while ( j-- ) { 1527 results.splice( duplicates[ j ], 1 ); 1528 } 1529 } 1530 1531 // Clear input after sorting to release objects 1532 // See https://github.com/jquery/sizzle/pull/225 1533 sortInput = null; 1534 1535 return results; 1536}; 1537 1538/** 1539 * Utility function for retrieving the text value of an array of DOM nodes 1540 * @param {Array|Element} elem 1541 */ 1542getText = Sizzle.getText = function( elem ) { 1543 var node, 1544 ret = "", 1545 i = 0, 1546 nodeType = elem.nodeType; 1547 1548 if ( !nodeType ) { 1549 // If no nodeType, this is expected to be an array 1550 while ( (node = elem[i++]) ) { 1551 // Do not traverse comment nodes 1552 ret += getText( node ); 1553 } 1554 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 1555 // Use textContent for elements 1556 // innerText usage removed for consistency of new lines (jQuery #11153) 1557 if ( typeof elem.textContent === "string" ) { 1558 return elem.textContent; 1559 } else { 1560 // Traverse its children 1561 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1562 ret += getText( elem ); 1563 } 1564 } 1565 } else if ( nodeType === 3 || nodeType === 4 ) { 1566 return elem.nodeValue; 1567 } 1568 // Do not include comment or processing instruction nodes 1569 1570 return ret; 1571}; 1572 1573Expr = Sizzle.selectors = { 1574 1575 // Can be adjusted by the user 1576 cacheLength: 50, 1577 1578 createPseudo: markFunction, 1579 1580 match: matchExpr, 1581 1582 attrHandle: {}, 1583 1584 find: {}, 1585 1586 relative: { 1587 ">": { dir: "parentNode", first: true }, 1588 " ": { dir: "parentNode" }, 1589 "+": { dir: "previousSibling", first: true }, 1590 "~": { dir: "previousSibling" } 1591 }, 1592 1593 preFilter: { 1594 "ATTR": function( match ) { 1595 match[1] = match[1].replace( runescape, funescape ); 1596 1597 // Move the given value to match[3] whether quoted or unquoted 1598 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 1599 1600 if ( match[2] === "~=" ) { 1601 match[3] = " " + match[3] + " "; 1602 } 1603 1604 return match.slice( 0, 4 ); 1605 }, 1606 1607 "CHILD": function( match ) { 1608 /* matches from matchExpr["CHILD"] 1609 1 type (only|nth|...) 1610 2 what (child|of-type) 1611 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1612 4 xn-component of xn+y argument ([+-]?\d*n|) 1613 5 sign of xn-component 1614 6 x of xn-component 1615 7 sign of y-component 1616 8 y of y-component 1617 */ 1618 match[1] = match[1].toLowerCase(); 1619 1620 if ( match[1].slice( 0, 3 ) === "nth" ) { 1621 // nth-* requires argument 1622 if ( !match[3] ) { 1623 Sizzle.error( match[0] ); 1624 } 1625 1626 // numeric x and y parameters for Expr.filter.CHILD 1627 // remember that false/true cast respectively to 0/1 1628 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 1629 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 1630 1631 // other types prohibit arguments 1632 } else if ( match[3] ) { 1633 Sizzle.error( match[0] ); 1634 } 1635 1636 return match; 1637 }, 1638 1639 "PSEUDO": function( match ) { 1640 var excess, 1641 unquoted = !match[6] && match[2]; 1642 1643 if ( matchExpr["CHILD"].test( match[0] ) ) { 1644 return null; 1645 } 1646 1647 // Accept quoted arguments as-is 1648 if ( match[3] ) { 1649 match[2] = match[4] || match[5] || ""; 1650 1651 // Strip excess characters from unquoted arguments 1652 } else if ( unquoted && rpseudo.test( unquoted ) && 1653 // Get excess from tokenize (recursively) 1654 (excess = tokenize( unquoted, true )) && 1655 // advance to the next closing parenthesis 1656 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 1657 1658 // excess is a negative index 1659 match[0] = match[0].slice( 0, excess ); 1660 match[2] = unquoted.slice( 0, excess ); 1661 } 1662 1663 // Return only captures needed by the pseudo filter method (type and argument) 1664 return match.slice( 0, 3 ); 1665 } 1666 }, 1667 1668 filter: { 1669 1670 "TAG": function( nodeNameSelector ) { 1671 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 1672 return nodeNameSelector === "*" ? 1673 function() { return true; } : 1674 function( elem ) { 1675 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 1676 }; 1677 }, 1678 1679 "CLASS": function( className ) { 1680 var pattern = classCache[ className + " " ]; 1681 1682 return pattern || 1683 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 1684 classCache( className, function( elem ) { 1685 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 1686 }); 1687 }, 1688 1689 "ATTR": function( name, operator, check ) { 1690 return function( elem ) { 1691 var result = Sizzle.attr( elem, name ); 1692 1693 if ( result == null ) { 1694 return operator === "!="; 1695 } 1696 if ( !operator ) { 1697 return true; 1698 } 1699 1700 result += ""; 1701 1702 return operator === "=" ? result === check : 1703 operator === "!=" ? result !== check : 1704 operator === "^=" ? check && result.indexOf( check ) === 0 : 1705 operator === "*=" ? check && result.indexOf( check ) > -1 : 1706 operator === "$=" ? check && result.slice( -check.length ) === check : 1707 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 1708 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 1709 false; 1710 }; 1711 }, 1712 1713 "CHILD": function( type, what, argument, first, last ) { 1714 var simple = type.slice( 0, 3 ) !== "nth", 1715 forward = type.slice( -4 ) !== "last", 1716 ofType = what === "of-type"; 1717 1718 return first === 1 && last === 0 ? 1719 1720 // Shortcut for :nth-*(n) 1721 function( elem ) { 1722 return !!elem.parentNode; 1723 } : 1724 1725 function( elem, context, xml ) { 1726 var cache, uniqueCache, outerCache, node, nodeIndex, start, 1727 dir = simple !== forward ? "nextSibling" : "previousSibling", 1728 parent = elem.parentNode, 1729 name = ofType && elem.nodeName.toLowerCase(), 1730 useCache = !xml && !ofType, 1731 diff = false; 1732 1733 if ( parent ) { 1734 1735 // :(first|last|only)-(child|of-type) 1736 if ( simple ) { 1737 while ( dir ) { 1738 node = elem; 1739 while ( (node = node[ dir ]) ) { 1740 if ( ofType ? 1741 node.nodeName.toLowerCase() === name : 1742 node.nodeType === 1 ) { 1743 1744 return false; 1745 } 1746 } 1747 // Reverse direction for :only-* (if we haven't yet done so) 1748 start = dir = type === "only" && !start && "nextSibling"; 1749 } 1750 return true; 1751 } 1752 1753 start = [ forward ? parent.firstChild : parent.lastChild ]; 1754 1755 // non-xml :nth-child(...) stores cache data on `parent` 1756 if ( forward && useCache ) { 1757 1758 // Seek `elem` from a previously-cached index 1759 1760 // ...in a gzip-friendly way 1761 node = parent; 1762 outerCache = node[ expando ] || (node[ expando ] = {}); 1763 1764 // Support: IE <9 only 1765 // Defend against cloned attroperties (jQuery gh-1709) 1766 uniqueCache = outerCache[ node.uniqueID ] || 1767 (outerCache[ node.uniqueID ] = {}); 1768 1769 cache = uniqueCache[ type ] || []; 1770 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1771 diff = nodeIndex && cache[ 2 ]; 1772 node = nodeIndex && parent.childNodes[ nodeIndex ]; 1773 1774 while ( (node = ++nodeIndex && node && node[ dir ] || 1775 1776 // Fallback to seeking `elem` from the start 1777 (diff = nodeIndex = 0) || start.pop()) ) { 1778 1779 // When found, cache indexes on `parent` and break 1780 if ( node.nodeType === 1 && ++diff && node === elem ) { 1781 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 1782 break; 1783 } 1784 } 1785 1786 } else { 1787 // Use previously-cached element index if available 1788 if ( useCache ) { 1789 // ...in a gzip-friendly way 1790 node = elem; 1791 outerCache = node[ expando ] || (node[ expando ] = {}); 1792 1793 // Support: IE <9 only 1794 // Defend against cloned attroperties (jQuery gh-1709) 1795 uniqueCache = outerCache[ node.uniqueID ] || 1796 (outerCache[ node.uniqueID ] = {}); 1797 1798 cache = uniqueCache[ type ] || []; 1799 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1800 diff = nodeIndex; 1801 } 1802 1803 // xml :nth-child(...) 1804 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 1805 if ( diff === false ) { 1806 // Use the same loop as above to seek `elem` from the start 1807 while ( (node = ++nodeIndex && node && node[ dir ] || 1808 (diff = nodeIndex = 0) || start.pop()) ) { 1809 1810 if ( ( ofType ? 1811 node.nodeName.toLowerCase() === name : 1812 node.nodeType === 1 ) && 1813 ++diff ) { 1814 1815 // Cache the index of each encountered element 1816 if ( useCache ) { 1817 outerCache = node[ expando ] || (node[ expando ] = {}); 1818 1819 // Support: IE <9 only 1820 // Defend against cloned attroperties (jQuery gh-1709) 1821 uniqueCache = outerCache[ node.uniqueID ] || 1822 (outerCache[ node.uniqueID ] = {}); 1823 1824 uniqueCache[ type ] = [ dirruns, diff ]; 1825 } 1826 1827 if ( node === elem ) { 1828 break; 1829 } 1830 } 1831 } 1832 } 1833 } 1834 1835 // Incorporate the offset, then check against cycle size 1836 diff -= last; 1837 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 1838 } 1839 }; 1840 }, 1841 1842 "PSEUDO": function( pseudo, argument ) { 1843 // pseudo-class names are case-insensitive 1844 // http://www.w3.org/TR/selectors/#pseudo-classes 1845 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 1846 // Remember that setFilters inherits from pseudos 1847 var args, 1848 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 1849 Sizzle.error( "unsupported pseudo: " + pseudo ); 1850 1851 // The user may use createPseudo to indicate that 1852 // arguments are needed to create the filter function 1853 // just as Sizzle does 1854 if ( fn[ expando ] ) { 1855 return fn( argument ); 1856 } 1857 1858 // But maintain support for old signatures 1859 if ( fn.length > 1 ) { 1860 args = [ pseudo, pseudo, "", argument ]; 1861 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 1862 markFunction(function( seed, matches ) { 1863 var idx, 1864 matched = fn( seed, argument ), 1865 i = matched.length; 1866 while ( i-- ) { 1867 idx = indexOf( seed, matched[i] ); 1868 seed[ idx ] = !( matches[ idx ] = matched[i] ); 1869 } 1870 }) : 1871 function( elem ) { 1872 return fn( elem, 0, args ); 1873 }; 1874 } 1875 1876 return fn; 1877 } 1878 }, 1879 1880 pseudos: { 1881 // Potentially complex pseudos 1882 "not": markFunction(function( selector ) { 1883 // Trim the selector passed to compile 1884 // to avoid treating leading and trailing 1885 // spaces as combinators 1886 var input = [], 1887 results = [], 1888 matcher = compile( selector.replace( rtrim, "$1" ) ); 1889 1890 return matcher[ expando ] ? 1891 markFunction(function( seed, matches, context, xml ) { 1892 var elem, 1893 unmatched = matcher( seed, null, xml, [] ), 1894 i = seed.length; 1895 1896 // Match elements unmatched by `matcher` 1897 while ( i-- ) { 1898 if ( (elem = unmatched[i]) ) { 1899 seed[i] = !(matches[i] = elem); 1900 } 1901 } 1902 }) : 1903 function( elem, context, xml ) { 1904 input[0] = elem; 1905 matcher( input, null, xml, results ); 1906 // Don't keep the element (issue #299) 1907 input[0] = null; 1908 return !results.pop(); 1909 }; 1910 }), 1911 1912 "has": markFunction(function( selector ) { 1913 return function( elem ) { 1914 return Sizzle( selector, elem ).length > 0; 1915 }; 1916 }), 1917 1918 "contains": markFunction(function( text ) { 1919 text = text.replace( runescape, funescape ); 1920 return function( elem ) { 1921 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 1922 }; 1923 }), 1924 1925 // "Whether an element is represented by a :lang() selector 1926 // is based solely on the element's language value 1927 // being equal to the identifier C, 1928 // or beginning with the identifier C immediately followed by "-". 1929 // The matching of C against the element's language value is performed case-insensitively. 1930 // The identifier C does not have to be a valid language name." 1931 // http://www.w3.org/TR/selectors/#lang-pseudo 1932 "lang": markFunction( function( lang ) { 1933 // lang value must be a valid identifier 1934 if ( !ridentifier.test(lang || "") ) { 1935 Sizzle.error( "unsupported lang: " + lang ); 1936 } 1937 lang = lang.replace( runescape, funescape ).toLowerCase(); 1938 return function( elem ) { 1939 var elemLang; 1940 do { 1941 if ( (elemLang = documentIsHTML ? 1942 elem.lang : 1943 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 1944 1945 elemLang = elemLang.toLowerCase(); 1946 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 1947 } 1948 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 1949 return false; 1950 }; 1951 }), 1952 1953 // Miscellaneous 1954 "target": function( elem ) { 1955 var hash = window.location && window.location.hash; 1956 return hash && hash.slice( 1 ) === elem.id; 1957 }, 1958 1959 "root": function( elem ) { 1960 return elem === docElem; 1961 }, 1962 1963 "focus": function( elem ) { 1964 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 1965 }, 1966 1967 // Boolean properties 1968 "enabled": function( elem ) { 1969 return elem.disabled === false; 1970 }, 1971 1972 "disabled": function( elem ) { 1973 return elem.disabled === true; 1974 }, 1975 1976 "checked": function( elem ) { 1977 // In CSS3, :checked should return both checked and selected elements 1978 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1979 var nodeName = elem.nodeName.toLowerCase(); 1980 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 1981 }, 1982 1983 "selected": function( elem ) { 1984 // Accessing this property makes selected-by-default 1985 // options in Safari work properly 1986 if ( elem.parentNode ) { 1987 elem.parentNode.selectedIndex; 1988 } 1989 1990 return elem.selected === true; 1991 }, 1992 1993 // Contents 1994 "empty": function( elem ) { 1995 // http://www.w3.org/TR/selectors/#empty-pseudo 1996 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 1997 // but not by others (comment: 8; processing instruction: 7; etc.) 1998 // nodeType < 6 works because attributes (2) do not appear as children 1999 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 2000 if ( elem.nodeType < 6 ) { 2001 return false; 2002 } 2003 } 2004 return true; 2005 }, 2006 2007 "parent": function( elem ) { 2008 return !Expr.pseudos["empty"]( elem ); 2009 }, 2010 2011 // Element/input types 2012 "header": function( elem ) { 2013 return rheader.test( elem.nodeName ); 2014 }, 2015 2016 "input": function( elem ) { 2017 return rinputs.test( elem.nodeName ); 2018 }, 2019 2020 "button": function( elem ) { 2021 var name = elem.nodeName.toLowerCase(); 2022 return name === "input" && elem.type === "button" || name === "button"; 2023 }, 2024 2025 "text": function( elem ) { 2026 var attr; 2027 return elem.nodeName.toLowerCase() === "input" && 2028 elem.type === "text" && 2029 2030 // Support: IE<8 2031 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 2032 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 2033 }, 2034 2035 // Position-in-collection 2036 "first": createPositionalPseudo(function() { 2037 return [ 0 ]; 2038 }), 2039 2040 "last": createPositionalPseudo(function( matchIndexes, length ) { 2041 return [ length - 1 ]; 2042 }), 2043 2044 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 2045 return [ argument < 0 ? argument + length : argument ]; 2046 }), 2047 2048 "even": createPositionalPseudo(function( matchIndexes, length ) { 2049 var i = 0; 2050 for ( ; i < length; i += 2 ) { 2051 matchIndexes.push( i ); 2052 } 2053 return matchIndexes; 2054 }), 2055 2056 "odd": createPositionalPseudo(function( matchIndexes, length ) { 2057 var i = 1; 2058 for ( ; i < length; i += 2 ) { 2059 matchIndexes.push( i ); 2060 } 2061 return matchIndexes; 2062 }), 2063 2064 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2065 var i = argument < 0 ? argument + length : argument; 2066 for ( ; --i >= 0; ) { 2067 matchIndexes.push( i ); 2068 } 2069 return matchIndexes; 2070 }), 2071 2072 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2073 var i = argument < 0 ? argument + length : argument; 2074 for ( ; ++i < length; ) { 2075 matchIndexes.push( i ); 2076 } 2077 return matchIndexes; 2078 }) 2079 } 2080}; 2081 2082Expr.pseudos["nth"] = Expr.pseudos["eq"]; 2083 2084// Add button/input type pseudos 2085for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 2086 Expr.pseudos[ i ] = createInputPseudo( i ); 2087} 2088for ( i in { submit: true, reset: true } ) { 2089 Expr.pseudos[ i ] = createButtonPseudo( i ); 2090} 2091 2092// Easy API for creating new setFilters 2093function setFilters() {} 2094setFilters.prototype = Expr.filters = Expr.pseudos; 2095Expr.setFilters = new setFilters(); 2096 2097tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 2098 var matched, match, tokens, type, 2099 soFar, groups, preFilters, 2100 cached = tokenCache[ selector + " " ]; 2101 2102 if ( cached ) { 2103 return parseOnly ? 0 : cached.slice( 0 ); 2104 } 2105 2106 soFar = selector; 2107 groups = []; 2108 preFilters = Expr.preFilter; 2109 2110 while ( soFar ) { 2111 2112 // Comma and first run 2113 if ( !matched || (match = rcomma.exec( soFar )) ) { 2114 if ( match ) { 2115 // Don't consume trailing commas as valid 2116 soFar = soFar.slice( match[0].length ) || soFar; 2117 } 2118 groups.push( (tokens = []) ); 2119 } 2120 2121 matched = false; 2122 2123 // Combinators 2124 if ( (match = rcombinators.exec( soFar )) ) { 2125 matched = match.shift(); 2126 tokens.push({ 2127 value: matched, 2128 // Cast descendant combinators to space 2129 type: match[0].replace( rtrim, " " ) 2130 }); 2131 soFar = soFar.slice( matched.length ); 2132 } 2133 2134 // Filters 2135 for ( type in Expr.filter ) { 2136 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 2137 (match = preFilters[ type ]( match ))) ) { 2138 matched = match.shift(); 2139 tokens.push({ 2140 value: matched, 2141 type: type, 2142 matches: match 2143 }); 2144 soFar = soFar.slice( matched.length ); 2145 } 2146 } 2147 2148 if ( !matched ) { 2149 break; 2150 } 2151 } 2152 2153 // Return the length of the invalid excess 2154 // if we're just parsing 2155 // Otherwise, throw an error or return tokens 2156 return parseOnly ? 2157 soFar.length : 2158 soFar ? 2159 Sizzle.error( selector ) : 2160 // Cache the tokens 2161 tokenCache( selector, groups ).slice( 0 ); 2162}; 2163 2164function toSelector( tokens ) { 2165 var i = 0, 2166 len = tokens.length, 2167 selector = ""; 2168 for ( ; i < len; i++ ) { 2169 selector += tokens[i].value; 2170 } 2171 return selector; 2172} 2173 2174function addCombinator( matcher, combinator, base ) { 2175 var dir = combinator.dir, 2176 checkNonElements = base && dir === "parentNode", 2177 doneName = done++; 2178 2179 return combinator.first ? 2180 // Check against closest ancestor/preceding element 2181 function( elem, context, xml ) { 2182 while ( (elem = elem[ dir ]) ) { 2183 if ( elem.nodeType === 1 || checkNonElements ) { 2184 return matcher( elem, context, xml ); 2185 } 2186 } 2187 } : 2188 2189 // Check against all ancestor/preceding elements 2190 function( elem, context, xml ) { 2191 var oldCache, uniqueCache, outerCache, 2192 newCache = [ dirruns, doneName ]; 2193 2194 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 2195 if ( xml ) { 2196 while ( (elem = elem[ dir ]) ) { 2197 if ( elem.nodeType === 1 || checkNonElements ) { 2198 if ( matcher( elem, context, xml ) ) { 2199 return true; 2200 } 2201 } 2202 } 2203 } else { 2204 while ( (elem = elem[ dir ]) ) { 2205 if ( elem.nodeType === 1 || checkNonElements ) { 2206 outerCache = elem[ expando ] || (elem[ expando ] = {}); 2207 2208 // Support: IE <9 only 2209 // Defend against cloned attroperties (jQuery gh-1709) 2210 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); 2211 2212 if ( (oldCache = uniqueCache[ dir ]) && 2213 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 2214 2215 // Assign to newCache so results back-propagate to previous elements 2216 return (newCache[ 2 ] = oldCache[ 2 ]); 2217 } else { 2218 // Reuse newcache so results back-propagate to previous elements 2219 uniqueCache[ dir ] = newCache; 2220 2221 // A match means we're done; a fail means we have to keep checking 2222 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 2223 return true; 2224 } 2225 } 2226 } 2227 } 2228 } 2229 }; 2230} 2231 2232function elementMatcher( matchers ) { 2233 return matchers.length > 1 ? 2234 function( elem, context, xml ) { 2235 var i = matchers.length; 2236 while ( i-- ) { 2237 if ( !matchers[i]( elem, context, xml ) ) { 2238 return false; 2239 } 2240 } 2241 return true; 2242 } : 2243 matchers[0]; 2244} 2245 2246function multipleContexts( selector, contexts, results ) { 2247 var i = 0, 2248 len = contexts.length; 2249 for ( ; i < len; i++ ) { 2250 Sizzle( selector, contexts[i], results ); 2251 } 2252 return results; 2253} 2254 2255function condense( unmatched, map, filter, context, xml ) { 2256 var elem, 2257 newUnmatched = [], 2258 i = 0, 2259 len = unmatched.length, 2260 mapped = map != null; 2261 2262 for ( ; i < len; i++ ) { 2263 if ( (elem = unmatched[i]) ) { 2264 if ( !filter || filter( elem, context, xml ) ) { 2265 newUnmatched.push( elem ); 2266 if ( mapped ) { 2267 map.push( i ); 2268 } 2269 } 2270 } 2271 } 2272 2273 return newUnmatched; 2274} 2275 2276function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 2277 if ( postFilter && !postFilter[ expando ] ) { 2278 postFilter = setMatcher( postFilter ); 2279 } 2280 if ( postFinder && !postFinder[ expando ] ) { 2281 postFinder = setMatcher( postFinder, postSelector ); 2282 } 2283 return markFunction(function( seed, results, context, xml ) { 2284 var temp, i, elem, 2285 preMap = [], 2286 postMap = [], 2287 preexisting = results.length, 2288 2289 // Get initial elements from seed or context 2290 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 2291 2292 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2293 matcherIn = preFilter && ( seed || !selector ) ? 2294 condense( elems, preMap, preFilter, context, xml ) : 2295 elems, 2296 2297 matcherOut = matcher ? 2298 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 2299 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 2300 2301 // ...intermediate processing is necessary 2302 [] : 2303 2304 // ...otherwise use results directly 2305 results : 2306 matcherIn; 2307 2308 // Find primary matches 2309 if ( matcher ) { 2310 matcher( matcherIn, matcherOut, context, xml ); 2311 } 2312 2313 // Apply postFilter 2314 if ( postFilter ) { 2315 temp = condense( matcherOut, postMap ); 2316 postFilter( temp, [], context, xml ); 2317 2318 // Un-match failing elements by moving them back to matcherIn 2319 i = temp.length; 2320 while ( i-- ) { 2321 if ( (elem = temp[i]) ) { 2322 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 2323 } 2324 } 2325 } 2326 2327 if ( seed ) { 2328 if ( postFinder || preFilter ) { 2329 if ( postFinder ) { 2330 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2331 temp = []; 2332 i = matcherOut.length; 2333 while ( i-- ) { 2334 if ( (elem = matcherOut[i]) ) { 2335 // Restore matcherIn since elem is not yet a final match 2336 temp.push( (matcherIn[i] = elem) ); 2337 } 2338 } 2339 postFinder( null, (matcherOut = []), temp, xml ); 2340 } 2341 2342 // Move matched elements from seed to results to keep them synchronized 2343 i = matcherOut.length; 2344 while ( i-- ) { 2345 if ( (elem = matcherOut[i]) && 2346 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 2347 2348 seed[temp] = !(results[temp] = elem); 2349 } 2350 } 2351 } 2352 2353 // Add elements to results, through postFinder if defined 2354 } else { 2355 matcherOut = condense( 2356 matcherOut === results ? 2357 matcherOut.splice( preexisting, matcherOut.length ) : 2358 matcherOut 2359 ); 2360 if ( postFinder ) { 2361 postFinder( null, results, matcherOut, xml ); 2362 } else { 2363 push.apply( results, matcherOut ); 2364 } 2365 } 2366 }); 2367} 2368 2369function matcherFromTokens( tokens ) { 2370 var checkContext, matcher, j, 2371 len = tokens.length, 2372 leadingRelative = Expr.relative[ tokens[0].type ], 2373 implicitRelative = leadingRelative || Expr.relative[" "], 2374 i = leadingRelative ? 1 : 0, 2375 2376 // The foundational matcher ensures that elements are reachable from top-level context(s) 2377 matchContext = addCombinator( function( elem ) { 2378 return elem === checkContext; 2379 }, implicitRelative, true ), 2380 matchAnyContext = addCombinator( function( elem ) { 2381 return indexOf( checkContext, elem ) > -1; 2382 }, implicitRelative, true ), 2383 matchers = [ function( elem, context, xml ) { 2384 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 2385 (checkContext = context).nodeType ? 2386 matchContext( elem, context, xml ) : 2387 matchAnyContext( elem, context, xml ) ); 2388 // Avoid hanging onto element (issue #299) 2389 checkContext = null; 2390 return ret; 2391 } ]; 2392 2393 for ( ; i < len; i++ ) { 2394 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 2395 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 2396 } else { 2397 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 2398 2399 // Return special upon seeing a positional matcher 2400 if ( matcher[ expando ] ) { 2401 // Find the next relative operator (if any) for proper handling 2402 j = ++i; 2403 for ( ; j < len; j++ ) { 2404 if ( Expr.relative[ tokens[j].type ] ) { 2405 break; 2406 } 2407 } 2408 return setMatcher( 2409 i > 1 && elementMatcher( matchers ), 2410 i > 1 && toSelector( 2411 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2412 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 2413 ).replace( rtrim, "$1" ), 2414 matcher, 2415 i < j && matcherFromTokens( tokens.slice( i, j ) ), 2416 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 2417 j < len && toSelector( tokens ) 2418 ); 2419 } 2420 matchers.push( matcher ); 2421 } 2422 } 2423 2424 return elementMatcher( matchers ); 2425} 2426 2427function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 2428 var bySet = setMatchers.length > 0, 2429 byElement = elementMatchers.length > 0, 2430 superMatcher = function( seed, context, xml, results, outermost ) { 2431 var elem, j, matcher, 2432 matchedCount = 0, 2433 i = "0", 2434 unmatched = seed && [], 2435 setMatched = [], 2436 contextBackup = outermostContext, 2437 // We must always have either seed elements or outermost context 2438 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 2439 // Use integer dirruns iff this is the outermost matcher 2440 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 2441 len = elems.length; 2442 2443 if ( outermost ) { 2444 outermostContext = context === document || context || outermost; 2445 } 2446 2447 // Add elements passing elementMatchers directly to results 2448 // Support: IE<9, Safari 2449 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 2450 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 2451 if ( byElement && elem ) { 2452 j = 0; 2453 if ( !context && elem.ownerDocument !== document ) { 2454 setDocument( elem ); 2455 xml = !documentIsHTML; 2456 } 2457 while ( (matcher = elementMatchers[j++]) ) { 2458 if ( matcher( elem, context || document, xml) ) { 2459 results.push( elem ); 2460 break; 2461 } 2462 } 2463 if ( outermost ) { 2464 dirruns = dirrunsUnique; 2465 } 2466 } 2467 2468 // Track unmatched elements for set filters 2469 if ( bySet ) { 2470 // They will have gone through all possible matchers 2471 if ( (elem = !matcher && elem) ) { 2472 matchedCount--; 2473 } 2474 2475 // Lengthen the array for every element, matched or not 2476 if ( seed ) { 2477 unmatched.push( elem ); 2478 } 2479 } 2480 } 2481 2482 // `i` is now the count of elements visited above, and adding it to `matchedCount` 2483 // makes the latter nonnegative. 2484 matchedCount += i; 2485 2486 // Apply set filters to unmatched elements 2487 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 2488 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 2489 // no element matchers and no seed. 2490 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 2491 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 2492 // numerically zero. 2493 if ( bySet && i !== matchedCount ) { 2494 j = 0; 2495 while ( (matcher = setMatchers[j++]) ) { 2496 matcher( unmatched, setMatched, context, xml ); 2497 } 2498 2499 if ( seed ) { 2500 // Reintegrate element matches to eliminate the need for sorting 2501 if ( matchedCount > 0 ) { 2502 while ( i-- ) { 2503 if ( !(unmatched[i] || setMatched[i]) ) { 2504 setMatched[i] = pop.call( results ); 2505 } 2506 } 2507 } 2508 2509 // Discard index placeholder values to get only actual matches 2510 setMatched = condense( setMatched ); 2511 } 2512 2513 // Add matches to results 2514 push.apply( results, setMatched ); 2515 2516 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2517 if ( outermost && !seed && setMatched.length > 0 && 2518 ( matchedCount + setMatchers.length ) > 1 ) { 2519 2520 Sizzle.uniqueSort( results ); 2521 } 2522 } 2523 2524 // Override manipulation of globals by nested matchers 2525 if ( outermost ) { 2526 dirruns = dirrunsUnique; 2527 outermostContext = contextBackup; 2528 } 2529 2530 return unmatched; 2531 }; 2532 2533 return bySet ? 2534 markFunction( superMatcher ) : 2535 superMatcher; 2536} 2537 2538compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 2539 var i, 2540 setMatchers = [], 2541 elementMatchers = [], 2542 cached = compilerCache[ selector + " " ]; 2543 2544 if ( !cached ) { 2545 // Generate a function of recursive functions that can be used to check each element 2546 if ( !match ) { 2547 match = tokenize( selector ); 2548 } 2549 i = match.length; 2550 while ( i-- ) { 2551 cached = matcherFromTokens( match[i] ); 2552 if ( cached[ expando ] ) { 2553 setMatchers.push( cached ); 2554 } else { 2555 elementMatchers.push( cached ); 2556 } 2557 } 2558 2559 // Cache the compiled function 2560 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 2561 2562 // Save selector and tokenization 2563 cached.selector = selector; 2564 } 2565 return cached; 2566}; 2567 2568/** 2569 * A low-level selection function that works with Sizzle's compiled 2570 * selector functions 2571 * @param {String|Function} selector A selector or a pre-compiled 2572 * selector function built with Sizzle.compile 2573 * @param {Element} context 2574 * @param {Array} [results] 2575 * @param {Array} [seed] A set of elements to match against 2576 */ 2577select = Sizzle.select = function( selector, context, results, seed ) { 2578 var i, tokens, token, type, find, 2579 compiled = typeof selector === "function" && selector, 2580 match = !seed && tokenize( (selector = compiled.selector || selector) ); 2581 2582 results = results || []; 2583 2584 // Try to minimize operations if there is only one selector in the list and no seed 2585 // (the latter of which guarantees us context) 2586 if ( match.length === 1 ) { 2587 2588 // Reduce context if the leading compound selector is an ID 2589 tokens = match[0] = match[0].slice( 0 ); 2590 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 2591 support.getById && context.nodeType === 9 && documentIsHTML && 2592 Expr.relative[ tokens[1].type ] ) { 2593 2594 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 2595 if ( !context ) { 2596 return results; 2597 2598 // Precompiled matchers will still verify ancestry, so step up a level 2599 } else if ( compiled ) { 2600 context = context.parentNode; 2601 } 2602 2603 selector = selector.slice( tokens.shift().value.length ); 2604 } 2605 2606 // Fetch a seed set for right-to-left matching 2607 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 2608 while ( i-- ) { 2609 token = tokens[i]; 2610 2611 // Abort if we hit a combinator 2612 if ( Expr.relative[ (type = token.type) ] ) { 2613 break; 2614 } 2615 if ( (find = Expr.find[ type ]) ) { 2616 // Search, expanding context for leading sibling combinators 2617 if ( (seed = find( 2618 token.matches[0].replace( runescape, funescape ), 2619 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 2620 )) ) { 2621 2622 // If seed is empty or no tokens remain, we can return early 2623 tokens.splice( i, 1 ); 2624 selector = seed.length && toSelector( tokens ); 2625 if ( !selector ) { 2626 push.apply( results, seed ); 2627 return results; 2628 } 2629 2630 break; 2631 } 2632 } 2633 } 2634 } 2635 2636 // Compile and execute a filtering function if one is not provided 2637 // Provide `match` to avoid retokenization if we modified the selector above 2638 ( compiled || compile( selector, match ) )( 2639 seed, 2640 context, 2641 !documentIsHTML, 2642 results, 2643 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 2644 ); 2645 return results; 2646}; 2647 2648// One-time assignments 2649 2650// Sort stability 2651support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 2652 2653// Support: Chrome 14-35+ 2654// Always assume duplicates if they aren't passed to the comparison function 2655support.detectDuplicates = !!hasDuplicate; 2656 2657// Initialize against the default document 2658setDocument(); 2659 2660// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 2661// Detached nodes confoundingly follow *each other* 2662support.sortDetached = assert(function( div1 ) { 2663 // Should return 1, but returns 4 (following) 2664 return div1.compareDocumentPosition( document.createElement("div") ) & 1; 2665}); 2666 2667// Support: IE<8 2668// Prevent attribute/property "interpolation" 2669// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 2670if ( !assert(function( div ) { 2671 div.innerHTML = "<a href='#'></a>"; 2672 return div.firstChild.getAttribute("href") === "#" ; 2673}) ) { 2674 addHandle( "type|href|height|width", function( elem, name, isXML ) { 2675 if ( !isXML ) { 2676 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 2677 } 2678 }); 2679} 2680 2681// Support: IE<9 2682// Use defaultValue in place of getAttribute("value") 2683if ( !support.attributes || !assert(function( div ) { 2684 div.innerHTML = "<input/>"; 2685 div.firstChild.setAttribute( "value", "" ); 2686 return div.firstChild.getAttribute( "value" ) === ""; 2687}) ) { 2688 addHandle( "value", function( elem, name, isXML ) { 2689 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 2690 return elem.defaultValue; 2691 } 2692 }); 2693} 2694 2695// Support: IE<9 2696// Use getAttributeNode to fetch booleans when getAttribute lies 2697if ( !assert(function( div ) { 2698 return div.getAttribute("disabled") == null; 2699}) ) { 2700 addHandle( booleans, function( elem, name, isXML ) { 2701 var val; 2702 if ( !isXML ) { 2703 return elem[ name ] === true ? name.toLowerCase() : 2704 (val = elem.getAttributeNode( name )) && val.specified ? 2705 val.value : 2706 null; 2707 } 2708 }); 2709} 2710 2711return Sizzle; 2712 2713})( window ); 2714 2715 2716 2717jQuery.find = Sizzle; 2718jQuery.expr = Sizzle.selectors; 2719jQuery.expr[ ":" ] = jQuery.expr.pseudos; 2720jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 2721jQuery.text = Sizzle.getText; 2722jQuery.isXMLDoc = Sizzle.isXML; 2723jQuery.contains = Sizzle.contains; 2724 2725 2726 2727var dir = function( elem, dir, until ) { 2728 var matched = [], 2729 truncate = until !== undefined; 2730 2731 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 2732 if ( elem.nodeType === 1 ) { 2733 if ( truncate && jQuery( elem ).is( until ) ) { 2734 break; 2735 } 2736 matched.push( elem ); 2737 } 2738 } 2739 return matched; 2740}; 2741 2742 2743var siblings = function( n, elem ) { 2744 var matched = []; 2745 2746 for ( ; n; n = n.nextSibling ) { 2747 if ( n.nodeType === 1 && n !== elem ) { 2748 matched.push( n ); 2749 } 2750 } 2751 2752 return matched; 2753}; 2754 2755 2756var rneedsContext = jQuery.expr.match.needsContext; 2757 2758var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); 2759 2760 2761 2762var risSimple = /^.[^:#\[\.,]*$/; 2763 2764// Implement the identical functionality for filter and not 2765function winnow( elements, qualifier, not ) { 2766 if ( jQuery.isFunction( qualifier ) ) { 2767 return jQuery.grep( elements, function( elem, i ) { 2768 /* jshint -W018 */ 2769 return !!qualifier.call( elem, i, elem ) !== not; 2770 } ); 2771 2772 } 2773 2774 if ( qualifier.nodeType ) { 2775 return jQuery.grep( elements, function( elem ) { 2776 return ( elem === qualifier ) !== not; 2777 } ); 2778 2779 } 2780 2781 if ( typeof qualifier === "string" ) { 2782 if ( risSimple.test( qualifier ) ) { 2783 return jQuery.filter( qualifier, elements, not ); 2784 } 2785 2786 qualifier = jQuery.filter( qualifier, elements ); 2787 } 2788 2789 return jQuery.grep( elements, function( elem ) { 2790 return (
2790jQuery.inArray( elem, qualifier ) > -1 ) !== not; 2791 } ); 2792} 2793 2794jQuery.filter = function( expr, elems, not ) { 2795 var elem = elems[ 0 ]; 2796 2797 if ( not ) { 2798 expr = ":not(" + expr + ")"; 2799 } 2800 2801 return elems.length === 1 && elem.nodeType === 1 ? 2802 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : 2803 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 2804 return elem.nodeType === 1; 2805 } ) ); 2806}; 2807 2808jQuery.fn.extend( { 2809 find: function( selector ) { 2810 var i, 2811 ret = [], 2812 self = this, 2813 len = self.length; 2814 2815 if ( typeof selector !== "string" ) {
vendor: 5,394 bytes, lines 2816-3018
2816 return this.pushStack( jQuery( selector ).filter( function() { 2817 for ( i = 0; i < len; i++ ) { 2818 if ( jQuery.contains( self[ i ], this ) ) { 2819 return true; 2820 } 2821 } 2822 } ) ); 2823 } 2824 2825 for ( i = 0; i < len; i++ ) { 2826 jQuery.find( selector, self[ i ], ret ); 2827 } 2828 2829 // Needed because $( selector, context ) becomes $( context ).find( selector ) 2830 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); 2831 ret.selector = this.selector ? this.selector + " " + selector : selector; 2832 return ret; 2833 }, 2834 filter: function( selector ) { 2835 return this.pushStack( winnow( this, selector || [], false ) ); 2836 }, 2837 not: function( selector ) { 2838 return this.pushStack( winnow( this, selector || [], true ) ); 2839 }, 2840 is: function( selector ) { 2841 return !!winnow( 2842 this, 2843 2844 // If this is a positional/relative selector, check membership in the returned set 2845 // so $("p:first").is("p:last") won't return true for a doc with two "p". 2846 typeof selector === "string" && rneedsContext.test( selector ) ? 2847 jQuery( selector ) : 2848 selector || [], 2849 false 2850 ).length; 2851 } 2852} ); 2853 2854 2855// Initialize a jQuery object 2856 2857 2858// A central reference to the root jQuery(document) 2859var rootjQuery, 2860 2861 // A simple way to check for HTML strings 2862 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 2863 // Strict HTML recognition (#11290: must start with <) 2864 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 2865 2866 init = jQuery.fn.init = function( selector, context, root ) { 2867 var match, elem; 2868 2869 // HANDLE: $(""), $(null), $(undefined), $(false) 2870 if ( !selector ) { 2871 return this; 2872 } 2873 2874 // init accepts an alternate rootjQuery 2875 // so migrate can support jQuery.sub (gh-2101) 2876 root = root || rootjQuery; 2877 2878 // Handle HTML strings 2879 if ( typeof selector === "string" ) { 2880 if ( selector.charAt( 0 ) === "<" && 2881 selector.charAt( selector.length - 1 ) === ">" && 2882 selector.length >= 3 ) { 2883 2884 // Assume that strings that start and end with <> are HTML and skip the regex check 2885 match = [ null, selector, null ]; 2886 2887 } else { 2888 match = rquickExpr.exec( selector ); 2889 } 2890 2891 // Match html or make sure no context is specified for #id 2892 if ( match && ( match[ 1 ] || !context ) ) { 2893 2894 // HANDLE: $(html) -> $(array) 2895 if ( match[ 1 ] ) { 2896 context = context instanceof jQuery ? context[ 0 ] : context; 2897 2898 // scripts is true for back-compat 2899 // Intentionally let the error be thrown if parseHTML is not present 2900 jQuery.merge( this, jQuery.parseHTML( 2901 match[ 1 ], 2902 context && context.nodeType ? context.ownerDocument || context : document, 2903 true 2904 ) ); 2905 2906 // HANDLE: $(html, props) 2907 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 2908 for ( match in context ) { 2909 2910 // Properties of context are called as methods if possible 2911 if ( jQuery.isFunction( this[ match ] ) ) { 2912 this[ match ]( context[ match ] ); 2913 2914 // ...and otherwise set as attributes 2915 } else { 2916 this.attr( match, context[ match ] ); 2917 } 2918 } 2919 } 2920 2921 return this; 2922 2923 // HANDLE: $(#id) 2924 } else { 2925 elem = document.getElementById( match[ 2 ] ); 2926 2927 // Check parentNode to catch when Blackberry 4.6 returns 2928 // nodes that are no longer in the document #6963 2929 if ( elem && elem.parentNode ) { 2930 2931 // Handle the case where IE and Opera return items 2932 // by name instead of ID 2933 if ( elem.id !== match[ 2 ] ) { 2934 return rootjQuery.find( selector ); 2935 } 2936 2937 // Otherwise, we inject the element directly into the jQuery object 2938 this.length = 1; 2939 this[ 0 ] = elem; 2940 } 2941 2942 this.context = document; 2943 this.selector = selector; 2944 return this; 2945 } 2946 2947 // HANDLE: $(expr, $(...)) 2948 } else if ( !context || context.jquery ) { 2949 return ( context || root ).find( selector ); 2950 2951 // HANDLE: $(expr, context) 2952 // (which is just equivalent to: $(context).find(expr) 2953 } else { 2954 return this.constructor( context ).find( selector ); 2955 } 2956 2957 // HANDLE: $(DOMElement) 2958 } else if ( selector.nodeType ) { 2959 this.context = this[ 0 ] = selector; 2960 this.length = 1; 2961 return this; 2962 2963 // HANDLE: $(function) 2964 // Shortcut for document ready 2965 } else if ( jQuery.isFunction( selector ) ) { 2966 return typeof root.ready !== "undefined" ? 2967 root.ready( selector ) : 2968 2969 // Execute immediately if ready is not present 2970 selector( jQuery ); 2971 } 2972 2973 if ( selector.selector !== undefined ) { 2974 this.selector = selector.selector; 2975 this.context = selector.context; 2976 } 2977 2978 return jQuery.makeArray( selector, this ); 2979 }; 2980 2981// Give the init function the jQuery prototype for later instantiation 2982init.prototype = jQuery.fn; 2983 2984// Initialize central reference 2985rootjQuery = jQuery( document ); 2986 2987 2988var rparentsprev = /^(?:parents|prev(?:Until|All))/, 2989 2990 // methods guaranteed to produce a unique set when starting from a unique set 2991 guaranteedUnique = { 2992 children: true, 2993 contents: true, 2994 next: true, 2995 prev: true 2996 }; 2997 2998jQuery.fn.extend( { 2999 has: function( target ) { 3000 var i, 3001 targets = jQuery( target, this ), 3002 len = targets.length; 3003 3004 return this.filter( function() { 3005 for ( i = 0; i < len; i++ ) { 3006 if ( jQuery.contains( this, targets[ i ] ) ) { 3007 return true; 3008 } 3009 } 3010 } ); 3011 }, 3012 3013 closest: function( selectors, context ) { 3014 var cur, 3015 i = 0, 3016 l = this.length, 3017 matched = [], 3018 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
vendor: 12,881 bytes, lines 3019-3527
3019 jQuery( selectors, context || this.context ) : 3020 0; 3021 3022 for ( ; i < l; i++ ) { 3023 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 3024 3025 // Always skip document fragments 3026 if ( cur.nodeType < 11 && ( pos ? 3027 pos.index( cur ) > -1 : 3028 3029 // Don't pass non-elements to Sizzle 3030 cur.nodeType === 1 && 3031 jQuery.find.matchesSelector( cur, selectors ) ) ) { 3032 3033 matched.push( cur ); 3034 break; 3035 } 3036 } 3037 } 3038 3039 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 3040 }, 3041 3042 // Determine the position of an element within 3043 // the matched set of elements 3044 index: function( elem ) { 3045 3046 // No argument, return index in parent 3047 if ( !elem ) { 3048 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 3049 } 3050 3051 // index in selector 3052 if ( typeof elem === "string" ) { 3053 return jQuery.inArray( this[ 0 ], jQuery( elem ) ); 3054 } 3055 3056 // Locate the position of the desired element 3057 return jQuery.inArray( 3058 3059 // If it receives a jQuery object, the first element is used 3060 elem.jquery ? elem[ 0 ] : elem, this ); 3061 }, 3062 3063 add: function( selector, context ) { 3064 return this.pushStack( 3065 jQuery.uniqueSort( 3066 jQuery.merge( this.get(), jQuery( selector, context ) ) 3067 ) 3068 ); 3069 }, 3070 3071 addBack: function( selector ) { 3072 return this.add( selector == null ? 3073 this.prevObject : this.prevObject.filter( selector ) 3074 ); 3075 } 3076} ); 3077 3078function sibling( cur, dir ) { 3079 do { 3080 cur = cur[ dir ]; 3081 } while ( cur && cur.nodeType !== 1 ); 3082 3083 return cur; 3084} 3085 3086jQuery.each( { 3087 parent: function( elem ) { 3088 var parent = elem.parentNode; 3089 return parent && parent.nodeType !== 11 ? parent : null; 3090 }, 3091 parents: function( elem ) { 3092 return dir( elem, "parentNode" ); 3093 }, 3094 parentsUntil: function( elem, i, until ) { 3095 return dir( elem, "parentNode", until ); 3096 }, 3097 next: function( elem ) { 3098 return sibling( elem, "nextSibling" ); 3099 }, 3100 prev: function( elem ) { 3101 return sibling( elem, "previousSibling" ); 3102 }, 3103 nextAll: function( elem ) { 3104 return dir( elem, "nextSibling" ); 3105 }, 3106 prevAll: function( elem ) { 3107 return dir( elem, "previousSibling" ); 3108 }, 3109 nextUntil: function( elem, i, until ) { 3110 return dir( elem, "nextSibling", until ); 3111 }, 3112 prevUntil: function( elem, i, until ) { 3113 return dir( elem, "previousSibling", until ); 3114 }, 3115 siblings: function( elem ) { 3116 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 3117 }, 3118 children: function( elem ) { 3119 return siblings( elem.firstChild ); 3120 }, 3121 contents: function( elem ) { 3122 return jQuery.nodeName( elem, "iframe" ) ? 3123 elem.contentDocument || elem.contentWindow.document : 3124 jQuery.merge( [], elem.childNodes ); 3125 } 3126}, function( name, fn ) { 3127 jQuery.fn[ name ] = function( until, selector ) { 3128 var ret = jQuery.map( this, fn, until ); 3129 3130 if ( name.slice( -5 ) !== "Until" ) { 3131 selector = until; 3132 } 3133 3134 if ( selector && typeof selector === "string" ) { 3135 ret = jQuery.filter( selector, ret ); 3136 } 3137 3138 if ( this.length > 1 ) { 3139 3140 // Remove duplicates 3141 if ( !guaranteedUnique[ name ] ) { 3142 ret = jQuery.uniqueSort( ret ); 3143 } 3144 3145 // Reverse order for parents* and prev-derivatives 3146 if ( rparentsprev.test( name ) ) { 3147 ret = ret.reverse(); 3148 } 3149 } 3150 3151 return this.pushStack( ret ); 3152 }; 3153} ); 3154var rnotwhite = ( /\S+/g ); 3155 3156 3157 3158// Convert String-formatted options into Object-formatted ones 3159function createOptions( options ) { 3160 var object = {}; 3161 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { 3162 object[ flag ] = true; 3163 } ); 3164 return object; 3165} 3166 3167/* 3168 * Create a callback list using the following parameters: 3169 * 3170 * options: an optional list of space-separated options that will change how 3171 * the callback list behaves or a more traditional option object 3172 * 3173 * By default a callback list will act like an event callback list and can be 3174 * "fired" multiple times. 3175 * 3176 * Possible options: 3177 * 3178 * once: will ensure the callback list can only be fired once (like a Deferred) 3179 * 3180 * memory: will keep track of previous values and will call any callback added 3181 * after the list has been fired right away with the latest "memorized" 3182 * values (like a Deferred) 3183 * 3184 * unique: will ensure a callback can only be added once (no duplicate in the list) 3185 * 3186 * stopOnFalse: interrupt callings when a callback returns false 3187 * 3188 */ 3189jQuery.Callbacks = function( options ) { 3190 3191 // Convert options from String-formatted to Object-formatted if needed 3192 // (we check in cache first) 3193 options = typeof options === "string" ? 3194 createOptions( options ) : 3195 jQuery.extend( {}, options ); 3196 3197 var // Flag to know if list is currently firing 3198 firing, 3199 3200 // Last fire value for non-forgettable lists 3201 memory, 3202 3203 // Flag to know if list was already fired 3204 fired, 3205 3206 // Flag to prevent firing 3207 locked, 3208 3209 // Actual callback list 3210 list = [], 3211 3212 // Queue of execution data for repeatable lists 3213 queue = [], 3214 3215 // Index of currently firing callback (modified by add/remove as needed) 3216 firingIndex = -1, 3217 3218 // Fire callbacks 3219 fire = function() { 3220 3221 // Enforce single-firing 3222 locked = options.once; 3223 3224 // Execute callbacks for all pending executions, 3225 // respecting firingIndex overrides and runtime changes 3226 fired = firing = true; 3227 for ( ; queue.length; firingIndex = -1 ) { 3228 memory = queue.shift(); 3229 while ( ++firingIndex < list.length ) { 3230 3231 // Run callback and check for early termination 3232 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 3233 options.stopOnFalse ) { 3234 3235 // Jump to end and forget the data so .add doesn't re-fire 3236 firingIndex = list.length; 3237 memory = false; 3238 } 3239 } 3240 } 3241 3242 // Forget the data if we're done with it 3243 if ( !options.memory ) { 3244 memory = false; 3245 } 3246 3247 firing = false; 3248 3249 // Clean up if we're done firing for good 3250 if ( locked ) { 3251 3252 // Keep an empty list if we have data for future add calls 3253 if ( memory ) { 3254 list = []; 3255 3256 // Otherwise, this object is spent 3257 } else { 3258 list = ""; 3259 } 3260 } 3261 }, 3262 3263 // Actual Callbacks object 3264 self = { 3265 3266 // Add a callback or a collection of callbacks to the list 3267 add: function() { 3268 if ( list ) { 3269 3270 // If we have memory from a past run, we should fire after adding 3271 if ( memory && !firing ) { 3272 firingIndex = list.length - 1; 3273 queue.push( memory ); 3274 } 3275 3276 ( function add( args ) { 3277 jQuery.each( args, function( _, arg ) { 3278 if ( jQuery.isFunction( arg ) ) { 3279 if ( !options.unique || !self.has( arg ) ) { 3280 list.push( arg ); 3281 } 3282 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { 3283 3284 // Inspect recursively 3285 add( arg ); 3286 } 3287 } ); 3288 } )( arguments ); 3289 3290 if ( memory && !firing ) { 3291 fire(); 3292 } 3293 } 3294 return this; 3295 }, 3296 3297 // Remove a callback from the list 3298 remove: function() { 3299 jQuery.each( arguments, function( _, arg ) { 3300 var index; 3301 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 3302 list.splice( index, 1 ); 3303 3304 // Handle firing indexes 3305 if ( index <= firingIndex ) { 3306 firingIndex--; 3307 } 3308 } 3309 } ); 3310 return this; 3311 }, 3312 3313 // Check if a given callback is in the list. 3314 // If no argument is given, return whether or not list has callbacks attached. 3315 has: function( fn ) { 3316 return fn ? 3317 jQuery.inArray( fn, list ) > -1 : 3318 list.length > 0; 3319 }, 3320 3321 // Remove all callbacks from the list 3322 empty: function() { 3323 if ( list ) { 3324 list = []; 3325 } 3326 return this; 3327 }, 3328 3329 // Disable .fire and .add 3330 // Abort any current/pending executions 3331 // Clear all callbacks and values 3332 disable: function() { 3333 locked = queue = []; 3334 list = memory = ""; 3335 return this; 3336 }, 3337 disabled: function() { 3338 return !list; 3339 }, 3340 3341 // Disable .fire 3342 // Also disable .add unless we have memory (since it would have no effect) 3343 // Abort any pending executions 3344 lock: function() { 3345 locked = true; 3346 if ( !memory ) { 3347 self.disable(); 3348 } 3349 return this; 3350 }, 3351 locked: function() { 3352 return !!locked; 3353 }, 3354 3355 // Call all callbacks with the given context and arguments 3356 fireWith: function( context, args ) { 3357 if ( !locked ) { 3358 args = args || []; 3359 args = [ context, args.slice ? args.slice() : args ]; 3360 queue.push( args ); 3361 if ( !firing ) { 3362 fire(); 3363 } 3364 } 3365 return this; 3366 }, 3367 3368 // Call all the callbacks with the given arguments 3369 fire: function() { 3370 self.fireWith( this, arguments ); 3371 return this; 3372 }, 3373 3374 // To know if the callbacks have already been called at least once 3375 fired: function() { 3376 return !!fired; 3377 } 3378 }; 3379 3380 return self; 3381}; 3382 3383 3384jQuery.extend( { 3385 3386 Deferred: function( func ) { 3387 var tuples = [ 3388 3389 // action, add listener, listener list, final state 3390 [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], 3391 [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], 3392 [ "notify", "progress", jQuery.Callbacks( "memory" ) ] 3393 ], 3394 state = "pending", 3395 promise = { 3396 state: function() { 3397 return state; 3398 }, 3399 always: function() { 3400 deferred.done( arguments ).fail( arguments ); 3401 return this; 3402 }, 3403 then: function( /* fnDone, fnFail, fnProgress */ ) { 3404 var fns = arguments; 3405 return jQuery.Deferred( function( newDefer ) { 3406 jQuery.each( tuples, function( i, tuple ) { 3407 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 3408 3409 // deferred[ done | fail | progress ] for forwarding actions to newDefer 3410 deferred[ tuple[ 1 ] ]( function() { 3411 var returned = fn && fn.apply( this, arguments ); 3412 if ( returned && jQuery.isFunction( returned.promise ) ) { 3413 returned.promise() 3414 .progress( newDefer.notify ) 3415 .done( newDefer.resolve ) 3416 .fail( newDefer.reject ); 3417 } else { 3418 newDefer[ tuple[ 0 ] + "With" ]( 3419 this === promise ? newDefer.promise() : this, 3420 fn ? [ returned ] : arguments 3421 ); 3422 } 3423 } ); 3424 } ); 3425 fns = null; 3426 } ).promise(); 3427 }, 3428 3429 // Get a promise for this deferred 3430 // If obj is provided, the promise aspect is added to the object 3431 promise: function( obj ) { 3432 return obj != null ? jQuery.extend( obj, promise ) : promise; 3433 } 3434 }, 3435 deferred = {}; 3436 3437 // Keep pipe for back-compat 3438 promise.pipe = promise.then; 3439 3440 // Add list-specific methods 3441 jQuery.each( tuples, function( i, tuple ) { 3442 var list = tuple[ 2 ], 3443 stateString = tuple[ 3 ]; 3444 3445 // promise[ done | fail | progress ] = list.add 3446 promise[ tuple[ 1 ] ] = list.add; 3447 3448 // Handle state 3449 if ( stateString ) { 3450 list.add( function() { 3451 3452 // state = [ resolved | rejected ] 3453 state = stateString; 3454 3455 // [ reject_list | resolve_list ].disable; progress_list.lock 3456 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 3457 } 3458 3459 // deferred[ resolve | reject | notify ] 3460 deferred[ tuple[ 0 ] ] = function() { 3461 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); 3462 return this; 3463 }; 3464 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 3465 } ); 3466 3467 // Make the deferred a promise 3468 promise.promise( deferred ); 3469 3470 // Call given func if any 3471 if ( func ) { 3472 func.call( deferred, deferred ); 3473 } 3474 3475 // All done! 3476 return deferred; 3477 }, 3478 3479 // Deferred helper 3480 when: function( subordinate /* , ..., subordinateN */ ) { 3481 var i = 0, 3482 resolveValues = slice.call( arguments ), 3483 length = resolveValues.length, 3484 3485 // the count of uncompleted subordinates 3486 remaining = length !== 1 || 3487 ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, 3488 3489 // the master Deferred. 3490 // If resolveValues consist of only a single Deferred, just use that. 3491 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 3492 3493 // Update function for both resolve and progress values 3494 updateFunc = function( i, contexts, values ) { 3495 return function( value ) { 3496 contexts[ i ] = this; 3497 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 3498 if ( values === progressValues ) { 3499 deferred.notifyWith( contexts, values ); 3500 3501 } else if ( !( --remaining ) ) { 3502 deferred.resolveWith( contexts, values ); 3503 } 3504 }; 3505 }, 3506 3507 progressValues, progressContexts, resolveContexts; 3508 3509 // add listeners to Deferred subordinates; treat others as resolved 3510 if ( length > 1 ) { 3511 progressValues = new Array( length ); 3512 progressContexts = new Array( length ); 3513 resolveContexts = new Array( length ); 3514 for ( ; i < length; i++ ) { 3515 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { 3516 resolveValues[ i ].promise() 3517 .progress( updateFunc( i, progressContexts, progressValues ) ) 3518 .done( updateFunc( i, resolveContexts, resolveValues ) ) 3519 .fail( deferred.reject ); 3520 } else { 3521 --remaining; 3522 } 3523 } 3524 } 3525 3526 // if we're not waiting on anything, resolve the master 3527 if ( !remaining ) {
vendor: 2,149 bytes, lines 3528-3627
3528 deferred.resolveWith( resolveContexts, resolveValues ); 3529 } 3530 3531 return deferred.promise(); 3532 } 3533} ); 3534 3535 3536// The deferred used on DOM ready 3537var readyList; 3538 3539jQuery.fn.ready = function( fn ) { 3540 3541 // Add the callback 3542 jQuery.ready.promise().done( fn ); 3543 3544 return this; 3545}; 3546 3547jQuery.extend( { 3548 3549 // Is the DOM ready to be used? Set to true once it occurs. 3550 isReady: false, 3551 3552 // A counter to track how many items to wait for before 3553 // the ready event fires. See #6781 3554 readyWait: 1, 3555 3556 // Hold (or release) the ready event 3557 holdReady: function( hold ) { 3558 if ( hold ) { 3559 jQuery.readyWait++; 3560 } else { 3561 jQuery.ready( true ); 3562 } 3563 }, 3564 3565 // Handle when the DOM is ready 3566 ready: function( wait ) { 3567 3568 // Abort if there are pending holds or we're already ready 3569 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 3570 return; 3571 } 3572 3573 // Remember that the DOM is ready 3574 jQuery.isReady = true; 3575 3576 // If a normal DOM Ready event fired, decrement, and wait if need be 3577 if ( wait !== true && --jQuery.readyWait > 0 ) { 3578 return; 3579 } 3580 3581 // If there are functions bound, to execute 3582 readyList.resolveWith( document, [ jQuery ] ); 3583 3584 // Trigger any bound ready events 3585 if ( jQuery.fn.triggerHandler ) { 3586 jQuery( document ).triggerHandler( "ready" ); 3587 jQuery( document ).off( "ready" ); 3588 } 3589 } 3590} ); 3591 3592/** 3593 * Clean-up method for dom ready events 3594 */ 3595function detach() { 3596 if ( document.addEventListener ) { 3597 document.removeEventListener( "DOMContentLoaded", completed ); 3598 window.removeEventListener( "load", completed ); 3599 3600 } else { 3601 document.detachEvent( "onreadystatechange", completed ); 3602 window.detachEvent( "onload", completed ); 3603 } 3604} 3605 3606/** 3607 * The ready event handler and self cleanup method 3608 */ 3609function completed() { 3610 3611 // readyState === "complete" is good enough for us to call the dom ready in oldIE 3612 if ( document.addEventListener || 3613 window.event.type === "load" || 3614 document.readyState === "complete" ) { 3615 3616 detach(); 3617 jQuery.ready(); 3618 } 3619} 3620 3621jQuery.ready.promise = function( obj ) { 3622 if ( !readyList ) { 3623 3624 readyList = jQuery.Deferred(); 3625 3626 // Catch cases where $(document).ready() is called 3627 // after the browser event has already occurred.
3628 // Support: IE6-10 3629 // Older IE sometimes signals "interactive" too soon 3630 if ( document.readyState === "complete" || 3631 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 3632 3633 // Handle it asynchronously to allow scripts the opportunity to delay ready 3634 window.setTimeout( jQuery.ready ); 3635 3636 // Standards-based browsers support DOMContentLoaded 3637 } else if ( document.addEventListener ) { 3638 3639 // Use the handy event callback 3640 document.addEventListener( "DOMContentLoaded", completed ); 3641 3642 // A fallback to window.onload, that will always work 3643 window.addEventListener( "load", completed ); 3644 3645 // If IE event model is used 3646 } else { 3647 3648 // Ensure firing before onload, maybe late but safe also for iframes 3649 document.attachEvent( "onreadystatechange", completed ); 3650 3651 // A fallback to window.onload, that will always work 3652 window.attachEvent( "onload", completed ); 3653 3654 // If IE and not a frame 3655 // continually check to see if the document is ready 3656 var top = false; 3657 3658 try { 3659 top = window.frameElement == null && document.documentElement; 3660 } catch ( e ) {} 3661 3662 if ( top && top.doScroll ) { 3663 ( function doScrollCheck() { 3664 if ( !jQuery.isReady ) { 3665 3666 try { 3667 3668 // Use the trick by Diego Perini 3669 // http://javascript.nwbox.com/IEContentLoaded/ 3670 top.doScroll( "left" ); 3671 } catch ( e ) { 3672 return window.setTimeout( doScrollCheck, 50 ); 3673 } 3674 3675 // detach all dom ready events 3676 detach(); 3677 3678 // and execute any waiting functions 3679 jQuery.ready(); 3680 } 3681 } )(); 3682 } 3683 } 3684 } 3685 return readyList.promise( obj ); 3686}; 3687 3688// Kick off the DOM ready check even if the user does not 3689jQuery.ready.promise(); 3690 3691 3692 3693 3694// Support: IE<9 3695// Iteration over object's inherited properties before its own 3696var i; 3697for ( i in jQuery( support ) ) { 3698 break; 3699} 3700support.ownFirst = i === "0"; 3701 3702// Note: most support tests are defined in their respective modules. 3703// false until the test is run 3704support.inlineBlockNeedsLayout = false; 3705 3706// Execute ASAP in case we need to set body.style.zoom 3707jQuery( function() { 3708 3709 // Minified: var a,b,c,d 3710 var val, div, body, container; 3711 3712 body = document.getElementsByTagName( "body" )[ 0 ]; 3713 if ( !body || !body.style ) { 3714 3715 // Return for frameset docs that don't have a body 3716 return; 3717 } 3718 3719 // Setup 3720 div = document.createElement( "div" ); 3721 container = document.createElement( "div" ); 3722 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 3723 body.appendChild( container ).appendChild( div ); 3724 3725 if ( typeof div.style.zoom !== "undefined" ) { 3726 3727 // Support: IE<8 3728 // Check if natively block-level elements act like inline-block 3729 // elements when setting their display to 'inline' and giving 3730 // them layout 3731 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; 3732 3733 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; 3734 if ( val ) { 3735 3736 // Prevent IE 6 from affecting layout for positioned elements #11048 3737 // Prevent IE from shrinking the body in IE 7 mode #12869 3738 // Support: IE<8 3739 body.style.zoom = 1; 3740 } 3741 } 3742 3743 body.removeChild( container ); 3744} ); 3745 3746 3747( function() { 3748 var div = document.createElement( "div" ); 3749 3750 // Support: IE<9 3751 support.deleteExpando = true; 3752 try { 3753 delete div.test; 3754 } catch ( e ) { 3755 support.deleteExpando = false; 3756 } 3757 3758 // Null elements to avoid leaks in IE. 3759 div = null; 3760} )(); 3761var acceptData = function( elem ) { 3762 var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], 3763 nodeType = +elem.nodeType || 1; 3764 3765 // Do not set data on non-element DOM nodes because it will not be cleared (#8335). 3766 return nodeType !== 1 && nodeType !== 9 ? 3767 false : 3768 3769 // Nodes accept data unless otherwise specified; rejection can be conditional 3770 !noData || noData !== true && elem.getAttribute( "classid" ) === noData; 3771}; 3772 3773 3774 3775 3776var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 3777 rmultiDash = /([A-Z])/g; 3778 3779function dataAttr( elem, key, data ) { 3780 3781 // If nothing was found internally, try to fetch any 3782 // data from the HTML5 data-* attribute 3783 if ( data === undefined && elem.nodeType === 1 ) { 3784 3785 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 3786 3787 data = elem.getAttribute( name ); 3788 3789 if ( typeof data === "string" ) { 3790 try { 3791 data = data === "true" ? true :
vendor: 11,186 bytes, lines 3792-4256
3792 data === "false" ? false : 3793 data === "null" ? null : 3794 3795 // Only convert to a number if it doesn't change the string 3796 +data + "" === data ? +data : 3797 rbrace.test( data ) ? jQuery.parseJSON( data ) : 3798 data; 3799 } catch ( e ) {} 3800 3801 // Make sure we set the data so it isn't changed later 3802 jQuery.data( elem, key, data ); 3803 3804 } else { 3805 data = undefined; 3806 } 3807 } 3808 3809 return data; 3810} 3811 3812// checks a cache object for emptiness 3813function isEmptyDataObject( obj ) { 3814 var name; 3815 for ( name in obj ) { 3816 3817 // if the public data object is empty, the private is still empty 3818 if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { 3819 continue; 3820 } 3821 if ( name !== "toJSON" ) { 3822 return false; 3823 } 3824 } 3825 3826 return true; 3827} 3828 3829function internalData( elem, name, data, pvt /* Internal Use Only */ ) { 3830 if ( !acceptData( elem ) ) { 3831 return; 3832 } 3833 3834 var ret, thisCache, 3835 internalKey = jQuery.expando, 3836 3837 // We have to handle DOM nodes and JS objects differently because IE6-7 3838 // can't GC object references properly across the DOM-JS boundary 3839 isNode = elem.nodeType, 3840 3841 // Only DOM nodes need the global jQuery cache; JS object data is 3842 // attached directly to the object so GC can occur automatically 3843 cache = isNode ? jQuery.cache : elem, 3844 3845 // Only defining an ID for JS objects if its cache already exists allows 3846 // the code to shortcut on the same path as a DOM node with no cache 3847 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; 3848 3849 // Avoid doing any more work than we need to when trying to get data on an 3850 // object that has no data at all 3851 if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && 3852 data === undefined && typeof name === "string" ) { 3853 return; 3854 } 3855 3856 if ( !id ) { 3857 3858 // Only DOM nodes need a new unique ID for each element since their data 3859 // ends up in the global cache 3860 if ( isNode ) { 3861 id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; 3862 } else { 3863 id = internalKey; 3864 } 3865 } 3866 3867 if ( !cache[ id ] ) { 3868 3869 // Avoid exposing jQuery metadata on plain JS objects when the object 3870 // is serialized using JSON.stringify 3871 cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; 3872 } 3873 3874 // An object can be passed to jQuery.data instead of a key/value pair; this gets 3875 // shallow copied over onto the existing cache 3876 if ( typeof name === "object" || typeof name === "function" ) { 3877 if ( pvt ) { 3878 cache[ id ] = jQuery.extend( cache[ id ], name ); 3879 } else { 3880 cache[ id ].data = jQuery.extend( cache[ id ].data, name ); 3881 } 3882 } 3883 3884 thisCache = cache[ id ]; 3885 3886 // jQuery data() is stored in a separate object inside the object's internal data 3887 // cache in order to avoid key collisions between internal data and user-defined 3888 // data. 3889 if ( !pvt ) { 3890 if ( !thisCache.data ) { 3891 thisCache.data = {}; 3892 } 3893 3894 thisCache = thisCache.data; 3895 } 3896 3897 if ( data !== undefined ) { 3898 thisCache[ jQuery.camelCase( name ) ] = data; 3899 } 3900 3901 // Check for both converted-to-camel and non-converted data property names 3902 // If a data property was specified 3903 if ( typeof name === "string" ) { 3904 3905 // First Try to find as-is property data 3906 ret = thisCache[ name ]; 3907 3908 // Test for null|undefined property data 3909 if ( ret == null ) { 3910 3911 // Try to find the camelCased property 3912 ret = thisCache[ jQuery.camelCase( name ) ]; 3913 } 3914 } else { 3915 ret = thisCache; 3916 } 3917 3918 return ret; 3919} 3920 3921function internalRemoveData( elem, name, pvt ) { 3922 if ( !acceptData( elem ) ) { 3923 return; 3924 } 3925 3926 var thisCache, i, 3927 isNode = elem.nodeType, 3928 3929 // See jQuery.data for more information 3930 cache = isNode ? jQuery.cache : elem, 3931 id = isNode ? elem[ jQuery.expando ] : jQuery.expando; 3932 3933 // If there is already no cache entry for this object, there is no 3934 // purpose in continuing 3935 if ( !cache[ id ] ) { 3936 return; 3937 } 3938 3939 if ( name ) { 3940 3941 thisCache = pvt ? cache[ id ] : cache[ id ].data; 3942 3943 if ( thisCache ) { 3944 3945 // Support array or space separated string names for data keys 3946 if ( !jQuery.isArray( name ) ) { 3947 3948 // try the string as a key before any manipulation 3949 if ( name in thisCache ) { 3950 name = [ name ]; 3951 } else { 3952 3953 // split the camel cased version by spaces unless a key with the spaces exists 3954 name = jQuery.camelCase( name ); 3955 if ( name in thisCache ) { 3956 name = [ name ]; 3957 } else { 3958 name = name.split( " " ); 3959 } 3960 } 3961 } else { 3962 3963 // If "name" is an array of keys... 3964 // When data is initially created, via ("key", "val") signature, 3965 // keys will be converted to camelCase. 3966 // Since there is no way to tell _how_ a key was added, remove 3967 // both plain key and camelCase key. #12786 3968 // This will only penalize the array argument path. 3969 name = name.concat( jQuery.map( name, jQuery.camelCase ) ); 3970 } 3971 3972 i = name.length; 3973 while ( i-- ) { 3974 delete thisCache[ name[ i ] ]; 3975 } 3976 3977 // If there is no data left in the cache, we want to continue 3978 // and let the cache object itself get destroyed 3979 if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { 3980 return; 3981 } 3982 } 3983 } 3984 3985 // See jQuery.data for more information 3986 if ( !pvt ) { 3987 delete cache[ id ].data; 3988 3989 // Don't destroy the parent cache unless the internal data object 3990 // had been the only thing left in it 3991 if ( !isEmptyDataObject( cache[ id ] ) ) { 3992 return; 3993 } 3994 } 3995 3996 // Destroy the cache 3997 if ( isNode ) { 3998 jQuery.cleanData( [ elem ], true ); 3999 4000 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) 4001 /* jshint eqeqeq: false */ 4002 } else if ( support.deleteExpando || cache != cache.window ) { 4003 /* jshint eqeqeq: true */ 4004 delete cache[ id ]; 4005 4006 // When all else fails, undefined 4007 } else { 4008 cache[ id ] = undefined; 4009 } 4010} 4011 4012jQuery.extend( { 4013 cache: {}, 4014 4015 // The following elements (space-suffixed to avoid Object.prototype collisions) 4016 // throw uncatchable exceptions if you attempt to set expando properties 4017 noData: { 4018 "applet ": true, 4019 "embed ": true, 4020 4021 // ...but Flash objects (which have this classid) *can* handle expandos 4022 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 4023 }, 4024 4025 hasData: function( elem ) { 4026 elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; 4027 return !!elem && !isEmptyDataObject( elem ); 4028 }, 4029 4030 data: function( elem, name, data ) { 4031 return internalData( elem, name, data ); 4032 }, 4033 4034 removeData: function( elem, name ) { 4035 return internalRemoveData( elem, name ); 4036 }, 4037 4038 // For internal use only. 4039 _data: function( elem, name, data ) { 4040 return internalData( elem, name, data, true ); 4041 }, 4042 4043 _removeData: function( elem, name ) { 4044 return internalRemoveData( elem, name, true ); 4045 } 4046} ); 4047 4048jQuery.fn.extend( { 4049 data: function( key, value ) { 4050 var i, name, data, 4051 elem = this[ 0 ], 4052 attrs = elem && elem.attributes; 4053 4054 // Special expections of .data basically thwart jQuery.access, 4055 // so implement the relevant behavior ourselves 4056 4057 // Gets all values 4058 if ( key === undefined ) { 4059 if ( this.length ) { 4060 data = jQuery.data( elem ); 4061 4062 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { 4063 i = attrs.length; 4064 while ( i-- ) { 4065 4066 // Support: IE11+ 4067 // The attrs elements can be null (#14894) 4068 if ( attrs[ i ] ) { 4069 name = attrs[ i ].name; 4070 if ( name.indexOf( "data-" ) === 0 ) { 4071 name = jQuery.camelCase( name.slice( 5 ) ); 4072 dataAttr( elem, name, data[ name ] ); 4073 } 4074 } 4075 } 4076 jQuery._data( elem, "parsedAttrs", true ); 4077 } 4078 } 4079 4080 return data; 4081 } 4082 4083 // Sets multiple values 4084 if ( typeof key === "object" ) { 4085 return this.each( function() { 4086 jQuery.data( this, key ); 4087 } ); 4088 } 4089 4090 return arguments.length > 1 ? 4091 4092 // Sets one value 4093 this.each( function() { 4094 jQuery.data( this, key, value ); 4095 } ) : 4096 4097 // Gets one value 4098 // Try to fetch any internally stored data first 4099 elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; 4100 }, 4101 4102 removeData: function( key ) { 4103 return this.each( function() { 4104 jQuery.removeData( this, key ); 4105 } ); 4106 } 4107} ); 4108 4109 4110jQuery.extend( { 4111 queue: function( elem, type, data ) { 4112 var queue; 4113 4114 if ( elem ) { 4115 type = ( type || "fx" ) + "queue"; 4116 queue = jQuery._data( elem, type ); 4117 4118 // Speed up dequeue by getting out quickly if this is just a lookup 4119 if ( data ) { 4120 if ( !queue || jQuery.isArray( data ) ) { 4121 queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); 4122 } else { 4123 queue.push( data ); 4124 } 4125 } 4126 return queue || []; 4127 } 4128 }, 4129 4130 dequeue: function( elem, type ) { 4131 type = type || "fx"; 4132 4133 var queue = jQuery.queue( elem, type ), 4134 startLength = queue.length, 4135 fn = queue.shift(), 4136 hooks = jQuery._queueHooks( elem, type ), 4137 next = function() { 4138 jQuery.dequeue( elem, type ); 4139 }; 4140 4141 // If the fx queue is dequeued, always remove the progress sentinel 4142 if ( fn === "inprogress" ) { 4143 fn = queue.shift(); 4144 startLength--; 4145 } 4146 4147 if ( fn ) { 4148 4149 // Add a progress sentinel to prevent the fx queue from being 4150 // automatically dequeued 4151 if ( type === "fx" ) { 4152 queue.unshift( "inprogress" ); 4153 } 4154 4155 // clear up the last queue stop function 4156 delete hooks.stop; 4157 fn.call( elem, next, hooks ); 4158 } 4159 4160 if ( !startLength && hooks ) { 4161 hooks.empty.fire(); 4162 } 4163 }, 4164 4165 // not intended for public consumption - generates a queueHooks object, 4166 // or returns the current one 4167 _queueHooks: function( elem, type ) { 4168 var key = type + "queueHooks"; 4169 return jQuery._data( elem, key ) || jQuery._data( elem, key, { 4170 empty: jQuery.Callbacks( "once memory" ).add( function() { 4171 jQuery._removeData( elem, type + "queue" ); 4172 jQuery._removeData( elem, key ); 4173 } ) 4174 } ); 4175 } 4176} ); 4177 4178jQuery.fn.extend( { 4179 queue: function( type, data ) { 4180 var setter = 2; 4181 4182 if ( typeof type !== "string" ) { 4183 data = type; 4184 type = "fx"; 4185 setter--; 4186 } 4187 4188 if ( arguments.length < setter ) { 4189 return jQuery.queue( this[ 0 ], type ); 4190 } 4191 4192 return data === undefined ? 4193 this : 4194 this.each( function() { 4195 var queue = jQuery.queue( this, type, data ); 4196 4197 // ensure a hooks for this queue 4198 jQuery._queueHooks( this, type ); 4199 4200 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 4201 jQuery.dequeue( this, type ); 4202 } 4203 } ); 4204 }, 4205 dequeue: function( type ) { 4206 return this.each( function() { 4207 jQuery.dequeue( this, type ); 4208 } ); 4209 }, 4210 clearQueue: function( type ) { 4211 return this.queue( type || "fx", [] ); 4212 }, 4213 4214 // Get a promise resolved when queues of a certain type 4215 // are emptied (fx is the type by default) 4216 promise: function( type, obj ) { 4217 var tmp, 4218 count = 1, 4219 defer = jQuery.Deferred(), 4220 elements = this, 4221 i = this.length, 4222 resolve = function() { 4223 if ( !( --count ) ) { 4224 defer.resolveWith( elements, [ elements ] ); 4225 } 4226 }; 4227 4228 if ( typeof type !== "string" ) { 4229 obj = type; 4230 type = undefined; 4231 } 4232 type = type || "fx"; 4233 4234 while ( i-- ) { 4235 tmp = jQuery._data( elements[ i ], type + "queueHooks" ); 4236 if ( tmp && tmp.empty ) { 4237 count++; 4238 tmp.empty.add( resolve ); 4239 } 4240 } 4241 resolve(); 4242 return defer.promise( obj ); 4243 } 4244} ); 4245 4246 4247( function() { 4248 var shrinkWrapBlocksVal; 4249 4250 support.shrinkWrapBlocks = function() { 4251 if ( shrinkWrapBlocksVal != null ) { 4252 return shrinkWrapBlocksVal; 4253 } 4254 4255 // Will be changed later if needed. 4256 shrinkWrapBlocksVal = false;
vendor: 4,171 bytes, lines 4257-4405
4257 4258 // Minified: var b,c,d 4259 var div, body, container; 4260 4261 body = document.getElementsByTagName( "body" )[ 0 ]; 4262 if ( !body || !body.style ) { 4263 4264 // Test fired too early or in an unsupported environment, exit. 4265 return; 4266 } 4267 4268 // Setup 4269 div = document.createElement( "div" ); 4270 container = document.createElement( "div" ); 4271 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 4272 body.appendChild( container ).appendChild( div ); 4273 4274 // Support: IE6 4275 // Check if elements with layout shrink-wrap their children 4276 if ( typeof div.style.zoom !== "undefined" ) { 4277 4278 // Reset CSS: box-sizing; display; margin; border 4279 div.style.cssText = 4280 4281 // Support: Firefox<29, Android 2.3 4282 // Vendor-prefix box-sizing 4283 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 4284 "box-sizing:content-box;display:block;margin:0;border:0;" + 4285 "padding:1px;width:1px;zoom:1"; 4286 div.appendChild( document.createElement( "div" ) ).style.width = "5px"; 4287 shrinkWrapBlocksVal = div.offsetWidth !== 3; 4288 } 4289 4290 body.removeChild( container ); 4291 4292 return shrinkWrapBlocksVal; 4293 }; 4294 4295} )(); 4296var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 4297 4298var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 4299 4300 4301var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 4302 4303var isHidden = function( elem, el ) { 4304 4305 // isHidden might be called from jQuery#filter function; 4306 // in that case, element will be second argument 4307 elem = el || elem; 4308 return jQuery.css( elem, "display" ) === "none" || 4309 !jQuery.contains( elem.ownerDocument, elem ); 4310 }; 4311 4312 4313 4314function adjustCSS( elem, prop, valueParts, tween ) { 4315 var adjusted, 4316 scale = 1, 4317 maxIterations = 20, 4318 currentValue = tween ? 4319 function() { return tween.cur(); } : 4320 function() { return jQuery.css( elem, prop, "" ); }, 4321 initial = currentValue(), 4322 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 4323 4324 // Starting value computation is required for potential unit mismatches 4325 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 4326 rcssNum.exec( jQuery.css( elem, prop ) ); 4327 4328 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 4329 4330 // Trust units reported by jQuery.css 4331 unit = unit || initialInUnit[ 3 ]; 4332 4333 // Make sure we update the tween properties later on 4334 valueParts = valueParts || []; 4335 4336 // Iteratively approximate from a nonzero starting point 4337 initialInUnit = +initial || 1; 4338 4339 do { 4340 4341 // If previous iteration zeroed out, double until we get *something*. 4342 // Use string for doubling so we don't accidentally see scale as unchanged below 4343 scale = scale || ".5"; 4344 4345 // Adjust and apply 4346 initialInUnit = initialInUnit / scale; 4347 jQuery.style( elem, prop, initialInUnit + unit ); 4348 4349 // Update scale, tolerating zero or NaN from tween.cur() 4350 // Break the loop if scale is unchanged or perfect, or if we've just had enough. 4351 } while ( 4352 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations 4353 ); 4354 } 4355 4356 if ( valueParts ) { 4357 initialInUnit = +initialInUnit || +initial || 0; 4358 4359 // Apply relative offset (+=/-=) if specified 4360 adjusted = valueParts[ 1 ] ? 4361 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 4362 +valueParts[ 2 ]; 4363 if ( tween ) { 4364 tween.unit = unit; 4365 tween.start = initialInUnit; 4366 tween.end = adjusted; 4367 } 4368 } 4369 return adjusted; 4370} 4371 4372 4373// Multifunctional method to get and set values of a collection 4374// The value/s can optionally be executed if it's a function 4375var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 4376 var i = 0, 4377 length = elems.length, 4378 bulk = key == null; 4379 4380 // Sets many values 4381 if ( jQuery.type( key ) === "object" ) { 4382 chainable = true; 4383 for ( i in key ) { 4384 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 4385 } 4386 4387 // Sets one value 4388 } else if ( value !== undefined ) { 4389 chainable = true; 4390 4391 if ( !jQuery.isFunction( value ) ) { 4392 raw = true; 4393 } 4394 4395 if ( bulk ) { 4396 4397 // Bulk operations run against the entire set 4398 if ( raw ) { 4399 fn.call( elems, value ); 4400 fn = null; 4401 4402 // ...except when executing function values 4403 } else { 4404 bulk = fn; 4405 fn = function( elem, key, value ) {
4406 return bulk.call( jQuery( elem ), value ); 4407 }; 4408 } 4409 } 4410 4411 if ( fn ) { 4412 for ( ; i < length; i++ ) { 4413 fn( 4414 elems[ i ], 4415 key, 4416 raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) 4417 ); 4418 } 4419 } 4420 } 4421 4422 return chainable ? 4423 elems : 4424 4425 // Gets 4426 bulk ? 4427 fn.call( elems ) : 4428 length ? fn( elems[ 0 ], key ) : emptyGet; 4429}; 4430var rcheckableType = ( /^(?:checkbox|radio)$/i ); 4431 4432var rtagName = ( /<([\w:-]+)/ ); 4433 4434var rscriptType = ( /^$|\/(?:java|ecma)script/i ); 4435 4436var rleadingWhitespace = ( /^\s+/ ); 4437 4438var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + 4439 "details|dialog|figcaption|figure|footer|header|hgroup|main|" + 4440 "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; 4441 4442 4443 4444function createSafeFragment( document ) { 4445 var list = nodeNames.split( "|" ), 4446 safeFrag = document.createDocumentFragment(); 4447 4448 if ( safeFrag.createElement ) { 4449 while ( list.length ) { 4450 safeFrag.createElement( 4451 list.pop() 4452 ); 4453 } 4454 } 4455 return safeFrag; 4456} 4457 4458 4459( function() { 4460 var div = document.createElement( "div" ), 4461 fragment = document.createDocumentFragment(), 4462 input = document.createElement( "input" ); 4463 4464 // Setup 4465 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 4466 4467 // IE strips leading whitespace when .innerHTML is used 4468 support.leadingWhitespace = div.firstChild.nodeType === 3; 4469 4470 // Make sure that tbody elements aren't automatically inserted 4471 // IE will insert them into empty tables 4472 support.tbody = !div.getElementsByTagName( "tbody" ).length; 4473 4474 // Make sure that link elements get serialized correctly by innerHTML 4475 // This requires a wrapper element in IE 4476 support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; 4477 4478 // Makes sure cloning an html5 element does not cause problems 4479 // Where outerHTML is undefined, this still works 4480 support.html5Clone = 4481 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; 4482 4483 // Check if a disconnected checkbox will retain its checked 4484 // value of true after appended to the DOM (IE6/7) 4485 input.type = "checkbox"; 4486 input.checked = true; 4487 fragment.appendChild( input ); 4488 support.appendChecked = input.checked; 4489 4490 // Make sure textarea (and checkbox) defaultValue is properly cloned 4491 // Support: IE6-IE11+ 4492 div.innerHTML = "<textarea>x</textarea>"; 4493 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 4494 4495 // #11217 - WebKit loses check when the name is after the checked attribute 4496 fragment.appendChild( div ); 4497 4498 // Support: Windows Web Apps (WWA) 4499 // `name` and `type` must use .setAttribute for WWA (#14901) 4500 input = document.createElement( "input" ); 4501 input.setAttribute( "type", "radio" ); 4502 input.setAttribute( "checked", "checked" ); 4503 input.setAttribute( "name", "t" ); 4504 4505 div.appendChild( input ); 4506 4507 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 4508 // old WebKit doesn't clone checked state correctly in fragments 4509 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 4510 4511 // Support: IE<9 4512 // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ 4513 support.noCloneEvent = !!div.addEventListener; 4514 4515 // Support: IE<9 4516 // Since attributes and properties are the same in IE, 4517 // cleanData must set properties to undefined rather than use removeAttribute 4518 div[ jQuery.expando ] = 1; 4519 support.attributes = !div.getAttribute( jQuery.expando ); 4520} )(); 4521 4522 4523// We have to close these tags to support XHTML (#13200) 4524var wrapMap = { 4525 option: [ 1, "<select multiple='multiple'>", "</select>" ], 4526 legend: [ 1, "<fieldset>", "</fieldset>" ], 4527 area: [ 1, "<map>", "</map>" ], 4528 4529 // Support: IE8 4530 param: [ 1, "<object>", "</object>" ], 4531 thead: [ 1, "<table>", "</table>" ], 4532 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4533 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], 4534 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4535 4536 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, 4537 // unless wrapped in a div with non-breaking characters in front of it. 4538 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] 4539}; 4540 4541// Support: IE8-IE9 4542wrapMap.optgroup = wrapMap.option; 4543 4544wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4545wrapMap.th = wrapMap.td; 4546 4547 4548function getAll( context, tag ) { 4549 var elems, elem, 4550 i = 0, 4551 found = typeof context.getElementsByTagName !== "undefined" ? 4552 context.getElementsByTagName( tag || "*" ) : 4553 typeof context.querySelectorAll !== "undefined" ? 4554 context.querySelectorAll( tag || "*" ) : 4555 undefined; 4556 4557 if ( !found ) { 4558 for ( found = [], elems = context.childNodes || context; 4559 ( elem = elems[ i ] ) != null; 4560 i++ 4561 ) { 4562 if ( !tag || jQuery.nodeName( elem, tag ) ) { 4563 found.push( elem ); 4564 } else { 4565 jQuery.merge( found, getAll( elem, tag ) ); 4566 } 4567 } 4568 } 4569 4570 return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 4571 jQuery.merge( [ context ], found ) : 4572 found; 4573} 4574 4575 4576// Mark scripts as having already been evaluated 4577function setGlobalEval( elems, refElements ) { 4578 var elem, 4579 i = 0; 4580 for ( ; ( elem = elems[ i ] ) != null; i++ ) { 4581 jQuery._data( 4582 elem, 4583 "globalEval", 4584 !refElements || jQuery._data( refElements[ i ], "globalEval" ) 4585 ); 4586 } 4587} 4588 4589
vendor: 45,546 bytes, lines 4590-6222
4590var rhtml = /<|&#?\w+;/, 4591 rtbody = /<tbody/i; 4592 4593function fixDefaultChecked( elem ) { 4594 if ( rcheckableType.test( elem.type ) ) { 4595 elem.defaultChecked = elem.checked; 4596 } 4597} 4598 4599function buildFragment( elems, context, scripts, selection, ignored ) { 4600 var j, elem, contains, 4601 tmp, tag, tbody, wrap, 4602 l = elems.length, 4603 4604 // Ensure a safe fragment 4605 safe = createSafeFragment( context ), 4606 4607 nodes = [], 4608 i = 0; 4609 4610 for ( ; i < l; i++ ) { 4611 elem = elems[ i ]; 4612 4613 if ( elem || elem === 0 ) { 4614 4615 // Add nodes directly 4616 if ( jQuery.type( elem ) === "object" ) { 4617 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 4618 4619 // Convert non-html into a text node 4620 } else if ( !rhtml.test( elem ) ) { 4621 nodes.push( context.createTextNode( elem ) ); 4622 4623 // Convert html into DOM nodes 4624 } else { 4625 tmp = tmp || safe.appendChild( context.createElement( "div" ) ); 4626 4627 // Deserialize a standard representation 4628 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 4629 wrap = wrapMap[ tag ] || wrapMap._default; 4630 4631 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 4632 4633 // Descend through wrappers to the right content 4634 j = wrap[ 0 ]; 4635 while ( j-- ) { 4636 tmp = tmp.lastChild; 4637 } 4638 4639 // Manually add leading whitespace removed by IE 4640 if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { 4641 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) ); 4642 } 4643 4644 // Remove IE's autoinserted <tbody> from table fragments 4645 if ( !support.tbody ) { 4646 4647 // String was a <table>, *may* have spurious <tbody> 4648 elem = tag === "table" && !rtbody.test( elem ) ? 4649 tmp.firstChild : 4650 4651 // String was a bare <thead> or <tfoot> 4652 wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ? 4653 tmp : 4654 0; 4655 4656 j = elem && elem.childNodes.length; 4657 while ( j-- ) { 4658 if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && 4659 !tbody.childNodes.length ) { 4660 4661 elem.removeChild( tbody ); 4662 } 4663 } 4664 } 4665 4666 jQuery.merge( nodes, tmp.childNodes ); 4667 4668 // Fix #12392 for WebKit and IE > 9 4669 tmp.textContent = ""; 4670 4671 // Fix #12392 for oldIE 4672 while ( tmp.firstChild ) { 4673 tmp.removeChild( tmp.firstChild ); 4674 } 4675 4676 // Remember the top-level container for proper cleanup 4677 tmp = safe.lastChild; 4678 } 4679 } 4680 } 4681 4682 // Fix #11356: Clear elements from fragment 4683 if ( tmp ) { 4684 safe.removeChild( tmp ); 4685 } 4686 4687 // Reset defaultChecked for any radios and checkboxes 4688 // about to be appended to the DOM in IE 6/7 (#8060) 4689 if ( !support.appendChecked ) { 4690 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); 4691 } 4692 4693 i = 0; 4694 while ( ( elem = nodes[ i++ ] ) ) { 4695 4696 // Skip elements already in the context collection (trac-4087) 4697 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 4698 if ( ignored ) { 4699 ignored.push( elem ); 4700 } 4701 4702 continue; 4703 } 4704 4705 contains = jQuery.contains( elem.ownerDocument, elem ); 4706 4707 // Append to fragment 4708 tmp = getAll( safe.appendChild( elem ), "script" ); 4709 4710 // Preserve script evaluation history 4711 if ( contains ) { 4712 setGlobalEval( tmp ); 4713 } 4714 4715 // Capture executables 4716 if ( scripts ) { 4717 j = 0; 4718 while ( ( elem = tmp[ j++ ] ) ) { 4719 if ( rscriptType.test( elem.type || "" ) ) { 4720 scripts.push( elem ); 4721 } 4722 } 4723 } 4724 } 4725 4726 tmp = null; 4727 4728 return safe; 4729} 4730 4731 4732( function() { 4733 var i, eventName, 4734 div = document.createElement( "div" ); 4735 4736 // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) 4737 for ( i in { submit: true, change: true, focusin: true } ) { 4738 eventName = "on" + i; 4739 4740 if ( !( support[ i ] = eventName in window ) ) { 4741 4742 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) 4743 div.setAttribute( eventName, "t" ); 4744 support[ i ] = div.attributes[ eventName ].expando === false; 4745 } 4746 } 4747 4748 // Null elements to avoid leaks in IE. 4749 div = null; 4750} )(); 4751 4752 4753var rformElems = /^(?:input|select|textarea)$/i, 4754 rkeyEvent = /^key/, 4755 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 4756 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 4757 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 4758 4759function returnTrue() { 4760 return true; 4761} 4762 4763function returnFalse() { 4764 return false; 4765} 4766 4767// Support: IE9 4768// See #13393 for more info 4769function safeActiveElement() { 4770 try { 4771 return document.activeElement; 4772 } catch ( err ) { } 4773} 4774 4775function on( elem, types, selector, data, fn, one ) { 4776 var origFn, type; 4777 4778 // Types can be a map of types/handlers 4779 if ( typeof types === "object" ) { 4780 4781 // ( types-Object, selector, data ) 4782 if ( typeof selector !== "string" ) { 4783 4784 // ( types-Object, data ) 4785 data = data || selector; 4786 selector = undefined; 4787 } 4788 for ( type in types ) { 4789 on( elem, type, selector, data, types[ type ], one ); 4790 } 4791 return elem; 4792 } 4793 4794 if ( data == null && fn == null ) { 4795 4796 // ( types, fn ) 4797 fn = selector; 4798 data = selector = undefined; 4799 } else if ( fn == null ) { 4800 if ( typeof selector === "string" ) { 4801 4802 // ( types, selector, fn ) 4803 fn = data; 4804 data = undefined; 4805 } else { 4806 4807 // ( types, data, fn ) 4808 fn = data; 4809 data = selector; 4810 selector = undefined; 4811 } 4812 } 4813 if ( fn === false ) { 4814 fn = returnFalse; 4815 } else if ( !fn ) { 4816 return elem; 4817 } 4818 4819 if ( one === 1 ) { 4820 origFn = fn; 4821 fn = function( event ) { 4822 4823 // Can use an empty set, since event contains the info 4824 jQuery().off( event ); 4825 return origFn.apply( this, arguments ); 4826 }; 4827 4828 // Use same guid so caller can remove using origFn 4829 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 4830 } 4831 return elem.each( function() { 4832 jQuery.event.add( this, types, fn, data, selector ); 4833 } ); 4834} 4835 4836/* 4837 * Helper functions for managing events -- not part of the public interface. 4838 * Props to Dean Edwards' addEvent library for many of the ideas. 4839 */ 4840jQuery.event = { 4841 4842 global: {}, 4843 4844 add: function( elem, types, handler, data, selector ) { 4845 var tmp, events, t, handleObjIn, 4846 special, eventHandle, handleObj, 4847 handlers, type, namespaces, origType, 4848 elemData = jQuery._data( elem ); 4849 4850 // Don't attach events to noData or text/comment nodes (but allow plain objects) 4851 if ( !elemData ) { 4852 return; 4853 } 4854 4855 // Caller can pass in an object of custom data in lieu of the handler 4856 if ( handler.handler ) { 4857 handleObjIn = handler; 4858 handler = handleObjIn.handler; 4859 selector = handleObjIn.selector; 4860 } 4861 4862 // Make sure that the handler has a unique ID, used to find/remove it later 4863 if ( !handler.guid ) { 4864 handler.guid = jQuery.guid++; 4865 } 4866 4867 // Init the element's event structure and main handler, if this is the first 4868 if ( !( events = elemData.events ) ) { 4869 events = elemData.events = {}; 4870 } 4871 if ( !( eventHandle = elemData.handle ) ) { 4872 eventHandle = elemData.handle = function( e ) { 4873 4874 // Discard the second event of a jQuery.event.trigger() and 4875 // when an event is called after a page has unloaded 4876 return typeof jQuery !== "undefined" && 4877 ( !e || jQuery.event.triggered !== e.type ) ? 4878 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : 4879 undefined; 4880 }; 4881 4882 // Add elem as a property of the handle fn to prevent a memory leak 4883 // with IE non-native events 4884 eventHandle.elem = elem; 4885 } 4886 4887 // Handle multiple events separated by a space 4888 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4889 t = types.length; 4890 while ( t-- ) { 4891 tmp = rtypenamespace.exec( types[ t ] ) || []; 4892 type = origType = tmp[ 1 ]; 4893 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4894 4895 // There *must* be a type, no attaching namespace-only handlers 4896 if ( !type ) { 4897 continue; 4898 } 4899 4900 // If event changes its type, use the special event handlers for the changed type 4901 special = jQuery.event.special[ type ] || {}; 4902 4903 // If selector defined, determine special event api type, otherwise given type 4904 type = ( selector ? special.delegateType : special.bindType ) || type; 4905 4906 // Update special based on newly reset type 4907 special = jQuery.event.special[ type ] || {}; 4908 4909 // handleObj is passed to all event handlers 4910 handleObj = jQuery.extend( { 4911 type: type, 4912 origType: origType, 4913 data: data, 4914 handler: handler, 4915 guid: handler.guid, 4916 selector: selector, 4917 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 4918 namespace: namespaces.join( "." ) 4919 }, handleObjIn ); 4920 4921 // Init the event handler queue if we're the first 4922 if ( !( handlers = events[ type ] ) ) { 4923 handlers = events[ type ] = []; 4924 handlers.delegateCount = 0; 4925 4926 // Only use addEventListener/attachEvent if the special events handler returns false 4927 if ( !special.setup || 4928 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 4929 4930 // Bind the global event handler to the element 4931 if ( elem.addEventListener ) { 4932 elem.addEventListener( type, eventHandle, false ); 4933 4934 } else if ( elem.attachEvent ) { 4935 elem.attachEvent( "on" + type, eventHandle ); 4936 } 4937 } 4938 } 4939 4940 if ( special.add ) { 4941 special.add.call( elem, handleObj ); 4942 4943 if ( !handleObj.handler.guid ) { 4944 handleObj.handler.guid = handler.guid; 4945 } 4946 } 4947 4948 // Add to the element's handler list, delegates in front 4949 if ( selector ) { 4950 handlers.splice( handlers.delegateCount++, 0, handleObj ); 4951 } else { 4952 handlers.push( handleObj ); 4953 } 4954 4955 // Keep track of which events have ever been used, for event optimization 4956 jQuery.event.global[ type ] = true; 4957 } 4958 4959 // Nullify elem to prevent memory leaks in IE 4960 elem = null; 4961 }, 4962 4963 // Detach an event or set of events from an element 4964 remove: function( elem, types, handler, selector, mappedTypes ) { 4965 var j, handleObj, tmp, 4966 origCount, t, events, 4967 special, handlers, type, 4968 namespaces, origType, 4969 elemData = jQuery.hasData( elem ) && jQuery._data( elem ); 4970 4971 if ( !elemData || !( events = elemData.events ) ) { 4972 return; 4973 } 4974 4975 // Once for each type.namespace in types; type may be omitted 4976 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4977 t = types.length; 4978 while ( t-- ) { 4979 tmp = rtypenamespace.exec( types[ t ] ) || []; 4980 type = origType = tmp[ 1 ]; 4981 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4982 4983 // Unbind all events (on this namespace, if provided) for the element 4984 if ( !type ) { 4985 for ( type in events ) { 4986 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 4987 } 4988 continue; 4989 } 4990 4991 special = jQuery.event.special[ type ] || {}; 4992 type = ( selector ? special.delegateType : special.bindType ) || type; 4993 handlers = events[ type ] || []; 4994 tmp = tmp[ 2 ] && 4995 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 4996 4997 // Remove matching events 4998 origCount = j = handlers.length; 4999 while ( j-- ) { 5000 handleObj = handlers[ j ]; 5001 5002 if ( ( mappedTypes || origType === handleObj.origType ) && 5003 ( !handler || handler.guid === handleObj.guid ) && 5004 ( !tmp || tmp.test( handleObj.namespace ) ) && 5005 ( !selector || selector === handleObj.selector || 5006 selector === "**" && handleObj.selector ) ) { 5007 handlers.splice( j, 1 ); 5008 5009 if ( handleObj.selector ) { 5010 handlers.delegateCount--; 5011 } 5012 if ( special.remove ) { 5013 special.remove.call( elem, handleObj ); 5014 } 5015 } 5016 } 5017 5018 // Remove generic event handler if we removed something and no more handlers exist 5019 // (avoids potential for endless recursion during removal of special event handlers) 5020 if ( origCount && !handlers.length ) { 5021 if ( !special.teardown || 5022 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 5023 5024 jQuery.removeEvent( elem, type, elemData.handle ); 5025 } 5026 5027 delete events[ type ]; 5028 } 5029 } 5030 5031 // Remove the expando if it's no longer used 5032 if ( jQuery.isEmptyObject( events ) ) { 5033 delete elemData.handle; 5034 5035 // removeData also checks for emptiness and clears the expando if empty 5036 // so use it instead of delete 5037 jQuery._removeData( elem, "events" ); 5038 } 5039 }, 5040 5041 trigger: function( event, data, elem, onlyHandlers ) { 5042 var handle, ontype, cur, 5043 bubbleType, special, tmp, i, 5044 eventPath = [ elem || document ], 5045 type = hasOwn.call( event, "type" ) ? event.type : event, 5046 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 5047 5048 cur = tmp = elem = elem || document; 5049 5050 // Don't do events on text and comment nodes 5051 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 5052 return; 5053 } 5054 5055 // focus/blur morphs to focusin/out; ensure we're not firing them right now 5056 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 5057 return; 5058 } 5059 5060 if ( type.indexOf( "." ) > -1 ) { 5061 5062 // Namespaced trigger; create a regexp to match event type in handle() 5063 namespaces = type.split( "." ); 5064 type = namespaces.shift(); 5065 namespaces.sort(); 5066 } 5067 ontype = type.indexOf( ":" ) < 0 && "on" + type; 5068 5069 // Caller can pass in a jQuery.Event object, Object, or just an event type string 5070 event = event[ jQuery.expando ] ? 5071 event : 5072 new jQuery.Event( type, typeof event === "object" && event ); 5073 5074 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 5075 event.isTrigger = onlyHandlers ? 2 : 3; 5076 event.namespace = namespaces.join( "." ); 5077 event.rnamespace = event.namespace ? 5078 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 5079 null; 5080 5081 // Clean up the event in case it is being reused 5082 event.result = undefined; 5083 if ( !event.target ) { 5084 event.target = elem; 5085 } 5086 5087 // Clone any incoming data and prepend the event, creating the handler arg list 5088 data = data == null ? 5089 [ event ] : 5090 jQuery.makeArray( data, [ event ] ); 5091 5092 // Allow special events to draw outside the lines 5093 special = jQuery.event.special[ type ] || {}; 5094 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 5095 return; 5096 } 5097 5098 // Determine event propagation path in advance, per W3C events spec (#9951) 5099 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 5100 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 5101 5102 bubbleType = special.delegateType || type; 5103 if ( !rfocusMorph.test( bubbleType + type ) ) { 5104 cur = cur.parentNode; 5105 } 5106 for ( ; cur; cur = cur.parentNode ) { 5107 eventPath.push( cur ); 5108 tmp = cur; 5109 } 5110 5111 // Only add window if we got to document (e.g., not plain obj or detached DOM) 5112 if ( tmp === ( elem.ownerDocument || document ) ) { 5113 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 5114 } 5115 } 5116 5117 // Fire handlers on the event path 5118 i = 0; 5119 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 5120 5121 event.type = i > 1 ? 5122 bubbleType : 5123 special.bindType || type; 5124 5125 // jQuery handler 5126 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && 5127 jQuery._data( cur, "handle" ); 5128 5129 if ( handle ) { 5130 handle.apply( cur, data ); 5131 } 5132 5133 // Native handler 5134 handle = ontype && cur[ ontype ]; 5135 if ( handle && handle.apply && acceptData( cur ) ) { 5136 event.result = handle.apply( cur, data ); 5137 if ( event.result === false ) { 5138 event.preventDefault(); 5139 } 5140 } 5141 } 5142 event.type = type; 5143 5144 // If nobody prevented the default action, do it now 5145 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 5146 5147 if ( 5148 ( !special._default || 5149 special._default.apply( eventPath.pop(), data ) === false 5150 ) && acceptData( elem ) 5151 ) { 5152 5153 // Call a native DOM method on the target with the same name name as the event. 5154 // Can't use an .isFunction() check here because IE6/7 fails that test. 5155 // Don't do default actions on window, that's where global variables be (#6170) 5156 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { 5157 5158 // Don't re-trigger an onFOO event when we call its FOO() method 5159 tmp = elem[ ontype ]; 5160 5161 if ( tmp ) { 5162 elem[ ontype ] = null; 5163 } 5164 5165 // Prevent re-triggering of the same event, since we already bubbled it above 5166 jQuery.event.triggered = type; 5167 try { 5168 elem[ type ](); 5169 } catch ( e ) { 5170 5171 // IE<9 dies on focus/blur to hidden element (#1486,#12518) 5172 // only reproducible on winXP IE8 native, not IE9 in IE8 mode 5173 } 5174 jQuery.event.triggered = undefined; 5175 5176 if ( tmp ) { 5177 elem[ ontype ] = tmp; 5178 } 5179 } 5180 } 5181 } 5182 5183 return event.result; 5184 }, 5185 5186 dispatch: function( event ) { 5187 5188 // Make a writable jQuery.Event from the native event object 5189 event = jQuery.event.fix( event ); 5190 5191 var i, j, ret, matched, handleObj, 5192 handlerQueue = [], 5193 args = slice.call( arguments ), 5194 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], 5195 special = jQuery.event.special[ event.type ] || {}; 5196 5197 // Use the fix-ed jQuery.Event rather than the (read-only) native event 5198 args[ 0 ] = event; 5199 event.delegateTarget = this; 5200 5201 // Call the preDispatch hook for the mapped type, and let it bail if desired 5202 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 5203 return; 5204 } 5205 5206 // Determine handlers 5207 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 5208 5209 // Run delegates first; they may want to stop propagation beneath us 5210 i = 0; 5211 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 5212 event.currentTarget = matched.elem; 5213 5214 j = 0; 5215 while ( ( handleObj = matched.handlers[ j++ ] ) && 5216 !event.isImmediatePropagationStopped() ) { 5217 5218 // Triggered event must either 1) have no namespace, or 2) have namespace(s) 5219 // a subset or equal to those in the bound event (both can have no namespace). 5220 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { 5221 5222 event.handleObj = handleObj; 5223 event.data = handleObj.data; 5224 5225 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 5226 handleObj.handler ).apply( matched.elem, args ); 5227 5228 if ( ret !== undefined ) { 5229 if ( ( event.result = ret ) === false ) { 5230 event.preventDefault(); 5231 event.stopPropagation(); 5232 } 5233 } 5234 } 5235 } 5236 } 5237 5238 // Call the postDispatch hook for the mapped type 5239 if ( special.postDispatch ) { 5240 special.postDispatch.call( this, event ); 5241 } 5242 5243 return event.result; 5244 }, 5245 5246 handlers: function( event, handlers ) { 5247 var i, matches, sel, handleObj, 5248 handlerQueue = [], 5249 delegateCount = handlers.delegateCount, 5250 cur = event.target; 5251 5252 // Support (at least): Chrome, IE9 5253 // Find delegate handlers 5254 // Black-hole SVG <use> instance trees (#13180) 5255 // 5256 // Support: Firefox<=42+ 5257 // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) 5258 if ( delegateCount && cur.nodeType && 5259 ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { 5260 5261 /* jshint eqeqeq: false */ 5262 for ( ; cur != this; cur = cur.parentNode || this ) { 5263 /* jshint eqeqeq: true */ 5264 5265 // Don't check non-elements (#13208) 5266 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 5267 if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { 5268 matches = []; 5269 for ( i = 0; i < delegateCount; i++ ) { 5270 handleObj = handlers[ i ]; 5271 5272 // Don't conflict with Object.prototype properties (#13203) 5273 sel = handleObj.selector + " "; 5274 5275 if ( matches[ sel ] === undefined ) { 5276 matches[ sel ] = handleObj.needsContext ? 5277 jQuery( sel, this ).index( cur ) > -1 : 5278 jQuery.find( sel, this, null, [ cur ] ).length; 5279 } 5280 if ( matches[ sel ] ) { 5281 matches.push( handleObj ); 5282 } 5283 } 5284 if ( matches.length ) { 5285 handlerQueue.push( { elem: cur, handlers: matches } ); 5286 } 5287 } 5288 } 5289 } 5290 5291 // Add the remaining (directly-bound) handlers 5292 if ( delegateCount < handlers.length ) { 5293 handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); 5294 } 5295 5296 return handlerQueue; 5297 }, 5298 5299 fix: function( event ) { 5300 if ( event[ jQuery.expando ] ) { 5301 return event; 5302 } 5303 5304 // Create a writable copy of the event object and normalize some properties 5305 var i, prop, copy, 5306 type = event.type, 5307 originalEvent = event, 5308 fixHook = this.fixHooks[ type ]; 5309 5310 if ( !fixHook ) { 5311 this.fixHooks[ type ] = fixHook = 5312 rmouseEvent.test( type ) ? this.mouseHooks : 5313 rkeyEvent.test( type ) ? this.keyHooks : 5314 {}; 5315 } 5316 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 5317 5318 event = new jQuery.Event( originalEvent ); 5319 5320 i = copy.length; 5321 while ( i-- ) { 5322 prop = copy[ i ]; 5323 event[ prop ] = originalEvent[ prop ]; 5324 } 5325 5326 // Support: IE<9 5327 // Fix target property (#1925) 5328 if ( !event.target ) { 5329 event.target = originalEvent.srcElement || document; 5330 } 5331 5332 // Support: Safari 6-8+ 5333 // Target should not be a text node (#504, #13143) 5334 if ( event.target.nodeType === 3 ) { 5335 event.target = event.target.parentNode; 5336 } 5337 5338 // Support: IE<9 5339 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) 5340 event.metaKey = !!event.metaKey; 5341 5342 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 5343 }, 5344 5345 // Includes some event props shared by KeyEvent and MouseEvent 5346 props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + 5347 "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), 5348 5349 fixHooks: {}, 5350 5351 keyHooks: { 5352 props: "char charCode key keyCode".split( " " ), 5353 filter: function( event, original ) { 5354 5355 // Add which for key events 5356 if ( event.which == null ) { 5357 event.which = original.charCode != null ? original.charCode : original.keyCode; 5358 } 5359 5360 return event; 5361 } 5362 }, 5363 5364 mouseHooks: { 5365 props: ( "button buttons clientX clientY fromElement offsetX offsetY " + 5366 "pageX pageY screenX screenY toElement" ).split( " " ), 5367 filter: function( event, original ) { 5368 var body, eventDoc, doc, 5369 button = original.button, 5370 fromElement = original.fromElement; 5371 5372 // Calculate pageX/Y if missing and clientX/Y available 5373 if ( event.pageX == null && original.clientX != null ) { 5374 eventDoc = event.target.ownerDocument || document; 5375 doc = eventDoc.documentElement; 5376 body = eventDoc.body; 5377 5378 event.pageX = original.clientX + 5379 ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - 5380 ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 5381 event.pageY = original.clientY + 5382 ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - 5383 ( doc && doc.clientTop || body && body.clientTop || 0 ); 5384 } 5385 5386 // Add relatedTarget, if necessary 5387 if ( !event.relatedTarget && fromElement ) { 5388 event.relatedTarget = fromElement === event.target ? 5389 original.toElement : 5390 fromElement; 5391 } 5392 5393 // Add which for click: 1 === left; 2 === middle; 3 === right 5394 // Note: button is not normalized, so don't use it 5395 if ( !event.which && button !== undefined ) { 5396 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 5397 } 5398 5399 return event; 5400 } 5401 }, 5402 5403 special: { 5404 load: { 5405 5406 // Prevent triggered image.load events from bubbling to window.load 5407 noBubble: true 5408 }, 5409 focus: { 5410 5411 // Fire native event if possible so blur/focus sequence is correct 5412 trigger: function() { 5413 if ( this !== safeActiveElement() && this.focus ) { 5414 try { 5415 this.focus(); 5416 return false; 5417 } catch ( e ) { 5418 5419 // Support: IE<9 5420 // If we error on focus to hidden element (#1486, #12518), 5421 // let .trigger() run the handlers 5422 } 5423 } 5424 }, 5425 delegateType: "focusin" 5426 }, 5427 blur: { 5428 trigger: function() { 5429 if ( this === safeActiveElement() && this.blur ) { 5430 this.blur(); 5431 return false; 5432 } 5433 }, 5434 delegateType: "focusout" 5435 }, 5436 click: { 5437 5438 // For checkbox, fire native event so checked state will be right 5439 trigger: function() { 5440 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { 5441 this.click(); 5442 return false; 5443 } 5444 }, 5445 5446 // For cross-browser consistency, don't fire native .click() on links 5447 _default: function( event ) { 5448 return jQuery.nodeName( event.target, "a" ); 5449 } 5450 }, 5451 5452 beforeunload: { 5453 postDispatch: function( event ) { 5454 5455 // Support: Firefox 20+ 5456 // Firefox doesn't alert if the returnValue field is not set. 5457 if ( event.result !== undefined && event.originalEvent ) { 5458 event.originalEvent.returnValue = event.result; 5459 } 5460 } 5461 } 5462 }, 5463 5464 // Piggyback on a donor event to simulate a different one 5465 simulate: function( type, elem, event ) { 5466 var e = jQuery.extend( 5467 new jQuery.Event(), 5468 event, 5469 { 5470 type: type, 5471 isSimulated: true 5472 5473 // Previously, `originalEvent: {}` was set here, so stopPropagation call 5474 // would not be triggered on donor event, since in our own 5475 // jQuery.event.stopPropagation function we had a check for existence of 5476 // originalEvent.stopPropagation method, so, consequently it would be a noop. 5477 // 5478 // Guard for simulated events was moved to jQuery.event.stopPropagation function 5479 // since `originalEvent` should point to the original event for the 5480 // constancy with other events and for more focused logic 5481 } 5482 ); 5483 5484 jQuery.event.trigger( e, null, elem ); 5485 5486 if ( e.isDefaultPrevented() ) { 5487 event.preventDefault(); 5488 } 5489 } 5490}; 5491 5492jQuery.removeEvent = document.removeEventListener ? 5493 function( elem, type, handle ) { 5494 5495 // This "if" is needed for plain objects 5496 if ( elem.removeEventListener ) { 5497 elem.removeEventListener( type, handle ); 5498 } 5499 } : 5500 function( elem, type, handle ) { 5501 var name = "on" + type; 5502 5503 if ( elem.detachEvent ) { 5504 5505 // #8545, #7054, preventing memory leaks for custom events in IE6-8 5506 // detachEvent needed property on element, by name of that event, 5507 // to properly expose it to GC 5508 if ( typeof elem[ name ] === "undefined" ) { 5509 elem[ name ] = null; 5510 } 5511 5512 elem.detachEvent( name, handle ); 5513 } 5514 }; 5515 5516jQuery.Event = function( src, props ) { 5517 5518 // Allow instantiation without the 'new' keyword 5519 if ( !( this instanceof jQuery.Event ) ) { 5520 return new jQuery.Event( src, props ); 5521 } 5522 5523 // Event object 5524 if ( src && src.type ) { 5525 this.originalEvent = src; 5526 this.type = src.type; 5527 5528 // Events bubbling up the document may have been marked as prevented 5529 // by a handler lower down the tree; reflect the correct value. 5530 this.isDefaultPrevented = src.defaultPrevented || 5531 src.defaultPrevented === undefined && 5532 5533 // Support: IE < 9, Android < 4.0 5534 src.returnValue === false ? 5535 returnTrue : 5536 returnFalse; 5537 5538 // Event type 5539 } else { 5540 this.type = src; 5541 } 5542 5543 // Put explicitly provided properties onto the event object 5544 if ( props ) { 5545 jQuery.extend( this, props ); 5546 } 5547 5548 // Create a timestamp if incoming event doesn't have one 5549 this.timeStamp = src && src.timeStamp || jQuery.now(); 5550 5551 // Mark it as fixed 5552 this[ jQuery.expando ] = true; 5553}; 5554 5555// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 5556// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 5557jQuery.Event.prototype = { 5558 constructor: jQuery.Event, 5559 isDefaultPrevented: returnFalse, 5560 isPropagationStopped: returnFalse, 5561 isImmediatePropagationStopped: returnFalse, 5562 5563 preventDefault: function() { 5564 var e = this.originalEvent; 5565 5566 this.isDefaultPrevented = returnTrue; 5567 if ( !e ) { 5568 return; 5569 } 5570 5571 // If preventDefault exists, run it on the original event 5572 if ( e.preventDefault ) { 5573 e.preventDefault(); 5574 5575 // Support: IE 5576 // Otherwise set the returnValue property of the original event to false 5577 } else { 5578 e.returnValue = false; 5579 } 5580 }, 5581 stopPropagation: function() { 5582 var e = this.originalEvent; 5583 5584 this.isPropagationStopped = returnTrue; 5585 5586 if ( !e || this.isSimulated ) { 5587 return; 5588 } 5589 5590 // If stopPropagation exists, run it on the original event 5591 if ( e.stopPropagation ) { 5592 e.stopPropagation(); 5593 } 5594 5595 // Support: IE 5596 // Set the cancelBubble property of the original event to true 5597 e.cancelBubble = true; 5598 }, 5599 stopImmediatePropagation: function() { 5600 var e = this.originalEvent; 5601 5602 this.isImmediatePropagationStopped = returnTrue; 5603 5604 if ( e && e.stopImmediatePropagation ) { 5605 e.stopImmediatePropagation(); 5606 } 5607 5608 this.stopPropagation(); 5609 } 5610}; 5611 5612// Create mouseenter/leave events using mouseover/out and event-time checks 5613// so that event delegation works in jQuery. 5614// Do the same for pointerenter/pointerleave and pointerover/pointerout 5615// 5616// Support: Safari 7 only 5617// Safari sends mouseenter too often; see: 5618// https://code.google.com/p/chromium/issues/detail?id=470258 5619// for the description of the bug (it existed in older Chrome versions as well). 5620jQuery.each( { 5621 mouseenter: "mouseover", 5622 mouseleave: "mouseout", 5623 pointerenter: "pointerover", 5624 pointerleave: "pointerout" 5625}, function( orig, fix ) { 5626 jQuery.event.special[ orig ] = { 5627 delegateType: fix, 5628 bindType: fix, 5629 5630 handle: function( event ) { 5631 var ret, 5632 target = this, 5633 related = event.relatedTarget, 5634 handleObj = event.handleObj; 5635 5636 // For mouseenter/leave call the handler if related is outside the target. 5637 // NB: No relatedTarget if the mouse left/entered the browser window 5638 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 5639 event.type = handleObj.origType; 5640 ret = handleObj.handler.apply( this, arguments ); 5641 event.type = fix; 5642 } 5643 return ret; 5644 } 5645 }; 5646} ); 5647 5648// IE submit delegation 5649if ( !support.submit ) { 5650 5651 jQuery.event.special.submit = { 5652 setup: function() { 5653 5654 // Only need this for delegated form submit events 5655 if ( jQuery.nodeName( this, "form" ) ) { 5656 return false; 5657 } 5658 5659 // Lazy-add a submit handler when a descendant form may potentially be submitted 5660 jQuery.event.add( this, "click._submit keypress._submit", function( e ) { 5661 5662 // Node name check avoids a VML-related crash in IE (#9807) 5663 var elem = e.target, 5664 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? 5665 5666 // Support: IE <=8 5667 // We use jQuery.prop instead of elem.form 5668 // to allow fixing the IE8 delegated submit issue (gh-2332) 5669 // by 3rd party polyfills/workarounds. 5670 jQuery.prop( elem, "form" ) : 5671 undefined; 5672 5673 if ( form && !jQuery._data( form, "submit" ) ) { 5674 jQuery.event.add( form, "submit._submit", function( event ) { 5675 event._submitBubble = true; 5676 } ); 5677 jQuery._data( form, "submit", true ); 5678 } 5679 } ); 5680 5681 // return undefined since we don't need an event listener 5682 }, 5683 5684 postDispatch: function( event ) { 5685 5686 // If form was submitted by the user, bubble the event up the tree 5687 if ( event._submitBubble ) { 5688 delete event._submitBubble; 5689 if ( this.parentNode && !event.isTrigger ) { 5690 jQuery.event.simulate( "submit", this.parentNode, event ); 5691 } 5692 } 5693 }, 5694 5695 teardown: function() { 5696 5697 // Only need this for delegated form submit events 5698 if ( jQuery.nodeName( this, "form" ) ) { 5699 return false; 5700 } 5701 5702 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above 5703 jQuery.event.remove( this, "._submit" ); 5704 } 5705 }; 5706} 5707 5708// IE change delegation and checkbox/radio fix 5709if ( !support.change ) { 5710 5711 jQuery.event.special.change = { 5712 5713 setup: function() { 5714 5715 if ( rformElems.test( this.nodeName ) ) { 5716 5717 // IE doesn't fire change on a check/radio until blur; trigger it on click 5718 // after a propertychange. Eat the blur-change in special.change.handle. 5719 // This still fires onchange a second time for check/radio after blur. 5720 if ( this.type === "checkbox" || this.type === "radio" ) { 5721 jQuery.event.add( this, "propertychange._change", function( event ) { 5722 if ( event.originalEvent.propertyName === "checked" ) { 5723 this._justChanged = true; 5724 } 5725 } ); 5726 jQuery.event.add( this, "click._change", function( event ) { 5727 if ( this._justChanged && !event.isTrigger ) { 5728 this._justChanged = false; 5729 } 5730 5731 // Allow triggered, simulated change events (#11500) 5732 jQuery.event.simulate( "change", this, event ); 5733 } ); 5734 } 5735 return false; 5736 } 5737 5738 // Delegated event; lazy-add a change handler on descendant inputs 5739 jQuery.event.add( this, "beforeactivate._change", function( e ) { 5740 var elem = e.target; 5741 5742 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { 5743 jQuery.event.add( elem, "change._change", function( event ) { 5744 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { 5745 jQuery.event.simulate( "change", this.parentNode, event ); 5746 } 5747 } ); 5748 jQuery._data( elem, "change", true ); 5749 } 5750 } ); 5751 }, 5752 5753 handle: function( event ) { 5754 var elem = event.target; 5755 5756 // Swallow native change events from checkbox/radio, we already triggered them above 5757 if ( this !== elem || event.isSimulated || event.isTrigger || 5758 ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { 5759 5760 return event.handleObj.handler.apply( this, arguments ); 5761 } 5762 }, 5763 5764 teardown: function() { 5765 jQuery.event.remove( this, "._change" ); 5766 5767 return !rformElems.test( this.nodeName ); 5768 } 5769 }; 5770} 5771 5772// Support: Firefox 5773// Firefox doesn't have focus(in | out) events 5774// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 5775// 5776// Support: Chrome, Safari 5777// focus(in | out) events fire after focus & blur events, 5778// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 5779// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 5780if ( !support.focusin ) { 5781 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 5782 5783 // Attach a single capturing handler on the document while someone wants focusin/focusout 5784 var handler = function( event ) { 5785 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 5786 }; 5787 5788 jQuery.event.special[ fix ] = { 5789 setup: function() { 5790 var doc = this.ownerDocument || this, 5791 attaches = jQuery._data( doc, fix ); 5792 5793 if ( !attaches ) { 5794 doc.addEventListener( orig, handler, true ); 5795 } 5796 jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); 5797 }, 5798 teardown: function() { 5799 var doc = this.ownerDocument || this, 5800 attaches = jQuery._data( doc, fix ) - 1; 5801 5802 if ( !attaches ) { 5803 doc.removeEventListener( orig, handler, true ); 5804 jQuery._removeData( doc, fix ); 5805 } else { 5806 jQuery._data( doc, fix, attaches ); 5807 } 5808 } 5809 }; 5810 } ); 5811} 5812 5813jQuery.fn.extend( { 5814 5815 on: function( types, selector, data, fn ) { 5816 return on( this, types, selector, data, fn ); 5817 }, 5818 one: function( types, selector, data, fn ) { 5819 return on( this, types, selector, data, fn, 1 ); 5820 }, 5821 off: function( types, selector, fn ) { 5822 var handleObj, type; 5823 if ( types && types.preventDefault && types.handleObj ) { 5824 5825 // ( event ) dispatched jQuery.Event 5826 handleObj = types.handleObj; 5827 jQuery( types.delegateTarget ).off( 5828 handleObj.namespace ? 5829 handleObj.origType + "." + handleObj.namespace : 5830 handleObj.origType, 5831 handleObj.selector, 5832 handleObj.handler 5833 ); 5834 return this; 5835 } 5836 if ( typeof types === "object" ) { 5837 5838 // ( types-object [, selector] ) 5839 for ( type in types ) { 5840 this.off( type, selector, types[ type ] ); 5841 } 5842 return this; 5843 } 5844 if ( selector === false || typeof selector === "function" ) { 5845 5846 // ( types [, fn] ) 5847 fn = selector; 5848 selector = undefined; 5849 } 5850 if ( fn === false ) { 5851 fn = returnFalse; 5852 } 5853 return this.each( function() { 5854 jQuery.event.remove( this, types, fn, selector ); 5855 } ); 5856 }, 5857 5858 trigger: function( type, data ) { 5859 return this.each( function() { 5860 jQuery.event.trigger( type, data, this ); 5861 } ); 5862 }, 5863 triggerHandler: function( type, data ) { 5864 var elem = this[ 0 ]; 5865 if ( elem ) { 5866 return jQuery.event.trigger( type, data, elem, true ); 5867 } 5868 } 5869} ); 5870 5871 5872var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, 5873 rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), 5874 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, 5875 5876 // Support: IE 10-11, Edge 10240+ 5877 // In IE/Edge using regex groups here causes severe slowdowns. 5878 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 5879 rnoInnerhtml = /<script|<style|<link/i, 5880 5881 // checked="checked" or checked 5882 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5883 rscriptTypeMasked = /^true\/(.*)/, 5884 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, 5885 safeFragment = createSafeFragment( document ), 5886 fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); 5887 5888// Support: IE<8 5889// Manipulating tables requires a tbody 5890function manipulationTarget( elem, content ) { 5891 return jQuery.nodeName( elem, "table" ) && 5892 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? 5893 5894 elem.getElementsByTagName( "tbody" )[ 0 ] || 5895 elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : 5896 elem; 5897} 5898 5899// Replace/restore the type attribute of script elements for safe DOM manipulation 5900function disableScript( elem ) { 5901 elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; 5902 return elem; 5903} 5904function restoreScript( elem ) { 5905 var match = rscriptTypeMasked.exec( elem.type ); 5906 if ( match ) { 5907 elem.type = match[ 1 ]; 5908 } else { 5909 elem.removeAttribute( "type" ); 5910 } 5911 return elem; 5912} 5913 5914function cloneCopyEvent( src, dest ) { 5915 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { 5916 return; 5917 } 5918 5919 var type, i, l, 5920 oldData = jQuery._data( src ), 5921 curData = jQuery._data( dest, oldData ), 5922 events = oldData.events; 5923 5924 if ( events ) { 5925 delete curData.handle; 5926 curData.events = {}; 5927 5928 for ( type in events ) { 5929 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 5930 jQuery.event.add( dest, type, events[ type ][ i ] ); 5931 } 5932 } 5933 } 5934 5935 // make the cloned public data object a copy from the original 5936 if ( curData.data ) { 5937 curData.data = jQuery.extend( {}, curData.data ); 5938 } 5939} 5940 5941function fixCloneNodeIssues( src, dest ) { 5942 var nodeName, e, data; 5943 5944 // We do not need to do anything for non-Elements 5945 if ( dest.nodeType !== 1 ) { 5946 return; 5947 } 5948 5949 nodeName = dest.nodeName.toLowerCase(); 5950 5951 // IE6-8 copies events bound via attachEvent when using cloneNode. 5952 if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { 5953 data = jQuery._data( dest ); 5954 5955 for ( e in data.events ) { 5956 jQuery.removeEvent( dest, e, data.handle ); 5957 } 5958 5959 // Event data gets referenced instead of copied if the expando gets copied too 5960 dest.removeAttribute( jQuery.expando ); 5961 } 5962 5963 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text 5964 if ( nodeName === "script" && dest.text !== src.text ) { 5965 disableScript( dest ).text = src.text; 5966 restoreScript( dest ); 5967 5968 // IE6-10 improperly clones children of object elements using classid. 5969 // IE10 throws NoModificationAllowedError if parent is null, #12132. 5970 } else if ( nodeName === "object" ) { 5971 if ( dest.parentNode ) { 5972 dest.outerHTML = src.outerHTML; 5973 } 5974 5975 // This path appears unavoidable for IE9. When cloning an object 5976 // element in IE9, the outerHTML strategy above is not sufficient. 5977 // If the src has innerHTML and the destination does not, 5978 // copy the src.innerHTML into the dest.innerHTML. #10324 5979 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { 5980 dest.innerHTML = src.innerHTML; 5981 } 5982 5983 } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 5984 5985 // IE6-8 fails to persist the checked state of a cloned checkbox 5986 // or radio button. Worse, IE6-7 fail to give the cloned element 5987 // a checked appearance if the defaultChecked value isn't also set 5988 5989 dest.defaultChecked = dest.checked = src.checked; 5990 5991 // IE6-7 get confused and end up setting the value of a cloned 5992 // checkbox/radio button to an empty string instead of "on" 5993 if ( dest.value !== src.value ) { 5994 dest.value = src.value; 5995 } 5996 5997 // IE6-8 fails to return the selected option to the default selected 5998 // state when cloning options 5999 } else if ( nodeName === "option" ) { 6000 dest.defaultSelected = dest.selected = src.defaultSelected; 6001 6002 // IE6-8 fails to set the defaultValue to the correct value when 6003 // cloning other types of input fields 6004 } else if ( nodeName === "input" || nodeName === "textarea" ) { 6005 dest.defaultValue = src.defaultValue; 6006 } 6007} 6008 6009function domManip( collection, args, callback, ignored ) { 6010 6011 // Flatten any nested arrays 6012 args = concat.apply( [], args ); 6013 6014 var first, node, hasScripts, 6015 scripts, doc, fragment, 6016 i = 0, 6017 l = collection.length, 6018 iNoClone = l - 1, 6019 value = args[ 0 ], 6020 isFunction = jQuery.isFunction( value ); 6021 6022 // We can't cloneNode fragments that contain checked, in WebKit 6023 if ( isFunction || 6024 ( l > 1 && typeof value === "string" && 6025 !support.checkClone && rchecked.test( value ) ) ) { 6026 return collection.each( function( index ) { 6027 var self = collection.eq( index ); 6028 if ( isFunction ) { 6029 args[ 0 ] = value.call( this, index, self.html() ); 6030 } 6031 domManip( self, args, callback, ignored ); 6032 } ); 6033 } 6034 6035 if ( l ) { 6036 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 6037 first = fragment.firstChild; 6038 6039 if ( fragment.childNodes.length === 1 ) { 6040 fragment = first; 6041 } 6042 6043 // Require either new content or an interest in ignored elements to invoke the callback 6044 if ( first || ignored ) { 6045 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 6046 hasScripts = scripts.length; 6047 6048 // Use the original fragment for the last item 6049 // instead of the first because it can end up 6050 // being emptied incorrectly in certain situations (#8070). 6051 for ( ; i < l; i++ ) { 6052 node = fragment; 6053 6054 if ( i !== iNoClone ) { 6055 node = jQuery.clone( node, true, true ); 6056 6057 // Keep references to cloned scripts for later restoration 6058 if ( hasScripts ) { 6059 6060 // Support: Android<4.1, PhantomJS<2 6061 // push.apply(_, arraylike) throws on ancient WebKit 6062 jQuery.merge( scripts, getAll( node, "script" ) ); 6063 } 6064 } 6065 6066 callback.call( collection[ i ], node, i ); 6067 } 6068 6069 if ( hasScripts ) { 6070 doc = scripts[ scripts.length - 1 ].ownerDocument; 6071 6072 // Reenable scripts 6073 jQuery.map( scripts, restoreScript ); 6074 6075 // Evaluate executable scripts on first document insertion 6076 for ( i = 0; i < hasScripts; i++ ) { 6077 node = scripts[ i ]; 6078 if ( rscriptType.test( node.type || "" ) && 6079 !jQuery._data( node, "globalEval" ) && 6080 jQuery.contains( doc, node ) ) { 6081 6082 if ( node.src ) { 6083 6084 // Optional AJAX dependency, but won't run scripts if not present 6085 if ( jQuery._evalUrl ) { 6086 jQuery._evalUrl( node.src ); 6087 } 6088 } else { 6089 jQuery.globalEval( 6090 ( node.text || node.textContent || node.innerHTML || "" ) 6091 .replace( rcleanScript, "" ) 6092 ); 6093 } 6094 } 6095 } 6096 } 6097 6098 // Fix #11809: Avoid leaking memory 6099 fragment = first = null; 6100 } 6101 } 6102 6103 return collection; 6104} 6105 6106function remove( elem, selector, keepData ) { 6107 var node, 6108 elems = selector ? jQuery.filter( selector, elem ) : elem, 6109 i = 0; 6110 6111 for ( ; ( node = elems[ i ] ) != null; i++ ) { 6112 6113 if ( !keepData && node.nodeType === 1 ) { 6114 jQuery.cleanData( getAll( node ) ); 6115 } 6116 6117 if ( node.parentNode ) { 6118 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { 6119 setGlobalEval( getAll( node, "script" ) ); 6120 } 6121 node.parentNode.removeChild( node ); 6122 } 6123 } 6124 6125 return elem; 6126} 6127 6128jQuery.extend( { 6129 htmlPrefilter: function( html ) { 6130 return html.replace( rxhtmlTag, "<$1></$2>" ); 6131 }, 6132 6133 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 6134 var destElements, node, clone, i, srcElements, 6135 inPage = jQuery.contains( elem.ownerDocument, elem ); 6136 6137 if ( support.html5Clone || jQuery.isXMLDoc( elem ) || 6138 !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { 6139 6140 clone = elem.cloneNode( true ); 6141 6142 // IE<=8 does not properly clone detached, unknown element nodes 6143 } else { 6144 fragmentDiv.innerHTML = elem.outerHTML; 6145 fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); 6146 } 6147 6148 if ( ( !support.noCloneEvent || !support.noCloneChecked ) && 6149 ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { 6150 6151 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 6152 destElements = getAll( clone ); 6153 srcElements = getAll( elem ); 6154 6155 // Fix all IE cloning issues 6156 for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { 6157 6158 // Ensure that the destination node is not null; Fixes #9587 6159 if ( destElements[ i ] ) { 6160 fixCloneNodeIssues( node, destElements[ i ] ); 6161 } 6162 } 6163 } 6164 6165 // Copy the events from the original to the clone 6166 if ( dataAndEvents ) { 6167 if ( deepDataAndEvents ) { 6168 srcElements = srcElements || getAll( elem ); 6169 destElements = destElements || getAll( clone ); 6170 6171 for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { 6172 cloneCopyEvent( node, destElements[ i ] ); 6173 } 6174 } else { 6175 cloneCopyEvent( elem, clone ); 6176 } 6177 } 6178 6179 // Preserve script evaluation history 6180 destElements = getAll( clone, "script" ); 6181 if ( destElements.length > 0 ) { 6182 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 6183 } 6184 6185 destElements = srcElements = node = null; 6186 6187 // Return the cloned set 6188 return clone; 6189 }, 6190 6191 cleanData: function( elems, /* internal */ forceAcceptData ) { 6192 var elem, type, id, data, 6193 i = 0, 6194 internalKey = jQuery.expando, 6195 cache = jQuery.cache, 6196 attributes = support.attributes, 6197 special = jQuery.event.special; 6198 6199 for ( ; ( elem = elems[ i ] ) != null; i++ ) { 6200 if ( forceAcceptData || acceptData( elem ) ) { 6201 6202 id = elem[ internalKey ]; 6203 data = id && cache[ id ]; 6204 6205 if ( data ) { 6206 if ( data.events ) { 6207 for ( type in data.events ) { 6208 if ( special[ type ] ) { 6209 jQuery.event.remove( elem, type ); 6210 6211 // This is a shortcut to avoid jQuery.event.remove's overhead 6212 } else { 6213 jQuery.removeEvent( elem, type, data.handle ); 6214 } 6215 } 6216 } 6217 6218 // Remove cache only if it was not already removed by jQuery.event.remove 6219 if ( cache[ id ] ) { 6220 6221 delete cache[ id ]; 6222
6223 // Support: IE<9 6224 // IE does not allow us to delete expando properties from nodes 6225 // IE creates expando attributes along with the property 6226 // IE does not have a removeAttribute function on Document nodes 6227 if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { 6228 elem.removeAttribute( internalKey ); 6229 6230 // Webkit & Blink performance suffers when deleting properties 6231 // from DOM nodes, so set to undefined instead 6232 // https://code.google.com/p/chromium/issues/detail?id=378607 6233 } else { 6234 elem[ internalKey ] = undefined; 6235 } 6236 6237 deletedIds.push( id ); 6238 } 6239 } 6240 } 6241 } 6242 } 6243} ); 6244 6245jQuery.fn.extend( { 6246 6247 // Keep domManip exposed until 3.0 (gh-2225) 6248 domManip: domManip, 6249 6250 detach: function( selector ) { 6251 return remove( this, selector, true ); 6252 }, 6253 6254 remove: function( selector ) { 6255 return remove( this, selector ); 6256 }, 6257 6258 text: function( value ) { 6259 return access( this, function( value ) { 6260 return value === undefined ? 6261 jQuery.text( this ) : 6262 this.empty().append( 6263 ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) 6264 ); 6265 }, null, value, arguments.length ); 6266 }, 6267 6268 append: function() { 6269 return domManip( this, arguments, function( elem ) { 6270 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6271 var target = manipulationTarget( this, elem ); 6272 target.appendChild( elem ); 6273 } 6274 } ); 6275 }, 6276
vendor: 4,288 bytes, lines 6277-6450
6277 prepend: function() { 6278 return domManip( this, arguments, function( elem ) { 6279 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6280 var target = manipulationTarget( this, elem ); 6281 target.insertBefore( elem, target.firstChild ); 6282 } 6283 } ); 6284 }, 6285 6286 before: function() { 6287 return domManip( this, arguments, function( elem ) { 6288 if ( this.parentNode ) { 6289 this.parentNode.insertBefore( elem, this ); 6290 } 6291 } ); 6292 }, 6293 6294 after: function() { 6295 return domManip( this, arguments, function( elem ) { 6296 if ( this.parentNode ) { 6297 this.parentNode.insertBefore( elem, this.nextSibling ); 6298 } 6299 } ); 6300 }, 6301 6302 empty: function() { 6303 var elem, 6304 i = 0; 6305 6306 for ( ; ( elem = this[ i ] ) != null; i++ ) { 6307 6308 // Remove element nodes and prevent memory leaks 6309 if ( elem.nodeType === 1 ) { 6310 jQuery.cleanData( getAll( elem, false ) ); 6311 } 6312 6313 // Remove any remaining nodes 6314 while ( elem.firstChild ) { 6315 elem.removeChild( elem.firstChild ); 6316 } 6317 6318 // If this is a select, ensure that it displays empty (#12336) 6319 // Support: IE<9 6320 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { 6321 elem.options.length = 0; 6322 } 6323 } 6324 6325 return this; 6326 }, 6327 6328 clone: function( dataAndEvents, deepDataAndEvents ) { 6329 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 6330 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 6331 6332 return this.map( function() { 6333 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 6334 } ); 6335 }, 6336 6337 html: function( value ) { 6338 return access( this, function( value ) { 6339 var elem = this[ 0 ] || {}, 6340 i = 0, 6341 l = this.length; 6342 6343 if ( value === undefined ) { 6344 return elem.nodeType === 1 ? 6345 elem.innerHTML.replace( rinlinejQuery, "" ) : 6346 undefined; 6347 } 6348 6349 // See if we can take a shortcut and just use innerHTML 6350 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 6351 ( support.htmlSerialize || !rnoshimcache.test( value ) ) && 6352 ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && 6353 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 6354 6355 value = jQuery.htmlPrefilter( value ); 6356 6357 try { 6358 for ( ; i < l; i++ ) { 6359 6360 // Remove element nodes and prevent memory leaks 6361 elem = this[ i ] || {}; 6362 if ( elem.nodeType === 1 ) { 6363 jQuery.cleanData( getAll( elem, false ) ); 6364 elem.innerHTML = value; 6365 } 6366 } 6367 6368 elem = 0; 6369 6370 // If using innerHTML throws an exception, use the fallback method 6371 } catch ( e ) {} 6372 } 6373 6374 if ( elem ) { 6375 this.empty().append( value ); 6376 } 6377 }, null, value, arguments.length ); 6378 }, 6379 6380 replaceWith: function() { 6381 var ignored = []; 6382 6383 // Make the changes, replacing each non-ignored context element with the new content 6384 return domManip( this, arguments, function( elem ) { 6385 var parent = this.parentNode; 6386 6387 if ( jQuery.inArray( this, ignored ) < 0 ) { 6388 jQuery.cleanData( getAll( this ) ); 6389 if ( parent ) { 6390 parent.replaceChild( elem, this ); 6391 } 6392 } 6393 6394 // Force callback invocation 6395 }, ignored ); 6396 } 6397} ); 6398 6399jQuery.each( { 6400 appendTo: "append", 6401 prependTo: "prepend", 6402 insertBefore: "before", 6403 insertAfter: "after", 6404 replaceAll: "replaceWith" 6405}, function( name, original ) { 6406 jQuery.fn[ name ] = function( selector ) { 6407 var elems, 6408 i = 0, 6409 ret = [], 6410 insert = jQuery( selector ), 6411 last = insert.length - 1; 6412 6413 for ( ; i <= last; i++ ) { 6414 elems = i === last ? this : this.clone( true ); 6415 jQuery( insert[ i ] )[ original ]( elems ); 6416 6417 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() 6418 push.apply( ret, elems.get() ); 6419 } 6420 6421 return this.pushStack( ret ); 6422 }; 6423} ); 6424 6425 6426var iframe, 6427 elemdisplay = { 6428 6429 // Support: Firefox 6430 // We have to pre-define these values for FF (#10227) 6431 HTML: "block", 6432 BODY: "block" 6433 }; 6434 6435/** 6436 * Retrieve the actual display of a element 6437 * @param {String} name nodeName of the element 6438 * @param {Object} doc Document object 6439 */ 6440 6441// Called only from within defaultDisplay 6442function actualDisplay( name, doc ) { 6443 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 6444 6445 display = jQuery.css( elem[ 0 ], "display" ); 6446 6447 // We don't have any data stored on the element, 6448 // so use "detach" method as fast way to get rid of the element 6449 elem.detach(); 6450
6451 return display; 6452} 6453 6454/** 6455 * Try to determine the default display value of an element 6456 * @param {String} nodeName 6457 */ 6458function defaultDisplay( nodeName ) { 6459 var doc = document, 6460 display = elemdisplay[ nodeName ]; 6461 6462 if ( !display ) { 6463 display = actualDisplay( nodeName, doc ); 6464 6465 // If the simple way fails, read from inside an iframe 6466 if ( display === "none" || !display ) { 6467 6468 // Use the already-created iframe if possible 6469 iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) 6470 .appendTo( doc.documentElement ); 6471 6472 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 6473 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; 6474 6475 // Support: IE 6476 doc.write(); 6477 doc.close(); 6478 6479 display = actualDisplay( nodeName, doc ); 6480 iframe.detach(); 6481 } 6482 6483 // Store the correct default display 6484 elemdisplay[ nodeName ] = display; 6485 } 6486 6487 return display; 6488} 6489var rmargin = ( /^margin/ ); 6490 6491var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 6492 6493var swap = function( elem, options, callback, args ) { 6494 var ret, name, 6495 old = {}; 6496 6497 // Remember the old values, and insert the new ones 6498 for ( name in options ) { 6499 old[ name ] = elem.style[ name ]; 6500 elem.style[ name ] = options[ name ]; 6501 } 6502 6503 ret = callback.apply( elem, args || [] ); 6504 6505 // Revert the old values 6506 for ( name in options ) { 6507 elem.style[ name ] = old[ name ]; 6508 } 6509 6510 return ret; 6511}; 6512 6513 6514var documentElement = document.documentElement; 6515 6516 6517 6518( function() { 6519 var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal, 6520 reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal, 6521 container = document.createElement( "div" ), 6522 div = document.createElement( "div" ); 6523 6524 // Finish early in limited (non-browser) environments 6525 if ( !div.style ) { 6526 return; 6527 } 6528 6529 div.style.cssText = "float:left;opacity:.5"; 6530 6531 // Support: IE<9 6532 // Make sure that element opacity exists (as opposed to filter) 6533 support.opacity = div.style.opacity === "0.5"; 6534 6535 // Verify style float existence 6536 // (IE uses styleFloat instead of cssFloat) 6537 support.cssFloat = !!div.style.cssFloat; 6538 6539 div.style.backgroundClip = "content-box"; 6540 div.cloneNode( true ).style.backgroundClip = ""; 6541 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 6542 6543 container = document.createElement( "div" ); 6544 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + 6545 "padding:0;margin-top:1px;position:absolute"; 6546 div.innerHTML = ""; 6547 container.appendChild( div ); 6548 6549 // Support: Firefox<29, Android 2.3 6550 // Vendor-prefix box-sizing 6551 support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" || 6552 div.style.WebkitBoxSizing === ""; 6553 6554 jQuery.extend( support, { 6555 reliableHiddenOffsets: function() { 6556 if ( pixelPositionVal == null ) { 6557 computeStyleTests(); 6558 } 6559 return reliableHiddenOffsetsVal; 6560 }, 6561 6562 boxSizingReliable: function() { 6563 6564 // We're checking for pixelPositionVal here instead of boxSizingReliableVal 6565 // since that compresses better and they're computed together anyway. 6566 if ( pixelPositionVal == null ) { 6567 computeStyleTests(); 6568 } 6569 return boxSizingReliableVal; 6570 }, 6571 6572 pixelMarginRight: function() { 6573 6574 // Support: Android 4.0-4.3 6575 if ( pixelPositionVal == null ) { 6576 computeStyleTests(); 6577 } 6578 return pixelMarginRightVal; 6579 }, 6580 6581 pixelPosition: function() { 6582 if ( pixelPositionVal == null ) { 6583 computeStyleTests(); 6584 } 6585 return pixelPositionVal; 6586 }, 6587 6588 reliableMarginRight: function() { 6589 6590 // Support: Android 2.3 6591 if ( pixelPositionVal == null ) { 6592 computeStyleTests(); 6593 } 6594 return reliableMarginRightVal; 6595 }, 6596 6597 reliableMarginLeft: function() { 6598 6599 // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 6600 if ( pixelPositionVal == null ) { 6601 computeStyleTests(); 6602 } 6603 return reliableMarginLeftVal; 6604 } 6605 } ); 6606 6607 function computeStyleTests() { 6608 var contents, divStyle, 6609 documentElement = document.documentElement; 6610 6611 // Setup 6612 documentElement.appendChild( container ); 6613 6614 div.style.cssText = 6615 6616 // Support: Android 2.3 6617 // Vendor-prefix box-sizing 6618 "-webkit-box-sizing:border-box;box-sizing:border-box;" + 6619 "position:relative;display:block;" + 6620 "margin:auto;border:1px;padding:1px;" + 6621 "top:1%;width:50%"; 6622
6623 // Support: IE<9 6624 // Assume reasonable values in the absence of getComputedStyle 6625 pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false; 6626 pixelMarginRightVal = reliableMarginRightVal = true; 6627 6628 // Check for getComputedStyle so that this code is not run in IE<9. 6629 if ( window.getComputedStyle ) { 6630 divStyle = window.getComputedStyle( div ); 6631 pixelPositionVal = ( divStyle || {} ).top !== "1%"; 6632 reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px"; 6633 boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px"; 6634 6635 // Support: Android 4.0 - 4.3 only 6636 // Some styles come back with percentage values, even though they shouldn't 6637 div.style.marginRight = "50%"; 6638 pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px"; 6639 6640 // Support: Android 2.3 only 6641 // Div with explicit width and no margin-right incorrectly 6642 // gets computed margin-right based on width of container (#3333) 6643 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 6644 contents = div.appendChild( document.createElement( "div" ) ); 6645 6646 // Reset CSS: box-sizing; display; margin; border; padding 6647 contents.style.cssText = div.style.cssText = 6648 6649 // Support: Android 2.3 6650 // Vendor-prefix box-sizing 6651 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 6652 "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; 6653 contents.style.marginRight = contents.style.width = "0"; 6654 div.style.width = "1px"; 6655 6656 reliableMarginRightVal = 6657 !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight ); 6658 6659 div.removeChild( contents ); 6660 } 6661 6662 // Support: IE6-8 6663 // First check that getClientRects works as expected 6664 // Check if table cells still have offsetWidth/Height when they are set 6665 // to display:none and there are still other visible table cells in a 6666 // table row; if so, offsetWidth/Height are not reliable for use when 6667 // determining if an element has been hidden directly using 6668 // display:none (it is still safe to use offsets if a parent element is 6669 // hidden; don safety goggles and see bug #4512 for more information). 6670 div.style.display = "none"; 6671 reliableHiddenOffsetsVal = div.getClientRects().length === 0; 6672 if ( reliableHiddenOffsetsVal ) { 6673 div.style.display = ""; 6674 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; 6675 div.childNodes[ 0 ].style.borderCollapse = "separate"; 6676 contents = div.getElementsByTagName( "td" ); 6677 contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; 6678 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; 6679 if ( reliableHiddenOffsetsVal ) { 6680 contents[ 0 ].style.display = ""; 6681 contents[ 1 ].style.display = "none"; 6682 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; 6683 } 6684 } 6685 6686 // Teardown 6687 documentElement.removeChild( container ); 6688 } 6689 6690} )(); 6691 6692 6693var getStyles, curCSS, 6694 rposition = /^(top|right|bottom|left)$/; 6695 6696if ( window.getComputedStyle ) { 6697 getStyles = function( elem ) { 6698 6699 // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 6700 // IE throws on elements created in popups 6701 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6702 var view = elem.ownerDocument.defaultView; 6703 6704 if ( !view || !view.opener ) { 6705 view = window; 6706 } 6707 6708 return view.getComputedStyle( elem ); 6709 }; 6710 6711 curCSS = function( elem, name, computed ) { 6712 var width, minWidth, maxWidth, ret, 6713 style = elem.style; 6714 6715 computed = computed || getStyles( elem ); 6716 6717 // getPropertyValue is only needed for .css('filter') in IE9, see #12537 6718 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; 6719 6720 // Support: Opera 12.1x only 6721 // Fall back to style even without computed 6722 // computed is undefined for elems on document fragments 6723 if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { 6724 ret = jQuery.style( elem, name ); 6725 } 6726 6727 if ( computed ) { 6728 6729 // A tribute to the "awesome hack by Dean Edwards" 6730 // Chrome < 17 and Safari 5.0 uses "computed value" 6731 // instead of "used value" for margin-right 6732 // Safari 5.1.7 (at least) returns percentage for a larger set of values, 6733 // but width seems to be reliably pixels 6734 // this is against the CSSOM draft spec: 6735 // http://dev.w3.org/csswg/cssom/#resolved-values 6736 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { 6737 6738 // Remember the original values 6739 width = style.width; 6740 minWidth = style.minWidth; 6741 maxWidth = style.maxWidth; 6742 6743 // Put in the new values to get a computed value out 6744 style.minWidth = style.maxWidth = style.width = ret; 6745 ret = computed.width; 6746 6747 // Revert the changed values 6748 style.width = width; 6749 style.minWidth = minWidth; 6750 style.maxWidth = maxWidth; 6751 } 6752 } 6753
vendor: 4,152 bytes, lines 6754-6916
6754 // Support: IE 6755 // IE returns zIndex value as an integer. 6756 return ret === undefined ? 6757 ret : 6758 ret + ""; 6759 }; 6760} else if ( documentElement.currentStyle ) { 6761 getStyles = function( elem ) { 6762 return elem.currentStyle; 6763 }; 6764 6765 curCSS = function( elem, name, computed ) { 6766 var left, rs, rsLeft, ret, 6767 style = elem.style; 6768 6769 computed = computed || getStyles( elem ); 6770 ret = computed ? computed[ name ] : undefined; 6771 6772 // Avoid setting ret to empty string here 6773 // so we don't default to auto 6774 if ( ret == null && style && style[ name ] ) { 6775 ret = style[ name ]; 6776 } 6777 6778 // From the awesome hack by Dean Edwards 6779 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 6780 6781 // If we're not dealing with a regular pixel number 6782 // but a number that has a weird ending, we need to convert it to pixels 6783 // but not position css attributes, as those are 6784 // proportional to the parent element instead 6785 // and we can't measure the parent instead because it 6786 // might trigger a "stacking dolls" problem 6787 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { 6788 6789 // Remember the original values 6790 left = style.left; 6791 rs = elem.runtimeStyle; 6792 rsLeft = rs && rs.left; 6793 6794 // Put in the new values to get a computed value out 6795 if ( rsLeft ) { 6796 rs.left = elem.currentStyle.left; 6797 } 6798 style.left = name === "fontSize" ? "1em" : ret; 6799 ret = style.pixelLeft + "px"; 6800 6801 // Revert the changed values 6802 style.left = left; 6803 if ( rsLeft ) { 6804 rs.left = rsLeft; 6805 } 6806 } 6807 6808 // Support: IE 6809 // IE returns zIndex value as an integer. 6810 return ret === undefined ? 6811 ret : 6812 ret + "" || "auto"; 6813 }; 6814} 6815 6816 6817 6818 6819function addGetHookIf( conditionFn, hookFn ) { 6820 6821 // Define the hook, we'll check on the first run if it's really needed. 6822 return { 6823 get: function() { 6824 if ( conditionFn() ) { 6825 6826 // Hook not needed (or it's not possible to use it due 6827 // to missing dependency), remove it. 6828 delete this.get; 6829 return; 6830 } 6831 6832 // Hook needed; redefine it so that the support test is not executed again. 6833 return ( this.get = hookFn ).apply( this, arguments ); 6834 } 6835 }; 6836} 6837 6838 6839var 6840 6841 ralpha = /alpha\([^)]*\)/i, 6842 ropacity = /opacity\s*=\s*([^)]*)/i, 6843 6844 // swappable if display is none or starts with table except 6845 // "table", "table-cell", or "table-caption" 6846 // see here for display values: 6847 // https://developer.mozilla.org/en-US/docs/CSS/display 6848 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 6849 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), 6850 6851 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 6852 cssNormalTransform = { 6853 letterSpacing: "0", 6854 fontWeight: "400" 6855 }, 6856 6857 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], 6858 emptyStyle = document.createElement( "div" ).style; 6859 6860 6861// return a css property mapped to a potentially vendor prefixed property 6862function vendorPropName( name ) { 6863 6864 // shortcut for names that are not vendor prefixed 6865 if ( name in emptyStyle ) { 6866 return name; 6867 } 6868 6869 // check for vendor prefixed names 6870 var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ), 6871 i = cssPrefixes.length; 6872 6873 while ( i-- ) { 6874 name = cssPrefixes[ i ] + capName; 6875 if ( name in emptyStyle ) { 6876 return name; 6877 } 6878 } 6879} 6880 6881function showHide( elements, show ) { 6882 var display, elem, hidden, 6883 values = [], 6884 index = 0, 6885 length = elements.length; 6886 6887 for ( ; index < length; index++ ) { 6888 elem = elements[ index ]; 6889 if ( !elem.style ) { 6890 continue; 6891 } 6892 6893 values[ index ] = jQuery._data( elem, "olddisplay" ); 6894 display = elem.style.display; 6895 if ( show ) { 6896 6897 // Reset the inline display of this element to learn if it is 6898 // being hidden by cascaded rules or not 6899 if ( !values[ index ] && display === "none" ) { 6900 elem.style.display = ""; 6901 } 6902 6903 // Set elements which have been overridden with display: none 6904 // in a stylesheet to whatever the default browser style is 6905 // for such an element 6906 if ( elem.style.display === "" && isHidden( elem ) ) { 6907 values[ index ] = 6908 jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) ); 6909 } 6910 } else { 6911 hidden = isHidden( elem ); 6912 6913 if ( display && display !== "none" || !hidden ) { 6914 jQuery._data( 6915 elem, 6916 "olddisplay",
vendor: 6,043 bytes, lines 6917-7128
6917 hidden ? display : jQuery.css( elem, "display" ) 6918 ); 6919 } 6920 } 6921 } 6922 6923 // Set the display of most of the elements in a second loop 6924 // to avoid the constant reflow 6925 for ( index = 0; index < length; index++ ) { 6926 elem = elements[ index ]; 6927 if ( !elem.style ) { 6928 continue; 6929 } 6930 if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 6931 elem.style.display = show ? values[ index ] || "" : "none"; 6932 } 6933 } 6934 6935 return elements; 6936} 6937 6938function setPositiveNumber( elem, value, subtract ) { 6939 var matches = rnumsplit.exec( value ); 6940 return matches ? 6941 6942 // Guard against undefined "subtract", e.g., when used as in cssHooks 6943 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : 6944 value; 6945} 6946 6947function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 6948 var i = extra === ( isBorderBox ? "border" : "content" ) ? 6949 6950 // If we already have the right measurement, avoid augmentation 6951 4 : 6952 6953 // Otherwise initialize for horizontal or vertical properties 6954 name === "width" ? 1 : 0, 6955 6956 val = 0; 6957 6958 for ( ; i < 4; i += 2 ) { 6959 6960 // both box models exclude margin, so add it if we want it 6961 if ( extra === "margin" ) { 6962 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 6963 } 6964 6965 if ( isBorderBox ) { 6966 6967 // border-box includes padding, so remove it if we want content 6968 if ( extra === "content" ) { 6969 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6970 } 6971 6972 // at this point, extra isn't border nor margin, so remove border 6973 if ( extra !== "margin" ) { 6974 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6975 } 6976 } else { 6977 6978 // at this point, extra isn't content, so add padding 6979 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6980 6981 // at this point, extra isn't content nor padding, so add border 6982 if ( extra !== "padding" ) { 6983 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6984 } 6985 } 6986 } 6987 6988 return val; 6989} 6990 6991function getWidthOrHeight( elem, name, extra ) { 6992 6993 // Start with offset property, which is equivalent to the border-box value 6994 var valueIsBorderBox = true, 6995 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 6996 styles = getStyles( elem ), 6997 isBorderBox = support.boxSizing && 6998 jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 6999 7000 // some non-html elements return undefined for offsetWidth, so check for null/undefined 7001 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 7002 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 7003 if ( val <= 0 || val == null ) { 7004 7005 // Fall back to computed then uncomputed css if necessary 7006 val = curCSS( elem, name, styles ); 7007 if ( val < 0 || val == null ) { 7008 val = elem.style[ name ]; 7009 } 7010 7011 // Computed unit is not pixels. Stop here and return. 7012 if ( rnumnonpx.test( val ) ) { 7013 return val; 7014 } 7015 7016 // we need the check for style in case a browser which returns unreliable values 7017 // for getComputedStyle silently falls back to the reliable elem.style 7018 valueIsBorderBox = isBorderBox && 7019 ( support.boxSizingReliable() || val === elem.style[ name ] ); 7020 7021 // Normalize "", auto, and prepare for extra 7022 val = parseFloat( val ) || 0; 7023 } 7024 7025 // use the active box-sizing model to add/subtract irrelevant styles 7026 return ( val + 7027 augmentWidthOrHeight( 7028 elem, 7029 name, 7030 extra || ( isBorderBox ? "border" : "content" ), 7031 valueIsBorderBox, 7032 styles 7033 ) 7034 ) + "px"; 7035} 7036 7037jQuery.extend( { 7038 7039 // Add in style property hooks for overriding the default 7040 // behavior of getting and setting a style property 7041 cssHooks: { 7042 opacity: { 7043 get: function( elem, computed ) { 7044 if ( computed ) { 7045 7046 // We should always get a number back from opacity 7047 var ret = curCSS( elem, "opacity" ); 7048 return ret === "" ? "1" : ret; 7049 } 7050 } 7051 } 7052 }, 7053 7054 // Don't automatically add "px" to these possibly-unitless properties 7055 cssNumber: { 7056 "animationIterationCount": true, 7057 "columnCount": true, 7058 "fillOpacity": true, 7059 "flexGrow": true, 7060 "flexShrink": true, 7061 "fontWeight": true, 7062 "lineHeight": true, 7063 "opacity": true, 7064 "order": true, 7065 "orphans": true, 7066 "widows": true, 7067 "zIndex": true, 7068 "zoom": true 7069 }, 7070 7071 // Add in properties whose names you wish to fix before 7072 // setting or getting the value 7073 cssProps: { 7074 7075 // normalize float css property 7076 "float": support.cssFloat ? "cssFloat" : "styleFloat" 7077 }, 7078 7079 // Get and set the style property on a DOM Node 7080 style: function( elem, name, value, extra ) { 7081 7082 // Don't set styles on text and comment nodes 7083 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 7084 return; 7085 } 7086 7087 // Make sure that we're working with the right name 7088 var ret, type, hooks, 7089 origName = jQuery.camelCase( name ), 7090 style = elem.style; 7091 7092 name = jQuery.cssProps[ origName ] || 7093 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 7094 7095 // gets hook for the prefixed version 7096 // followed by the unprefixed version 7097 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 7098 7099 // Check if we're setting a value 7100 if ( value !== undefined ) { 7101 type = typeof value; 7102 7103 // Convert "+=" or "-=" to relative numbers (#7345) 7104 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 7105 value = adjustCSS( elem, name, ret ); 7106 7107 // Fixes bug #9237 7108 type = "number"; 7109 } 7110 7111 // Make sure that null and NaN values aren't set. See: #7116 7112 if ( value == null || value !== value ) { 7113 return; 7114 } 7115 7116 // If a number was passed in, add the unit (except for certain CSS properties) 7117 if ( type === "number" ) { 7118 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 7119 } 7120 7121 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, 7122 // but it would mean to define eight 7123 // (for every problematic property) identical functions 7124 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 7125 style[ name ] = "inherit"; 7126 } 7127 7128 // If a hook was provided, use that value, otherwise just set the specified value
vendor: 4,586 bytes, lines 7129-7284
7129 if ( !hooks || !( "set" in hooks ) || 7130 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 7131 7132 // Support: IE 7133 // Swallow errors from 'invalid' CSS values (#5509) 7134 try { 7135 style[ name ] = value; 7136 } catch ( e ) {} 7137 } 7138 7139 } else { 7140 7141 // If a hook was provided get the non-computed value from there 7142 if ( hooks && "get" in hooks && 7143 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 7144 7145 return ret; 7146 } 7147 7148 // Otherwise just get the value from the style object 7149 return style[ name ]; 7150 } 7151 }, 7152 7153 css: function( elem, name, extra, styles ) { 7154 var num, val, hooks, 7155 origName = jQuery.camelCase( name ); 7156 7157 // Make sure that we're working with the right name 7158 name = jQuery.cssProps[ origName ] || 7159 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 7160 7161 // gets hook for the prefixed version 7162 // followed by the unprefixed version 7163 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 7164 7165 // If a hook was provided get the computed value from there 7166 if ( hooks && "get" in hooks ) { 7167 val = hooks.get( elem, true, extra ); 7168 } 7169 7170 // Otherwise, if a way to get the computed value exists, use that 7171 if ( val === undefined ) { 7172 val = curCSS( elem, name, styles ); 7173 } 7174 7175 //convert "normal" to computed value 7176 if ( val === "normal" && name in cssNormalTransform ) { 7177 val = cssNormalTransform[ name ]; 7178 } 7179 7180 // Return, converting to number if forced or a qualifier was provided and val looks numeric 7181 if ( extra === "" || extra ) { 7182 num = parseFloat( val ); 7183 return extra === true || isFinite( num ) ? num || 0 : val; 7184 } 7185 return val; 7186 } 7187} ); 7188 7189jQuery.each( [ "height", "width" ], function( i, name ) { 7190 jQuery.cssHooks[ name ] = { 7191 get: function( elem, computed, extra ) { 7192 if ( computed ) { 7193 7194 // certain elements can have dimension info if we invisibly show them 7195 // however, it must have a current display style that would benefit from this 7196 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 7197 elem.offsetWidth === 0 ? 7198 swap( elem, cssShow, function() { 7199 return getWidthOrHeight( elem, name, extra ); 7200 } ) : 7201 getWidthOrHeight( elem, name, extra ); 7202 } 7203 }, 7204 7205 set: function( elem, value, extra ) { 7206 var styles = extra && getStyles( elem ); 7207 return setPositiveNumber( elem, value, extra ? 7208 augmentWidthOrHeight( 7209 elem, 7210 name, 7211 extra, 7212 support.boxSizing && 7213 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 7214 styles 7215 ) : 0 7216 ); 7217 } 7218 }; 7219} ); 7220 7221if ( !support.opacity ) { 7222 jQuery.cssHooks.opacity = { 7223 get: function( elem, computed ) { 7224 7225 // IE uses filters for opacity 7226 return ropacity.test( ( computed && elem.currentStyle ? 7227 elem.currentStyle.filter : 7228 elem.style.filter ) || "" ) ? 7229 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : 7230 computed ? "1" : ""; 7231 }, 7232 7233 set: function( elem, value ) { 7234 var style = elem.style, 7235 currentStyle = elem.currentStyle, 7236 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", 7237 filter = currentStyle && currentStyle.filter || style.filter || ""; 7238 7239 // IE has trouble with opacity if it does not have layout 7240 // Force it by setting the zoom level 7241 style.zoom = 1; 7242 7243 // if setting opacity to 1, and no other filters exist - 7244 // attempt to remove filter attribute #6652 7245 // if value === "", then remove inline opacity #12685 7246 if ( ( value >= 1 || value === "" ) && 7247 jQuery.trim( filter.replace( ralpha, "" ) ) === "" && 7248 style.removeAttribute ) { 7249 7250 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText 7251 // if "filter:" is present at all, clearType is disabled, we want to avoid this 7252 // style.removeAttribute is IE Only, but so apparently is this code path... 7253 style.removeAttribute( "filter" ); 7254 7255 // if there is no filter style applied in a css rule 7256 // or unset inline opacity, we are done 7257 if ( value === "" || currentStyle && !currentStyle.filter ) { 7258 return; 7259 } 7260 } 7261 7262 // otherwise, set new filter values 7263 style.filter = ralpha.test( filter ) ? 7264 filter.replace( ralpha, opacity ) : 7265 filter + " " + opacity; 7266 } 7267 }; 7268} 7269 7270jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, 7271 function( elem, computed ) { 7272 if ( computed ) { 7273 return swap( elem, { "display": "inline-block" }, 7274 curCSS, [ elem, "marginRight" ] ); 7275 } 7276 } 7277); 7278 7279jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 7280 function( elem, computed ) { 7281 if ( computed ) { 7282 return ( 7283 parseFloat( curCSS( elem, "marginLeft" ) ) || 7284
vendor: 4,625 bytes, lines 7285-7463
7285 // Support: IE<=11+ 7286 // Running getBoundingClientRect on a disconnected node in IE throws an error 7287 // Support: IE8 only 7288 // getClientRects() errors on disconnected elems 7289 ( jQuery.contains( elem.ownerDocument, elem ) ? 7290 elem.getBoundingClientRect().left - 7291 swap( elem, { marginLeft: 0 }, function() { 7292 return elem.getBoundingClientRect().left; 7293 } ) : 7294 0 7295 ) 7296 ) + "px"; 7297 } 7298 } 7299); 7300 7301// These hooks are used by animate to expand properties 7302jQuery.each( { 7303 margin: "", 7304 padding: "", 7305 border: "Width" 7306}, function( prefix, suffix ) { 7307 jQuery.cssHooks[ prefix + suffix ] = { 7308 expand: function( value ) { 7309 var i = 0, 7310 expanded = {}, 7311 7312 // assumes a single number if not a string 7313 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 7314 7315 for ( ; i < 4; i++ ) { 7316 expanded[ prefix + cssExpand[ i ] + suffix ] = 7317 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 7318 } 7319 7320 return expanded; 7321 } 7322 }; 7323 7324 if ( !rmargin.test( prefix ) ) { 7325 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 7326 } 7327} ); 7328 7329jQuery.fn.extend( { 7330 css: function( name, value ) { 7331 return access( this, function( elem, name, value ) { 7332 var styles, len, 7333 map = {}, 7334 i = 0; 7335 7336 if ( jQuery.isArray( name ) ) { 7337 styles = getStyles( elem ); 7338 len = name.length; 7339 7340 for ( ; i < len; i++ ) { 7341 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 7342 } 7343 7344 return map; 7345 } 7346 7347 return value !== undefined ? 7348 jQuery.style( elem, name, value ) : 7349 jQuery.css( elem, name ); 7350 }, name, value, arguments.length > 1 ); 7351 }, 7352 show: function() { 7353 return showHide( this, true ); 7354 }, 7355 hide: function() { 7356 return showHide( this ); 7357 }, 7358 toggle: function( state ) { 7359 if ( typeof state === "boolean" ) { 7360 return state ? this.show() : this.hide(); 7361 } 7362 7363 return this.each( function() { 7364 if ( isHidden( this ) ) { 7365 jQuery( this ).show(); 7366 } else { 7367 jQuery( this ).hide(); 7368 } 7369 } ); 7370 } 7371} ); 7372 7373 7374function Tween( elem, options, prop, end, easing ) { 7375 return new Tween.prototype.init( elem, options, prop, end, easing ); 7376} 7377jQuery.Tween = Tween; 7378 7379Tween.prototype = { 7380 constructor: Tween, 7381 init: function( elem, options, prop, end, easing, unit ) { 7382 this.elem = elem; 7383 this.prop = prop; 7384 this.easing = easing || jQuery.easing._default; 7385 this.options = options; 7386 this.start = this.now = this.cur(); 7387 this.end = end; 7388 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 7389 }, 7390 cur: function() { 7391 var hooks = Tween.propHooks[ this.prop ]; 7392 7393 return hooks && hooks.get ? 7394 hooks.get( this ) : 7395 Tween.propHooks._default.get( this ); 7396 }, 7397 run: function( percent ) { 7398 var eased, 7399 hooks = Tween.propHooks[ this.prop ]; 7400 7401 if ( this.options.duration ) { 7402 this.pos = eased = jQuery.easing[ this.easing ]( 7403 percent, this.options.duration * percent, 0, 1, this.options.duration 7404 ); 7405 } else { 7406 this.pos = eased = percent; 7407 } 7408 this.now = ( this.end - this.start ) * eased + this.start; 7409 7410 if ( this.options.step ) { 7411 this.options.step.call( this.elem, this.now, this ); 7412 } 7413 7414 if ( hooks && hooks.set ) { 7415 hooks.set( this ); 7416 } else { 7417 Tween.propHooks._default.set( this ); 7418 } 7419 return this; 7420 } 7421}; 7422 7423Tween.prototype.init.prototype = Tween.prototype; 7424 7425Tween.propHooks = { 7426 _default: { 7427 get: function( tween ) { 7428 var result; 7429 7430 // Use a property on the element directly when it is not a DOM element, 7431 // or when there is no matching style property that exists. 7432 if ( tween.elem.nodeType !== 1 || 7433 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 7434 return tween.elem[ tween.prop ]; 7435 } 7436 7437 // passing an empty string as a 3rd parameter to .css will automatically 7438 // attempt a parseFloat and fallback to a string if the parse fails 7439 // so, simple values such as "10px" are parsed to Float. 7440 // complex values such as "rotate(1rad)" are returned as is. 7441 result = jQuery.css( tween.elem, tween.prop, "" ); 7442 7443 // Empty strings, null, undefined and "auto" are converted to 0. 7444 return !result || result === "auto" ? 0 : result; 7445 }, 7446 set: function( tween ) { 7447 7448 // use step hook for back compat - use cssHook if its there - use .style if its 7449 // available and use plain properties where available 7450 if ( jQuery.fx.step[ tween.prop ] ) { 7451 jQuery.fx.step[ tween.prop ]( tween ); 7452 } else if ( tween.elem.nodeType === 1 && 7453 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || 7454 jQuery.cssHooks[ tween.prop ] ) ) { 7455 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 7456 } else { 7457 tween.elem[ tween.prop ] = tween.now; 7458 } 7459 } 7460 } 7461}; 7462 7463// Support: IE <=9
vendor: 5,654 bytes, lines 7464-7680
7464// Panic based approach to setting things on disconnected nodes 7465 7466Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 7467 set: function( tween ) { 7468 if ( tween.elem.nodeType && tween.elem.parentNode ) { 7469 tween.elem[ tween.prop ] = tween.now; 7470 } 7471 } 7472}; 7473 7474jQuery.easing = { 7475 linear: function( p ) { 7476 return p; 7477 }, 7478 swing: function( p ) { 7479 return 0.5 - Math.cos( p * Math.PI ) / 2; 7480 }, 7481 _default: "swing" 7482}; 7483 7484jQuery.fx = Tween.prototype.init; 7485 7486// Back Compat <1.8 extension point 7487jQuery.fx.step = {}; 7488 7489 7490 7491 7492var 7493 fxNow, timerId, 7494 rfxtypes = /^(?:toggle|show|hide)$/, 7495 rrun = /queueHooks$/; 7496 7497// Animations created synchronously will run synchronously 7498function createFxNow() { 7499 window.setTimeout( function() { 7500 fxNow = undefined; 7501 } ); 7502 return ( fxNow = jQuery.now() ); 7503} 7504 7505// Generate parameters to create a standard animation 7506function genFx( type, includeWidth ) { 7507 var which, 7508 attrs = { height: type }, 7509 i = 0; 7510 7511 // if we include width, step value is 1 to do all cssExpand values, 7512 // if we don't include width, step value is 2 to skip over Left and Right 7513 includeWidth = includeWidth ? 1 : 0; 7514 for ( ; i < 4 ; i += 2 - includeWidth ) { 7515 which = cssExpand[ i ]; 7516 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 7517 } 7518 7519 if ( includeWidth ) { 7520 attrs.opacity = attrs.width = type; 7521 } 7522 7523 return attrs; 7524} 7525 7526function createTween( value, prop, animation ) { 7527 var tween, 7528 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 7529 index = 0, 7530 length = collection.length; 7531 for ( ; index < length; index++ ) { 7532 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 7533 7534 // we're done with this property 7535 return tween; 7536 } 7537 } 7538} 7539 7540function defaultPrefilter( elem, props, opts ) { 7541 /* jshint validthis: true */ 7542 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, 7543 anim = this, 7544 orig = {}, 7545 style = elem.style, 7546 hidden = elem.nodeType && isHidden( elem ), 7547 dataShow = jQuery._data( elem, "fxshow" ); 7548 7549 // handle queue: false promises 7550 if ( !opts.queue ) { 7551 hooks = jQuery._queueHooks( elem, "fx" ); 7552 if ( hooks.unqueued == null ) { 7553 hooks.unqueued = 0; 7554 oldfire = hooks.empty.fire; 7555 hooks.empty.fire = function() { 7556 if ( !hooks.unqueued ) { 7557 oldfire(); 7558 } 7559 }; 7560 } 7561 hooks.unqueued++; 7562 7563 anim.always( function() { 7564 7565 // doing this makes sure that the complete handler will be called 7566 // before this completes 7567 anim.always( function() { 7568 hooks.unqueued--; 7569 if ( !jQuery.queue( elem, "fx" ).length ) { 7570 hooks.empty.fire(); 7571 } 7572 } ); 7573 } ); 7574 } 7575 7576 // height/width overflow pass 7577 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { 7578 7579 // Make sure that nothing sneaks out 7580 // Record all 3 overflow attributes because IE does not 7581 // change the overflow attribute when overflowX and 7582 // overflowY are set to the same value 7583 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 7584 7585 // Set display property to inline-block for height/width 7586 // animations on inline elements that are having width/height animated 7587 display = jQuery.css( elem, "display" ); 7588 7589 // Test default display if display is currently "none" 7590 checkDisplay = display === "none" ? 7591 jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; 7592 7593 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { 7594 7595 // inline-level elements accept inline-block; 7596 // block-level elements need to be inline with layout 7597 if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { 7598 style.display = "inline-block"; 7599 } else { 7600 style.zoom = 1; 7601 } 7602 } 7603 } 7604 7605 if ( opts.overflow ) { 7606 style.overflow = "hidden"; 7607 if ( !support.shrinkWrapBlocks() ) { 7608 anim.always( function() { 7609 style.overflow = opts.overflow[ 0 ]; 7610 style.overflowX = opts.overflow[ 1 ]; 7611 style.overflowY = opts.overflow[ 2 ]; 7612 } ); 7613 } 7614 } 7615 7616 // show/hide pass 7617 for ( prop in props ) { 7618 value = props[ prop ]; 7619 if ( rfxtypes.exec( value ) ) { 7620 delete props[ prop ]; 7621 toggle = toggle || value === "toggle"; 7622 if ( value === ( hidden ? "hide" : "show" ) ) { 7623 7624 // If there is dataShow left over from a stopped hide or show 7625 // and we are going to proceed with show, we should pretend to be hidden 7626 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 7627 hidden = true; 7628 } else { 7629 continue; 7630 } 7631 } 7632 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 7633 7634 // Any non-fx value stops us from restoring the original display value 7635 } else { 7636 display = undefined; 7637 } 7638 } 7639 7640 if ( !jQuery.isEmptyObject( orig ) ) { 7641 if ( dataShow ) { 7642 if ( "hidden" in dataShow ) { 7643 hidden = dataShow.hidden; 7644 } 7645 } else { 7646 dataShow = jQuery._data( elem, "fxshow", {} ); 7647 } 7648 7649 // store state if its toggle - enables .stop().toggle() to "reverse" 7650 if ( toggle ) { 7651 dataShow.hidden = !hidden; 7652 } 7653 if ( hidden ) { 7654 jQuery( elem ).show(); 7655 } else { 7656 anim.done( function() { 7657 jQuery( elem ).hide(); 7658 } ); 7659 } 7660 anim.done( function() { 7661 var prop; 7662 jQuery._removeData( elem, "fxshow" ); 7663 for ( prop in orig ) { 7664 jQuery.style( elem, prop, orig[ prop ] ); 7665 } 7666 } ); 7667 for ( prop in orig ) { 7668 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 7669 7670 if ( !( prop in dataShow ) ) { 7671 dataShow[ prop ] = tween.start; 7672 if ( hidden ) { 7673 tween.end = tween.start; 7674 tween.start = prop === "width" || prop === "height" ? 1 : 0; 7675 } 7676 } 7677 } 7678 7679 // If this is a noop like .hide().hide(), restore an overwritten display value 7680 } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : dis
vendor: 10,851 bytes, lines 7680-8112
7680play ) === "inline" ) { 7681 style.display = display; 7682 } 7683} 7684 7685function propFilter( props, specialEasing ) { 7686 var index, name, easing, value, hooks; 7687 7688 // camelCase, specialEasing and expand cssHook pass 7689 for ( index in props ) { 7690 name = jQuery.camelCase( index ); 7691 easing = specialEasing[ name ]; 7692 value = props[ index ]; 7693 if ( jQuery.isArray( value ) ) { 7694 easing = value[ 1 ]; 7695 value = props[ index ] = value[ 0 ]; 7696 } 7697 7698 if ( index !== name ) { 7699 props[ name ] = value; 7700 delete props[ index ]; 7701 } 7702 7703 hooks = jQuery.cssHooks[ name ]; 7704 if ( hooks && "expand" in hooks ) { 7705 value = hooks.expand( value ); 7706 delete props[ name ]; 7707 7708 // not quite $.extend, this wont overwrite keys already present. 7709 // also - reusing 'index' from above because we have the correct "name" 7710 for ( index in value ) { 7711 if ( !( index in props ) ) { 7712 props[ index ] = value[ index ]; 7713 specialEasing[ index ] = easing; 7714 } 7715 } 7716 } else { 7717 specialEasing[ name ] = easing; 7718 } 7719 } 7720} 7721 7722function Animation( elem, properties, options ) { 7723 var result, 7724 stopped, 7725 index = 0, 7726 length = Animation.prefilters.length, 7727 deferred = jQuery.Deferred().always( function() { 7728 7729 // don't match elem in the :animated selector 7730 delete tick.elem; 7731 } ), 7732 tick = function() { 7733 if ( stopped ) { 7734 return false; 7735 } 7736 var currentTime = fxNow || createFxNow(), 7737 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 7738 7739 // Support: Android 2.3 7740 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 7741 temp = remaining / animation.duration || 0, 7742 percent = 1 - temp, 7743 index = 0, 7744 length = animation.tweens.length; 7745 7746 for ( ; index < length ; index++ ) { 7747 animation.tweens[ index ].run( percent ); 7748 } 7749 7750 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 7751 7752 if ( percent < 1 && length ) { 7753 return remaining; 7754 } else { 7755 deferred.resolveWith( elem, [ animation ] ); 7756 return false; 7757 } 7758 }, 7759 animation = deferred.promise( { 7760 elem: elem, 7761 props: jQuery.extend( {}, properties ), 7762 opts: jQuery.extend( true, { 7763 specialEasing: {}, 7764 easing: jQuery.easing._default 7765 }, options ), 7766 originalProperties: properties, 7767 originalOptions: options, 7768 startTime: fxNow || createFxNow(), 7769 duration: options.duration, 7770 tweens: [], 7771 createTween: function( prop, end ) { 7772 var tween = jQuery.Tween( elem, animation.opts, prop, end, 7773 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 7774 animation.tweens.push( tween ); 7775 return tween; 7776 }, 7777 stop: function( gotoEnd ) { 7778 var index = 0, 7779 7780 // if we are going to the end, we want to run all the tweens 7781 // otherwise we skip this part 7782 length = gotoEnd ? animation.tweens.length : 0; 7783 if ( stopped ) { 7784 return this; 7785 } 7786 stopped = true; 7787 for ( ; index < length ; index++ ) { 7788 animation.tweens[ index ].run( 1 ); 7789 } 7790 7791 // resolve when we played the last frame 7792 // otherwise, reject 7793 if ( gotoEnd ) { 7794 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 7795 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 7796 } else { 7797 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 7798 } 7799 return this; 7800 } 7801 } ), 7802 props = animation.props; 7803 7804 propFilter( props, animation.opts.specialEasing ); 7805 7806 for ( ; index < length ; index++ ) { 7807 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 7808 if ( result ) { 7809 if ( jQuery.isFunction( result.stop ) ) { 7810 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 7811 jQuery.proxy( result.stop, result ); 7812 } 7813 return result; 7814 } 7815 } 7816 7817 jQuery.map( props, createTween, animation ); 7818 7819 if ( jQuery.isFunction( animation.opts.start ) ) { 7820 animation.opts.start.call( elem, animation ); 7821 } 7822 7823 jQuery.fx.timer( 7824 jQuery.extend( tick, { 7825 elem: elem, 7826 anim: animation, 7827 queue: animation.opts.queue 7828 } ) 7829 ); 7830 7831 // attach callbacks from options 7832 return animation.progress( animation.opts.progress ) 7833 .done( animation.opts.done, animation.opts.complete ) 7834 .fail( animation.opts.fail ) 7835 .always( animation.opts.always ); 7836} 7837 7838jQuery.Animation = jQuery.extend( Animation, { 7839 7840 tweeners: { 7841 "*": [ function( prop, value ) { 7842 var tween = this.createTween( prop, value ); 7843 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 7844 return tween; 7845 } ] 7846 }, 7847 7848 tweener: function( props, callback ) { 7849 if ( jQuery.isFunction( props ) ) { 7850 callback = props; 7851 props = [ "*" ]; 7852 } else { 7853 props = props.match( rnotwhite ); 7854 } 7855 7856 var prop, 7857 index = 0, 7858 length = props.length; 7859 7860 for ( ; index < length ; index++ ) { 7861 prop = props[ index ]; 7862 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 7863 Animation.tweeners[ prop ].unshift( callback ); 7864 } 7865 }, 7866 7867 prefilters: [ defaultPrefilter ], 7868 7869 prefilter: function( callback, prepend ) { 7870 if ( prepend ) { 7871 Animation.prefilters.unshift( callback ); 7872 } else { 7873 Animation.prefilters.push( callback ); 7874 } 7875 } 7876} ); 7877 7878jQuery.speed = function( speed, easing, fn ) { 7879 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 7880 complete: fn || !fn && easing || 7881 jQuery.isFunction( speed ) && speed, 7882 duration: speed, 7883 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing 7884 }; 7885 7886 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : 7887 opt.duration in jQuery.fx.speeds ? 7888 jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; 7889 7890 // normalize opt.queue - true/undefined/null -> "fx" 7891 if ( opt.queue == null || opt.queue === true ) { 7892 opt.queue = "fx"; 7893 } 7894 7895 // Queueing 7896 opt.old = opt.complete; 7897 7898 opt.complete = function() { 7899 if ( jQuery.isFunction( opt.old ) ) { 7900 opt.old.call( this ); 7901 } 7902 7903 if ( opt.queue ) { 7904 jQuery.dequeue( this, opt.queue ); 7905 } 7906 }; 7907 7908 return opt; 7909}; 7910 7911jQuery.fn.extend( { 7912 fadeTo: function( speed, to, easing, callback ) { 7913 7914 // show any hidden elements after setting opacity to 0 7915 return this.filter( isHidden ).css( "opacity", 0 ).show() 7916 7917 // animate to the value specified 7918 .end().animate( { opacity: to }, speed, easing, callback ); 7919 }, 7920 animate: function( prop, speed, easing, callback ) { 7921 var empty = jQuery.isEmptyObject( prop ), 7922 optall = jQuery.speed( speed, easing, callback ), 7923 doAnimation = function() { 7924 7925 // Operate on a copy of prop so per-property easing won't be lost 7926 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 7927 7928 // Empty animations, or finishing resolves immediately 7929 if ( empty || jQuery._data( this, "finish" ) ) { 7930 anim.stop( true ); 7931 } 7932 }; 7933 doAnimation.finish = doAnimation; 7934 7935 return empty || optall.queue === false ? 7936 this.each( doAnimation ) : 7937 this.queue( optall.queue, doAnimation ); 7938 }, 7939 stop: function( type, clearQueue, gotoEnd ) { 7940 var stopQueue = function( hooks ) { 7941 var stop = hooks.stop; 7942 delete hooks.stop; 7943 stop( gotoEnd ); 7944 }; 7945 7946 if ( typeof type !== "string" ) { 7947 gotoEnd = clearQueue; 7948 clearQueue = type; 7949 type = undefined; 7950 } 7951 if ( clearQueue && type !== false ) { 7952 this.queue( type || "fx", [] ); 7953 } 7954 7955 return this.each( function() { 7956 var dequeue = true, 7957 index = type != null && type + "queueHooks", 7958 timers = jQuery.timers, 7959 data = jQuery._data( this ); 7960 7961 if ( index ) { 7962 if ( data[ index ] && data[ index ].stop ) { 7963 stopQueue( data[ index ] ); 7964 } 7965 } else { 7966 for ( index in data ) { 7967 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 7968 stopQueue( data[ index ] ); 7969 } 7970 } 7971 } 7972 7973 for ( index = timers.length; index--; ) { 7974 if ( timers[ index ].elem === this && 7975 ( type == null || timers[ index ].queue === type ) ) { 7976 7977 timers[ index ].anim.stop( gotoEnd ); 7978 dequeue = false; 7979 timers.splice( index, 1 ); 7980 } 7981 } 7982 7983 // start the next in the queue if the last step wasn't forced 7984 // timers currently will call their complete callbacks, which will dequeue 7985 // but only if they were gotoEnd 7986 if ( dequeue || !gotoEnd ) { 7987 jQuery.dequeue( this, type ); 7988 } 7989 } ); 7990 }, 7991 finish: function( type ) { 7992 if ( type !== false ) { 7993 type = type || "fx"; 7994 } 7995 return this.each( function() { 7996 var index, 7997 data = jQuery._data( this ), 7998 queue = data[ type + "queue" ], 7999 hooks = data[ type + "queueHooks" ], 8000 timers = jQuery.timers, 8001 length = queue ? queue.length : 0; 8002 8003 // enable finishing flag on private data 8004 data.finish = true; 8005 8006 // empty the queue first 8007 jQuery.queue( this, type, [] ); 8008 8009 if ( hooks && hooks.stop ) { 8010 hooks.stop.call( this, true ); 8011 } 8012 8013 // look for any active animations, and finish them 8014 for ( index = timers.length; index--; ) { 8015 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 8016 timers[ index ].anim.stop( true ); 8017 timers.splice( index, 1 ); 8018 } 8019 } 8020 8021 // look for any animations in the old queue and finish them 8022 for ( index = 0; index < length; index++ ) { 8023 if ( queue[ index ] && queue[ index ].finish ) { 8024 queue[ index ].finish.call( this ); 8025 } 8026 } 8027 8028 // turn off finishing flag 8029 delete data.finish; 8030 } ); 8031 } 8032} ); 8033 8034jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { 8035 var cssFn = jQuery.fn[ name ]; 8036 jQuery.fn[ name ] = function( speed, easing, callback ) { 8037 return speed == null || typeof speed === "boolean" ? 8038 cssFn.apply( this, arguments ) : 8039 this.animate( genFx( name, true ), speed, easing, callback ); 8040 }; 8041} ); 8042 8043// Generate shortcuts for custom animations 8044jQuery.each( { 8045 slideDown: genFx( "show" ), 8046 slideUp: genFx( "hide" ), 8047 slideToggle: genFx( "toggle" ), 8048 fadeIn: { opacity: "show" }, 8049 fadeOut: { opacity: "hide" }, 8050 fadeToggle: { opacity: "toggle" } 8051}, function( name, props ) { 8052 jQuery.fn[ name ] = function( speed, easing, callback ) { 8053 return this.animate( props, speed, easing, callback ); 8054 }; 8055} ); 8056 8057jQuery.timers = []; 8058jQuery.fx.tick = function() { 8059 var timer, 8060 timers = jQuery.timers, 8061 i = 0; 8062 8063 fxNow = jQuery.now(); 8064 8065 for ( ; i < timers.length; i++ ) { 8066 timer = timers[ i ]; 8067 8068 // Checks the timer has not already been removed 8069 if ( !timer() && timers[ i ] === timer ) { 8070 timers.splice( i--, 1 ); 8071 } 8072 } 8073 8074 if ( !timers.length ) { 8075 jQuery.fx.stop(); 8076 } 8077 fxNow = undefined; 8078}; 8079 8080jQuery.fx.timer = function( timer ) { 8081 jQuery.timers.push( timer ); 8082 if ( timer() ) { 8083 jQuery.fx.start(); 8084 } else { 8085 jQuery.timers.pop(); 8086 } 8087}; 8088 8089jQuery.fx.interval = 13; 8090 8091jQuery.fx.start = function() { 8092 if ( !timerId ) { 8093 timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); 8094 } 8095}; 8096 8097jQuery.fx.stop = function() { 8098 window.clearInterval( timerId ); 8099 timerId = null; 8100}; 8101 8102jQuery.fx.speeds = { 8103 slow: 600, 8104 fast: 200, 8105 8106 // Default speed 8107 _default: 400 8108}; 8109 8110 8111// Based off of the plugin by Clint Helfers, with permission. 8112// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
8113jQuery.fn.delay = function( time, type ) { 8114 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 8115 type = type || "fx"; 8116 8117 return this.queue( type, function( next, hooks ) { 8118 var timeout = window.setTimeout( next, time ); 8119 hooks.stop = function() { 8120 window.clearTimeout( timeout ); 8121 }; 8122 } ); 8123}; 8124 8125 8126( function() { 8127 var a, 8128 input = document.createElement( "input" ), 8129 div = document.createElement( "div" ), 8130 select = document.createElement( "select" ), 8131 opt = select.appendChild( document.createElement( "option" ) ); 8132 8133 // Setup 8134 div = document.createElement( "div" ); 8135 div.setAttribute( "className", "t" ); 8136 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 8137 a = div.getElementsByTagName( "a" )[ 0 ]; 8138 8139 // Support: Windows Web Apps (WWA) 8140 // `type` must use .setAttribute for WWA (#14901) 8141 input.setAttribute( "type", "checkbox" ); 8142 div.appendChild( input ); 8143 8144 a = div.getElementsByTagName( "a" )[ 0 ]; 8145 8146 // First batch of tests. 8147 a.style.cssText = "top:1px"; 8148 8149 // Test setAttribute on camelCase class. 8150 // If it works, we need attrFixes when doing get/setAttribute (ie6/7)
vendor: 2,696 bytes, lines 8151-8252
8151 support.getSetAttribute = div.className !== "t"; 8152 8153 // Get the style information from getAttribute 8154 // (IE uses .cssText instead) 8155 support.style = /top/.test( a.getAttribute( "style" ) ); 8156 8157 // Make sure that URLs aren't manipulated 8158 // (IE normalizes it by default) 8159 support.hrefNormalized = a.getAttribute( "href" ) === "/a"; 8160 8161 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) 8162 support.checkOn = !!input.value; 8163 8164 // Make sure that a selected-by-default option has a working selected property. 8165 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) 8166 support.optSelected = opt.selected; 8167 8168 // Tests for enctype support on a form (#6743) 8169 support.enctype = !!document.createElement( "form" ).enctype; 8170 8171 // Make sure that the options inside disabled selects aren't marked as disabled 8172 // (WebKit marks them as disabled) 8173 select.disabled = true; 8174 support.optDisabled = !opt.disabled; 8175 8176 // Support: IE8 only 8177 // Check if we can trust getAttribute("value") 8178 input = document.createElement( "input" ); 8179 input.setAttribute( "value", "" ); 8180 support.input = input.getAttribute( "value" ) === ""; 8181 8182 // Check if an input maintains its value after becoming a radio 8183 input.value = "t"; 8184 input.setAttribute( "type", "radio" ); 8185 support.radioValue = input.value === "t"; 8186} )(); 8187 8188 8189var rreturn = /\r/g, 8190 rspaces = /[\x20\t\r\n\f]+/g; 8191 8192jQuery.fn.extend( { 8193 val: function( value ) { 8194 var hooks, ret, isFunction, 8195 elem = this[ 0 ]; 8196 8197 if ( !arguments.length ) { 8198 if ( elem ) { 8199 hooks = jQuery.valHooks[ elem.type ] || 8200 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 8201 8202 if ( 8203 hooks && 8204 "get" in hooks && 8205 ( ret = hooks.get( elem, "value" ) ) !== undefined 8206 ) { 8207 return ret; 8208 } 8209 8210 ret = elem.value; 8211 8212 return typeof ret === "string" ? 8213 8214 // handle most common string cases 8215 ret.replace( rreturn, "" ) : 8216 8217 // handle cases where value is null/undef or number 8218 ret == null ? "" : ret; 8219 } 8220 8221 return; 8222 } 8223 8224 isFunction = jQuery.isFunction( value ); 8225 8226 return this.each( function( i ) { 8227 var val; 8228 8229 if ( this.nodeType !== 1 ) { 8230 return; 8231 } 8232 8233 if ( isFunction ) { 8234 val = value.call( this, i, jQuery( this ).val() ); 8235 } else { 8236 val = value; 8237 } 8238 8239 // Treat null/undefined as ""; convert numbers to string 8240 if ( val == null ) { 8241 val = ""; 8242 } else if ( typeof val === "number" ) { 8243 val += ""; 8244 } else if ( jQuery.isArray( val ) ) { 8245 val = jQuery.map( val, function( value ) { 8246 return value == null ? "" : value + ""; 8247 } ); 8248 } 8249 8250 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 8251 8252 // If set returns undefined, fall back to normal setting
vendor: 4,648 bytes, lines 8253-8443
8253 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 8254 this.value = val; 8255 } 8256 } ); 8257 } 8258} ); 8259 8260jQuery.extend( { 8261 valHooks: { 8262 option: { 8263 get: function( elem ) { 8264 var val = jQuery.find.attr( elem, "value" ); 8265 return val != null ? 8266 val : 8267 8268 // Support: IE10-11+ 8269 // option.text throws exceptions (#14686, #14858) 8270 // Strip and collapse whitespace 8271 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 8272 jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); 8273 } 8274 }, 8275 select: { 8276 get: function( elem ) { 8277 var value, option, 8278 options = elem.options, 8279 index = elem.selectedIndex, 8280 one = elem.type === "select-one" || index < 0, 8281 values = one ? null : [], 8282 max = one ? index + 1 : options.length, 8283 i = index < 0 ? 8284 max : 8285 one ? index : 0; 8286 8287 // Loop through all the selected options 8288 for ( ; i < max; i++ ) { 8289 option = options[ i ]; 8290 8291 // oldIE doesn't update selected after form reset (#2551) 8292 if ( ( option.selected || i === index ) && 8293 8294 // Don't return options that are disabled or in a disabled optgroup 8295 ( support.optDisabled ? 8296 !option.disabled : 8297 option.getAttribute( "disabled" ) === null ) && 8298 ( !option.parentNode.disabled || 8299 !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 8300 8301 // Get the specific value for the option 8302 value = jQuery( option ).val(); 8303 8304 // We don't need an array for one selects 8305 if ( one ) { 8306 return value; 8307 } 8308 8309 // Multi-Selects return an array 8310 values.push( value ); 8311 } 8312 } 8313 8314 return values; 8315 }, 8316 8317 set: function( elem, value ) { 8318 var optionSet, option, 8319 options = elem.options, 8320 values = jQuery.makeArray( value ), 8321 i = options.length; 8322 8323 while ( i-- ) { 8324 option = options[ i ]; 8325 8326 if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { 8327 8328 // Support: IE6 8329 // When new option element is added to select box we need to 8330 // force reflow of newly added node in order to workaround delay 8331 // of initialization properties 8332 try { 8333 option.selected = optionSet = true; 8334 8335 } catch ( _ ) { 8336 8337 // Will be executed only in IE6 8338 option.scrollHeight; 8339 } 8340 8341 } else { 8342 option.selected = false; 8343 } 8344 } 8345 8346 // Force browsers to behave consistently when non-matching value is set 8347 if ( !optionSet ) { 8348 elem.selectedIndex = -1; 8349 } 8350 8351 return options; 8352 } 8353 } 8354 } 8355} ); 8356 8357// Radios and checkboxes getter/setter 8358jQuery.each( [ "radio", "checkbox" ], function() { 8359 jQuery.valHooks[ this ] = { 8360 set: function( elem, value ) { 8361 if ( jQuery.isArray( value ) ) { 8362 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 8363 } 8364 } 8365 }; 8366 if ( !support.checkOn ) { 8367 jQuery.valHooks[ this ].get = function( elem ) { 8368 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 8369 }; 8370 } 8371} ); 8372 8373 8374 8375 8376var nodeHook, boolHook, 8377 attrHandle = jQuery.expr.attrHandle, 8378 ruseDefault = /^(?:checked|selected)$/i, 8379 getSetAttribute = support.getSetAttribute, 8380 getSetInput = support.input; 8381 8382jQuery.fn.extend( { 8383 attr: function( name, value ) { 8384 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 8385 }, 8386 8387 removeAttr: function( name ) { 8388 return this.each( function() { 8389 jQuery.removeAttr( this, name ); 8390 } ); 8391 } 8392} ); 8393 8394jQuery.extend( { 8395 attr: function( elem, name, value ) { 8396 var ret, hooks, 8397 nType = elem.nodeType; 8398 8399 // Don't get/set attributes on text, comment and attribute nodes 8400 if ( nType === 3 || nType === 8 || nType === 2 ) { 8401 return; 8402 } 8403 8404 // Fallback to prop when attributes are not supported 8405 if ( typeof elem.getAttribute === "undefined" ) { 8406 return jQuery.prop( elem, name, value ); 8407 } 8408 8409 // All attributes are lowercase 8410 // Grab necessary hook if one is defined 8411 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 8412 name = name.toLowerCase(); 8413 hooks = jQuery.attrHooks[ name ] || 8414 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); 8415 } 8416 8417 if ( value !== undefined ) { 8418 if ( value === null ) { 8419 jQuery.removeAttr( elem, name ); 8420 return; 8421 } 8422 8423 if ( hooks && "set" in hooks && 8424 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 8425 return ret; 8426 } 8427 8428 elem.setAttribute( name, value + "" ); 8429 return value; 8430 } 8431 8432 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 8433 return ret; 8434 } 8435 8436 ret = jQuery.find.attr( elem, name ); 8437 8438 // Non-existent attributes return null, we normalize to undefined 8439 return ret == null ? undefined : ret; 8440 }, 8441 8442 attrHooks: { 8443 type: {
vendor: 4,457 bytes, lines 8444-8610
8444 set: function( elem, value ) { 8445 if ( !support.radioValue && value === "radio" && 8446 jQuery.nodeName( elem, "input" ) ) { 8447 8448 // Setting the type on a radio button after the value resets the value in IE8-9 8449 // Reset value to default in case type is set after value during creation 8450 var val = elem.value; 8451 elem.setAttribute( "type", value ); 8452 if ( val ) { 8453 elem.value = val; 8454 } 8455 return value; 8456 } 8457 } 8458 } 8459 }, 8460 8461 removeAttr: function( elem, value ) { 8462 var name, propName, 8463 i = 0, 8464 attrNames = value && value.match( rnotwhite ); 8465 8466 if ( attrNames && elem.nodeType === 1 ) { 8467 while ( ( name = attrNames[ i++ ] ) ) { 8468 propName = jQuery.propFix[ name ] || name; 8469 8470 // Boolean attributes get special treatment (#10870) 8471 if ( jQuery.expr.match.bool.test( name ) ) { 8472 8473 // Set corresponding property to false 8474 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 8475 elem[ propName ] = false; 8476 8477 // Support: IE<9 8478 // Also clear defaultChecked/defaultSelected (if appropriate) 8479 } else { 8480 elem[ jQuery.camelCase( "default-" + name ) ] = 8481 elem[ propName ] = false; 8482 } 8483 8484 // See #9699 for explanation of this approach (setting first, then removal) 8485 } else { 8486 jQuery.attr( elem, name, "" ); 8487 } 8488 8489 elem.removeAttribute( getSetAttribute ? name : propName ); 8490 } 8491 } 8492 } 8493} ); 8494 8495// Hooks for boolean attributes 8496boolHook = { 8497 set: function( elem, value, name ) { 8498 if ( value === false ) { 8499 8500 // Remove boolean attributes when set to false 8501 jQuery.removeAttr( elem, name ); 8502 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 8503 8504 // IE<8 needs the *property* name 8505 elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); 8506 8507 } else { 8508 8509 // Support: IE<9 8510 // Use defaultChecked and defaultSelected for oldIE 8511 elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; 8512 } 8513 return name; 8514 } 8515}; 8516 8517jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 8518 var getter = attrHandle[ name ] || jQuery.find.attr; 8519 8520 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 8521 attrHandle[ name ] = function( elem, name, isXML ) { 8522 var ret, handle; 8523 if ( !isXML ) { 8524 8525 // Avoid an infinite loop by temporarily removing this function from the getter 8526 handle = attrHandle[ name ]; 8527 attrHandle[ name ] = ret; 8528 ret = getter( elem, name, isXML ) != null ? 8529 name.toLowerCase() : 8530 null; 8531 attrHandle[ name ] = handle; 8532 } 8533 return ret; 8534 }; 8535 } else { 8536 attrHandle[ name ] = function( elem, name, isXML ) { 8537 if ( !isXML ) { 8538 return elem[ jQuery.camelCase( "default-" + name ) ] ? 8539 name.toLowerCase() : 8540 null; 8541 } 8542 }; 8543 } 8544} ); 8545 8546// fix oldIE attroperties 8547if ( !getSetInput || !getSetAttribute ) { 8548 jQuery.attrHooks.value = { 8549 set: function( elem, value, name ) { 8550 if ( jQuery.nodeName( elem, "input" ) ) { 8551 8552 // Does not return so that setAttribute is also used 8553 elem.defaultValue = value; 8554 } else { 8555 8556 // Use nodeHook if defined (#1954); otherwise setAttribute is fine 8557 return nodeHook && nodeHook.set( elem, value, name ); 8558 } 8559 } 8560 }; 8561} 8562 8563// IE6/7 do not support getting/setting some attributes with get/setAttribute 8564if ( !getSetAttribute ) { 8565 8566 // Use this for any attribute in IE6/7 8567 // This fixes almost every IE6/7 issue 8568 nodeHook = { 8569 set: function( elem, value, name ) { 8570 8571 // Set the existing or create a new attribute node 8572 var ret = elem.getAttributeNode( name ); 8573 if ( !ret ) { 8574 elem.setAttributeNode( 8575 ( ret = elem.ownerDocument.createAttribute( name ) ) 8576 ); 8577 } 8578 8579 ret.value = value += ""; 8580 8581 // Break association with cloned elements by also using setAttribute (#9646) 8582 if ( name === "value" || value === elem.getAttribute( name ) ) { 8583 return value; 8584 } 8585 } 8586 }; 8587 8588 // Some attributes are constructed with empty-string values when not defined 8589 attrHandle.id = attrHandle.name = attrHandle.coords = 8590 function( elem, name, isXML ) { 8591 var ret; 8592 if ( !isXML ) { 8593 return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ? 8594 ret.value : 8595 null; 8596 } 8597 }; 8598 8599 // Fixing value retrieval on a button requires this module 8600 jQuery.valHooks.button = { 8601 get: function( elem, name ) { 8602 var ret = elem.getAttributeNode( name ); 8603 if ( ret && ret.specified ) { 8604 return ret.value; 8605 } 8606 }, 8607 set: nodeHook.set 8608 }; 8609 8610 // Set contenteditable to false on removals(#10429)
8611 // Setting to empty string throws an error as an invalid value 8612 jQuery.attrHooks.contenteditable = { 8613 set: function( elem, value, name ) { 8614 nodeHook.set( elem, value === "" ? false : value, name ); 8615 } 8616 }; 8617 8618 // Set width and height to auto instead of 0 on empty string( Bug #8150 ) 8619 // This is for removals 8620 jQuery.each( [ "width", "height" ], function( i, name ) { 8621 jQuery.attrHooks[ name ] = { 8622 set: function( elem, value ) { 8623 if ( value === "" ) { 8624 elem.setAttribute( name, "auto" ); 8625 return value; 8626 } 8627 } 8628 }; 8629 } ); 8630} 8631 8632if ( !support.style ) { 8633 jQuery.attrHooks.style = { 8634 get: function( elem ) { 8635 8636 // Return undefined in the case of empty string 8637 // Note: IE uppercases css property names, but if we were to .toLowerCase() 8638 // .cssText, that would destroy case sensitivity in URL's, like in "background" 8639 return elem.style.cssText || undefined; 8640 }, 8641 set: function( elem, value ) { 8642 return ( elem.style.cssText = value + "" ); 8643 } 8644 }; 8645} 8646 8647 8648 8649 8650var rfocusable = /^(?:input|select|textarea|button|object)$/i, 8651 rclickable = /^(?:a|area)$/i; 8652 8653jQuery.fn.extend( { 8654 prop: function( name, value ) { 8655 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 8656 }, 8657 8658 removeProp: function( name ) { 8659 name = jQuery.propFix[ name ] || name; 8660 return this.each( function() { 8661 8662 // try/catch handles cases where IE balks (such as removing a property on window) 8663 try { 8664 this[ name ] = undefined; 8665 delete this[ name ]; 8666 } catch ( e ) {} 8667 } ); 8668 } 8669} ); 8670 8671jQuery.extend( { 8672 prop: function( elem, name, value ) { 8673 var ret, hooks, 8674 nType = elem.nodeType; 8675 8676 // Don't get/set properties on text, comment and attribute nodes 8677 if ( nType === 3 || nType === 8 || nType === 2 ) { 8678 return; 8679 } 8680 8681 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 8682 8683 // Fix name and attach hooks 8684 name = jQuery.propFix[ name ] || name; 8685 hooks = jQuery.propHooks[ name ]; 8686 } 8687 8688 if ( value !== undefined ) { 8689 if ( hooks && "set" in hooks && 8690 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 8691 return ret; 8692 } 8693 8694 return ( elem[ name ] = value ); 8695 } 8696 8697 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 8698 return ret; 8699 } 8700 8701 return elem[ name ]; 8702 }, 8703 8704 propHooks: { 8705 tabIndex: { 8706 get: function( elem ) { 8707 8708 // elem.tabIndex doesn't always return the 8709 // correct value when it hasn't been explicitly set 8710 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 8711 // Use proper attribute retrieval(#12072) 8712 var tabindex = jQuery.find.attr( elem, "tabindex" ); 8713 8714 return tabindex ? 8715 parseInt( tabindex, 10 ) : 8716 rfocusable.test( elem.nodeName ) || 8717 rclickable.test( elem.nodeName ) && elem.href ? 8718 0 : 8719 -1; 8720 } 8721 } 8722 }, 8723 8724 propFix: { 8725 "for": "htmlFor", 8726 "class": "className" 8727 } 8728} ); 8729 8730// Some attributes require a special call on IE 8731// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 8732if ( !support.hrefNormalized ) { 8733 8734 // href/src property should get the full normalized URL (#10299/#12915) 8735 jQuery.each( [ "href", "src" ], function( i, name ) { 8736 jQuery.propHooks[ name ] = { 8737 get: function( elem ) { 8738 return elem.getAttribute( name, 4 ); 8739 } 8740 }; 8741 } ); 8742} 8743 8744// Support: Safari, IE9+ 8745// Accessing the selectedIndex property 8746// forces the browser to respect setting selected 8747// on the option 8748// The getter ensures a default option is selected 8749// when in an optgroup 8750if ( !support.optSelected ) { 8751 jQuery.propHooks.selected = { 8752 get: function( elem ) { 8753 var parent = elem.parentNode; 8754 8755 if ( parent ) { 8756 parent.selectedIndex; 8757 8758 // Make sure that it also works with optgroups, see #5701 8759 if ( parent.parentNode ) { 8760 parent.parentNode.selectedIndex; 8761 } 8762 } 8763 return null; 8764 }, 8765 set: function( elem ) { 8766 var parent = elem.parentNode; 8767 if ( parent ) { 8768 parent.selectedIndex; 8769 8770 if ( parent.parentNode ) { 8771 parent.parentNode.selectedIndex; 8772 } 8773 } 8774 } 8775 }; 8776} 8777 8778jQuery.each( [ 8779 "tabIndex", 8780 "readOnly", 8781 "maxLength", 8782 "cellSpacing", 8783 "cellPadding", 8784 "rowSpan", 8785 "colSpan", 8786 "useMap", 8787 "frameBorder", 8788 "contentEditable" 8789], function() { 8790 jQuery.propFix[ this.toLowerCase() ] = this; 8791} ); 8792 8793// IE6/7 call enctype encoding 8794if ( !support.enctype ) { 8795 jQuery.propFix.enctype = "encoding"; 8796} 8797 8798 8799 8800 8801var rclass = /[\t\r\n\f]/g; 8802 8803function getClass( elem ) { 8804 return jQuery.attr( elem, "class" ) || ""; 8805} 8806 8807jQuery.fn.extend( { 8808 addClass: function( value ) { 8809 var classes, elem, cur, curValue, clazz, j, finalValue, 8810 i = 0; 8811 8812 if ( jQuery.isFunction( value ) ) { 8813 return this.each( function( j ) { 8814 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 8815 } ); 8816 } 8817 8818 if ( typeof value === "string" && value ) { 8819 classes = value.match( rnotwhite ) || []; 8820 8821 while ( ( elem = this[ i++ ] ) ) { 8822 curValue = getClass( elem ); 8823 cur = elem.nodeType === 1 && 8824 ( " " + curValue + " " ).replace( rclass, " " ); 8825 8826 if ( cur ) { 8827 j = 0; 8828 while ( ( clazz = classes[ j++ ] ) ) { 8829 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 8830 cur += clazz + " "; 8831 } 8832 } 8833 8834 // only assign if different to avoid unneeded rendering. 8835 finalValue = jQuery.trim( cur ); 8836 if ( curValue !== finalValue ) { 8837 jQuery.attr( elem, "class", finalValue ); 8838 } 8839 } 8840 } 8841 } 8842 8843 return this; 8844 }, 8845 8846 removeClass: function( value ) { 8847 var classes, elem, cur, curValue, clazz, j, finalValue, 8848 i = 0; 8849 8850 if ( jQuery.isFunction( value ) ) { 8851 return this.each( function( j ) { 8852 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 8853 } ); 8854 } 8855 8856 if ( !arguments.length ) { 8857 return this.attr( "class", "" ); 8858 } 8859 8860 if ( typeof value === "string" && value ) { 8861 classes = value.match( rnotwhite ) || []; 8862 8863 while ( ( elem = this[ i++ ] ) ) { 8864 curValue = getClass( elem ); 8865 8866 // This expression is here for better compressibility (see addClass) 8867 cur = elem.nodeType === 1 && 8868 ( " " + curValue + " " ).replace( rclass, " " ); 8869 8870 if ( cur ) { 8871 j = 0; 8872 while ( ( clazz = classes[ j++ ] ) ) { 8873
8874 // Remove *all* instances 8875 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 8876 cur = cur.replace( " " + clazz + " ", " " ); 8877 } 8878 } 8879 8880 // Only assign if different to avoid unneeded rendering. 8881 finalValue = jQuery.trim( cur ); 8882 if ( curValue !== finalValue ) { 8883 jQuery.attr( elem, "class", finalValue ); 8884 } 8885 } 8886 } 8887 } 8888 8889 return this; 8890 }, 8891 8892 toggleClass: function( value, stateVal ) { 8893 var type = typeof value; 8894 8895 if ( typeof stateVal === "boolean" && type === "string" ) { 8896 return stateVal ? this.addClass( value ) : this.removeClass( value ); 8897 } 8898 8899 if ( jQuery.isFunction( value ) ) { 8900 return this.each( function( i ) { 8901 jQuery( this ).toggleClass( 8902 value.call( this, i, getClass( this ), stateVal ), 8903 stateVal 8904 ); 8905 } ); 8906 } 8907 8908 return this.each( function() { 8909 var className, i, self, classNames; 8910 8911 if ( type === "string" ) { 8912 8913 // Toggle individual class names 8914 i = 0; 8915 self = jQuery( this ); 8916 classNames = value.match( rnotwhite ) || []; 8917 8918 while ( ( className = classNames[ i++ ] ) ) { 8919 8920 // Check each className given, space separated list 8921 if ( self.hasClass( className ) ) { 8922 self.removeClass( className ); 8923 } else { 8924 self.addClass( className ); 8925 } 8926 } 8927 8928 // Toggle whole class name 8929 } else if ( value === undefined || type === "boolean" ) { 8930 className = getClass( this ); 8931 if ( className ) { 8932 8933 // store className if set 8934 jQuery._data( this, "__className__", className ); 8935 } 8936 8937 // If the element has a class name or if we're passed "false", 8938 // then remove the whole classname (if there was one, the above saved it). 8939 // Otherwise bring back whatever was previously saved (if anything), 8940 // falling back to the empty string if nothing was stored. 8941 jQuery.attr( this, "class", 8942 className || value === false ? 8943 "" : 8944 jQuery._data( this, "__className__" ) || "" 8945 ); 8946 } 8947 } ); 8948 }, 8949 8950 hasClass: function( selector ) { 8951 var className, elem, 8952 i = 0; 8953 8954 className = " " + selector + " "; 8955 while ( ( elem = this[ i++ ] ) ) { 8956 if ( elem.nodeType === 1 && 8957 ( " " + getClass( elem ) + " " ).replace( rclass, " " ) 8958 .indexOf( className ) > -1 8959 ) { 8960 return true; 8961 } 8962 } 8963 8964 return false; 8965 } 8966} ); 8967 8968 8969 8970 8971// Return jQuery for attributes-only inclusion 8972 8973 8974jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + 8975 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 8976 "change select submit keydown keypress keyup error contextmenu" ).split( " " ), 8977 function( i, name ) { 8978 8979 // Handle event binding 8980 jQuery.fn[ name ] = function( data, fn ) { 8981 return arguments.length > 0 ? 8982 this.on( name, null, data, fn ) : 8983 this.trigger( name ); 8984 }; 8985} ); 8986 8987jQuery.fn.extend( { 8988 hover: function( fnOver, fnOut ) { 8989 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 8990 } 8991} ); 8992 8993 8994var location = window.location; 8995 8996var nonce = jQuery.now(); 8997 8998var rquery = ( /\?/ ); 8999 9000 9001 9002var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; 9003 9004jQuery.parseJSON = function( data ) { 9005 9006 // Attempt to parse using the native JSON parser first 9007 if ( window.JSON && window.JSON.parse ) { 9008 9009 // Support: Android 2.3 9010 // Workaround failure to string-cast null input 9011 return window.JSON.parse( data + "" ); 9012 } 9013 9014 var requireNonComma, 9015 depth = null, 9016 str = jQuery.trim( data + "" ); 9017 9018 // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains 9019 // after removing valid tokens 9020 return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { 9021 9022 // Force termination if we see a misplaced comma 9023 if ( requireNonComma && comma ) { 9024 depth = 0; 9025 } 9026 9027 // Perform no more replacements after returning to outermost depth 9028 if ( depth === 0 ) { 9029 return token; 9030 } 9031 9032 // Commas must not follow "[", "{", or "," 9033 requireNonComma = open || comma; 9034 9035 // Determine new depth 9036 // array/object open ("[" or "{"): depth += true - false (increment) 9037 // array/object close ("]" or "}"): depth += false - true (decrement) 9038 // other cases ("," or primitive): depth += true - true (numeric cast) 9039 depth += !close - !open; 9040 9041 // Remove this token 9042 return ""; 9043 } ) ) ? 9044 ( Function( "return " + str ) )() : 9045 jQuery.error( "Invalid JSON: " + data ); 9046}; 9047 9048 9049// Cross-browser xml parsing
vendor: 10,393 bytes, lines 9050-9455
9050jQuery.parseXML = function( data ) { 9051 var xml, tmp; 9052 if ( !data || typeof data !== "string" ) { 9053 return null; 9054 } 9055 try { 9056 if ( window.DOMParser ) { // Standard 9057 tmp = new window.DOMParser(); 9058 xml = tmp.parseFromString( data, "text/xml" ); 9059 } else { // IE 9060 xml = new window.ActiveXObject( "Microsoft.XMLDOM" ); 9061 xml.async = "false"; 9062 xml.loadXML( data ); 9063 } 9064 } catch ( e ) { 9065 xml = undefined; 9066 } 9067 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { 9068 jQuery.error( "Invalid XML: " + data ); 9069 } 9070 return xml; 9071}; 9072 9073 9074var 9075 rhash = /#.*$/, 9076 rts = /([?&])_=[^&]*/, 9077 9078 // IE leaves an \r character at EOL 9079 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, 9080 9081 // #7653, #8125, #8152: local protocol detection 9082 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 9083 rnoContent = /^(?:GET|HEAD)$/, 9084 rprotocol = /^\/\//, 9085 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, 9086 9087 /* Prefilters 9088 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 9089 * 2) These are called: 9090 * - BEFORE asking for a transport 9091 * - AFTER param serialization (s.data is a string if s.processData is true) 9092 * 3) key is the dataType 9093 * 4) the catchall symbol "*" can be used 9094 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 9095 */ 9096 prefilters = {}, 9097 9098 /* Transports bindings 9099 * 1) key is the dataType 9100 * 2) the catchall symbol "*" can be used 9101 * 3) selection will start with transport dataType and THEN go to "*" if needed 9102 */ 9103 transports = {}, 9104 9105 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 9106 allTypes = "*/".concat( "*" ), 9107 9108 // Document location 9109 ajaxLocation = location.href, 9110 9111 // Segment location into parts 9112 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; 9113 9114// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 9115function addToPrefiltersOrTransports( structure ) { 9116 9117 // dataTypeExpression is optional and defaults to "*" 9118 return function( dataTypeExpression, func ) { 9119 9120 if ( typeof dataTypeExpression !== "string" ) { 9121 func = dataTypeExpression; 9122 dataTypeExpression = "*"; 9123 } 9124 9125 var dataType, 9126 i = 0, 9127 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; 9128 9129 if ( jQuery.isFunction( func ) ) { 9130 9131 // For each dataType in the dataTypeExpression 9132 while ( ( dataType = dataTypes[ i++ ] ) ) { 9133 9134 // Prepend if requested 9135 if ( dataType.charAt( 0 ) === "+" ) { 9136 dataType = dataType.slice( 1 ) || "*"; 9137 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 9138 9139 // Otherwise append 9140 } else { 9141 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 9142 } 9143 } 9144 } 9145 }; 9146} 9147 9148// Base inspection function for prefilters and transports 9149function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 9150 9151 var inspected = {}, 9152 seekingTransport = ( structure === transports ); 9153 9154 function inspect( dataType ) { 9155 var selected; 9156 inspected[ dataType ] = true; 9157 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 9158 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 9159 if ( typeof dataTypeOrTransport === "string" && 9160 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 9161 9162 options.dataTypes.unshift( dataTypeOrTransport ); 9163 inspect( dataTypeOrTransport ); 9164 return false; 9165 } else if ( seekingTransport ) { 9166 return !( selected = dataTypeOrTransport ); 9167 } 9168 } ); 9169 return selected; 9170 } 9171 9172 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 9173} 9174 9175// A special extend for ajax options 9176// that takes "flat" options (not to be deep extended) 9177// Fixes #9887 9178function ajaxExtend( target, src ) { 9179 var deep, key, 9180 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 9181 9182 for ( key in src ) { 9183 if ( src[ key ] !== undefined ) { 9184 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 9185 } 9186 } 9187 if ( deep ) { 9188 jQuery.extend( true, target, deep ); 9189 } 9190 9191 return target; 9192} 9193 9194/* Handles responses to an ajax request: 9195 * - finds the right dataType (mediates between content-type and expected dataType) 9196 * - returns the corresponding response 9197 */ 9198function ajaxHandleResponses( s, jqXHR, responses ) { 9199 var firstDataType, ct, finalDataType, type, 9200 contents = s.contents, 9201 dataTypes = s.dataTypes; 9202 9203 // Remove auto dataType and get content-type in the process 9204 while ( dataTypes[ 0 ] === "*" ) { 9205 dataTypes.shift(); 9206 if ( ct === undefined ) { 9207 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 9208 } 9209 } 9210 9211 // Check if we're dealing with a known content-type 9212 if ( ct ) { 9213 for ( type in contents ) { 9214 if ( contents[ type ] && contents[ type ].test( ct ) ) { 9215 dataTypes.unshift( type ); 9216 break; 9217 } 9218 } 9219 } 9220 9221 // Check to see if we have a response for the expected dataType 9222 if ( dataTypes[ 0 ] in responses ) { 9223 finalDataType = dataTypes[ 0 ]; 9224 } else { 9225 9226 // Try convertible dataTypes 9227 for ( type in responses ) { 9228 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 9229 finalDataType = type; 9230 break; 9231 } 9232 if ( !firstDataType ) { 9233 firstDataType = type; 9234 } 9235 } 9236 9237 // Or just use first one 9238 finalDataType = finalDataType || firstDataType; 9239 } 9240 9241 // If we found a dataType 9242 // We add the dataType to the list if needed 9243 // and return the corresponding response 9244 if ( finalDataType ) { 9245 if ( finalDataType !== dataTypes[ 0 ] ) { 9246 dataTypes.unshift( finalDataType ); 9247 } 9248 return responses[ finalDataType ]; 9249 } 9250} 9251 9252/* Chain conversions given the request and the original response 9253 * Also sets the responseXXX fields on the jqXHR instance 9254 */ 9255function ajaxConvert( s, response, jqXHR, isSuccess ) { 9256 var conv2, current, conv, tmp, prev, 9257 converters = {}, 9258 9259 // Work with a copy of dataTypes in case we need to modify it for conversion 9260 dataTypes = s.dataTypes.slice(); 9261 9262 // Create converters map with lowercased keys 9263 if ( dataTypes[ 1 ] ) { 9264 for ( conv in s.converters ) { 9265 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 9266 } 9267 } 9268 9269 current = dataTypes.shift(); 9270 9271 // Convert to each sequential dataType 9272 while ( current ) { 9273 9274 if ( s.responseFields[ current ] ) { 9275 jqXHR[ s.responseFields[ current ] ] = response; 9276 } 9277 9278 // Apply the dataFilter if provided 9279 if ( !prev && isSuccess && s.dataFilter ) { 9280 response = s.dataFilter( response, s.dataType ); 9281 } 9282 9283 prev = current; 9284 current = dataTypes.shift(); 9285 9286 if ( current ) { 9287 9288 // There's only work to do if current dataType is non-auto 9289 if ( current === "*" ) { 9290 9291 current = prev; 9292 9293 // Convert response if prev dataType is non-auto and differs from current 9294 } else if ( prev !== "*" && prev !== current ) { 9295 9296 // Seek a direct converter 9297 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 9298 9299 // If none found, seek a pair 9300 if ( !conv ) { 9301 for ( conv2 in converters ) { 9302 9303 // If conv2 outputs current 9304 tmp = conv2.split( " " ); 9305 if ( tmp[ 1 ] === current ) { 9306 9307 // If prev can be converted to accepted input 9308 conv = converters[ prev + " " + tmp[ 0 ] ] || 9309 converters[ "* " + tmp[ 0 ] ]; 9310 if ( conv ) { 9311 9312 // Condense equivalence converters 9313 if ( conv === true ) { 9314 conv = converters[ conv2 ]; 9315 9316 // Otherwise, insert the intermediate dataType 9317 } else if ( converters[ conv2 ] !== true ) { 9318 current = tmp[ 0 ]; 9319 dataTypes.unshift( tmp[ 1 ] ); 9320 } 9321 break; 9322 } 9323 } 9324 } 9325 } 9326 9327 // Apply converter (if not an equivalence) 9328 if ( conv !== true ) { 9329 9330 // Unless errors are allowed to bubble, catch and return them 9331 if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation 9332 response = conv( response ); 9333 } else { 9334 try { 9335 response = conv( response ); 9336 } catch ( e ) { 9337 return { 9338 state: "parsererror", 9339 error: conv ? e : "No conversion from " + prev + " to " + current 9340 }; 9341 } 9342 } 9343 } 9344 } 9345 } 9346 } 9347 9348 return { state: "success", data: response }; 9349} 9350 9351jQuery.extend( { 9352 9353 // Counter for holding the number of active queries 9354 active: 0, 9355 9356 // Last-Modified header cache for next request 9357 lastModified: {}, 9358 etag: {}, 9359 9360 ajaxSettings: { 9361 url: ajaxLocation, 9362 type: "GET", 9363 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), 9364 global: true, 9365 processData: true, 9366 async: true, 9367 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 9368 /* 9369 timeout: 0, 9370 data: null, 9371 dataType: null, 9372 username: null, 9373 password: null, 9374 cache: null, 9375 throws: false, 9376 traditional: false, 9377 headers: {}, 9378 */ 9379 9380 accepts: { 9381 "*": allTypes, 9382 text: "text/plain", 9383 html: "text/html", 9384 xml: "application/xml, text/xml", 9385 json: "application/json, text/javascript" 9386 }, 9387 9388 contents: { 9389 xml: /\bxml\b/, 9390 html: /\bhtml/, 9391 json: /\bjson\b/ 9392 }, 9393 9394 responseFields: { 9395 xml: "responseXML", 9396 text: "responseText", 9397 json: "responseJSON" 9398 }, 9399 9400 // Data converters 9401 // Keys separate source (or catchall "*") and destination types with a single space 9402 converters: { 9403 9404 // Convert anything to text 9405 "* text": String, 9406 9407 // Text to html (true = no transformation) 9408 "text html": true, 9409 9410 // Evaluate text as a json expression 9411 "text json": jQuery.parseJSON, 9412 9413 // Parse text as xml 9414 "text xml": jQuery.parseXML 9415 }, 9416 9417 // For options that shouldn't be deep extended: 9418 // you can add your own custom options here if 9419 // and when you create one that shouldn't be 9420 // deep extended (see ajaxExtend) 9421 flatOptions: { 9422 url: true, 9423 context: true 9424 } 9425 }, 9426 9427 // Creates a full fledged settings object into target 9428 // with both ajaxSettings and settings fields. 9429 // If target is omitted, writes into ajaxSettings. 9430 ajaxSetup: function( target, settings ) { 9431 return settings ? 9432 9433 // Building a settings object 9434 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 9435 9436 // Extending ajaxSettings 9437 ajaxExtend( jQuery.ajaxSettings, target ); 9438 }, 9439 9440 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 9441 ajaxTransport: addToPrefiltersOrTransports( transports ), 9442 9443 // Main method 9444 ajax: function( url, options ) { 9445 9446 // If url is an object, simulate pre-1.5 signature 9447 if ( typeof url === "object" ) { 9448 options = url; 9449 url = undefined; 9450 } 9451 9452 // Force options to be an object 9453 options = options || {}; 9454 9455 var
vendor: 5,146 bytes, lines 9456-9646
9456 9457 // Cross-domain detection vars 9458 parts, 9459 9460 // Loop variable 9461 i, 9462 9463 // URL without anti-cache param 9464 cacheURL, 9465 9466 // Response headers as string 9467 responseHeadersString, 9468 9469 // timeout handle 9470 timeoutTimer, 9471 9472 // To know if global events are to be dispatched 9473 fireGlobals, 9474 9475 transport, 9476 9477 // Response headers 9478 responseHeaders, 9479 9480 // Create the final options object 9481 s = jQuery.ajaxSetup( {}, options ), 9482 9483 // Callbacks context 9484 callbackContext = s.context || s, 9485 9486 // Context for global events is callbackContext if it is a DOM node or jQuery collection 9487 globalEventContext = s.context && 9488 ( callbackContext.nodeType || callbackContext.jquery ) ? 9489 jQuery( callbackContext ) : 9490 jQuery.event, 9491 9492 // Deferreds 9493 deferred = jQuery.Deferred(), 9494 completeDeferred = jQuery.Callbacks( "once memory" ), 9495 9496 // Status-dependent callbacks 9497 statusCode = s.statusCode || {}, 9498 9499 // Headers (they are sent all at once) 9500 requestHeaders = {}, 9501 requestHeadersNames = {}, 9502 9503 // The jqXHR state 9504 state = 0, 9505 9506 // Default abort message 9507 strAbort = "canceled", 9508 9509 // Fake xhr 9510 jqXHR = { 9511 readyState: 0, 9512 9513 // Builds headers hashtable if needed 9514 getResponseHeader: function( key ) { 9515 var match; 9516 if ( state === 2 ) { 9517 if ( !responseHeaders ) { 9518 responseHeaders = {}; 9519 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 9520 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; 9521 } 9522 } 9523 match = responseHeaders[ key.toLowerCase() ]; 9524 } 9525 return match == null ? null : match; 9526 }, 9527 9528 // Raw string 9529 getAllResponseHeaders: function() { 9530 return state === 2 ? responseHeadersString : null; 9531 }, 9532 9533 // Caches the header 9534 setRequestHeader: function( name, value ) { 9535 var lname = name.toLowerCase(); 9536 if ( !state ) { 9537 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 9538 requestHeaders[ name ] = value; 9539 } 9540 return this; 9541 }, 9542 9543 // Overrides response content-type header 9544 overrideMimeType: function( type ) { 9545 if ( !state ) { 9546 s.mimeType = type; 9547 } 9548 return this; 9549 }, 9550 9551 // Status-dependent callbacks 9552 statusCode: function( map ) { 9553 var code; 9554 if ( map ) { 9555 if ( state < 2 ) { 9556 for ( code in map ) { 9557 9558 // Lazy-add the new callback in a way that preserves old ones 9559 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 9560 } 9561 } else { 9562 9563 // Execute the appropriate callbacks 9564 jqXHR.always( map[ jqXHR.status ] ); 9565 } 9566 } 9567 return this; 9568 }, 9569 9570 // Cancel the request 9571 abort: function( statusText ) { 9572 var finalText = statusText || strAbort; 9573 if ( transport ) { 9574 transport.abort( finalText ); 9575 } 9576 done( 0, finalText ); 9577 return this; 9578 } 9579 }; 9580 9581 // Attach deferreds 9582 deferred.promise( jqXHR ).complete = completeDeferred.add; 9583 jqXHR.success = jqXHR.done; 9584 jqXHR.error = jqXHR.fail; 9585 9586 // Remove hash character (#7531: and string promotion) 9587 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) 9588 // Handle falsy url in the settings object (#10093: consistency with old signature) 9589 // We also use the url parameter if available 9590 s.url = ( ( url || s.url || ajaxLocation ) + "" ) 9591 .replace( rhash, "" ) 9592 .replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); 9593 9594 // Alias method option to type as per ticket #12004 9595 s.type = options.method || options.type || s.method || s.type; 9596 9597 // Extract dataTypes list 9598 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; 9599 9600 // A cross-domain request is in order when we have a protocol:host:port mismatch 9601 if ( s.crossDomain == null ) { 9602 parts = rurl.exec( s.url.toLowerCase() ); 9603 s.crossDomain = !!( parts && 9604 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || 9605 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== 9606 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) 9607 ); 9608 } 9609 9610 // Convert data if not already a string 9611 if ( s.data && s.processData && typeof s.data !== "string" ) { 9612 s.data = jQuery.param( s.data, s.traditional ); 9613 } 9614 9615 // Apply prefilters 9616 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 9617 9618 // If request was aborted inside a prefilter, stop there 9619 if ( state === 2 ) { 9620 return jqXHR; 9621 } 9622 9623 // We can fire global events as of now if asked to 9624 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 9625 fireGlobals = jQuery.event && s.global; 9626 9627 // Watch for a new set of requests 9628 if ( fireGlobals && jQuery.active++ === 0 ) { 9629 jQuery.event.trigger( "ajaxStart" ); 9630 } 9631 9632 // Uppercase the type 9633 s.type = s.type.toUpperCase(); 9634 9635 // Determine if request has content 9636 s.hasContent = !rnoContent.test( s.type ); 9637 9638 // Save the URL in case we're toying with the If-Modified-Since 9639 // and/or If-None-Match header later on 9640 cacheURL = s.url; 9641 9642 // More options handling for requests with no content 9643 if ( !s.hasContent ) { 9644 9645 // If data is available, append data to url 9646 if ( s.data ) {
vendor: 8,244 bytes, lines 9647-9986
9647 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); 9648 9649 // #9682: remove data so that it's not used in an eventual retry 9650 delete s.data; 9651 } 9652 9653 // Add anti-cache in url if needed 9654 if ( s.cache === false ) { 9655 s.url = rts.test( cacheURL ) ? 9656 9657 // If there is already a '_' parameter, set its value 9658 cacheURL.replace( rts, "$1_=" + nonce++ ) : 9659 9660 // Otherwise add one to the end 9661 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; 9662 } 9663 } 9664 9665 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9666 if ( s.ifModified ) { 9667 if ( jQuery.lastModified[ cacheURL ] ) { 9668 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 9669 } 9670 if ( jQuery.etag[ cacheURL ] ) { 9671 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 9672 } 9673 } 9674 9675 // Set the correct header, if data is being sent 9676 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 9677 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 9678 } 9679 9680 // Set the Accepts header for the server, depending on the dataType 9681 jqXHR.setRequestHeader( 9682 "Accept", 9683 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 9684 s.accepts[ s.dataTypes[ 0 ] ] + 9685 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 9686 s.accepts[ "*" ] 9687 ); 9688 9689 // Check for headers option 9690 for ( i in s.headers ) { 9691 jqXHR.setRequestHeader( i, s.headers[ i ] ); 9692 } 9693 9694 // Allow custom headers/mimetypes and early abort 9695 if ( s.beforeSend && 9696 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 9697 9698 // Abort if not done already and return 9699 return jqXHR.abort(); 9700 } 9701 9702 // aborting is no longer a cancellation 9703 strAbort = "abort"; 9704 9705 // Install callbacks on deferreds 9706 for ( i in { success: 1, error: 1, complete: 1 } ) { 9707 jqXHR[ i ]( s[ i ] ); 9708 } 9709 9710 // Get transport 9711 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 9712 9713 // If no transport, we auto-abort 9714 if ( !transport ) { 9715 done( -1, "No Transport" ); 9716 } else { 9717 jqXHR.readyState = 1; 9718 9719 // Send global event 9720 if ( fireGlobals ) { 9721 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 9722 } 9723 9724 // If request was aborted inside ajaxSend, stop there 9725 if ( state === 2 ) { 9726 return jqXHR; 9727 } 9728 9729 // Timeout 9730 if ( s.async && s.timeout > 0 ) { 9731 timeoutTimer = window.setTimeout( function() { 9732 jqXHR.abort( "timeout" ); 9733 }, s.timeout ); 9734 } 9735 9736 try { 9737 state = 1; 9738 transport.send( requestHeaders, done ); 9739 } catch ( e ) { 9740 9741 // Propagate exception as error if not done 9742 if ( state < 2 ) { 9743 done( -1, e ); 9744 9745 // Simply rethrow otherwise 9746 } else { 9747 throw e; 9748 } 9749 } 9750 } 9751 9752 // Callback for when everything is done 9753 function done( status, nativeStatusText, responses, headers ) { 9754 var isSuccess, success, error, response, modified, 9755 statusText = nativeStatusText; 9756 9757 // Called once 9758 if ( state === 2 ) { 9759 return; 9760 } 9761 9762 // State is "done" now 9763 state = 2; 9764 9765 // Clear timeout if it exists 9766 if ( timeoutTimer ) { 9767 window.clearTimeout( timeoutTimer ); 9768 } 9769 9770 // Dereference transport for early garbage collection 9771 // (no matter how long the jqXHR object will be used) 9772 transport = undefined; 9773 9774 // Cache response headers 9775 responseHeadersString = headers || ""; 9776 9777 // Set readyState 9778 jqXHR.readyState = status > 0 ? 4 : 0; 9779 9780 // Determine if successful 9781 isSuccess = status >= 200 && status < 300 || status === 304; 9782 9783 // Get response data 9784 if ( responses ) { 9785 response = ajaxHandleResponses( s, jqXHR, responses ); 9786 } 9787 9788 // Convert no matter what (that way responseXXX fields are always set) 9789 response = ajaxConvert( s, response, jqXHR, isSuccess ); 9790 9791 // If successful, handle type chaining 9792 if ( isSuccess ) { 9793 9794 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9795 if ( s.ifModified ) { 9796 modified = jqXHR.getResponseHeader( "Last-Modified" ); 9797 if ( modified ) { 9798 jQuery.lastModified[ cacheURL ] = modified; 9799 } 9800 modified = jqXHR.getResponseHeader( "etag" ); 9801 if ( modified ) { 9802 jQuery.etag[ cacheURL ] = modified; 9803 } 9804 } 9805 9806 // if no content 9807 if ( status === 204 || s.type === "HEAD" ) { 9808 statusText = "nocontent"; 9809 9810 // if not modified 9811 } else if ( status === 304 ) { 9812 statusText = "notmodified"; 9813 9814 // If we have data, let's convert it 9815 } else { 9816 statusText = response.state; 9817 success = response.data; 9818 error = response.error; 9819 isSuccess = !error; 9820 } 9821 } else { 9822 9823 // We extract error from statusText 9824 // then normalize statusText and status for non-aborts 9825 error = statusText; 9826 if ( status || !statusText ) { 9827 statusText = "error"; 9828 if ( status < 0 ) { 9829 status = 0; 9830 } 9831 } 9832 } 9833 9834 // Set data for the fake xhr object 9835 jqXHR.status = status; 9836 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 9837 9838 // Success/Error 9839 if ( isSuccess ) { 9840 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 9841 } else { 9842 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 9843 } 9844 9845 // Status-dependent callbacks 9846 jqXHR.statusCode( statusCode ); 9847 statusCode = undefined; 9848 9849 if ( fireGlobals ) { 9850 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 9851 [ jqXHR, s, isSuccess ? success : error ] ); 9852 } 9853 9854 // Complete 9855 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 9856 9857 if ( fireGlobals ) { 9858 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 9859 9860 // Handle the global AJAX counter 9861 if ( !( --jQuery.active ) ) { 9862 jQuery.event.trigger( "ajaxStop" ); 9863 } 9864 } 9865 } 9866 9867 return jqXHR; 9868 }, 9869 9870 getJSON: function( url, data, callback ) { 9871 return jQuery.get( url, data, callback, "json" ); 9872 }, 9873 9874 getScript: function( url, callback ) { 9875 return jQuery.get( url, undefined, callback, "script" ); 9876 } 9877} ); 9878 9879jQuery.each( [ "get", "post" ], function( i, method ) { 9880 jQuery[ method ] = function( url, data, callback, type ) { 9881 9882 // shift arguments if data argument was omitted 9883 if ( jQuery.isFunction( data ) ) { 9884 type = type || callback; 9885 callback = data; 9886 data = undefined; 9887 } 9888 9889 // The url can be an options object (which then must have .url) 9890 return jQuery.ajax( jQuery.extend( { 9891 url: url, 9892 type: method, 9893 dataType: type, 9894 data: data, 9895 success: callback 9896 }, jQuery.isPlainObject( url ) && url ) ); 9897 }; 9898} ); 9899 9900 9901jQuery._evalUrl = function( url ) { 9902 return jQuery.ajax( { 9903 url: url, 9904 9905 // Make this explicit, since user can override this through ajaxSetup (#11264) 9906 type: "GET", 9907 dataType: "script", 9908 cache: true, 9909 async: false, 9910 global: false, 9911 "throws": true 9912 } ); 9913}; 9914 9915 9916jQuery.fn.extend( { 9917 wrapAll: function( html ) { 9918 if ( jQuery.isFunction( html ) ) { 9919 return this.each( function( i ) { 9920 jQuery( this ).wrapAll( html.call( this, i ) ); 9921 } ); 9922 } 9923 9924 if ( this[ 0 ] ) { 9925 9926 // The elements to wrap the target around 9927 var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 9928 9929 if ( this[ 0 ].parentNode ) { 9930 wrap.insertBefore( this[ 0 ] ); 9931 } 9932 9933 wrap.map( function() { 9934 var elem = this; 9935 9936 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { 9937 elem = elem.firstChild; 9938 } 9939 9940 return elem; 9941 } ).append( this ); 9942 } 9943 9944 return this; 9945 }, 9946 9947 wrapInner: function( html ) { 9948 if ( jQuery.isFunction( html ) ) { 9949 return this.each( function( i ) { 9950 jQuery( this ).wrapInner( html.call( this, i ) ); 9951 } ); 9952 } 9953 9954 return this.each( function() { 9955 var self = jQuery( this ), 9956 contents = self.contents(); 9957 9958 if ( contents.length ) { 9959 contents.wrapAll( html ); 9960 9961 } else { 9962 self.append( html ); 9963 } 9964 } ); 9965 }, 9966 9967 wrap: function( html ) { 9968 var isFunction = jQuery.isFunction( html ); 9969 9970 return this.each( function( i ) { 9971 jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); 9972 } ); 9973 }, 9974 9975 unwrap: function() { 9976 return this.parent().each( function() { 9977 if ( !jQuery.nodeName( this, "body" ) ) { 9978 jQuery( this ).replaceWith( this.childNodes ); 9979 } 9980 } ).end(); 9981 } 9982} ); 9983 9984 9985function getDisplay( elem ) { 9986 return elem.style && elem.style.display || jQuery.css( elem, "dis
9986play" ); 9987} 9988 9989function filterHidden( elem ) { 9990 9991 // Disconnected elements are considered hidden 9992 if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) { 9993 return true; 9994 } 9995 while ( elem && elem.nodeType === 1 ) { 9996 if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) { 9997 return true; 9998 } 9999 elem = elem.parentNode; 10000 } 10001 return false; 10002} 10003 10004jQuery.expr.filters.hidden = function( elem ) { 10005 10006 // Support: Opera <= 12.12 10007 // Opera reports offsetWidths and offsetHeights less than zero on some elements 10008 return support.reliableHiddenOffsets() ? 10009 ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 && 10010 !elem.getClientRects().length ) : 10011 filterHidden( elem ); 10012}; 10013 10014jQuery.expr.filters.visible = function( elem ) { 10015 return !jQuery.expr.filters.hidden( elem ); 10016}; 10017 10018 10019 10020 10021var r20 = /%20/g, 10022 rbracket = /\[\]$/, 10023 rCRLF = /\r?\n/g, 10024 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 10025 rsubmittable = /^(?:input|select|textarea|keygen)/i; 10026 10027function buildParams( prefix, obj, traditional, add ) { 10028 var name; 10029 10030 if ( jQuery.isArray( obj ) ) { 10031 10032 // Serialize array item. 10033 jQuery.each( obj, function( i, v ) { 10034 if ( traditional || rbracket.test( prefix ) ) { 10035 10036 // Treat each array item as a scalar. 10037 add( prefix, v ); 10038 10039 } else { 10040 10041 // Item is non-scalar (array or object), encode its numeric index. 10042 buildParams( 10043 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 10044 v, 10045 traditional, 10046 add 10047 ); 10048 } 10049 } ); 10050 10051 } else if ( !traditional && jQuery.type( obj ) === "object" ) { 10052 10053 // Serialize object item. 10054 for ( name in obj ) { 10055 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 10056 } 10057 10058 } else { 10059 10060 // Serialize scalar item. 10061 add( prefix, obj ); 10062 } 10063} 10064 10065// Serialize an array of form elements or a set of 10066// key/values into a query string 10067jQuery.param = function( a, traditional ) { 10068 var prefix, 10069 s = [], 10070 add = function( key, value ) { 10071 10072 // If value is a function, invoke it and return its value 10073 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); 10074 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 10075 }; 10076 10077 // Set traditional to true for jQuery <= 1.3.2 behavior. 10078 if ( traditional === undefined ) { 10079 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 10080 } 10081 10082 // If an array was passed in, assume that it is an array of form elements. 10083 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 10084 10085 // Serialize the form elements 10086 jQuery.each( a, function() { 10087 add( this.name, this.value ); 10088 } ); 10089 10090 } else { 10091 10092 // If traditional, encode the "old" way (the way 1.3.2 or older 10093 // did it), otherwise encode params recursively. 10094 for ( prefix in a ) { 10095 buildParams( prefix, a[ prefix ], traditional, add ); 10096 } 10097 } 10098 10099 // Return the resulting serialization 10100 return s.join( "&" ).replace( r20, "+" ); 10101}; 10102 10103jQuery.fn.extend( { 10104 serialize: function() { 10105 return jQuery.param( this.serializeArray() ); 10106 }, 10107 serializeArray: function() { 10108 return this.map( function() { 10109 10110 // Can add propHook for "elements" to filter or add form elements 10111 var elements = jQuery.prop( this, "elements" ); 10112 return elements ? jQuery.makeArray( elements ) : this; 10113 } ) 10114 .filter( function() { 10115 var type = this.type; 10116 10117 // Use .is(":disabled") so that fieldset[disabled] works 10118 return this.name && !jQuery( this ).is( ":disabled" ) && 10119 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 10120 ( this.checked || !rcheckableType.test( type ) ); 10121 } ) 10122 .map( function( i, elem ) { 10123 var val = jQuery( this ).val(); 10124 10125 return val == null ? 10126 null : 10127 jQuery.isArray( val ) ? 10128 jQuery.map( val, function( val ) { 10129 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 10130 } ) : 10131 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 10132 } ).get(); 10133 } 10134} ); 10135 10136 10137// Create the request object 10138// (This is still attached to ajaxSettings for backward compatibility) 10139jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? 10140 10141 // Support: IE6-IE8 10142 function() { 10143 10144 // XHR cannot access local files, always use ActiveX for that case 10145 if ( this.isLocal ) { 10146 return createActiveXHR(); 10147 } 10148
vendor: 22,565 bytes, lines 10149-10969
10149 // Support: IE 9-11 10150 // IE seems to error on cross-domain PATCH requests when ActiveX XHR 10151 // is used. In IE 9+ always use the native XHR. 10152 // Note: this condition won't catch Edge as it doesn't define 10153 // document.documentMode but it also doesn't support ActiveX so it won't 10154 // reach this code. 10155 if ( document.documentMode > 8 ) { 10156 return createStandardXHR(); 10157 } 10158 10159 // Support: IE<9 10160 // oldIE XHR does not support non-RFC2616 methods (#13240) 10161 // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx 10162 // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 10163 // Although this check for six methods instead of eight 10164 // since IE also does not support "trace" and "connect" 10165 return /^(get|post|head|put|delete|options)$/i.test( this.type ) && 10166 createStandardXHR() || createActiveXHR(); 10167 } : 10168 10169 // For all other browsers, use the standard XMLHttpRequest object 10170 createStandardXHR; 10171 10172var xhrId = 0, 10173 xhrCallbacks = {}, 10174 xhrSupported = jQuery.ajaxSettings.xhr(); 10175 10176// Support: IE<10 10177// Open requests must be manually aborted on unload (#5280) 10178// See https://support.microsoft.com/kb/2856746 for more info 10179if ( window.attachEvent ) { 10180 window.attachEvent( "onunload", function() { 10181 for ( var key in xhrCallbacks ) { 10182 xhrCallbacks[ key ]( undefined, true ); 10183 } 10184 } ); 10185} 10186 10187// Determine support properties 10188support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 10189xhrSupported = support.ajax = !!xhrSupported; 10190 10191// Create transport if the browser can provide an xhr 10192if ( xhrSupported ) { 10193 10194 jQuery.ajaxTransport( function( options ) { 10195 10196 // Cross domain only allowed if supported through XMLHttpRequest 10197 if ( !options.crossDomain || support.cors ) { 10198 10199 var callback; 10200 10201 return { 10202 send: function( headers, complete ) { 10203 var i, 10204 xhr = options.xhr(), 10205 id = ++xhrId; 10206 10207 // Open the socket 10208 xhr.open( 10209 options.type, 10210 options.url, 10211 options.async, 10212 options.username, 10213 options.password 10214 ); 10215 10216 // Apply custom fields if provided 10217 if ( options.xhrFields ) { 10218 for ( i in options.xhrFields ) { 10219 xhr[ i ] = options.xhrFields[ i ]; 10220 } 10221 } 10222 10223 // Override mime type if needed 10224 if ( options.mimeType && xhr.overrideMimeType ) { 10225 xhr.overrideMimeType( options.mimeType ); 10226 } 10227 10228 // X-Requested-With header 10229 // For cross-domain requests, seeing as conditions for a preflight are 10230 // akin to a jigsaw puzzle, we simply never set it to be sure. 10231 // (it can always be set on a per-request basis or even using ajaxSetup) 10232 // For same-domain requests, won't change header if already provided. 10233 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 10234 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 10235 } 10236 10237 // Set headers 10238 for ( i in headers ) { 10239 10240 // Support: IE<9 10241 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting 10242 // request header to a null-value. 10243 // 10244 // To keep consistent with other XHR implementations, cast the value 10245 // to string and ignore `undefined`. 10246 if ( headers[ i ] !== undefined ) { 10247 xhr.setRequestHeader( i, headers[ i ] + "" ); 10248 } 10249 } 10250 10251 // Do send the request 10252 // This may raise an exception which is actually 10253 // handled in jQuery.ajax (so no try/catch here) 10254 xhr.send( ( options.hasContent && options.data ) || null ); 10255 10256 // Listener 10257 callback = function( _, isAbort ) { 10258 var status, statusText, responses; 10259 10260 // Was never called and is aborted or complete 10261 if ( callback && ( isAbort || xhr.readyState === 4 ) ) { 10262 10263 // Clean up 10264 delete xhrCallbacks[ id ]; 10265 callback = undefined; 10266 xhr.onreadystatechange = jQuery.noop; 10267 10268 // Abort manually if needed 10269 if ( isAbort ) { 10270 if ( xhr.readyState !== 4 ) { 10271 xhr.abort(); 10272 } 10273 } else { 10274 responses = {}; 10275 status = xhr.status; 10276 10277 // Support: IE<10 10278 // Accessing binary-data responseText throws an exception 10279 // (#11426) 10280 if ( typeof xhr.responseText === "string" ) { 10281 responses.text = xhr.responseText; 10282 } 10283 10284 // Firefox throws an exception when accessing 10285 // statusText for faulty cross-domain requests 10286 try { 10287 statusText = xhr.statusText; 10288 } catch ( e ) { 10289 10290 // We normalize with Webkit giving an empty statusText 10291 statusText = ""; 10292 } 10293 10294 // Filter status for non standard behaviors 10295 10296 // If the request is local and we have data: assume a success 10297 // (success with no data won't get notified, that's the best we 10298 // can do given current implementations) 10299 if ( !status && options.isLocal && !options.crossDomain ) { 10300 status = responses.text ? 200 : 404; 10301 10302 // IE - #1450: sometimes returns 1223 when it should be 204 10303 } else if ( status === 1223 ) { 10304 status = 204; 10305 } 10306 } 10307 } 10308 10309 // Call complete if needed 10310 if ( responses ) { 10311 complete( status, statusText, responses, xhr.getAllResponseHeaders() ); 10312 } 10313 }; 10314 10315 // Do send the request 10316 // `xhr.send` may raise an exception, but it will be 10317 // handled in jQuery.ajax (so no try/catch here) 10318 if ( !options.async ) { 10319 10320 // If we're in sync mode we fire the callback 10321 callback(); 10322 } else if ( xhr.readyState === 4 ) { 10323 10324 // (IE6 & IE7) if it's in cache and has been 10325 // retrieved directly we need to fire the callback 10326 window.setTimeout( callback ); 10327 } else { 10328 10329 // Register the callback, but delay it in case `xhr.send` throws 10330 // Add to the list of active xhr callbacks 10331 xhr.onreadystatechange = xhrCallbacks[ id ] = callback; 10332 } 10333 }, 10334 10335 abort: function() { 10336 if ( callback ) { 10337 callback( undefined, true ); 10338 } 10339 } 10340 }; 10341 } 10342 } ); 10343} 10344 10345// Functions to create xhrs 10346function createStandardXHR() { 10347 try { 10348 return new window.XMLHttpRequest(); 10349 } catch ( e ) {} 10350} 10351 10352function createActiveXHR() { 10353 try { 10354 return new window.ActiveXObject( "Microsoft.XMLHTTP" ); 10355 } catch ( e ) {} 10356} 10357 10358 10359 10360 10361// Install script dataType 10362jQuery.ajaxSetup( { 10363 accepts: { 10364 script: "text/javascript, application/javascript, " + 10365 "application/ecmascript, application/x-ecmascript" 10366 }, 10367 contents: { 10368 script: /\b(?:java|ecma)script\b/ 10369 }, 10370 converters: { 10371 "text script": function( text ) { 10372 jQuery.globalEval( text ); 10373 return text; 10374 } 10375 } 10376} ); 10377 10378// Handle cache's special case and global 10379jQuery.ajaxPrefilter( "script", function( s ) { 10380 if ( s.cache === undefined ) { 10381 s.cache = false; 10382 } 10383 if ( s.crossDomain ) { 10384 s.type = "GET"; 10385 s.global = false; 10386 } 10387} ); 10388 10389// Bind script tag hack transport 10390jQuery.ajaxTransport( "script", function( s ) { 10391 10392 // This transport only deals with cross domain requests 10393 if ( s.crossDomain ) { 10394 10395 var script, 10396 head = document.head || jQuery( "head" )[ 0 ] || document.documentElement; 10397 10398 return { 10399 10400 send: function( _, callback ) { 10401 10402 script = document.createElement( "script" ); 10403 10404 script.async = true; 10405 10406 if ( s.scriptCharset ) { 10407 script.charset = s.scriptCharset; 10408 } 10409 10410 script.src = s.url; 10411 10412 // Attach handlers for all browsers 10413 script.onload = script.onreadystatechange = function( _, isAbort ) { 10414 10415 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { 10416 10417 // Handle memory leak in IE 10418 script.onload = script.onreadystatechange = null; 10419 10420 // Remove the script 10421 if ( script.parentNode ) { 10422 script.parentNode.removeChild( script ); 10423 } 10424 10425 // Dereference the script 10426 script = null; 10427 10428 // Callback if not abort 10429 if ( !isAbort ) { 10430 callback( 200, "success" ); 10431 } 10432 } 10433 }; 10434 10435 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending 10436 // Use native DOM manipulation to avoid our domManip AJAX trickery 10437 head.insertBefore( script, head.firstChild ); 10438 }, 10439 10440 abort: function() { 10441 if ( script ) { 10442 script.onload( undefined, true ); 10443 } 10444 } 10445 }; 10446 } 10447} ); 10448 10449 10450 10451 10452var oldCallbacks = [], 10453 rjsonp = /(=)\?(?=&|$)|\?\?/; 10454 10455// Default jsonp settings 10456jQuery.ajaxSetup( { 10457 jsonp: "callback", 10458 jsonpCallback: function() { 10459 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 10460 this[ callback ] = true; 10461 return callback; 10462 } 10463} ); 10464 10465// Detect, normalize options and install callbacks for jsonp requests 10466jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 10467 10468 var callbackName, overwritten, responseContainer, 10469 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 10470 "url" : 10471 typeof s.data === "string" && 10472 ( s.contentType || "" ) 10473 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 10474 rjsonp.test( s.data ) && "data" 10475 ); 10476 10477 // Handle iff the expected data type is "jsonp" or we have a parameter to set 10478 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 10479 10480 // Get callback name, remembering preexisting value associated with it 10481 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 10482 s.jsonpCallback() : 10483 s.jsonpCallback; 10484 10485 // Insert callback into url or form data 10486 if ( jsonProp ) { 10487 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 10488 } else if ( s.jsonp !== false ) { 10489 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 10490 } 10491 10492 // Use data converter to retrieve json after script execution 10493 s.converters[ "script json" ] = function() { 10494 if ( !responseContainer ) { 10495 jQuery.error( callbackName + " was not called" ); 10496 } 10497 return responseContainer[ 0 ]; 10498 }; 10499 10500 // force json dataType 10501 s.dataTypes[ 0 ] = "json"; 10502 10503 // Install callback 10504 overwritten = window[ callbackName ]; 10505 window[ callbackName ] = function() { 10506 responseContainer = arguments; 10507 }; 10508 10509 // Clean-up function (fires after converters) 10510 jqXHR.always( function() { 10511 10512 // If previous value didn't exist - remove it 10513 if ( overwritten === undefined ) { 10514 jQuery( window ).removeProp( callbackName ); 10515 10516 // Otherwise restore preexisting value 10517 } else { 10518 window[ callbackName ] = overwritten; 10519 } 10520 10521 // Save back as free 10522 if ( s[ callbackName ] ) { 10523 10524 // make sure that re-using the options doesn't screw things around 10525 s.jsonpCallback = originalSettings.jsonpCallback; 10526 10527 // save the callback name for future use 10528 oldCallbacks.push( callbackName ); 10529 } 10530 10531 // Call if it was a function and we have a response 10532 if ( responseContainer && jQuery.isFunction( overwritten ) ) { 10533 overwritten( responseContainer[ 0 ] ); 10534 } 10535 10536 responseContainer = overwritten = undefined; 10537 } ); 10538 10539 // Delegate to script 10540 return "script"; 10541 } 10542} ); 10543 10544 10545 10546 10547// data: string of html 10548// context (optional): If specified, the fragment will be created in this context, 10549// defaults to document 10550// keepScripts (optional): If true, will include scripts passed in the html string 10551jQuery.parseHTML = function( data, context, keepScripts ) { 10552 if ( !data || typeof data !== "string" ) { 10553 return null; 10554 } 10555 if ( typeof context === "boolean" ) { 10556 keepScripts = context; 10557 context = false; 10558 } 10559 context = context || document; 10560 10561 var parsed = rsingleTag.exec( data ), 10562 scripts = !keepScripts && []; 10563 10564 // Single tag 10565 if ( parsed ) { 10566 return [ context.createElement( parsed[ 1 ] ) ]; 10567 } 10568 10569 parsed = buildFragment( [ data ], context, scripts ); 10570 10571 if ( scripts && scripts.length ) { 10572 jQuery( scripts ).remove(); 10573 } 10574 10575 return jQuery.merge( [], parsed.childNodes ); 10576}; 10577 10578 10579// Keep a copy of the old load method 10580var _load = jQuery.fn.load; 10581 10582/** 10583 * Load a url into a page 10584 */ 10585jQuery.fn.load = function( url, params, callback ) { 10586 if ( typeof url !== "string" && _load ) { 10587 return _load.apply( this, arguments ); 10588 } 10589 10590 var selector, type, response, 10591 self = this, 10592 off = url.indexOf( " " ); 10593 10594 if ( off > -1 ) { 10595 selector = jQuery.trim( url.slice( off, url.length ) ); 10596 url = url.slice( 0, off ); 10597 } 10598 10599 // If it's a function 10600 if ( jQuery.isFunction( params ) ) { 10601 10602 // We assume that it's the callback 10603 callback = params; 10604 params = undefined; 10605 10606 // Otherwise, build a param string 10607 } else if ( params && typeof params === "object" ) { 10608 type = "POST"; 10609 } 10610 10611 // If we have elements to modify, make the request 10612 if ( self.length > 0 ) { 10613 jQuery.ajax( { 10614 url: url, 10615 10616 // If "type" variable is undefined, then "GET" method will be used. 10617 // Make value of this field explicit since 10618 // user can override it through ajaxSetup method 10619 type: type || "GET", 10620 dataType: "html", 10621 data: params 10622 } ).done( function( responseText ) { 10623 10624 // Save response for use in complete callback 10625 response = arguments; 10626 10627 self.html( selector ? 10628 10629 // If a selector was specified, locate the right elements in a dummy div 10630 // Exclude scripts to avoid IE 'Permission Denied' errors 10631 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 10632 10633 // Otherwise use the full result 10634 responseText ); 10635 10636 // If the request succeeds, this function gets "data", "status", "jqXHR" 10637 // but they are ignored because response was set above. 10638 // If it fails, this function gets "jqXHR", "status", "error" 10639 } ).always( callback && function( jqXHR, status ) { 10640 self.each( function() { 10641 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 10642 } ); 10643 } ); 10644 } 10645 10646 return this; 10647}; 10648 10649 10650 10651 10652// Attach a bunch of functions for handling common AJAX events 10653jQuery.each( [ 10654 "ajaxStart", 10655 "ajaxStop", 10656 "ajaxComplete", 10657 "ajaxError", 10658 "ajaxSuccess", 10659 "ajaxSend" 10660], function( i, type ) { 10661 jQuery.fn[ type ] = function( fn ) { 10662 return this.on( type, fn ); 10663 }; 10664} ); 10665 10666 10667 10668 10669jQuery.expr.filters.animated = function( elem ) { 10670 return jQuery.grep( jQuery.timers, function( fn ) { 10671 return elem === fn.elem; 10672 } ).length; 10673}; 10674 10675 10676 10677 10678 10679/** 10680 * Gets a window from an element 10681 */ 10682function getWindow( elem ) { 10683 return jQuery.isWindow( elem ) ? 10684 elem : 10685 elem.nodeType === 9 ? 10686 elem.defaultView || elem.parentWindow : 10687 false; 10688} 10689 10690jQuery.offset = { 10691 setOffset: function( elem, options, i ) { 10692 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 10693 position = jQuery.css( elem, "position" ), 10694 curElem = jQuery( elem ), 10695 props = {}; 10696 10697 // set position first, in-case top/left are set even on static elem 10698 if ( position === "static" ) { 10699 elem.style.position = "relative"; 10700 } 10701 10702 curOffset = curElem.offset(); 10703 curCSSTop = jQuery.css( elem, "top" ); 10704 curCSSLeft = jQuery.css( elem, "left" ); 10705 calculatePosition = ( position === "absolute" || position === "fixed" ) && 10706 jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1; 10707 10708 // need to be able to calculate position if either top or left 10709 // is auto and position is either absolute or fixed 10710 if ( calculatePosition ) { 10711 curPosition = curElem.position(); 10712 curTop = curPosition.top; 10713 curLeft = curPosition.left; 10714 } else { 10715 curTop = parseFloat( curCSSTop ) || 0; 10716 curLeft = parseFloat( curCSSLeft ) || 0; 10717 } 10718 10719 if ( jQuery.isFunction( options ) ) { 10720 10721 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 10722 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 10723 } 10724 10725 if ( options.top != null ) { 10726 props.top = ( options.top - curOffset.top ) + curTop; 10727 } 10728 if ( options.left != null ) { 10729 props.left = ( options.left - curOffset.left ) + curLeft; 10730 } 10731 10732 if ( "using" in options ) { 10733 options.using.call( elem, props ); 10734 } else { 10735 curElem.css( props ); 10736 } 10737 } 10738}; 10739 10740jQuery.fn.extend( { 10741 offset: function( options ) { 10742 if ( arguments.length ) { 10743 return options === undefined ? 10744 this : 10745 this.each( function( i ) { 10746 jQuery.offset.setOffset( this, options, i ); 10747 } ); 10748 } 10749 10750 var docElem, win, 10751 box = { top: 0, left: 0 }, 10752 elem = this[ 0 ], 10753 doc = elem && elem.ownerDocument; 10754 10755 if ( !doc ) { 10756 return; 10757 } 10758 10759 docElem = doc.documentElement; 10760 10761 // Make sure it's not a disconnected DOM node 10762 if ( !jQuery.contains( docElem, elem ) ) { 10763 return box; 10764 } 10765 10766 // If we don't have gBCR, just use 0,0 rather than error 10767 // BlackBerry 5, iOS 3 (original iPhone) 10768 if ( typeof elem.getBoundingClientRect !== "undefined" ) { 10769 box = elem.getBoundingClientRect(); 10770 } 10771 win = getWindow( doc ); 10772 return { 10773 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), 10774 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) 10775 }; 10776 }, 10777 10778 position: function() { 10779 if ( !this[ 0 ] ) { 10780 return; 10781 } 10782 10783 var offsetParent, offset, 10784 parentOffset = { top: 0, left: 0 }, 10785 elem = this[ 0 ]; 10786 10787 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, 10788 // because it is its only offset parent 10789 if ( jQuery.css( elem, "position" ) === "fixed" ) { 10790 10791 // we assume that getBoundingClientRect is available when computed position is fixed 10792 offset = elem.getBoundingClientRect(); 10793 } else { 10794 10795 // Get *real* offsetParent 10796 offsetParent = this.offsetParent(); 10797 10798 // Get correct offsets 10799 offset = this.offset(); 10800 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 10801 parentOffset = offsetParent.offset(); 10802 } 10803 10804 // Add offsetParent borders 10805 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); 10806 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); 10807 } 10808 10809 // Subtract parent offsets and element margins 10810 // note: when an element has margin: auto the offsetLeft and marginLeft 10811 // are the same in Safari causing offset.left to incorrectly be 0 10812 return { 10813 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 10814 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 10815 }; 10816 }, 10817 10818 offsetParent: function() { 10819 return this.map( function() { 10820 var offsetParent = this.offsetParent; 10821 10822 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && 10823 jQuery.css( offsetParent, "position" ) === "static" ) ) { 10824 offsetParent = offsetParent.offsetParent; 10825 } 10826 return offsetParent || documentElement; 10827 } ); 10828 } 10829} ); 10830 10831// Create scrollLeft and scrollTop methods 10832jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 10833 var top = /Y/.test( prop ); 10834 10835 jQuery.fn[ method ] = function( val ) { 10836 return access( this, function( elem, method, val ) { 10837 var win = getWindow( elem ); 10838 10839 if ( val === undefined ) { 10840 return win ? ( prop in win ) ? win[ prop ] : 10841 win.document.documentElement[ method ] : 10842 elem[ method ]; 10843 } 10844 10845 if ( win ) { 10846 win.scrollTo( 10847 !top ? val : jQuery( win ).scrollLeft(), 10848 top ? val : jQuery( win ).scrollTop() 10849 ); 10850 10851 } else { 10852 elem[ method ] = val; 10853 } 10854 }, method, val, arguments.length, null ); 10855 }; 10856} ); 10857 10858// Support: Safari<7-8+, Chrome<37-44+ 10859// Add the top/left cssHooks using jQuery.fn.position 10860// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 10861// getComputedStyle returns percent when specified for top/left/bottom/right 10862// rather than make the css module depend on the offset module, we just check for it here 10863jQuery.each( [ "top", "left" ], function( i, prop ) { 10864 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 10865 function( elem, computed ) { 10866 if ( computed ) { 10867 computed = curCSS( elem, prop ); 10868 10869 // if curCSS returns percentage, fallback to offset 10870 return rnumnonpx.test( computed ) ? 10871 jQuery( elem ).position()[ prop ] + "px" : 10872 computed; 10873 } 10874 } 10875 ); 10876} ); 10877 10878 10879// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 10880jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 10881 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 10882 function( defaultExtra, funcName ) { 10883 10884 // margin is only for outerHeight, outerWidth 10885 jQuery.fn[ funcName ] = function( margin, value ) { 10886 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 10887 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 10888 10889 return access( this, function( elem, type, value ) { 10890 var doc; 10891 10892 if ( jQuery.isWindow( elem ) ) { 10893 10894 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 10895 // isn't a whole lot we can do. See pull request at this URL for discussion: 10896 // https://github.com/jquery/jquery/pull/764 10897 return elem.document.documentElement[ "client" + name ]; 10898 } 10899 10900 // Get document width or height 10901 if ( elem.nodeType === 9 ) { 10902 doc = elem.documentElement; 10903 10904 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 10905 // whichever is greatest 10906 // unfortunately, this causes bug #3838 in IE6/8 only, 10907 // but there is currently no good, small way to fix it. 10908 return Math.max( 10909 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 10910 elem.body[ "offset" + name ], doc[ "offset" + name ], 10911 doc[ "client" + name ] 10912 ); 10913 } 10914 10915 return value === undefined ? 10916 10917 // Get width or height on the element, requesting but not forcing parseFloat 10918 jQuery.css( elem, type, extra ) : 10919 10920 // Set width or height on the element 10921 jQuery.style( elem, type, value, extra ); 10922 }, type, chainable ? margin : undefined, chainable, null ); 10923 }; 10924 } ); 10925} ); 10926 10927 10928jQuery.fn.extend( { 10929 10930 bind: function( types, data, fn ) { 10931 return this.on( types, null, data, fn ); 10932 }, 10933 unbind: function( types, fn ) { 10934 return this.off( types, null, fn ); 10935 }, 10936 10937 delegate: function( selector, types, data, fn ) { 10938 return this.on( types, selector, data, fn ); 10939 }, 10940 undelegate: function( selector, types, fn ) { 10941 10942 // ( namespace ) or ( selector, types [, fn] ) 10943 return arguments.length === 1 ? 10944 this.off( selector, "**" ) : 10945 this.off( types, selector || "**", fn ); 10946 } 10947} ); 10948 10949// The number of elements contained in the matched element set 10950jQuery.fn.size = function() { 10951 return this.length; 10952}; 10953 10954jQuery.fn.andSelf = jQuery.fn.addBack; 10955 10956 10957 10958 10959// Register as a named AMD module, since jQuery can be concatenated with other 10960// files that may use define, but not via a proper concatenation script that 10961// understands anonymous AMD modules. A named AMD is safest and most robust 10962// way to register. Lowercase jquery is used because AMD module names are 10963// derived from file names, and jQuery is normally delivered in a lowercase 10964// file name. Do this after creating the global so that if an AMD module wants 10965// to call noConflict to hide this version of jQuery, it will work. 10966 10967// Note that for maximum portability, libraries that are not jQuery should 10968// declare themselves as anonymous modules, and avoid setting a global if an 10969// AMD loader is present. jQuery is a special case. For more information, see
10970// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 10971 10972if ( typeof define === "function" && define.amd ) { 10973 define( "jquery", [], function() { 10974 return jQuery; 10975 } ); 10976} 10977 10978 10979 10980var 10981 10982 // Map over jQuery in case of overwrite 10983 _jQuery = window.jQuery, 10984 10985 // Map over the $ in case of overwrite 10986 _$ = window.$; 10987 10988jQuery.noConflict = function( deep ) { 10989 if ( window.$ === jQuery ) { 10990 window.$ = _$; 10991 } 10992 10993 if ( deep && window.jQuery === jQuery ) { 10994 window.jQuery = _jQuery; 10995 } 10996 10997 return jQuery; 10998}; 10999 11000// Expose jQuery and $ identifiers, even in 11001// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 11002// and CommonJS for browser emulators (#13566) 11003if ( !noGlobal ) { 11004 window.jQuery = window.$ = jQuery; 11005} 11006 11007return jQuery; 11008})); 11009/* jshint node: true */ 11010 11011/** 11012 * Unobtrusive scripting adapter for jQuery 11013 * https://github.com/rails/jquery-ujs 11014 * 11015 * Requires jQuery 1.8.0 or later. 11016 * 11017 * Released under the MIT license 11018 * 11019 */ 11020 11021(function() { 11022 'use strict'; 11023 11024 var jqueryUjsInit = function($, undefined) { 11025 11026 // Cut down on the number of issues from people inadvertently including jquery_ujs twice 11027 // by detecting and raising an error when it happens. 11028 if ( $.rails !== undefined ) { 11029 $.error('jquery-ujs has already been loaded!'); 11030 } 11031 11032 // Shorthand to make it a little easier to call public rails functions from within rails.js 11033 var rails; 11034 var $document = $(document); 11035 11036 $.rails = rails = { 11037 // Link elements bound by jquery-ujs 11038 linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]', 11039 11040 // Button elements bound by jquery-ujs 11041 buttonClickSelector: 'button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)', 11042 11043 // Select elements bound by jquery-ujs 11044 inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', 11045 11046 // Form elements bound by jquery-ujs 11047 formSubmitSelector: 'form:not([data-turbo=true])', 11048 11049 // Form input elements bound by jquery-ujs 11050 formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])', 11051 11052 // Form input elements disabled during form submission 11053 disableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled', 11054 11055 // Form input elements re-enabled after form submission 11056 enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled', 11057 11058 // Form required input elements 11059 requiredInputSelector: 'input[name][required]:not([disabled]), textarea[name][required]:not([disabled])', 11060 11061 // Form file input elements 11062 fileInputSelector: 'input[name][type=file]:not([disabled])', 11063 11064 // Link onClick disable selector with possible reenable after remote submission 11065 linkDisableSelector: 'a[data-disable-with], a[data-disable]', 11066 11067 // Button onClick disable selector with possible reenable after remote submission 11068 buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]', 11069 11070 // Up-to-date Cross-Site Request Forgery token 11071 csrfToken: function() { 11072 return $('meta[name=csrf-token]').attr('content'); 11073 }, 11074 11075 // URL param that must contain the CSRF token 11076 csrfParam: function() { 11077 return $('meta[name=csrf-param]').attr('content'); 11078 }, 11079 11080 // Make sure that every Ajax request sends the CSRF token 11081 CSRFProtection: function(xhr) { 11082 var token = rails.csrfToken(); 11083 if (token) xhr.setRequestHeader('X-CSRF-Token', token); 11084 }, 11085 11086 // Make sure that all forms have actual up-to-date tokens (cached forms contain old ones) 11087 refreshCSRFTokens: function(){ 11088 $('form input[name="' + rails.csrfParam() + '"]').val(rails.csrfToken()); 11089 }, 11090 11091 // Triggers an event on an element and returns false if the event result is false 11092 fire: function(obj, name, data) { 11093 var event = $.Event(name); 11094 obj.trigger(event, data); 11095 return event.result !== false; 11096 }, 11097 11098 // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm 11099 confirm: function(message) { 11100 return confirm(message); 11101 }, 11102 11103 // Default ajax function, may be overridden with custom function in $.rails.ajax 11104 ajax: function(options) { 11105 return $.ajax(options); 11106 }, 11107 11108 // Default way to get an element's href. May be overridden at $.rails.href. 11109 href: function(element) { 11110 return element[0].href; 11111 }, 11112 11113 // Checks "data-remote" if true to handle the request through a XHR request. 11114 isRemote: function(element) { 11115 return element.data('remote') !== undefined && element.data('remote') !== false; 11116 }, 11117 11118 // Submits "remote" forms and links with ajax 11119 handleRemote: function(element) { 11120 var method, url, data, withCredentials, dataType, options; 11121 11122 if (rails.fire(element, 'ajax:before')) { 11123 withCredentials = element.data('with-credentials') || null; 11124 dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType); 11125 11126 if (element.is('form')) { 11127 method = element.data('ujs:submit-button-formmethod') || element.attr('method'); 11128 url = element.data('ujs:submit-button-formaction') || element.attr('action'); 11129 data = $(element[0]).serializeArray(); 11130 // memoized value from clicked submit button 11131 var button = element.data('ujs:submit-button'); 11132 if (button) { 11133 data.push(button); 11134 element.data('ujs:submit-button', null); 11135 } 11136 element.data('ujs:submit-button-formmethod', null); 11137 element.data('ujs:submit-button-formaction', null); 11138 } else if (element.is(rails.inputChangeSelector)) { 11139 method = element.data('method'); 11140 url = element.data('url'); 11141 data = element.serialize(); 11142 if (element.data('params')) data = data + '&' + element.data('params'); 11143 } else if (element.is(rails.buttonClickSelector)) { 11144 method = element.data('method') || 'get'; 11145 url = element.data('url'); 11146 data = element.serialize(); 11147 if (element.data('params')) data = data + '&' + element.data('params'); 11148 } else { 11149 method = element.data('method'); 11150 url = rails.href(element); 11151 data = element.data('params') || null; 11152 } 11153 11154 options = { 11155 type: method || 'GET', data: data, dataType: dataType, 11156 // stopping the "ajax:beforeSend" event will cancel the ajax request 11157 beforeSend: function(xhr, settings) { 11158 if (settings.dataType === undefined) { 11159 xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script); 11160 } 11161 if (rails.fire(element, 'ajax:beforeSend', [xhr, settings])) {
11162 element.trigger('ajax:send', xhr); 11163 } else { 11164 return false; 11165 } 11166 }, 11167 success: function(data, status, xhr) { 11168 element.trigger('ajax:success', [data, status, xhr]); 11169 }, 11170 complete: function(xhr, status) { 11171 element.trigger('ajax:complete', [xhr, status]); 11172 }, 11173 error: function(xhr, status, error) { 11174 element.trigger('ajax:error', [xhr, status, error]); 11175 }, 11176 crossDomain: rails.isCrossDomain(url) 11177 }; 11178 11179 // There is no withCredentials for IE6-8 when 11180 // "Enable native XMLHTTP support" is disabled 11181 if (withCredentials) { 11182 options.xhrFields = { 11183 withCredentials: withCredentials 11184 }; 11185 } 11186 11187 // Only pass url to `ajax` options if not blank 11188 if (url) { options.url = url; } 11189 11190 return rails.ajax(options); 11191 } else { 11192 return false; 11193 } 11194 }, 11195 11196 // Determines if the request is a cross domain request. 11197 isCrossDomain: function(url) { 11198 var originAnchor = document.createElement('a'); 11199 originAnchor.href = location.href; 11200 var urlAnchor = document.createElement('a'); 11201 11202 try { 11203 urlAnchor.href = url; 11204 // This is a workaround to a IE bug. 11205 urlAnchor.href = urlAnchor.href; 11206 11207 // If URL protocol is false or is a string containing a single colon 11208 // *and* host are false, assume it is not a cross-domain request 11209 // (should only be the case for IE7 and IE compatibility mode). 11210 // Otherwise, evaluate protocol and host of the URL against the origin 11211 // protocol and host. 11212 return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || 11213 (originAnchor.protocol + '//' + originAnchor.host === 11214 urlAnchor.protocol + '//' + urlAnchor.host)); 11215 } catch (e) { 11216 // If there is an error parsing the URL, assume it is crossDomain. 11217 return true; 11218 } 11219 }, 11220 11221 // Handles "data-method" on links such as: 11222 // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a> 11223 handleMethod: function(link) { 11224 var href = rails.href(link), 11225 method = link.data('method'), 11226 target = link.attr('target'), 11227 csrfToken = rails.csrfToken(), 11228 csrfParam = rails.csrfParam(), 11229 form = $('<form method="post" action="' + href + '"></form>'), 11230 metadataInput = '<input name="_method" value="' + method + '" type="hidden" />'; 11231 11232 if (csrfParam !== undefined && csrfToken !== undefined && !rails.isCrossDomain(href)) { 11233 metadataInput += '<input name="' + csrfParam + '" value="' + csrfToken + '" type="hidden" />'; 11234 } 11235 11236 if (target) { form.attr('target', target); } 11237 11238 form.hide().append(metadataInput).appendTo('body'); 11239 form.submit(); 11240 }, 11241 11242 // Helper function that returns form elements that match the specified CSS selector 11243 // If form is actually a "form" element this will return associated elements outside the from that have 11244 // the html form attribute set 11245 formElements: function(form, selector) { 11246 return form.is('form') ? $(form[0].elements).filter(selector) : form.find(selector); 11247 }, 11248 11249 /* Disables form elements: 11250 - Caches element value in 'ujs:enable-with' data store 11251 - Replaces element text with value of 'data-disable-with' attribute 11252 - Sets disabled property to true 11253 */ 11254 disableFormElements: function(form) { 11255 rails.formElements(form, rails.disableSelector).each(function() { 11256 rails.disableFormElement($(this)); 11257 }); 11258 }, 11259 11260 disableFormElement: function(element) { 11261 var method, replacement; 11262 11263 method = element.is('button') ? 'html' : 'val'; 11264 replacement = element.data('disable-with'); 11265 11266 if (replacement !== undefined) { 11267 element.data('ujs:enable-with', element[method]()); 11268 element[method](replacement); 11269 } 11270 11271 element.prop('disabled', true); 11272 element.data('ujs:disabled', true); 11273 }, 11274 11275 /* Re-enables disabled form elements: 11276 - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`) 11277 - Sets disabled property to false 11278 */ 11279 enableFormElements: function(form) { 11280 rails.formElements(form, rails.enableSelector).each(function() { 11281 rails.enableFormElement($(this)); 11282 }); 11283 }, 11284 11285 enableFormElement: function(element) { 11286 var method = element.is('button') ? 'html' : 'val'; 11287 if (element.data('ujs:enable-with') !== undefined) { 11288 element[method](element.data('ujs:enable-with')); 11289 element.removeData('ujs:enable-with'); // clean up cache 11290 } 11291 element.prop('disabled', false); 11292 element.removeData('ujs:disabled'); 11293 }, 11294 11295 /* For 'data-confirm' attribute: 11296 - Fires `confirm` event 11297 - Shows the confirmation dialog 11298 - Fires the `confirm:complete` event 11299 11300 Returns `true` if no function stops the chain and user chose yes; `false` otherwise. 11301 Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog. 11302 Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
11303 return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog. 11304 */ 11305 allowAction: function(element) { 11306 var message = element.data('confirm'), 11307 answer = false, callback; 11308 if (!message) { return true; } 11309 11310 if (rails.fire(element, 'confirm')) { 11311 try { 11312 answer = rails.confirm(message); 11313 } catch (e) { 11314 (console.error || console.log).call(console, e.stack || e); 11315 } 11316 callback = rails.fire(element, 'confirm:complete', [answer]); 11317 } 11318 return answer && callback; 11319 }, 11320 11321 // Helper function which checks for blank inputs in a form that match the specified CSS selector 11322 blankInputs: function(form, specifiedSelector, nonBlank) { 11323 var foundInputs = $(), 11324 input, 11325 valueToCheck, 11326 radiosForNameWithNoneSelected, 11327 radioName, 11328 selector = specifiedSelector || 'input,textarea', 11329 requiredInputs = form.find(selector), 11330 checkedRadioButtonNames = {}; 11331 11332 requiredInputs.each(function() { 11333 input = $(this); 11334 if (input.is('input[type=radio]')) { 11335 11336 // Don't count unchecked required radio as blank if other radio with same name is checked, 11337 // regardless of whether same-name radio input has required attribute or not. The spec 11338 // states https://www.w3.org/TR/html5/forms.html#the-required-attribute 11339 radioName = input.attr('name'); 11340 11341 // Skip if we've already seen the radio with this name. 11342 if (!checkedRadioButtonNames[radioName]) { 11343 11344 // If none checked 11345 if (form.find('input[type=radio]:checked[name="' + radioName + '"]').length === 0) { 11346 radiosForNameWithNoneSelected = form.find( 11347 'input[type=radio][name="' + radioName + '"]'); 11348 foundInputs = foundInputs.add(radiosForNameWithNoneSelected); 11349 } 11350 11351 // We only need to check each name once. 11352 checkedRadioButtonNames[radioName] = radioName; 11353 } 11354 } else { 11355 valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : !!input.val(); 11356 if (valueToCheck === nonBlank) { 11357 foundInputs = foundInputs.add(input); 11358 } 11359 } 11360 }); 11361 return foundInputs.length ? foundInputs : false; 11362 }, 11363 11364 // Helper function which checks for non-blank inputs in a form that match the specified CSS selector 11365 nonBlankInputs: function(form, specifiedSelector) { 11366 return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank 11367 }, 11368 11369 // Helper function, needed to provide consistent behavior in IE 11370 stopEverything: function(e) { 11371 $(e.target).trigger('ujs:everythingStopped'); 11372 e.stopImmediatePropagation(); 11373 return false; 11374 }, 11375 11376 // Replace element's html with the 'data-disable-with' after storing original html 11377 // and prevent clicking on it 11378 disableElement: function(element) { 11379 var replacement = element.data('disable-with'); 11380 11381 if (replacement !== undefined) { 11382 element.data('ujs:enable-with', element.html()); // store enabled state 11383 element.html(replacement); 11384 } 11385 11386 element.on('click.railsDisable', function(e) { // prevent further clicking 11387 return rails.stopEverything(e); 11388 }); 11389 element.data('ujs:disabled', true); 11390 }, 11391 11392 // Restore element to its original state which was disabled by 'disableElement' above 11393 enableElement: function(element) { 11394 if (element.data('ujs:enable-with') !== undefined) { 11395 element.html(element.data('ujs:enable-with')); // set to old enabled state 11396 element.removeData('ujs:enable-with'); // clean up cache 11397 } 11398 element.off('click.railsDisable'); // enable element 11399 element.removeData('ujs:disabled'); 11400 } 11401 }; 11402 11403 if (rails.fire($document, 'rails:attachBindings')) { 11404 11405 $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }}); 11406 11407 // This event works the same as the load event, except that it fires every 11408 // time the page is loaded. 11409 // 11410 // See https://github.com/rails/jquery-ujs/issues/357 11411 // See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching 11412 $(window).on('pageshow.rails', function () { 11413 $($.rails.enableSelector).each(function () { 11414 var element = $(this); 11415 11416 if (element.data('ujs:disabled')) { 11417 $.rails.enableFormElement(element); 11418 } 11419 }); 11420 11421 $($.rails.linkDisableSelector).each(function () { 11422 var element = $(this); 11423 11424 if (element.data('ujs:disabled')) { 11425 $.rails.enableElement(element); 11426 } 11427 }); 11428 }); 11429 11430 $document.on('ajax:complete', rails.linkDisableSelector, function() { 11431 rails.enableElement($(this)); 11432 }); 11433 11434 $document.on('ajax:complete', rails.buttonDisableSelector, function() { 11435 rails.enableFormElement($(this)); 11436 }); 11437 11438 $document.on('click.rails', rails.linkClickSelector, function(e) { 11439 var link = $(this), method = link.data('method'), data = link.data('params'), metaClick = e.metaKey || e.ctrlKey; 11440 if (!rails.allowAction(link)) return rails.stopEverything(e); 11441 11442 if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link); 11443 11444 if (rails.isRemote(link)) { 11445 if (metaClick && (!method || method === 'GET') && !data) { return true; } 11446 11447 var handleRemote = rails.handleRemote(link); 11448 // Response from rails.handleRemote() will either be false or a deferred object promise. 11449 if (handleRemote === false) { 11450 rails.enableElement(link); 11451 } else { 11452 handleRemote.fail( function() { rails.enableElement(link); } ); 11453 } 11454 return false;
11455 11456 } else if (method) { 11457 rails.handleMethod(link); 11458 return false; 11459 } 11460 }); 11461 11462 $document.on('click.rails', rails.buttonClickSelector, function(e) { 11463 var button = $(this); 11464 11465 if (!rails.allowAction(button) || !rails.isRemote(button)) return rails.stopEverything(e); 11466 11467 if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button); 11468 11469 var handleRemote = rails.handleRemote(button); 11470 // Response from rails.handleRemote() will either be false or a deferred object promise. 11471 if (handleRemote === false) { 11472 rails.enableFormElement(button); 11473 } else { 11474 handleRemote.fail( function() { rails.enableFormElement(button); } ); 11475 } 11476 return false; 11477 }); 11478 11479 $document.on('change.rails', rails.inputChangeSelector, function(e) { 11480 var link = $(this); 11481 if (!rails.allowAction(link) || !rails.isRemote(link)) return rails.stopEverything(e); 11482 11483 rails.handleRemote(link); 11484 return false; 11485 }); 11486 11487 $document.on('submit.rails', rails.formSubmitSelector, function(e) { 11488 var form = $(this), 11489 remote = rails.isRemote(form), 11490 blankRequiredInputs, 11491 nonBlankFileInputs; 11492 11493 if (!rails.allowAction(form)) return rails.stopEverything(e); 11494 11495 // Skip other logic when required values are missing or file upload is present 11496 if (form.attr('novalidate') === undefined) { 11497 if (form.data('ujs:formnovalidate-button') === undefined) { 11498 blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector, false); 11499 if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) { 11500 return rails.stopEverything(e); 11501 } 11502 } else { 11503 // Clear the formnovalidate in case the next button click is not on a formnovalidate button 11504 // Not strictly necessary to do here, since it is also reset on each button click, but just to be certain 11505 form.data('ujs:formnovalidate-button', undefined); 11506 } 11507 } 11508 11509 if (remote) { 11510 nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector); 11511 if (nonBlankFileInputs) { 11512 // Slight timeout so that the submit button gets properly serialized 11513 // (make it easy for event handler to serialize form without disabled values) 11514 setTimeout(function(){ rails.disableFormElements(form); }, 13); 11515 var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]); 11516 11517 // Re-enable form elements if event bindings return false (canceling normal form submission) 11518 if (!aborted) { setTimeout(function(){ rails.enableFormElements(form); }, 13); } 11519 11520 return aborted; 11521 } 11522 11523 rails.handleRemote(form); 11524 return false; 11525 11526 } else { 11527 // Slight timeout so that the submit button gets properly serialized 11528 setTimeout(function(){ rails.disableFormElements(form); }, 13); 11529 } 11530 }); 11531 11532 $document.on('click.rails', rails.formInputClickSelector, function(event) { 11533 var button = $(this); 11534 11535 if (!rails.allowAction(button)) return rails.stopEverything(event); 11536 11537 // Register the pressed submit button 11538 var name = button.attr('name'), 11539 data = name ? {name:name, value:button.val()} : null; 11540 11541 var form = button.closest('form'); 11542 if (form.length === 0) { 11543 form = $('#' + button.attr('form')); 11544 } 11545 form.data('ujs:submit-button', data); 11546 11547 // Save attributes from button 11548 form.data('ujs:formnovalidate-button', button.attr('formnovalidate')); 11549 form.data('ujs:submit-button-formaction', button.attr('formaction')); 11550 form.data('ujs:submit-button-formmethod', button.attr('formmethod')); 11551 }); 11552 11553 $document.on('ajax:send.rails', rails.formSubmitSelector, function(event) { 11554 if (this === event.target) rails.disableFormElements($(this)); 11555 }); 11556 11557 $document.on('ajax:complete.rails', rails.formSubmitSelector, function(event) { 11558 if (this === event.target) rails.enableFormElements($(this)); 11559 }); 11560 11561 $(function(){ 11562 rails.refreshCSRFTokens(); 11563 }); 11564 } 11565 11566 }; 11567 11568 if (window.jQuery) { 11569 jqueryUjsInit(jQuery); 11570 } else if (typeof exports === 'object' && typeof module === 'object') { 11571 module.exports = jqueryUjsInit; 11572 } 11573})(); 11574/*! jQuery UI - v1.10.4 - 2014-04-02 11575* http://jqueryui.com 11576* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js 11577* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ 11578 11579(function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id
vendor: 19,326 bytes, line 11579
11579)&&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,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"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.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.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:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.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?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),k=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),D={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),a=i(D.at,p,g),v.left+=a[0],v.top+=a[1],this.each(function(){var n,h,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),x=u+f+s(this,"marginRight")+k.width,C=d+_+s(this,"marginBottom")+k.height,M=t.extend({},v),T=i(D.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?M.left-=u:"center"===e.my[0]&&(M.left-=u/2),"bottom"===e.my[1]?M.top-=d:"center"===e.my[1]&&(M.top-=d/2),M.left+=T[0],M.top+=T[1],t.support.offsetFractions||(M.left=l(M.left),M.top=l(M.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](M,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:C,offset:[a[0]+T[0],a[1]+T[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(h=function(t){var i=m.left-M.left,s=i+p-u,n=m.top-M.top,a=n+g-d,l={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:M.left,top:M.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+a)&&(l.vertical="middle"),l.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(M,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-o-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-o-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-o-a,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){var t=0,i={},a={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",a.height=a.paddingTop=a.paddingBottom=a.borderTopWidth=a.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.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},_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(),content: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-helper-reset 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").each(function(){/^ui-accordion/.test(this.id
vendor: 15,672 bytes, line 11579
11579)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),undefined):("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.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t),undefined)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,a=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:n=this.headers[(s+1)%a];break;case i.LEFT:case i.UP:n=this.headers[(s-1+a)%a];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:n=this.headers[0];break;case i.END:n=this.headers[a-1]}n&&(e(t.target).attr("tabIndex",-1),e(n).attr("tabIndex",0),n.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(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,a=this.options,s=a.heightStyle,n=this.element.parent(),r=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(a.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(t){var i=e(this),a=i.attr("id"),s=i.next(),n=s.attr("id");a||(a=r+"-header-"+t,i.attr("id",a)),n||(n=r+"-panel-"+t,s.attr("id",n)),i.attr("aria-controls",n),s.attr("aria-labelledby",a)}).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(a.event),"fill"===s?(i=n.height(),this.element.siblings(":visible").each(function(){var t=e(this),a=t.css("position");"absolute"!==a&&"fixed"!==a&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_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,a=this.active,s=e(t.currentTarget),n=s[0]===a[0],r=n&&i.collapsible,o=r?e():s.next(),h=a.next(),d={oldHeader:a,oldPanel:h,newHeader:r?e():s,newPanel:o};t.preventDefault(),n&&!i.collapsible||this._trigger("beforeActivate",t,d)===!1||(i.active=r?!1:this.headers.index(s),this.active=n?e():s,this._toggle(d),a.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&a.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),n||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,a=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=a,this.options.animate?this._animate(i,a,t):(a.hide(),i.show(),this._toggleComplete(t)),a.attr({"aria-hidden":"true"}),a.prev().attr("aria-selected","false"),i.length&&a.length?a.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,s){var n,r,o,h=this,d=0,c=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=c&&l.down||l,v=function(){h._toggleComplete(s)};return"number"==typeof u&&(o=u),"string"==typeof u&&(r=u),r=r||u.easing||l.easing,o=o||u.duration||l.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(i,{duration:o,easing:r,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(a,{duration:o,easing:r,complete:v,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?d+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-d),d=0)}}),undefined):t.animate(i,o,r,v):e.animate(a,o,r,v)},_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)}})})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.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,undefined;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:case a.NUMPAD_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._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(),undefined;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(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),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){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},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":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),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=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(){this.term!==this._value()&&(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):undefined},_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({label:t.label||t.value,value:t.value||t.label},t)})},_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>").append(e("<a>").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._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},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(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(e){var t,i="ui-button ui-widget ui-state-default ui-corner-all",n="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",s=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},a=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.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,s),"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 n=this,o=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===o.label&&(o.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){o.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){o.disabled||e(this).removeClass(h)}).bind("click"+this.eventNamespace,function(e){o.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}
vendor: 6,082 bytes, line 11579
11579),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){n.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return o.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),n.buttonElement.attr("aria-pressed","true");var t=n.element[0];a(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return o.disabled?!1:(e(this).addClass("ui-state-active"),t=this,n.document.one("mouseup",function(){t=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return o.disabled?!1:(e(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(t){return o.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),undefined)}).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",o.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(i+" ui-state-active "+n).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.element.prop("disabled",!!t),t&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},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?a(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),undefined;var t=this.buttonElement.removeClass(n),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,a=s.primary&&s.secondary,o=[];s.primary||s.secondary?(this.options.text&&o.push("ui-button-text-icon"+(a?"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||(o.push(a?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.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");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().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")}})})(jQuery);(function(e,t){function i(){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","Frid
vendor: 6,173 bytes, line 11579
11579ay","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.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",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.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 s(t,i){e.extend(t,i);for(var a in i)null==i[a]&&(t[a]=i[a]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var a,s,n;a=t.nodeName.toLowerCase(),s="div"===a||"span"===a,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},i||{}),"input"===a?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_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 a=e(t);i.append=e([]),i.trigger=e([]),a.hasClass(this.markerClassName)||(this._attachments(a,i),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var a,s,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),a=this._get(i,"showOn"),("focus"===a||"both"===a)&&t.focus(this._showDatepicker),("button"===a||"both"===a)&&(s=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"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,a,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,a=0,s=0;e.length>s;s++)e[s].length>i&&(i=e[s].length,a=s);return a},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var a=e(t);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,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,a,n,o){var u,c,h,l,d,p=this._dialogInst;return p||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+l,h/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,a=e(t),s=e.data(t,r);a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("
11579keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&a.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().removeClass("ui-state-disabled"),a.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,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().addClass("ui-state-disabled"),a.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,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,a,n){var r,o,u,c,h=this._getInst(i);return 2===arguments.length&&"string"==typeof a?"defaults"===a?e.extend({},e.datepicker._defaults):h?"all"===a?e.extend({},h.settings):this._get(h,a):null:(r=a||{},"string"==typeof a&&(r={},r[a]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),u=this._getMinMaxDate(h,"min"),c=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==u&&r.dateFormat!==t&&r.minDate===t&&(h.settings.minDate=this._formatDate(h,u)),null!==c&&r.dateFormat!==t&&r.maxDate===t&&(h.settings.maxDate=this._formatDate(h,c)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),t)},_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,a,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),i=e.datepicker._get(n,"onSelect"),i?(a=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[a,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var a,s,n=e.datepicker._getInst(i.target);return e.datepicker._get(n,"constrainInput")?(a=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">s||!a||a.indexOf(s)>-1):t},_doKeyUp:function(t){var i,a=e.datepicker._getInst(t.target);if(a.input.val()!==a.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)),i&&(e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(
vendor: 10,654 bytes, line 11579
11579a),e.datepicker._updateDatepicker(a))}catch(s){}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,a,n,r,o,u,c;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])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(s(i.settings,n),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),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={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),o=e.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(u=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[u]?i.dpDiv.show(u,e.datepicker._get(i,"showOptions"),c):i.dpDiv[u||"show"](u?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,a=this._getNumberOfMonths(t),s=a[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==a[0]||1!==a[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,a){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,u=document.documentElement.clientWidth+(a?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=a&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=a&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>u&&u>s?Math.abs(i.left+s-u):0),i.top-=Math.min(i.top,i.top+n>c&&c>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,a=this._getInst(t),s=this._get(a,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,a,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),a=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),a,s):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?a:null,s),i||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.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),a=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!==a)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,a){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,i+("M"===a?this._get(n,"showCurrentAtPos"):0),a),this._updateDatepicker(n))},_gotoToday:function(t){var i,a=e(t),s=this._getInst(a[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(a)},_selectMonthYear:function(t,i,a){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===a?"Month":"Year")]=n["draw"+("M"===a?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,i,a,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=a,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var a,s=e(t),n=this._getInst(s[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),a=this._get(n,"onSelect"),a?a.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,a,s,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),a=this._getDate(t),s=this.formatDate(i,a,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},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(i,a,s){if(null==i||null==a)throw"Invalid arguments";if(a="object"==typeof a?""+a:a+"",""===a)return null;var n,r,o,u,c=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,m=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,_=-1,v=-1,k=-1,y=!1,b=function(e){var t=i.length>n+1&&i.charAt(n+1)===e;return t&&n++,t},D=function(e){var t=b(e),i="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+i+"}"),n=a.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)},w=function(i,s,n){var r=-1,o=e.map(b(i)?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,i){var s=i[1];return a.substr(c,s.length).toLowerCase()===s.toLowerCase()?(r=i[0],c+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+c},M=function(){if(a.charAt(c)!==i.charAt(n))throw"Unexpected literal at position "+c;c++};for(n=0;i.length>n;n++)if(y)"'"!==i.charAt(n)||b("'")?M():y=!1;else switch(i.charAt(n)){case"d":v=D("d");break;case"D":w("D",d,p);break;case"o":k=D("o");break;case"m":_=D("m");break;case"M":_=w("M",g,m);break;case"y":f=D("y");break;case"@":u=new Date(D("@")),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"!":u=new Date((D("!")-this._ticksTo1970)/1e4),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"'":b("'")?M():y=!0;break;default:M()}if(a.length>c&&(o=a.substr(c),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=f?0:-100)),k>-1)for(_=1,v=k;;){if(r=this._getDaysInMonth(f,_-1),r>=v)break;_++,v-=r}if(u=this._daylightSavingAdjust(new Date(f,_-1,v)),u.getFullYear()!==f||u.getMonth()+1!==_||u.getDate()!==v)throw"Invalid date";return u},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 a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,u=function(t){var i=e.length>a+1&&e.charAt(a+1)===t;return i&&a++,i},c=function(e,t,i){var a=""+t;if(u(e))for(;i>a.length;)a="0"+a;return a},h=function(e,t,i,a){return u(e)?a[t]:i[t]},l="",d=!1;if(t)for(a=0;e.length>a;a++)if(d)"'"!==e.charAt(a)||u("'")?l+=e.charAt(a):d=!1;else switch(e.charAt(a)){case"d":l+=c("d",t.getDate(),2);break;case"D":l+=h("D",t.getDay(),s,n);break;case"o":l+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=c("m",t.getMonth()+1,2);break;case"M":l+=h("M",t.getMonth(),r,o);break;case"y":l+=u("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":u("'")?l+="'":d=!0;break;default:l+=e.charAt(a)}return l},_possibleChars:function(e){var t,i="",a=!1,s=function(i){var a=e.length>t+1&&e.charAt(t+1)===i;return a&&t++,a};for(t=0;e.length>t;t++)if(a)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):a=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":a=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),a=e.lastVal=e.input?e.input.val():null,
vendor: 9,052 bytes, line 11579
11579s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(i,a,r)||s}catch(o){a=t?"":a}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=a?n.getDate():0,e.currentMonth=a?n.getMonth():0,e.currentYear=a?n.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,a){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(a){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,c=u.exec(i);c;){switch(c[2]||"d"){case"d":case"D":o+=parseInt(c[1],10);break;case"w":case"W":o+=7*parseInt(c[1],10);break;case"m":case"M":r+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}c=u.exec(i)}return new Date(n,r,o)},r=null==i||""===i?a:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?a:s(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?a:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var a=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(a?"":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"),a="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(a,-i,"M")},next:function(){e.datepicker._adjustDate(a,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(a)},selectDay:function(){return e.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(a,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,a,s,n,r,o,u,c,h,l,d,p,g,m,f,_,v,k,y,b,D,w,M,C,x,I,N,T,A,E,S,Y,F,P,O,j,K,R,H=new Date,W=this._daylightSavingAdjust(new Date(H.getFullYear(),H.getMonth(),H.getDate())),L=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),Q=1!==q[0]||1!==q[1],V=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-G,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-q[0]*q[1]+1,X.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=z?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):i,a=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-"+(L?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=z?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?V:W,r=z?this.formatDate(r,o,this._getFormatConfig(e)):r,u=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>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(L?u:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(L?"":u)+"</div>":"",h=parseInt(this._get(e,"firstDay"),10),h=isNaN(h)?0:h,l=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",D=0;q[0]>D;D++){for(w="",this.maxRows=4,M=0;q[1]>M;M++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),x=" ui-corner-all",I="",Q){if(I+="<div class='ui-datepicker-group",q[1]>1)switch(M){case 0:I+=" ui-datepicker-group-first",x=" ui-corner-"+(L?"right":"left");break;case q[1]-1:I+=" ui-datepicker-group-last",x=" ui-corner-"+(L?"left":"right");break;default:I+=" ui-datepicker-group-middle",x=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+x+"'>"+(/all|left/.test(x)&&0===D?L?n:a:"")+(/all|right/.test(x)&&0===D?L?a:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,D>0||M>0,g,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=l?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;7>b;b++)T=(b+h)%7,N+="<th"+((b+h+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[T]+"'>"+p[T]+"</span></th>";for(I+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),E=(this._getFirstDayOfMonth(et,Z)-h+7)%7,S=Math.ceil((E+A)/7),Y=Q?this.maxRows>S?this.maxRows:S:S,this.maxRows=Y,F=this._daylightSavingAdjust(new Date(et,Z,1-E)),P=0;Y>P;P++){for(I+="<tr>",O=l?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;7>b;b++)j=f?f.apply(e.input?e.input[0]:null,[F]):[!0,""],K=F.getMonth()!==Z,R=K&&!v||!j[0]||$&&$>F||X&&F>X,O+="<td class='"+((b+h+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(F.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===F.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!_?"":" "+j[1]+(F.getTime()===V.getTime()?" "+this._currentClass:"")+(F.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(K&&!_||!j[2]?"":" title='"+j[2].replace(/'/g,"'")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(K&&!_?" ":R?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===W.getTime()?" ui-state-highlight":"")+(F.getTime()===V.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);I+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),I+="</tbody></table>"+(Q?"</div>"+(q[0]>0&&M===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=I}y+=w}return y+=c,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,a,s,n,r,o){var u,c,h,l,d,p,g,m,f=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(u=a&&a.getFullYear()===i,c=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!u||h>=a.getMonth())&&(!c||s.getMonth()>=h)&&(y+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"</option>");y+="</select>"}if(v||(k+=y+(!n&&f&&_?"":" ")),!e.yearshtml)if(e.yearshtml="",n||!_)k+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(l=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+p
vendor: 29,736 bytes, lines 11579-11580
11579arseInt(e,10):parseInt(e,10); 11580return isNaN(t)?d:t},g=p(l[0]),m=Math.max(g,p(l[1]||"")),g=a?Math.max(g,a.getFullYear()):g,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===i?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),v&&(k+=(!n&&f&&_?"":" ")+y),k+="</div>"},_adjustInstDate:function(e,t,i){var a=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(a,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(a,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return a&&s>a?a:s},_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,a){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,a+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,a,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,u=this._get(e,"yearRange");return u&&(i=u.split(":"),a=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=a),i[1].match(/[+\-].*/)&&(o+=a)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=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,a){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(a,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,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 i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,a=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(s){}this._hide(this.uiDialog,this.options.hide,function(){a._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),undefined;if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),a=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==a[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(a.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(e.each(i,function(i,a){var s,n;a=e.isFunction(a)?{click:a,text:i}:a,a=e.extend({type:"button"},a),s=a.click,a.click=function(){s.apply(t.element[0],arguments)},n={icons:a.icons,text:a.showText},delete a.icons,delete a.showText,e("<button></button>",a).button(n).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,a=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(a,s){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",a,t(s))},drag:function(e,a){i._trigger("drag",e,t(a))},stop:function(s,n){a.position=[n.position.left-i.document.scrollLeft(),n.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(n))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,a=this.options,s=a.resizable,n=this.uiDialog.css("position"),r="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:r,start:function(a,s){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",a,t(s))},resize:function(e,a){i._trigger("resize",e,t(a))},stop:function(s,n){a.height=e(this).height(),a.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(n))}}).css("position",n)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(a){var s=this,n=!1,r={};e.each(a,function(e,a){s._setOption(e,a),e in t&&(n=!0),e in i&&(r[e]=a)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,t){var i,a,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(a=s.is(":data(ui-resizable)"),a&&!t&&s.resizable("destroy"),a&&"string"==typeof t&&s.resizable("option","handles",t),a||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,a=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),a.minWidth>a.width&&(a.width=a.minWidth),e=this.uiDialog.css({height:"auto",width:a.width}).outerHeight(),t=Math.max(0,a.minHeight-e),i="number"==typeof a.maxHeight?Math.max(0,a.maxHeight-e):"none","auto"===a.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,a.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(a){t._allowInteraction(a)||(a.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,a=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(a=i.split?i.split(" "):[i[0],i[1]],1===a.length&&(a[1]=a[0]),e.each(["left","top"],function(e,t){+a[e]===a[e]&&(s[e]=a[e],a[e]=t)}),i={my:a[0]+(0>s[0]?s[0]:"+"+s[0])+" "+a[1]+(0>s[1]?s[1]:"+"+s[1]),at:a.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.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||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return 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"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_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 e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==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),(e?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,(e?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.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.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]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,h=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((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=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)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_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},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t
vendor: 2,351 bytes, line 11580
11580(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,a,o,r,l,h,c,u,d,p=t(this).data("ui-draggable"),g=p.options,f=g.snapTolerance,m=i.offset.left,_=m+p.helperProportions.width,v=i.offset.top,b=v+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,l=r+p.snapElements[u].width,h=p.snapElements[u].top,c=h+p.snapElements[u].height,r-f>_||m>l+f||h-f>b||v>c+f||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==g.snapMode&&(s=f>=Math.abs(h-b),n=f>=Math.abs(c-v),a=f>=Math.abs(r-_),o=f>=Math.abs(l-m),s&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=s||n||a||o,"outer"!==g.snapMode&&(s=f>=Math.abs(h-v),n=f>=Math.abs(c-b),a=f>=Math.abs(r-m),o=f>=Math.abs(l-_),s&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-
vendor: 7,417 bytes, line 11580
11580p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||a||o||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.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 e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.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",e,this.ui(i)))},_out:function(e){var i=t.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",e,this.ui(i)))},_drop:function(e,i){var s=i||t.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 e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),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",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=o+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return o>=c&&d>=l&&r>=u&&p>=h;case"intersect":return o+t.helperProportions.width/2>c&&d>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||h>=u&&p>=h||u>r&&h>p)&&(o>=c&&d>=o||l>=c&&d>=l||c>o&&l>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,a=t.ui.ddmanager.droppables[e.options.scope]||[],o=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||e&&!a[s].accept.call(a[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue t}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(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=t.ui.intersect(e,this,this.options.tolerance),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 t.data(this,"ui-droppable").options.scope===n}),a.length&&(s=t.data(a[0],"ui-droppable"),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(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,a){var o,r=a.re.exec(i),l=r&&a.parse(r),h=a.space||"rgba";return l?(o=s[h](l),s[c[h].cache]=o[c[h].cache],n=s._rgba=o._rgba,
vendor: 4,180 bytes, line 11580
11580!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={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"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,o,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,l],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),a=c[n],o=0===this.alpha()?h("transparent"):this,r=o[a.cache]||a.to(o._rgba),l=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],h=s[a],c=u[n.type]||{};null!==h&&(null===o?l[a]=h:(c.mod&&(h-o>c.mod/2?o+=c.mod:o-h>c.mod/2&&(o-=c.mod)),l[a]=i((h-o)*e+o,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),l=Math.min(s,n,a),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-a)/h+360:n===r?60*(a-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,
vendor: 65,075 bytes, line 11580
11580null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[o]&&(this[o]=l(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[o]=d,n):h(d)},f(a,function(e,i){h.fn[e]||(h.fn[e]=function(n){var a,o=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=h(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.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"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var l=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",h=l.children?o.find("*").addBack():o;h=h.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),h=h.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,l=t(this),h=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),h):t.effects.save(l,h),l.show(),a=t.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,h),t.effects.removeWrapper(l),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),h="hide"===l,c="show"===l,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||h?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||h)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),h&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=h?2*d:d/2;h&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){h&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(h,"pos"===c?-s:s),u[h]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var a,o,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(l=m.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=m.left+o*v,h=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?h*v:0),top:l+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),l="show"===r,h="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[h?0:1]),l&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=l?n[0]:c,v[f[1]]=l?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){h&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,l=o||"hide"===a,h=2*(e.times||5)+(l?1:0),c=e.duration/h,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;h>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,h+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=o.css("position"),_=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===g||"both"===g)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===g||"both"===g)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(h),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(n=t.effects.getBaseline(m,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",l=e.distance||20,h=e.times||3,c=2*h+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+l,g[d]=(p?"+=":"-=")+2*l,m[d]=(p?"-=":"+=")+2*l,n.animate(f,u,e.easing),s=1;h>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,l=a?o.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left 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 ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(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(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||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-corner-all ui-menu-icons").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").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},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(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){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=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){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=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.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=t("<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(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===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=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),a="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,a;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,a),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(t(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),o.containment&&(s+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-a.left||0,d=e.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,a=s?0:c.sizeDiff.width,o={width:c.helper.width()-a,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(o,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,a=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),a&&(t.height=e.maxHeight),o&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),a&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,a=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:o,h=t.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,a,o=t(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,c=o._aspectRatio||e.shiftKey,u={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-u.left),c&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),c&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-u.left:o.offset.left-u.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=Math.abs(o.parentData.left)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,c&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,c&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,a=e.containerElement,o=t(e.helper),r=o.offset(),h=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,a=e.originalPosition,o=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(o)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.top=a.top-u):/^(sw)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.left=a.left-c):(p-l>0?(e.size.height=p,e.position.top=a.top-u):(e.size.height=l,e.position.top=a.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=a.left-c):(e.size.width=h,e.position.left=a.left+n.width-h))}})})(jQuery);(function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=e.pageX,l=e.pageY;return a>r&&(i=r,r=a,a=i),o>l&&(i=l,l=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:l-o}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?h=!(i.left>r||a>i.right||i.top>l||o>i.bottom):"fit"===n.tolerance&&(h=i.left>a&&r>i.right&&i.top>o&&l>i.bottom),h?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.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},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),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 e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.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=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_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(e){var i,s,n,a,o,r,l,h,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:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),l=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-a.width()/2,top:e.pageY-l.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(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,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(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):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(e,i){var s,n=0;switch("range"===e&&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)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();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"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);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(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=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)[h?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.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},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left
vendor: 7,764 bytes, line 11580
11580:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.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(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),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],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,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 e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].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(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;
vendor: 3,271 bytes, line 11580
11580return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(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 t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;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?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.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--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.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(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td> </td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHe
vendor: 5,248 bytes, line 11580
11580ight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("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(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.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 e,i,s,n=this.options;"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,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),
vendor: 6,129 bytes, line 11580
1158010)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(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():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.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]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=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((o-this.originalPageX)/n.grid[0])*n.grid[0],o=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:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.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(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}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&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||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,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&
vendor: 6,212 bytes, line 11580
11580this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t
vendor: 14,618 bytes, line 11580
11580=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=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).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),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",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),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 t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),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(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,c))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,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-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_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.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(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 e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}}
11580,i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery); 11581// Knockout JavaScript library v3.1.0 11582// (c) Steven Sanderson - http://knockoutjs.com/ 11583// License: MIT (http://www.opensource.org/licenses/mit-license.php) 11584 11585(function() {(function(p){var A=this||(0,eval)("this"),w=A.document,K=A.navigator,t=A.jQuery,C=A.JSON;(function(p){"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?p(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],p):p(A.ko={})})(function(z){function G(a,c){return null===a||typeof a in M?a===c:!1}function N(a,c){var d;return function(){d||(d=setTimeout(function(){d=p;a()},c))}}function O(a,c){var d;return function(){clearTimeout(d);d=setTimeout(a, 11586c)}}function H(b,c,d,e){a.d[b]={init:function(b,h,g,k,l){var n,r;a.ba(function(){var g=a.a.c(h()),k=!d!==!g,s=!r;if(s||c||k!==n)s&&a.ca.fa()&&(r=a.a.lb(a.e.childNodes(b),!0)),k?(s||a.e.U(b,a.a.lb(r)),a.gb(e?e(l,g):l,b)):a.e.da(b),n=k},null,{G:b});return{controlsDescendantBindings:!0}}};a.g.aa[b]=!1;a.e.Q[b]=!0}var a="undefined"!==typeof z?z:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.s=function(a,c,d){a[c]=d};a.version="3.1.0";a.b("version", 11587a.version);a.a=function(){function b(a,b){for(var c in a)a.hasOwnProperty(c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}var e={__proto__:[]}instanceof Array,f={},h={};f[K&&/Firefox\/2/i.test(K.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];f.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(f,function(a,b){if(b.length)for(var c=0, 11588d=b.length;c<d;c++)h[b[c]]=a});var g={propertychange:!0},k=w&&function(){for(var a=3,b=w.createElement("div"),c=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+ ++a+"]><i></i><![endif]--\x3e",c[0];);return 4<a?a:p}();return{mb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],r:function(a,b){for(var c=0,d=a.length;c<d;c++)b(a[c],c)},l:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var c=0,d=a.length;c<d;c++)if(a[c]=== 11589b)return c;return-1},hb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d))return a[d];return null},ma:function(b,c){var d=a.a.l(b,c);0<d?b.splice(d,1):0===d&&b.shift()},ib:function(b){b=b||[];for(var c=[],d=0,e=b.length;d<e;d++)0>a.a.l(c,b[d])&&c.push(b[d]);return c},ya:function(a,b){a=a||[];for(var c=[],d=0,e=a.length;d<e;d++)c.push(b(a[d],d));return c},la:function(a,b){a=a||[];for(var c=[],d=0,e=a.length;d<e;d++)b(a[d],d)&&c.push(a[d]);return c},$:function(a,b){if(b instanceof Array)a.push.apply(a, 11590b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},Y:function(b,c,d){var e=a.a.l(a.a.Sa(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},na:e,extend:c,ra:d,sa:e?d:c,A:b,Oa:function(a,b){if(!a)return a;var c={},d;for(d in a)a.hasOwnProperty(d)&&(c[d]=b(a[d],d,a));return c},Fa:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},ec:function(b){b=a.a.R(b);for(var c=w.createElement("div"),d=0,e=b.length;d<e;d++)c.appendChild(a.M(b[d]));return c},lb:function(b,c){for(var d=0,e=b.length,g=[];d< 11591e;d++){var k=b[d].cloneNode(!0);g.push(c?a.M(k):k)}return g},U:function(b,c){a.a.Fa(b);
11591if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Bb:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0],g=e.parentNode,k=0,h=c.length;k<h;k++)g.insertBefore(c[k],e);k=0;for(h=d.length;k<h;k++)a.removeNode(d[k])}},ea:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.shift();if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)if(a.push(c), 11592c=c.nextSibling,!c)return;a.push(d)}}return a},Db:function(a,b){7>k?a.setAttribute("selected",b):a.selected=b},ta:function(a){return null===a||a===p?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},oc:function(b,c){for(var d=[],e=(b||"").split(c),g=0,k=e.length;g<k;g++){var h=a.a.ta(e[g]);""!==h&&d.push(h)}return d},kc:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},Sb:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(3=== 11593a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Ea:function(b){return a.a.Sb(b,b.ownerDocument.documentElement)},eb:function(b){return!!a.a.hb(b,a.a.Ea)},B:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},q:function(b,c,d){var e=k&&g[c];if(!e&&t)t(b).bind(c,d);else if(e||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var h=function(a){d.call(b,a)},f="on"+c;b.attachEvent(f, 11594h);a.a.u.ja(b,function(){b.detachEvent(f,h)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(c,d,!1)},ha:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var d;"input"===a.a.B(b)&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==d||"radio"==d):d=!1;if(t&&!d)t(b).trigger(c);else if("function"==typeof w.createEvent)if("function"==typeof b.dispatchEvent)d=w.createEvent(h[c]||"HTMLEvents"), 11595d.initEvent(c,!0,!0,A,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error("The supplied element doesn't support dispatchEvent");else if(d&&b.click)b.click();else if("undefined"!=typeof b.fireEvent)b.fireEvent("on"+c);else throw Error("Browser doesn't support triggering events");},c:function(b){return a.v(b)?b():b},Sa:function(b){return a.v(b)?b.o():b},ua:function(b,c,d){if(c){var e=/\S+/g,g=b.className.match(e)||[];a.a.r(c.match(e),function(b){a.a.Y(g,b,d)});b.className=g.join(" ")}},Xa:function(b, 11596c){var d=a.a.c(c);if(null===d||d===p)d="";var e=a.e.firstChild(b);!e||3!=e.nodeType||a.e.nextSibling(e)?a.e.U(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.Vb(b)},Cb:function(a,b){a.name=b;if(7>=k)try{a.mergeAttributes(w.createElement("<input name='"+a.name+"'/>"),!1)}catch(c){}},Vb:function(a){9<=k&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},Tb:function(a){if(k){var b=a.style.width;a.style.width=0;a.style.width=b}},ic:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var d= 11597[],e=b;e<=c;e++)d.push(e);return d},R:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},mc:6===k,nc:7===k,oa:k,ob:function(b,c){for(var d=a.a.R(b.getElementsByTagName("input")).concat(a.a.R(b.getElementsByTagName("textarea"))),e="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},g=[],k=d.length-1;0<=k;k--)e(d[k])&&g.push(d[k]);return g},fc:function(b){return"string"==typeof b&&(b=a.a.ta(b))?C&&C.parse?C.parse(b):(new Function("return "+b))(): 11598null},Ya:function(b,c,d){if(!C||!C.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return C.stringify(a.a.c(b),c,d)},gc:function(c,d,e){e=e||{};var g=e.params||{},k=e.includeFields||this.mb,h=c;if("object"==typeof c&&"form"===a.a.B(c))for(var h=c.action,f=k.length-1;0<=f;f--)for(var u=a.a.ob(c,k[f]),D=u.length-1;0<=D;D--)g[u[D].name]= 11599u[D].value;d=a.a.c(d);var y=w.createElement("form");y.style.display="none";y.action=h;y.method="post";for(var p in d)c=w.createElement("input"),c.name=p,c.value=a.a.Ya(a.a.c(d[p])),y.appendChild(c);b(g,function(a,b){var c=w.createElement("input");c.name=a;c.value=b;y.appendChild(c)});w.body.appendChild(y);e.submitter?e.submitter(y):y.submit();setTimeout(function(){y.parentNode.removeChild(y)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.r);a.b("utils.arrayFirst",a.a.hb);a.b("utils.arrayFilter", 11600a.a.la);a.b("utils.arrayGetDistinctValues",a.a.ib);a.b("utils.arrayIndexOf",a.a.l);a.b("utils.arrayMap",a.a.ya);a.b("utils.arrayPushAll",a.a.$);a.b("utils.arrayRemoveItem",a.a.ma);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",a.a.mb);a.b("utils.getFormFields",a.a.ob);a.b("utils.peekObservable",a.a.Sa);a.b("utils.postJson",a.a.gc);a.b("utils.parseJson",a.a.fc);a.b("utils.registerEventHandler",a.a.q);a.b("utils.stringifyJson",a.a.Ya);a.b("utils.range",a.a.ic);a.b("utils.toggleDomNodeCssClass", 11601a.a.ua);a.b("utils.triggerEvent",a.a.ha);a.b("utils.unwrapObservable",a.a.c);a.b("utils.objectForEach",a.a.A);a.b("utils.addOrRemoveItem",a.a.Y);a.b("unwrap",a.a.c);Function.prototype.bind||(Function.prototype.bind=function(a){var c=this,d=Array.prototype.slice.call(arguments);a=d.shift();return function(){return c.apply(a,d.concat(Array.prototype.slice.call(arguments)))}});a.a.f=new function(){function a(b,h){var g=b[d];if(!g||"null"===g||!e[g]){if(!h)return p;g=b[d]="ko"+c++;e[g]={}}return e[g]} 11602var c=0,d="__ko__"+(new Date).getTime(),e={};return{get:function(c,d){var e=a(c,!1);return e===p?p:e[d]},set:function(c,d,e){if(e!==p||a(c,!1)!==p)a(c,!0)[d]=e},clear:function(a){var b=a[d];return b?(delete e[b],a[d]=null,!0):!1},L:function(){return c++ +d}}};a.b("utils.domData",a.a.f);a.b("utils.domData.clear",a.a.f.clear);a.a.u=new function(){function b(b,c){var e=a.a.f.get(b,d);
vendor: 3,705 bytes, lines 11602-11610
11602e===p&&c&&(e=[],a.a.f.set(b,d,e));return e}function c(d){var e=b(d,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](d); 11603a.a.f.clear(d);a.a.u.cleanExternalData(d);if(f[d.nodeType])for(e=d.firstChild;d=e;)e=d.nextSibling,8===d.nodeType&&c(d)}var d=a.a.f.L(),e={1:!0,8:!0,9:!0},f={1:!0,9:!0};return{ja:function(a,c){if("function"!=typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},Ab:function(c,e){var k=b(c,!1);k&&(a.a.ma(k,e),0==k.length&&a.a.f.set(c,d,p))},M:function(b){if(e[b.nodeType]&&(c(b),f[b.nodeType])){var d=[];a.a.$(d,b.getElementsByTagName("*"));for(var k=0,l=d.length;k<l;k++)c(d[k])}return b}, 11604removeNode:function(b){a.M(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){t&&"function"==typeof t.cleanData&&t.cleanData([a])}}};a.M=a.a.u.M;a.removeNode=a.a.u.removeNode;a.b("cleanNode",a.M);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.u);a.b("utils.domNodeDisposal.addDisposeCallback",a.a.u.ja);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.u.Ab);(function(){a.a.Qa=function(b){var c;if(t)if(t.parseHTML)c=t.parseHTML(b)||[];else{if((c=t.clean([b]))&& 11605c[0]){for(b=c[0];b.parentNode&&11!==b.parentNode.nodeType;)b=b.parentNode;b.parentNode&&b.parentNode.removeChild(b)}}else{var d=a.a.ta(b).toLowerCase();c=w.createElement("div");d=d.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!d.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!d.indexOf("<td")||!d.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];b="ignored<div>"+d[1]+b+d[2]+"</div>";for("function"==typeof A.innerShiv?c.appendChild(A.innerShiv(b)): 11606c.innerHTML=b;d[0]--;)c=c.lastChild;c=a.a.R(c.lastChild.childNodes)}return c};a.a.Va=function(b,c){a.a.Fa(b);c=a.a.c(c);if(null!==c&&c!==p)if("string"!=typeof c&&(c=c.toString()),t)t(b).html(c);else for(var d=a.a.Qa(c),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b("utils.parseHtmlFragment",a.a.Qa);a.b("utils.setHtml",a.a.Va);a.w=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.w.xb(c.nodeValue);null!=f&&e.push({Rb:c,cc:f})}else if(1==c.nodeType)for(var f=0,h=c.childNodes,g=h.length;f<g;f++)b(h[f], 11607e)}var c={};return{Na:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},Hb:function(a,b){var f=c[a];if(f===p)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},Ib:function(c,e){var f= 11608[];b(c,f);for(var h=0,g=f.length;h<g;h++){var k=f[h].Rb,l=[k];e&&a.a.$(l,e);a.w.Hb(f[h].cc,l);k.nodeValue="";k.parentNode&&k.parentNode.removeChild(k)}},xb:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.w);a.b("memoization.memoize",a.w.Na);a.b("memoization.unmemoize",a.w.Hb);a.b("memoization.parseMemoText",a.w.xb);a.b("memoization.unmemoizeDomNodeAndDescendants",a.w.Ib);a.Ga={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.h({read:b,write:function(a){clearTimeout(d); 11609d=setTimeout(function(){b(a)},c)}})},rateLimit:function(a,c){var d,e,f;"number"==typeof c?d=c:(d=c.timeout,e=c.method);f="notifyWhenChangesStop"==e?O:N;a.Ma(function(a){return f(a,d)})},notify:function(a,c){a.equalityComparer="always"==c?null:G}};var M={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.Ga);a.Fb=function(b,c,d){this.target=b;this.za=c;this.Qb=d;this.sb=!1;a.s(this,"dispose",this.F)};a.Fb.prototype.F=function(){this.sb=!0;this.Qb()};a.N=function(){a.a.sa(this,a.N.fn);this.H= 11610{}}
11610;var F="change";z={V:function(b,c,d){var e=this;d=d||F;var f=new a.Fb(e,c?b.bind(c):b,function(){a.a.ma(e.H[d],f)});e.o&&e.o();e.H[d]||(e.H[d]=[]);e.H[d].push(f);return f},notifySubscribers:function(b,c){c=c||F;if(this.qb(c))try{a.k.jb();for(var d=this.H[c].slice(0),e=0,f;f=d[e];++e)f.sb||f.za(b)}finally{a.k.end()}},Ma:function(b){var c=this,d=a.v(c),e,f,h;c.ia||(c.ia=c.notifySubscribers,c.notifySubscribers=function(a,b){b&&b!==F?"beforeChange"===b?c.bb(a):c.ia(a,b):c.cb(a)});var g=b(function(){d&& 11611h===c&&(h=c());e=!1;c.Ka(f,h)&&c.ia(f=h)});c.cb=function(a){e=!0;h=a;g()};c.bb=function(a){e||(f=a,c.ia(a,"beforeChange"))}},qb:function(a){return this.H[a]&&this.H[a].length},Wb:function(){var b=0;a.a.A(this.H,function(a,d){b+=d.length});return b},Ka:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},extend:function(b){var c=this;b&&a.a.A(b,function(b,e){var f=a.Ga[b];"function"==typeof f&&(c=f(c,e)||c)});return c}};a.s(z,"subscribe",z.V);a.s(z,"extend",z.extend);a.s(z,"getSubscriptionsCount", 11612z.Wb);a.a.na&&a.a.ra(z,Function.prototype);a.N.fn=z;a.tb=function(a){return null!=a&&"function"==typeof a.V&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.N);a.b("isSubscribable",a.tb);a.ca=a.k=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{jb:b,end:c,zb:function(b){if(e){if(!a.tb(b))throw Error("Only subscribable things can act as dependencies");e.za(b,b.Kb||(b.Kb=++f))}},t:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},fa:function(){if(e)return e.ba.fa()}, 11613pa:function(){if(e)return e.pa}}}();a.b("computedContext",a.ca);a.b("computedContext.getDependenciesCount",a.ca.fa);a.b("computedContext.isInitial",a.ca.pa);a.m=function(b){function c(){if(0<arguments.length)return c.Ka(d,arguments[0])&&(c.P(),d=arguments[0],c.O()),this;a.k.zb(c);return d}var d=b;a.N.call(c);a.a.sa(c,a.m.fn);c.o=function(){return d};c.O=function(){c.notifySubscribers(d)};c.P=function(){c.notifySubscribers(d,"beforeChange")};a.s(c,"peek",c.o);a.s(c,"valueHasMutated",c.O);a.s(c,"valueWillMutate", 11614c.P);return c};a.m.fn={equalityComparer:G};var E=a.m.hc="__ko_proto__";a.m.fn[E]=a.m;a.a.na&&a.a.ra(a.m.fn,a.N.fn);a.Ha=function(b,c){return null===b||b===p||b[E]===p?!1:b[E]===c?!0:a.Ha(b[E],c)};a.v=function(b){return a.Ha(b,a.m)};a.ub=function(b){return"function"==typeof b&&b[E]===a.m||"function"==typeof b&&b[E]===a.h&&b.Yb?!0:!1};a.b("observable",a.m);a.b("isObservable",a.v);a.b("isWriteableObservable",a.ub);a.T=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined."); 11615b=a.m(b);a.a.sa(b,a.T.fn);return b.extend({trackArrayChanges:!0})};a.T.fn={remove:function(b){for(var c=this.o(),d=[],e="function"!=typeof b||a.v(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var h=c[f];e(h)&&(0===d.length&&this.P(),d.push(h),c.splice(f,1),f--)}d.length&&this.O();return d},removeAll:function(b){if(b===p){var c=this.o(),d=c.slice(0);this.P();c.splice(0,c.length);this.O();return d}return b?this.remove(function(c){return 0<=a.a.l(b,c)}):[]},destroy:function(b){var c=this.o(),d= 11616"function"!=typeof b||a.v(b)?function(a){return a===b}:b;this.P();for(var e=c.length-1;0<=e;e--)d(c[e])&&(c[e]._destroy=!0);this.O()},destroyAll:function(b){return b===p?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.l(b,c)}):[]},indexOf:function(b){var c=this();return a.a.l(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.P(),this.o()[d]=c,this.O())}};a.a.r("pop push reverse shift sort splice unshift".split(" "),function(b){a.T.fn[b]=function(){var a=this.o(); 11617this.P();this.kb(a,b,arguments);a=a[b].apply(a,arguments);this.O();return a}});a.a.r(["slice"],function(b){a.T.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.a.na&&a.a.ra(a.T.fn,a.m.fn);a.b("observableArray",a.T);var I="arrayChange";a.Ga.trackArrayChanges=function(b){function c(){if(!d){d=!0;var c=b.notifySubscribers;b.notifySubscribers=function(a,b){b&&b!==F||++f;return c.apply(this,arguments)};var k=[].concat(b.o()||[]);e=null;b.V(function(c){c=[].concat(c||[]);if(b.qb(I)){var d; 11618if(!e||1<f)e=a.a.Aa(k,c,{sparse:!0});d=e;d.length&&b.notifySubscribers(d,I)}k=c;e=null;f=0})}}if(!b.kb){var d=!1,e=null,f=0,h=b.V;b.V=b.subscribe=function(a,b,d){d===I&&c();return h.apply(this,arguments)};b.kb=function(b,c,l){function h(a,b,c){return r[r.length]={status:a,value:b,index:c}}if(d&&!f){var r=[],m=b.length,q=l.length,s=0;switch(c){case "push":s=m;case "unshift":for(c=0;c<q;c++)h("added",l[c],s+c);break;case "pop":s=m-1;case "shift":m&&h("deleted",b[s],s);break;case "splice":c=Math.min(Math.max(0, 116190>l[0]?m+l[0]:l[0]),m);for(var m=1===q?m:Math.min(c+(l[1]||0),m),q=c+q-2,s=Math.max(m,q),B=[],u=[],D=2;c<s;++c,++D)c<m&&u.push(h("deleted",b[c],c)),c<q&&B.push(h("added",l[D],c));a.a.nb(u,B);break;default:return}e=r}}}};a.ba=a.h=function(b,c,d){function e(){q=!0;a.a.A(v,function(a,b){b.F()});v={};x=0;n=!1}function f(){var a=g.throttleEvaluation;a&&0<=a?(clearTimeout(t),t=setTimeout(h,a)):g.wa?g.wa():h()}function h(){if(!r&&!q){if(y&&y()){if(!m){p();return}}else m=!1;r=!0;try{var b=v,d=x;a.k.jb({za:function(a, 11620c){q||(d&&b[c]?(v[c]=b[c],++x,delete b[c],--d):v[c]||(v[c]=a.V(f),++x))},ba:g,pa:!x});v={};x=0;try{var e=c?s.call(c):s()}finally{a.k.end(),d&&a.a.A(b,function(a,b){b.F()}),n=!1}g.Ka(l,e)&&(g.notifySubscribers(l,"beforeChange"),l=e,g.wa&&!g.throttleEvaluation||g.notifySubscribers(l))}finally{r=!1}x||p()}}function g(){if(0<arguments.length){if("function"===typeof B)B.apply(c,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."); 11621return this}n&&h();a.k.zb(g);return l}function k(){return n||0<x}var l,n=!0,r=!1,m=!1,q=!1,s=b;s&&"object"==typeof s?(d=s,s=d.read):(d=d||{},s||(s=d.read));if("function"!=typeof s)throw Error("Pass a function that returns the value of the ko.computed");var B=d.write,u=d.disposeWhenNodeIsRemoved||d.G||null,D=d.disposeWhen||d.Da,y=D,p=e,v={},x=0,t=null;c||(c=d.owner);a.N.call(g);a.a.sa(g,a.h.fn);g.o=function(){n&&!x&&h();return l};g.fa=function(){return x};g.Yb="function"===typeof d.write;g.F=function(){p()}; 11622g.ga=k;var w=g.Ma;g.Ma=function(a){w.call(g,a);g.wa=function(){g.bb(l);n=!0;g.cb(g)}};a.s(g,"peek",g.o);a.s(g,"dispose",g.F);a.s(g,"isActive",g.ga);a.s(g,"getDependenciesCount",g.fa);u&&(m=!0,u.nodeType&&(y=function(){return!a.a.Ea(u)||D&&D()}));!0!==d.deferEvaluation&&h();u&&k()&&u.nodeType&&(p=function(){a.a.u.Ab(u,p);e()},a.a.u.ja(u,p));return g};a.$b=function(b){return a.Ha(b,a.h)};z=a.m.hc;a.h[z]=a.m;a.h.fn={equalityComparer:G};a.h.fn[z]=a.h;a.a.na&&a.a.ra(a.h.fn,a.N.fn);a.b("dependentObservable", 11623a.h);a.b("computed",a.h);a.b("isComputed",a.$b);(function(){function b(a,f,h){h=h||new d;a=f(a);if("object"!=typeof a||null===a||a===p||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var g=a instanceof Array?[]:{};h.save(a,g);c(a,function(c){var d=f(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":g[c]=d;break;case "object":case "undefined":var n=h.get(d);g[c]=n!==p?n:b(d,f,h)}});return g}function c(a,b){if(a instanceof Array){for(var c= 116240;c<a.length;c++)b(c);"function"==typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function d(){this.keys=[];this.ab=[]}a.Gb=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(c,function(b){for(var c=0;a.v(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.Gb(b);return a.a.Ya(b,c,d)};d.prototype={save:function(b,c){var d=a.a.l(this.keys,b);0<=d?this.ab[d]=c:(this.keys.push(b),this.ab.push(c))},get:function(b){b=a.a.l(this.keys, 11625b);return 0<=b?this.ab[b]:p}}})();a.b("toJS",a.Gb);a.b("toJSON",a.toJSON);(function(){a.i={p:function(b){switch(a.a.B(b)){case "option":return!0===b.__ko__hasDomDataOptionValue__?a.a.f.get(b,a.d.options.Pa):7>=a.a.oa?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.i.p(b.options[b.selectedIndex]):p;default:return b.value}},X:function(b,c,d){switch(a.a.B(b)){case "option":switch(typeof c){case "string":a.a.f.set(b,a.d.options.Pa, 11626p);"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=c;break;default:a.a.f.set(b,a.d.options.Pa,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===typeof c?c:""}break;case "select":if(""===c||null===c)c=p;for(var e=-1,f=0,h=b.options.length,g;f<h;++f)if(g=a.i.p(b.options[f]),g==c||""==g&&c===p){e=f;break}if(d||0<=e||c===p&&1<b.size)b.selectedIndex=e;break;default:if(null===c||c===p)c="";b.value=c}}}})();a.b("selectExtensions",a.i);a.b("selectExtensions.readValue", 11627a.i.p);a.b("selectExtensions.writeValue",a.i.X);a.g=function(){function b(b){b=a.a.ta(b);123===b.charCodeAt(0)&&(b=b.slice(1,-1));var c=[],d=b.match(e),g,m,q=0;if(d){d.push(",");for(var s=0,B;B=d[s];
11627++s){var u=B.charCodeAt(0);if(44===u){if(0>=q){g&&c.push(m?{key:g,value:m.join("")}:{unknown:g});g=m=q=0;continue}}else if(58===u){if(!m)continue}else if(47===u&&s&&1<B.length)(u=d[s-1].match(f))&&!h[u[0]]&&(b=b.substr(b.indexOf(B)+1),d=b.match(e),d.push(","),s=-1,B="/");else if(40===u||123===u||91=== 11628u)++q;else if(41===u||125===u||93===u)--q;else if(!g&&!m){g=34===u||39===u?B.slice(1,-1):B;continue}m?m.push(B):m=[B]}}return c}var c=["true","false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,h={"in":1,"return":1,"typeof":1},g={};return{aa:[],W:g,Ra:b,qa:function(e,l){function f(b,e){var l,k=a.getBindingHandler(b); 11629if(k&&k.preprocess?e=k.preprocess(e,b,f):1){if(k=g[b])l=e,0<=a.a.l(c,l)?l=!1:(k=l.match(d),l=null===k?!1:k[1]?"Object("+k[1]+")"+k[2]:l),k=l;k&&m.push("'"+b+"':function(_z){"+l+"=_z}");q&&(e="function(){return "+e+" }");h.push("'"+b+"':"+e)}}l=l||{};var h=[],m=[],q=l.valueAccessors,s="string"===typeof e?b(e):e;a.a.r(s,function(a){f(a.key||a.unknown,a.value)});m.length&&f("_ko_property_writers","{"+m.join(",")+" }");return h.join(",")},bc:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0; 11630return!1},va:function(b,c,d,e,g){if(b&&a.v(b))!a.ub(b)||g&&b.o()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();a.b("expressionRewriting",a.g);a.b("expressionRewriting.bindingRewriteValidators",a.g.aa);a.b("expressionRewriting.parseObjectLiteral",a.g.Ra);a.b("expressionRewriting.preProcessBindings",a.g.qa);a.b("expressionRewriting._twoWayBindings",a.g.W);a.b("jsonExpressionRewriting",a.g);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.g.qa);(function(){function b(a){return 8== 11631a.nodeType&&h.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function d(a,d){for(var e=a,g=1,k=[];e=e.nextSibling;){if(c(e)&&(g--,0===g))return k;k.push(e);b(e)&&g++}if(!d)throw Error("Cannot find closing comment tag to match: "+a.nodeValue);return null}function e(a,b){var c=d(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=w&&"\x3c!--test--\x3e"===w.createComment("test").text,h=f?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/, 11632g=f?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0};a.e={Q:{},childNodes:function(a){return b(a)?d(a):a.childNodes},da:function(c){if(b(c)){c=a.e.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Fa(c)},U:function(c,d){if(b(c)){a.e.da(c);for(var e=c.nextSibling,g=0,k=d.length;g<k;g++)e.parentNode.insertBefore(d[g],e)}else a.a.U(c,d)},yb:function(a,c){b(a)?a.parentNode.insertBefore(c,a.nextSibling):a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)},rb:function(c, 11633d,e){e?b(c)?c.parentNode.insertBefore(d,e.nextSibling):e.nextSibling?c.insertBefore(d,e.nextSibling):c.appendChild(d):a.e.yb(c,d)},firstChild:function(a){return b(a)?!a.nextSibling||c(a.nextSibling)?null:a.nextSibling:a.firstChild},nextSibling:function(a){b(a)&&(a=e(a));return a.nextSibling&&c(a.nextSibling)?null:a.nextSibling},Xb:b,lc:function(a){return(a=(f?a.text:a.nodeValue).match(h))?a[1]:null},wb:function(d){if(k[a.a.B(d)]){var g=d.firstChild;if(g){do if(1===g.nodeType){var f;f=g.firstChild; 11634var h=null;if(f){do if(h)h.push(f);else if(b(f)){var q=e(f,!0);q?f=q:h=[f]}else c(f)&&(h=[f]);while(f=f.nextSibling)}if(f=h)for(h=g.nextSibling,q=0;q<f.length;q++)h?d.insertBefore(f[q],h):d.appendChild(f[q])}while(g=g.nextSibling)}}}}})();a.b("virtualElements",a.e);a.b("virtualElements.allowedBindings",a.e.Q);a.b("virtualElements.emptyNode",a.e.da);a.b("virtualElements.insertAfter",a.e.rb);a.b("virtualElements.prepend",a.e.yb);a.b("virtualElements.setDomNodeChildren",a.e.U);(function(){a.J=function(){this.Nb= 11635{}};a.a.extend(a.J.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=b.getAttribute("data-bind");case 8:return a.e.Xb(b);default:return!1}},getBindings:function(a,c){var d=this.getBindingsString(a,c);return d?this.parseBindingsString(d,c,a):null},getBindingAccessors:function(a,c){var d=this.getBindingsString(a,c);return d?this.parseBindingsString(d,c,a,{valueAccessors:!0}):null},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind"); 11636case 8:return a.e.lc(b);default:return null}},parseBindingsString:function(b,c,d,e){try{var f=this.Nb,h=b+(e&&e.valueAccessors||""),g;if(!(g=f[h])){var k,l="with($context){with($data||{}){return{"+a.g.qa(b,e)+"}}}";k=new Function("$context","$element",l);g=f[h]=k}return g(c,d)}catch(n){throw n.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+n.message,n;}}});a.J.instance=new a.J})();a.b("bindingProvider",a.J);(function(){function b(a){return function(){return a}}function c(a){return a()} 11637function d(b){return a.a.Oa(a.k.t(b),function(a,c){return function(){return b()[c]}})}function e(a,b){return d(this.getBindings.bind(this,a,b))}function f(b,c,d){var e,g=a.e.firstChild(c),k=a.J.instance,f=k.preprocessNode;if(f){for(;e=g;)g=a.e.nextSibling(e),f.call(k,e);g=a.e.firstChild(c)}for(;e=g;)g=a.e.nextSibling(e),h(b,e,d)}function h(b,c,d){var e=!0,g=1===c.nodeType;g&&a.e.wb(c);if(g&&d||a.J.instance.nodeHasBindings(c))e=k(c,null,b,d).shouldBindDescendants;e&&!n[a.a.B(c)]&&f(b,c,!g)}function g(b){var c= 11638[],d={},e=[];a.a.A(b,function y(g){if(!d[g]){var k=a.getBindingHandler(g);k&&(k.after&&(e.push(g),a.a.r(k.after,function(c){if(b[c]){if(-1!==a.a.l(e,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+e.join(", "));y(c)}}),e.length--),c.push({key:g,pb:k}));d[g]=!0}});return c}function k(b,d,k,f){var h=a.a.f.get(b,r);
11638if(!d){if(h)throw Error("You cannot apply bindings multiple times to the same element.");a.a.f.set(b,r,!0)}!h&&f&&a.Eb(b,k);var l;if(d&&"function"!== 11639typeof d)l=d;else{var n=a.J.instance,m=n.getBindingAccessors||e,x=a.h(function(){(l=d?d(k,b):m.call(n,b,k))&&k.D&&k.D();return l},null,{G:b});l&&x.ga()||(x=null)}var t;if(l){var w=x?function(a){return function(){return c(x()[a])}}:function(a){return l[a]},z=function(){return a.a.Oa(x?x():l,c)};z.get=function(a){return l[a]&&c(w(a))};z.has=function(a){return a in l};f=g(l);a.a.r(f,function(c){var d=c.pb.init,e=c.pb.update,g=c.key;if(8===b.nodeType&&!a.e.Q[g])throw Error("The binding '"+g+"' cannot be used with virtual elements"); 11640try{"function"==typeof d&&a.k.t(function(){var a=d(b,w(g),z,k.$data,k);if(a&&a.controlsDescendantBindings){if(t!==p)throw Error("Multiple bindings ("+t+" and "+g+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");t=g}}),"function"==typeof e&&a.h(function(){e(b,w(g),z,k.$data,k)},null,{G:b})}catch(f){throw f.message='Unable to process binding "'+g+": "+l[g]+'"\nMessage: '+f.message,f;}})}return{shouldBindDescendants:t===p}} 11641function l(b){return b&&b instanceof a.I?b:new a.I(b)}a.d={};var n={script:!0};a.getBindingHandler=function(b){return a.d[b]};a.I=function(b,c,d,e){var g=this,k="function"==typeof b&&!a.v(b),f,h=a.h(function(){var f=k?b():b,l=a.a.c(f);c?(c.D&&c.D(),a.a.extend(g,c),h&&(g.D=h)):(g.$parents=[],g.$root=l,g.ko=a);g.$rawData=f;g.$data=l;d&&(g[d]=l);e&&e(g,c,l);return g.$data},null,{Da:function(){return f&&!a.a.eb(f)},G:!0});h.ga()&&(g.D=h,h.equalityComparer=null,f=[],h.Jb=function(b){f.push(b);a.a.u.ja(b, 11642function(b){a.a.ma(f,b);f.length||(h.F(),g.D=h=p)})})};a.I.prototype.createChildContext=function(b,c,d){return new a.I(b,this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)})};a.I.prototype.extend=function(b){return new a.I(this.D||this.$data,this,null,function(c,d){c.$rawData=d.$rawData;a.a.extend(c,"function"==typeof b?b():b)})};var r=a.a.f.L(),m=a.a.f.L();a.Eb=function(b,c){if(2==arguments.length)a.a.f.set(b,m,c), 11643c.D&&c.D.Jb(b);else return a.a.f.get(b,m)};a.xa=function(b,c,d){1===b.nodeType&&a.e.wb(b);return k(b,c,l(d),!0)};a.Lb=function(c,e,g){g=l(g);return a.xa(c,"function"===typeof e?d(e.bind(null,g,c)):a.a.Oa(e,b),g)};a.gb=function(a,b){1!==b.nodeType&&8!==b.nodeType||f(l(a),b,!0)};a.fb=function(a,b){!t&&A.jQuery&&(t=A.jQuery);if(b&&1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");b=b||A.document.body;h(l(a), 11644b,!0)};a.Ca=function(b){switch(b.nodeType){case 1:case 8:var c=a.Eb(b);if(c)return c;if(b.parentNode)return a.Ca(b.parentNode)}return p};a.Pb=function(b){return(b=a.Ca(b))?b.$data:p};a.b("bindingHandlers",a.d);a.b("applyBindings",a.fb);a.b("applyBindingsToDescendants",a.gb);a.b("applyBindingAccessorsToNode",a.xa);a.b("applyBindingsToNode",a.Lb);a.b("contextFor",a.Ca);a.b("dataFor",a.Pb)})();var L={"class":"className","for":"htmlFor"};a.d.attr={update:function(b,c){var d=a.a.c(c())||{};a.a.A(d,function(c, 11645d){d=a.a.c(d);var h=!1===d||null===d||d===p;h&&b.removeAttribute(c);8>=a.a.oa&&c in L?(c=L[c],h?b.removeAttribute(c):b[c]=d):h||b.setAttribute(c,d.toString());"name"===c&&a.a.Cb(b,h?"":d.toString())})}};(function(){a.d.checked={after:["value","attr"],init:function(b,c,d){function e(){return d.has("checkedValue")?a.a.c(d.get("checkedValue")):b.value}function f(){var g=b.checked,f=r?e():g;if(!a.ca.pa()&&(!k||g)){var h=a.k.t(c);l?n!==f?(g&&(a.a.Y(h,f,!0),a.a.Y(h,n,!1)),n=f):a.a.Y(h,f,g):a.g.va(h,d,"checked", 11646f,!0)}}function h(){var d=a.a.c(c());b.checked=l?0<=a.a.l(d,e()):g?d:e()===d}var g="checkbox"==b.type,k="radio"==b.type;if(g||k){var l=g&&a.a.c(c())instanceof Array,n=l?e():p,r=k||l;k&&!b.name&&a.d.uniqueName.init(b,function(){return!0});a.ba(f,null,{G:b});a.a.q(b,"click",f);a.ba(h,null,{G:b})}}};a.g.W.checked=!0;a.d.checkedValue={update:function(b,c){b.value=a.a.c(c())}}})();a.d.css={update:function(b,c){var d=a.a.c(c());"object"==typeof d?a.a.A(d,function(c,d){d=a.a.c(d);a.a.ua(b,c,d)}):(d=String(d|| 11647""),a.a.ua(b,b.__ko__cssValue,!1),b.__ko__cssValue=d,a.a.ua(b,d,!0))}};a.d.enable={update:function(b,c){var d=a.a.c(c());d&&b.disabled?b.removeAttribute("disabled"):d||b.disabled||(b.disabled=!0)}};a.d.disable={update:function(b,c){a.d.enable.update(b,function(){return!a.a.c(c())})}};a.d.event={init:function(b,c,d,e,f){var h=c()||{};a.a.A(h,function(g){"string"==typeof g&&a.a.q(b,g,function(b){var h,n=c()[g];if(n){try{var r=a.a.R(arguments);e=f.$data;r.unshift(e);h=n.apply(e,r)}finally{!0!==h&&(b.preventDefault? 11648b.preventDefault():b.returnValue=!1)}!1===d.get(g+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.d.foreach={vb:function(b){return function(){var c=b(),d=a.a.Sa(c);if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.K.Ja};a.a.c(c);return{foreach:d.data,as:d.as,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRe
11648nder:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.K.Ja}}},init:function(b, 11649c){return a.d.template.init(b,a.d.foreach.vb(c))},update:function(b,c,d,e,f){return a.d.template.update(b,a.d.foreach.vb(c),d,e,f)}};a.g.aa.foreach=!1;a.e.Q.foreach=!0;a.d.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var k=b.ownerDocument;if("activeElement"in k){var f;try{f=k.activeElement}catch(h){f=k.body}e=f===b}k=c();a.g.va(k,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),h=e.bind(null,!1);a.a.q(b,"focus",f);a.a.q(b,"focusin", 11650f);a.a.q(b,"blur",h);a.a.q(b,"focusout",h)},update:function(b,c){var d=!!a.a.c(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),a.k.t(a.a.ha,null,[b,d?"focusin":"focusout"]))}};a.g.W.hasfocus=!0;a.d.hasFocus=a.d.hasfocus;a.g.W.hasFocus=!0;a.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Va(b,c())}};H("if");H("ifnot",!1,!0);H("with",!0,!1,function(a,c){return a.createChildContext(c)});var J={};a.d.options={init:function(b){if("select"!== 11651a.a.B(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.la(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function h(c,d){if(r.length){var e=0<=a.a.l(r,a.i.p(d[0]));a.a.Db(d[0],e);m&&!e&&a.k.t(a.a.ha,null,[b,"change"])}}var g=0!=b.length&&b.multiple?b.scrollTop:null,k=a.a.c(c()),l=d.get("optionsIncludeDestroyed"); 11652c={};var n,r;r=b.multiple?a.a.ya(e(),a.i.p):0<=b.selectedIndex?[a.i.p(b.options[b.selectedIndex])]:[];k&&("undefined"==typeof k.length&&(k=[k]),n=a.a.la(k,function(b){return l||b===p||null===b||!a.a.c(b._destroy)}),d.has("optionsCaption")&&(k=a.a.c(d.get("optionsCaption")),null!==k&&k!==p&&n.unshift(J)));var m=!1;c.beforeRemove=function(a){b.removeChild(a)};k=h;d.has("optionsAfterRender")&&(k=function(b,c){h(0,c);a.k.t(d.get("optionsAfterRender"),null,[c[0],b!==J?b:p])});a.a.Ua(b,n,function(c,e,g){g.length&& 11653(r=g[0].selected?[a.i.p(g[0])]:[],m=!0);e=b.ownerDocument.createElement("option");c===J?(a.a.Xa(e,d.get("optionsCaption")),a.i.X(e,p)):(g=f(c,d.get("optionsValue"),c),a.i.X(e,a.a.c(g)),c=f(c,d.get("optionsText"),g),a.a.Xa(e,c));return[e]},c,k);a.k.t(function(){d.get("valueAllowUnset")&&d.has("value")?a.i.X(b,a.a.c(d.get("value")),!0):(b.multiple?r.length&&e().length<r.length:r.length&&0<=b.selectedIndex?a.i.p(b.options[b.selectedIndex])!==r[0]:r.length||0<=b.selectedIndex)&&a.a.ha(b,"change")});a.a.Tb(b); 11654g&&20<Math.abs(g-b.scrollTop)&&(b.scrollTop=g)}};a.d.options.Pa=a.a.f.L();a.d.selectedOptions={after:["options","foreach"],init:function(b,c,d){a.a.q(b,"change",function(){var e=c(),f=[];a.a.r(b.getElementsByTagName("option"),function(b){b.selected&&f.push(a.i.p(b))});a.g.va(e,d,"selectedOptions",f)})},update:function(b,c){if("select"!=a.a.B(b))throw Error("values binding applies only to SELECT elements");var d=a.a.c(c());d&&"number"==typeof d.length&&a.a.r(b.getElementsByTagName("option"),function(b){var c= 116550<=a.a.l(d,a.i.p(b));a.a.Db(b,c)})}};a.g.W.selectedOptions=!0;a.d.style={update:function(b,c){var d=a.a.c(c()||{});a.a.A(d,function(c,d){d=a.a.c(d);b.style[c]=d||""})}};a.d.submit={init:function(b,c,d,e,f){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");a.a.q(b,"submit",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.d.text={init:function(){return{controlsDescendantBindings:!0}}, 11656update:function(b,c){a.a.Xa(b,c())}};a.e.Q.text=!0;a.d.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.d.uniqueName.Ob;a.a.Cb(b,d)}}};a.d.uniqueName.Ob=0;a.d.value={after:["options","foreach"],init:function(b,c,d){function e(){g=!1;var e=c(),f=a.i.p(b);a.g.va(e,d,"value",f)}var f=["change"],h=d.get("valueUpdate"),g=!1;h&&("string"==typeof h&&(h=[h]),a.a.$(f,h),f=a.a.ib(f));!a.a.oa||"input"!=b.tagName.toLowerCase()||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete|| 11657-1!=a.a.l(f,"propertychange")||(a.a.q(b,"propertychange",function(){g=!0}),a.a.q(b,"focus",function(){g=!1}),a.a.q(b,"blur",function(){g&&e()}));a.a.r(f,function(c){var d=e;a.a.kc(c,"after")&&(d=function(){setTimeout(e,0)},c=c.substring(5));a.a.q(b,c,d)})},update:function(b,c,d){var e=a.a.c(c());c=a.i.p(b);if(e!==c)if("select"===a.a.B(b)){var f=d.get("valueAllowUnset");d=function(){a.i.X(b,e,f)};d();f||e===a.i.p(b)?setTimeout(d,0):a.k.t(a.a.ha,null,[b,"change"])}else a.i.X(b,e)}};a.g.W.value=!0;a.d.visible= 11658{update:function(b,c){var d=a.a.c(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};(function(b){a.d[b]={init:function(c,d,e,f,h){return a.d.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,h)}}})("click");a.C=function(){};a.C.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};a.C.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.C.prototype.makeTemplateSource= 11659function(b,c){if("string"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.n.j(d)}if(1==b.nodeType||8==b.nodeType)return new a.n.Z(b);throw Error("Unknown template type: "+b);};a.C.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d)};a.C.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.C.prototype.rewriteTemplate= 11660function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.C);a.Za=function(){function b(b,c,d,g){b=a.g.Ra(b);for(var k=a.g.aa,l=0;l<b.length;l++){var n=b[l].key;if(k.hasOwnProperty(n)){var r=k[n];if("function"===typeof r){if(n=r(b[l].value))throw Error(n);}else if(!r)throw Error("This template engine does not support the '"+n+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.g.qa(b, 11661{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return g.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\
11661s\S]*?)\3/gi,d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Ub:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.Za.dc(b,c)},d)},dc:function(a,f){return a.replace(c,function(a,c,d,e,n){return b(n,c,d,f)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e", 11662"#comment",f)})},Mb:function(b,c){return a.w.Na(function(d,g){var k=d.nextSibling;k&&k.nodeName.toLowerCase()===c&&a.xa(k,b,g)})}}}();a.b("__tr_ambtns",a.Za.Mb);(function(){a.n={};a.n.j=function(a){this.j=a};a.n.j.prototype.text=function(){var b=a.a.B(this.j),b="script"===b?"text":"textarea"===b?"value":"innerHTML";if(0==arguments.length)return this.j[b];var c=arguments[0];"innerHTML"===b?a.a.Va(this.j,c):this.j[b]=c};var b=a.a.f.L()+"_";a.n.j.prototype.data=function(c){if(1===arguments.length)return a.a.f.get(this.j, 11663b+c);a.a.f.set(this.j,b+c,arguments[1])};var c=a.a.f.L();a.n.Z=function(a){this.j=a};a.n.Z.prototype=new a.n.j;a.n.Z.prototype.text=function(){if(0==arguments.length){var b=a.a.f.get(this.j,c)||{};b.$a===p&&b.Ba&&(b.$a=b.Ba.innerHTML);return b.$a}a.a.f.set(this.j,c,{$a:arguments[0]})};a.n.j.prototype.nodes=function(){if(0==arguments.length)return(a.a.f.get(this.j,c)||{}).Ba;a.a.f.set(this.j,c,{Ba:arguments[0]})};a.b("templateSources",a.n);a.b("templateSources.domElement",a.n.j);a.b("templateSources.anonymousTemplate", 11664a.n.Z)})();(function(){function b(b,c,d){var e;for(c=a.e.nextSibling(c);b&&(e=b)!==c;)b=a.e.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],h=e.parentNode,m=a.J.instance,q=m.preprocessNode;if(q){b(e,f,function(a,b){var c=a.previousSibling,d=q.call(m,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):(c.push(e,f),a.a.ea(c,h))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.fb(d,b)});b(e,f,function(b){1!==b.nodeType&&8!== 11665b.nodeType||a.w.Ib(b,[d])});a.a.ea(c,h)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,h,n,r){r=r||{};var m=b&&d(b),m=m&&m.ownerDocument,q=r.templateEngine||f;a.Za.Ub(h,q,m);h=q.renderTemplate(h,n,r,m);if("number"!=typeof h.length||0<h.length&&"number"!=typeof h[0].nodeType)throw Error("Template engine must return an array of DOM nodes");m=!1;switch(e){case "replaceChildren":a.e.U(b,h);m=!0;break;case "replaceNode":a.a.Bb(b,h);m=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+ 11666e);}m&&(c(h,n),r.afterRender&&a.k.t(r.afterRender,null,[h,n.$data]));return h}var f;a.Wa=function(b){if(b!=p&&!(b instanceof a.C))throw Error("templateEngine must inherit from ko.templateEngine");f=b};a.Ta=function(b,c,h,n,r){h=h||{};if((h.templateEngine||f)==p)throw Error("Set a template engine before calling renderTemplate");r=r||"replaceChildren";if(n){var m=d(n);return a.h(function(){var f=c&&c instanceof a.I?c:new a.I(a.a.c(c)),p=a.v(b)?b():"function"==typeof b?b(f.$data,f):b,f=e(n,r,p,f,h); 11667"replaceNode"==r&&(n=f,m=d(n))},null,{Da:function(){return!m||!a.a.Ea(m)},G:m&&"replaceNode"==r?m.parentNode:m})}return a.w.Na(function(d){a.Ta(b,c,h,d,"replaceNode")})};a.jc=function(b,d,f,h,r){function m(a,b){c(b,s);f.afterRender&&f.afterRender(b,a)}function q(a,c){s=r.createChildContext(a,f.as,function(a){a.$index=c});var d="function"==typeof b?b(a,s):b;return e(null,"ignoreTargetNode",d,s,f)}var s;return a.h(function(){var b=a.a.c(d)||[];"undefined"==typeof b.length&&(b=[b]);b=a.a.la(b,function(b){return f.includeDestroyed|| 11668b===p||null===b||!a.a.c(b._destroy)});a.k.t(a.a.Ua,null,[h,b,q,f,m])},null,{G:h})};var h=a.a.f.L();a.d.template={init:function(b,c){var d=a.a.c(c());"string"==typeof d||d.name?a.e.da(b):(d=a.e.childNodes(b),d=a.a.ec(d),(new a.n.Z(b)).nodes(d));return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var m=c(),q;c=a.a.c(m);d=!0;e=null;"string"==typeof c?c={}:(m=c.name,"if"in c&&(d=a.a.c(c["if"])),d&&"ifnot"in c&&(d=!a.a.c(c.ifnot)),q=a.a.c(c.data));"foreach"in c?e=a.jc(m||b,d&&c.foreach|| 11669[],c,b,f):d?(f="data"in c?f.createChildContext(q,c.as):f,e=a.Ta(m||b,f,c,b)):a.e.da(b);f=e;(q=a.a.f.get(b,h))&&"function"==typeof q.F&&q.F();a.a.f.set(b,h,f&&f.ga()?f:p)}};a.g.aa.template=function(b){b=a.g.Ra(b);return 1==b.length&&b[0].unknown||a.g.bc(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.e.Q.template=!0})();a.b("setTemplateEngine",a.Wa);a.b("renderTemplate",a.Ta);a.a.nb=function(a,c,d){if(a.length&&c.length){var e,f,h,g,k;for(e= 11670f=0;(!d||e<d)&&(g=a[f]);++f){for(h=0;k=c[h];
11670++h)if(g.value===k.value){g.moved=k.index;k.moved=g.index;c.splice(h,1);e=h=0;break}e+=h}}};a.a.Aa=function(){function b(b,d,e,f,h){var g=Math.min,k=Math.max,l=[],n,p=b.length,m,q=d.length,s=q-p||1,t=p+q+1,u,w,y;for(n=0;n<=p;n++)for(w=u,l.push(u=[]),y=g(q,n+s),m=k(0,n-1);m<=y;m++)u[m]=m?n?b[n-1]===d[m-1]?w[m-1]:g(w[m]||t,u[m-1]||t)+1:m+1:n+1;g=[];k=[];s=[];n=p;for(m=q;n||m;)q=l[n][m]-1,m&&q===l[n][m-1]?k.push(g[g.length]={status:e,value:d[--m],index:m}): 11671n&&q===l[n-1][m]?s.push(g[g.length]={status:f,value:b[--n],index:n}):(--m,--n,h.sparse||g.push({status:"retained",value:d[m]}));a.a.nb(k,s,10*p);return g.reverse()}return function(a,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<=d.length?b(a,d,"added","deleted",e):b(d,a,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.Aa);(function(){function b(b,c,f,h,g){var k=[],l=a.h(function(){var l=c(f,g,a.a.ea(k,b))||[];0<k.length&&(a.a.Bb(k,l),h&&a.k.t(h,null,[f, 11672l,g]));k.length=0;a.a.$(k,l)},null,{G:b,Da:function(){return!a.a.eb(k)}});return{S:k,h:l.ga()?l:p}}var c=a.a.f.L();a.a.Ua=function(d,e,f,h,g){function k(b,c){v=r[c];u!==c&&(z[b]=v);v.Ia(u++);a.a.ea(v.S,d);s.push(v);y.push(v)}function l(b,c){if(b)for(var d=0,e=c.length;d<e;d++)c[d]&&a.a.r(c[d].S,function(a){b(a,d,c[d].ka)})}e=e||[];h=h||{};var n=a.a.f.get(d,c)===p,r=a.a.f.get(d,c)||[],m=a.a.ya(r,function(a){return a.ka}),q=a.a.Aa(m,e,h.dontLimitMoves),s=[],t=0,u=0,w=[],y=[];e=[];for(var z=[],m=[], 11673v,x=0,A,C;A=q[x];x++)switch(C=A.moved,A.status){case "deleted":C===p&&(v=r[t],v.h&&v.h.F(),w.push.apply(w,a.a.ea(v.S,d)),h.beforeRemove&&(e[x]=v,y.push(v)));t++;break;case "retained":k(x,t++);break;case "added":C!==p?k(x,C):(v={ka:A.value,Ia:a.m(u++)},s.push(v),y.push(v),n||(m[x]=v))}l(h.beforeMove,z);a.a.r(w,h.beforeRemove?a.M:a.removeNode);for(var x=0,n=a.e.firstChild(d),E;v=y[x];x++){v.S||a.a.extend(v,b(d,f,v.ka,g,v.Ia));for(t=0;q=v.S[t];n=q.nextSibling,E=q,t++)q!==n&&a.e.rb(d,q,E);!v.Zb&&g&&(g(v.ka, 11674v.S,v.Ia),v.Zb=!0)}l(h.beforeRemove,e);l(h.afterMove,z);l(h.afterAdd,m);a.a.f.set(d,c,s)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.Ua);a.K=function(){this.allowTemplateRewriting=!1};a.K.prototype=new a.C;a.K.prototype.renderTemplateSource=function(b){var c=(9>a.a.oa?0:b.nodes)?b.nodes():null;if(c)return a.a.R(c.cloneNode(!0).childNodes);b=b.text();return a.a.Qa(b)};a.K.Ja=new a.K;a.Wa(a.K.Ja);a.b("nativeTemplateEngine",a.K);(function(){a.La=function(){var a=this.ac=function(){if(!t|| 11675!t.tmpl)return 0;try{if(0<=t.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,f){f=f||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=t.template(null,"{{ko_with $item.koBindingContext}}"+h+"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=t.extend({koBindingContext:e},f.templateOptions);e=t.tmpl(h,b,e);e.appendTo(w.createElement("div")); 11676t.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){w.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(t.tmpl.tag.ko_code={open:"__.push($1 || '');"},t.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.La.prototype=new a.C;var b=new a.La;0<b.ac&&a.Wa(b);a.b("jqueryTmplTemplateEngine",a.La)})()})})();})(); 11677//! moment.js 11678//! version : 2.29.4 11679//! authors : Tim Wood, Iskren Chernev, Moment.js contributors 11680//! license : MIT 11681//! momentjs.com 11682 11683;(function (global, factory) { 11684 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 11685 typeof define === 'function' && define.amd ? define(factory) : 11686 global.moment = factory() 11687}(this, (function () { 'use strict'; 11688 11689 var hookCallback; 11690 11691 function hooks() { 11692 return hookCallback.apply(null, arguments); 11693 } 11694 11695 // This is done to register the method called with moment() 11696 // without creating circular dependencies. 11697 function setHookCallback(callback) { 11698 hookCallback = callback; 11699 } 11700 11701 function isArray(input) { 11702 return ( 11703 input instanceof Array || 11704 Object.prototype.toString.call(input) === '[object Array]' 11705 ); 11706 } 11707 11708 function isObject(input) { 11709 // IE8 will treat undefined and null as object if it wasn't for 11710 // input != null 11711 return ( 11712 input != null && 11713 Object.prototype.toString.call(input) === '[object Object]' 11714 ); 11715 } 11716 11717 function hasOwnProp(a, b) { 11718 return Object.prototype.hasOwnProperty.call(a, b); 11719 } 11720 11721 function isObjectEmpty(obj) { 11722 if (Object.getOwnPropertyNames) { 11723 return Object.getOwnPropertyNames(obj).length === 0; 11724 } else { 11725 var k; 11726 for (k in obj) { 11727 if (hasOwnProp(obj, k)) { 11728 return false;
vendor: 11,502 bytes, lines 11729-12131
11729 } 11730 } 11731 return true; 11732 } 11733 } 11734 11735 function isUndefined(input) { 11736 return input === void 0; 11737 } 11738 11739 function isNumber(input) { 11740 return ( 11741 typeof input === 'number' || 11742 Object.prototype.toString.call(input) === '[object Number]' 11743 ); 11744 } 11745 11746 function isDate(input) { 11747 return ( 11748 input instanceof Date || 11749 Object.prototype.toString.call(input) === '[object Date]' 11750 ); 11751 } 11752 11753 function map(arr, fn) { 11754 var res = [], 11755 i, 11756 arrLen = arr.length; 11757 for (i = 0; i < arrLen; ++i) { 11758 res.push(fn(arr[i], i)); 11759 } 11760 return res; 11761 } 11762 11763 function extend(a, b) { 11764 for (var i in b) { 11765 if (hasOwnProp(b, i)) { 11766 a[i] = b[i]; 11767 } 11768 } 11769 11770 if (hasOwnProp(b, 'toString')) { 11771 a.toString = b.toString; 11772 } 11773 11774 if (hasOwnProp(b, 'valueOf')) { 11775 a.valueOf = b.valueOf; 11776 } 11777 11778 return a; 11779 } 11780 11781 function createUTC(input, format, locale, strict) { 11782 return createLocalOrUTC(input, format, locale, strict, true).utc(); 11783 } 11784 11785 function defaultParsingFlags() { 11786 // We need to deep clone this object. 11787 return { 11788 empty: false, 11789 unusedTokens: [], 11790 unusedInput: [], 11791 overflow: -2, 11792 charsLeftOver: 0, 11793 nullInput: false, 11794 invalidEra: null, 11795 invalidMonth: null, 11796 invalidFormat: false, 11797 userInvalidated: false, 11798 iso: false, 11799 parsedDateParts: [], 11800 era: null, 11801 meridiem: null, 11802 rfc2822: false, 11803 weekdayMismatch: false, 11804 }; 11805 } 11806 11807 function getParsingFlags(m) { 11808 if (m._pf == null) { 11809 m._pf = defaultParsingFlags(); 11810 } 11811 return m._pf; 11812 } 11813 11814 var some; 11815 if (Array.prototype.some) { 11816 some = Array.prototype.some; 11817 } else { 11818 some = function (fun) { 11819 var t = Object(this), 11820 len = t.length >>> 0, 11821 i; 11822 11823 for (i = 0; i < len; i++) { 11824 if (i in t && fun.call(this, t[i], i, t)) { 11825 return true; 11826 } 11827 } 11828 11829 return false; 11830 }; 11831 } 11832 11833 function isValid(m) { 11834 if (m._isValid == null) { 11835 var flags = getParsingFlags(m), 11836 parsedParts = some.call(flags.parsedDateParts, function (i) { 11837 return i != null; 11838 }), 11839 isNowValid = 11840 !isNaN(m._d.getTime()) && 11841 flags.overflow < 0 && 11842 !flags.empty && 11843 !flags.invalidEra && 11844 !flags.invalidMonth && 11845 !flags.invalidWeekday && 11846 !flags.weekdayMismatch && 11847 !flags.nullInput && 11848 !flags.invalidFormat && 11849 !flags.userInvalidated && 11850 (!flags.meridiem || (flags.meridiem && parsedParts)); 11851 11852 if (m._strict) { 11853 isNowValid = 11854 isNowValid && 11855 flags.charsLeftOver === 0 && 11856 flags.unusedTokens.length === 0 && 11857 flags.bigHour === undefined; 11858 } 11859 11860 if (Object.isFrozen == null || !Object.isFrozen(m)) { 11861 m._isValid = isNowValid; 11862 } else { 11863 return isNowValid; 11864 } 11865 } 11866 return m._isValid; 11867 } 11868 11869 function createInvalid(flags) { 11870 var m = createUTC(NaN); 11871 if (flags != null) { 11872 extend(getParsingFlags(m), flags); 11873 } else { 11874 getParsingFlags(m).userInvalidated = true; 11875 } 11876 11877 return m; 11878 } 11879 11880 // Plugins that add properties should also add the key here (null value), 11881 // so we can properly clone ourselves. 11882 var momentProperties = (hooks.momentProperties = []), 11883 updateInProgress = false; 11884 11885 function copyConfig(to, from) { 11886 var i, 11887 prop, 11888 val, 11889 momentPropertiesLen = momentProperties.length; 11890 11891 if (!isUndefined(from._isAMomentObject)) { 11892 to._isAMomentObject = from._isAMomentObject; 11893 } 11894 if (!isUndefined(from._i)) { 11895 to._i = from._i; 11896 } 11897 if (!isUndefined(from._f)) { 11898 to._f = from._f; 11899 } 11900 if (!isUndefined(from._l)) { 11901 to._l = from._l; 11902 } 11903 if (!isUndefined(from._strict)) { 11904 to._strict = from._strict; 11905 } 11906 if (!isUndefined(from._tzm)) { 11907 to._tzm = from._tzm; 11908 } 11909 if (!isUndefined(from._isUTC)) { 11910 to._isUTC = from._isUTC; 11911 } 11912 if (!isUndefined(from._offset)) { 11913 to._offset = from._offset; 11914 } 11915 if (!isUndefined(from._pf)) { 11916 to._pf = getParsingFlags(from); 11917 } 11918 if (!isUndefined(from._locale)) { 11919 to._locale = from._locale; 11920 } 11921 11922 if (momentPropertiesLen > 0) { 11923 for (i = 0; i < momentPropertiesLen; i++) { 11924 prop = momentProperties[i]; 11925 val = from[prop]; 11926 if (!isUndefined(val)) { 11927 to[prop] = val; 11928 } 11929 } 11930 } 11931 11932 return to; 11933 } 11934 11935 // Moment prototype object 11936 function Moment(config) { 11937 copyConfig(this, config); 11938 this._d = new Date(config._d != null ? config._d.getTime() : NaN); 11939 if (!this.isValid()) { 11940 this._d = new Date(NaN); 11941 } 11942 // Prevent infinite loop in case updateOffset creates new moment 11943 // objects. 11944 if (updateInProgress === false) { 11945 updateInProgress = true; 11946 hooks.updateOffset(this); 11947 updateInProgress = false; 11948 } 11949 } 11950 11951 function isMoment(obj) { 11952 return ( 11953 obj instanceof Moment || (obj != null && obj._isAMomentObject != null) 11954 ); 11955 } 11956 11957 function warn(msg) { 11958 if ( 11959 hooks.suppressDeprecationWarnings === false && 11960 typeof console !== 'undefined' && 11961 console.warn 11962 ) { 11963 console.warn('Deprecation warning: ' + msg); 11964 } 11965 } 11966 11967 function deprecate(msg, fn) { 11968 var firstTime = true; 11969 11970 return extend(function () { 11971 if (hooks.deprecationHandler != null) { 11972 hooks.deprecationHandler(null, msg); 11973 } 11974 if (firstTime) { 11975 var args = [], 11976 arg, 11977 i, 11978 key, 11979 argLen = arguments.length; 11980 for (i = 0; i < argLen; i++) { 11981 arg = ''; 11982 if (typeof arguments[i] === 'object') { 11983 arg += '\n[' + i + '] '; 11984 for (key in arguments[0]) { 11985 if (hasOwnProp(arguments[0], key)) { 11986 arg += key + ': ' + arguments[0][key] + ', '; 11987 } 11988 } 11989 arg = arg.slice(0, -2); // Remove trailing comma and space 11990 } else { 11991 arg = arguments[i]; 11992 } 11993 args.push(arg); 11994 } 11995 warn( 11996 msg + 11997 '\nArguments: ' + 11998 Array.prototype.slice.call(args).join('') + 11999 '\n' + 12000 new Error().stack 12001 ); 12002 firstTime = false; 12003 } 12004 return fn.apply(this, arguments); 12005 }, fn); 12006 } 12007 12008 var deprecations = {}; 12009 12010 function deprecateSimple(name, msg) { 12011 if (hooks.deprecationHandler != null) { 12012 hooks.deprecationHandler(name, msg); 12013 } 12014 if (!deprecations[name]) { 12015 warn(msg); 12016 deprecations[name] = true; 12017 } 12018 } 12019 12020 hooks.suppressDeprecationWarnings = false; 12021 hooks.deprecationHandler = null; 12022 12023 function isFunction(input) { 12024 return ( 12025 (typeof Function !== 'undefined' && input instanceof Function) || 12026 Object.prototype.toString.call(input) === '[object Function]' 12027 ); 12028 } 12029 12030 function set(config) { 12031 var prop, i; 12032 for (i in config) { 12033 if (hasOwnProp(config, i)) { 12034 prop = config[i]; 12035 if (isFunction(prop)) { 12036 this[i] = prop; 12037 } else { 12038 this['_' + i] = prop; 12039 } 12040 } 12041 } 12042 this._config = config; 12043 // Lenient ordinal parsing accepts just a number in addition to 12044 // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. 12045 // TODO: Remove "ordinalParse" fallback in next major release. 12046 this._dayOfMonthOrdinalParseLenient = new RegExp( 12047 (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + 12048 '|' + 12049 /\d{1,2}/.source 12050 ); 12051 } 12052 12053 function mergeConfigs(parentConfig, childConfig) { 12054 var res = extend({}, parentConfig), 12055 prop; 12056 for (prop in childConfig) { 12057 if (hasOwnProp(childConfig, prop)) { 12058 if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { 12059 res[prop] = {}; 12060 extend(res[prop], parentConfig[prop]); 12061 extend(res[prop], childConfig[prop]); 12062 } else if (childConfig[prop] != null) { 12063 res[prop] = childConfig[prop]; 12064 } else { 12065 delete res[prop]; 12066 } 12067 } 12068 } 12069 for (prop in parentConfig) { 12070 if ( 12071 hasOwnProp(parentConfig, prop) && 12072 !hasOwnProp(childConfig, prop) && 12073 isObject(parentConfig[prop]) 12074 ) { 12075 // make sure changes to properties don't modify parent config 12076 res[prop] = extend({}, res[prop]); 12077 } 12078 } 12079 return res; 12080 } 12081 12082 function Locale(config) { 12083 if (config != null) { 12084 this.set(config); 12085 } 12086 } 12087 12088 var keys; 12089 12090 if (Object.keys) { 12091 keys = Object.keys; 12092 } else { 12093 keys = function (obj) { 12094 var i, 12095 res = []; 12096 for (i in obj) { 12097 if (hasOwnProp(obj, i)) { 12098 res.push(i); 12099 } 12100 } 12101 return res; 12102 }; 12103 } 12104 12105 var defaultCalendar = { 12106 sameDay: '[Today at] LT', 12107 nextDay: '[Tomorrow at] LT', 12108 nextWeek: 'dddd [at] LT', 12109 lastDay: '[Yesterday at] LT', 12110 lastWeek: '[Last] dddd [at] LT', 12111 sameElse: 'L', 12112 }; 12113 12114 function calendar(key, mom, now) { 12115 var output = this._calendar[key] || this._calendar['sameElse']; 12116 return isFunction(output) ? output.call(mom, now) : output; 12117 } 12118 12119 function zeroFill(number, targetLength, forceSign) { 12120 var absNumber = '' + Math.abs(number), 12121 zerosToFill = targetLength - absNumber.length, 12122 sign = number >= 0; 12123 return ( 12124 (sign ? (forceSign ? '+' : '') : '-') + 12125 Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + 12126 absNumber 12127 ); 12128 } 12129 12130 var formattingTokens = 12131
vendor: 8,563 bytes, lines 12131-12435
12131 /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, 12132 localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, 12133 formatFunctions = {}, 12134 formatTokenFunctions = {}; 12135 12136 // token: 'M' 12137 // padded: ['MM', 2] 12138 // ordinal: 'Mo' 12139 // callback: function () { this.month() + 1 } 12140 function addFormatToken(token, padded, ordinal, callback) { 12141 var func = callback; 12142 if (typeof callback === 'string') { 12143 func = function () { 12144 return this[callback](); 12145 }; 12146 } 12147 if (token) { 12148 formatTokenFunctions[token] = func; 12149 } 12150 if (padded) { 12151 formatTokenFunctions[padded[0]] = function () { 12152 return zeroFill(func.apply(this, arguments), padded[1], padded[2]); 12153 }; 12154 } 12155 if (ordinal) { 12156 formatTokenFunctions[ordinal] = function () { 12157 return this.localeData().ordinal( 12158 func.apply(this, arguments), 12159 token 12160 ); 12161 }; 12162 } 12163 } 12164 12165 function removeFormattingTokens(input) { 12166 if (input.match(/\[[\s\S]/)) { 12167 return input.replace(/^\[|\]$/g, ''); 12168 } 12169 return input.replace(/\\/g, ''); 12170 } 12171 12172 function makeFormatFunction(format) { 12173 var array = format.match(formattingTokens), 12174 i, 12175 length; 12176 12177 for (i = 0, length = array.length; i < length; i++) { 12178 if (formatTokenFunctions[array[i]]) { 12179 array[i] = formatTokenFunctions[array[i]]; 12180 } else { 12181 array[i] = removeFormattingTokens(array[i]); 12182 } 12183 } 12184 12185 return function (mom) { 12186 var output = '', 12187 i; 12188 for (i = 0; i < length; i++) { 12189 output += isFunction(array[i]) 12190 ? array[i].call(mom, format) 12191 : array[i]; 12192 } 12193 return output; 12194 }; 12195 } 12196 12197 // format date using native date object 12198 function formatMoment(m, format) { 12199 if (!m.isValid()) { 12200 return m.localeData().invalidDate(); 12201 } 12202 12203 format = expandFormat(format, m.localeData()); 12204 formatFunctions[format] = 12205 formatFunctions[format] || makeFormatFunction(format); 12206 12207 return formatFunctions[format](m); 12208 } 12209 12210 function expandFormat(format, locale) { 12211 var i = 5; 12212 12213 function replaceLongDateFormatTokens(input) { 12214 return locale.longDateFormat(input) || input; 12215 } 12216 12217 localFormattingTokens.lastIndex = 0; 12218 while (i >= 0 && localFormattingTokens.test(format)) { 12219 format = format.replace( 12220 localFormattingTokens, 12221 replaceLongDateFormatTokens 12222 ); 12223 localFormattingTokens.lastIndex = 0; 12224 i -= 1; 12225 } 12226 12227 return format; 12228 } 12229 12230 var defaultLongDateFormat = { 12231 LTS: 'h:mm:ss A', 12232 LT: 'h:mm A', 12233 L: 'MM/DD/YYYY', 12234 LL: 'MMMM D, YYYY', 12235 LLL: 'MMMM D, YYYY h:mm A', 12236 LLLL: 'dddd, MMMM D, YYYY h:mm A', 12237 }; 12238 12239 function longDateFormat(key) { 12240 var format = this._longDateFormat[key], 12241 formatUpper = this._longDateFormat[key.toUpperCase()]; 12242 12243 if (format || !formatUpper) { 12244 return format; 12245 } 12246 12247 this._longDateFormat[key] = formatUpper 12248 .match(formattingTokens) 12249 .map(function (tok) { 12250 if ( 12251 tok === 'MMMM' || 12252 tok === 'MM' || 12253 tok === 'DD' || 12254 tok === 'dddd' 12255 ) { 12256 return tok.slice(1); 12257 } 12258 return tok; 12259 }) 12260 .join(''); 12261 12262 return this._longDateFormat[key]; 12263 } 12264 12265 var defaultInvalidDate = 'Invalid date'; 12266 12267 function invalidDate() { 12268 return this._invalidDate; 12269 } 12270 12271 var defaultOrdinal = '%d', 12272 defaultDayOfMonthOrdinalParse = /\d{1,2}/; 12273 12274 function ordinal(number) { 12275 return this._ordinal.replace('%d', number); 12276 } 12277 12278 var defaultRelativeTime = { 12279 future: 'in %s', 12280 past: '%s ago', 12281 s: 'a few seconds', 12282 ss: '%d seconds', 12283 m: 'a minute', 12284 mm: '%d minutes', 12285 h: 'an hour', 12286 hh: '%d hours', 12287 d: 'a day', 12288 dd: '%d days', 12289 w: 'a week', 12290 ww: '%d weeks', 12291 M: 'a month', 12292 MM: '%d months', 12293 y: 'a year', 12294 yy: '%d years', 12295 }; 12296 12297 function relativeTime(number, withoutSuffix, string, isFuture) { 12298 var output = this._relativeTime[string]; 12299 return isFunction(output) 12300 ? output(number, withoutSuffix, string, isFuture) 12301 : output.replace(/%d/i, number); 12302 } 12303 12304 function pastFuture(diff, output) { 12305 var format = this._relativeTime[diff > 0 ? 'future' : 'past']; 12306 return isFunction(format) ? format(output) : format.replace(/%s/i, output); 12307 } 12308 12309 var aliases = {}; 12310 12311 function addUnitAlias(unit, shorthand) { 12312 var lowerCase = unit.toLowerCase(); 12313 aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; 12314 } 12315 12316 function normalizeUnits(units) { 12317 return typeof units === 'string' 12318 ? aliases[units] || aliases[units.toLowerCase()] 12319 : undefined; 12320 } 12321 12322 function normalizeObjectUnits(inputObject) { 12323 var normalizedInput = {}, 12324 normalizedProp, 12325 prop; 12326 12327 for (prop in inputObject) { 12328 if (hasOwnProp(inputObject, prop)) { 12329 normalizedProp = normalizeUnits(prop); 12330 if (normalizedProp) { 12331 normalizedInput[normalizedProp] = inputObject[prop]; 12332 } 12333 } 12334 } 12335 12336 return normalizedInput; 12337 } 12338 12339 var priorities = {}; 12340 12341 function addUnitPriority(unit, priority) { 12342 priorities[unit] = priority; 12343 } 12344 12345 function getPrioritizedUnits(unitsObj) { 12346 var units = [], 12347 u; 12348 for (u in unitsObj) { 12349 if (hasOwnProp(unitsObj, u)) { 12350 units.push({ unit: u, priority: priorities[u] }); 12351 } 12352 } 12353 units.sort(function (a, b) { 12354 return a.priority - b.priority; 12355 }); 12356 return units; 12357 } 12358 12359 function isLeapYear(year) { 12360 return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; 12361 } 12362 12363 function absFloor(number) { 12364 if (number < 0) { 12365 // -0 -> 0 12366 return Math.ceil(number) || 0; 12367 } else { 12368 return Math.floor(number); 12369 } 12370 } 12371 12372 function toInt(argumentForCoercion) { 12373 var coercedNumber = +argumentForCoercion, 12374 value = 0; 12375 12376 if (coercedNumber !== 0 && isFinite(coercedNumber)) { 12377 value = absFloor(coercedNumber); 12378 } 12379 12380 return value; 12381 } 12382 12383 function makeGetSet(unit, keepTime) { 12384 return function (value) { 12385 if (value != null) { 12386 set$1(this, unit, value); 12387 hooks.updateOffset(this, keepTime); 12388 return this; 12389 } else { 12390 return get(this, unit); 12391 } 12392 }; 12393 } 12394 12395 function get(mom, unit) { 12396 return mom.isValid() 12397 ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() 12398 : NaN; 12399 } 12400 12401 function set$1(mom, unit, value) { 12402 if (mom.isValid() && !isNaN(value)) { 12403 if ( 12404 unit === 'FullYear' && 12405 isLeapYear(mom.year()) && 12406 mom.month() === 1 && 12407 mom.date() === 29 12408 ) { 12409 value = toInt(value); 12410 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit]( 12411 value, 12412 mom.month(), 12413 daysInMonth(value, mom.month()) 12414 ); 12415 } else { 12416 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); 12417 } 12418 } 12419 } 12420 12421 // MOMENTS 12422 12423 function stringGet(units) { 12424 units = normalizeUnits(units); 12425 if (isFunction(this[units])) { 12426 return this[units](); 12427 } 12428 return this; 12429 } 12430 12431 function stringSet(units, value) { 12432 if (typeof units === 'object') { 12433 units = normalizeObjectUnits(units); 12434 var prioritized = getPrioritizedUnits(units), 12435 i
vendor: 5,547 bytes, lines 12435-12621
12435, 12436 prioritizedLen = prioritized.length; 12437 for (i = 0; i < prioritizedLen; i++) { 12438 this[prioritized[i].unit](units[prioritized[i].unit]); 12439 } 12440 } else { 12441 units = normalizeUnits(units); 12442 if (isFunction(this[units])) { 12443 return this[units](value); 12444 } 12445 } 12446 return this; 12447 } 12448 12449 var match1 = /\d/, // 0 - 9 12450 match2 = /\d\d/, // 00 - 99 12451 match3 = /\d{3}/, // 000 - 999 12452 match4 = /\d{4}/, // 0000 - 9999 12453 match6 = /[+-]?\d{6}/, // -999999 - 999999 12454 match1to2 = /\d\d?/, // 0 - 99 12455 match3to4 = /\d\d\d\d?/, // 999 - 9999 12456 match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 12457 match1to3 = /\d{1,3}/, // 0 - 999 12458 match1to4 = /\d{1,4}/, // 0 - 9999 12459 match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 12460 matchUnsigned = /\d+/, // 0 - inf 12461 matchSigned = /[+-]?\d+/, // -inf - inf 12462 matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z 12463 matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z 12464 matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 12465 // any word (or two) characters or numbers including two/three word month in arabic. 12466 // includes scottish gaelic two word and hyphenated months 12467 matchWord = 12468 /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, 12469 regexes; 12470 12471 regexes = {}; 12472 12473 function addRegexToken(token, regex, strictRegex) { 12474 regexes[token] = isFunction(regex) 12475 ? regex 12476 : function (isStrict, localeData) { 12477 return isStrict && strictRegex ? strictRegex : regex; 12478 }; 12479 } 12480 12481 function getParseRegexForToken(token, config) { 12482 if (!hasOwnProp(regexes, token)) { 12483 return new RegExp(unescapeFormat(token)); 12484 } 12485 12486 return regexes[token](config._strict, config._locale); 12487 } 12488 12489 // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript 12490 function unescapeFormat(s) { 12491 return regexEscape( 12492 s 12493 .replace('\\', '') 12494 .replace( 12495 /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, 12496 function (matched, p1, p2, p3, p4) { 12497 return p1 || p2 || p3 || p4; 12498 } 12499 ) 12500 ); 12501 } 12502 12503 function regexEscape(s) { 12504 return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); 12505 } 12506 12507 var tokens = {}; 12508 12509 function addParseToken(token, callback) { 12510 var i, 12511 func = callback, 12512 tokenLen; 12513 if (typeof token === 'string') { 12514 token = [token]; 12515 } 12516 if (isNumber(callback)) { 12517 func = function (input, array) { 12518 array[callback] = toInt(input); 12519 }; 12520 } 12521 tokenLen = token.length; 12522 for (i = 0; i < tokenLen; i++) { 12523 tokens[token[i]] = func; 12524 } 12525 } 12526 12527 function addWeekParseToken(token, callback) { 12528 addParseToken(token, function (input, array, config, token) { 12529 config._w = config._w || {}; 12530 callback(input, config._w, config, token); 12531 }); 12532 } 12533 12534 function addTimeToArrayFromToken(token, input, config) { 12535 if (input != null && hasOwnProp(tokens, token)) { 12536 tokens[token](input, config._a, config, token); 12537 } 12538 } 12539 12540 var YEAR = 0, 12541 MONTH = 1, 12542 DATE = 2, 12543 HOUR = 3, 12544 MINUTE = 4, 12545 SECOND = 5, 12546 MILLISECOND = 6, 12547 WEEK = 7, 12548 WEEKDAY = 8; 12549 12550 function mod(n, x) { 12551 return ((n % x) + x) % x; 12552 } 12553 12554 var indexOf; 12555 12556 if (Array.prototype.indexOf) { 12557 indexOf = Array.prototype.indexOf; 12558 } else { 12559 indexOf = function (o) { 12560 // I know 12561 var i; 12562 for (i = 0; i < this.length; ++i) { 12563 if (this[i] === o) { 12564 return i; 12565 } 12566 } 12567 return -1; 12568 }; 12569 } 12570 12571 function daysInMonth(year, month) { 12572 if (isNaN(year) || isNaN(month)) { 12573 return NaN; 12574 } 12575 var modMonth = mod(month, 12); 12576 year += (month - modMonth) / 12; 12577 return modMonth === 1 12578 ? isLeapYear(year) 12579 ? 29 12580 : 28 12581 : 31 - ((modMonth % 7) % 2); 12582 } 12583 12584 // FORMATTING 12585 12586 addFormatToken('M', ['MM', 2], 'Mo', function () { 12587 return this.month() + 1; 12588 }); 12589 12590 addFormatToken('MMM', 0, 0, function (format) { 12591 return this.localeData().monthsShort(this, format); 12592 }); 12593 12594 addFormatToken('MMMM', 0, 0, function (format) { 12595 return this.localeData().months(this, format); 12596 }); 12597 12598 // ALIASES 12599 12600 addUnitAlias('month', 'M'); 12601 12602 // PRIORITY 12603 12604 addUnitPriority('month', 8); 12605 12606 // PARSING 12607 12608 addRegexToken('M', match1to2); 12609 addRegexToken('MM', match1to2, match2); 12610 addRegexToken('MMM', function (isStrict, locale) { 12611 return locale.monthsShortRegex(isStrict); 12612 }); 12613 addRegexToken('MMMM', function (isStrict, locale) { 12614 return locale.monthsRegex(isStrict); 12615 }); 12616 12617 addParseToken(['M', 'MM'], function (input, array) { 12618 array[MONTH] = toInt(input) - 1; 12619 }); 12620 12621 addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
12622 var month = config._locale.monthsParse(input, token, config._strict); 12623 // if we didn't find a month name, mark the date as invalid. 12624 if (month != null) { 12625 array[MONTH] = month; 12626 } else { 12627 getParsingFlags(config).invalidMonth = input; 12628 } 12629 }); 12630 12631 // LOCALES 12632 12633 var defaultLocaleMonths = 12634 'January_February_March_April_May_June_July_August_September_October_November_December'.split( 12635 '_' 12636 ), 12637 defaultLocaleMonthsShort = 12638 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'
vendor: 13,773 bytes, lines 12638-13080
12638), 12639 MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, 12640 defaultMonthsShortRegex = matchWord, 12641 defaultMonthsRegex = matchWord; 12642 12643 function localeMonths(m, format) { 12644 if (!m) { 12645 return isArray(this._months) 12646 ? this._months 12647 : this._months['standalone']; 12648 } 12649 return isArray(this._months) 12650 ? this._months[m.month()] 12651 : this._months[ 12652 (this._months.isFormat || MONTHS_IN_FORMAT).test(format) 12653 ? 'format' 12654 : 'standalone' 12655 ][m.month()]; 12656 } 12657 12658 function localeMonthsShort(m, format) { 12659 if (!m) { 12660 return isArray(this._monthsShort) 12661 ? this._monthsShort 12662 : this._monthsShort['standalone']; 12663 } 12664 return isArray(this._monthsShort) 12665 ? this._monthsShort[m.month()] 12666 : this._monthsShort[ 12667 MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' 12668 ][m.month()]; 12669 } 12670 12671 function handleStrictParse(monthName, format, strict) { 12672 var i, 12673 ii, 12674 mom, 12675 llc = monthName.toLocaleLowerCase(); 12676 if (!this._monthsParse) { 12677 // this is not used 12678 this._monthsParse = []; 12679 this._longMonthsParse = []; 12680 this._shortMonthsParse = []; 12681 for (i = 0; i < 12; ++i) { 12682 mom = createUTC([2000, i]); 12683 this._shortMonthsParse[i] = this.monthsShort( 12684 mom, 12685 '' 12686 ).toLocaleLowerCase(); 12687 this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); 12688 } 12689 } 12690 12691 if (strict) { 12692 if (format === 'MMM') { 12693 ii = indexOf.call(this._shortMonthsParse, llc); 12694 return ii !== -1 ? ii : null; 12695 } else { 12696 ii = indexOf.call(this._longMonthsParse, llc); 12697 return ii !== -1 ? ii : null; 12698 } 12699 } else { 12700 if (format === 'MMM') { 12701 ii = indexOf.call(this._shortMonthsParse, llc); 12702 if (ii !== -1) { 12703 return ii; 12704 } 12705 ii = indexOf.call(this._longMonthsParse, llc); 12706 return ii !== -1 ? ii : null; 12707 } else { 12708 ii = indexOf.call(this._longMonthsParse, llc); 12709 if (ii !== -1) { 12710 return ii; 12711 } 12712 ii = indexOf.call(this._shortMonthsParse, llc); 12713 return ii !== -1 ? ii : null; 12714 } 12715 } 12716 } 12717 12718 function localeMonthsParse(monthName, format, strict) { 12719 var i, mom, regex; 12720 12721 if (this._monthsParseExact) { 12722 return handleStrictParse.call(this, monthName, format, strict); 12723 } 12724 12725 if (!this._monthsParse) { 12726 this._monthsParse = []; 12727 this._longMonthsParse = []; 12728 this._shortMonthsParse = []; 12729 } 12730 12731 // TODO: add sorting 12732 // Sorting makes sure if one month (or abbr) is a prefix of another 12733 // see sorting in computeMonthsParse 12734 for (i = 0; i < 12; i++) { 12735 // make the regex if we don't have it already 12736 mom = createUTC([2000, i]); 12737 if (strict && !this._longMonthsParse[i]) { 12738 this._longMonthsParse[i] = new RegExp( 12739 '^' + this.months(mom, '').replace('.', '') + '$', 12740 'i' 12741 ); 12742 this._shortMonthsParse[i] = new RegExp( 12743 '^' + this.monthsShort(mom, '').replace('.', '') + '$', 12744 'i' 12745 ); 12746 } 12747 if (!strict && !this._monthsParse[i]) { 12748 regex = 12749 '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); 12750 this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); 12751 } 12752 // test the regex 12753 if ( 12754 strict && 12755 format === 'MMMM' && 12756 this._longMonthsParse[i].test(monthName) 12757 ) { 12758 return i; 12759 } else if ( 12760 strict && 12761 format === 'MMM' && 12762 this._shortMonthsParse[i].test(monthName) 12763 ) { 12764 return i; 12765 } else if (!strict && this._monthsParse[i].test(monthName)) { 12766 return i; 12767 } 12768 } 12769 } 12770 12771 // MOMENTS 12772 12773 function setMonth(mom, value) { 12774 var dayOfMonth; 12775 12776 if (!mom.isValid()) { 12777 // No op 12778 return mom; 12779 } 12780 12781 if (typeof value === 'string') { 12782 if (/^\d+$/.test(value)) { 12783 value = toInt(value); 12784 } else { 12785 value = mom.localeData().monthsParse(value); 12786 // TODO: Another silent failure? 12787 if (!isNumber(value)) { 12788 return mom; 12789 } 12790 } 12791 } 12792 12793 dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); 12794 mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); 12795 return mom; 12796 } 12797 12798 function getSetMonth(value) { 12799 if (value != null) { 12800 setMonth(this, value); 12801 hooks.updateOffset(this, true); 12802 return this; 12803 } else { 12804 return get(this, 'Month'); 12805 } 12806 } 12807 12808 function getDaysInMonth() { 12809 return daysInMonth(this.year(), this.month()); 12810 } 12811 12812 function monthsShortRegex(isStrict) { 12813 if (this._monthsParseExact) { 12814 if (!hasOwnProp(this, '_monthsRegex')) { 12815 computeMonthsParse.call(this); 12816 } 12817 if (isStrict) { 12818 return this._monthsShortStrictRegex; 12819 } else { 12820 return this._monthsShortRegex; 12821 } 12822 } else { 12823 if (!hasOwnProp(this, '_monthsShortRegex')) { 12824 this._monthsShortRegex = defaultMonthsShortRegex; 12825 } 12826 return this._monthsShortStrictRegex && isStrict 12827 ? this._monthsShortStrictRegex 12828 : this._monthsShortRegex; 12829 } 12830 } 12831 12832 function monthsRegex(isStrict) { 12833 if (this._monthsParseExact) { 12834 if (!hasOwnProp(this, '_monthsRegex')) { 12835 computeMonthsParse.call(this); 12836 } 12837 if (isStrict) { 12838 return this._monthsStrictRegex; 12839 } else { 12840 return this._monthsRegex; 12841 } 12842 } else { 12843 if (!hasOwnProp(this, '_monthsRegex')) { 12844 this._monthsRegex = defaultMonthsRegex; 12845 } 12846 return this._monthsStrictRegex && isStrict 12847 ? this._monthsStrictRegex 12848 : this._monthsRegex; 12849 } 12850 } 12851 12852 function computeMonthsParse() { 12853 function cmpLenRev(a, b) { 12854 return b.length - a.length; 12855 } 12856 12857 var shortPieces = [], 12858 longPieces = [], 12859 mixedPieces = [], 12860 i, 12861 mom; 12862 for (i = 0; i < 12; i++) { 12863 // make the regex if we don't have it already 12864 mom = createUTC([2000, i]); 12865 shortPieces.push(this.monthsShort(mom, '')); 12866 longPieces.push(this.months(mom, '')); 12867 mixedPieces.push(this.months(mom, '')); 12868 mixedPieces.push(this.monthsShort(mom, '')); 12869 } 12870 // Sorting makes sure if one month (or abbr) is a prefix of another it 12871 // will match the longer piece. 12872 shortPieces.sort(cmpLenRev); 12873 longPieces.sort(cmpLenRev); 12874 mixedPieces.sort(cmpLenRev); 12875 for (i = 0; i < 12; i++) { 12876 shortPieces[i] = regexEscape(shortPieces[i]); 12877 longPieces[i] = regexEscape(longPieces[i]); 12878 } 12879 for (i = 0; i < 24; i++) { 12880 mixedPieces[i] = regexEscape(mixedPieces[i]); 12881 } 12882 12883 this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 12884 this._monthsShortRegex = this._monthsRegex; 12885 this._monthsStrictRegex = new RegExp( 12886 '^(' + longPieces.join('|') + ')', 12887 'i' 12888 ); 12889 this._monthsShortStrictRegex = new RegExp( 12890 '^(' + shortPieces.join('|') + ')', 12891 'i' 12892 ); 12893 } 12894 12895 // FORMATTING 12896 12897 addFormatToken('Y', 0, 0, function () { 12898 var y = this.year(); 12899 return y <= 9999 ? zeroFill(y, 4) : '+' + y; 12900 }); 12901 12902 addFormatToken(0, ['YY', 2], 0, function () { 12903 return this.year() % 100; 12904 }); 12905 12906 addFormatToken(0, ['YYYY', 4], 0, 'year'); 12907 addFormatToken(0, ['YYYYY', 5], 0, 'year'); 12908 addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); 12909 12910 // ALIASES 12911 12912 addUnitAlias('year', 'y'); 12913 12914 // PRIORITIES 12915 12916 addUnitPriority('year', 1); 12917 12918 // PARSING 12919 12920 addRegexToken('Y', matchSigned); 12921 addRegexToken('YY', match1to2, match2); 12922 addRegexToken('YYYY', match1to4, match4); 12923 addRegexToken('YYYYY', match1to6, match6); 12924 addRegexToken('YYYYYY', match1to6, match6); 12925 12926 addParseToken(['YYYYY', 'YYYYYY'], YEAR); 12927 addParseToken('YYYY', function (input, array) { 12928 array[YEAR] = 12929 input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); 12930 }); 12931 addParseToken('YY', function (input, array) { 12932 array[YEAR] = hooks.parseTwoDigitYear(input); 12933 }); 12934 addParseToken('Y', function (input, array) { 12935 array[YEAR] = parseInt(input, 10); 12936 }); 12937 12938 // HELPERS 12939 12940 function daysInYear(year) { 12941 return isLeapYear(year) ? 366 : 365; 12942 } 12943 12944 // HOOKS 12945 12946 hooks.parseTwoDigitYear = function (input) { 12947 return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); 12948 }; 12949 12950 // MOMENTS 12951 12952 var getSetYear = makeGetSet('FullYear', true); 12953 12954 function getIsLeapYear() { 12955 return isLeapYear(this.year()); 12956 } 12957 12958 function createDate(y, m, d, h, M, s, ms) { 12959 // can't just apply() to create a date: 12960 // https://stackoverflow.com/q/181348 12961 var date; 12962 // the date constructor remaps years 0-99 to 1900-1999 12963 if (y < 100 && y >= 0) { 12964 // preserve leap years using a full 400 year cycle, then reset 12965 date = new Date(y + 400, m, d, h, M, s, ms); 12966 if (isFinite(date.getFullYear())) { 12967 date.setFullYear(y); 12968 } 12969 } else { 12970 date = new Date(y, m, d, h, M, s, ms); 12971 } 12972 12973 return date; 12974 } 12975 12976 function createUTCDate(y) { 12977 var date, args; 12978 // the Date.UTC function remaps years 0-99 to 1900-1999 12979 if (y < 100 && y >= 0) { 12980 args = Array.prototype.slice.call(arguments); 12981 // preserve leap years using a full 400 year cycle, then reset 12982 args[0] = y + 400; 12983 date = new Date(Date.UTC.apply(null, args)); 12984 if (isFinite(date.getUTCFullYear())) { 12985 date.setUTCFullYear(y); 12986 } 12987 } else { 12988 date = new Date(Date.UTC.apply(null, arguments)); 12989 } 12990 12991 return date; 12992 } 12993 12994 // start-of-first-week - start-of-year 12995 function firstWeekOffset(year, dow, doy) { 12996 var // first-week day -- which january is always in the first week (4 for iso, 1 for other) 12997 fwd = 7 + dow - doy, 12998 // first-week day local weekday -- which local weekday is fwd 12999 fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; 13000 13001 return -fwdlw + fwd - 1; 13002 } 13003 13004 // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday 13005 function dayOfYearFromWeeks(year, week, weekday, dow, doy) { 13006 var localWeekday = (7 + weekday - dow) % 7, 13007 weekOffset = firstWeekOffset(year, dow, doy), 13008 dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, 13009 resYear, 13010 resDayOfYear; 13011 13012 if (dayOfYear <= 0) { 13013 resYear = year - 1; 13014 resDayOfYear = daysInYear(resYear) + dayOfYear; 13015 } else if (dayOfYear > daysInYear(year)) { 13016 resYear = year + 1; 13017 resDayOfYear = dayOfYear - daysInYear(year); 13018 } else { 13019 resYear = year; 13020 resDayOfYear = dayOfYear; 13021 } 13022 13023 return { 13024 year: resYear, 13025 dayOfYear: resDayOfYear, 13026 }; 13027 } 13028 13029 function weekOfYear(mom, dow, doy) { 13030 var weekOffset = firstWeekOffset(mom.year(), dow, doy), 13031 week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, 13032 resWeek, 13033 resYear; 13034 13035 if (week < 1) { 13036 resYear = mom.year() - 1; 13037 resWeek = week + weeksInYear(resYear, dow, doy); 13038 } else if (week > weeksInYear(mom.year(), dow, doy)) { 13039 resWeek = week - weeksInYear(mom.year(), dow, doy); 13040 resYear = mom.year() + 1; 13041 } else { 13042 resYear = mom.year(); 13043 resWeek = week; 13044 } 13045 13046 return { 13047 week: resWeek, 13048 year: resYear, 13049 }; 13050 } 13051 13052 function weeksInYear(year, dow, doy) { 13053 var weekOffset = firstWeekOffset(year, dow, doy), 13054 weekOffsetNext = firstWeekOffset(year + 1, dow, doy); 13055 return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; 13056 } 13057 13058 // FORMATTING 13059 13060 addFormatToken('w', ['ww', 2], 'wo', 'week'); 13061 addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); 13062 13063 // ALIASES 13064 13065 addUnitAlias('week', 'w'); 13066 addUnitAlias('isoWeek', 'W'); 13067 13068 // PRIORITIES 13069 13070 addUnitPriority('week', 5); 13071 addUnitPriority('isoWeek', 5); 13072 13073 // PARSING 13074 13075 addRegexToken('w', match1to2); 13076 addRegexToken('ww', match1to2, match2); 13077 addRegexToken('W', match1to2); 13078 addRegexToken('WW', match1to2, match2); 13079 13080 addWeekParseToken(
vendor: 3,487 bytes, lines 13080-13211
13080 13081 ['w', 'ww', 'W', 'WW'], 13082 function (input, week, config, token) { 13083 week[token.substr(0, 1)] = toInt(input); 13084 } 13085 ); 13086 13087 // HELPERS 13088 13089 // LOCALES 13090 13091 function localeWeek(mom) { 13092 return weekOfYear(mom, this._week.dow, this._week.doy).week; 13093 } 13094 13095 var defaultLocaleWeek = { 13096 dow: 0, // Sunday is the first day of the week. 13097 doy: 6, // The week that contains Jan 6th is the first week of the year. 13098 }; 13099 13100 function localeFirstDayOfWeek() { 13101 return this._week.dow; 13102 } 13103 13104 function localeFirstDayOfYear() { 13105 return this._week.doy; 13106 } 13107 13108 // MOMENTS 13109 13110 function getSetWeek(input) { 13111 var week = this.localeData().week(this); 13112 return input == null ? week : this.add((input - week) * 7, 'd'); 13113 } 13114 13115 function getSetISOWeek(input) { 13116 var week = weekOfYear(this, 1, 4).week; 13117 return input == null ? week : this.add((input - week) * 7, 'd'); 13118 } 13119 13120 // FORMATTING 13121 13122 addFormatToken('d', 0, 'do', 'day'); 13123 13124 addFormatToken('dd', 0, 0, function (format) { 13125 return this.localeData().weekdaysMin(this, format); 13126 }); 13127 13128 addFormatToken('ddd', 0, 0, function (format) { 13129 return this.localeData().weekdaysShort(this, format); 13130 }); 13131 13132 addFormatToken('dddd', 0, 0, function (format) { 13133 return this.localeData().weekdays(this, format); 13134 }); 13135 13136 addFormatToken('e', 0, 0, 'weekday'); 13137 addFormatToken('E', 0, 0, 'isoWeekday'); 13138 13139 // ALIASES 13140 13141 addUnitAlias('day', 'd'); 13142 addUnitAlias('weekday', 'e'); 13143 addUnitAlias('isoWeekday', 'E'); 13144 13145 // PRIORITY 13146 addUnitPriority('day', 11); 13147 addUnitPriority('weekday', 11); 13148 addUnitPriority('isoWeekday', 11); 13149 13150 // PARSING 13151 13152 addRegexToken('d', match1to2); 13153 addRegexToken('e', match1to2); 13154 addRegexToken('E', match1to2); 13155 addRegexToken('dd', function (isStrict, locale) { 13156 return locale.weekdaysMinRegex(isStrict); 13157 }); 13158 addRegexToken('ddd', function (isStrict, locale) { 13159 return locale.weekdaysShortRegex(isStrict); 13160 }); 13161 addRegexToken('dddd', function (isStrict, locale) { 13162 return locale.weekdaysRegex(isStrict); 13163 }); 13164 13165 addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { 13166 var weekday = config._locale.weekdaysParse(input, token, config._strict); 13167 // if we didn't get a weekday name, mark the date as invalid 13168 if (weekday != null) { 13169 week.d = weekday; 13170 } else { 13171 getParsingFlags(config).invalidWeekday = input; 13172 } 13173 }); 13174 13175 addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { 13176 week[token] = toInt(input); 13177 }); 13178 13179 // HELPERS 13180 13181 function parseWeekday(input, locale) { 13182 if (typeof input !== 'string') { 13183 return input; 13184 } 13185 13186 if (!isNaN(input)) { 13187 return parseInt(input, 10); 13188 } 13189 13190 input = locale.weekdaysParse(input); 13191 if (typeof input === 'number') { 13192 return input; 13193 } 13194 13195 return null; 13196 } 13197 13198 function parseIsoWeekday(input, locale) { 13199 if (typeof input === 'string') { 13200 return locale.weekdaysParse(input) % 7 || 7; 13201 } 13202 return isNaN(input) ? null : input; 13203 } 13204 13205 // LOCALES 13206 function shiftWeekdays(ws, n) { 13207 return ws.slice(n, 7).concat(ws.slice(0, n)); 13208 } 13209 13210 var defaultLocaleWeekdays = 13211 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'
vendor: 17,864 bytes, lines 13211-13759
13211), 13212 defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), 13213 defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), 13214 defaultWeekdaysRegex = matchWord, 13215 defaultWeekdaysShortRegex = matchWord, 13216 defaultWeekdaysMinRegex = matchWord; 13217 13218 function localeWeekdays(m, format) { 13219 var weekdays = isArray(this._weekdays) 13220 ? this._weekdays 13221 : this._weekdays[ 13222 m && m !== true && this._weekdays.isFormat.test(format) 13223 ? 'format' 13224 : 'standalone' 13225 ]; 13226 return m === true 13227 ? shiftWeekdays(weekdays, this._week.dow) 13228 : m 13229 ? weekdays[m.day()] 13230 : weekdays; 13231 } 13232 13233 function localeWeekdaysShort(m) { 13234 return m === true 13235 ? shiftWeekdays(this._weekdaysShort, this._week.dow) 13236 : m 13237 ? this._weekdaysShort[m.day()] 13238 : this._weekdaysShort; 13239 } 13240 13241 function localeWeekdaysMin(m) { 13242 return m === true 13243 ? shiftWeekdays(this._weekdaysMin, this._week.dow) 13244 : m 13245 ? this._weekdaysMin[m.day()] 13246 : this._weekdaysMin; 13247 } 13248 13249 function handleStrictParse$1(weekdayName, format, strict) { 13250 var i, 13251 ii, 13252 mom, 13253 llc = weekdayName.toLocaleLowerCase(); 13254 if (!this._weekdaysParse) { 13255 this._weekdaysParse = []; 13256 this._shortWeekdaysParse = []; 13257 this._minWeekdaysParse = []; 13258 13259 for (i = 0; i < 7; ++i) { 13260 mom = createUTC([2000, 1]).day(i); 13261 this._minWeekdaysParse[i] = this.weekdaysMin( 13262 mom, 13263 '' 13264 ).toLocaleLowerCase(); 13265 this._shortWeekdaysParse[i] = this.weekdaysShort( 13266 mom, 13267 '' 13268 ).toLocaleLowerCase(); 13269 this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); 13270 } 13271 } 13272 13273 if (strict) { 13274 if (format === 'dddd') { 13275 ii = indexOf.call(this._weekdaysParse, llc); 13276 return ii !== -1 ? ii : null; 13277 } else if (format === 'ddd') { 13278 ii = indexOf.call(this._shortWeekdaysParse, llc); 13279 return ii !== -1 ? ii : null; 13280 } else { 13281 ii = indexOf.call(this._minWeekdaysParse, llc); 13282 return ii !== -1 ? ii : null; 13283 } 13284 } else { 13285 if (format === 'dddd') { 13286 ii = indexOf.call(this._weekdaysParse, llc); 13287 if (ii !== -1) { 13288 return ii; 13289 } 13290 ii = indexOf.call(this._shortWeekdaysParse, llc); 13291 if (ii !== -1) { 13292 return ii; 13293 } 13294 ii = indexOf.call(this._minWeekdaysParse, llc); 13295 return ii !== -1 ? ii : null; 13296 } else if (format === 'ddd') { 13297 ii = indexOf.call(this._shortWeekdaysParse, llc); 13298 if (ii !== -1) { 13299 return ii; 13300 } 13301 ii = indexOf.call(this._weekdaysParse, llc); 13302 if (ii !== -1) { 13303 return ii; 13304 } 13305 ii = indexOf.call(this._minWeekdaysParse, llc); 13306 return ii !== -1 ? ii : null; 13307 } else { 13308 ii = indexOf.call(this._minWeekdaysParse, llc); 13309 if (ii !== -1) { 13310 return ii; 13311 } 13312 ii = indexOf.call(this._weekdaysParse, llc); 13313 if (ii !== -1) { 13314 return ii; 13315 } 13316 ii = indexOf.call(this._shortWeekdaysParse, llc); 13317 return ii !== -1 ? ii : null; 13318 } 13319 } 13320 } 13321 13322 function localeWeekdaysParse(weekdayName, format, strict) { 13323 var i, mom, regex; 13324 13325 if (this._weekdaysParseExact) { 13326 return handleStrictParse$1.call(this, weekdayName, format, strict); 13327 } 13328 13329 if (!this._weekdaysParse) { 13330 this._weekdaysParse = []; 13331 this._minWeekdaysParse = []; 13332 this._shortWeekdaysParse = []; 13333 this._fullWeekdaysParse = []; 13334 } 13335 13336 for (i = 0; i < 7; i++) { 13337 // make the regex if we don't have it already 13338 13339 mom = createUTC([2000, 1]).day(i); 13340 if (strict && !this._fullWeekdaysParse[i]) { 13341 this._fullWeekdaysParse[i] = new RegExp( 13342 '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 13343 'i' 13344 ); 13345 this._shortWeekdaysParse[i] = new RegExp( 13346 '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 13347 'i' 13348 ); 13349 this._minWeekdaysParse[i] = new RegExp( 13350 '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 13351 'i' 13352 ); 13353 } 13354 if (!this._weekdaysParse[i]) { 13355 regex = 13356 '^' + 13357 this.weekdays(mom, '') + 13358 '|^' + 13359 this.weekdaysShort(mom, '') + 13360 '|^' + 13361 this.weekdaysMin(mom, ''); 13362 this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); 13363 } 13364 // test the regex 13365 if ( 13366 strict && 13367 format === 'dddd' && 13368 this._fullWeekdaysParse[i].test(weekdayName) 13369 ) { 13370 return i; 13371 } else if ( 13372 strict && 13373 format === 'ddd' && 13374 this._shortWeekdaysParse[i].test(weekdayName) 13375 ) { 13376 return i; 13377 } else if ( 13378 strict && 13379 format === 'dd' && 13380 this._minWeekdaysParse[i].test(weekdayName) 13381 ) { 13382 return i; 13383 } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { 13384 return i; 13385 } 13386 } 13387 } 13388 13389 // MOMENTS 13390 13391 function getSetDayOfWeek(input) { 13392 if (!this.isValid()) { 13393 return input != null ? this : NaN; 13394 } 13395 var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); 13396 if (input != null) { 13397 input = parseWeekday(input, this.localeData()); 13398 return this.add(input - day, 'd'); 13399 } else { 13400 return day; 13401 } 13402 } 13403 13404 function getSetLocaleDayOfWeek(input) { 13405 if (!this.isValid()) { 13406 return input != null ? this : NaN; 13407 } 13408 var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; 13409 return input == null ? weekday : this.add(input - weekday, 'd'); 13410 } 13411 13412 function getSetISODayOfWeek(input) { 13413 if (!this.isValid()) { 13414 return input != null ? this : NaN; 13415 } 13416 13417 // behaves the same as moment#day except 13418 // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) 13419 // as a setter, sunday should belong to the previous week. 13420 13421 if (input != null) { 13422 var weekday = parseIsoWeekday(input, this.localeData()); 13423 return this.day(this.day() % 7 ? weekday : weekday - 7); 13424 } else { 13425 return this.day() || 7; 13426 } 13427 } 13428 13429 function weekdaysRegex(isStrict) { 13430 if (this._weekdaysParseExact) { 13431 if (!hasOwnProp(this, '_weekdaysRegex')) { 13432 computeWeekdaysParse.call(this); 13433 } 13434 if (isStrict) { 13435 return this._weekdaysStrictRegex; 13436 } else { 13437 return this._weekdaysRegex; 13438 } 13439 } else { 13440 if (!hasOwnProp(this, '_weekdaysRegex')) { 13441 this._weekdaysRegex = defaultWeekdaysRegex; 13442 } 13443 return this._weekdaysStrictRegex && isStrict 13444 ? this._weekdaysStrictRegex 13445 : this._weekdaysRegex; 13446 } 13447 } 13448 13449 function weekdaysShortRegex(isStrict) { 13450 if (this._weekdaysParseExact) { 13451 if (!hasOwnProp(this, '_weekdaysRegex')) { 13452 computeWeekdaysParse.call(this); 13453 } 13454 if (isStrict) { 13455 return this._weekdaysShortStrictRegex; 13456 } else { 13457 return this._weekdaysShortRegex; 13458 } 13459 } else { 13460 if (!hasOwnProp(this, '_weekdaysShortRegex')) { 13461 this._weekdaysShortRegex = defaultWeekdaysShortRegex; 13462 } 13463 return this._weekdaysShortStrictRegex && isStrict 13464 ? this._weekdaysShortStrictRegex 13465 : this._weekdaysShortRegex; 13466 } 13467 } 13468 13469 function weekdaysMinRegex(isStrict) { 13470 if (this._weekdaysParseExact) { 13471 if (!hasOwnProp(this, '_weekdaysRegex')) { 13472 computeWeekdaysParse.call(this); 13473 } 13474 if (isStrict) { 13475 return this._weekdaysMinStrictRegex; 13476 } else { 13477 return this._weekdaysMinRegex; 13478 } 13479 } else { 13480 if (!hasOwnProp(this, '_weekdaysMinRegex')) { 13481 this._weekdaysMinRegex = defaultWeekdaysMinRegex; 13482 } 13483 return this._weekdaysMinStrictRegex && isStrict 13484 ? this._weekdaysMinStrictRegex 13485 : this._weekdaysMinRegex; 13486 } 13487 } 13488 13489 function computeWeekdaysParse() { 13490 function cmpLenRev(a, b) { 13491 return b.length - a.length; 13492 } 13493 13494 var minPieces = [], 13495 shortPieces = [], 13496 longPieces = [], 13497 mixedPieces = [], 13498 i, 13499 mom, 13500 minp, 13501 shortp, 13502 longp; 13503 for (i = 0; i < 7; i++) { 13504 // make the regex if we don't have it already 13505 mom = createUTC([2000, 1]).day(i); 13506 minp = regexEscape(this.weekdaysMin(mom, '')); 13507 shortp = regexEscape(this.weekdaysShort(mom, '')); 13508 longp = regexEscape(this.weekdays(mom, '')); 13509 minPieces.push(minp); 13510 shortPieces.push(shortp); 13511 longPieces.push(longp); 13512 mixedPieces.push(minp); 13513 mixedPieces.push(shortp); 13514 mixedPieces.push(longp); 13515 } 13516 // Sorting makes sure if one weekday (or abbr) is a prefix of another it 13517 // will match the longer piece. 13518 minPieces.sort(cmpLenRev); 13519 shortPieces.sort(cmpLenRev); 13520 longPieces.sort(cmpLenRev); 13521 mixedPieces.sort(cmpLenRev); 13522 13523 this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 13524 this._weekdaysShortRegex = this._weekdaysRegex; 13525 this._weekdaysMinRegex = this._weekdaysRegex; 13526 13527 this._weekdaysStrictRegex = new RegExp( 13528 '^(' + longPieces.join('|') + ')', 13529 'i' 13530 ); 13531 this._weekdaysShortStrictRegex = new RegExp( 13532 '^(' + shortPieces.join('|') + ')', 13533 'i' 13534 ); 13535 this._weekdaysMinStrictRegex = new RegExp( 13536 '^(' + minPieces.join('|') + ')', 13537 'i' 13538 ); 13539 } 13540 13541 // FORMATTING 13542 13543 function hFormat() { 13544 return this.hours() % 12 || 12; 13545 } 13546 13547 function kFormat() { 13548 return this.hours() || 24; 13549 } 13550 13551 addFormatToken('H', ['HH', 2], 0, 'hour'); 13552 addFormatToken('h', ['hh', 2], 0, hFormat); 13553 addFormatToken('k', ['kk', 2], 0, kFormat); 13554 13555 addFormatToken('hmm', 0, 0, function () { 13556 return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); 13557 }); 13558 13559 addFormatToken('hmmss', 0, 0, function () { 13560 return ( 13561 '' + 13562 hFormat.apply(this) + 13563 zeroFill(this.minutes(), 2) + 13564 zeroFill(this.seconds(), 2) 13565 ); 13566 }); 13567 13568 addFormatToken('Hmm', 0, 0, function () { 13569 return '' + this.hours() + zeroFill(this.minutes(), 2); 13570 }); 13571 13572 addFormatToken('Hmmss', 0, 0, function () { 13573 return ( 13574 '' + 13575 this.hours() + 13576 zeroFill(this.minutes(), 2) + 13577 zeroFill(this.seconds(), 2) 13578 ); 13579 }); 13580 13581 function meridiem(token, lowercase) { 13582 addFormatToken(token, 0, 0, function () { 13583 return this.localeData().meridiem( 13584 this.hours(), 13585 this.minutes(), 13586 lowercase 13587 ); 13588 }); 13589 } 13590 13591 meridiem('a', true); 13592 meridiem('A', false); 13593 13594 // ALIASES 13595 13596 addUnitAlias('hour', 'h'); 13597 13598 // PRIORITY 13599 addUnitPriority('hour', 13); 13600 13601 // PARSING 13602 13603 function matchMeridiem(isStrict, locale) { 13604 return locale._meridiemParse; 13605 } 13606 13607 addRegexToken('a', matchMeridiem); 13608 addRegexToken('A', matchMeridiem); 13609 addRegexToken('H', match1to2); 13610 addRegexToken('h', match1to2); 13611 addRegexToken('k', match1to2); 13612 addRegexToken('HH', match1to2, match2); 13613 addRegexToken('hh', match1to2, match2); 13614 addRegexToken('kk', match1to2, match2); 13615 13616 addRegexToken('hmm', match3to4); 13617 addRegexToken('hmmss', match5to6); 13618 addRegexToken('Hmm', match3to4); 13619 addRegexToken('Hmmss', match5to6); 13620 13621 addParseToken(['H', 'HH'], HOUR); 13622 addParseToken(['k', 'kk'], function (input, array, config) { 13623 var kInput = toInt(input); 13624 array[HOUR] = kInput === 24 ? 0 : kInput; 13625 }); 13626 addParseToken(['a', 'A'], function (input, array, config) { 13627 config._isPm = config._locale.isPM(input); 13628 config._meridiem = input; 13629 }); 13630 addParseToken(['h', 'hh'], function (input, array, config) { 13631 array[HOUR] = toInt(input); 13632 getParsingFlags(config).bigHour = true; 13633 }); 13634 addParseToken('hmm', function (input, array, config) { 13635 var pos = input.length - 2; 13636 array[HOUR] = toInt(input.substr(0, pos)); 13637 array[MINUTE] = toInt(input.substr(pos)); 13638 getParsingFlags(config).bigHour = true; 13639 }); 13640 addParseToken('hmmss', function (input, array, config) { 13641 var pos1 = input.length - 4, 13642 pos2 = input.length - 2; 13643 array[HOUR] = toInt(input.substr(0, pos1)); 13644 array[MINUTE] = toInt(input.substr(pos1, 2)); 13645 array[SECOND] = toInt(input.substr(pos2)); 13646 getParsingFlags(config).bigHour = true; 13647 }); 13648 addParseToken('Hmm', function (input, array, config) { 13649 var pos = input.length - 2; 13650 array[HOUR] = toInt(input.substr(0, pos)); 13651 array[MINUTE] = toInt(input.substr(pos)); 13652 }); 13653 addParseToken('Hmmss', function (input, array, config) { 13654 var pos1 = input.length - 4, 13655 pos2 = input.length - 2; 13656 array[HOUR] = toInt(input.substr(0, pos1)); 13657 array[MINUTE] = toInt(input.substr(pos1, 2)); 13658 array[SECOND] = toInt(input.substr(pos2)); 13659 }); 13660 13661 // LOCALES 13662 13663 function localeIsPM(input) { 13664 // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays 13665 // Using charAt should be more compatible. 13666 return (input + '').toLowerCase().charAt(0) === 'p'; 13667 } 13668 13669 var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, 13670 // Setting the hour should keep the time, because the user explicitly 13671 // specified which hour they want. So trying to maintain the same hour (in 13672 // a new timezone) makes sense. Adding/subtracting hours does not follow 13673 // this rule. 13674 getSetHour = makeGetSet('Hours', true); 13675 13676 function localeMeridiem(hours, minutes, isLower) { 13677 if (hours > 11) { 13678 return isLower ? 'pm' : 'PM'; 13679 } else { 13680 return isLower ? 'am' : 'AM'; 13681 } 13682 } 13683 13684 var baseConfig = { 13685 calendar: defaultCalendar, 13686 longDateFormat: defaultLongDateFormat, 13687 invalidDate: defaultInvalidDate, 13688 ordinal: defaultOrdinal, 13689 dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, 13690 relativeTime: defaultRelativeTime, 13691 13692 months: defaultLocaleMonths, 13693 monthsShort: defaultLocaleMonthsShort, 13694 13695 week: defaultLocaleWeek, 13696 13697 weekdays: defaultLocaleWeekdays, 13698 weekdaysMin: defaultLocaleWeekdaysMin, 13699 weekdaysShort: defaultLocaleWeekdaysShort, 13700 13701 meridiemParse: defaultLocaleMeridiemParse, 13702 }; 13703 13704 // internal storage for locale config files 13705 var locales = {}, 13706 localeFamilies = {}, 13707 globalLocale; 13708 13709 function commonPrefix(arr1, arr2) { 13710 var i, 13711 minl = Math.min(arr1.length, arr2.length); 13712 for (i = 0; i < minl; i += 1) { 13713 if (arr1[i] !== arr2[i]) { 13714 return i; 13715 } 13716 } 13717 return minl; 13718 } 13719 13720 function normalizeLocale(key) { 13721 return key ? key.toLowerCase().replace('_', '-') : key; 13722 } 13723 13724 // pick the locale from the array 13725 // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each 13726 // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root 13727 function chooseLocale(names) { 13728 var i = 0, 13729 j, 13730 next, 13731 locale, 13732 split; 13733 13734 while (i < names.length) { 13735 split = normalizeLocale(names[i]).split('-'); 13736 j = split.length; 13737 next = normalizeLocale(names[i + 1]); 13738 next = next ? next.split('-') : null; 13739 while (j > 0) { 13740 locale = loadLocale(split.slice(0, j).join('-')); 13741 if (locale) { 13742 return locale; 13743 } 13744 if ( 13745 next && 13746 next.length >= j && 13747 commonPrefix(split, next) >= j - 1 13748 ) { 13749 //the next array item is better than a shallower substring of this one 13750 break; 13751 } 13752 j--; 13753 } 13754 i++; 13755 } 13756 return globalLocale; 13757 } 13758 13759 function
vendor: 7,449 bytes, lines 13759-13966
13759isLocaleNameSane(name) { 13760 // Prevent names that look like filesystem paths, i.e contain '/' or '\' 13761 return name.match('^[^/\\\\]*$') != null; 13762 } 13763 13764 function loadLocale(name) { 13765 var oldLocale = null, 13766 aliasedRequire; 13767 // TODO: Find a better way to register and load all the locales in Node 13768 if ( 13769 locales[name] === undefined && 13770 typeof module !== 'undefined' && 13771 module && 13772 module.exports && 13773 isLocaleNameSane(name) 13774 ) { 13775 try { 13776 oldLocale = globalLocale._abbr; 13777 aliasedRequire = require; 13778 aliasedRequire('./locale/' + name); 13779 getSetGlobalLocale(oldLocale); 13780 } catch (e) { 13781 // mark as not found to avoid repeating expensive file require call causing high CPU 13782 // when trying to find en-US, en_US, en-us for every format call 13783 locales[name] = null; // null means not found 13784 } 13785 } 13786 return locales[name]; 13787 } 13788 13789 // This function will load locale and then set the global locale. If 13790 // no arguments are passed in, it will simply return the current global 13791 // locale key. 13792 function getSetGlobalLocale(key, values) { 13793 var data; 13794 if (key) { 13795 if (isUndefined(values)) { 13796 data = getLocale(key); 13797 } else { 13798 data = defineLocale(key, values); 13799 } 13800 13801 if (data) { 13802 // moment.duration._locale = moment._locale = data; 13803 globalLocale = data; 13804 } else { 13805 if (typeof console !== 'undefined' && console.warn) { 13806 //warn user if arguments are passed but the locale could not be set 13807 console.warn( 13808 'Locale ' + key + ' not found. Did you forget to load it?' 13809 ); 13810 } 13811 } 13812 } 13813 13814 return globalLocale._abbr; 13815 } 13816 13817 function defineLocale(name, config) { 13818 if (config !== null) { 13819 var locale, 13820 parentConfig = baseConfig; 13821 config.abbr = name; 13822 if (locales[name] != null) { 13823 deprecateSimple( 13824 'defineLocaleOverride', 13825 'use moment.updateLocale(localeName, config) to change ' + 13826 'an existing locale. moment.defineLocale(localeName, ' + 13827 'config) should only be used for creating a new locale ' + 13828 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' 13829 ); 13830 parentConfig = locales[name]._config; 13831 } else if (config.parentLocale != null) { 13832 if (locales[config.parentLocale] != null) { 13833 parentConfig = locales[config.parentLocale]._config; 13834 } else { 13835 locale = loadLocale(config.parentLocale); 13836 if (locale != null) { 13837 parentConfig = locale._config; 13838 } else { 13839 if (!localeFamilies[config.parentLocale]) { 13840 localeFamilies[config.parentLocale] = []; 13841 } 13842 localeFamilies[config.parentLocale].push({ 13843 name: name, 13844 config: config, 13845 }); 13846 return null; 13847 } 13848 } 13849 } 13850 locales[name] = new Locale(mergeConfigs(parentConfig, config)); 13851 13852 if (localeFamilies[name]) { 13853 localeFamilies[name].forEach(function (x) { 13854 defineLocale(x.name, x.config); 13855 }); 13856 } 13857 13858 // backwards compat for now: also set the locale 13859 // make sure we set the locale AFTER all child locales have been 13860 // created, so we won't end up with the child locale set. 13861 getSetGlobalLocale(name); 13862 13863 return locales[name]; 13864 } else { 13865 // useful for testing 13866 delete locales[name]; 13867 return null; 13868 } 13869 } 13870 13871 function updateLocale(name, config) { 13872 if (config != null) { 13873 var locale, 13874 tmpLocale, 13875 parentConfig = baseConfig; 13876 13877 if (locales[name] != null && locales[name].parentLocale != null) { 13878 // Update existing child locale in-place to avoid memory-leaks 13879 locales[name].set(mergeConfigs(locales[name]._config, config)); 13880 } else { 13881 // MERGE 13882 tmpLocale = loadLocale(name); 13883 if (tmpLocale != null) { 13884 parentConfig = tmpLocale._config; 13885 } 13886 config = mergeConfigs(parentConfig, config); 13887 if (tmpLocale == null) { 13888 // updateLocale is called for creating a new locale 13889 // Set abbr so it will have a name (getters return 13890 // undefined otherwise). 13891 config.abbr = name; 13892 } 13893 locale = new Locale(config); 13894 locale.parentLocale = locales[name]; 13895 locales[name] = locale; 13896 } 13897 13898 // backwards compat for now: also set the locale 13899 getSetGlobalLocale(name); 13900 } else { 13901 // pass null for config to unupdate, useful for tests 13902 if (locales[name] != null) { 13903 if (locales[name].parentLocale != null) { 13904 locales[name] = locales[name].parentLocale; 13905 if (name === getSetGlobalLocale()) { 13906 getSetGlobalLocale(name); 13907 } 13908 } else if (locales[name] != null) { 13909 delete locales[name]; 13910 } 13911 } 13912 } 13913 return locales[name]; 13914 } 13915 13916 // returns locale data 13917 function getLocale(key) { 13918 var locale; 13919 13920 if (key && key._locale && key._locale._abbr) { 13921 key = key._locale._abbr; 13922 } 13923 13924 if (!key) { 13925 return globalLocale; 13926 } 13927 13928 if (!isArray(key)) { 13929 //short-circuit everything else 13930 locale = loadLocale(key); 13931 if (locale) { 13932 return locale; 13933 } 13934 key = [key]; 13935 } 13936 13937 return chooseLocale(key); 13938 } 13939 13940 function listLocales() { 13941 return keys(locales); 13942 } 13943 13944 function checkOverflow(m) { 13945 var overflow, 13946 a = m._a; 13947 13948 if (a && getParsingFlags(m).overflow === -2) { 13949 overflow = 13950 a[MONTH] < 0 || a[MONTH] > 11 13951 ? MONTH 13952 : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) 13953 ? DATE 13954 : a[HOUR] < 0 || 13955 a[HOUR] > 24 || 13956 (a[HOUR] === 24 && 13957 (a[MINUTE] !== 0 || 13958 a[SECOND] !== 0 || 13959 a[MILLISECOND] !== 0)) 13960 ? HOUR 13961 : a[MINUTE] < 0 || a[MINUTE] > 59 13962 ? MINUTE 13963 : a[SECOND] < 0 || a[SECOND] > 59 13964 ? SECOND 13965 : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 13966 ? MILLISECOND
vendor: 9,346 bytes, lines 13967-14250
13967 : -1; 13968 13969 if ( 13970 getParsingFlags(m)._overflowDayOfYear && 13971 (overflow < YEAR || overflow > DATE) 13972 ) { 13973 overflow = DATE; 13974 } 13975 if (getParsingFlags(m)._overflowWeeks && overflow === -1) { 13976 overflow = WEEK; 13977 } 13978 if (getParsingFlags(m)._overflowWeekday && overflow === -1) { 13979 overflow = WEEKDAY; 13980 } 13981 13982 getParsingFlags(m).overflow = overflow; 13983 } 13984 13985 return m; 13986 } 13987 13988 // iso 8601 regex 13989 // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) 13990 var extendedIsoRegex = 13991 /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, 13992 basicIsoRegex = 13993 /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, 13994 tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, 13995 isoDates = [ 13996 ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], 13997 ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], 13998 ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], 13999 ['GGGG-[W]WW', /\d{4}-W\d\d/, false], 14000 ['YYYY-DDD', /\d{4}-\d{3}/], 14001 ['YYYY-MM', /\d{4}-\d\d/, false], 14002 ['YYYYYYMMDD', /[+-]\d{10}/], 14003 ['YYYYMMDD', /\d{8}/], 14004 ['GGGG[W]WWE', /\d{4}W\d{3}/], 14005 ['GGGG[W]WW', /\d{4}W\d{2}/, false], 14006 ['YYYYDDD', /\d{7}/], 14007 ['YYYYMM', /\d{6}/, false], 14008 ['YYYY', /\d{4}/, false], 14009 ], 14010 // iso time formats and regexes 14011 isoTimes = [ 14012 ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], 14013 ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], 14014 ['HH:mm:ss', /\d\d:\d\d:\d\d/], 14015 ['HH:mm', /\d\d:\d\d/], 14016 ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], 14017 ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], 14018 ['HHmmss', /\d\d\d\d\d\d/], 14019 ['HHmm', /\d\d\d\d/], 14020 ['HH', /\d\d/], 14021 ], 14022 aspNetJsonRegex = /^\/?Date\((-?\d+)/i, 14023 // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 14024 rfc2822 = 14025 /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, 14026 obsOffsets = { 14027 UT: 0, 14028 GMT: 0, 14029 EDT: -4 * 60, 14030 EST: -5 * 60, 14031 CDT: -5 * 60, 14032 CST: -6 * 60, 14033 MDT: -6 * 60, 14034 MST: -7 * 60, 14035 PDT: -7 * 60, 14036 PST: -8 * 60, 14037 }; 14038 14039 // date from iso format 14040 function configFromISO(config) { 14041 var i, 14042 l, 14043 string = config._i, 14044 match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), 14045 allowTime, 14046 dateFormat, 14047 timeFormat, 14048 tzFormat, 14049 isoDatesLen = isoDates.length, 14050 isoTimesLen = isoTimes.length; 14051 14052 if (match) { 14053 getParsingFlags(config).iso = true; 14054 for (i = 0, l = isoDatesLen; i < l; i++) { 14055 if (isoDates[i][1].exec(match[1])) { 14056 dateFormat = isoDates[i][0]; 14057 allowTime = isoDates[i][2] !== false; 14058 break; 14059 } 14060 } 14061 if (dateFormat == null) { 14062 config._isValid = false; 14063 return; 14064 } 14065 if (match[3]) { 14066 for (i = 0, l = isoTimesLen; i < l; i++) { 14067 if (isoTimes[i][1].exec(match[3])) { 14068 // match[2] should be 'T' or space 14069 timeFormat = (match[2] || ' ') + isoTimes[i][0]; 14070 break; 14071 } 14072 } 14073 if (timeFormat == null) { 14074 config._isValid = false; 14075 return; 14076 } 14077 } 14078 if (!allowTime && timeFormat != null) { 14079 config._isValid = false; 14080 return; 14081 } 14082 if (match[4]) { 14083 if (tzRegex.exec(match[4])) { 14084 tzFormat = 'Z'; 14085 } else { 14086 config._isValid = false; 14087 return; 14088 } 14089 } 14090 config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); 14091 configFromStringAndFormat(config); 14092 } else { 14093 config._isValid = false; 14094 } 14095 } 14096 14097 function extractFromRFC2822Strings( 14098 yearStr, 14099 monthStr, 14100 dayStr, 14101 hourStr, 14102 minuteStr, 14103 secondStr 14104 ) { 14105 var result = [ 14106 untruncateYear(yearStr), 14107 defaultLocaleMonthsShort.indexOf(monthStr), 14108 parseInt(dayStr, 10), 14109 parseInt(hourStr, 10), 14110 parseInt(minuteStr, 10), 14111 ]; 14112 14113 if (secondStr) { 14114 result.push(parseInt(secondStr, 10)); 14115 } 14116 14117 return result; 14118 } 14119 14120 function untruncateYear(yearStr) { 14121 var year = parseInt(yearStr, 10); 14122 if (year <= 49) { 14123 return 2000 + year; 14124 } else if (year <= 999) { 14125 return 1900 + year; 14126 } 14127 return year; 14128 } 14129 14130 function preprocessRFC2822(s) { 14131 // Remove comments and folding whitespace and replace multiple-spaces with a single space 14132 return s 14133 .replace(/\([^()]*\)|[\n\t]/g, ' ') 14134 .replace(/(\s\s+)/g, ' ') 14135 .replace(/^\s\s*/, '') 14136 .replace(/\s\s*$/, ''); 14137 } 14138 14139 function checkWeekday(weekdayStr, parsedInput, config) { 14140 if (weekdayStr) { 14141 // TODO: Replace the vanilla JS Date object with an independent day-of-week check. 14142 var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), 14143 weekdayActual = new Date( 14144 parsedInput[0], 14145 parsedInput[1], 14146 parsedInput[2] 14147 ).getDay(); 14148 if (weekdayProvided !== weekdayActual) { 14149 getParsingFlags(config).weekdayMismatch = true; 14150 config._isValid = false; 14151 return false; 14152 } 14153 } 14154 return true; 14155 } 14156 14157 function calculateOffset(obsOffset, militaryOffset, numOffset) { 14158 if (obsOffset) { 14159 return obsOffsets[obsOffset]; 14160 } else if (militaryOffset) { 14161 // the only allowed military tz is Z 14162 return 0; 14163 } else { 14164 var hm = parseInt(numOffset, 10), 14165 m = hm % 100, 14166 h = (hm - m) / 100; 14167 return h * 60 + m; 14168 } 14169 } 14170 14171 // date and time from ref 2822 format 14172 function configFromRFC2822(config) { 14173 var match = rfc2822.exec(preprocessRFC2822(config._i)), 14174 parsedArray; 14175 if (match) { 14176 parsedArray = extractFromRFC2822Strings( 14177 match[4], 14178 match[3], 14179 match[2], 14180 match[5], 14181 match[6], 14182 match[7] 14183 ); 14184 if (!checkWeekday(match[1], parsedArray, config)) { 14185 return; 14186 } 14187 14188 config._a = parsedArray; 14189 config._tzm = calculateOffset(match[8], match[9], match[10]); 14190 14191 config._d = createUTCDate.apply(null, config._a); 14192 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); 14193 14194 getParsingFlags(config).rfc2822 = true; 14195 } else { 14196 config._isValid = false; 14197 } 14198 } 14199 14200 // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict 14201 function configFromString(config) { 14202 var matched = aspNetJsonRegex.exec(config._i); 14203 if (matched !== null) { 14204 config._d = new Date(+matched[1]); 14205 return; 14206 } 14207 14208 configFromISO(config); 14209 if (config._isValid === false) { 14210 delete config._isValid; 14211 } else { 14212 return; 14213 } 14214 14215 configFromRFC2822(config); 14216 if (config._isValid === false) { 14217 delete config._isValid; 14218 } else { 14219 return; 14220 } 14221 14222 if (config._strict) { 14223 config._isValid = false; 14224 } else { 14225 // Final attempt, use Input Fallback 14226 hooks.createFromInputFallback(config); 14227 } 14228 } 14229 14230 hooks.createFromInputFallback = deprecate( 14231 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 14232 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 14233 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', 14234 function (config) { 14235 config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); 14236 } 14237 ); 14238 14239 // Pick the first defined of two or three arguments. 14240 function defaults(a, b, c) { 14241 if (a != null) { 14242 return a; 14243 } 14244 if (b != null) { 14245 return b; 14246 } 14247 return c; 14248 } 14249 14250 function currentDateArray(config
vendor: 17,694 bytes, lines 14250-14811
14250) { 14251 // hooks is actually the exported moment object 14252 var nowValue = new Date(hooks.now()); 14253 if (config._useUTC) { 14254 return [ 14255 nowValue.getUTCFullYear(), 14256 nowValue.getUTCMonth(), 14257 nowValue.getUTCDate(), 14258 ]; 14259 } 14260 return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; 14261 } 14262 14263 // convert an array to a date. 14264 // the array should mirror the parameters below 14265 // note: all values past the year are optional and will default to the lowest possible value. 14266 // [year, month, day , hour, minute, second, millisecond] 14267 function configFromArray(config) { 14268 var i, 14269 date, 14270 input = [], 14271 currentDate, 14272 expectedWeekday, 14273 yearToUse; 14274 14275 if (config._d) { 14276 return; 14277 } 14278 14279 currentDate = currentDateArray(config); 14280 14281 //compute day of the year from weeks and weekdays 14282 if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { 14283 dayOfYearFromWeekInfo(config); 14284 } 14285 14286 //if the day of the year is set, figure out what it is 14287 if (config._dayOfYear != null) { 14288 yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); 14289 14290 if ( 14291 config._dayOfYear > daysInYear(yearToUse) || 14292 config._dayOfYear === 0 14293 ) { 14294 getParsingFlags(config)._overflowDayOfYear = true; 14295 } 14296 14297 date = createUTCDate(yearToUse, 0, config._dayOfYear); 14298 config._a[MONTH] = date.getUTCMonth(); 14299 config._a[DATE] = date.getUTCDate(); 14300 } 14301 14302 // Default to current date. 14303 // * if no year, month, day of month are given, default to today 14304 // * if day of month is given, default month and year 14305 // * if month is given, default only year 14306 // * if year is given, don't default anything 14307 for (i = 0; i < 3 && config._a[i] == null; ++i) { 14308 config._a[i] = input[i] = currentDate[i]; 14309 } 14310 14311 // Zero out whatever was not defaulted, including time 14312 for (; i < 7; i++) { 14313 config._a[i] = input[i] = 14314 config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; 14315 } 14316 14317 // Check for 24:00:00.000 14318 if ( 14319 config._a[HOUR] === 24 && 14320 config._a[MINUTE] === 0 && 14321 config._a[SECOND] === 0 && 14322 config._a[MILLISECOND] === 0 14323 ) { 14324 config._nextDay = true; 14325 config._a[HOUR] = 0; 14326 } 14327 14328 config._d = (config._useUTC ? createUTCDate : createDate).apply( 14329 null, 14330 input 14331 ); 14332 expectedWeekday = config._useUTC 14333 ? config._d.getUTCDay() 14334 : config._d.getDay(); 14335 14336 // Apply timezone offset from input. The actual utcOffset can be changed 14337 // with parseZone. 14338 if (config._tzm != null) { 14339 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); 14340 } 14341 14342 if (config._nextDay) { 14343 config._a[HOUR] = 24; 14344 } 14345 14346 // check for mismatching day of week 14347 if ( 14348 config._w && 14349 typeof config._w.d !== 'undefined' && 14350 config._w.d !== expectedWeekday 14351 ) { 14352 getParsingFlags(config).weekdayMismatch = true; 14353 } 14354 } 14355 14356 function dayOfYearFromWeekInfo(config) { 14357 var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; 14358 14359 w = config._w; 14360 if (w.GG != null || w.W != null || w.E != null) { 14361 dow = 1; 14362 doy = 4; 14363 14364 // TODO: We need to take the current isoWeekYear, but that depends on 14365 // how we interpret now (local, utc, fixed offset). So create 14366 // a now version of current config (take local/utc/offset flags, and 14367 // create now). 14368 weekYear = defaults( 14369 w.GG, 14370 config._a[YEAR], 14371 weekOfYear(createLocal(), 1, 4).year 14372 ); 14373 week = defaults(w.W, 1); 14374 weekday = defaults(w.E, 1); 14375 if (weekday < 1 || weekday > 7) { 14376 weekdayOverflow = true; 14377 } 14378 } else { 14379 dow = config._locale._week.dow; 14380 doy = config._locale._week.doy; 14381 14382 curWeek = weekOfYear(createLocal(), dow, doy); 14383 14384 weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); 14385 14386 // Default to current week. 14387 week = defaults(w.w, curWeek.week); 14388 14389 if (w.d != null) { 14390 // weekday -- low day numbers are considered next week 14391 weekday = w.d; 14392 if (weekday < 0 || weekday > 6) { 14393 weekdayOverflow = true; 14394 } 14395 } else if (w.e != null) { 14396 // local weekday -- counting starts from beginning of week 14397 weekday = w.e + dow; 14398 if (w.e < 0 || w.e > 6) { 14399 weekdayOverflow = true; 14400 } 14401 } else { 14402 // default to beginning of week 14403 weekday = dow; 14404 } 14405 } 14406 if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { 14407 getParsingFlags(config)._overflowWeeks = true; 14408 } else if (weekdayOverflow != null) { 14409 getParsingFlags(config)._overflowWeekday = true; 14410 } else { 14411 temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); 14412 config._a[YEAR] = temp.year; 14413 config._dayOfYear = temp.dayOfYear; 14414 } 14415 } 14416 14417 // constant that refers to the ISO standard 14418 hooks.ISO_8601 = function () {}; 14419 14420 // constant that refers to the RFC 2822 form 14421 hooks.RFC_2822 = function () {}; 14422 14423 // date from string and format string 14424 function configFromStringAndFormat(config) { 14425 // TODO: Move this to another part of the creation flow to prevent circular deps 14426 if (config._f === hooks.ISO_8601) { 14427 configFromISO(config); 14428 return; 14429 } 14430 if (config._f === hooks.RFC_2822) { 14431 configFromRFC2822(config); 14432 return; 14433 } 14434 config._a = []; 14435 getParsingFlags(config).empty = true; 14436 14437 // This array is used to make a Date, either with `new Date` or `Date.UTC` 14438 var string = '' + config._i, 14439 i, 14440 parsedInput, 14441 tokens, 14442 token, 14443 skipped, 14444 stringLength = string.length, 14445 totalParsedInputLength = 0, 14446 era, 14447 tokenLen; 14448 14449 tokens = 14450 expandFormat(config._f, config._locale).match(formattingTokens) || []; 14451 tokenLen = tokens.length; 14452 for (i = 0; i < tokenLen; i++) { 14453 token = tokens[i]; 14454 parsedInput = (string.match(getParseRegexForToken(token, config)) || 14455 [])[0]; 14456 if (parsedInput) { 14457 skipped = string.substr(0, string.indexOf(parsedInput)); 14458 if (skipped.length > 0) { 14459 getParsingFlags(config).unusedInput.push(skipped); 14460 } 14461 string = string.slice( 14462 string.indexOf(parsedInput) + parsedInput.length 14463 ); 14464 totalParsedInputLength += parsedInput.length; 14465 } 14466 // don't parse if it's not a known token 14467 if (formatTokenFunctions[token]) { 14468 if (parsedInput) { 14469 getParsingFlags(config).empty = false; 14470 } else { 14471 getParsingFlags(config).unusedTokens.push(token); 14472 } 14473 addTimeToArrayFromToken(token, parsedInput, config); 14474 } else if (config._strict && !parsedInput) { 14475 getParsingFlags(config).unusedTokens.push(token); 14476 } 14477 } 14478 14479 // add remaining unparsed input length to the string 14480 getParsingFlags(config).charsLeftOver = 14481 stringLength - totalParsedInputLength; 14482 if (string.length > 0) { 14483 getParsingFlags(config).unusedInput.push(string); 14484 } 14485 14486 // clear _12h flag if hour is <= 12 14487 if ( 14488 config._a[HOUR] <= 12 && 14489 getParsingFlags(config).bigHour === true && 14490 config._a[HOUR] > 0 14491 ) { 14492 getParsingFlags(config).bigHour = undefined; 14493 } 14494 14495 getParsingFlags(config).parsedDateParts = config._a.slice(0); 14496 getParsingFlags(config).meridiem = config._meridiem; 14497 // handle meridiem 14498 config._a[HOUR] = meridiemFixWrap( 14499 config._locale, 14500 config._a[HOUR], 14501 config._meridiem 14502 ); 14503 14504 // handle era 14505 era = getParsingFlags(config).era; 14506 if (era !== null) { 14507 config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); 14508 } 14509 14510 configFromArray(config); 14511 checkOverflow(config); 14512 } 14513 14514 function meridiemFixWrap(locale, hour, meridiem) { 14515 var isPm; 14516 14517 if (meridiem == null) { 14518 // nothing to do 14519 return hour; 14520 } 14521 if (locale.meridiemHour != null) { 14522 return locale.meridiemHour(hour, meridiem); 14523 } else if (locale.isPM != null) { 14524 // Fallback 14525 isPm = locale.isPM(meridiem); 14526 if (isPm && hour < 12) { 14527 hour += 12; 14528 } 14529 if (!isPm && hour === 12) { 14530 hour = 0; 14531 } 14532 return hour; 14533 } else { 14534 // this is not supposed to happen 14535 return hour; 14536 } 14537 } 14538 14539 // date from string and array of format strings 14540 function configFromStringAndArray(config) { 14541 var tempConfig, 14542 bestMoment, 14543 scoreToBeat, 14544 i, 14545 currentScore, 14546 validFormatFound, 14547 bestFormatIsValid = false, 14548 configfLen = config._f.length; 14549 14550 if (configfLen === 0) { 14551 getParsingFlags(config).invalidFormat = true; 14552 config._d = new Date(NaN); 14553 return; 14554 } 14555 14556 for (i = 0; i < configfLen; i++) { 14557 currentScore = 0; 14558 validFormatFound = false; 14559 tempConfig = copyConfig({}, config); 14560 if (config._useUTC != null) { 14561 tempConfig._useUTC = config._useUTC; 14562 } 14563 tempConfig._f = config._f[i]; 14564 configFromStringAndFormat(tempConfig); 14565 14566 if (isValid(tempConfig)) { 14567 validFormatFound = true; 14568 } 14569 14570 // if there is any input that was not parsed add a penalty for that format 14571 currentScore += getParsingFlags(tempConfig).charsLeftOver; 14572 14573 //or tokens 14574 currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; 14575 14576 getParsingFlags(tempConfig).score = currentScore; 14577 14578 if (!bestFormatIsValid) { 14579 if ( 14580 scoreToBeat == null || 14581 currentScore < scoreToBeat || 14582 validFormatFound 14583 ) { 14584 scoreToBeat = currentScore; 14585 bestMoment = tempConfig; 14586 if (validFormatFound) { 14587 bestFormatIsValid = true; 14588 } 14589 } 14590 } else { 14591 if (currentScore < scoreToBeat) { 14592 scoreToBeat = currentScore; 14593 bestMoment = tempConfig; 14594 } 14595 } 14596 } 14597 14598 extend(config, bestMoment || tempConfig); 14599 } 14600 14601 function configFromObject(config) { 14602 if (config._d) { 14603 return; 14604 } 14605 14606 var i = normalizeObjectUnits(config._i), 14607 dayOrDate = i.day === undefined ? i.date : i.day; 14608 config._a = map( 14609 [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], 14610 function (obj) { 14611 return obj && parseInt(obj, 10); 14612 } 14613 ); 14614 14615 configFromArray(config); 14616 } 14617 14618 function createFromConfig(config) { 14619 var res = new Moment(checkOverflow(prepareConfig(config))); 14620 if (res._nextDay) { 14621 // Adding is smart enough around DST 14622 res.add(1, 'd'); 14623 res._nextDay = undefined; 14624 } 14625 14626 return res; 14627 } 14628 14629 function prepareConfig(config) { 14630 var input = config._i, 14631 format = config._f; 14632 14633 config._locale = config._locale || getLocale(config._l); 14634 14635 if (input === null || (format === undefined && input === '')) { 14636 return createInvalid({ nullInput: true }); 14637 } 14638 14639 if (typeof input === 'string') { 14640 config._i = input = config._locale.preparse(input); 14641 } 14642 14643 if (isMoment(input)) { 14644 return new Moment(checkOverflow(input)); 14645 } else if (isDate(input)) { 14646 config._d = input; 14647 } else if (isArray(format)) { 14648 configFromStringAndArray(config); 14649 } else if (format) { 14650 configFromStringAndFormat(config); 14651 } else { 14652 configFromInput(config); 14653 } 14654 14655 if (!isValid(config)) { 14656 config._d = null; 14657 } 14658 14659 return config; 14660 } 14661 14662 function configFromInput(config) { 14663 var input = config._i; 14664 if (isUndefined(input)) { 14665 config._d = new Date(hooks.now()); 14666 } else if (isDate(input)) { 14667 config._d = new Date(input.valueOf()); 14668 } else if (typeof input === 'string') { 14669 configFromString(config); 14670 } else if (isArray(input)) { 14671 config._a = map(input.slice(0), function (obj) { 14672 return parseInt(obj, 10); 14673 }); 14674 configFromArray(config); 14675 } else if (isObject(input)) { 14676 configFromObject(config); 14677 } else if (isNumber(input)) { 14678 // from milliseconds 14679 config._d = new Date(input); 14680 } else { 14681 hooks.createFromInputFallback(config); 14682 } 14683 } 14684 14685 function createLocalOrUTC(input, format, locale, strict, isUTC) { 14686 var c = {}; 14687 14688 if (format === true || format === false) { 14689 strict = format; 14690 format = undefined; 14691 } 14692 14693 if (locale === true || locale === false) { 14694 strict = locale; 14695 locale = undefined; 14696 } 14697 14698 if ( 14699 (isObject(input) && isObjectEmpty(input)) || 14700 (isArray(input) && input.length === 0) 14701 ) { 14702 input = undefined; 14703 } 14704 // object construction must be done this way. 14705 // https://github.com/moment/moment/issues/1423 14706 c._isAMomentObject = true; 14707 c._useUTC = c._isUTC = isUTC; 14708 c._l = locale; 14709 c._i = input; 14710 c._f = format; 14711 c._strict = strict; 14712 14713 return createFromConfig(c); 14714 } 14715 14716 function createLocal(input, format, locale, strict) { 14717 return createLocalOrUTC(input, format, locale, strict, false); 14718 } 14719 14720 var prototypeMin = deprecate( 14721 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', 14722 function () { 14723 var other = createLocal.apply(null, arguments); 14724 if (this.isValid() && other.isValid()) { 14725 return other < this ? this : other; 14726 } else { 14727 return createInvalid(); 14728 } 14729 } 14730 ), 14731 prototypeMax = deprecate( 14732 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', 14733 function () { 14734 var other = createLocal.apply(null, arguments); 14735 if (this.isValid() && other.isValid()) { 14736 return other > this ? this : other; 14737 } else { 14738 return createInvalid(); 14739 } 14740 } 14741 ); 14742 14743 // Pick a moment m from moments so that m[fn](other) is true for all 14744 // other. This relies on the function fn to be transitive. 14745 // 14746 // moments should either be an array of moment objects or an array, whose 14747 // first element is an array of moment objects. 14748 function pickBy(fn, moments) { 14749 var res, i; 14750 if (moments.length === 1 && isArray(moments[0])) { 14751 moments = moments[0]; 14752 } 14753 if (!moments.length) { 14754 return createLocal(); 14755 } 14756 res = moments[0]; 14757 for (i = 1; i < moments.length; ++i) { 14758 if (!moments[i].isValid() || moments[i][fn](res)) { 14759 res = moments[i]; 14760 } 14761 } 14762 return res; 14763 } 14764 14765 // TODO: Use [].sort instead? 14766 function min() { 14767 var args = [].slice.call(arguments, 0); 14768 14769 return pickBy('isBefore', args); 14770 } 14771 14772 function max() { 14773 var args = [].slice.call(arguments, 0); 14774 14775 return pickBy('isAfter', args); 14776 } 14777 14778 var now = function () { 14779 return Date.now ? Date.now() : +new Date(); 14780 }; 14781 14782 var ordering = [ 14783 'year', 14784 'quarter', 14785 'month', 14786 'week', 14787 'day', 14788 'hour', 14789 'minute', 14790 'second', 14791 'millisecond', 14792 ]; 14793 14794 function isDurationValid(m) { 14795 var key, 14796 unitHasDecimal = false, 14797 i, 14798 orderLen = ordering.length; 14799 for (key in m) { 14800 if ( 14801 hasOwnProp(m, key) && 14802 !( 14803 indexOf.call(ordering, key) !== -1 && 14804 (m[key] == null || !isNaN(m[key])) 14805 ) 14806 ) { 14807 return false; 14808 } 14809 } 14810 14811 for (i = 0; i < orderLen
vendor: 10,251 bytes, lines 14811-15136
14811; ++i) { 14812 if (m[ordering[i]]) { 14813 if (unitHasDecimal) { 14814 return false; // only allow non-integers for smallest unit 14815 } 14816 if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { 14817 unitHasDecimal = true; 14818 } 14819 } 14820 } 14821 14822 return true; 14823 } 14824 14825 function isValid$1() { 14826 return this._isValid; 14827 } 14828 14829 function createInvalid$1() { 14830 return createDuration(NaN); 14831 } 14832 14833 function Duration(duration) { 14834 var normalizedInput = normalizeObjectUnits(duration), 14835 years = normalizedInput.year || 0, 14836 quarters = normalizedInput.quarter || 0, 14837 months = normalizedInput.month || 0, 14838 weeks = normalizedInput.week || normalizedInput.isoWeek || 0, 14839 days = normalizedInput.day || 0, 14840 hours = normalizedInput.hour || 0, 14841 minutes = normalizedInput.minute || 0, 14842 seconds = normalizedInput.second || 0, 14843 milliseconds = normalizedInput.millisecond || 0; 14844 14845 this._isValid = isDurationValid(normalizedInput); 14846 14847 // representation for dateAddRemove 14848 this._milliseconds = 14849 +milliseconds + 14850 seconds * 1e3 + // 1000 14851 minutes * 6e4 + // 1000 * 60 14852 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 14853 // Because of dateAddRemove treats 24 hours as different from a 14854 // day when working around DST, we need to store them separately 14855 this._days = +days + weeks * 7; 14856 // It is impossible to translate months into days without knowing 14857 // which months you are are talking about, so we have to store 14858 // it separately. 14859 this._months = +months + quarters * 3 + years * 12; 14860 14861 this._data = {}; 14862 14863 this._locale = getLocale(); 14864 14865 this._bubble(); 14866 } 14867 14868 function isDuration(obj) { 14869 return obj instanceof Duration; 14870 } 14871 14872 function absRound(number) { 14873 if (number < 0) { 14874 return Math.round(-1 * number) * -1; 14875 } else { 14876 return Math.round(number); 14877 } 14878 } 14879 14880 // compare two arrays, return the number of differences 14881 function compareArrays(array1, array2, dontConvert) { 14882 var len = Math.min(array1.length, array2.length), 14883 lengthDiff = Math.abs(array1.length - array2.length), 14884 diffs = 0, 14885 i; 14886 for (i = 0; i < len; i++) { 14887 if ( 14888 (dontConvert && array1[i] !== array2[i]) || 14889 (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) 14890 ) { 14891 diffs++; 14892 } 14893 } 14894 return diffs + lengthDiff; 14895 } 14896 14897 // FORMATTING 14898 14899 function offset(token, separator) { 14900 addFormatToken(token, 0, 0, function () { 14901 var offset = this.utcOffset(), 14902 sign = '+'; 14903 if (offset < 0) { 14904 offset = -offset; 14905 sign = '-'; 14906 } 14907 return ( 14908 sign + 14909 zeroFill(~~(offset / 60), 2) + 14910 separator + 14911 zeroFill(~~offset % 60, 2) 14912 ); 14913 }); 14914 } 14915 14916 offset('Z', ':'); 14917 offset('ZZ', ''); 14918 14919 // PARSING 14920 14921 addRegexToken('Z', matchShortOffset); 14922 addRegexToken('ZZ', matchShortOffset); 14923 addParseToken(['Z', 'ZZ'], function (input, array, config) { 14924 config._useUTC = true; 14925 config._tzm = offsetFromString(matchShortOffset, input); 14926 }); 14927 14928 // HELPERS 14929 14930 // timezone chunker 14931 // '+10:00' > ['10', '00'] 14932 // '-1530' > ['-15', '30'] 14933 var chunkOffset = /([\+\-]|\d\d)/gi; 14934 14935 function offsetFromString(matcher, string) { 14936 var matches = (string || '').match(matcher), 14937 chunk, 14938 parts, 14939 minutes; 14940 14941 if (matches === null) { 14942 return null; 14943 } 14944 14945 chunk = matches[matches.length - 1] || []; 14946 parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; 14947 minutes = +(parts[1] * 60) + toInt(parts[2]); 14948 14949 return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; 14950 } 14951 14952 // Return a moment from input, that is local/utc/zone equivalent to model. 14953 function cloneWithOffset(input, model) { 14954 var res, diff; 14955 if (model._isUTC) { 14956 res = model.clone(); 14957 diff = 14958 (isMoment(input) || isDate(input) 14959 ? input.valueOf() 14960 : createLocal(input).valueOf()) - res.valueOf(); 14961 // Use low-level api, because this fn is low-level api. 14962 res._d.setTime(res._d.valueOf() + diff); 14963 hooks.updateOffset(res, false); 14964 return res; 14965 } else { 14966 return createLocal(input).local(); 14967 } 14968 } 14969 14970 function getDateOffset(m) { 14971 // On Firefox.24 Date#getTimezoneOffset returns a floating point. 14972 // https://github.com/moment/moment/pull/1871 14973 return -Math.round(m._d.getTimezoneOffset()); 14974 } 14975 14976 // HOOKS 14977 14978 // This function will be called whenever a moment is mutated. 14979 // It is intended to keep the offset in sync with the timezone. 14980 hooks.updateOffset = function () {}; 14981 14982 // MOMENTS 14983 14984 // keepLocalTime = true means only change the timezone, without 14985 // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> 14986 // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset 14987 // +0200, so we adjust the time as needed, to be valid. 14988 // 14989 // Keeping the time actually adds/subtracts (one hour) 14990 // from the actual represented time. That is why we call updateOffset 14991 // a second time. In case it wants us to change the offset again 14992 // _changeInProgress == true case, then we have to adjust, because 14993 // there is no such time in the given timezone. 14994 function getSetOffset(input, keepLocalTime, keepMinutes) { 14995 var offset = this._offset || 0, 14996 localAdjust; 14997 if (!this.isValid()) { 14998 return input != null ? this : NaN; 14999 } 15000 if (input != null) { 15001 if (typeof input === 'string') { 15002 input = offsetFromString(matchShortOffset, input); 15003 if (input === null) { 15004 return this; 15005 } 15006 } else if (Math.abs(input) < 16 && !keepMinutes) { 15007 input = input * 60; 15008 } 15009 if (!this._isUTC && keepLocalTime) { 15010 localAdjust = getDateOffset(this); 15011 } 15012 this._offset = input; 15013 this._isUTC = true; 15014 if (localAdjust != null) { 15015 this.add(localAdjust, 'm'); 15016 } 15017 if (offset !== input) { 15018 if (!keepLocalTime || this._changeInProgress) { 15019 addSubtract( 15020 this, 15021 createDuration(input - offset, 'm'), 15022 1, 15023 false 15024 ); 15025 } else if (!this._changeInProgress) { 15026 this._changeInProgress = true; 15027 hooks.updateOffset(this, true); 15028 this._changeInProgress = null; 15029 } 15030 } 15031 return this; 15032 } else { 15033 return this._isUTC ? offset : getDateOffset(this); 15034 } 15035 } 15036 15037 function getSetZone(input, keepLocalTime) { 15038 if (input != null) { 15039 if (typeof input !== 'string') { 15040 input = -input; 15041 } 15042 15043 this.utcOffset(input, keepLocalTime); 15044 15045 return this; 15046 } else { 15047 return -this.utcOffset(); 15048 } 15049 } 15050 15051 function setOffsetToUTC(keepLocalTime) { 15052 return this.utcOffset(0, keepLocalTime); 15053 } 15054 15055 function setOffsetToLocal(keepLocalTime) { 15056 if (this._isUTC) { 15057 this.utcOffset(0, keepLocalTime); 15058 this._isUTC = false; 15059 15060 if (keepLocalTime) { 15061 this.subtract(getDateOffset(this), 'm'); 15062 } 15063 } 15064 return this; 15065 } 15066 15067 function setOffsetToParsedOffset() { 15068 if (this._tzm != null) { 15069 this.utcOffset(this._tzm, false, true); 15070 } else if (typeof this._i === 'string') { 15071 var tZone = offsetFromString(matchOffset, this._i); 15072 if (tZone != null) { 15073 this.utcOffset(tZone); 15074 } else { 15075 this.utcOffset(0, true); 15076 } 15077 } 15078 return this; 15079 } 15080 15081 function hasAlignedHourOffset(input) { 15082 if (!this.isValid()) { 15083 return false; 15084 } 15085 input = input ? createLocal(input).utcOffset() : 0; 15086 15087 return (this.utcOffset() - input) % 60 === 0; 15088 } 15089 15090 function isDaylightSavingTime() { 15091 return ( 15092 this.utcOffset() > this.clone().month(0).utcOffset() || 15093 this.utcOffset() > this.clone().month(5).utcOffset() 15094 ); 15095 } 15096 15097 function isDaylightSavingTimeShifted() { 15098 if (!isUndefined(this._isDSTShifted)) { 15099 return this._isDSTShifted; 15100 } 15101 15102 var c = {}, 15103 other; 15104 15105 copyConfig(c, this); 15106 c = prepareConfig(c); 15107 15108 if (c._a) { 15109 other = c._isUTC ? createUTC(c._a) : createLocal(c._a); 15110 this._isDSTShifted = 15111 this.isValid() && compareArrays(c._a, other.toArray()) > 0; 15112 } else { 15113 this._isDSTShifted = false; 15114 } 15115 15116 return this._isDSTShifted; 15117 } 15118 15119 function isLocal() { 15120 return this.isValid() ? !this._isUTC : false; 15121 } 15122 15123 function isUtcOffset() { 15124 return this.isValid() ? this._isUTC : false; 15125 } 15126 15127 function isUtc() { 15128 return this.isValid() ? this._isUTC && this._offset === 0 : false; 15129 } 15130 15131 // ASP.NET json date format regex 15132 var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, 15133 // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html 15134 // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere 15135 // and further modified to allow for strings containing both week and day 15136 isoRegex =
vendor: 9,021 bytes, lines 15136-15426
15136 15137 /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; 15138 15139 function createDuration(input, key) { 15140 var duration = input, 15141 // matching against regexp is expensive, do it on demand 15142 match = null, 15143 sign, 15144 ret, 15145 diffRes; 15146 15147 if (isDuration(input)) { 15148 duration = { 15149 ms: input._milliseconds, 15150 d: input._days, 15151 M: input._months, 15152 }; 15153 } else if (isNumber(input) || !isNaN(+input)) { 15154 duration = {}; 15155 if (key) { 15156 duration[key] = +input; 15157 } else { 15158 duration.milliseconds = +input; 15159 } 15160 } else if ((match = aspNetRegex.exec(input))) { 15161 sign = match[1] === '-' ? -1 : 1; 15162 duration = { 15163 y: 0, 15164 d: toInt(match[DATE]) * sign, 15165 h: toInt(match[HOUR]) * sign, 15166 m: toInt(match[MINUTE]) * sign, 15167 s: toInt(match[SECOND]) * sign, 15168 ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match 15169 }; 15170 } else if ((match = isoRegex.exec(input))) { 15171 sign = match[1] === '-' ? -1 : 1; 15172 duration = { 15173 y: parseIso(match[2], sign), 15174 M: parseIso(match[3], sign), 15175 w: parseIso(match[4], sign), 15176 d: parseIso(match[5], sign), 15177 h: parseIso(match[6], sign), 15178 m: parseIso(match[7], sign), 15179 s: parseIso(match[8], sign), 15180 }; 15181 } else if (duration == null) { 15182 // checks for null or undefined 15183 duration = {}; 15184 } else if ( 15185 typeof duration === 'object' && 15186 ('from' in duration || 'to' in duration) 15187 ) { 15188 diffRes = momentsDifference( 15189 createLocal(duration.from), 15190 createLocal(duration.to) 15191 ); 15192 15193 duration = {}; 15194 duration.ms = diffRes.milliseconds; 15195 duration.M = diffRes.months; 15196 } 15197 15198 ret = new Duration(duration); 15199 15200 if (isDuration(input) && hasOwnProp(input, '_locale')) { 15201 ret._locale = input._locale; 15202 } 15203 15204 if (isDuration(input) && hasOwnProp(input, '_isValid')) { 15205 ret._isValid = input._isValid; 15206 } 15207 15208 return ret; 15209 } 15210 15211 createDuration.fn = Duration.prototype; 15212 createDuration.invalid = createInvalid$1; 15213 15214 function parseIso(inp, sign) { 15215 // We'd normally use ~~inp for this, but unfortunately it also 15216 // converts floats to ints. 15217 // inp may be undefined, so careful calling replace on it. 15218 var res = inp && parseFloat(inp.replace(',', '.')); 15219 // apply sign while we're at it 15220 return (isNaN(res) ? 0 : res) * sign; 15221 } 15222 15223 function positiveMomentsDifference(base, other) { 15224 var res = {}; 15225 15226 res.months = 15227 other.month() - base.month() + (other.year() - base.year()) * 12; 15228 if (base.clone().add(res.months, 'M').isAfter(other)) { 15229 --res.months; 15230 } 15231 15232 res.milliseconds = +other - +base.clone().add(res.months, 'M'); 15233 15234 return res; 15235 } 15236 15237 function momentsDifference(base, other) { 15238 var res; 15239 if (!(base.isValid() && other.isValid())) { 15240 return { milliseconds: 0, months: 0 }; 15241 } 15242 15243 other = cloneWithOffset(other, base); 15244 if (base.isBefore(other)) { 15245 res = positiveMomentsDifference(base, other); 15246 } else { 15247 res = positiveMomentsDifference(other, base); 15248 res.milliseconds = -res.milliseconds; 15249 res.months = -res.months; 15250 } 15251 15252 return res; 15253 } 15254 15255 // TODO: remove 'name' arg after deprecation is removed 15256 function createAdder(direction, name) { 15257 return function (val, period) { 15258 var dur, tmp; 15259 //invert the arguments, but complain about it 15260 if (period !== null && !isNaN(+period)) { 15261 deprecateSimple( 15262 name, 15263 'moment().' + 15264 name + 15265 '(period, number) is deprecated. Please use moment().' + 15266 name + 15267 '(number, period). ' + 15268 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' 15269 ); 15270 tmp = val; 15271 val = period; 15272 period = tmp; 15273 } 15274 15275 dur = createDuration(val, period); 15276 addSubtract(this, dur, direction); 15277 return this; 15278 }; 15279 } 15280 15281 function addSubtract(mom, duration, isAdding, updateOffset) { 15282 var milliseconds = duration._milliseconds, 15283 days = absRound(duration._days), 15284 months = absRound(duration._months); 15285 15286 if (!mom.isValid()) { 15287 // No op 15288 return; 15289 } 15290 15291 updateOffset = updateOffset == null ? true : updateOffset; 15292 15293 if (months) { 15294 setMonth(mom, get(mom, 'Month') + months * isAdding); 15295 } 15296 if (days) { 15297 set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); 15298 } 15299 if (milliseconds) { 15300 mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); 15301 } 15302 if (updateOffset) { 15303 hooks.updateOffset(mom, days || months); 15304 } 15305 } 15306 15307 var add = createAdder(1, 'add'), 15308 subtract = createAdder(-1, 'subtract'); 15309 15310 function isString(input) { 15311 return typeof input === 'string' || input instanceof String; 15312 } 15313 15314 // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined 15315 function isMomentInput(input) { 15316 return ( 15317 isMoment(input) || 15318 isDate(input) || 15319 isString(input) || 15320 isNumber(input) || 15321 isNumberOrStringArray(input) || 15322 isMomentInputObject(input) || 15323 input === null || 15324 input === undefined 15325 ); 15326 } 15327 15328 function isMomentInputObject(input) { 15329 var objectTest = isObject(input) && !isObjectEmpty(input), 15330 propertyTest = false, 15331 properties = [ 15332 'years', 15333 'year', 15334 'y', 15335 'months', 15336 'month', 15337 'M', 15338 'days', 15339 'day', 15340 'd', 15341 'dates', 15342 'date', 15343 'D', 15344 'hours', 15345 'hour', 15346 'h', 15347 'minutes', 15348 'minute', 15349 'm', 15350 'seconds', 15351 'second', 15352 's', 15353 'milliseconds', 15354 'millisecond', 15355 'ms', 15356 ], 15357 i, 15358 property, 15359 propertyLen = properties.length; 15360 15361 for (i = 0; i < propertyLen; i += 1) { 15362 property = properties[i]; 15363 propertyTest = propertyTest || hasOwnProp(input, property); 15364 } 15365 15366 return objectTest && propertyTest; 15367 } 15368 15369 function isNumberOrStringArray(input) { 15370 var arrayTest = isArray(input), 15371 dataTypeTest = false; 15372 if (arrayTest) { 15373 dataTypeTest = 15374 input.filter(function (item) { 15375 return !isNumber(item) && isString(input); 15376 }).length === 0; 15377 } 15378 return arrayTest && dataTypeTest; 15379 } 15380 15381 function isCalendarSpec(input) { 15382 var objectTest = isObject(input) && !isObjectEmpty(input), 15383 propertyTest = false, 15384 properties = [ 15385 'sameDay', 15386 'nextDay', 15387 'lastDay', 15388 'nextWeek', 15389 'lastWeek', 15390 'sameElse', 15391 ], 15392 i, 15393 property; 15394 15395 for (i = 0; i < properties.length; i += 1) { 15396 property = properties[i]; 15397 propertyTest = propertyTest || hasOwnProp(input, property); 15398 } 15399 15400 return objectTest && propertyTest; 15401 } 15402 15403 function getCalendarFormat(myMoment, now) { 15404 var diff = myMoment.diff(now, 'days', true); 15405 return diff < -6 15406 ? 'sameElse' 15407 : diff < -1 15408 ? 'lastWeek' 15409 : diff < 0 15410 ? 'lastDay' 15411 : diff < 1 15412 ? 'sameDay' 15413 : diff < 2 15414 ? 'nextDay' 15415 : diff < 7 15416 ? 'nextWeek' 15417 : 'sameElse'; 15418 } 15419 15420 function calendar$1(time, formats) { 15421 // Support for single parameter, formats only overload to the calendar function 15422 if (arguments.length === 1) { 15423 if (!arguments[0]) { 15424 time = undefined; 15425 formats = undefined; 15426 } else
vendor: 17,627 bytes, lines 15426-15984
15426 if (isMomentInput(arguments[0])) { 15427 time = arguments[0]; 15428 formats = undefined; 15429 } else if (isCalendarSpec(arguments[0])) { 15430 formats = arguments[0]; 15431 time = undefined; 15432 } 15433 } 15434 // We want to compare the start of today, vs this. 15435 // Getting start-of-today depends on whether we're local/utc/offset or not. 15436 var now = time || createLocal(), 15437 sod = cloneWithOffset(now, this).startOf('day'), 15438 format = hooks.calendarFormat(this, sod) || 'sameElse', 15439 output = 15440 formats && 15441 (isFunction(formats[format]) 15442 ? formats[format].call(this, now) 15443 : formats[format]); 15444 15445 return this.format( 15446 output || this.localeData().calendar(format, this, createLocal(now)) 15447 ); 15448 } 15449 15450 function clone() { 15451 return new Moment(this); 15452 } 15453 15454 function isAfter(input, units) { 15455 var localInput = isMoment(input) ? input : createLocal(input); 15456 if (!(this.isValid() && localInput.isValid())) { 15457 return false; 15458 } 15459 units = normalizeUnits(units) || 'millisecond'; 15460 if (units === 'millisecond') { 15461 return this.valueOf() > localInput.valueOf(); 15462 } else { 15463 return localInput.valueOf() < this.clone().startOf(units).valueOf(); 15464 } 15465 } 15466 15467 function isBefore(input, units) { 15468 var localInput = isMoment(input) ? input : createLocal(input); 15469 if (!(this.isValid() && localInput.isValid())) { 15470 return false; 15471 } 15472 units = normalizeUnits(units) || 'millisecond'; 15473 if (units === 'millisecond') { 15474 return this.valueOf() < localInput.valueOf(); 15475 } else { 15476 return this.clone().endOf(units).valueOf() < localInput.valueOf(); 15477 } 15478 } 15479 15480 function isBetween(from, to, units, inclusivity) { 15481 var localFrom = isMoment(from) ? from : createLocal(from), 15482 localTo = isMoment(to) ? to : createLocal(to); 15483 if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { 15484 return false; 15485 } 15486 inclusivity = inclusivity || '()'; 15487 return ( 15488 (inclusivity[0] === '(' 15489 ? this.isAfter(localFrom, units) 15490 : !this.isBefore(localFrom, units)) && 15491 (inclusivity[1] === ')' 15492 ? this.isBefore(localTo, units) 15493 : !this.isAfter(localTo, units)) 15494 ); 15495 } 15496 15497 function isSame(input, units) { 15498 var localInput = isMoment(input) ? input : createLocal(input), 15499 inputMs; 15500 if (!(this.isValid() && localInput.isValid())) { 15501 return false; 15502 } 15503 units = normalizeUnits(units) || 'millisecond'; 15504 if (units === 'millisecond') { 15505 return this.valueOf() === localInput.valueOf(); 15506 } else { 15507 inputMs = localInput.valueOf(); 15508 return ( 15509 this.clone().startOf(units).valueOf() <= inputMs && 15510 inputMs <= this.clone().endOf(units).valueOf() 15511 ); 15512 } 15513 } 15514 15515 function isSameOrAfter(input, units) { 15516 return this.isSame(input, units) || this.isAfter(input, units); 15517 } 15518 15519 function isSameOrBefore(input, units) { 15520 return this.isSame(input, units) || this.isBefore(input, units); 15521 } 15522 15523 function diff(input, units, asFloat) { 15524 var that, zoneDelta, output; 15525 15526 if (!this.isValid()) { 15527 return NaN; 15528 } 15529 15530 that = cloneWithOffset(input, this); 15531 15532 if (!that.isValid()) { 15533 return NaN; 15534 } 15535 15536 zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; 15537 15538 units = normalizeUnits(units); 15539 15540 switch (units) { 15541 case 'year': 15542 output = monthDiff(this, that) / 12; 15543 break; 15544 case 'month': 15545 output = monthDiff(this, that); 15546 break; 15547 case 'quarter': 15548 output = monthDiff(this, that) / 3; 15549 break; 15550 case 'second': 15551 output = (this - that) / 1e3; 15552 break; // 1000 15553 case 'minute': 15554 output = (this - that) / 6e4; 15555 break; // 1000 * 60 15556 case 'hour': 15557 output = (this - that) / 36e5; 15558 break; // 1000 * 60 * 60 15559 case 'day': 15560 output = (this - that - zoneDelta) / 864e5; 15561 break; // 1000 * 60 * 60 * 24, negate dst 15562 case 'week': 15563 output = (this - that - zoneDelta) / 6048e5; 15564 break; // 1000 * 60 * 60 * 24 * 7, negate dst 15565 default: 15566 output = this - that; 15567 } 15568 15569 return asFloat ? output : absFloor(output); 15570 } 15571 15572 function monthDiff(a, b) { 15573 if (a.date() < b.date()) { 15574 // end-of-month calculations work correct when the start month has more 15575 // days than the end month. 15576 return -monthDiff(b, a); 15577 } 15578 // difference in months 15579 var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), 15580 // b is in (anchor - 1 month, anchor + 1 month) 15581 anchor = a.clone().add(wholeMonthDiff, 'months'), 15582 anchor2, 15583 adjust; 15584 15585 if (b - anchor < 0) { 15586 anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); 15587 // linear across the month 15588 adjust = (b - anchor) / (anchor - anchor2); 15589 } else { 15590 anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); 15591 // linear across the month 15592 adjust = (b - anchor) / (anchor2 - anchor); 15593 } 15594 15595 //check for negative zero, return zero if negative zero 15596 return -(wholeMonthDiff + adjust) || 0; 15597 } 15598 15599 hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; 15600 hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; 15601 15602 function toString() { 15603 return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); 15604 } 15605 15606 function toISOString(keepOffset) { 15607 if (!this.isValid()) { 15608 return null; 15609 } 15610 var utc = keepOffset !== true, 15611 m = utc ? this.clone().utc() : this; 15612 if (m.year() < 0 || m.year() > 9999) { 15613 return formatMoment( 15614 m, 15615 utc 15616 ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' 15617 : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' 15618 ); 15619 } 15620 if (isFunction(Date.prototype.toISOString)) { 15621 // native implementation is ~50x faster, use it when we can 15622 if (utc) { 15623 return this.toDate().toISOString(); 15624 } else { 15625 return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) 15626 .toISOString() 15627 .replace('Z', formatMoment(m, 'Z')); 15628 } 15629 } 15630 return formatMoment( 15631 m, 15632 utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' 15633 ); 15634 } 15635 15636 /** 15637 * Return a human readable representation of a moment that can 15638 * also be evaluated to get a new moment which is the same 15639 * 15640 * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects 15641 */ 15642 function inspect() { 15643 if (!this.isValid()) { 15644 return 'moment.invalid(/* ' + this._i + ' */)'; 15645 } 15646 var func = 'moment', 15647 zone = '', 15648 prefix, 15649 year, 15650 datetime, 15651 suffix; 15652 if (!this.isLocal()) { 15653 func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; 15654 zone = 'Z'; 15655 } 15656 prefix = '[' + func + '("]'; 15657 year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; 15658 datetime = '-MM-DD[T]HH:mm:ss.SSS'; 15659 suffix = zone + '[")]'; 15660 15661 return this.format(prefix + year + datetime + suffix); 15662 } 15663 15664 function format(inputString) { 15665 if (!inputString) { 15666 inputString = this.isUtc() 15667 ? hooks.defaultFormatUtc 15668 : hooks.defaultFormat; 15669 } 15670 var output = formatMoment(this, inputString); 15671 return this.localeData().postformat(output); 15672 } 15673 15674 function from(time, withoutSuffix) { 15675 if ( 15676 this.isValid() && 15677 ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) 15678 ) { 15679 return createDuration({ to: this, from: time }) 15680 .locale(this.locale()) 15681 .humanize(!withoutSuffix); 15682 } else { 15683 return this.localeData().invalidDate(); 15684 } 15685 } 15686 15687 function fromNow(withoutSuffix) { 15688 return this.from(createLocal(), withoutSuffix); 15689 } 15690 15691 function to(time, withoutSuffix) { 15692 if ( 15693 this.isValid() && 15694 ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) 15695 ) { 15696 return createDuration({ from: this, to: time }) 15697 .locale(this.locale()) 15698 .humanize(!withoutSuffix); 15699 } else { 15700 return this.localeData().invalidDate(); 15701 } 15702 } 15703 15704 function toNow(withoutSuffix) { 15705 return this.to(createLocal(), withoutSuffix); 15706 } 15707 15708 // If passed a locale key, it will set the locale for this 15709 // instance. Otherwise, it will return the locale configuration 15710 // variables for this instance. 15711 function locale(key) { 15712 var newLocaleData; 15713 15714 if (key === undefined) { 15715 return this._locale._abbr; 15716 } else { 15717 newLocaleData = getLocale(key); 15718 if (newLocaleData != null) { 15719 this._locale = newLocaleData; 15720 } 15721 return this; 15722 } 15723 } 15724 15725 var lang = deprecate( 15726 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', 15727 function (key) { 15728 if (key === undefined) { 15729 return this.localeData(); 15730 } else { 15731 return this.locale(key); 15732 } 15733 } 15734 ); 15735 15736 function localeData() { 15737 return this._locale; 15738 } 15739 15740 var MS_PER_SECOND = 1000, 15741 MS_PER_MINUTE = 60 * MS_PER_SECOND, 15742 MS_PER_HOUR = 60 * MS_PER_MINUTE, 15743 MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; 15744 15745 // actual modulo - handles negative numbers (for dates before 1970): 15746 function mod$1(dividend, divisor) { 15747 return ((dividend % divisor) + divisor) % divisor; 15748 } 15749 15750 function localStartOfDate(y, m, d) { 15751 // the date constructor remaps years 0-99 to 1900-1999 15752 if (y < 100 && y >= 0) { 15753 // preserve leap years using a full 400 year cycle, then reset 15754 return new Date(y + 400, m, d) - MS_PER_400_YEARS; 15755 } else { 15756 return new Date(y, m, d).valueOf(); 15757 } 15758 } 15759 15760 function utcStartOfDate(y, m, d) { 15761 // Date.UTC remaps years 0-99 to 1900-1999 15762 if (y < 100 && y >= 0) { 15763 // preserve leap years using a full 400 year cycle, then reset 15764 return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; 15765 } else { 15766 return Date.UTC(y, m, d); 15767 } 15768 } 15769 15770 function startOf(units) { 15771 var time, startOfDate; 15772 units = normalizeUnits(units); 15773 if (units === undefined || units === 'millisecond' || !this.isValid()) { 15774 return this; 15775 } 15776 15777 startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; 15778 15779 switch (units) { 15780 case 'year': 15781 time = startOfDate(this.year(), 0, 1); 15782 break; 15783 case 'quarter': 15784 time = startOfDate( 15785 this.year(), 15786 this.month() - (this.month() % 3), 15787 1 15788 ); 15789 break; 15790 case 'month': 15791 time = startOfDate(this.year(), this.month(), 1); 15792 break; 15793 case 'week': 15794 time = startOfDate( 15795 this.year(), 15796 this.month(), 15797 this.date() - this.weekday() 15798 ); 15799 break; 15800 case 'isoWeek': 15801 time = startOfDate( 15802 this.year(), 15803 this.month(), 15804 this.date() - (this.isoWeekday() - 1) 15805 ); 15806 break; 15807 case 'day': 15808 case 'date': 15809 time = startOfDate(this.year(), this.month(), this.date()); 15810 break; 15811 case 'hour': 15812 time = this._d.valueOf(); 15813 time -= mod$1( 15814 time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), 15815 MS_PER_HOUR 15816 ); 15817 break; 15818 case 'minute': 15819 time = this._d.valueOf(); 15820 time -= mod$1(time, MS_PER_MINUTE); 15821 break; 15822 case 'second': 15823 time = this._d.valueOf(); 15824 time -= mod$1(time, MS_PER_SECOND); 15825 break; 15826 } 15827 15828 this._d.setTime(time); 15829 hooks.updateOffset(this, true); 15830 return this; 15831 } 15832 15833 function endOf(units) { 15834 var time, startOfDate; 15835 units = normalizeUnits(units); 15836 if (units === undefined || units === 'millisecond' || !this.isValid()) { 15837 return this; 15838 } 15839 15840 startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; 15841 15842 switch (units) { 15843 case 'year': 15844 time = startOfDate(this.year() + 1, 0, 1) - 1; 15845 break; 15846 case 'quarter': 15847 time = 15848 startOfDate( 15849 this.year(), 15850 this.month() - (this.month() % 3) + 3, 15851 1 15852 ) - 1; 15853 break; 15854 case 'month': 15855 time = startOfDate(this.year(), this.month() + 1, 1) - 1; 15856 break; 15857 case 'week': 15858 time = 15859 startOfDate( 15860 this.year(), 15861 this.month(), 15862 this.date() - this.weekday() + 7 15863 ) - 1; 15864 break; 15865 case 'isoWeek': 15866 time = 15867 startOfDate( 15868 this.year(), 15869 this.month(), 15870 this.date() - (this.isoWeekday() - 1) + 7 15871 ) - 1; 15872 break; 15873 case 'day': 15874 case 'date': 15875 time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; 15876 break; 15877 case 'hour': 15878 time = this._d.valueOf(); 15879 time += 15880 MS_PER_HOUR - 15881 mod$1( 15882 time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), 15883 MS_PER_HOUR 15884 ) - 15885 1; 15886 break; 15887 case 'minute': 15888 time = this._d.valueOf(); 15889 time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; 15890 break; 15891 case 'second': 15892 time = this._d.valueOf(); 15893 time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; 15894 break; 15895 } 15896 15897 this._d.setTime(time); 15898 hooks.updateOffset(this, true); 15899 return this; 15900 } 15901 15902 function valueOf() { 15903 return this._d.valueOf() - (this._offset || 0) * 60000; 15904 } 15905 15906 function unix() { 15907 return Math.floor(this.valueOf() / 1000); 15908 } 15909 15910 function toDate() { 15911 return new Date(this.valueOf()); 15912 } 15913 15914 function toArray() { 15915 var m = this; 15916 return [ 15917 m.year(), 15918 m.month(), 15919 m.date(), 15920 m.hour(), 15921 m.minute(), 15922 m.second(), 15923 m.millisecond(), 15924 ]; 15925 } 15926 15927 function toObject() { 15928 var m = this; 15929 return { 15930 years: m.year(), 15931 months: m.month(), 15932 date: m.date(), 15933 hours: m.hours(), 15934 minutes: m.minutes(), 15935 seconds: m.seconds(), 15936 milliseconds: m.milliseconds(), 15937 }; 15938 } 15939 15940 function toJSON() { 15941 // new Date(NaN).toJSON() === null 15942 return this.isValid() ? this.toISOString() : null; 15943 } 15944 15945 function isValid$2() { 15946 return isValid(this); 15947 } 15948 15949 function parsingFlags() { 15950 return extend({}, getParsingFlags(this)); 15951 } 15952 15953 function invalidAt() { 15954 return getParsingFlags(this).overflow; 15955 } 15956 15957 function creationData() { 15958 return { 15959 input: this._i, 15960 format: this._f, 15961 locale: this._locale, 15962 isUTC: this._isUTC, 15963 strict: this._strict, 15964 }; 15965 } 15966 15967 addFormatToken('N', 0, 0, 'eraAbbr'); 15968 addFormatToken('NN', 0, 0, 'eraAbbr'); 15969 addFormatToken('NNN', 0, 0, 'eraAbbr'); 15970 addFormatToken('NNNN', 0, 0, 'eraName'); 15971 addFormatToken('NNNNN', 0, 0, 'eraNarrow'); 15972 15973 addFormatToken('y', ['y', 1], 'yo', 'eraYear'); 15974 addFormatToken('y', ['yy', 2], 0, 'eraYear'); 15975 addFormatToken('y', ['yyy', 3], 0, 'eraYear'); 15976 addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); 15977 15978 addRegexToken('N', matchEraAbbr); 15979 addRegexToken('NN', matchEraAbbr); 15980 addRegexToken('NNN', matchEraAbbr); 15981 addRegexToken('NNNN', matchEraName); 15982 addRegexToken('NNNNN', matchEraNarrow); 15983 15984 addParseToken(
vendor: 8,145 bytes, lines 15984-16259
15984 15985 ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], 15986 function (input, array, config, token) { 15987 var era = config._locale.erasParse(input, token, config._strict); 15988 if (era) { 15989 getParsingFlags(config).era = era; 15990 } else { 15991 getParsingFlags(config).invalidEra = input; 15992 } 15993 } 15994 ); 15995 15996 addRegexToken('y', matchUnsigned); 15997 addRegexToken('yy', matchUnsigned); 15998 addRegexToken('yyy', matchUnsigned); 15999 addRegexToken('yyyy', matchUnsigned); 16000 addRegexToken('yo', matchEraYearOrdinal); 16001 16002 addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); 16003 addParseToken(['yo'], function (input, array, config, token) { 16004 var match; 16005 if (config._locale._eraYearOrdinalRegex) { 16006 match = input.match(config._locale._eraYearOrdinalRegex); 16007 } 16008 16009 if (config._locale.eraYearOrdinalParse) { 16010 array[YEAR] = config._locale.eraYearOrdinalParse(input, match); 16011 } else { 16012 array[YEAR] = parseInt(input, 10); 16013 } 16014 }); 16015 16016 function localeEras(m, format) { 16017 var i, 16018 l, 16019 date, 16020 eras = this._eras || getLocale('en')._eras; 16021 for (i = 0, l = eras.length; i < l; ++i) { 16022 switch (typeof eras[i].since) { 16023 case 'string': 16024 // truncate time 16025 date = hooks(eras[i].since).startOf('day'); 16026 eras[i].since = date.valueOf(); 16027 break; 16028 } 16029 16030 switch (typeof eras[i].until) { 16031 case 'undefined': 16032 eras[i].until = +Infinity; 16033 break; 16034 case 'string': 16035 // truncate time 16036 date = hooks(eras[i].until).startOf('day').valueOf(); 16037 eras[i].until = date.valueOf(); 16038 break; 16039 } 16040 } 16041 return eras; 16042 } 16043 16044 function localeErasParse(eraName, format, strict) { 16045 var i, 16046 l, 16047 eras = this.eras(), 16048 name, 16049 abbr, 16050 narrow; 16051 eraName = eraName.toUpperCase(); 16052 16053 for (i = 0, l = eras.length; i < l; ++i) { 16054 name = eras[i].name.toUpperCase(); 16055 abbr = eras[i].abbr.toUpperCase(); 16056 narrow = eras[i].narrow.toUpperCase(); 16057 16058 if (strict) { 16059 switch (format) { 16060 case 'N': 16061 case 'NN': 16062 case 'NNN': 16063 if (abbr === eraName) { 16064 return eras[i]; 16065 } 16066 break; 16067 16068 case 'NNNN': 16069 if (name === eraName) { 16070 return eras[i]; 16071 } 16072 break; 16073 16074 case 'NNNNN': 16075 if (narrow === eraName) { 16076 return eras[i]; 16077 } 16078 break; 16079 } 16080 } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { 16081 return eras[i]; 16082 } 16083 } 16084 } 16085 16086 function localeErasConvertYear(era, year) { 16087 var dir = era.since <= era.until ? +1 : -1; 16088 if (year === undefined) { 16089 return hooks(era.since).year(); 16090 } else { 16091 return hooks(era.since).year() + (year - era.offset) * dir; 16092 } 16093 } 16094 16095 function getEraName() { 16096 var i, 16097 l, 16098 val, 16099 eras = this.localeData().eras(); 16100 for (i = 0, l = eras.length; i < l; ++i) { 16101 // truncate time 16102 val = this.clone().startOf('day').valueOf(); 16103 16104 if (eras[i].since <= val && val <= eras[i].until) { 16105 return eras[i].name; 16106 } 16107 if (eras[i].until <= val && val <= eras[i].since) { 16108 return eras[i].name; 16109 } 16110 } 16111 16112 return ''; 16113 } 16114 16115 function getEraNarrow() { 16116 var i, 16117 l, 16118 val, 16119 eras = this.localeData().eras(); 16120 for (i = 0, l = eras.length; i < l; ++i) { 16121 // truncate time 16122 val = this.clone().startOf('day').valueOf(); 16123 16124 if (eras[i].since <= val && val <= eras[i].until) { 16125 return eras[i].narrow; 16126 } 16127 if (eras[i].until <= val && val <= eras[i].since) { 16128 return eras[i].narrow; 16129 } 16130 } 16131 16132 return ''; 16133 } 16134 16135 function getEraAbbr() { 16136 var i, 16137 l, 16138 val, 16139 eras = this.localeData().eras(); 16140 for (i = 0, l = eras.length; i < l; ++i) { 16141 // truncate time 16142 val = this.clone().startOf('day').valueOf(); 16143 16144 if (eras[i].since <= val && val <= eras[i].until) { 16145 return eras[i].abbr; 16146 } 16147 if (eras[i].until <= val && val <= eras[i].since) { 16148 return eras[i].abbr; 16149 } 16150 } 16151 16152 return ''; 16153 } 16154 16155 function getEraYear() { 16156 var i, 16157 l, 16158 dir, 16159 val, 16160 eras = this.localeData().eras(); 16161 for (i = 0, l = eras.length; i < l; ++i) { 16162 dir = eras[i].since <= eras[i].until ? +1 : -1; 16163 16164 // truncate time 16165 val = this.clone().startOf('day').valueOf(); 16166 16167 if ( 16168 (eras[i].since <= val && val <= eras[i].until) || 16169 (eras[i].until <= val && val <= eras[i].since) 16170 ) { 16171 return ( 16172 (this.year() - hooks(eras[i].since).year()) * dir + 16173 eras[i].offset 16174 ); 16175 } 16176 } 16177 16178 return this.year(); 16179 } 16180 16181 function erasNameRegex(isStrict) { 16182 if (!hasOwnProp(this, '_erasNameRegex')) { 16183 computeErasParse.call(this); 16184 } 16185 return isStrict ? this._erasNameRegex : this._erasRegex; 16186 } 16187 16188 function erasAbbrRegex(isStrict) { 16189 if (!hasOwnProp(this, '_erasAbbrRegex')) { 16190 computeErasParse.call(this); 16191 } 16192 return isStrict ? this._erasAbbrRegex : this._erasRegex; 16193 } 16194 16195 function erasNarrowRegex(isStrict) { 16196 if (!hasOwnProp(this, '_erasNarrowRegex')) { 16197 computeErasParse.call(this); 16198 } 16199 return isStrict ? this._erasNarrowRegex : this._erasRegex; 16200 } 16201 16202 function matchEraAbbr(isStrict, locale) { 16203 return locale.erasAbbrRegex(isStrict); 16204 } 16205 16206 function matchEraName(isStrict, locale) { 16207 return locale.erasNameRegex(isStrict); 16208 } 16209 16210 function matchEraNarrow(isStrict, locale) { 16211 return locale.erasNarrowRegex(isStrict); 16212 } 16213 16214 function matchEraYearOrdinal(isStrict, locale) { 16215 return locale._eraYearOrdinalRegex || matchUnsigned; 16216 } 16217 16218 function computeErasParse() { 16219 var abbrPieces = [], 16220 namePieces = [], 16221 narrowPieces = [], 16222 mixedPieces = [], 16223 i, 16224 l, 16225 eras = this.eras(); 16226 16227 for (i = 0, l = eras.length; i < l; ++i) { 16228 namePieces.push(regexEscape(eras[i].name)); 16229 abbrPieces.push(regexEscape(eras[i].abbr)); 16230 narrowPieces.push(regexEscape(eras[i].narrow)); 16231 16232 mixedPieces.push(regexEscape(eras[i].name)); 16233 mixedPieces.push(regexEscape(eras[i].abbr)); 16234 mixedPieces.push(regexEscape(eras[i].narrow)); 16235 } 16236 16237 this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 16238 this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); 16239 this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); 16240 this._erasNarrowRegex = new RegExp( 16241 '^(' + narrowPieces.join('|') + ')', 16242 'i' 16243 ); 16244 } 16245 16246 // FORMATTING 16247 16248 addFormatToken(0, ['gg', 2], 0, function () { 16249 return this.weekYear() % 100; 16250 }); 16251 16252 addFormatToken(0, ['GG', 2], 0, function () { 16253 return this.isoWeekYear() % 100; 16254 }); 16255 16256 function addWeekYearFormatToken(token, getter) { 16257 addFormatToken(0, [token, token.length], 0, getter); 16258 } 16259
16260 addWeekYearFormatToken('gggg', 'weekYear'); 16261 addWeekYearFormatToken('ggggg', 'weekYear'); 16262 addWeekYearFormatToken('GGGG', 'isoWeekYear'); 16263 addWeekYearFormatToken('GGGGG', 'isoWeekYear'); 16264 16265 // ALIASES 16266 16267 addUnitAlias('weekYear', 'gg'); 16268 addUnitAlias('isoWeekYear', 'GG'); 16269 16270 // PRIORITY 16271 16272 addUnitPriority('weekYear', 1); 16273 addUnitPriority('isoWeekYear', 1); 16274 16275 // PARSING 16276 16277 addRegexToken('G', matchSigned); 16278 addRegexToken('g', matchSigned); 16279 addRegexToken('GG', match1to2, match2); 16280 addRegexToken('gg', match1to2, match2); 16281 addRegexToken('GGGG', match1to4, match4); 16282 addRegexToken('gggg', match1to4, match4); 16283 addRegexToken('GGGGG', match1to6, match6); 16284 addRegexToken('ggggg', match1to6, match6); 16285 16286 addWeekParseToken( 16287 ['gggg', 'ggggg', 'GGGG', 'GGGGG'], 16288 function (input, week, config, token) { 16289 week[token.substr(0, 2)] = toInt(input); 16290 } 16291
vendor: 29,543 bytes, lines 16291-17314
16291); 16292 16293 addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { 16294 week[token] = hooks.parseTwoDigitYear(input); 16295 }); 16296 16297 // MOMENTS 16298 16299 function getSetWeekYear(input) { 16300 return getSetWeekYearHelper.call( 16301 this, 16302 input, 16303 this.week(), 16304 this.weekday(), 16305 this.localeData()._week.dow, 16306 this.localeData()._week.doy 16307 ); 16308 } 16309 16310 function getSetISOWeekYear(input) { 16311 return getSetWeekYearHelper.call( 16312 this, 16313 input, 16314 this.isoWeek(), 16315 this.isoWeekday(), 16316 1, 16317 4 16318 ); 16319 } 16320 16321 function getISOWeeksInYear() { 16322 return weeksInYear(this.year(), 1, 4); 16323 } 16324 16325 function getISOWeeksInISOWeekYear() { 16326 return weeksInYear(this.isoWeekYear(), 1, 4); 16327 } 16328 16329 function getWeeksInYear() { 16330 var weekInfo = this.localeData()._week; 16331 return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); 16332 } 16333 16334 function getWeeksInWeekYear() { 16335 var weekInfo = this.localeData()._week; 16336 return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); 16337 } 16338 16339 function getSetWeekYearHelper(input, week, weekday, dow, doy) { 16340 var weeksTarget; 16341 if (input == null) { 16342 return weekOfYear(this, dow, doy).year; 16343 } else { 16344 weeksTarget = weeksInYear(input, dow, doy); 16345 if (week > weeksTarget) { 16346 week = weeksTarget; 16347 } 16348 return setWeekAll.call(this, input, week, weekday, dow, doy); 16349 } 16350 } 16351 16352 function setWeekAll(weekYear, week, weekday, dow, doy) { 16353 var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), 16354 date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); 16355 16356 this.year(date.getUTCFullYear()); 16357 this.month(date.getUTCMonth()); 16358 this.date(date.getUTCDate()); 16359 return this; 16360 } 16361 16362 // FORMATTING 16363 16364 addFormatToken('Q', 0, 'Qo', 'quarter'); 16365 16366 // ALIASES 16367 16368 addUnitAlias('quarter', 'Q'); 16369 16370 // PRIORITY 16371 16372 addUnitPriority('quarter', 7); 16373 16374 // PARSING 16375 16376 addRegexToken('Q', match1); 16377 addParseToken('Q', function (input, array) { 16378 array[MONTH] = (toInt(input) - 1) * 3; 16379 }); 16380 16381 // MOMENTS 16382 16383 function getSetQuarter(input) { 16384 return input == null 16385 ? Math.ceil((this.month() + 1) / 3) 16386 : this.month((input - 1) * 3 + (this.month() % 3)); 16387 } 16388 16389 // FORMATTING 16390 16391 addFormatToken('D', ['DD', 2], 'Do', 'date'); 16392 16393 // ALIASES 16394 16395 addUnitAlias('date', 'D'); 16396 16397 // PRIORITY 16398 addUnitPriority('date', 9); 16399 16400 // PARSING 16401 16402 addRegexToken('D', match1to2); 16403 addRegexToken('DD', match1to2, match2); 16404 addRegexToken('Do', function (isStrict, locale) { 16405 // TODO: Remove "ordinalParse" fallback in next major release. 16406 return isStrict 16407 ? locale._dayOfMonthOrdinalParse || locale._ordinalParse 16408 : locale._dayOfMonthOrdinalParseLenient; 16409 }); 16410 16411 addParseToken(['D', 'DD'], DATE); 16412 addParseToken('Do', function (input, array) { 16413 array[DATE] = toInt(input.match(match1to2)[0]); 16414 }); 16415 16416 // MOMENTS 16417 16418 var getSetDayOfMonth = makeGetSet('Date', true); 16419 16420 // FORMATTING 16421 16422 addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); 16423 16424 // ALIASES 16425 16426 addUnitAlias('dayOfYear', 'DDD'); 16427 16428 // PRIORITY 16429 addUnitPriority('dayOfYear', 4); 16430 16431 // PARSING 16432 16433 addRegexToken('DDD', match1to3); 16434 addRegexToken('DDDD', match3); 16435 addParseToken(['DDD', 'DDDD'], function (input, array, config) { 16436 config._dayOfYear = toInt(input); 16437 }); 16438 16439 // HELPERS 16440 16441 // MOMENTS 16442 16443 function getSetDayOfYear(input) { 16444 var dayOfYear = 16445 Math.round( 16446 (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 16447 ) + 1; 16448 return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); 16449 } 16450 16451 // FORMATTING 16452 16453 addFormatToken('m', ['mm', 2], 0, 'minute'); 16454 16455 // ALIASES 16456 16457 addUnitAlias('minute', 'm'); 16458 16459 // PRIORITY 16460 16461 addUnitPriority('minute', 14); 16462 16463 // PARSING 16464 16465 addRegexToken('m', match1to2); 16466 addRegexToken('mm', match1to2, match2); 16467 addParseToken(['m', 'mm'], MINUTE); 16468 16469 // MOMENTS 16470 16471 var getSetMinute = makeGetSet('Minutes', false); 16472 16473 // FORMATTING 16474 16475 addFormatToken('s', ['ss', 2], 0, 'second'); 16476 16477 // ALIASES 16478 16479 addUnitAlias('second', 's'); 16480 16481 // PRIORITY 16482 16483 addUnitPriority('second', 15); 16484 16485 // PARSING 16486 16487 addRegexToken('s', match1to2); 16488 addRegexToken('ss', match1to2, match2); 16489 addParseToken(['s', 'ss'], SECOND); 16490 16491 // MOMENTS 16492 16493 var getSetSecond = makeGetSet('Seconds', false); 16494 16495 // FORMATTING 16496 16497 addFormatToken('S', 0, 0, function () { 16498 return ~~(this.millisecond() / 100); 16499 }); 16500 16501 addFormatToken(0, ['SS', 2], 0, function () { 16502 return ~~(this.millisecond() / 10); 16503 }); 16504 16505 addFormatToken(0, ['SSS', 3], 0, 'millisecond'); 16506 addFormatToken(0, ['SSSS', 4], 0, function () { 16507 return this.millisecond() * 10; 16508 }); 16509 addFormatToken(0, ['SSSSS', 5], 0, function () { 16510 return this.millisecond() * 100; 16511 }); 16512 addFormatToken(0, ['SSSSSS', 6], 0, function () { 16513 return this.millisecond() * 1000; 16514 }); 16515 addFormatToken(0, ['SSSSSSS', 7], 0, function () { 16516 return this.millisecond() * 10000; 16517 }); 16518 addFormatToken(0, ['SSSSSSSS', 8], 0, function () { 16519 return this.millisecond() * 100000; 16520 }); 16521 addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { 16522 return this.millisecond() * 1000000; 16523 }); 16524 16525 // ALIASES 16526 16527 addUnitAlias('millisecond', 'ms'); 16528 16529 // PRIORITY 16530 16531 addUnitPriority('millisecond', 16); 16532 16533 // PARSING 16534 16535 addRegexToken('S', match1to3, match1); 16536 addRegexToken('SS', match1to3, match2); 16537 addRegexToken('SSS', match1to3, match3); 16538 16539 var token, getSetMillisecond; 16540 for (token = 'SSSS'; token.length <= 9; token += 'S') { 16541 addRegexToken(token, matchUnsigned); 16542 } 16543 16544 function parseMs(input, array) { 16545 array[MILLISECOND] = toInt(('0.' + input) * 1000); 16546 } 16547 16548 for (token = 'S'; token.length <= 9; token += 'S') { 16549 addParseToken(token, parseMs); 16550 } 16551 16552 getSetMillisecond = makeGetSet('Milliseconds', false); 16553 16554 // FORMATTING 16555 16556 addFormatToken('z', 0, 0, 'zoneAbbr'); 16557 addFormatToken('zz', 0, 0, 'zoneName'); 16558 16559 // MOMENTS 16560 16561 function getZoneAbbr() { 16562 return this._isUTC ? 'UTC' : ''; 16563 } 16564 16565 function getZoneName() { 16566 return this._isUTC ? 'Coordinated Universal Time' : ''; 16567 } 16568 16569 var proto = Moment.prototype; 16570 16571 proto.add = add; 16572 proto.calendar = calendar$1; 16573 proto.clone = clone; 16574 proto.diff = diff; 16575 proto.endOf = endOf; 16576 proto.format = format; 16577 proto.from = from; 16578 proto.fromNow = fromNow; 16579 proto.to = to; 16580 proto.toNow = toNow; 16581 proto.get = stringGet; 16582 proto.invalidAt = invalidAt; 16583 proto.isAfter = isAfter; 16584 proto.isBefore = isBefore; 16585 proto.isBetween = isBetween; 16586 proto.isSame = isSame; 16587 proto.isSameOrAfter = isSameOrAfter; 16588 proto.isSameOrBefore = isSameOrBefore; 16589 proto.isValid = isValid$2; 16590 proto.lang = lang; 16591 proto.locale = locale; 16592 proto.localeData = localeData; 16593 proto.max = prototypeMax; 16594 proto.min = prototypeMin; 16595 proto.parsingFlags = parsingFlags; 16596 proto.set = stringSet; 16597 proto.startOf = startOf; 16598 proto.subtract = subtract; 16599 proto.toArray = toArray; 16600 proto.toObject = toObject; 16601 proto.toDate = toDate; 16602 proto.toISOString = toISOString; 16603 proto.inspect = inspect; 16604 if (typeof Symbol !== 'undefined' && Symbol.for != null) { 16605 proto[Symbol.for('nodejs.util.inspect.custom')] = function () { 16606 return 'Moment<' + this.format() + '>'; 16607 }; 16608 } 16609 proto.toJSON = toJSON; 16610 proto.toString = toString; 16611 proto.unix = unix; 16612 proto.valueOf = valueOf; 16613 proto.creationData = creationData; 16614 proto.eraName = getEraName; 16615 proto.eraNarrow = getEraNarrow; 16616 proto.eraAbbr = getEraAbbr; 16617 proto.eraYear = getEraYear; 16618 proto.year = getSetYear; 16619 proto.isLeapYear = getIsLeapYear; 16620 proto.weekYear = getSetWeekYear; 16621 proto.isoWeekYear = getSetISOWeekYear; 16622 proto.quarter = proto.quarters = getSetQuarter; 16623 proto.month = getSetMonth; 16624 proto.daysInMonth = getDaysInMonth; 16625 proto.week = proto.weeks = getSetWeek; 16626 proto.isoWeek = proto.isoWeeks = getSetISOWeek; 16627 proto.weeksInYear = getWeeksInYear; 16628 proto.weeksInWeekYear = getWeeksInWeekYear; 16629 proto.isoWeeksInYear = getISOWeeksInYear; 16630 proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; 16631 proto.date = getSetDayOfMonth; 16632 proto.day = proto.days = getSetDayOfWeek; 16633 proto.weekday = getSetLocaleDayOfWeek; 16634 proto.isoWeekday = getSetISODayOfWeek; 16635 proto.dayOfYear = getSetDayOfYear; 16636 proto.hour = proto.hours = getSetHour; 16637 proto.minute = proto.minutes = getSetMinute; 16638 proto.second = proto.seconds = getSetSecond; 16639 proto.millisecond = proto.milliseconds = getSetMillisecond; 16640 proto.utcOffset = getSetOffset; 16641 proto.utc = setOffsetToUTC; 16642 proto.local = setOffsetToLocal; 16643 proto.parseZone = setOffsetToParsedOffset; 16644 proto.hasAlignedHourOffset = hasAlignedHourOffset; 16645 proto.isDST = isDaylightSavingTime; 16646 proto.isLocal = isLocal; 16647 proto.isUtcOffset = isUtcOffset; 16648 proto.isUtc = isUtc; 16649 proto.isUTC = isUtc; 16650 proto.zoneAbbr = getZoneAbbr; 16651 proto.zoneName = getZoneName; 16652 proto.dates = deprecate( 16653 'dates accessor is deprecated. Use date instead.', 16654 getSetDayOfMonth 16655 ); 16656 proto.months = deprecate( 16657 'months accessor is deprecated. Use month instead', 16658 getSetMonth 16659 ); 16660 proto.years = deprecate( 16661 'years accessor is deprecated. Use year instead', 16662 getSetYear 16663 ); 16664 proto.zone = deprecate( 16665 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', 16666 getSetZone 16667 ); 16668 proto.isDSTShifted = deprecate( 16669 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', 16670 isDaylightSavingTimeShifted 16671 ); 16672 16673 function createUnix(input) { 16674 return createLocal(input * 1000); 16675 } 16676 16677 function createInZone() { 16678 return createLocal.apply(null, arguments).parseZone(); 16679 } 16680 16681 function preParsePostFormat(string) { 16682 return string; 16683 } 16684 16685 var proto$1 = Locale.prototype; 16686 16687 proto$1.calendar = calendar; 16688 proto$1.longDateFormat = longDateFormat; 16689 proto$1.invalidDate = invalidDate; 16690 proto$1.ordinal = ordinal; 16691 proto$1.preparse = preParsePostFormat; 16692 proto$1.postformat = preParsePostFormat; 16693 proto$1.relativeTime = relativeTime; 16694 proto$1.pastFuture = pastFuture; 16695 proto$1.set = set; 16696 proto$1.eras = localeEras; 16697 proto$1.erasParse = localeErasParse; 16698 proto$1.erasConvertYear = localeErasConvertYear; 16699 proto$1.erasAbbrRegex = erasAbbrRegex; 16700 proto$1.erasNameRegex = erasNameRegex; 16701 proto$1.erasNarrowRegex = erasNarrowRegex; 16702 16703 proto$1.months = localeMonths; 16704 proto$1.monthsShort = localeMonthsShort; 16705 proto$1.monthsParse = localeMonthsParse; 16706 proto$1.monthsRegex = monthsRegex; 16707 proto$1.monthsShortRegex = monthsShortRegex; 16708 proto$1.week = localeWeek; 16709 proto$1.firstDayOfYear = localeFirstDayOfYear; 16710 proto$1.firstDayOfWeek = localeFirstDayOfWeek; 16711 16712 proto$1.weekdays = localeWeekdays; 16713 proto$1.weekdaysMin = localeWeekdaysMin; 16714 proto$1.weekdaysShort = localeWeekdaysShort; 16715 proto$1.weekdaysParse = localeWeekdaysParse; 16716 16717 proto$1.weekdaysRegex = weekdaysRegex; 16718 proto$1.weekdaysShortRegex = weekdaysShortRegex; 16719 proto$1.weekdaysMinRegex = weekdaysMinRegex; 16720 16721 proto$1.isPM = localeIsPM; 16722 proto$1.meridiem = localeMeridiem; 16723 16724 function get$1(format, index, field, setter) { 16725 var locale = getLocale(), 16726 utc = createUTC().set(setter, index); 16727 return locale[field](utc, format); 16728 } 16729 16730 function listMonthsImpl(format, index, field) { 16731 if (isNumber(format)) { 16732 index = format; 16733 format = undefined; 16734 } 16735 16736 format = format || ''; 16737 16738 if (index != null) { 16739 return get$1(format, index, field, 'month'); 16740 } 16741 16742 var i, 16743 out = []; 16744 for (i = 0; i < 12; i++) { 16745 out[i] = get$1(format, i, field, 'month'); 16746 } 16747 return out; 16748 } 16749 16750 // () 16751 // (5) 16752 // (fmt, 5) 16753 // (fmt) 16754 // (true) 16755 // (true, 5) 16756 // (true, fmt, 5) 16757 // (true, fmt) 16758 function listWeekdaysImpl(localeSorted, format, index, field) { 16759 if (typeof localeSorted === 'boolean') { 16760 if (isNumber(format)) { 16761 index = format; 16762 format = undefined; 16763 } 16764 16765 format = format || ''; 16766 } else { 16767 format = localeSorted; 16768 index = format; 16769 localeSorted = false; 16770 16771 if (isNumber(format)) { 16772 index = format; 16773 format = undefined; 16774 } 16775 16776 format = format || ''; 16777 } 16778 16779 var locale = getLocale(), 16780 shift = localeSorted ? locale._week.dow : 0, 16781 i, 16782 out = []; 16783 16784 if (index != null) { 16785 return get$1(format, (index + shift) % 7, field, 'day'); 16786 } 16787 16788 for (i = 0; i < 7; i++) { 16789 out[i] = get$1(format, (i + shift) % 7, field, 'day'); 16790 } 16791 return out; 16792 } 16793 16794 function listMonths(format, index) { 16795 return listMonthsImpl(format, index, 'months'); 16796 } 16797 16798 function listMonthsShort(format, index) { 16799 return listMonthsImpl(format, index, 'monthsShort'); 16800 } 16801 16802 function listWeekdays(localeSorted, format, index) { 16803 return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); 16804 } 16805 16806 function listWeekdaysShort(localeSorted, format, index) { 16807 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); 16808 } 16809 16810 function listWeekdaysMin(localeSorted, format, index) { 16811 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); 16812 } 16813 16814 getSetGlobalLocale('en', { 16815 eras: [ 16816 { 16817 since: '0001-01-01', 16818 until: +Infinity, 16819 offset: 1, 16820 name: 'Anno Domini', 16821 narrow: 'AD', 16822 abbr: 'AD', 16823 }, 16824 { 16825 since: '0000-12-31', 16826 until: -Infinity, 16827 offset: 1, 16828 name: 'Before Christ', 16829 narrow: 'BC', 16830 abbr: 'BC', 16831 }, 16832 ], 16833 dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, 16834 ordinal: function (number) { 16835 var b = number % 10, 16836 output = 16837 toInt((number % 100) / 10) === 1 16838 ? 'th' 16839 : b === 1 16840 ? 'st' 16841 : b === 2 16842 ? 'nd' 16843 : b === 3 16844 ? 'rd' 16845 : 'th'; 16846 return number + output; 16847 }, 16848 }); 16849 16850 // Side effect imports 16851 16852 hooks.lang = deprecate( 16853 'moment.lang is deprecated. Use moment.locale instead.', 16854 getSetGlobalLocale 16855 ); 16856 hooks.langData = deprecate( 16857 'moment.langData is deprecated. Use moment.localeData instead.', 16858 getLocale 16859 ); 16860 16861 var mathAbs = Math.abs; 16862 16863 function abs() { 16864 var data = this._data; 16865 16866 this._milliseconds = mathAbs(this._milliseconds); 16867 this._days = mathAbs(this._days); 16868 this._months = mathAbs(this._months); 16869 16870 data.milliseconds = mathAbs(data.milliseconds); 16871 data.seconds = mathAbs(data.seconds); 16872 data.minutes = mathAbs(data.minutes); 16873 data.hours = mathAbs(data.hours); 16874 data.months = mathAbs(data.months); 16875 data.years = mathAbs(data.years); 16876 16877 return this; 16878 } 16879 16880 function addSubtract$1(duration, input, value, direction) { 16881 var other = createDuration(input, value); 16882 16883 duration._milliseconds += direction * other._milliseconds; 16884 duration._days += direction * other._days; 16885 duration._months += direction * other._months; 16886 16887 return duration._bubble(); 16888 } 16889 16890 // supports only 2.0-style add(1, 's') or add(duration) 16891 function add$1(input, value) { 16892 return addSubtract$1(this, input, value, 1); 16893 } 16894 16895 // supports only 2.0-style subtract(1, 's') or subtract(duration) 16896 function subtract$1(input, value) { 16897 return addSubtract$1(this, input, value, -1); 16898 } 16899 16900 function absCeil(number) { 16901 if (number < 0) { 16902 return Math.floor(number); 16903 } else { 16904 return Math.ceil(number); 16905 } 16906 } 16907 16908 function bubble() { 16909 var milliseconds = this._milliseconds, 16910 days = this._days, 16911 months = this._months, 16912 data = this._data, 16913 seconds, 16914 minutes, 16915 hours, 16916 years, 16917 monthsFromDays; 16918 16919 // if we have a mix of positive and negative values, bubble down first 16920 // check: https://github.com/moment/moment/issues/2166 16921 if ( 16922 !( 16923 (milliseconds >= 0 && days >= 0 && months >= 0) || 16924 (milliseconds <= 0 && days <= 0 && months <= 0) 16925 ) 16926 ) { 16927 milliseconds += absCeil(monthsToDays(months) + days) * 864e5; 16928 days = 0; 16929 months = 0; 16930 } 16931 16932 // The following code bubbles up values, see the tests for 16933 // examples of what that means. 16934 data.milliseconds = milliseconds % 1000; 16935 16936 seconds = absFloor(milliseconds / 1000); 16937 data.seconds = seconds % 60; 16938 16939 minutes = absFloor(seconds / 60); 16940 data.minutes = minutes % 60; 16941 16942 hours = absFloor(minutes / 60); 16943 data.hours = hours % 24; 16944 16945 days += absFloor(hours / 24); 16946 16947 // convert days to months 16948 monthsFromDays = absFloor(daysToMonths(days)); 16949 months += monthsFromDays; 16950 days -= absCeil(monthsToDays(monthsFromDays)); 16951 16952 // 12 months -> 1 year 16953 years = absFloor(months / 12); 16954 months %= 12; 16955 16956 data.days = days; 16957 data.months = months; 16958 data.years = years; 16959 16960 return this; 16961 } 16962 16963 function daysToMonths(days) { 16964 // 400 years have 146097 days (taking into account leap year rules) 16965 // 400 years have 12 months === 4800 16966 return (days * 4800) / 146097; 16967 } 16968 16969 function monthsToDays(months) { 16970 // the reverse of daysToMonths 16971 return (months * 146097) / 4800; 16972 } 16973 16974 function as(units) { 16975 if (!this.isValid()) { 16976 return NaN; 16977 } 16978 var days, 16979 months, 16980 milliseconds = this._milliseconds; 16981 16982 units = normalizeUnits(units); 16983 16984 if (units === 'month' || units === 'quarter' || units === 'year') { 16985 days = this._days + milliseconds / 864e5; 16986 months = this._months + daysToMonths(days); 16987 switch (units) { 16988 case 'month': 16989 return months; 16990 case 'quarter': 16991 return months / 3; 16992 case 'year': 16993 return months / 12; 16994 } 16995 } else { 16996 // handle milliseconds separately because of floating point math errors (issue #1867) 16997 days = this._days + Math.round(monthsToDays(this._months)); 16998 switch (units) { 16999 case 'week': 17000 return days / 7 + milliseconds / 6048e5; 17001 case 'day': 17002 return days + milliseconds / 864e5; 17003 case 'hour': 17004 return days * 24 + milliseconds / 36e5; 17005 case 'minute': 17006 return days * 1440 + milliseconds / 6e4; 17007 case 'second': 17008 return days * 86400 + milliseconds / 1000; 17009 // Math.floor prevents floating point math errors here 17010 case 'millisecond': 17011 return Math.floor(days * 864e5) + milliseconds; 17012 default: 17013 throw new Error('Unknown unit ' + units); 17014 } 17015 } 17016 } 17017 17018 // TODO: Use this.as('ms')? 17019 function valueOf$1() { 17020 if (!this.isValid()) { 17021 return NaN; 17022 } 17023 return ( 17024 this._milliseconds + 17025 this._days * 864e5 + 17026 (this._months % 12) * 2592e6 + 17027 toInt(this._months / 12) * 31536e6 17028 ); 17029 } 17030 17031 function makeAs(alias) { 17032 return function () { 17033 return this.as(alias); 17034 }; 17035 } 17036 17037 var asMilliseconds = makeAs('ms'), 17038 asSeconds = makeAs('s'), 17039 asMinutes = makeAs('m'), 17040 asHours = makeAs('h'), 17041 asDays = makeAs('d'), 17042 asWeeks = makeAs('w'), 17043 asMonths = makeAs('M'), 17044 asQuarters = makeAs('Q'), 17045 asYears = makeAs('y'); 17046 17047 function clone$1() { 17048 return createDuration(this); 17049 } 17050 17051 function get$2(units) { 17052 units = normalizeUnits(units); 17053 return this.isValid() ? this[units + 's']() : NaN; 17054 } 17055 17056 function makeGetter(name) { 17057 return function () { 17058 return this.isValid() ? this._data[name] : NaN; 17059 }; 17060 } 17061 17062 var milliseconds = makeGetter('milliseconds'), 17063 seconds = makeGetter('seconds'), 17064 minutes = makeGetter('minutes'), 17065 hours = makeGetter('hours'), 17066 days = makeGetter('days'), 17067 months = makeGetter('months'), 17068 years = makeGetter('years'); 17069 17070 function weeks() { 17071 return absFloor(this.days() / 7); 17072 } 17073 17074 var round = Math.round, 17075 thresholds = { 17076 ss: 44, // a few seconds to seconds 17077 s: 45, // seconds to minute 17078 m: 45, // minutes to hour 17079 h: 22, // hours to day 17080 d: 26, // days to month/week 17081 w: null, // weeks to month 17082 M: 11, // months to year 17083 }; 17084 17085 // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize 17086 function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { 17087 return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); 17088 } 17089 17090 function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { 17091 var duration = createDuration(posNegDuration).abs(), 17092 seconds = round(duration.as('s')), 17093 minutes = round(duration.as('m')), 17094 hours = round(duration.as('h')), 17095 days = round(duration.as('d')), 17096 months = round(duration.as('M')), 17097 weeks = round(duration.as('w')), 17098 years = round(duration.as('y')), 17099 a = 17100 (seconds <= thresholds.ss && ['s', seconds]) || 17101 (seconds < thresholds.s && ['ss', seconds]) || 17102 (minutes <= 1 && ['m']) || 17103 (minutes < thresholds.m && ['mm', minutes]) || 17104 (hours <= 1 && ['h']) || 17105 (hours < thresholds.h && ['hh', hours]) || 17106 (days <= 1 && ['d']) || 17107 (days < thresholds.d && ['dd', days]); 17108 17109 if (thresholds.w != null) { 17110 a = 17111 a || 17112 (weeks <= 1 && ['w']) || 17113 (weeks < thresholds.w && ['ww', weeks]); 17114 } 17115 a = a || 17116 (months <= 1 && ['M']) || 17117 (months < thresholds.M && ['MM', months]) || 17118 (years <= 1 && ['y']) || ['yy', years]; 17119 17120 a[2] = withoutSuffix; 17121 a[3] = +posNegDuration > 0; 17122 a[4] = locale; 17123 return substituteTimeAgo.apply(null, a); 17124 } 17125 17126 // This function allows you to set the rounding function for relative time strings 17127 function getSetRelativeTimeRounding(roundingFunction) { 17128 if (roundingFunction === undefined) { 17129 return round; 17130 } 17131 if (typeof roundingFunction === 'function') { 17132 round = roundingFunction; 17133 return true; 17134 } 17135 return false; 17136 } 17137 17138 // This function allows you to set a threshold for relative time strings 17139 function getSetRelativeTimeThreshold(threshold, limit) { 17140 if (thresholds[threshold] === undefined) { 17141 return false; 17142 } 17143 if (limit === undefined) { 17144 return thresholds[threshold]; 17145 } 17146 thresholds[threshold] = limit; 17147 if (threshold === 's') { 17148 thresholds.ss = limit - 1; 17149 } 17150 return true; 17151 } 17152 17153 function humanize(argWithSuffix, argThresholds) { 17154 if (!this.isValid()) { 17155 return this.localeData().invalidDate(); 17156 } 17157 17158 var withSuffix = false, 17159 th = thresholds, 17160 locale, 17161 output; 17162 17163 if (typeof argWithSuffix === 'object') { 17164 argThresholds = argWithSuffix; 17165 argWithSuffix = false; 17166 } 17167 if (typeof argWithSuffix === 'boolean') { 17168 withSuffix = argWithSuffix; 17169 } 17170 if (typeof argThresholds === 'object') { 17171 th = Object.assign({}, thresholds, argThresholds); 17172 if (argThresholds.s != null && argThresholds.ss == null) { 17173 th.ss = argThresholds.s - 1; 17174 } 17175 } 17176 17177 locale = this.localeData(); 17178 output = relativeTime$1(this, !withSuffix, th, locale); 17179 17180 if (withSuffix) { 17181 output = locale.pastFuture(+this, output); 17182 } 17183 17184 return locale.postformat(output); 17185 } 17186 17187 var abs$1 = Math.abs; 17188 17189 function sign(x) { 17190 return (x > 0) - (x < 0) || +x; 17191 } 17192 17193 function toISOString$1() { 17194 // for ISO strings we do not use the normal bubbling rules: 17195 // * milliseconds bubble up until they become hours 17196 // * days do not bubble at all 17197 // * months bubble up until they become years 17198 // This is because there is no context-free conversion between hours and days 17199 // (think of clock changes) 17200 // and also not between days and months (28-31 days per month) 17201 if (!this.isValid()) { 17202 return this.localeData().invalidDate(); 17203 } 17204 17205 var seconds = abs$1(this._milliseconds) / 1000, 17206 days = abs$1(this._days), 17207 months = abs$1(this._months), 17208 minutes, 17209 hours, 17210 years, 17211 s, 17212 total = this.asSeconds(), 17213 totalSign, 17214 ymSign, 17215 daysSign, 17216 hmsSign; 17217 17218 if (!total) { 17219 // this is the same as C#'s (Noda) and python (isodate)... 17220 // but not other JS (goog.date) 17221 return 'P0D'; 17222 } 17223 17224 // 3600 seconds -> 60 minutes -> 1 hour 17225 minutes = absFloor(seconds / 60); 17226 hours = absFloor(minutes / 60); 17227 seconds %= 60; 17228 minutes %= 60; 17229 17230 // 12 months -> 1 year 17231 years = absFloor(months / 12); 17232 months %= 12; 17233 17234 // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js 17235 s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; 17236 17237 totalSign = total < 0 ? '-' : ''; 17238 ymSign = sign(this._months) !== sign(total) ? '-' : ''; 17239 daysSign = sign(this._days) !== sign(total) ? '-' : ''; 17240 hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; 17241 17242 return ( 17243 totalSign + 17244 'P' + 17245 (years ? ymSign + years + 'Y' : '') + 17246 (months ? ymSign + months + 'M' : '') + 17247 (days ? daysSign + days + 'D' : '') + 17248 (hours || minutes || seconds ? 'T' : '') + 17249 (hours ? hmsSign + hours + 'H' : '') + 17250 (minutes ? hmsSign + minutes + 'M' : '') + 17251 (seconds ? hmsSign + s + 'S' : '') 17252 ); 17253 } 17254 17255 var proto$2 = Duration.prototype; 17256 17257 proto$2.isValid = isValid$1; 17258 proto$2.abs = abs; 17259 proto$2.add = add$1; 17260 proto$2.subtract = subtract$1; 17261 proto$2.as = as; 17262 proto$2.asMilliseconds = asMilliseconds; 17263 proto$2.asSeconds = asSeconds; 17264 proto$2.asMinutes = asMinutes; 17265 proto$2.asHours = asHours; 17266 proto$2.asDays = asDays; 17267 proto$2.asWeeks = asWeeks; 17268 proto$2.asMonths = asMonths; 17269 proto$2.asQuarters = asQuarters; 17270 proto$2.asYears = asYears; 17271 proto$2.valueOf = valueOf$1; 17272 proto$2._bubble = bubble; 17273 proto$2.clone = clone$1; 17274 proto$2.get = get$2; 17275 proto$2.milliseconds = milliseconds; 17276 proto$2.seconds = seconds; 17277 proto$2.minutes = minutes; 17278 proto$2.hours = hours; 17279 proto$2.days = days; 17280 proto$2.weeks = weeks; 17281 proto$2.months = months; 17282 proto$2.years = years; 17283 proto$2.humanize = humanize; 17284 proto$2.toISOString = toISOString$1; 17285 proto$2.toString = toISOString$1; 17286 proto$2.toJSON = toISOString$1; 17287 proto$2.locale = locale; 17288 proto$2.localeData = localeData; 17289 17290 proto$2.toIsoString = deprecate( 17291 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', 17292 toISOString$1 17293 ); 17294 proto$2.lang = lang; 17295 17296 // FORMATTING 17297 17298 addFormatToken('X', 0, 0, 'unix'); 17299 addFormatToken('x', 0, 0, 'valueOf'); 17300 17301 // PARSING 17302 17303 addRegexToken('x', matchSigned); 17304 addRegexToken('X', matchTimestamp); 17305 addParseToken('X', function (input, array, config) { 17306 config._d = new Date(parseFloat(input) * 1000); 17307 }); 17308 addParseToken('x', function (input, array, config) { 17309 config._d = new Date(toInt(input)); 17310 }); 17311 17312 //! moment.js 17313 17314 hooks.version = '2.2
173149.4'; 17315 17316 setHookCallback(createLocal); 17317 17318 hooks.fn = proto; 17319 hooks.min = min; 17320 hooks.max = max; 17321 hooks.now = now; 17322 hooks.utc = createUTC; 17323 hooks.unix = createUnix; 17324 hooks.months = listMonths; 17325 hooks.isDate = isDate; 17326 hooks.locale = getSetGlobalLocale; 17327 hooks.invalid = createInvalid; 17328 hooks.duration = createDuration; 17329 hooks.isMoment = isMoment; 17330 hooks.weekdays = listWeekdays; 17331 hooks.parseZone = createInZone; 17332 hooks.localeData = getLocale; 17333 hooks.isDuration = isDuration; 17334 hooks.monthsShort = listMonthsShort; 17335 hooks.weekdaysMin = listWeekdaysMin; 17336 hooks.defineLocale = defineLocale; 17337 hooks.updateLocale = updateLocale; 17338 hooks.locales = listLocales; 17339 hooks.weekdaysShort = listWeekdaysShort; 17340 hooks.normalizeUnits = normalizeUnits; 17341 hooks.relativeTimeRounding = getSetRelativeTimeRounding; 17342 hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; 17343 hooks.calendarFormat = getCalendarFormat; 17344 hooks.prototype = proto; 17345 17346 // currently HTML5 input type only supports 24-hour formats 17347 hooks.HTML5_FMT = { 17348 DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" /> 17349 DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" /> 17350 DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" /> 17351 DATE: 'YYYY-MM-DD', // <input type="date" /> 17352 TIME: 'HH:mm', // <input type="time" /> 17353 TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" /> 17354 TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" /> 17355 WEEK: 'GGGG-[W]WW', // <input type="week" /> 17356 MONTH: 'YYYY-MM', // <input type="month" /> 17357 }; 17358 17359 return hooks; 17360 17361}))); 17362//! moment.js locale configuration 17363//! locale : Czech [cs] 17364//! author : petrbela : https://github.com/petrbela 17365 17366;(function (global, factory) { 17367 typeof exports === 'object' && typeof module !== 'undefined' 17368 && typeof require === 'function' ? factory(require('../moment')) : 17369 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 17370 factory(global.moment) 17371}(this, (function (moment) { 'use strict'; 17372 17373 //! moment.js locale configuration 17374 17375 var months = { 17376 format: 'leden_únor_bÅezen_duben_kvÄten_Äerven_Äervenec_srpen_záÅÃ_ÅÃjen_listopad_prosinec'.
vendor: 7,203 bytes, lines 17376-17554
17376split( 17377 '_' 17378 ), 17379 standalone: 17380 'ledna_února_bÅezna_dubna_kvÄtna_Äervna_Äervence_srpna_záÅÃ_ÅÃjna_listopadu_prosince'.split( 17381 '_' 17382 ), 17383 }, 17384 monthsShort = 'led_úno_bÅe_dub_kvÄ_Ävn_Ävc_srp_záÅ_ÅÃj_lis_pro'.split('_'), 17385 monthsParse = [ 17386 /^led/i, 17387 /^úno/i, 17388 /^bÅe/i, 17389 /^dub/i, 17390 /^kvÄ/i, 17391 /^(Ävn|Äerven$|Äervna)/i, 17392 /^(Ävc|Äervenec|Äervence)/i, 17393 /^srp/i, 17394 /^záÅ/i, 17395 /^ÅÃj/i, 17396 /^lis/i, 17397 /^pro/i, 17398 ], 17399 // NOTE: 'Äerven' is substring of 'Äervenec'; therefore 'Äervenec' must precede 'Äerven' in the regex to be fully matched. 17400 // Otherwise parser matches '1. Äervenec' as '1. Äerven' + 'ec'. 17401 monthsRegex = 17402 /^(leden|únor|bÅezen|duben|kvÄten|Äervenec|Äervence|Äerven|Äervna|srpen|záÅÃ|ÅÃjen|listopad|prosinec|led|úno|bÅe|dub|kvÄ|Ävn|Ävc|srp|záÅ|ÅÃj|lis|pro)/i; 17403 17404 function plural(n) { 17405 return n > 1 && n < 5 && ~~(n / 10) !== 1; 17406 } 17407 function translate(number, withoutSuffix, key, isFuture) { 17408 var result = number + ' '; 17409 switch (key) { 17410 case 's': // a few seconds / in a few seconds / a few seconds ago 17411 return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami'; 17412 case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago 17413 if (withoutSuffix || isFuture) { 17414 return result + (plural(number) ? 'sekundy' : 'sekund'); 17415 } else { 17416 return result + 'sekundami'; 17417 } 17418 case 'm': // a minute / in a minute / a minute ago 17419 return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou'; 17420 case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago 17421 if (withoutSuffix || isFuture) { 17422 return result + (plural(number) ? 'minuty' : 'minut'); 17423 } else { 17424 return result + 'minutami'; 17425 } 17426 case 'h': // an hour / in an hour / an hour ago 17427 return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou'; 17428 case 'hh': // 9 hours / in 9 hours / 9 hours ago 17429 if (withoutSuffix || isFuture) { 17430 return result + (plural(number) ? 'hodiny' : 'hodin'); 17431 } else { 17432 return result + 'hodinami'; 17433 } 17434 case 'd': // a day / in a day / a day ago 17435 return withoutSuffix || isFuture ? 'den' : 'dnem'; 17436 case 'dd': // 9 days / in 9 days / 9 days ago 17437 if (withoutSuffix || isFuture) { 17438 return result + (plural(number) ? 'dny' : 'dnÃ'); 17439 } else { 17440 return result + 'dny'; 17441 } 17442 case 'M': // a month / in a month / a month ago 17443 return withoutSuffix || isFuture ? 'mÄsÃc' : 'mÄsÃcem'; 17444 case 'MM': // 9 months / in 9 months / 9 months ago 17445 if (withoutSuffix || isFuture) { 17446 return result + (plural(number) ? 'mÄsÃce' : 'mÄsÃců'); 17447 } else { 17448 return result + 'mÄsÃci'; 17449 } 17450 case 'y': // a year / in a year / a year ago 17451 return withoutSuffix || isFuture ? 'rok' : 'rokem'; 17452 case 'yy': // 9 years / in 9 years / 9 years ago 17453 if (withoutSuffix || isFuture) { 17454 return result + (plural(number) ? 'roky' : 'let'); 17455 } else { 17456 return result + 'lety'; 17457 } 17458 } 17459 } 17460 17461 var cs = moment.defineLocale('cs', { 17462 months: months, 17463 monthsShort: monthsShort, 17464 monthsRegex: monthsRegex, 17465 monthsShortRegex: monthsRegex, 17466 // NOTE: 'Äerven' is substring of 'Äervenec'; therefore 'Äervenec' must precede 'Äerven' in the regex to be fully matched. 17467 // Otherwise parser matches '1. Äervenec' as '1. Äerven' + 'ec'. 17468 monthsStrictRegex: 17469 /^(leden|ledna|února|únor|bÅezen|bÅezna|duben|dubna|kvÄten|kvÄtna|Äervenec|Äervence|Äerven|Äervna|srpen|srpna|záÅÃ|ÅÃjen|ÅÃjna|listopadu|listopad|prosinec|prosince)/i, 17470 monthsShortStrictRegex: 17471 /^(led|úno|bÅe|dub|kvÄ|Ävn|Ävc|srp|záÅ|ÅÃj|lis|pro)/i, 17472 monthsParse: monthsParse, 17473 longMonthsParse: monthsParse, 17474 shortMonthsParse: monthsParse, 17475 weekdays: 'nedÄle_pondÄlÃ_úterý_stÅeda_Ätvrtek_pátek_sobota'.split('_'), 17476 weekdaysShort: 'ne_po_út_st_Ät_pá_so'.split('_'), 17477 weekdaysMin: 'ne_po_út_st_Ät_pá_so'.split('_'), 17478 longDateFormat: { 17479 LT: 'H:mm', 17480 LTS: 'H:mm:ss', 17481 L: 'DD.MM.YYYY', 17482 LL: 'D. MMMM YYYY', 17483 LLL: 'D. MMMM YYYY H:mm', 17484 LLLL: 'dddd D. MMMM YYYY H:mm', 17485 l: 'D. M. YYYY', 17486 }, 17487 calendar: { 17488 sameDay: '[dnes v] LT', 17489 nextDay: '[zÃtra v] LT', 17490 nextWeek: function () { 17491 switch (this.day()) { 17492 case 0: 17493 return '[v nedÄli v] LT'; 17494 case 1: 17495 case 2: 17496 return '[v] dddd [v] LT'; 17497 case 3: 17498 return '[ve stÅedu v] LT'; 17499 case 4: 17500 return '[ve Ätvrtek v] LT'; 17501 case 5: 17502 return '[v pátek v] LT'; 17503 case 6: 17504 return '[v sobotu v] LT'; 17505 } 17506 }, 17507 lastDay: '[vÄera v] LT', 17508 lastWeek: function () { 17509 switch (this.day()) { 17510 case 0: 17511 return '[minulou nedÄli v] LT'; 17512 case 1: 17513 case 2: 17514 return '[minulé] dddd [v] LT'; 17515 case 3: 17516 return '[minulou stÅedu v] LT'; 17517 case 4: 17518 case 5: 17519 return '[minulý] dddd [v] LT'; 17520 case 6: 17521 return '[minulou sobotu v] LT'; 17522 } 17523 }, 17524 sameElse: 'L', 17525 }, 17526 relativeTime: { 17527 future: 'za %s', 17528 past: 'pÅed %s', 17529 s: translate, 17530 ss: translate, 17531 m: translate, 17532 mm: translate, 17533 h: translate, 17534 hh: translate, 17535 d: translate, 17536 dd: translate, 17537 M: translate, 17538 MM: translate, 17539 y: translate, 17540 yy: translate, 17541 }, 17542 dayOfMonthOrdinalParse: /\d{1,2}\./, 17543 ordinal: '%d.', 17544 week: { 17545 dow: 1, // Monday is the first day of the week. 17546 doy: 4, // The week that contains Jan 4th is the first week of the year. 17547 }, 17548 }); 17549 17550 return cs; 17551 17552}))); 17553// Underscore.js 1.6.0 17554// http://underscorejs.org
17555// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 17556// Underscore may be freely distributed under the MIT license. 17557 17558(function() { 17559 17560 // Baseline setup 17561 // -------------- 17562 17563 // Establish the root object, `window` in the browser, or `exports` on the server. 17564 var root = this; 17565 17566 // Save the previous value of the `_` variable. 17567 var previousUnderscore = root._; 17568 17569 // Establish the object that gets returned to break out of a loop iteration. 17570 var breaker = {}; 17571 17572 // Save bytes in the minified (but not gzipped) version: 17573 var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; 17574 17575 // Create quick reference variables for speed access to core prototypes. 17576 var 17577 push = ArrayProto.push, 17578 slice = ArrayProto.slice, 17579 concat = ArrayProto.concat, 17580 toString = ObjProto.toString, 17581 hasOwnProperty = ObjProto.hasOwnProperty; 17582 17583 // All **ECMAScript 5** native function implementations that we hope to use 17584 // are declared here. 17585 var 17586 nativeForEach = ArrayProto.forEach, 17587 nativeMap = ArrayProto.map, 17588 nativeReduce = ArrayProto.reduce, 17589 nativeReduceRight = ArrayProto.reduceRight, 17590 nativeFilter = ArrayProto.filter, 17591 nativeEvery = ArrayProto.every, 17592 nativeSome = ArrayProto.some, 17593 nativeIndexOf = ArrayProto.indexOf, 17594 nativeLastIndexOf = ArrayProto.lastIndexOf, 17595 nativeIsArray = Array.isArray, 17596 nativeKeys = Object.keys, 17597 nativeBind = FuncProto.bind; 17598 17599 // Create a safe reference to the Underscore object for use below. 17600 var _ = function(obj) { 17601 if (obj instanceof _) return obj; 17602 if (!(this instanceof _)) return new _(obj); 17603 this._wrapped = obj; 17604 }; 17605 17606 // Export the Underscore object for **Node.js**, with 17607 // backwards-compatibility for the old `require()` API. If we're in 17608 // the browser, add `_` as a global object via a string identifier, 17609 // for Closure Compiler "advanced" mode. 17610 if (typeof exports !== 'undefined') { 17611 if (typeof module !== 'undefined' && module.exports) { 17612 exports = module.exports = _; 17613 } 17614 exports._ = _; 17615 } else { 17616 root._ = _; 17617 } 17618 17619 // Current version. 17620 _.VERSION = '1.6.0'; 17621 17622 // Collection Functions 17623 // -------------------- 17624 17625 // The cornerstone, an `each` implementation, aka `forEach`. 17626 // Handles objects with the built-in `forEach`, arrays, and raw objects. 17627 // Delegates to **ECMAScript 5**'s native `forEach` if available. 17628 var each = _.each = _.forEach = function(obj, iterator, context) { 17629 if (obj == null) return obj; 17630 if (nativeForEach && obj.forEach === nativeForEach) { 17631 obj.forEach(iterator, context); 17632 } else if (obj.length === +obj.length) { 17633 for (var i = 0, length = obj.length; i < length; i++) { 17634 if (iterator.call(context, obj[i], i, obj) === breaker) return; 17635 } 17636 } else { 17637 var keys = _.keys(obj); 17638 for (var i = 0, length = keys.length; i < length; i++) { 17639 if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; 17640 } 17641 } 17642 return obj; 17643 }; 17644 17645 // Return the results of applying the iterator to each element. 17646 // Delegates to **ECMAScript 5**'s native `map` if available. 17647 _.map = _.collect = function(obj, iterator, context) { 17648 var results = []; 17649 if (obj == null) return results; 17650 if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); 17651 each(obj, function(value, index, list) { 17652 results.push(iterator.call(context, value, index, list)); 17653 }); 17654 return results; 17655 }; 17656 17657 var reduceError = 'Reduce of empty array with no initial value'; 17658 17659 // **Reduce** builds up a single result from a list of values, aka `inject`, 17660 // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. 17661 _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { 17662 var initial = arguments.length > 2; 17663 if (obj == null) obj = []; 17664 if (nativeReduce && obj.reduce === nativeReduce) { 17665 if (context) iterator = _.bind(iterator, context); 17666 return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); 17667 } 17668 each(obj, function(value, index, list) { 17669 if (!initial) { 17670 memo = value; 17671 initial = true; 17672 } else { 17673 memo = iterator.call(context, memo, value, index, list); 17674 } 17675 }); 17676 if (!initial) throw new TypeError(reduceError); 17677 return memo; 17678 }; 17679 17680 // The right-associative version of reduce, also known as `foldr`. 17681 // Delegates to **ECMAScript 5**'s native `reduceRight` if available. 17682 _.reduceRight = _.foldr = function(obj, iterator, memo, context) { 17683 var initial = arguments.length > 2; 17684 if (obj == null) obj = []; 17685 if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { 17686 if (context) iterator = _.bind(iterator, context); 17687 return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); 17688 } 17689 var length = obj.length; 17690 if (length !== +length) { 17691 var keys = _.keys(obj); 17692 length = keys.length; 17693 } 17694 each(obj, function(value, index, list) { 17695 index = keys ? keys[--length] : --length; 17696 if (!initial) { 17697 memo = obj[index]; 17698 initial = true; 17699 } else { 17700 memo = iterator.call(context, memo, obj[index], index, list); 17701 } 17702 }); 17703 if (!initial) throw new TypeError(reduceError); 17704 return memo; 17705 }; 17706 17707 // Return the first value which passes a truth test. Aliased as `detect`. 17708 _.find = _.detect = function(obj, predicate, context) { 17709 var result; 17710 any(obj, function(value, index, list) { 17711 if (predicate.call(context, value, index, list)) { 17712 result = value; 17713 return true; 17714 } 17715 }); 17716 return result; 17717 }; 17718 17719 // Return all the elements that pass a truth test. 17720 // Delegates to **ECMAScript 5**'s native `filter` if available. 17721 // Aliased as `select`. 17722 _.filter = _.select = function(obj, predicate, context) { 17723 var results = []; 17724 if (obj == null) return results; 17725 if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); 17726 each(obj, function(value, index, list) { 17727 if (predicate.call(context, value, index, list)) results.push(value); 17728 }); 17729 return results; 17730 }; 17731 17732 // Return all the elements for which a truth test fails. 17733 _.reject = function(obj, predicate, context) { 17734 return _.filter(obj, function(value, index, list) { 17735 return !predicate.call(context, value, index, list); 17736 }, context); 17737 }; 17738 17739 // Determine whether all of the elements match a truth test. 17740 // Delegates to **ECMAScript 5**'s native `every` if available. 17741 // Aliased as `all`. 17742 _.every = _.all = function(obj, predicate, context) { 17743 predicate || (predicate = _.identity); 17744 var result = true; 17745 if (obj == null) return result; 17746 if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); 17747 each(obj, function(value, index, list) { 17748 if (!(result = result && predicate.call(context, value, index, list))) return breaker; 17749 }); 17750 return !!result; 17751 }; 17752 17753 // Determine if at least one element in the object matches a truth test. 17754 // Delegates to **ECMAScript 5**'s native `some` if available. 17755 // Aliased as `any`. 17756 var any = _.some = _.any = function(obj, predicate, context) { 17757 predicate || (predicate = _.identity); 17758 var result = false;
17759 if (obj == null) return result; 17760 if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); 17761 each(obj, function(value, index, list) { 17762 if (result || (result = predicate.call(context, value, index, list))) return breaker; 17763 }); 17764 return !!result; 17765 }; 17766 17767 // Determine if the array or object contains a given value (using `===`). 17768 // Aliased as `include`. 17769 _.contains = _.include = function(obj, target) { 17770 if (obj == null) return false; 17771 if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; 17772 return any(obj, function(value) { 17773 return value === target; 17774 }); 17775 }; 17776 17777 // Invoke a method (with arguments) on every item in a collection. 17778 _.invoke = function(obj, method) { 17779 var args = slice.call(arguments, 2); 17780 var isFunc = _.isFunction(method); 17781 return _.map(obj, function(value) { 17782 return (isFunc ? method : value[method]).apply(value, args); 17783 }); 17784 }; 17785 17786 // Convenience version of a common use case of `map`: fetching a property. 17787 _.pluck = function(obj, key) { 17788 return _.map(obj, _.property(key)); 17789 }; 17790 17791 // Convenience version of a common use case of `filter`: selecting only objects 17792 // containing specific `key:value` pairs. 17793 _.where = function(obj, attrs) { 17794 return _.filter(obj, _.matches(attrs)); 17795 }; 17796 17797 // Convenience version of a common use case of `find`: getting the first object 17798 // containing specific `key:value` pairs. 17799 _.findWhere = function(obj, attrs) { 17800 return _.find(obj, _.matches(attrs)); 17801 }; 17802 17803 // Return the maximum element or (element-based computation). 17804 // Can't optimize arrays of integers longer than 65,535 elements. 17805 // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) 17806 _.max = function(obj, iterator, context) { 17807 if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { 17808 return Math.max.apply(Math, obj); 17809 } 17810 var result = -Infinity, lastComputed = -Infinity; 17811 each(obj, function(value, index, list) { 17812 var computed = iterator ? iterator.call(context, value, index, list) : value; 17813 if (computed > lastComputed) { 17814 result = value; 17815 lastComputed = computed; 17816 } 17817 }); 17818 return result; 17819 }; 17820 17821 // Return the minimum element (or element-based computation). 17822 _.min = function(obj, iterator, context) { 17823 if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { 17824 return Math.min.apply(Math, obj); 17825 } 17826 var result = Infinity, lastComputed = Infinity; 17827 each(obj, function(value, index, list) { 17828 var computed = iterator ? iterator.call(context, value, index, list) : value; 17829 if (computed < lastComputed) { 17830 result = value; 17831 lastComputed = computed; 17832 } 17833 }); 17834 return result; 17835 }; 17836 17837 // Shuffle an array, using the modern version of the 17838 // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/FisherâYates_shuffle). 17839 _.shuffle = function(obj) { 17840 var rand; 17841 var index = 0; 17842 var shuffled = []; 17843 each(obj, function(value) { 17844 rand = _.random(index++); 17845 shuffled[index - 1] = shuffled[rand]; 17846 shuffled[rand] = value; 17847 }); 17848 return shuffled; 17849 }; 17850 17851 // Sample **n** random values from a collection. 17852 // If **n** is not specified, returns a single random element. 17853 // The internal `guard` argument allows it to work with `map`. 17854 _.sample = function(obj, n, guard) { 17855 if (n == null || guard) { 17856 if (obj.length !== +obj.length) obj = _.values(obj); 17857 return obj[_.random(obj.length - 1)]; 17858 } 17859 return _.shuffle(obj).slice(0, Math.max(0, n)); 17860 }; 17861 17862 // An internal function to generate lookup iterators. 17863 var lookupIterator = function(value) { 17864 if (value == null) return _.identity; 17865 if (_.isFunction(value)) return value; 17866 return _.property(value); 17867 }; 17868 17869 // Sort the object's values by a criterion produced by an iterator. 17870 _.sortBy = function(obj, iterator, context) { 17871 iterator = lookupIterator(iterator); 17872 return _.pluck(_.map(obj, function(value, index, list) { 17873 return { 17874 value: value, 17875 index: index, 17876 criteria: iterator.call(context, value, index, list) 17877 }; 17878 }).sort(function(left, right) { 17879 var a = left.criteria; 17880 var b = right.criteria; 17881 if (a !== b) { 17882 if (a > b || a === void 0) return 1; 17883 if (a < b || b === void 0) return -1; 17884 } 17885 return left.index - right.index; 17886 }), 'value'); 17887 }; 17888 17889 // An internal function used for aggregate "group by" operations. 17890 var group = function(behavior) { 17891 return function(obj, iterator, context) { 17892 var result = {}; 17893 iterator = lookupIterator(iterator); 17894 each(obj, function(value, index) { 17895 var key = iterator.call(context, value, index, obj); 17896 behavior(result, key, value); 17897 }); 17898 return result; 17899 }; 17900 }; 17901 17902 // Groups the object's values by a criterion. Pass either a string attribute 17903 // to group by, or a function that returns the criterion. 17904 _.groupBy = group(function(result, key, value) { 17905 _.has(result, key) ? result[key].push(value) : result[key] = [value]; 17906 }); 17907 17908 // Indexes the object's values by a criterion, similar to `groupBy`, but for 17909 // when you know that your index values will be unique. 17910 _.indexBy = group(function(result, key, value) { 17911 result[key] = value; 17912 }); 17913 17914 // Counts instances of an object that group by a certain criterion. Pass 17915 // either a string attribute to count by, or a function that returns the 17916 // criterion. 17917 _.countBy = group(function(result, key) { 17918 _.has(result, key) ? result[key]++ : result[key] = 1; 17919 }); 17920 17921 // Use a comparator function to figure out the smallest index at which 17922 // an object should be inserted so as to maintain order. Uses binary search. 17923 _.sortedIndex = function(array, obj, iterator, context) { 17924 iterator = lookupIterator(iterator); 17925 var value = iterator.call(context, obj); 17926 var low = 0, high = array.length; 17927 while (low < high) { 17928 var mid = (low + high) >>> 1; 17929 iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; 17930 } 17931 return low; 17932 }; 17933 17934 // Safely create a real, live array from anything iterable. 17935 _.toArray = function(obj) { 17936 if (!obj) return []; 17937 if (_.isArray(obj)) return slice.call(obj); 17938 if (obj.length === +obj.length) return _.map(obj, _.identity); 17939 return _.values(obj); 17940 }; 17941 17942 // Return the number of elements in an object. 17943 _.size = function(obj) { 17944 if (obj == null) return 0; 17945 return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; 17946 }; 17947 17948 // Array Functions 17949 // --------------- 17950 17951 // Get the first element of an array. Passing **n** will return the first N 17952 // values in the array. Aliased as `head` and `take`. The **guard** check 17953 // allows it to work with `_.map`. 17954 _.first = _.head = _.take = function(array, n, guard) { 17955 if (array == null) return void 0; 17956 if ((n == null) || guard) return array[0]; 17957 if (n < 0) return []; 17958 return slice.call(array, 0, n); 17959 }; 17960 17961 // Returns everything but the last entry of the array. Especially useful on 17962 // the arguments object. Passing **n** will return all the values in 17963 // the array, excluding the last N. The **guard** check allows it to work with 17964 // `_.map`. 17965 _.initial = function(array, n, guard) { 17966 return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); 17967 }; 17968 17969 // Get the last element of an array. Passing **n** will return the last N 17970 // values in the array. The **guard** check allows it to work with `_.map`. 17971 _.last = function(array, n, guard) { 17972 if (array == null) return void 0; 17973 if ((n == null) || guard) return array[array.length - 1]; 17974 return slice.call(array, Math.max(array.length - n, 0)); 17975 }; 17976 17977 // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. 17978 // Especially useful on the arguments object. Passing an **n** will return 17979 // the rest N values in the array. The **guard** 17980 // check allows it to work with `_.map`. 17981 _.rest = _.tail = _.drop = function(array, n, guard) { 17982 return slice.call(array, (n == null) || guard ? 1 : n); 17983 }; 17984 17985 // Trim out all falsy values from an array.
17986 _.compact = function(array) { 17987 return _.filter(array, _.identity); 17988 }; 17989 17990 // Internal implementation of a recursive `flatten` function. 17991 var flatten = function(input, shallow, output) { 17992 if (shallow && _.every(input, _.isArray)) { 17993 return concat.apply(output, input); 17994 } 17995 each(input, function(value) { 17996 if (_.isArray(value) || _.isArguments(value)) { 17997 shallow ? push.apply(output, value) : flatten(value, shallow, output); 17998 } else { 17999 output.push(value); 18000 } 18001 }); 18002 return output; 18003 }; 18004 18005 // Flatten out an array, either recursively (by default), or just one level. 18006 _.flatten = function(array, shallow) { 18007 return flatten(array, shallow, []); 18008 }; 18009 18010 // Return a version of the array that does not contain the specified value(s). 18011 _.without = function(array) { 18012 return _.difference(array, slice.call(arguments, 1)); 18013 }; 18014 18015 // Split an array into two arrays: one whose elements all satisfy the given 18016 // predicate, and one whose elements all do not satisfy the predicate. 18017 _.partition = function(array, predicate) { 18018 var pass = [], fail = []; 18019 each(array, function(elem) { 18020 (predicate(elem) ? pass : fail).push(elem); 18021 }); 18022 return [pass, fail]; 18023 }; 18024 18025 // Produce a duplicate-free version of the array. If the array has already 18026 // been sorted, you have the option of using a faster algorithm. 18027 // Aliased as `unique`. 18028 _.uniq = _.unique = function(array, isSorted, iterator, context) { 18029 if (_.isFunction(isSorted)) { 18030 context = iterator; 18031 iterator = isSorted; 18032 isSorted = false; 18033 } 18034 var initial = iterator ? _.map(array, iterator, context) : array; 18035 var results = []; 18036 var seen = []; 18037 each(initial, function(value, index) { 18038 if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { 18039 seen.push(value); 18040 results.push(array[index]); 18041 } 18042 }); 18043 return results; 18044 }; 18045 18046 // Produce an array that contains the union: each distinct element from all of 18047 // the passed-in arrays. 18048 _.union = function() { 18049 return _.uniq(_.flatten(arguments, true)); 18050 }; 18051 18052 // Produce an array that contains every item shared between all the 18053 // passed-in arrays. 18054 _.intersection = function(array) { 18055 var rest = slice.call(arguments, 1); 18056 return _.filter(_.uniq(array), function(item) { 18057 return _.every(rest, function(other) { 18058 return _.contains(other, item); 18059 }); 18060 }); 18061 }; 18062 18063 // Take the difference between one array and a number of other arrays. 18064 // Only the elements present in just the first array will remain. 18065 _.difference = function(array) { 18066 var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); 18067 return _.filter(array, function(value){ return !_.contains(rest, value); }); 18068 }; 18069 18070 // Zip together multiple lists into a single array -- elements that share 18071 // an index go together. 18072 _.zip = function() { 18073 var length = _.max(_.pluck(arguments, 'length').concat(0)); 18074 var results = new Array(length); 18075 for (var i = 0; i < length; i++) { 18076 results[i] = _.pluck(arguments, '' + i); 18077 } 18078 return results; 18079 }; 18080 18081 // Converts lists into objects. Pass either a single array of `[key, value]` 18082 // pairs, or two parallel arrays of the same length -- one of keys, and one of 18083 // the corresponding values. 18084 _.object = function(list, values) { 18085 if (list == null) return {}; 18086 var result = {}; 18087 for (var i = 0, length = list.length; i < length; i++) { 18088 if (values) { 18089 result[list[i]] = values[i]; 18090 } else { 18091 result[list[i][0]] = list[i][1]; 18092 } 18093 } 18094 return result; 18095 }; 18096 18097 // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), 18098 // we need this function. Return the position of the first occurrence of an 18099 // item in an array, or -1 if the item is not included in the array. 18100 // Delegates to **ECMAScript 5**'s native `indexOf` if available. 18101 // If the array is large and already in sort order, pass `true` 18102 // for **isSorted** to use binary search. 18103 _.indexOf = function(array, item, isSorted) { 18104 if (array == null) return -1; 18105 var i = 0, length = array.length; 18106 if (isSorted) { 18107 if (typeof isSorted == 'number') { 18108 i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); 18109 } else { 18110 i = _.sortedIndex(array, item); 18111 return array[i] === item ? i : -1; 18112 } 18113 } 18114 if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); 18115 for (; i < length; i++) if (array[i] === item) return i; 18116 return -1; 18117 }; 18118 18119 // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. 18120 _.lastIndexOf = function(array, item, from) { 18121 if (array == null) return -1; 18122 var hasIndex = from != null; 18123 if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { 18124 return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); 18125 } 18126 var i = (hasIndex ? from : array.length); 18127 while (i--) if (array[i] === item) return i; 18128 return -1; 18129 }; 18130 18131 // Generate an integer Array containing an arithmetic progression. A port of 18132 // the native Python `range()` function. See 18133 // [the Python documentation](http://docs.python.org/library/functions.html#range). 18134 _.range = function(start, stop, step) { 18135 if (arguments.length <= 1) { 18136 stop = start || 0; 18137 start = 0; 18138 } 18139 step = arguments[2] || 1; 18140 18141 var length = Math.max(Math.ceil((stop - start) / step), 0); 18142 var idx = 0; 18143 var range = new Array(length); 18144 18145 while(idx < length) { 18146 range[idx++] = start; 18147 start += step; 18148 } 18149 18150 return range; 18151 }; 18152 18153 // Function (ahem) Functions 18154 // ------------------ 18155 18156 // Reusable constructor function for prototype setting. 18157 var ctor = function(){}; 18158 18159 // Create a function bound to a given object (assigning `this`, and arguments, 18160 // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if 18161 // available. 18162 _.bind = function(func, context) { 18163 var args, bound; 18164 if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); 18165 if (!_.isFunction(func)) throw new TypeError; 18166 args = slice.call(arguments, 2); 18167 return bound = function() { 18168 if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); 18169 ctor.prototype = func.prototype; 18170 var self = new ctor; 18171 ctor.prototype = null; 18172 var result = func.apply(self, args.concat(slice.call(arguments))); 18173 if (Object(result) === result) return result; 18174 return self; 18175 }; 18176 }; 18177 18178 // Partially apply a function by creating a version that has had some of its 18179 // arguments pre-filled, without changing its dynamic `this` context. _ acts 18180 // as a placeholder, allowing any combination of arguments to be pre-filled. 18181 _.partial = function(func) { 18182 var boundArgs = slice.call(arguments, 1); 18183 return function() { 18184 var position = 0; 18185 var args = boundArgs.slice(); 18186 for (var i = 0, length = args.length; i < length; i++) { 18187 if (args[i] === _) args[i] = arguments[position++]; 18188 } 18189 while (position < arguments.length) args.push(arguments[position++]); 18190 return func.apply(this, args); 18191 }; 18192 }; 18193 18194 // Bind a number of an object's methods to that object. Remaining arguments
18195 // are the method names to be bound. Useful for ensuring that all callbacks 18196 // defined on an object belong to it. 18197 _.bindAll = function(obj) { 18198 var funcs = slice.call(arguments, 1); 18199 if (funcs.length === 0) throw new Error('bindAll must be passed function names'); 18200 each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); 18201 return obj; 18202 }; 18203 18204 // Memoize an expensive function by storing its results. 18205 _.memoize = function(func, hasher) { 18206 var memo = {}; 18207 hasher || (hasher = _.identity); 18208 return function() { 18209 var key = hasher.apply(this, arguments); 18210 return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); 18211 }; 18212 }; 18213 18214 // Delays a function for the given number of milliseconds, and then calls 18215 // it with the arguments supplied. 18216 _.delay = function(func, wait) { 18217 var args = slice.call(arguments, 2); 18218 return setTimeout(function(){ return func.apply(null, args); }, wait); 18219 }; 18220 18221 // Defers a function, scheduling it to run after the current call stack has 18222 // cleared. 18223 _.defer = function(func) { 18224 return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); 18225 }; 18226 18227 // Returns a function, that, when invoked, will only be triggered at most once 18228 // during a given window of time. Normally, the throttled function will run 18229 // as much as it can, without ever going more than once per `wait` duration; 18230 // but if you'd like to disable the execution on the leading edge, pass 18231 // `{leading: false}`. To disable execution on the trailing edge, ditto. 18232 _.throttle = function(func, wait, options) { 18233 var context, args, result; 18234 var timeout = null; 18235 var previous = 0; 18236 options || (options = {}); 18237 var later = function() { 18238 previous = options.leading === false ? 0 : _.now(); 18239 timeout = null; 18240 result = func.apply(context, args); 18241 context = args = null; 18242 }; 18243 return function() { 18244 var now = _.now(); 18245 if (!previous && options.leading === false) previous = now; 18246 var remaining = wait - (now - previous); 18247 context = this; 18248 args = arguments; 18249 if (remaining <= 0) { 18250 clearTimeout(timeout); 18251 timeout = null; 18252 previous = now; 18253 result = func.apply(context, args); 18254 context = args = null; 18255 } else if (!timeout && options.trailing !== false) { 18256 timeout = setTimeout(later, remaining); 18257 } 18258 return result; 18259 }; 18260 }; 18261 18262 // Returns a function, that, as long as it continues to be invoked, will not 18263 // be triggered. The function will be called after it stops being called for 18264 // N milliseconds. If `immediate` is passed, trigger the function on the 18265 // leading edge, instead of the trailing. 18266 _.debounce = function(func, wait, immediate) { 18267 var timeout, args, context, timestamp, result; 18268 18269 var later = function() { 18270 var last = _.now() - timestamp; 18271 if (last < wait) { 18272 timeout = setTimeout(later, wait - last); 18273 } else { 18274 timeout = null; 18275 if (!immediate) { 18276 result = func.apply(context, args); 18277 context = args = null; 18278 } 18279 } 18280 }; 18281 18282 return function() { 18283 context = this; 18284 args = arguments; 18285 timestamp = _.now(); 18286 var callNow = immediate && !timeout; 18287 if (!timeout) { 18288 timeout = setTimeout(later, wait); 18289 } 18290 if (callNow) { 18291 result = func.apply(context, args); 18292 context = args = null; 18293 } 18294 18295 return result; 18296 }; 18297 }; 18298 18299 // Returns a function that will be executed at most one time, no matter how 18300 // often you call it. Useful for lazy initialization. 18301 _.once = function(func) { 18302 var ran = false, memo; 18303 return function() { 18304 if (ran) return memo; 18305 ran = true; 18306 memo = func.apply(this, arguments); 18307 func = null; 18308 return memo; 18309 }; 18310 }; 18311 18312 // Returns the first function passed as an argument to the second, 18313 // allowing you to adjust arguments, run code before and after, and 18314 // conditionally execute the original function. 18315 _.wrap = function(func, wrapper) { 18316 return _.partial(wrapper, func); 18317 }; 18318 18319 // Returns a function that is the composition of a list of functions, each 18320 // consuming the return value of the function that follows. 18321 _.compose = function() { 18322 var funcs = arguments; 18323 return function() { 18324 var args = arguments; 18325 for (var i = funcs.length - 1; i >= 0; i--) { 18326 args = [funcs[i].apply(this, args)]; 18327 } 18328 return args[0]; 18329 }; 18330 }; 18331 18332 // Returns a function that will only be executed after being called N times. 18333 _.after = function(times, func) { 18334 return function() { 18335 if (--times < 1) { 18336 return func.apply(this, arguments); 18337 } 18338 }; 18339 }; 18340 18341 // Object Functions 18342 // ---------------- 18343 18344 // Retrieve the names of an object's properties. 18345 // Delegates to **ECMAScript 5**'s native `Object.keys` 18346 _.keys = function(obj) { 18347 if (!_.isObject(obj)) return []; 18348 if (nativeKeys) return nativeKeys(obj); 18349 var keys = []; 18350 for (var key in obj) if (_.has(obj, key)) keys.push(key); 18351 return keys; 18352 }; 18353 18354 // Retrieve the values of an object's properties. 18355 _.values = function(obj) { 18356 var keys = _.keys(obj); 18357 var length = keys.length; 18358 var values = new Array(length); 18359 for (var i = 0; i < length; i++) { 18360 values[i] = obj[keys[i]]; 18361 } 18362 return values; 18363 }; 18364 18365 // Convert an object into a list of `[key, value]` pairs. 18366 _.pairs = function(obj) { 18367 var keys = _.keys(obj); 18368 var length = keys.length; 18369 var pairs = new Array(length); 18370 for (var i = 0; i < length; i++) { 18371 pairs[i] = [keys[i], obj[keys[i]]]; 18372 } 18373 return pairs; 18374 }; 18375 18376 // Invert the keys and values of an object. The values must be serializable. 18377 _.invert = function(obj) { 18378 var result = {}; 18379 var keys = _.keys(obj); 18380 for (var i = 0, length = keys.length; i < length; i++) { 18381 result[obj[keys[i]]] = keys[i]; 18382 } 18383 return result; 18384 }; 18385 18386 // Return a sorted list of the function names available on the object. 18387 // Aliased as `methods` 18388 _.functions = _.methods = function(obj) { 18389 var names = []; 18390 for (var key in obj) { 18391 if (_.isFunction(obj[key])) names.push(key); 18392 } 18393 return names.sort(); 18394 }; 18395 18396 // Extend a given object with all the properties in passed-in object(s). 18397 _.extend = function(obj) { 18398 each(slice.call(arguments, 1), function(source) { 18399 if (source) { 18400 for (var prop in source) { 18401 obj[prop] = source[prop]; 18402 } 18403 } 18404 }); 18405 return obj; 18406 }; 18407 18408 // Return a copy of the object only containing the whitelisted properties. 18409 _.pick = function(obj) { 18410 var copy = {}; 18411 var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); 18412 each(keys, function(key) { 18413 if (key in obj) copy[key] = obj[key]; 18414 }); 18415 return copy; 18416 }; 18417
18418 // Return a copy of the object without the blacklisted properties. 18419 _.omit = function(obj) { 18420 var copy = {}; 18421 var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); 18422 for (var key in obj) { 18423 if (!_.contains(keys, key)) copy[key] = obj[key]; 18424 } 18425 return copy; 18426 }; 18427 18428 // Fill in a given object with default properties. 18429 _.defaults = function(obj) { 18430 each(slice.call(arguments, 1), function(source) { 18431 if (source) { 18432 for (var prop in source) { 18433 if (obj[prop] === void 0) obj[prop] = source[prop]; 18434 } 18435 } 18436 }); 18437 return obj; 18438 }; 18439 18440 // Create a (shallow-cloned) duplicate of an object. 18441 _.clone = function(obj) { 18442 if (!_.isObject(obj)) return obj; 18443 return _.isArray(obj) ? obj.slice() : _.extend({}, obj); 18444 }; 18445 18446 // Invokes interceptor with the obj, and then returns obj. 18447 // The primary purpose of this method is to "tap into" a method chain, in 18448 // order to perform operations on intermediate results within the chain. 18449 _.tap = function(obj, interceptor) { 18450 interceptor(obj); 18451 return obj; 18452 }; 18453 18454 // Internal recursive comparison function for `isEqual`. 18455 var eq = function(a, b, aStack, bStack) { 18456 // Identical objects are equal. `0 === -0`, but they aren't identical. 18457 // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). 18458 if (a === b) return a !== 0 || 1 / a == 1 / b; 18459 // A strict comparison is necessary because `null == undefined`. 18460 if (a == null || b == null) return a === b; 18461 // Unwrap any wrapped objects. 18462 if (a instanceof _) a = a._wrapped; 18463 if (b instanceof _) b = b._wrapped; 18464 // Compare `[[Class]]` names. 18465 var className = toString.call(a); 18466 if (className != toString.call(b)) return false; 18467 switch (className) { 18468 // Strings, numbers, dates, and booleans are compared by value. 18469 case '[object String]': 18470 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is 18471 // equivalent to `new String("5")`. 18472 return a == String(b); 18473 case '[object Number]': 18474 // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for 18475 // other numeric values. 18476 return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); 18477 case '[object Date]': 18478 case '[object Boolean]': 18479 // Coerce dates and booleans to numeric primitive values. Dates are compared by their 18480 // millisecond representations. Note that invalid dates with millisecond representations 18481 // of `NaN` are not equivalent. 18482 return +a == +b; 18483 // RegExps are compared by their source patterns and flags. 18484 case '[object RegExp]': 18485 return a.source == b.source && 18486 a.global == b.global && 18487 a.multiline == b.multiline && 18488 a.ignoreCase == b.ignoreCase; 18489 } 18490 if (typeof a != 'object' || typeof b != 'object') return false; 18491 // Assume equality for cyclic structures. The algorithm for detecting cyclic 18492 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. 18493 var length = aStack.length; 18494 while (length--) { 18495 // Linear search. Performance is inversely proportional to the number of 18496 // unique nested structures. 18497 if (aStack[length] == a) return bStack[length] == b; 18498 } 18499 // Objects with different constructors are not equivalent, but `Object`s 18500 // from different frames are. 18501 var aCtor = a.constructor, bCtor = b.constructor; 18502 if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && 18503 _.isFunction(bCtor) && (bCtor instanceof bCtor)) 18504 && ('constructor' in a && 'constructor' in b)) { 18505 return false; 18506 } 18507 // Add the first object to the stack of traversed objects. 18508 aStack.push(a); 18509 bStack.push(b); 18510 var size = 0, result = true; 18511 // Recursively compare objects and arrays. 18512 if (className == '[object Array]') { 18513 // Compare array lengths to determine if a deep comparison is necessary. 18514 size = a.length; 18515 result = size == b.length; 18516 if (result) { 18517 // Deep compare the contents, ignoring non-numeric properties. 18518 while (size--) { 18519 if (!(result = eq(a[size], b[size], aStack, bStack))) break; 18520 } 18521 } 18522 } else { 18523 // Deep compare objects. 18524 for (var key in a) { 18525 if (_.has(a, key)) { 18526 // Count the expected number of properties. 18527 size++; 18528 // Deep compare each member. 18529 if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; 18530 } 18531 } 18532 // Ensure that both objects contain the same number of properties. 18533 if (result) { 18534 for (key in b) { 18535 if (_.has(b, key) && !(size--)) break; 18536 } 18537 result = !size; 18538 } 18539 } 18540 // Remove the first object from the stack of traversed objects. 18541 aStack.pop(); 18542 bStack.pop(); 18543 return result; 18544 }; 18545 18546 // Perform a deep comparison to check if two objects are equal. 18547 _.isEqual = function(a, b) { 18548 return eq(a, b, [], []); 18549 }; 18550 18551 // Is a given array, string, or object empty? 18552 // An "empty" object has no enumerable own-properties. 18553 _.isEmpty = function(obj) { 18554 if (obj == null) return true; 18555 if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; 18556 for (var key in obj) if (_.has(obj, key)) return false;
18557 return true; 18558 }; 18559 18560 // Is a given value a DOM element? 18561 _.isElement = function(obj) { 18562 return !!(obj && obj.nodeType === 1); 18563 }; 18564 18565 // Is a given value an array? 18566 // Delegates to ECMA5's native Array.isArray 18567 _.isArray = nativeIsArray || function(obj) { 18568 return toString.call(obj) == '[object Array]'; 18569 }; 18570 18571 // Is a given variable an object? 18572 _.isObject = function(obj) { 18573 return obj === Object(obj); 18574 }; 18575 18576 // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. 18577 each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { 18578 _['is' + name] = function(obj) { 18579 return toString.call(obj) == '[object ' + name + ']'; 18580 }; 18581 }); 18582 18583 // Define a fallback version of the method in browsers (ahem, IE), where 18584 // there isn't any inspectable "Arguments" type. 18585 if (!_.isArguments(arguments)) { 18586 _.isArguments = function(obj) { 18587 return !!(obj && _.has(obj, 'callee')); 18588 }; 18589 } 18590 18591 // Optimize `isFunction` if appropriate. 18592 if (typeof (/./) !== 'function') { 18593 _.isFunction = function(obj) { 18594 return typeof obj === 'function'; 18595 }; 18596 } 18597 18598 // Is a given object a finite number? 18599 _.isFinite = function(obj) { 18600 return isFinite(obj) && !isNaN(parseFloat(obj)); 18601 }; 18602 18603 // Is the given value `NaN`? (NaN is the only number which does not equal itself). 18604 _.isNaN = function(obj) { 18605 return _.isNumber(obj) && obj != +obj; 18606 }; 18607 18608 // Is a given value a boolean? 18609 _.isBoolean = function(obj) { 18610 return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; 18611 }; 18612 18613 // Is a given value equal to null? 18614 _.isNull = function(obj) { 18615 return obj === null; 18616 }; 18617 18618 // Is a given variable undefined? 18619 _.isUndefined = function(obj) { 18620 return obj === void 0; 18621 }; 18622 18623 // Shortcut function for checking if an object has a given property directly 18624 // on itself (in other words, not on a prototype). 18625 _.has = function(obj, key) { 18626 return hasOwnProperty.call(obj, key); 18627 }; 18628 18629 // Utility Functions 18630 // ----------------- 18631 18632 // Run Underscore.js in *noConflict* mode, returning the `_` variable to its 18633 // previous owner. Returns a reference to the Underscore object. 18634 _.noConflict = function() { 18635 root._ = previousUnderscore; 18636 return this; 18637 }; 18638 18639 // Keep the identity function around for default iterators. 18640 _.identity = function(value) { 18641 return value; 18642 }; 18643 18644 _.constant = function(value) { 18645 return function () { 18646 return value; 18647 }; 18648 }; 18649 18650 _.property = function(key) { 18651 return function(obj) { 18652 return obj[key]; 18653 }; 18654 }; 18655 18656 // Returns a predicate for checking whether an object has a given set of `key:value` pairs. 18657 _.matches = function(attrs) { 18658 return function(obj) { 18659 if (obj === attrs) return true; //avoid comparing an object to itself. 18660 for (var key in attrs) { 18661 if (attrs[key] !== obj[key]) 18662 return false; 18663 } 18664 return true; 18665 } 18666 }; 18667 18668 // Run a function **n** times. 18669 _.times = function(n, iterator, context) { 18670 var accum = Array(Math.max(0, n)); 18671 for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); 18672 return accum; 18673 }; 18674 18675 // Return a random integer between min and max (inclusive). 18676 _.random = function(min, max) { 18677 if (max == null) { 18678 max = min; 18679 min = 0; 18680 } 18681 return min + Math.floor(Math.random() * (max - min + 1)); 18682 }; 18683 18684 // A (possibly faster) way to get the current timestamp as an integer. 18685 _.now = Date.now || function() { return new Date().getTime(); }; 18686 18687 // List of HTML entities for escaping. 18688 var entityMap = { 18689 escape: { 18690 '&': '&', 18691 '<': '<', 18692 '>': '>', 18693 '"': '"', 18694 "'": ''' 18695 } 18696 }; 18697 entityMap.unescape = _.invert(entityMap.escape); 18698 18699 // Regexes containing the keys and values listed immediately above. 18700 var entityRegexes = { 18701 escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), 18702 unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') 18703 }; 18704 18705 // Functions for escaping and unescaping strings to/from HTML interpolation. 18706 _.each(['escape', 'unescape'], function(method) { 18707 _[method] = function(string) { 18708 if (string == null) return ''; 18709 return ('' + string).replace(entityRegexes[method], function(match) { 18710 return entityMap[method][match]; 18711 }); 18712 }; 18713 }); 18714 18715 // If the value of the named `property` is a function then invoke it with the 18716 // `object` as context; otherwise, return it. 18717 _.result = function(object, property) { 18718 if (object == null) return void 0; 18719 var value = object[property]; 18720 return _.isFunction(value) ? value.call(object) : value; 18721 }; 18722 18723 // Add your own custom functions to the Underscore object. 18724 _.mixin = function(obj) { 18725 each(_.functions(obj), function(name) { 18726 var func = _[name] = obj[name]; 18727 _.prototype[name] = function() { 18728 var args = [this._wrapped]; 18729 push.apply(args, arguments); 18730 return result.call(this, func.apply(_, args)); 18731 }; 18732 }); 18733 }; 18734 18735 // Generate a unique integer id (unique within the entire client session). 18736 // Useful for temporary DOM ids. 18737 var idCounter = 0; 18738 _.uniqueId = function(prefix) { 18739 var id = ++idCounter + ''; 18740 return prefix ? prefix + id : id; 18741 }; 18742 18743 // By default, Underscore uses ERB-style template delimiters, change the 18744 // following template settings to use alternative delimiters. 18745 _.templateSettings = { 18746 evaluate : /<%([\s\S]+?)%>/g, 18747 interpolate : /<%=([\s\S]+?)%>/g, 18748 escape : /<%-([\s\S]+?)%>/g 18749 }; 18750 18751 // When customizing `templateSettings`, if you don't want to define an 18752 // interpolation, evaluation or escaping regex, we need one that is 18753 // guaranteed not to match. 18754 var noMatch = /(.)^/; 18755 18756 // Certain characters need to be escaped so that they can be put into a 18757 // string literal. 18758 var escapes = { 18759 "'": "'", 18760 '\\': '\\', 18761 '\r': 'r', 18762 '\n': 'n', 18763 '\t': 't', 18764 '\u2028': 'u2028', 18765 '\u2029': 'u2029' 18766 }; 18767 18768 var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; 18769 18770 // JavaScript micro-templating, similar to John Resig's implementation. 18771 // Underscore templating handles arbitrary delimiters, preserves whitespace, 18772 // and correctly escapes quotes within interpolated code. 18773 _.template = function(text, data, settings) { 18774 var render; 18775 settings = _.defaults({}, settings, _.templateSettings); 18776 18777 // Combine delimiters into one regular expression via alternation. 18778 var matcher = new RegExp([
18779 (settings.escape || noMatch).source, 18780 (settings.interpolate || noMatch).source, 18781 (settings.evaluate || noMatch).source 18782 ].join('|') + '|$', 'g'); 18783 18784 // Compile the template source, escaping string literals appropriately. 18785 var index = 0; 18786 var source = "__p+='"; 18787 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { 18788 source += text.slice(index, offset) 18789 .replace(escaper, function(match) { return '\\' + escapes[match]; }); 18790 18791 if (escape) { 18792 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; 18793 } 18794 if (interpolate) { 18795 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; 18796 } 18797 if (evaluate) { 18798 source += "';\n" + evaluate + "\n__p+='"; 18799 } 18800 index = offset + match.length; 18801 return match; 18802 }); 18803 source += "';\n"; 18804 18805 // If a variable is not specified, place data values in local scope. 18806 if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; 18807 18808 source = "var __t,__p='',__j=Array.prototype.join," + 18809 "print=function(){__p+=__j.call(arguments,'');};\n" + 18810 source + "return __p;\n"; 18811 18812 try { 18813 render = new Function(settings.variable || 'obj', '_', source); 18814 } catch (e) { 18815 e.source = source; 18816 throw e; 18817 } 18818 18819 if (data) return render(data, _); 18820 var template = function(data) { 18821 return render.call(this, data, _); 18822 }; 18823 18824 // Provide the compiled function source as a convenience for precompilation. 18825 template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; 18826 18827 return template; 18828 }; 18829 18830 // Add a "chain" function, which will delegate to the wrapper. 18831 _.chain = function(obj) { 18832 return _(obj).chain(); 18833 }; 18834 18835 // OOP 18836 // --------------- 18837 // If Underscore is called as a function, it returns a wrapped object that 18838 // can be used OO-style. This wrapper holds altered versions of all the 18839 // underscore functions. Wrapped objects may be chained. 18840 18841 // Helper function to continue chaining intermediate results. 18842 var result = function(obj) { 18843 return this._chain ? _(obj).chain() : obj; 18844 }; 18845 18846 // Add all of the Underscore functions to the wrapper object. 18847 _.mixin(_); 18848 18849 // Add all mutator Array functions to the wrapper. 18850 each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { 18851 var method = ArrayProto[name]; 18852 _.prototype[name] = function() { 18853 var obj = this._wrapped; 18854 method.apply(obj, arguments); 18855 if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; 18856 return result.call(this, obj); 18857 }; 18858 }); 18859 18860 // Add all accessor Array functions to the wrapper. 18861 each(['concat', 'join', 'slice'], function(name) { 18862 var method = ArrayProto[name]; 18863 _.prototype[name] = function() { 18864 return result.call(this, method.apply(this._wrapped, arguments)); 18865 }; 18866 }); 18867 18868 _.extend(_.prototype, { 18869 18870 // Start chaining a wrapped Underscore object. 18871 chain: function() { 18872 this._chain = true; 18873 return this; 18874 }, 18875 18876 // Extracts the result from a wrapped and chained object. 18877 value: function() { 18878 return this._wrapped; 18879 } 18880 18881 }); 18882 18883 // AMD registration happens at the end for compatibility with AMD loaders 18884 // that may not enforce next-turn semantics on modules. Even though general 18885 // practice for AMD registration is to be anonymous, underscore registers 18886 // as a named module because, like jQuery, it is a base library that is 18887 // popular enough to be bundled in a third party lib, but not be part of 18888 // an AMD load request. Those cases could generate an error when an 18889 // anonymous define() is called outside of a loader request. 18890 if (typeof define === 'function' && define.amd) { 18891 define('underscore', [], function() { 18892 return _; 18893 }); 18894 } 18895}).call(this); 18896(function() { 18897 var add, average, between, clockwise, degToRad, div, mul, nearer, oldNum, oldNumber, pinch, radToDeg, random, round, sign, sub, _loop, _n, 18898 __slice = [].slice; 18899 18900 _n = {}; 18901 18902 _n.sign = sign = function(num) { 18903 if (num > 0) { 18904 return 1; 18905 } else if (num < 0) { 18906 return -1; 18907 } else { 18908 return 0; 18909 } 18910 }; 18911 18912 _n.pinch = pinch = function(target, min, max) { 18913 var _ref; 18914 if (min > max) { 18915 _ref = [max, min], min = _ref[0], max = _ref[1]; 18916 } 18917 if (target < min) { 18918 return min; 18919 } else if (target > max) { 18920 return max; 18921 } else { 18922 return target; 18923 } 18924 }; 18925 18926 _n.loop = _loop = function(target, min, max) { 18927 var val, vol, _ref; 18928 if (min === max) { 18929 return min; 18930 } else { 18931 if (min > max) { 18932 _ref = [max, min], min = _ref[0], max = _ref[1]; 18933 } 18934 vol = max - min; 18935 val = target - max; 18936 while (val < 0) { 18937 val += vol; 18938 } 18939 return (val % vol) + min; 18940 } 18941 }; 18942 18943 _n.clockwise = clockwise = function(from, to, range) { 18944 while (to > from) { 18945 to -= range; 18946 } 18947 while (to < from) { 18948 to += range; 18949 } 18950 return to - from; 18951 }; 18952 18953 _n.nearer = nearer = function(from, to, range) { 18954 var c; 18955 c = clockwise(from, to, range); 18956 if (c >= range * 0.5) { 18957 return c - range; 18958 } else { 18959 return c; 18960 } 18961 }; 18962 18963 _n.average = average = function() { 18964 var nums; 18965 nums = 1 <= arguments.length ? __slice.call(arguments, 0) : []; 18966 return add.apply(null, nums) / nums.length; 18967 }; 18968 18969 _n.round = round = function(num, level) { 18970 var e; 18971 if (level == null) { 18972 level = 0; 18973 } 18974 e = Math.pow(10, level); 18975 return Math.round(num * e) / e; 18976 }; 18977 18978 _n.between = between = function(from, to, ratio) { 18979 return from + (to - from) * ratio; 18980 }; 18981 18982 _n.add = add = function() { 18983 var n, num, nums, _i, _len; 18984 nums = 1 <= arguments.length ? __slice.call(arguments, 0) : []; 18985 n = 0; 18986 for (_i = 0, _len = nums.length; _i < _len; _i++) { 18987 num = nums[_i]; 18988 n += num; 18989 } 18990 return n; 18991 }; 18992 18993 _n.sub = sub = function() { 18994 var base, num, nums, _i, _len; 18995 base = arguments[0], nums = 2 <= arguments.length ? __slice.call(arguments, 1) : []; 18996 if (base === void 0) { 18997 throw new Error; 18998 } 18999 if (nums.length) { 19000 for (_i = 0, _len = nums.length; _i < _len; _i++) { 19001 num = nums[_i]; 19002 base -= num; 19003 } 19004 return base; 19005 } else { 19006 return -base; 19007 } 19008 }; 19009 19010 _n.mul = mul = function() { 19011 var n, num, nums, _i, _len; 19012 nums = 1 <= arguments.length ? __slice.call(arguments, 0) : []; 19013 n = 1; 19014 for (_i = 0, _len = nums.length; _i < _len; _i++) { 19015 num = nums[_i]; 19016 n *= num; 19017 } 19018 return n; 19019 }; 19020 19021 _n.div = div = function() { 19022 var base, num, nums, _i, _len; 19023 base = arguments[0], nums = 2 <= arguments.length ? __slice.call(arguments, 1) : []; 19024 if (base === void 0) { 19025 throw new Error; 19026 } 19027 if (nums.length) { 19028 for (_i = 0, _len = nums.length; _i < _len; _i++) { 19029 num = nums[_i]; 19030 base /= num; 19031 } 19032 return base; 19033 } else { 19034 return 1 / base; 19035 } 19036 }; 19037 19038 _n.random = random = function() { 19039 var nums; 19040 nums = 1 <= arguments.length ? __slice.call(arguments, 0) : []; 19041 if (nums.length === 0) { 19042 return Math.random(); 19043 } else if (nums.length === 1) { 19044 return Math.random() * nums[0]; 19045 } else { 19046 return Math.random() * (nums[1] - nums[0]) + nums[0]; 19047 } 19048 }; 19049 19050 _n.radToDeg = radToDeg = function(rad) { 19051 return rad * 57.29577951308232; 19052 }; 19053 19054 _n.degToRad = degToRad = function(deg) { 19055 return deg * 0.017453292519943295; 19056 }; 19057 19058 _n.exports = function() { 19059 var k, r, v; 19060 r = {}; 19061 for (k in _n) { 19062 v = _n[k]; 19063 r[k] = v; 19064 } 19065 return r; 19066 }; 19067 19068 if ((typeof module !== "undefined" && module !== null ? module.exports : void 0) != null) { 19069 module.exports = _n; 19070 } else { 19071 this._ || (this._ = {}); 19072 oldNumber = this._.number; 19073 oldNum = this._.num; 19074 this._.number = this._.num = _n; 19075 _n.noConflict = (function(_this) { 19076 return function() { 19077 _this._.number = oldNumber; 19078 _this._.num = oldNum; 19079 return _n; 19080 }; 19081 })(this); 19082 } 19083 19084}).call(this); 19085// Underscore.string 19086// (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org> 19087// Underscore.string is freely distributable under the terms of the MIT license. 19088// Documentation: https://github.com/epeli/underscore.string 19089// Some code is borrowed from MooTools and Alexandru Marasteanu. 19090// Version '2.3.0' 19091 19092!function(root, String){ 19093 'use strict'; 19094 19095 // Defining helper functions. 19096 19097 var nativeTrim = String.prototype.trim; 19098 var nativeTrimRight = String.prototype.trimRight; 19099 var nativeTrimLeft = String.prototype.trimLeft; 19100 19101 var parseNumber = function(source) { return source * 1 || 0; }; 19102 19103 var strRepeat = function(str, qty){ 19104 if (qty < 1) return ''; 19105 var result = ''; 19106 while (qty > 0) { 19107 if (qty & 1) result += str; 19108 qty >>= 1, str += str; 19109 } 19110 return result; 19111 }; 19112 19113 var slice = [].slice; 19114
19115 var defaultToWhiteSpace = function(characters) { 19116 if (characters == null) 19117 return '\\s'; 19118 else if (characters.source) 19119 return characters.source; 19120 else 19121 return '[' + _s.escapeRegExp(characters) + ']'; 19122 }; 19123 19124 var escapeChars = { 19125 lt: '<', 19126 gt: '>', 19127 quot: '"', 19128 amp: '&', 19129 apos: "'" 19130 }; 19131 19132 var reversedEscapeChars = {}; 19133 for(var key in escapeChars) reversedEscapeChars[escapeChars[key]] = key; 19134 reversedEscapeChars["'"] = '#39'; 19135 19136 // sprintf() for JavaScript 0.7-beta1 19137 // http://www.diveintojavascript.com/projects/javascript-sprintf 19138 // 19139 // Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com> 19140 // All rights reserved. 19141 19142 var sprintf = (function() { 19143 function get_type(variable) { 19144 return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); 19145 } 19146 19147 var str_repeat = strRepeat; 19148 19149 var str_format = function() { 19150 if (!str_format.cache.hasOwnProperty(arguments[0])) { 19151 str_format.cache[arguments[0]] = str_format.parse(arguments[0]); 19152 } 19153 return str_format.format.call(null, str_format.cache[arguments[0]], arguments); 19154 }; 19155 19156 str_format.format = function(parse_tree, argv) { 19157 var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length; 19158 for (i = 0; i < tree_length; i++) { 19159 node_type = get_type(parse_tree[i]); 19160 if (node_type === 'string') { 19161 output.push(parse_tree[i]); 19162 } 19163 else if (node_type === 'array') { 19164 match = parse_tree[i]; // convenience purposes only 19165 if (match[2]) { // keyword argument 19166 arg = argv[cursor]; 19167 for (k = 0; k < match[2].length; k++) { 19168 if (!arg.hasOwnProperty(match[2][k])) { 19169 throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k])); 19170 } 19171 arg = arg[match[2][k]]; 19172 } 19173 } else if (match[1]) { // positional argument (explicit) 19174 arg = argv[match[1]]; 19175 } 19176 else { // positional argument (implicit) 19177 arg = argv[cursor++]; 19178 } 19179 19180 if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) { 19181 throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg))); 19182 } 19183 switch (match[8]) { 19184 case 'b': arg = arg.toString(2); break; 19185 case 'c': arg = String.fromCharCode(arg); break; 19186 case 'd': arg = parseInt(arg, 10); break; 19187 case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break; 19188 case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break; 19189 case 'o': arg = arg.toString(8); break; 19190 case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break; 19191 case 'u': arg = Math.abs(arg); break; 19192 case 'x': arg = arg.toString(16); break; 19193 case 'X': arg = arg.toString(16).toUpperCase(); break; 19194 } 19195 arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg); 19196 pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' '; 19197 pad_length = match[6] - String(arg).length; 19198 pad = match[6] ? str_repeat(pad_character, pad_length) : ''; 19199 output.push(match[5] ? arg + pad : pad + arg); 19200 } 19201 } 19202 return output.join(''); 19203 }; 19204 19205 str_format.cache = {}; 19206 19207 str_format.parse = function(fmt) { 19208 var _fmt = fmt, match = [], parse_tree = [], arg_names = 0; 19209 while (_fmt) { 19210 if ((match = /^[^\x25]+/.exec(_fmt)) !== null) { 19211 parse_tree.push(match[0]); 19212 } 19213 else if ((match = /^\x25{2}/.exec(_fmt)) !== null) { 19214 parse_tree.push('%'); 19215 } 19216 else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) { 19217 if (match[2]) { 19218 arg_names |= 1; 19219 var field_list = [], replacement_field = match[2], field_match = []; 19220 if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { 19221 field_list.push(field_match[1]); 19222 while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { 19223 if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { 19224 field_list.push(field_match[1]); 19225 } 19226 else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) { 19227 field_list.push(field_match[1]); 19228 } 19229 else { 19230 throw new Error('[_.sprintf] huh?'); 19231 } 19232 } 19233 } 19234 else { 19235 throw new Error('[_.sprintf] huh?'); 19236 } 19237 match[2] = field_list; 19238 } 19239 else { 19240 arg_names |= 2; 19241 } 19242 if (arg_names === 3) { 19243 throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported'); 19244 } 19245 parse_tree.push(match); 19246 } 19247 else { 19248 throw new Error('[_.sprintf] huh?'); 19249 } 19250 _fmt = _fmt.substring(match[0].length); 19251 } 19252 return parse_tree; 19253 }; 19254 19255 return str_format; 19256 })(); 19257 19258 19259 19260 // Defining underscore.string 19261 19262 var _s = { 19263 19264 VERSION: '2.3.0', 19265 19266 isBlank: function(str){ 19267 if (str == null) str = ''; 19268 return (/^\s*$/).test(str); 19269 }, 19270 19271 stripTags: function(str){ 19272 if (str == null) return ''; 19273 return String(str).replace(/<\/?[^>]+>/g, ''); 19274 }, 19275 19276 capitalize : function(str){ 19277 str = str == null ? '' : String(str); 19278 return str.charAt(0).toUpperCase() + str.slice(1); 19279 }, 19280 19281 chop: function(str, step){ 19282 if (str == null) return []; 19283 str = String(str); 19284 step = ~~step; 19285 return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str]; 19286 }, 19287 19288 clean: function(str){ 19289 return _s.strip(str).replace(/\s+/g, ' '); 19290 }, 19291 19292 count: function(str, substr){ 19293 if (str == null || substr == null) return 0; 19294 19295 str = String(str); 19296 substr = String(substr); 19297 19298 var count = 0, 19299 pos = 0, 19300 length = substr.length; 19301 19302 while (true) { 19303 pos = str.indexOf(substr, pos); 19304 if (pos === -1) break; 19305 count++; 19306 pos += length; 19307 } 19308 19309 return count; 19310 }, 19311 19312 chars: function(str) { 19313 if (str == null) return []; 19314 return String(str).split(''); 19315 }, 19316 19317 swapCase: function(str) { 19318 if (str == null) return ''; 19319 return String(str).replace(/\S/g, function(c){ 19320 return c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase(); 19321 }); 19322 }, 19323 19324 escapeHTML: function(str) { 19325 if (str == null) return ''; 19326 return String(str).replace(/[&<>"']/g, function(m){ return '&' + reversedEscapeChars[m] + ';'; }); 19327 }, 19328 19329 unescapeHTML: function(str) { 19330 if (str == null) return ''; 19331 return String(str).replace(/\&([^;]+);/g, function(entity, entityCode){ 19332 var match; 19333 19334 if (entityCode in escapeChars) { 19335 return escapeChars[entityCode]; 19336 } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) { 19337 return String.fromCharCode(parseInt(match[1], 16)); 19338 } else if (match = entityCode.match(/^#(\d+)$/)) { 19339 return String.fromCharCode(~~match[1]); 19340 } else { 19341 return entity; 19342 } 19343 }); 19344 }, 19345 19346 escapeRegExp: function(str){ 19347 if (str == null) return ''; 19348 return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); 19349 }, 19350 19351 splice: function(str, i, howmany, substr){ 19352 var arr = _s.chars(str); 19353 arr.splice(~~i, ~~howmany, substr); 19354 return arr.join(''); 19355 }, 19356 19357 insert: function(str, i, substr){ 19358 return _s.splice(str, i, 0, substr); 19359 }, 19360 19361 include: function(str, needle){ 19362 if (needle === '') return true; 19363 if (str == null) return false;
19364 return String(str).indexOf(needle) !== -1; 19365 }, 19366 19367 join: function() { 19368 var args = slice.call(arguments), 19369 separator = args.shift(); 19370 19371 if (separator == null) separator = ''; 19372 19373 return args.join(separator); 19374 }, 19375 19376 lines: function(str) { 19377 if (str == null) return []; 19378 return String(str).split("\n"); 19379 }, 19380 19381 reverse: function(str){ 19382 return _s.chars(str).reverse().join(''); 19383 }, 19384 19385 startsWith: function(str, starts){ 19386 if (starts === '') return true; 19387 if (str == null || starts == null) return false; 19388 str = String(str); starts = String(starts); 19389 return str.length >= starts.length && str.slice(0, starts.length) === starts; 19390 }, 19391 19392 endsWith: function(str, ends){ 19393 if (ends === '') return true; 19394 if (str == null || ends == null) return false; 19395 str = String(str); ends = String(ends); 19396 return str.length >= ends.length && str.slice(str.length - ends.length) === ends; 19397 }, 19398 19399 succ: function(str){ 19400 if (str == null) return ''; 19401 str = String(str); 19402 return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length-1) + 1); 19403 }, 19404 19405 titleize: function(str){ 19406 if (str == null) return ''; 19407 return String(str).replace(/(?:^|\s)\S/g, function(c){ return c.toUpperCase(); }); 19408 }, 19409 19410 camelize: function(str){ 19411 return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, c){ return c ? c.toUpperCase() : ""; }); 19412 }, 19413 19414 underscored: function(str){ 19415 return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase(); 19416 }, 19417 19418 dasherize: function(str){ 19419 return _s.trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase(); 19420 }, 19421 19422 classify: function(str){ 19423 return _s.titleize(String(str).replace(/[\W_]/g, ' ')).replace(/\s/g, ''); 19424 }, 19425 19426 humanize: function(str){ 19427 return _s.capitalize(_s.underscored(str).replace(/_id$/,'').replace(/_/g, ' ')); 19428 }, 19429 19430 trim: function(str, characters){ 19431 if (str == null) return ''; 19432 if (!characters && nativeTrim) return nativeTrim.call(str); 19433 characters = defaultToWhiteSpace(characters); 19434 return String(str).replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); 19435 }, 19436 19437 ltrim: function(str, characters){ 19438 if (str == null) return ''; 19439 if (!characters && nativeTrimLeft) return nativeTrimLeft.call(str); 19440 characters = defaultToWhiteSpace(characters); 19441 return String(str).replace(new RegExp('^' + characters + '+'), ''); 19442 }, 19443 19444 rtrim: function(str, characters){ 19445 if (str == null) return ''; 19446 if (!characters && nativeTrimRight) return nativeTrimRight.call(str); 19447 characters = defaultToWhiteSpace(characters); 19448 return String(str).replace(new RegExp(characters + '+$'), ''); 19449 }, 19450 19451 truncate: function(str, length, truncateStr){ 19452 if (str == null) return ''; 19453 str = String(str); truncateStr = truncateStr || '...'; 19454 length = ~~length; 19455 return str.length > length ? str.slice(0, length) + truncateStr : str; 19456 }, 19457 19458 /** 19459 * _s.prune: a more elegant version of truncate 19460 * prune extra chars, never leaving a half-chopped word. 19461 * @author github.com/rwz 19462 */ 19463 prune: function(str, length, pruneStr){ 19464 if (str == null) return ''; 19465 19466 str = String(str); length = ~~length; 19467 pruneStr = pruneStr != null ? String(pruneStr) : '...'; 19468 19469 if (str.length <= length) return str; 19470 19471 var tmpl = function(c){ return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' '; }, 19472 template = str.slice(0, length+1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA' 19473 19474 if (template.slice(template.length-2).match(/\w\w/)) 19475 template = template.replace(/\s*\S+$/, ''); 19476 else 19477 template = _s.rtrim(template.slice(0, template.length-1)); 19478 19479 return (template+pruneStr).length > str.length ? str : str.slice(0, template.length)+pruneStr; 19480 }, 19481 19482 words: function(str, delimiter) { 19483 if (_s.isBlank(str)) return []; 19484 return _s.trim(str, delimiter).split(delimiter || /\s+/); 19485 }, 19486 19487 pad: function(str, length, padStr, type) { 19488 str = str == null ? '' : String(str); 19489 length = ~~length; 19490 19491 var padlen = 0; 19492 19493 if (!padStr) 19494 padStr = ' '; 19495 else if (padStr.length > 1) 19496 padStr = padStr.charAt(0); 19497 19498 switch(type) { 19499 case 'right': 19500 padlen = length - str.length; 19501 return str + strRepeat(padStr, padlen); 19502 case 'both': 19503 padlen = length - str.length; 19504 return strRepeat(padStr, Math.ceil(padlen/2)) + str 19505 + strRepeat(padStr, Math.floor(padlen/2)); 19506 default: // 'left' 19507 padlen = length - str.length; 19508 return strRepeat(padStr, padlen) + str; 19509 } 19510 }, 19511 19512 lpad: function(str, length, padStr) { 19513 return _s.pad(str, length, padStr); 19514 }, 19515 19516 rpad: function(str, length, padStr) { 19517 return _s.pad(str, length, padStr, 'right'); 19518 }, 19519 19520 lrpad: function(str, length, padStr) { 19521 return _s.pad(str, length, padStr, 'both'); 19522 }, 19523 19524 sprintf: sprintf, 19525 19526 vsprintf: function(fmt, argv){ 19527 argv.unshift(fmt); 19528 return sprintf.apply(null, argv); 19529 }, 19530 19531 toNumber: function(str, decimals) { 19532 if (!str) return 0; 19533 str = _s.trim(str); 19534 if (!str.match(/^-?\d+(?:\.\d+)?$/)) return NaN; 19535 return parseNumber(parseNumber(str).toFixed(~~decimals)); 19536 }, 19537 19538 numberFormat : function(number, dec, dsep, tsep) { 19539 if (isNaN(number) || number == null) return ''; 19540 19541 number = number.toFixed(~~dec); 19542 tsep = typeof tsep == 'string' ? tsep : ','; 19543 19544 var parts = number.split('.'), fnums = parts[0], 19545 decimals = parts[1] ? (dsep || '.') + parts[1] : ''; 19546 19547 return fnums.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + tsep) + decimals; 19548 }, 19549 19550 strRight: function(str, sep){ 19551 if (str == null) return ''; 19552 str = String(str); sep = sep != null ? String(sep) : sep; 19553 var pos = !sep ? -1 : str.indexOf(sep); 19554 return ~pos ? str.slice(pos+sep.length, str.length) : str; 19555 }, 19556 19557 strRightBack: function(str, sep){ 19558 if (str == null) return ''; 19559 str = String(str); sep = sep != null ? String(sep) : sep; 19560 var pos = !sep ? -1 : str.lastIndexOf(sep); 19561 return ~pos ? str.slice(pos+sep.length, str.length) : str; 19562 }, 19563 19564 strLeft: function(str, sep){ 19565 if (str == null) return ''; 19566 str = String(str); sep = sep != null ? String(sep) : sep; 19567 var pos = !sep ? -1 : str.indexOf(sep); 19568 return ~pos ? str.slice(0, pos) : str; 19569 }, 19570 19571 strLeftBack: function(str, sep){ 19572 if (str == null) return ''; 19573 str += ''; sep = sep != null ? ''+sep : sep; 19574 var pos = str.lastIndexOf(sep); 19575 return ~pos ? str.slice(0, pos) : str; 19576 }, 19577 19578 toSentence: function(array, separator, lastSeparator, serial) { 19579 separator = separator || ', ' 19580 lastSeparator = lastSeparator || ' and ' 19581 var a = array.slice(), lastMember = a.pop(); 19582 19583 if (array.length > 2 && serial) lastSeparator = _s.rtrim(separator) + lastSeparator; 19584 19585 return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember; 19586 }, 19587 19588 toSentenceSerial: function() { 19589 var args = slice.call(arguments); 19590 args[3] = true; 19591 return _s.toSentence.apply(_s, args); 19592 }, 19593 19594 slugify: function(str) { 19595 if (str == null) return ''; 19596 19597 var from = "Ä Ã Ã¡Ã¤Ã¢Ã£Ã¥Ã¦ÄÄèéëêìÃïîÅÅòóöôõøÅùúüûñçżź",
19598 to = "aaaaaaaaceeeeeiiiilnoooooosuuuunczz", 19599 regex = new RegExp(defaultToWhiteSpace(from), 'g'); 19600 19601 str = String(str).toLowerCase().replace(regex, function(c){ 19602 var index = from.indexOf(c); 19603 return to.charAt(index) || '-'; 19604 }); 19605 19606 return _s.dasherize(str.replace(/[^\w\s-]/g, '')); 19607 }, 19608 19609 surround: function(str, wrapper) { 19610 return [wrapper, str, wrapper].join(''); 19611 }, 19612 19613 quote: function(str) { 19614 return _s.surround(str, '"'); 19615 }, 19616 19617 exports: function() { 19618 var result = {}; 19619 19620 for (var prop in this) { 19621 if (!this.hasOwnProperty(prop) || prop.match(/^(?:include|contains|reverse)$/)) continue; 19622 result[prop] = this[prop]; 19623 } 19624 19625 return result; 19626 }, 19627 19628 repeat: function(str, qty, separator){ 19629 if (str == null) return ''; 19630 19631 qty = ~~qty; 19632 19633 // using faster implementation if separator is not needed; 19634 if (separator == null) return strRepeat(String(str), qty); 19635 19636 // this one is about 300x slower in Google Chrome 19637 for (var repeat = []; qty > 0; repeat[--qty] = str) {} 19638 return repeat.join(separator); 19639 }, 19640 19641 naturalCmp: function(str1, str2){ 19642 if (str1 == str2) return 0; 19643 if (!str1) return -1; 19644 if (!str2) return 1; 19645 19646 var cmpRegex = /(\.\d+)|(\d+)|(\D+)/g, 19647 tokens1 = String(str1).toLowerCase().match(cmpRegex), 19648 tokens2 = String(str2).toLowerCase().match(cmpRegex), 19649 count = Math.min(tokens1.length, tokens2.length); 19650 19651 for(var i = 0; i < count; i++) { 19652 var a = tokens1[i], b = tokens2[i]; 19653 19654 if (a !== b){ 19655 var num1 = parseInt(a, 10); 19656 if (!isNaN(num1)){ 19657 var num2 = parseInt(b, 10); 19658 if (!isNaN(num2) && num1 - num2) 19659 return num1 - num2; 19660 } 19661 return a < b ? -1 : 1; 19662 } 19663 } 19664 19665 if (tokens1.length === tokens2.length) 19666 return tokens1.length - tokens2.length; 19667 19668 return str1 < str2 ? -1 : 1; 19669 }, 19670 19671 levenshtein: function(str1, str2) { 19672 if (str1 == null && str2 == null) return 0; 19673 if (str1 == null) return String(str2).length; 19674 if (str2 == null) return String(str1).length; 19675 19676 str1 = String(str1); str2 = String(str2); 19677 19678 var current = [], prev, value; 19679 19680 for (var i = 0; i <= str2.length; i++) 19681 for (var j = 0; j <= str1.length; j++) { 19682 if (i && j) 19683 if (str1.charAt(j - 1) === str2.charAt(i - 1)) 19684 value = prev; 19685 else 19686 value = Math.min(current[j], current[j - 1], prev) + 1; 19687 else 19688 value = i + j; 19689 19690 prev = current[j]; 19691 current[j] = value; 19692 } 19693 19694 return current.pop(); 19695 } 19696 }; 19697 19698 // Aliases 19699 19700 _s.strip = _s.trim; 19701 _s.lstrip = _s.ltrim; 19702 _s.rstrip = _s.rtrim; 19703 _s.center = _s.lrpad; 19704 _s.rjust = _s.lpad; 19705 _s.ljust = _s.rpad; 19706 _s.contains = _s.include; 19707 _s.q = _s.quote; 19708 19709 // Exporting 19710 19711 // CommonJS module is defined 19712 if (typeof exports !== 'undefined') { 19713 if (typeof module !== 'undefined' && module.exports) 19714 module.exports = _s; 19715 19716 exports._s = _s; 19717 } 19718 19719 // Register as a named module with AMD. 19720 if (typeof define === 'function' && define.amd) 19721 define('underscore.string', [], function(){ return _s; }); 19722 19723 19724 // Integrate with Underscore.js if defined 19725 // or create our own underscore object. 19726 root._ = root._ || {}; 19727 root._.string = root._.str = _s; 19728}(this, String); 19729/* ======================================================================== 19730 * Bootstrap: affix.js v3.4.1 19731 * https://getbootstrap.com/docs/3.4/javascript/#affix 19732 * ======================================================================== 19733 * Copyright 2011-2019 Twitter, Inc. 19734 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 19735 * ======================================================================== */ 19736 19737 19738+function ($) { 19739 'use strict'; 19740 19741 // AFFIX CLASS DEFINITION 19742 // ====================== 19743 19744 var Affix = function (element, options) { 19745 this.options = $.extend({}, Affix.DEFAULTS, options) 19746 19747 var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target) 19748 19749 this.$target = target 19750 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) 19751 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) 19752 19753 this.$element = $(element) 19754 this.affixed = null 19755 this.unpin = null 19756 this.pinnedOffset = null 19757 19758 this.checkPosition() 19759 } 19760 19761 Affix.VERSION = '3.4.1' 19762 19763 Affix.RESET = 'affix affix-top affix-bottom' 19764 19765 Affix.DEFAULTS = { 19766 offset: 0, 19767 target: window 19768 } 19769 19770 Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { 19771 var scrollTop = this.$target.scrollTop() 19772 var position = this.$element.offset() 19773 var targetHeight = this.$target.height() 19774 19775 if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false 19776 19777 if (this.affixed == 'bottom') { 19778 if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' 19779 return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' 19780 } 19781 19782 var initializing = this.affixed == null 19783 var colliderTop = initializing ? scrollTop : position.top 19784 var colliderHeight = initializing ? targetHeight : height 19785 19786 if (offsetTop != null && scrollTop <= offsetTop) return 'top' 19787 if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' 19788 19789 return false 19790 } 19791 19792 Affix.prototype.getPinnedOffset = function () { 19793 if (this.pinnedOffset) return this.pinnedOffset 19794 this.$element.removeClass(Affix.RESET).addClass('affix') 19795 var scrollTop = this.$target.scrollTop() 19796 var position = this.$element.offset() 19797 return (this.pinnedOffset = position.top - scrollTop) 19798 } 19799 19800 Affix.prototype.checkPositionWithEventLoop = function () { 19801 setTimeout($.proxy(this.checkPosition, this), 1) 19802 } 19803 19804 Affix.prototype.checkPosition = function () { 19805 if (!this.$element.is(':visible')) return 19806 19807 var height = this.$element.height() 19808 var offset = this.options.offset 19809 var offsetTop = offset.top 19810 var offsetBottom = offset.bottom 19811 var scrollHeight = Math.max($(document).height(), $(document.body).height()) 19812 19813 if (typeof offset != 'object') offsetBottom = offsetTop = offset 19814 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) 19815 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) 19816
vendor: 6,453 bytes, lines 19817-20061
19817 var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) 19818 19819 if (this.affixed != affix) { 19820 if (this.unpin != null) this.$element.css('top', '') 19821 19822 var affixType = 'affix' + (affix ? '-' + affix : '') 19823 var e = $.Event(affixType + '.bs.affix') 19824 19825 this.$element.trigger(e) 19826 19827 if (e.isDefaultPrevented()) return 19828 19829 this.affixed = affix 19830 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null 19831 19832 this.$element 19833 .removeClass(Affix.RESET) 19834 .addClass(affixType) 19835 .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') 19836 } 19837 19838 if (affix == 'bottom') { 19839 this.$element.offset({ 19840 top: scrollHeight - height - offsetBottom 19841 }) 19842 } 19843 } 19844 19845 19846 // AFFIX PLUGIN DEFINITION 19847 // ======================= 19848 19849 function Plugin(option) { 19850 return this.each(function () { 19851 var $this = $(this) 19852 var data = $this.data('bs.affix') 19853 var options = typeof option == 'object' && option 19854 19855 if (!data) $this.data('bs.affix', (data = new Affix(this, options))) 19856 if (typeof option == 'string') data[option]() 19857 }) 19858 } 19859 19860 var old = $.fn.affix 19861 19862 $.fn.affix = Plugin 19863 $.fn.affix.Constructor = Affix 19864 19865 19866 // AFFIX NO CONFLICT 19867 // ================= 19868 19869 $.fn.affix.noConflict = function () { 19870 $.fn.affix = old 19871 return this 19872 } 19873 19874 19875 // AFFIX DATA-API 19876 // ============== 19877 19878 $(window).on('load', function () { 19879 $('[data-spy="affix"]').each(function () { 19880 var $spy = $(this) 19881 var data = $spy.data() 19882 19883 data.offset = data.offset || {} 19884 19885 if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom 19886 if (data.offsetTop != null) data.offset.top = data.offsetTop 19887 19888 Plugin.call($spy, data) 19889 }) 19890 }) 19891 19892}(jQuery); 19893/* ======================================================================== 19894 * Bootstrap: alert.js v3.4.1 19895 * https://getbootstrap.com/docs/3.4/javascript/#alerts 19896 * ======================================================================== 19897 * Copyright 2011-2019 Twitter, Inc. 19898 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 19899 * ======================================================================== */ 19900 19901 19902+function ($) { 19903 'use strict'; 19904 19905 // ALERT CLASS DEFINITION 19906 // ====================== 19907 19908 var dismiss = '[data-dismiss="alert"]' 19909 var Alert = function (el) { 19910 $(el).on('click', dismiss, this.close) 19911 } 19912 19913 Alert.VERSION = '3.4.1' 19914 19915 Alert.TRANSITION_DURATION = 150 19916 19917 Alert.prototype.close = function (e) { 19918 var $this = $(this) 19919 var selector = $this.attr('data-target') 19920 19921 if (!selector) { 19922 selector = $this.attr('href') 19923 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 19924 } 19925 19926 selector = selector === '#' ? [] : selector 19927 var $parent = $(document).find(selector) 19928 19929 if (e) e.preventDefault() 19930 19931 if (!$parent.length) { 19932 $parent = $this.closest('.alert') 19933 } 19934 19935 $parent.trigger(e = $.Event('close.bs.alert')) 19936 19937 if (e.isDefaultPrevented()) return 19938 19939 $parent.removeClass('in') 19940 19941 function removeElement() { 19942 // detach from parent, fire event then clean up data 19943 $parent.detach().trigger('closed.bs.alert').remove() 19944 } 19945 19946 $.support.transition && $parent.hasClass('fade') ? 19947 $parent 19948 .one('bsTransitionEnd', removeElement) 19949 .emulateTransitionEnd(Alert.TRANSITION_DURATION) : 19950 removeElement() 19951 } 19952 19953 19954 // ALERT PLUGIN DEFINITION 19955 // ======================= 19956 19957 function Plugin(option) { 19958 return this.each(function () { 19959 var $this = $(this) 19960 var data = $this.data('bs.alert') 19961 19962 if (!data) $this.data('bs.alert', (data = new Alert(this))) 19963 if (typeof option == 'string') data[option].call($this) 19964 }) 19965 } 19966 19967 var old = $.fn.alert 19968 19969 $.fn.alert = Plugin 19970 $.fn.alert.Constructor = Alert 19971 19972 19973 // ALERT NO CONFLICT 19974 // ================= 19975 19976 $.fn.alert.noConflict = function () { 19977 $.fn.alert = old 19978 return this 19979 } 19980 19981 19982 // ALERT DATA-API 19983 // ============== 19984 19985 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 19986 19987}(jQuery); 19988/* ======================================================================== 19989 * Bootstrap: button.js v3.4.1 19990 * https://getbootstrap.com/docs/3.4/javascript/#buttons 19991 * ======================================================================== 19992 * Copyright 2011-2019 Twitter, Inc. 19993 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 19994 * ======================================================================== */ 19995 19996 19997+function ($) { 19998 'use strict'; 19999 20000 // BUTTON PUBLIC CLASS DEFINITION 20001 // ============================== 20002 20003 var Button = function (element, options) { 20004 this.$element = $(element) 20005 this.options = $.extend({}, Button.DEFAULTS, options) 20006 this.isLoading = false 20007 } 20008 20009 Button.VERSION = '3.4.1' 20010 20011 Button.DEFAULTS = { 20012 loadingText: 'loading...' 20013 } 20014 20015 Button.prototype.setState = function (state) { 20016 var d = 'disabled' 20017 var $el = this.$element 20018 var val = $el.is('input') ? 'val' : 'html' 20019 var data = $el.data() 20020 20021 state += 'Text' 20022 20023 if (data.resetText == null) $el.data('resetText', $el[val]()) 20024 20025 // push to event loop to allow forms to submit 20026 setTimeout($.proxy(function () { 20027 $el[val](data[state] == null ? this.options[state] : data[state]) 20028 20029 if (state == 'loadingText') { 20030 this.isLoading = true 20031 $el.addClass(d).attr(d, d).prop(d, true) 20032 } else if (this.isLoading) { 20033 this.isLoading = false 20034 $el.removeClass(d).removeAttr(d).prop(d, false) 20035 } 20036 }, this), 0) 20037 } 20038 20039 Button.prototype.toggle = function () { 20040 var changed = true 20041 var $parent = this.$element.closest('[data-toggle="buttons"]') 20042 20043 if ($parent.length) { 20044 var $input = this.$element.find('input') 20045 if ($input.prop('type') == 'radio') { 20046 if ($input.prop('checked')) changed = false 20047 $parent.find('.active').removeClass('active') 20048 this.$element.addClass('active') 20049 } else if ($input.prop('type') == 'checkbox') { 20050 if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false 20051 this.$element.toggleClass('active') 20052 } 20053 $input.prop('checked', this.$element.hasClass('active')) 20054 if (changed) $input.trigger('change') 20055 } else { 20056 this.$element.attr('aria-pressed', !this.$element.hasClass('active')) 20057 this.$element.toggleClass('active') 20058 } 20059 } 20060 20061
vendor: 6,040 bytes, lines 20062-20256
20062 // BUTTON PLUGIN DEFINITION 20063 // ======================== 20064 20065 function Plugin(option) { 20066 return this.each(function () { 20067 var $this = $(this) 20068 var data = $this.data('bs.button') 20069 var options = typeof option == 'object' && option 20070 20071 if (!data) $this.data('bs.button', (data = new Button(this, options))) 20072 20073 if (option == 'toggle') data.toggle() 20074 else if (option) data.setState(option) 20075 }) 20076 } 20077 20078 var old = $.fn.button 20079 20080 $.fn.button = Plugin 20081 $.fn.button.Constructor = Button 20082 20083 20084 // BUTTON NO CONFLICT 20085 // ================== 20086 20087 $.fn.button.noConflict = function () { 20088 $.fn.button = old 20089 return this 20090 } 20091 20092 20093 // BUTTON DATA-API 20094 // =============== 20095 20096 $(document) 20097 .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { 20098 var $btn = $(e.target).closest('.btn') 20099 Plugin.call($btn, 'toggle') 20100 if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { 20101 // Prevent double click on radios, and the double selections (so cancellation) on checkboxes 20102 e.preventDefault() 20103 // The target component still receive the focus 20104 if ($btn.is('input,button')) $btn.trigger('focus') 20105 else $btn.find('input:visible,button:visible').first().trigger('focus') 20106 } 20107 }) 20108 .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { 20109 $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) 20110 }) 20111 20112}(jQuery); 20113/* ======================================================================== 20114 * Bootstrap: carousel.js v3.4.1 20115 * https://getbootstrap.com/docs/3.4/javascript/#carousel 20116 * ======================================================================== 20117 * Copyright 2011-2019 Twitter, Inc. 20118 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 20119 * ======================================================================== */ 20120 20121 20122+function ($) { 20123 'use strict'; 20124 20125 // CAROUSEL CLASS DEFINITION 20126 // ========================= 20127 20128 var Carousel = function (element, options) { 20129 this.$element = $(element) 20130 this.$indicators = this.$element.find('.carousel-indicators') 20131 this.options = options 20132 this.paused = null 20133 this.sliding = null 20134 this.interval = null 20135 this.$active = null 20136 this.$items = null 20137 20138 this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) 20139 20140 this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element 20141 .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) 20142 .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) 20143 } 20144 20145 Carousel.VERSION = '3.4.1' 20146 20147 Carousel.TRANSITION_DURATION = 600 20148 20149 Carousel.DEFAULTS = { 20150 interval: 5000, 20151 pause: 'hover', 20152 wrap: true, 20153 keyboard: true 20154 } 20155 20156 Carousel.prototype.keydown = function (e) { 20157 if (/input|textarea/i.test(e.target.tagName)) return 20158 switch (e.which) { 20159 case 37: this.prev(); break 20160 case 39: this.next(); break 20161 default: return 20162 } 20163 20164 e.preventDefault() 20165 } 20166 20167 Carousel.prototype.cycle = function (e) { 20168 e || (this.paused = false) 20169 20170 this.interval && clearInterval(this.interval) 20171 20172 this.options.interval 20173 && !this.paused 20174 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) 20175 20176 return this 20177 } 20178 20179 Carousel.prototype.getItemIndex = function (item) { 20180 this.$items = item.parent().children('.item') 20181 return this.$items.index(item || this.$active) 20182 } 20183 20184 Carousel.prototype.getItemForDirection = function (direction, active) { 20185 var activeIndex = this.getItemIndex(active) 20186 var willWrap = (direction == 'prev' && activeIndex === 0) 20187 || (direction == 'next' && activeIndex == (this.$items.length - 1)) 20188 if (willWrap && !this.options.wrap) return active 20189 var delta = direction == 'prev' ? -1 : 1 20190 var itemIndex = (activeIndex + delta) % this.$items.length 20191 return this.$items.eq(itemIndex) 20192 } 20193 20194 Carousel.prototype.to = function (pos) { 20195 var that = this 20196 var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) 20197 20198 if (pos > (this.$items.length - 1) || pos < 0) return 20199 20200 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" 20201 if (activeIndex == pos) return this.pause().cycle() 20202 20203 return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) 20204 } 20205 20206 Carousel.prototype.pause = function (e) { 20207 e || (this.paused = true) 20208 20209 if (this.$element.find('.next, .prev').length && $.support.transition) { 20210 this.$element.trigger($.support.transition.end) 20211 this.cycle(true) 20212 } 20213 20214 this.interval = clearInterval(this.interval) 20215 20216 return this 20217 } 20218 20219 Carousel.prototype.next = function () { 20220 if (this.sliding) return 20221 return this.slide('next') 20222 } 20223 20224 Carousel.prototype.prev = function () { 20225 if (this.sliding) return 20226 return this.slide('prev') 20227 } 20228 20229 Carousel.prototype.slide = function (type, next) { 20230 var $active = this.$element.find('.item.active') 20231 var $next = next || this.getItemForDirection(type, $active) 20232 var isCycling = this.interval 20233 var direction = type == 'next' ? 'left' : 'right' 20234 var that = this 20235 20236 if ($next.hasClass('active')) return (this.sliding = false) 20237 20238 var relatedTarget = $next[0] 20239 var slideEvent = $.Event('slide.bs.carousel', { 20240 relatedTarget: relatedTarget, 20241 direction: direction 20242 }) 20243 this.$element.trigger(slideEvent) 20244 if (slideEvent.isDefaultPrevented()) return 20245 20246 this.sliding = true 20247 20248 isCycling && this.pause() 20249 20250 if (this.$indicators.length) { 20251 this.$indicators.find('.active').removeClass('active') 20252 var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) 20253 $nextIndicator && $nextIndicator.addClass('active') 20254 } 20255 20256 var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
vendor: 33,291 bytes, lines 20257-21432
20257 if ($.support.transition && this.$element.hasClass('slide')) { 20258 $next.addClass(type) 20259 if (typeof $next === 'object' && $next.length) { 20260 $next[0].offsetWidth // force reflow 20261 } 20262 $active.addClass(direction) 20263 $next.addClass(direction) 20264 $active 20265 .one('bsTransitionEnd', function () { 20266 $next.removeClass([type, direction].join(' ')).addClass('active') 20267 $active.removeClass(['active', direction].join(' ')) 20268 that.sliding = false 20269 setTimeout(function () { 20270 that.$element.trigger(slidEvent) 20271 }, 0) 20272 }) 20273 .emulateTransitionEnd(Carousel.TRANSITION_DURATION) 20274 } else { 20275 $active.removeClass('active') 20276 $next.addClass('active') 20277 this.sliding = false 20278 this.$element.trigger(slidEvent) 20279 } 20280 20281 isCycling && this.cycle() 20282 20283 return this 20284 } 20285 20286 20287 // CAROUSEL PLUGIN DEFINITION 20288 // ========================== 20289 20290 function Plugin(option) { 20291 return this.each(function () { 20292 var $this = $(this) 20293 var data = $this.data('bs.carousel') 20294 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) 20295 var action = typeof option == 'string' ? option : options.slide 20296 20297 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) 20298 if (typeof option == 'number') data.to(option) 20299 else if (action) data[action]() 20300 else if (options.interval) data.pause().cycle() 20301 }) 20302 } 20303 20304 var old = $.fn.carousel 20305 20306 $.fn.carousel = Plugin 20307 $.fn.carousel.Constructor = Carousel 20308 20309 20310 // CAROUSEL NO CONFLICT 20311 // ==================== 20312 20313 $.fn.carousel.noConflict = function () { 20314 $.fn.carousel = old 20315 return this 20316 } 20317 20318 20319 // CAROUSEL DATA-API 20320 // ================= 20321 20322 var clickHandler = function (e) { 20323 var $this = $(this) 20324 var href = $this.attr('href') 20325 if (href) { 20326 href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 20327 } 20328 20329 var target = $this.attr('data-target') || href 20330 var $target = $(document).find(target) 20331 20332 if (!$target.hasClass('carousel')) return 20333 20334 var options = $.extend({}, $target.data(), $this.data()) 20335 var slideIndex = $this.attr('data-slide-to') 20336 if (slideIndex) options.interval = false 20337 20338 Plugin.call($target, options) 20339 20340 if (slideIndex) { 20341 $target.data('bs.carousel').to(slideIndex) 20342 } 20343 20344 e.preventDefault() 20345 } 20346 20347 $(document) 20348 .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) 20349 .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) 20350 20351 $(window).on('load', function () { 20352 $('[data-ride="carousel"]').each(function () { 20353 var $carousel = $(this) 20354 Plugin.call($carousel, $carousel.data()) 20355 }) 20356 }) 20357 20358}(jQuery); 20359/* ======================================================================== 20360 * Bootstrap: collapse.js v3.4.1 20361 * https://getbootstrap.com/docs/3.4/javascript/#collapse 20362 * ======================================================================== 20363 * Copyright 2011-2019 Twitter, Inc. 20364 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 20365 * ======================================================================== */ 20366 20367/* jshint latedef: false */ 20368 20369+function ($) { 20370 'use strict'; 20371 20372 // COLLAPSE PUBLIC CLASS DEFINITION 20373 // ================================ 20374 20375 var Collapse = function (element, options) { 20376 this.$element = $(element) 20377 this.options = $.extend({}, Collapse.DEFAULTS, options) 20378 this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + 20379 '[data-toggle="collapse"][data-target="#' + element.id + '"]') 20380 this.transitioning = null 20381 20382 if (this.options.parent) { 20383 this.$parent = this.getParent() 20384 } else { 20385 this.addAriaAndCollapsedClass(this.$element, this.$trigger) 20386 } 20387 20388 if (this.options.toggle) this.toggle() 20389 } 20390 20391 Collapse.VERSION = '3.4.1' 20392 20393 Collapse.TRANSITION_DURATION = 350 20394 20395 Collapse.DEFAULTS = { 20396 toggle: true 20397 } 20398 20399 Collapse.prototype.dimension = function () { 20400 var hasWidth = this.$element.hasClass('width') 20401 return hasWidth ? 'width' : 'height' 20402 } 20403 20404 Collapse.prototype.show = function () { 20405 if (this.transitioning || this.$element.hasClass('in')) return 20406 20407 var activesData 20408 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') 20409 20410 if (actives && actives.length) { 20411 activesData = actives.data('bs.collapse') 20412 if (activesData && activesData.transitioning) return 20413 } 20414 20415 var startEvent = $.Event('show.bs.collapse') 20416 this.$element.trigger(startEvent) 20417 if (startEvent.isDefaultPrevented()) return 20418 20419 if (actives && actives.length) { 20420 Plugin.call(actives, 'hide') 20421 activesData || actives.data('bs.collapse', null) 20422 } 20423 20424 var dimension = this.dimension() 20425 20426 this.$element 20427 .removeClass('collapse') 20428 .addClass('collapsing')[dimension](0) 20429 .attr('aria-expanded', true) 20430 20431 this.$trigger 20432 .removeClass('collapsed') 20433 .attr('aria-expanded', true) 20434 20435 this.transitioning = 1 20436 20437 var complete = function () { 20438 this.$element 20439 .removeClass('collapsing') 20440 .addClass('collapse in')[dimension]('') 20441 this.transitioning = 0 20442 this.$element 20443 .trigger('shown.bs.collapse') 20444 } 20445 20446 if (!$.support.transition) return complete.call(this) 20447 20448 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 20449 20450 this.$element 20451 .one('bsTransitionEnd', $.proxy(complete, this)) 20452 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) 20453 } 20454 20455 Collapse.prototype.hide = function () { 20456 if (this.transitioning || !this.$element.hasClass('in')) return 20457 20458 var startEvent = $.Event('hide.bs.collapse') 20459 this.$element.trigger(startEvent) 20460 if (startEvent.isDefaultPrevented()) return 20461 20462 var dimension = this.dimension() 20463 20464 this.$element[dimension](this.$element[dimension]())[0].offsetHeight 20465 20466 this.$element 20467 .addClass('collapsing') 20468 .removeClass('collapse in') 20469 .attr('aria-expanded', false) 20470 20471 this.$trigger 20472 .addClass('collapsed') 20473 .attr('aria-expanded', false) 20474 20475 this.transitioning = 1 20476 20477 var complete = function () { 20478 this.transitioning = 0 20479 this.$element 20480 .removeClass('collapsing') 20481 .addClass('collapse') 20482 .trigger('hidden.bs.collapse') 20483 } 20484 20485 if (!$.support.transition) return complete.call(this) 20486 20487 this.$element 20488 [dimension](0) 20489 .one('bsTransitionEnd', $.proxy(complete, this)) 20490 .emulateTransitionEnd(Collapse.TRANSITION_DURATION) 20491 } 20492 20493 Collapse.prototype.toggle = function () { 20494 this[this.$element.hasClass('in') ? 'hide' : 'show']() 20495 } 20496 20497 Collapse.prototype.getParent = function () { 20498 return $(document).find(this.options.parent) 20499 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') 20500 .each($.proxy(function (i, element) { 20501 var $element = $(element) 20502 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) 20503 }, this)) 20504 .end() 20505 } 20506 20507 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { 20508 var isOpen = $element.hasClass('in') 20509 20510 $element.attr('aria-expanded', isOpen) 20511 $trigger 20512 .toggleClass('collapsed', !isOpen) 20513 .attr('aria-expanded', isOpen) 20514 } 20515 20516 function getTargetFromTrigger($trigger) { 20517 var href 20518 var target = $trigger.attr('data-target') 20519 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 20520 20521 return $(document).find(target) 20522 } 20523 20524 20525 // COLLAPSE PLUGIN DEFINITION 20526 // ========================== 20527 20528 function Plugin(option) { 20529 return this.each(function () { 20530 var $this = $(this) 20531 var data = $this.data('bs.collapse') 20532 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 20533 20534 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false 20535 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 20536 if (typeof option == 'string') data[option]() 20537 }) 20538 } 20539 20540 var old = $.fn.collapse 20541 20542 $.fn.collapse = Plugin 20543 $.fn.collapse.Constructor = Collapse 20544 20545 20546 // COLLAPSE NO CONFLICT 20547 // ==================== 20548 20549 $.fn.collapse.noConflict = function () { 20550 $.fn.collapse = old 20551 return this 20552 } 20553 20554 20555 // COLLAPSE DATA-API 20556 // ================= 20557 20558 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { 20559 var $this = $(this) 20560 20561 if (!$this.attr('data-target')) e.preventDefault() 20562 20563 var $target = getTargetFromTrigger($this) 20564 var data = $target.data('bs.collapse') 20565 var option = data ? 'toggle' : $this.data() 20566 20567 Plugin.call($target, option) 20568 }) 20569 20570}(jQuery); 20571/* ======================================================================== 20572 * Bootstrap: dropdown.js v3.4.1 20573 * https://getbootstrap.com/docs/3.4/javascript/#dropdowns 20574 * ======================================================================== 20575 * Copyright 2011-2019 Twitter, Inc. 20576 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 20577 * ======================================================================== */ 20578 20579 20580+function ($) { 20581 'use strict'; 20582 20583 // DROPDOWN CLASS DEFINITION 20584 // ========================= 20585 20586 var backdrop = '.dropdown-backdrop' 20587 var toggle = '[data-toggle="dropdown"]' 20588 var Dropdown = function (element) { 20589 $(element).on('click.bs.dropdown', this.toggle) 20590 } 20591 20592 Dropdown.VERSION = '3.4.1' 20593 20594 function getParent($this) { 20595 var selector = $this.attr('data-target') 20596 20597 if (!selector) { 20598 selector = $this.attr('href') 20599 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 20600 } 20601 20602 var $parent = selector !== '#' ? $(document).find(selector) : null 20603 20604 return $parent && $parent.length ? $parent : $this.parent() 20605 } 20606 20607 function clearMenus(e) { 20608 if (e && e.which === 3) return 20609 $(backdrop).remove() 20610 $(toggle).each(function () { 20611 var $this = $(this) 20612 var $parent = getParent($this) 20613 var relatedTarget = { relatedTarget: this } 20614 20615 if (!$parent.hasClass('open')) return 20616 20617 if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return 20618 20619 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) 20620 20621 if (e.isDefaultPrevented()) return 20622 20623 $this.attr('aria-expanded', 'false') 20624 $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) 20625 }) 20626 } 20627 20628 Dropdown.prototype.toggle = function (e) { 20629 var $this = $(this) 20630 20631 if ($this.is('.disabled, :disabled')) return 20632 20633 var $parent = getParent($this) 20634 var isActive = $parent.hasClass('open') 20635 20636 clearMenus() 20637 20638 if (!isActive) { 20639 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 20640 // if mobile we use a backdrop because click events don't delegate 20641 $(document.createElement('div')) 20642 .addClass('dropdown-backdrop') 20643 .insertAfter($(this)) 20644 .on('click', clearMenus) 20645 } 20646 20647 var relatedTarget = { relatedTarget: this } 20648 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) 20649 20650 if (e.isDefaultPrevented()) return 20651 20652 $this 20653 .trigger('focus') 20654 .attr('aria-expanded', 'true') 20655 20656 $parent 20657 .toggleClass('open') 20658 .trigger($.Event('shown.bs.dropdown', relatedTarget)) 20659 } 20660 20661 return false 20662 } 20663 20664 Dropdown.prototype.keydown = function (e) { 20665 if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return 20666 20667 var $this = $(this) 20668 20669 e.preventDefault() 20670 e.stopPropagation() 20671 20672 if ($this.is('.disabled, :disabled')) return 20673 20674 var $parent = getParent($this) 20675 var isActive = $parent.hasClass('open') 20676 20677 if (!isActive && e.which != 27 || isActive && e.which == 27) { 20678 if (e.which == 27) $parent.find(toggle).trigger('focus') 20679 return $this.trigger('click') 20680 } 20681 20682 var desc = ' li:not(.disabled):visible a' 20683 var $items = $parent.find('.dropdown-menu' + desc) 20684 20685 if (!$items.length) return 20686 20687 var index = $items.index(e.target) 20688 20689 if (e.which == 38 && index > 0) index-- // up 20690 if (e.which == 40 && index < $items.length - 1) index++ // down 20691 if (!~index) index = 0 20692 20693 $items.eq(index).trigger('focus') 20694 } 20695 20696 20697 // DROPDOWN PLUGIN DEFINITION 20698 // ========================== 20699 20700 function Plugin(option) { 20701 return this.each(function () { 20702 var $this = $(this) 20703 var data = $this.data('bs.dropdown') 20704 20705 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) 20706 if (typeof option == 'string') data[option].call($this) 20707 }) 20708 } 20709 20710 var old = $.fn.dropdown 20711 20712 $.fn.dropdown = Plugin 20713 $.fn.dropdown.Constructor = Dropdown 20714 20715 20716 // DROPDOWN NO CONFLICT 20717 // ==================== 20718 20719 $.fn.dropdown.noConflict = function () { 20720 $.fn.dropdown = old 20721 return this 20722 } 20723 20724 20725 // APPLY TO STANDARD DROPDOWN ELEMENTS 20726 // =================================== 20727 20728 $(document) 20729 .on('click.bs.dropdown.data-api', clearMenus) 20730 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) 20731 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) 20732 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) 20733 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) 20734 20735}(jQuery); 20736/* ======================================================================== 20737 * Bootstrap: modal.js v3.4.1 20738 * https://getbootstrap.com/docs/3.4/javascript/#modals 20739 * ======================================================================== 20740 * Copyright 2011-2019 Twitter, Inc. 20741 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 20742 * ======================================================================== */ 20743 20744 20745+function ($) { 20746 'use strict'; 20747 20748 // MODAL CLASS DEFINITION 20749 // ====================== 20750 20751 var Modal = function (element, options) { 20752 this.options = options 20753 this.$body = $(document.body) 20754 this.$element = $(element) 20755 this.$dialog = this.$element.find('.modal-dialog') 20756 this.$backdrop = null 20757 this.isShown = null 20758 this.originalBodyPad = null 20759 this.scrollbarWidth = 0 20760 this.ignoreBackdropClick = false 20761 this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom' 20762 20763 if (this.options.remote) { 20764 this.$element 20765 .find('.modal-content') 20766 .load(this.options.remote, $.proxy(function () { 20767 this.$element.trigger('loaded.bs.modal') 20768 }, this)) 20769 } 20770 } 20771 20772 Modal.VERSION = '3.4.1' 20773 20774 Modal.TRANSITION_DURATION = 300 20775 Modal.BACKDROP_TRANSITION_DURATION = 150 20776 20777 Modal.DEFAULTS = { 20778 backdrop: true, 20779 keyboard: true, 20780 show: true 20781 } 20782 20783 Modal.prototype.toggle = function (_relatedTarget) { 20784 return this.isShown ? this.hide() : this.show(_relatedTarget) 20785 } 20786 20787 Modal.prototype.show = function (_relatedTarget) { 20788 var that = this 20789 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) 20790 20791 this.$element.trigger(e) 20792 20793 if (this.isShown || e.isDefaultPrevented()) return 20794 20795 this.isShown = true 20796 20797 this.checkScrollbar() 20798 this.setScrollbar() 20799 this.$body.addClass('modal-open') 20800 20801 this.escape() 20802 this.resize() 20803 20804 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) 20805 20806 this.$dialog.on('mousedown.dismiss.bs.modal', function () { 20807 that.$element.one('mouseup.dismiss.bs.modal', function (e) { 20808 if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true 20809 }) 20810 }) 20811 20812 this.backdrop(function () { 20813 var transition = $.support.transition && that.$element.hasClass('fade') 20814 20815 if (!that.$element.parent().length) { 20816 that.$element.appendTo(that.$body) // don't move modals dom position 20817 } 20818 20819 that.$element 20820 .show() 20821 .scrollTop(0) 20822 20823 that.adjustDialog() 20824 20825 if (transition) { 20826 that.$element[0].offsetWidth // force reflow 20827 } 20828 20829 that.$element.addClass('in') 20830 20831 that.enforceFocus() 20832 20833 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) 20834 20835 transition ? 20836 that.$dialog // wait for modal to slide in 20837 .one('bsTransitionEnd', function () { 20838 that.$element.trigger('focus').trigger(e) 20839 }) 20840 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 20841 that.$element.trigger('focus').trigger(e) 20842 }) 20843 } 20844 20845 Modal.prototype.hide = function (e) { 20846 if (e) e.preventDefault() 20847 20848 e = $.Event('hide.bs.modal') 20849 20850 this.$element.trigger(e) 20851 20852 if (!this.isShown || e.isDefaultPrevented()) return 20853 20854 this.isShown = false 20855 20856 this.escape() 20857 this.resize() 20858 20859 $(document).off('focusin.bs.modal') 20860 20861 this.$element 20862 .removeClass('in') 20863 .off('click.dismiss.bs.modal') 20864 .off('mouseup.dismiss.bs.modal') 20865 20866 this.$dialog.off('mousedown.dismiss.bs.modal') 20867 20868 $.support.transition && this.$element.hasClass('fade') ? 20869 this.$element 20870 .one('bsTransitionEnd', $.proxy(this.hideModal, this)) 20871 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 20872 this.hideModal() 20873 } 20874 20875 Modal.prototype.enforceFocus = function () { 20876 $(document) 20877 .off('focusin.bs.modal') // guard against infinite focus loop 20878 .on('focusin.bs.modal', $.proxy(function (e) { 20879 if (document !== e.target && 20880 this.$element[0] !== e.target && 20881 !this.$element.has(e.target).length) { 20882 this.$element.trigger('focus') 20883 } 20884 }, this)) 20885 } 20886 20887 Modal.prototype.escape = function () { 20888 if (this.isShown && this.options.keyboard) { 20889 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { 20890 e.which == 27 && this.hide() 20891 }, this)) 20892 } else if (!this.isShown) { 20893 this.$element.off('keydown.dismiss.bs.modal') 20894 } 20895 } 20896 20897 Modal.prototype.resize = function () { 20898 if (this.isShown) { 20899 $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) 20900 } else { 20901 $(window).off('resize.bs.modal') 20902 } 20903 } 20904 20905 Modal.prototype.hideModal = function () { 20906 var that = this 20907 this.$element.hide() 20908 this.backdrop(function () { 20909 that.$body.removeClass('modal-open') 20910 that.resetAdjustments() 20911 that.resetScrollbar() 20912 that.$element.trigger('hidden.bs.modal') 20913 }) 20914 } 20915 20916 Modal.prototype.removeBackdrop = function () { 20917 this.$backdrop && this.$backdrop.remove() 20918 this.$backdrop = null 20919 } 20920 20921 Modal.prototype.backdrop = function (callback) { 20922 var that = this 20923 var animate = this.$element.hasClass('fade') ? 'fade' : '' 20924 20925 if (this.isShown && this.options.backdrop) { 20926 var doAnimate = $.support.transition && animate 20927 20928 this.$backdrop = $(document.createElement('div')) 20929 .addClass('modal-backdrop ' + animate) 20930 .appendTo(this.$body) 20931 20932 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { 20933 if (this.ignoreBackdropClick) { 20934 this.ignoreBackdropClick = false 20935 return 20936 } 20937 if (e.target !== e.currentTarget) return 20938 this.options.backdrop == 'static' 20939 ? this.$element[0].focus() 20940 : this.hide() 20941 }, this)) 20942 20943 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow 20944 20945 this.$backdrop.addClass('in') 20946 20947 if (!callback) return 20948 20949 doAnimate ? 20950 this.$backdrop 20951 .one('bsTransitionEnd', callback) 20952 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 20953 callback() 20954 20955 } else if (!this.isShown && this.$backdrop) { 20956 this.$backdrop.removeClass('in') 20957 20958 var callbackRemove = function () { 20959 that.removeBackdrop() 20960 callback && callback() 20961 } 20962 $.support.transition && this.$element.hasClass('fade') ? 20963 this.$backdrop 20964 .one('bsTransitionEnd', callbackRemove) 20965 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 20966 callbackRemove() 20967 20968 } else if (callback) { 20969 callback() 20970 } 20971 } 20972 20973 // these following methods are used to handle overflowing modals 20974 20975 Modal.prototype.handleUpdate = function () { 20976 this.adjustDialog() 20977 } 20978 20979 Modal.prototype.adjustDialog = function () { 20980 var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight 20981 20982 this.$element.css({ 20983 paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', 20984 paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' 20985 }) 20986 } 20987 20988 Modal.prototype.resetAdjustments = function () { 20989 this.$element.css({ 20990 paddingLeft: '', 20991 paddingRight: '' 20992 }) 20993 } 20994 20995 Modal.prototype.checkScrollbar = function () { 20996 var fullWindowWidth = window.innerWidth 20997 if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 20998 var documentElementRect = document.documentElement.getBoundingClientRect() 20999 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) 21000 } 21001 this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth 21002 this.scrollbarWidth = this.measureScrollbar() 21003 } 21004 21005 Modal.prototype.setScrollbar = function () { 21006 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) 21007 this.originalBodyPad = document.body.style.paddingRight || '' 21008 var scrollbarWidth = this.scrollbarWidth 21009 if (this.bodyIsOverflowing) { 21010 this.$body.css('padding-right', bodyPad + scrollbarWidth) 21011 $(this.fixedContent).each(function (index, element) { 21012 var actualPadding = element.style.paddingRight 21013 var calculatedPadding = $(element).css('padding-right') 21014 $(element) 21015 .data('padding-right', actualPadding) 21016 .css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px') 21017 }) 21018 } 21019 } 21020 21021 Modal.prototype.resetScrollbar = function () { 21022 this.$body.css('padding-right', this.originalBodyPad) 21023 $(this.fixedContent).each(function (index, element) { 21024 var padding = $(element).data('padding-right') 21025 $(element).removeData('padding-right') 21026 element.style.paddingRight = padding ? padding : '' 21027 }) 21028 } 21029 21030 Modal.prototype.measureScrollbar = function () { // thx walsh 21031 var scrollDiv = document.createElement('div') 21032 scrollDiv.className = 'modal-scrollbar-measure' 21033 this.$body.append(scrollDiv) 21034 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth 21035 this.$body[0].removeChild(scrollDiv) 21036 return scrollbarWidth 21037 } 21038 21039 21040 // MODAL PLUGIN DEFINITION 21041 // ======================= 21042 21043 function Plugin(option, _relatedTarget) { 21044 return this.each(function () { 21045 var $this = $(this) 21046 var data = $this.data('bs.modal') 21047 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) 21048 21049 if (!data) $this.data('bs.modal', (data = new Modal(this, options))) 21050 if (typeof option == 'string') data[option](_relatedTarget) 21051 else if (options.show) data.show(_relatedTarget) 21052 }) 21053 } 21054 21055 var old = $.fn.modal 21056 21057 $.fn.modal = Plugin 21058 $.fn.modal.Constructor = Modal 21059 21060 21061 // MODAL NO CONFLICT 21062 // ================= 21063 21064 $.fn.modal.noConflict = function () { 21065 $.fn.modal = old 21066 return this 21067 } 21068 21069 21070 // MODAL DATA-API 21071 // ============== 21072 21073 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { 21074 var $this = $(this) 21075 var href = $this.attr('href') 21076 var target = $this.attr('data-target') || 21077 (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 21078 21079 var $target = $(document).find(target) 21080 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) 21081 21082 if ($this.is('a')) e.preventDefault() 21083 21084 $target.one('show.bs.modal', function (showEvent) { 21085 if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown 21086 $target.one('hidden.bs.modal', function () { 21087 $this.is(':visible') && $this.trigger('focus') 21088 }) 21089 }) 21090 Plugin.call($target, option, this) 21091 }) 21092 21093}(jQuery); 21094/* ======================================================================== 21095 * Bootstrap: scrollspy.js v3.4.1 21096 * https://getbootstrap.com/docs/3.4/javascript/#scrollspy 21097 * ======================================================================== 21098 * Copyright 2011-2019 Twitter, Inc. 21099 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 21100 * ======================================================================== */ 21101 21102 21103+function ($) { 21104 'use strict'; 21105 21106 // SCROLLSPY CLASS DEFINITION 21107 // ========================== 21108 21109 function ScrollSpy(element, options) { 21110 this.$body = $(document.body) 21111 this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) 21112 this.options = $.extend({}, ScrollSpy.DEFAULTS, options) 21113 this.selector = (this.options.target || '') + ' .nav li > a' 21114 this.offsets = [] 21115 this.targets = [] 21116 this.activeTarget = null 21117 this.scrollHeight = 0 21118 21119 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) 21120 this.refresh() 21121 this.process() 21122 } 21123 21124 ScrollSpy.VERSION = '3.4.1' 21125 21126 ScrollSpy.DEFAULTS = { 21127 offset: 10 21128 } 21129 21130 ScrollSpy.prototype.getScrollHeight = function () { 21131 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) 21132 } 21133 21134 ScrollSpy.prototype.refresh = function () { 21135 var that = this 21136 var offsetMethod = 'offset' 21137 var offsetBase = 0 21138 21139 this.offsets = [] 21140 this.targets = [] 21141 this.scrollHeight = this.getScrollHeight() 21142 21143 if (!$.isWindow(this.$scrollElement[0])) { 21144 offsetMethod = 'position' 21145 offsetBase = this.$scrollElement.scrollTop() 21146 } 21147 21148 this.$body 21149 .find(this.selector) 21150 .map(function () { 21151 var $el = $(this) 21152 var href = $el.data('target') || $el.attr('href') 21153 var $href = /^#./.test(href) && $(href) 21154 21155 return ($href 21156 && $href.length 21157 && $href.is(':visible') 21158 && [[$href[offsetMethod]().top + offsetBase, href]]) || null 21159 }) 21160 .sort(function (a, b) { return a[0] - b[0] }) 21161 .each(function () { 21162 that.offsets.push(this[0]) 21163 that.targets.push(this[1]) 21164 }) 21165 } 21166 21167 ScrollSpy.prototype.process = function () { 21168 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 21169 var scrollHeight = this.getScrollHeight() 21170 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() 21171 var offsets = this.offsets 21172 var targets = this.targets 21173 var activeTarget = this.activeTarget 21174 var i 21175 21176 if (this.scrollHeight != scrollHeight) { 21177 this.refresh() 21178 } 21179 21180 if (scrollTop >= maxScroll) { 21181 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) 21182 } 21183 21184 if (activeTarget && scrollTop < offsets[0]) { 21185 this.activeTarget = null 21186 return this.clear() 21187 } 21188 21189 for (i = offsets.length; i--;) { 21190 activeTarget != targets[i] 21191 && scrollTop >= offsets[i] 21192 && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) 21193 && this.activate(targets[i]) 21194 } 21195 } 21196 21197 ScrollSpy.prototype.activate = function (target) { 21198 this.activeTarget = target 21199 21200 this.clear() 21201 21202 var selector = this.selector + 21203 '[data-target="' + target + '"],' + 21204 this.selector + '[href="' + target + '"]' 21205 21206 var active = $(selector) 21207 .parents('li') 21208 .addClass('active') 21209 21210 if (active.parent('.dropdown-menu').length) { 21211 active = active 21212 .closest('li.dropdown') 21213 .addClass('active') 21214 } 21215 21216 active.trigger('activate.bs.scrollspy') 21217 } 21218 21219 ScrollSpy.prototype.clear = function () { 21220 $(this.selector) 21221 .parentsUntil(this.options.target, '.active') 21222 .removeClass('active') 21223 } 21224 21225 21226 // SCROLLSPY PLUGIN DEFINITION 21227 // =========================== 21228 21229 function Plugin(option) { 21230 return this.each(function () { 21231 var $this = $(this) 21232 var data = $this.data('bs.scrollspy') 21233 var options = typeof option == 'object' && option 21234 21235 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) 21236 if (typeof option == 'string') data[option]() 21237 }) 21238 } 21239 21240 var old = $.fn.scrollspy 21241 21242 $.fn.scrollspy = Plugin 21243 $.fn.scrollspy.Constructor = ScrollSpy 21244 21245 21246 // SCROLLSPY NO CONFLICT 21247 // ===================== 21248 21249 $.fn.scrollspy.noConflict = function () { 21250 $.fn.scrollspy = old 21251 return this 21252 } 21253 21254 21255 // SCROLLSPY DATA-API 21256 // ================== 21257 21258 $(window).on('load.bs.scrollspy.data-api', function () { 21259 $('[data-spy="scroll"]').each(function () { 21260 var $spy = $(this) 21261 Plugin.call($spy, $spy.data()) 21262 }) 21263 }) 21264 21265}(jQuery); 21266/* ======================================================================== 21267 * Bootstrap: tab.js v3.4.1 21268 * https://getbootstrap.com/docs/3.4/javascript/#tabs 21269 * ======================================================================== 21270 * Copyright 2011-2019 Twitter, Inc. 21271 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 21272 * ======================================================================== */ 21273 21274 21275+function ($) { 21276 'use strict'; 21277 21278 // TAB CLASS DEFINITION 21279 // ==================== 21280 21281 var Tab = function (element) { 21282 // jscs:disable requireDollarBeforejQueryAssignment 21283 this.element = $(element) 21284 // jscs:enable requireDollarBeforejQueryAssignment 21285 } 21286 21287 Tab.VERSION = '3.4.1' 21288 21289 Tab.TRANSITION_DURATION = 150 21290 21291 Tab.prototype.show = function () { 21292 var $this = this.element 21293 var $ul = $this.closest('ul:not(.dropdown-menu)') 21294 var selector = $this.data('target') 21295 21296 if (!selector) { 21297 selector = $this.attr('href') 21298 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 21299 } 21300 21301 if ($this.parent('li').hasClass('active')) return 21302 21303 var $previous = $ul.find('.active:last a') 21304 var hideEvent = $.Event('hide.bs.tab', { 21305 relatedTarget: $this[0] 21306 }) 21307 var showEvent = $.Event('show.bs.tab', { 21308 relatedTarget: $previous[0] 21309 }) 21310 21311 $previous.trigger(hideEvent) 21312 $this.trigger(showEvent) 21313 21314 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return 21315 21316 var $target = $(document).find(selector) 21317 21318 this.activate($this.closest('li'), $ul) 21319 this.activate($target, $target.parent(), function () { 21320 $previous.trigger({ 21321 type: 'hidden.bs.tab', 21322 relatedTarget: $this[0] 21323 }) 21324 $this.trigger({ 21325 type: 'shown.bs.tab', 21326 relatedTarget: $previous[0] 21327 }) 21328 }) 21329 } 21330 21331 Tab.prototype.activate = function (element, container, callback) { 21332 var $active = container.find('> .active') 21333 var transition = callback 21334 && $.support.transition 21335 && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) 21336 21337 function next() { 21338 $active 21339 .removeClass('active') 21340 .find('> .dropdown-menu > .active') 21341 .removeClass('active') 21342 .end() 21343 .find('[data-toggle="tab"]') 21344 .attr('aria-expanded', false) 21345 21346 element 21347 .addClass('active') 21348 .find('[data-toggle="tab"]') 21349 .attr('aria-expanded', true) 21350 21351 if (transition) { 21352 element[0].offsetWidth // reflow for transition 21353 element.addClass('in') 21354 } else { 21355 element.removeClass('fade') 21356 } 21357 21358 if (element.parent('.dropdown-menu').length) { 21359 element 21360 .closest('li.dropdown') 21361 .addClass('active') 21362 .end() 21363 .find('[data-toggle="tab"]') 21364 .attr('aria-expanded', true) 21365 } 21366 21367 callback && callback() 21368 } 21369 21370 $active.length && transition ? 21371 $active 21372 .one('bsTransitionEnd', next) 21373 .emulateTransitionEnd(Tab.TRANSITION_DURATION) : 21374 next() 21375 21376 $active.removeClass('in') 21377 } 21378 21379 21380 // TAB PLUGIN DEFINITION 21381 // ===================== 21382 21383 function Plugin(option) { 21384 return this.each(function () { 21385 var $this = $(this) 21386 var data = $this.data('bs.tab') 21387 21388 if (!data) $this.data('bs.tab', (data = new Tab(this))) 21389 if (typeof option == 'string') data[option]() 21390 }) 21391 } 21392 21393 var old = $.fn.tab 21394 21395 $.fn.tab = Plugin 21396 $.fn.tab.Constructor = Tab 21397 21398 21399 // TAB NO CONFLICT 21400 // =============== 21401 21402 $.fn.tab.noConflict = function () { 21403 $.fn.tab = old 21404 return this 21405 } 21406 21407 21408 // TAB DATA-API 21409 // ============ 21410 21411 var clickHandler = function (e) { 21412 e.preventDefault() 21413 Plugin.call($(this), 'show') 21414 } 21415 21416 $(document) 21417 .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) 21418 .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) 21419 21420}(jQuery); 21421/* ======================================================================== 21422 * Bootstrap: transition.js v3.4.1 21423 * https://getbootstrap.com/docs/3.4/javascript/#transitions 21424 * ======================================================================== 21425 * Copyright 2011-2019 Twitter, Inc. 21426 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 21427 * ======================================================================== */ 21428 21429 21430+function ($) { 21431 'use strict'; 21432
vendor: 1,361 bytes, lines 21433-21479
21433 // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/) 21434 // ============================================================ 21435 21436 function transitionEnd() { 21437 var el = document.createElement('bootstrap') 21438 21439 var transEndEventNames = { 21440 WebkitTransition : 'webkitTransitionEnd', 21441 MozTransition : 'transitionend', 21442 OTransition : 'oTransitionEnd otransitionend', 21443 transition : 'transitionend' 21444 } 21445 21446 for (var name in transEndEventNames) { 21447 if (el.style[name] !== undefined) { 21448 return { end: transEndEventNames[name] } 21449 } 21450 } 21451 21452 return false // explicit for ie8 ( ._.) 21453 } 21454 21455 // https://blog.alexmaccaw.com/css-transitions 21456 $.fn.emulateTransitionEnd = function (duration) { 21457 var called = false 21458 var $el = this 21459 $(this).one('bsTransitionEnd', function () { called = true }) 21460 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 21461 setTimeout(callback, duration) 21462 return this 21463 } 21464 21465 $(function () { 21466 $.support.transition = transitionEnd() 21467 21468 if (!$.support.transition) return 21469 21470 $.event.special.bsTransitionEnd = { 21471 bindType: $.support.transition.end, 21472 delegateType: $.support.transition.end, 21473 handle: function (e) { 21474 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 21475 } 21476 } 21477 }) 21478 21479}(jQuery);
vendor: 21,138 bytes, lines 21479-22156
21479 21480/* ======================================================================== 21481 * Bootstrap: tooltip.js v3.4.1 21482 * https://getbootstrap.com/docs/3.4/javascript/#tooltip 21483 * Inspired by the original jQuery.tipsy by Jason Frame 21484 * ======================================================================== 21485 * Copyright 2011-2019 Twitter, Inc. 21486 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 21487 * ======================================================================== */ 21488 21489+function ($) { 21490 'use strict'; 21491 21492 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'] 21493 21494 var uriAttrs = [ 21495 'background', 21496 'cite', 21497 'href', 21498 'itemtype', 21499 'longdesc', 21500 'poster', 21501 'src', 21502 'xlink:href' 21503 ] 21504 21505 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i 21506 21507 var DefaultWhitelist = { 21508 // Global attributes allowed on any supplied element below. 21509 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 21510 a: ['target', 'href', 'title', 'rel'], 21511 area: [], 21512 b: [], 21513 br: [], 21514 col: [], 21515 code: [], 21516 div: [], 21517 em: [], 21518 hr: [], 21519 h1: [], 21520 h2: [], 21521 h3: [], 21522 h4: [], 21523 h5: [], 21524 h6: [], 21525 i: [], 21526 img: ['src', 'alt', 'title', 'width', 'height'], 21527 li: [], 21528 ol: [], 21529 p: [], 21530 pre: [], 21531 s: [], 21532 small: [], 21533 span: [], 21534 sub: [], 21535 sup: [], 21536 strong: [], 21537 u: [], 21538 ul: [] 21539 } 21540 21541 /** 21542 * A pattern that recognizes a commonly useful subset of URLs that are safe. 21543 * 21544 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 21545 */ 21546 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi 21547 21548 /** 21549 * A pattern that matches safe data URLs. Only matches image, video and audio types. 21550 * 21551 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 21552 */ 21553 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i 21554 21555 function allowedAttribute(attr, allowedAttributeList) { 21556 var attrName = attr.nodeName.toLowerCase() 21557 21558 if ($.inArray(attrName, allowedAttributeList) !== -1) { 21559 if ($.inArray(attrName, uriAttrs) !== -1) { 21560 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)) 21561 } 21562 21563 return true 21564 } 21565 21566 var regExp = $(allowedAttributeList).filter(function (index, value) { 21567 return value instanceof RegExp 21568 }) 21569 21570 // Check if a regular expression validates the attribute. 21571 for (var i = 0, l = regExp.length; i < l; i++) { 21572 if (attrName.match(regExp[i])) { 21573 return true 21574 } 21575 } 21576 21577 return false 21578 } 21579 21580 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 21581 if (unsafeHtml.length === 0) { 21582 return unsafeHtml 21583 } 21584 21585 if (sanitizeFn && typeof sanitizeFn === 'function') { 21586 return sanitizeFn(unsafeHtml) 21587 } 21588 21589 // IE 8 and below don't support createHTMLDocument 21590 if (!document.implementation || !document.implementation.createHTMLDocument) { 21591 return unsafeHtml 21592 } 21593 21594 var createdDocument = document.implementation.createHTMLDocument('sanitization') 21595 createdDocument.body.innerHTML = unsafeHtml 21596 21597 var whitelistKeys = $.map(whiteList, function (el, i) { return i }) 21598 var elements = $(createdDocument.body).find('*') 21599 21600 for (var i = 0, len = elements.length; i < len; i++) { 21601 var el = elements[i] 21602 var elName = el.nodeName.toLowerCase() 21603 21604 if ($.inArray(elName, whitelistKeys) === -1) { 21605 el.parentNode.removeChild(el) 21606 21607 continue 21608 } 21609 21610 var attributeList = $.map(el.attributes, function (el) { return el }) 21611 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []) 21612 21613 for (var j = 0, len2 = attributeList.length; j < len2; j++) { 21614 if (!allowedAttribute(attributeList[j], whitelistedAttributes)) { 21615 el.removeAttribute(attributeList[j].nodeName) 21616 } 21617 } 21618 } 21619 21620 return createdDocument.body.innerHTML 21621 } 21622 21623 // TOOLTIP PUBLIC CLASS DEFINITION 21624 // =============================== 21625 21626 var Tooltip = function (element, options) { 21627 this.type = null 21628 this.options = null 21629 this.enabled = null 21630 this.timeout = null 21631 this.hoverState = null 21632 this.$element = null 21633 this.inState = null 21634 21635 this.init('tooltip', element, options) 21636 } 21637 21638 Tooltip.VERSION = '3.4.1' 21639 21640 Tooltip.TRANSITION_DURATION = 150 21641 21642 Tooltip.DEFAULTS = { 21643 animation: true, 21644 placement: 'top', 21645 selector: false, 21646 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 21647 trigger: 'hover focus', 21648 title: '', 21649 delay: 0, 21650 html: false, 21651 container: false, 21652 viewport: { 21653 selector: 'body', 21654 padding: 0 21655 }, 21656 sanitize : true, 21657 sanitizeFn : null, 21658 whiteList : DefaultWhitelist 21659 } 21660 21661 Tooltip.prototype.init = function (type, element, options) { 21662 this.enabled = true 21663 this.type = type 21664 this.$element = $(element) 21665 this.options = this.getOptions(options) 21666 this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) 21667 this.inState = { click: false, hover: false, focus: false } 21668 21669 if (this.$element[0] instanceof document.constructor && !this.options.selector) { 21670 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') 21671 } 21672 21673 var triggers = this.options.trigger.split(' ') 21674 21675 for (var i = triggers.length; i--;) { 21676 var trigger = triggers[i] 21677 21678 if (trigger == 'click') { 21679 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 21680 } else if (trigger != 'manual') { 21681 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' 21682 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' 21683 21684 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 21685 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 21686 } 21687 } 21688 21689 this.options.selector ? 21690 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 21691 this.fixTitle() 21692 } 21693 21694 Tooltip.prototype.getDefaults = function () { 21695 return Tooltip.DEFAULTS 21696 } 21697 21698 Tooltip.prototype.getOptions = function (options) { 21699 var dataAttributes = this.$element.data() 21700 21701 for (var dataAttr in dataAttributes) { 21702 if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) { 21703 delete dataAttributes[dataAttr] 21704 } 21705 } 21706 21707 options = $.extend({}, this.getDefaults(), dataAttributes, options) 21708 21709 if (options.delay && typeof options.delay == 'number') { 21710 options.delay = { 21711 show: options.delay, 21712 hide: options.delay 21713 } 21714 } 21715 21716 if (options.sanitize) { 21717 options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn) 21718 } 21719 21720 return options 21721 } 21722 21723 Tooltip.prototype.getDelegateOptions = function () { 21724 var options = {} 21725 var defaults = this.getDefaults() 21726 21727 this._options && $.each(this._options, function (key, value) { 21728 if (defaults[key] != value) options[key] = value 21729 }) 21730 21731 return options 21732 } 21733 21734 Tooltip.prototype.enter = function (obj) { 21735 var self = obj instanceof this.constructor ? 21736 obj : $(obj.currentTarget).data('bs.' + this.type) 21737 21738 if (!self) { 21739 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 21740 $(obj.currentTarget).data('bs.' + this.type, self) 21741 } 21742 21743 if (obj instanceof $.Event) { 21744 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true 21745 } 21746 21747 if (self.tip().hasClass('in') || self.hoverState == 'in') { 21748 self.hoverState = 'in' 21749 return 21750 } 21751 21752 clearTimeout(self.timeout) 21753 21754 self.hoverState = 'in' 21755 21756 if (!self.options.delay || !self.options.delay.show) return self.show() 21757 21758 self.timeout = setTimeout(function () { 21759 if (self.hoverState == 'in') self.show() 21760 }, self.options.delay.show) 21761 } 21762 21763 Tooltip.prototype.isInStateTrue = function () { 21764 for (var key in this.inState) { 21765 if (this.inState[key]) return true 21766 } 21767 21768 return false 21769 } 21770 21771 Tooltip.prototype.leave = function (obj) { 21772 var self = obj instanceof this.constructor ? 21773 obj : $(obj.currentTarget).data('bs.' + this.type) 21774 21775 if (!self) { 21776 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 21777 $(obj.currentTarget).data('bs.' + this.type, self) 21778 } 21779 21780 if (obj instanceof $.Event) { 21781 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false 21782 } 21783 21784 if (self.isInStateTrue()) return 21785 21786 clearTimeout(self.timeout) 21787 21788 self.hoverState = 'out' 21789 21790 if (!self.options.delay || !self.options.delay.hide) return self.hide() 21791 21792 self.timeout = setTimeout(function () { 21793 if (self.hoverState == 'out') self.hide() 21794 }, self.options.delay.hide) 21795 } 21796 21797 Tooltip.prototype.show = function () { 21798 var e = $.Event('show.bs.' + this.type) 21799 21800 if (this.hasContent() && this.enabled) { 21801 this.$element.trigger(e) 21802 21803 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) 21804 if (e.isDefaultPrevented() || !inDom) return 21805 var that = this 21806 21807 var $tip = this.tip() 21808 21809 var tipId = this.getUID(this.type) 21810 21811 this.setContent() 21812 $tip.attr('id', tipId) 21813 this.$element.attr('aria-describedby', tipId) 21814 21815 if (this.options.animation) $tip.addClass('fade') 21816 21817 var placement = typeof this.options.placement == 'function' ? 21818 this.options.placement.call(this, $tip[0], this.$element[0]) : 21819 this.options.placement 21820 21821 var autoToken = /\s?auto?\s?/i 21822 var autoPlace = autoToken.test(placement) 21823 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 21824 21825 $tip 21826 .detach() 21827 .css({ top: 0, left: 0, display: 'block' }) 21828 .addClass(placement) 21829 .data('bs.' + this.type, this) 21830 21831 this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element) 21832 this.$element.trigger('inserted.bs.' + this.type) 21833 21834 var pos = this.getPosition() 21835 var actualWidth = $tip[0].offsetWidth 21836 var actualHeight = $tip[0].offsetHeight 21837 21838 if (autoPlace) { 21839 var orgPlacement = placement 21840 var viewportDim = this.getPosition(this.$viewport) 21841 21842 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : 21843 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : 21844 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : 21845 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : 21846 placement 21847 21848 $tip 21849 .removeClass(orgPlacement) 21850 .addClass(placement) 21851 } 21852 21853 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 21854 21855 this.applyPlacement(calculatedOffset, placement) 21856 21857 var complete = function () { 21858 var prevHoverState = that.hoverState 21859 that.$element.trigger('shown.bs.' + that.type) 21860 that.hoverState = null 21861 21862 if (prevHoverState == 'out') that.leave(that) 21863 } 21864 21865 $.support.transition && this.$tip.hasClass('fade') ? 21866 $tip 21867 .one('bsTransitionEnd', complete) 21868 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 21869 complete() 21870 } 21871 } 21872 21873 Tooltip.prototype.applyPlacement = function (offset, placement) { 21874 var $tip = this.tip() 21875 var width = $tip[0].offsetWidth 21876 var height = $tip[0].offsetHeight 21877 21878 // manually read margins because getBoundingClientRect includes difference 21879 var marginTop = parseInt($tip.css('margin-top'), 10) 21880 var marginLeft = parseInt($tip.css('margin-left'), 10) 21881 21882 // we must check for NaN for ie 8/9 21883 if (isNaN(marginTop)) marginTop = 0 21884 if (isNaN(marginLeft)) marginLeft = 0 21885 21886 offset.top += marginTop 21887 offset.left += marginLeft 21888 21889 // $.fn.offset doesn't round pixel values 21890 // so we use setOffset directly with our own function B-0 21891 $.offset.setOffset($tip[0], $.extend({ 21892 using: function (props) { 21893 $tip.css({ 21894 top: Math.round(props.top), 21895 left: Math.round(props.left) 21896 }) 21897 } 21898 }, offset), 0) 21899 21900 $tip.addClass('in') 21901 21902 // check to see if placing tip in new offset caused the tip to resize itself 21903 var actualWidth = $tip[0].offsetWidth 21904 var actualHeight = $tip[0].offsetHeight 21905 21906 if (placement == 'top' && actualHeight != height) { 21907 offset.top = offset.top + height - actualHeight 21908 } 21909 21910 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) 21911 21912 if (delta.left) offset.left += delta.left 21913 else offset.top += delta.top 21914 21915 var isVertical = /top|bottom/.test(placement) 21916 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight 21917 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' 21918 21919 $tip.offset(offset) 21920 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) 21921 } 21922 21923 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { 21924 this.arrow() 21925 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') 21926 .css(isVertical ? 'top' : 'left', '') 21927 } 21928 21929 Tooltip.prototype.setContent = function () { 21930 var $tip = this.tip() 21931 var title = this.getTitle() 21932 21933 if (this.options.html) { 21934 if (this.options.sanitize) { 21935 title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn) 21936 } 21937 21938 $tip.find('.tooltip-inner').html(title) 21939 } else { 21940 $tip.find('.tooltip-inner').text(title) 21941 } 21942 21943 $tip.removeClass('fade in top bottom left right') 21944 } 21945 21946 Tooltip.prototype.hide = function (callback) { 21947 var that = this 21948 var $tip = $(this.$tip) 21949 var e = $.Event('hide.bs.' + this.type) 21950 21951 function complete() { 21952 if (that.hoverState != 'in') $tip.detach() 21953 if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. 21954 that.$element 21955 .removeAttr('aria-describedby') 21956 .trigger('hidden.bs.' + that.type) 21957 } 21958 callback && callback() 21959 } 21960 21961 this.$element.trigger(e) 21962 21963 if (e.isDefaultPrevented()) return 21964 21965 $tip.removeClass('in') 21966 21967 $.support.transition && $tip.hasClass('fade') ? 21968 $tip 21969 .one('bsTransitionEnd', complete) 21970 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 21971 complete() 21972 21973 this.hoverState = null 21974 21975 return this 21976 } 21977 21978 Tooltip.prototype.fixTitle = function () { 21979 var $e = this.$element 21980 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { 21981 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 21982 } 21983 } 21984 21985 Tooltip.prototype.hasContent = function () { 21986 return this.getTitle() 21987 } 21988 21989 Tooltip.prototype.getPosition = function ($element) { 21990 $element = $element || this.$element 21991 21992 var el = $element[0] 21993 var isBody = el.tagName == 'BODY' 21994 21995 var elRect = el.getBoundingClientRect() 21996 if (elRect.width == null) { 21997 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 21998 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) 21999 } 22000 var isSvg = window.SVGElement && el instanceof window.SVGElement 22001 // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. 22002 // See https://github.com/twbs/bootstrap/issues/20280 22003 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) 22004 var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } 22005 var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null 22006 22007 return $.extend({}, elRect, scroll, outerDims, elOffset) 22008 } 22009 22010 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 22011 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 22012 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 22013 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 22014 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 22015 22016 } 22017 22018 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { 22019 var delta = { top: 0, left: 0 } 22020 if (!this.$viewport) return delta 22021 22022 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 22023 var viewportDimensions = this.getPosition(this.$viewport) 22024 22025 if (/right|left/.test(placement)) { 22026 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll 22027 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight 22028 if (topEdgeOffset < viewportDimensions.top) { // top overflow 22029 delta.top = viewportDimensions.top - topEdgeOffset 22030 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow 22031 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset 22032 } 22033 } else { 22034 var leftEdgeOffset = pos.left - viewportPadding 22035 var rightEdgeOffset = pos.left + viewportPadding + actualWidth 22036 if (leftEdgeOffset < viewportDimensions.left) { // left overflow 22037 delta.left = viewportDimensions.left - leftEdgeOffset 22038 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow 22039 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset 22040 } 22041 } 22042 22043 return delta 22044 } 22045 22046 Tooltip.prototype.getTitle = function () { 22047 var title 22048 var $e = this.$element 22049 var o = this.options 22050 22051 title = $e.attr('data-original-title') 22052 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 22053 22054 return title 22055 } 22056 22057 Tooltip.prototype.getUID = function (prefix) { 22058 do prefix += ~~(Math.random() * 1000000) 22059 while (document.getElementById(prefix)) 22060 return prefix 22061 } 22062 22063 Tooltip.prototype.tip = function () { 22064 if (!this.$tip) { 22065 this.$tip = $(this.options.template) 22066 if (this.$tip.length != 1) { 22067 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') 22068 } 22069 } 22070 return this.$tip 22071 } 22072 22073 Tooltip.prototype.arrow = function () { 22074 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) 22075 } 22076 22077 Tooltip.prototype.enable = function () { 22078 this.enabled = true 22079 } 22080 22081 Tooltip.prototype.disable = function () { 22082 this.enabled = false 22083 } 22084 22085 Tooltip.prototype.toggleEnabled = function () { 22086 this.enabled = !this.enabled 22087 } 22088 22089 Tooltip.prototype.toggle = function (e) { 22090 var self = this 22091 if (e) { 22092 self = $(e.currentTarget).data('bs.' + this.type) 22093 if (!self) { 22094 self = new this.constructor(e.currentTarget, this.getDelegateOptions()) 22095 $(e.currentTarget).data('bs.' + this.type, self) 22096 } 22097 } 22098 22099 if (e) { 22100 self.inState.click = !self.inState.click 22101 if (self.isInStateTrue()) self.enter(self) 22102 else self.leave(self) 22103 } else { 22104 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 22105 } 22106 } 22107 22108 Tooltip.prototype.destroy = function () { 22109 var that = this 22110 clearTimeout(this.timeout) 22111 this.hide(function () { 22112 that.$element.off('.' + that.type).removeData('bs.' + that.type) 22113 if (that.$tip) { 22114 that.$tip.detach() 22115 } 22116 that.$tip = null 22117 that.$arrow = null 22118 that.$viewport = null 22119 that.$element = null 22120 }) 22121 } 22122 22123 Tooltip.prototype.sanitizeHtml = function (unsafeHtml) { 22124 return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn) 22125 } 22126 22127 // TOOLTIP PLUGIN DEFINITION 22128 // ========================= 22129 22130 function Plugin(option) { 22131 return this.each(function () { 22132 var $this = $(this) 22133 var data = $this.data('bs.tooltip') 22134 var options = typeof option == 'object' && option 22135 22136 if (!data && /destroy|hide/.test(option)) return 22137 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 22138 if (typeof option == 'string') data[option]() 22139 }) 22140 } 22141 22142 var old = $.fn.tooltip 22143 22144 $.fn.tooltip = Plugin 22145 $.fn.tooltip.Constructor = Tooltip 22146 22147 22148 // TOOLTIP NO CONFLICT 22149 // =================== 22150 22151 $.fn.tooltip.noConflict = function () { 22152 $.fn.tooltip = old 22153 return this 22154 } 22155 22156}(jQuery);
22157/* ======================================================================== 22158 * Bootstrap: popover.js v3.4.1 22159 * https://getbootstrap.com/docs/3.4/javascript/#popovers 22160 * ======================================================================== 22161 * Copyright 2011-2019 Twitter, Inc. 22162 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 22163 * ======================================================================== */ 22164 22165 22166+function ($) { 22167 'use strict'; 22168 22169 // POPOVER PUBLIC CLASS DEFINITION 22170 // =============================== 22171 22172 var Popover = function (element, options) { 22173 this.init('popover', element, options) 22174 } 22175 22176 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') 22177 22178 Popover.VERSION = '3.4.1' 22179 22180 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { 22181 placement: 'right', 22182 trigger: 'click', 22183 content: '', 22184 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' 22185 }) 22186 22187 22188 // NOTE: POPOVER EXTENDS tooltip.js 22189 // ================================ 22190 22191 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) 22192 22193 Popover.prototype.constructor = Popover 22194 22195 Popover.prototype.getDefaults = function () { 22196 return Popover.DEFAULTS 22197 } 22198 22199 Popover.prototype.setContent = function () { 22200 var $tip = this.tip() 22201 var title = this.getTitle() 22202 var content = this.getContent() 22203 22204 if (this.options.html) { 22205 var typeContent = typeof content 22206 22207 if (this.options.sanitize) { 22208 title = this.sanitizeHtml(title) 22209 22210 if (typeContent === 'string') { 22211 content = this.sanitizeHtml(content) 22212 } 22213 } 22214 22215 $tip.find('.popover-title').html(title) 22216 $tip.find('.popover-content').children().detach().end()[ 22217 typeContent === 'string' ? 'html' : 'append' 22218 ](content) 22219 } else { 22220 $tip.find('.popover-title').text(title) 22221 $tip.find('.popover-content').children().detach().end().text(content) 22222 } 22223 22224 $tip.removeClass('fade top bottom left right in') 22225 22226 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do 22227 // this manually by checking the contents. 22228 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() 22229 } 22230 22231 Popover.prototype.hasContent = function () { 22232 return this.getTitle() || this.getContent() 22233 } 22234 22235 Popover.prototype.getContent = function () { 22236 var $e = this.$element 22237 var o = this.options 22238 22239 return $e.attr('data-content') 22240 || (typeof o.content == 'function' ? 22241 o.content.call($e[0]) : 22242 o.content) 22243 } 22244 22245 Popover.prototype.arrow = function () { 22246 return (this.$arrow = this.$arrow || this.tip().find('.arrow')) 22247 } 22248 22249 22250 // POPOVER PLUGIN DEFINITION 22251 // ========================= 22252 22253 function Plugin(option) { 22254 return this.each(function () { 22255 var $this = $(this) 22256 var data = $this.data('bs.popover') 22257 var options = typeof option == 'object' && option 22258 22259 if (!data && /destroy|hide/.test(option)) return 22260 if (!data) $this.data('bs.popover', (data = new Popover(this, options))) 22261 if (typeof option == 'string') data[option]() 22262 }) 22263 } 22264 22265 var old = $.fn.popover 22266 22267 $.fn.popover = Plugin 22268 $.fn.popover.Constructor = Popover 22269 22270 22271 // POPOVER NO CONFLICT 22272 // =================== 22273 22274 $.fn.popover.noConflict = function () { 22275 $.fn.popover = old 22276 return this 22277 } 22278 22279}(jQuery); 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 22290 22291 22292/* 22293 * metismenu - v2.0.2 22294 * A jQuery menu plugin 22295 * https://github.com/onokumus/metisMenu 22296 * 22297 * Made by Osman Nuri Okumus 22298 * Under MIT License 22299 */ 22300 22301!function(a){"use strict";function b(){var a=document.createElement("mm"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}function c(b){return this.each(function(){var c=a(this),d=c.data("mm"),f=a.extend({},e.DEFAULTS,c.data(),"object"==typeof b&&b);d||c.data("mm",d=new e(this,f)),"string"==typeof b&&d[b]()})}a.fn.emulateTransitionEnd=function(b){var c=!1,e=this;a(this).one("mmTransitionEnd",function(){c=!0});var f=function(){c||a(e).trigger(d.end)};return setTimeout(f,b),this};var d=b();d&&(a.event.special.mmTransitionEnd={bindType:d.end,delegateType:d.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}});var e=function(b,c){this.$element=a(b),this.options=a.extend({},e.DEFAULTS,c),this.transitioning=null,this.init()};e.TRANSITION_DURATION=350,e.DEFAULTS={toggle:!0,doubleTapToGo:!1,activeClass:"active"},e.prototype.init=function(){var b=this,c=this.options.activeClass;this.$element.find("li."+c).has("ul").children("ul").addClass("collapse in"),this.$element.find("li").not("."+c).has("ul").children("ul").addClass("collapse"),this.options.doubleTapToGo&&this.$element.find("li."+c).has("ul").children("a").addClass("doubleTapToGo"),this.$element.find("li").has("ul").children("a").on("click.metisMenu",function(d){var e=a(this),f=e.parent("li"),g=f.children("ul");return d.preventDefault(),f.hasClass(c)?b.hide(g):b.show(g),b.options.doubleTapToGo&&b.doubleTapToGo(e)&&"#"!==e.attr("href")&&""!==e.attr("href")?(d.stopPropagation(),void(document.location=e.attr("href"))):void 0})},e.prototype.doubleTapToGo=function(a){var b=this.$element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},e.prototype.show=function(b){var c=this.options.activeClass,f=a(b),g=f.parent("li");if(!this.transitioning&&!f.hasClass("in")){g.addClass(c),this.options.toggle&&this.hide(g.siblings().children("ul.in")),f.removeClass("collapse").addClass("collapsing").height(0),this.transitioning=1;var h=function(){f.removeClass("collapsing").addClass("collapse in").height(""),this.transitioning=0};return d?void f.one("mmTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(e.TRANSITION_DURATION).height(f[0].scrollHeight):h.call(this)}},e.prototype.hide=function(b){var c=this.options.activeClass,f=a(b);if(!this.transitioning&&f.hasClass("in")){f.parent("li").removeClass(c),f.height(f.height())[0].offsetHeight,f.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var g=function(){this.transitioning=0,f.removeClass("collapsing").addClass("collapse")};
22301return d?void f.height(0).one("mmTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(e.TRANSITION_DURATION):g.call(this)}};var f=a.fn.metisMenu;a.fn.metisMenu=c,a.fn.metisMenu.Constructor=e,a.fn.metisMenu.noConflict=function(){return a.fn.metisMenu=f,this}}(jQuery); 22302!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):window.jQuery&&!window.jQuery.fn.colorpicker&&a(window.jQuery)}(function(a){"use strict";var b=function(a){this.value={h:0,s:0,b:0,a:1},this.origFormat=null,a&&(void 0!==a.toLowerCase?(a+="","#"===a.charAt(0)||3!==a.length&&6!==a.length||(a="#"+a),this.setColor(a)):void 0!==a.h&&(this.value=a))};b.prototype={constructor:b,colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},_sanitizeNumber:function(a){return"number"==typeof a?a:isNaN(a)||null===a||""===a||void 0===a?1:void 0!==a.toLowerCase?parseFloat(a):1},setColor:function(a){a=a.toLowerCase(),this.value=this.stringToHSB(a)||{h:0,s:0,b:0,a:1}},stringToHSB:function(b){b=b.toLowerCase();var c=this,d=!1;return a.each(this.stringParsers,function(a,e){var f=e.re.exec(b),g=f&&e.parse.apply(c,[f]),h=e.format||"rgba";return g?(d=h.match(/hsla?/)?c.RGBtoHSB.apply(c,c.HSLtoRGB.apply(c,g)):c.RGBtoHSB.apply(c,g),c.origFormat=h,!1):!0}),d},setHue:function(a){this.value.h=1-a},setSaturation:function(a){this.value.s=a},setBrightness:function(a){this.value.b=1-a},setAlpha:function(a){this.value.a=parseInt(100*(1-a),10)/100},toRGB:function(a,b,c,d){a||(a=this.value.h,b=this.value.s,c=this.value.b),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-Math.abs(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],{r:Math.round(255*e),g:Math.round(255*f),b:Math.round(255*g),a:d||this.value.a}},toHex:function(a,b,c,d){var e=this.toRGB(a,b,c,d);return"#"+(1<<24|parseInt(e.r)<<16|parseInt(e.g)<<8|parseInt(e.b)).toString(16).substr(1)},toHSL:function(a,b,c,d){a=a||this.value.h,b=b||this.value.s,c=c||this.value.b,d=d||this.value.a;var e=a,f=(2-b)*c,g=b*c;return g/=f>0&&1>=f?f:2-f,f/=2,g>1&&(g=1),{h:isNaN(e)?0:e,s:isNaN(g)?0:g,l:isNaN(f)?0:f,a:isNaN(d)?0:d}},toAlias:function(a,b,c,d){var e=this.toHex(a,b,c,d);for(var f in this.colors)if(this.colors[f]==e)return f;return!1},RGBtoHSB:function(a,b,c,d){a/=255,b/=255,c/=255;var e,f,g,h;return g=Math.max(a,b,c),h=g-Math.min(a,b,c),e=0===h?null:g===a?(b-c)/h:g===b?(c-a)/h+2:(a-b)/h+4,e=(e+360)%6*60/360,f=0===h?0:h/g,{h:this._sanitizeNumber(e),s:f,b:g,a:this._sanitizeNumber(d)}},HueToRGB:function(a,b,c){return 0>c?c+=1:c>1&&(c-=1),1>6*c?a+(b-a)*c*6:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a},HSLtoRGB:function(a,b,c,d){0>b&&(b=0);var e;e=.5>=c?c*(1+b):c+b-c*b;var f=2*c-e,g=a+1/3,h=a,i=a-1/3,j=Math.round(255*this.HueToRGB(f,e,g)),k=Math.round(255*this.HueToRGB(f,e,h)),l=Math.round(255*this.HueToRGB(f,e,i));return[j,k,l,this._sanitizeNumber(d)]},toString:function(a){switch(a=a||"rgba"){case"rgb":var b=this.toRGB();return"rgb("+b.r+","+b.g+","+b.b+")";case"rgba":var b=this.toRGB();return"rgba("+b.r+","+b.g+","+b.b+","+b.a+")";case"hsl":var c=this.toHSL();return"hsl("+Math.round(360*c.h)+","+Math.round(100*c.s)+"%,"+Math.round(100*c.l)+"%)";case"hsla":var c=this.toHSL();return"hsla("+Math.round(360*c.h)+","+Math.round(100*c.s)+"%,"+Math.round(100*c.l)+"%,"+c.a+")";case"hex":return this.toHex();case"alias":return this.toAlias()||this.toHex();default:return!1}},stringParsers:[{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16),1]}},{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(a){return[a[1],a[2],a[3],1]}},{re:/rgb\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],a[4]]}},{re:/hsl\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(a){return[a[1]/360,a[2]/100,a[3]/100,a[4]]}},{re:/hsla\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(a){return[a[1]/360,a[2]/100,a[3]/100,a[4]]}},{re:/^([a-z]{3,})$/,format:"alias",parse:function(a){var b=this.colorNameToHex(a[0])||"#000000",c=this.stringParsers[0].re.exec(b),d=c&&this.stringParsers[0].parse.apply(this,[c]);return d}}],colorNameToHex:function(a){return"undefined"!=typeof this.colors[a.toLowerCase()]?this.colors[a.toLowerCase()]:!1}};var c={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",
22302sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:'<div class="colorpicker dropdown-menu"><div class="colorpicker-saturation"><i><b></b></i></div><div class="colorpicker-hue"><i></i></div><div class="colorpicker-alpha"><i></i></div><div class="colorpicker-color"><div /></div></div>'},d=function(d,e){this.element=a(d).addClass("colorpicker-element"),this.options=a.extend({},c,this.element.data(),e),this.component=this.options.component,this.component=this.component!==!1?this.element.find(this.component):!1,this.component&&0===this.component.length&&(this.component=!1),this.container=this.options.container===!0?this.element:this.options.container,this.container=this.container!==!1?a(this.container):!1,this.input=this.element.is("input")?this.element:this.options.input?this.element.find(this.options.input):!1,this.input&&0===this.input.length&&(this.input=!1),this.color=new b(this.options.color!==!1?this.options.color:this.getValue()),this.format=this.options.format!==!1?this.options.format:this.color.origFormat,this.picker=a(this.options.template),this.picker.addClass(this.options.inline?"colorpicker-inline colorpicker-visible":"colorpicker-hidden"),this.options.horizontal&&this.picker.addClass("colorpicker-horizontal"),("rgba"===this.format||"hsla"===this.format)&&this.picker.addClass("colorpicker-with-alpha"),this.picker.on("mousedown.colorpicker touchstart.colorpicker",a.proxy(this.mousedown,this)),this.picker.appendTo(this.container?this.container:a("body")),this.input!==!1&&(this.input.on({"keyup.colorpicker":a.proxy(this.keyup,this)}),this.component===!1&&this.element.on({"focus.colorpicker":a.proxy(this.show,this)}),this.options.inline===!1&&this.element.on({"focusout.colorpicker":a.proxy(this.hide,this)})),this.component!==!1&&this.component.on({"click.colorpicker":a.proxy(this.show,this)}),this.input===!1&&this.component===!1&&this.element.on({"click.colorpicker":a.proxy(this.show,this)}),this.input!==!1&&this.component!==!1&&"color"===this.input.attr("type")&&this.input.on({"click.colorpicker":a.proxy(this.show,this),"focus.colorpicker":a.proxy(this.show,this)}),this.update(),a(a.proxy(function(){this.element.trigger("create")},this))};d.version="2.0.0-beta",d.Color=b,d.prototype={constructor:d,destroy:function(){this.picker.remove(),this.element.removeData("colorpicker").off(".colorpicker"),this.input!==!1&&this.input.off(".colorpicker"),this.component!==!1&&this.component.off(".colorpicker"),this.element.removeClass("colorpicker-element"),this.element.trigger({type:"destroy"})},reposition:function(){if(this.options.inline!==!1||this.options.container)return!1;var a=this.container&&this.container[0]!==document.body?"position":"offset",b=this.component?this.component[a]():this.element[a]();this.picker.css({top:b.top+(this.component?this.component.outerHeight():this.element.outerHeight()),left:b.left})},show:function(b){return this.isDisabled()?!1:(this.picker.addClass("colorpicker-visible").removeClass("colorpicker-hidden"),this.reposition(),a(window).on("resize.colorpicker",a.proxy(this.reposition,this)),!b||this.hasInput()&&"color"!==this.input.attr("type")||b.stopPropagation&&b.preventDefault&&(b.stopPropagation(),b.preventDefault()),this.options.inline===!1&&a(window.document).on({"mousedown.colorpicker":a.proxy(this.hide,this)}),void this.element.trigger({type:"showPicker",color:this.color}))},hide:function(){this.picker.addClass("colorpicker-hidden").removeClass("colorpicker-visible"),a(window).off("resize.colorpicker",this.reposition),a(document).off({"mousedown.colorpicker":this.hide}),this.update(),this.element.trigger({type:"hidePicker",color:this.color})},updateData:function(a){return a=a||this.color.toString(this.format),this.element.data("color",a),a},updateInput:function(a){return a=a||this.color.toString(this.format),this.input!==!1&&this.input.prop("value",a),a},updatePicker:function(a){void 0!==a&&(this.color=new b(a));var c=this.options.horizontal===!1?this.options.sliders:this.options.slidersHorz,d=this.picker.find("i");return 0!==d.length?(this.options.horizontal===!1?(c=this.options.sliders,d.eq(1).css("top",c.hue.maxTop*(1-this.color.value.h)).end().eq(2).css("top",c.alpha.maxTop*(1-this.color.value.a))):(c=this.options.slidersHorz,d.eq(1).css("left",c.hue.maxLeft*(1-this.color.value.h)).end().eq(2).css("left",c.alpha.maxLeft*(1-this.color.value.a))),d.eq(0).css({top:c.saturation.maxTop-this.color.value.b*c.saturation.maxTop,left
22302:this.color.value.s*c.saturation.maxLeft}),this.picker.find(".colorpicker-saturation").css("backgroundColor",this.color.toHex(this.color.value.h,1,1,1)),this.picker.find(".colorpicker-alpha").css("backgroundColor",this.color.toHex()),this.picker.find(".colorpicker-color, .colorpicker-color div").css("backgroundColor",this.color.toString(this.format)),a):void 0},updateComponent:function(a){if(a=a||this.color.toString(this.format),this.component!==!1){var b=this.component.find("i").eq(0);b.length>0?b.css({backgroundColor:a}):this.component.css({backgroundColor:a})}return a},update:function(a){var b=this.updateComponent();return(this.getValue(!1)!==!1||a===!0)&&(this.updateInput(b),this.updateData(b)),this.updatePicker(),b},setValue:function(a){this.color=new b(a),this.update(),this.element.trigger({type:"changeColor",color:this.color,value:a})},getValue:function(a){a=void 0===a?"#000000":a;var b;return b=this.hasInput()?this.input.val():this.element.data("color"),(void 0===b||""===b||null===b)&&(b=a),b},hasInput:function(){return this.input!==!1},isDisabled:function(){return this.hasInput()?this.input.prop("disabled")===!0:!1},disable:function(){return this.hasInput()?(this.input.prop("disabled",!0),!0):!1},enable:function(){return this.hasInput()?(this.input.prop("disabled",!1),!0):!1},currentSlider:null,mousePointer:{left:0,top:0},mousedown:function(b){b.pageX||b.pageY||!b.originalEvent||(b.pageX=b.originalEvent.touches[0].pageX,b.pageY=b.originalEvent.touches[0].pageY),b.stopPropagation(),b.preventDefault();var c=a(b.target),d=c.closest("div"),e=this.options.horizontal?this.options.slidersHorz:this.options.sliders;if(!d.is(".colorpicker")){if(d.is(".colorpicker-saturation"))this.currentSlider=a.extend({},e.saturation);else if(d.is(".colorpicker-hue"))this.currentSlider=a.extend({},e.hue);else{if(!d.is(".colorpicker-alpha"))return!1;this.currentSlider=a.extend({},e.alpha)}var f=d.offset();this.currentSlider.guide=d.find("i")[0].style,this.currentSlider.left=b.pageX-f.left,this.currentSlider.top=b.pageY-f.top,this.mousePointer={left:b.pageX,top:b.pageY},a(document).on({"mousemove.colorpicker":a.proxy(this.mousemove,this),"touchmove.colorpicker":a.proxy(this.mousemove,this),"mouseup.colorpicker":a.proxy(this.mouseup,this),"touchend.colorpicker":a.proxy(this.mouseup,this)}).trigger("mousemove")}return!1},mousemove:function(a){a.pageX||a.pageY||!a.originalEvent||(a.pageX=a.originalEvent.touches[0].pageX,a.pageY=a.originalEvent.touches[0].pageY),a.stopPropagation(),a.preventDefault();var b=Math.max(0,Math.min(this.currentSlider.maxLeft,this.currentSlider.left+((a.pageX||this.mousePointer.left)-this.mousePointer.left))),c=Math.max(0,Math.min(this.currentSlider.maxTop,this.currentSlider.top+((a.pageY||this.mousePointer.top)-this.mousePointer.top)));return this.currentSlider.guide.left=b+"px",this.currentSlider.guide.top=c+"px",this.currentSlider.callLeft&&this.color[this.currentSlider.callLeft].call(this.color,b/this.currentSlider.maxLeft),this.currentSlider.callTop&&this.color[this.currentSlider.callTop].call(this.color,c/this.currentSlider.maxTop),this.update(!0),this.element.trigger({type:"changeColor",color:this.color}),!1},mouseup:function(b){return b.stopPropagation(),b.preventDefault(),a(document).off({"mousemove.colorpicker":this.mousemove,"touchmove.colorpicker":this.mousemove,"mouseup.colorpicker":this.mouseup,"touchend.colorpicker":this.mouseup}),!1},keyup:function(a){if(38===a.keyCode)this.color.value.a<1&&(this.color.value.a=Math.round(100*(this.color.value.a+.01))/100),this.update(!0);else if(40===a.keyCode)this.color.value.a>0&&(this.color.value.a=Math.round(100*(this.color.value.a-.01))/100),this.update(!0);else{var c=this.input.val();this.color=new b(c),this.getValue(!1)!==!1&&(this.updateData(),this.updateComponent(),this.updatePicker())}this.element.trigger({type:"changeColor",color:this.color,value:c})}},a.colorpicker=d,a.fn.colorpicker=function(b){var c=arguments;return this.each(function(){var e=a(this),f=e.data("colorpicker"),g="object"==typeof b?b:{};f||"string"==typeof b?"string"==typeof b&&f[b].apply(f,Array.prototype.slice.call(c,1)):e.data("colorpicker",new d(this,g))})},a.fn.colorpicker.constructor=d}); 22303/*! pace 1.0.0 */ 22304(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X=[].slice,Y={}.hasOwnProperty,Z=function(a,b){function c(){this.constructor=a}for(var d in b)Y.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},$=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};for(u={catchupTime:100,initialRate:.03,minTime:250,ghostTime:100,maxProgressPerFrame:20,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},C=function(){var a;return null!=(a="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?a:+new Date},E=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,t=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==E&&(E=function(a){return setTimeout(a,50)},t=function(a){return clearTimeout(a)}),G=function(a){var b,c;return b=C(),(c=function(){var d;return d=C()-b,d>=33?(b=C(),a(d,function(){return E(c)})):setTimeout(c,33-d)})()},F=function(){var a,b,c;return c=arguments[0],b=arguments[1],a=3<=arguments.length?X.call(arguments,2):[],"function"==typeof c[b]?c[b].apply(c,a):c[b]},v=function(){var a,b,c,d,e,f,g;
vendor: 4,025 bytes, line 22304
22304for(b=arguments[0],d=2<=arguments.length?X.call(arguments,1):[],f=0,g=d.length;g>f;f++)if(c=d[f])for(a in c)Y.call(c,a)&&(e=c[a],null!=b[a]&&"object"==typeof b[a]&&null!=e&&"object"==typeof e?v(b[a],e):b[a]=e);return b},q=function(a){var b,c,d,e,f;for(c=b=0,e=0,f=a.length;f>e;e++)d=a[e],c+=Math.abs(d),b++;return c/b},x=function(a,b){var c,d,e;if(null==a&&(a="options"),null==b&&(b=!0),e=document.querySelector("[data-pace-"+a+"]")){if(c=e.getAttribute("data-pace-"+a),!b)return c;try{return JSON.parse(c)}catch(f){return d=f,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",d):void 0}}},g=function(){function a(){}return a.prototype.on=function(a,b,c,d){var e;return null==d&&(d=!1),null==this.bindings&&(this.bindings={}),null==(e=this.bindings)[a]&&(e[a]=[]),this.bindings[a].push({handler:b,ctx:c,once:d})},a.prototype.once=function(a,b,c){return this.on(a,b,c,!0)},a.prototype.off=function(a,b){var c,d,e;if(null!=(null!=(d=this.bindings)?d[a]:void 0)){if(null==b)return delete this.bindings[a];for(c=0,e=[];c<this.bindings[a].length;)e.push(this.bindings[a][c].handler===b?this.bindings[a].splice(c,1):c++);return e}},a.prototype.trigger=function(){var a,b,c,d,e,f,g,h,i;if(c=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],null!=(g=this.bindings)?g[c]:void 0){for(e=0,i=[];e<this.bindings[c].length;)h=this.bindings[c][e],d=h.handler,b=h.ctx,f=h.once,d.apply(null!=b?b:this,a),i.push(f?this.bindings[c].splice(e,1):e++);return i}},a}(),j=window.Pace||{},window.Pace=j,v(j,g.prototype),D=j.options=v({},u,window.paceOptions,x()),U=["ajax","document","eventLag","elements"],Q=0,S=U.length;S>Q;Q++)K=U[Q],D[K]===!0&&(D[K]=u[K]);i=function(a){function b(){return V=b.__super__.constructor.apply(this,arguments)}return Z(b,a),b}(Error),b=function(){function a(){this.progress=0}return a.prototype.getElement=function(){var a;if(null==this.el){if(a=document.querySelector(D.target),!a)throw new i;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/pace-done/g,""),document.body.className+=" pace-running",this.el.innerHTML='<div class="pace-progress">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>',null!=a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el)}return this.el},a.prototype.finish=function(){var a;return a=this.getElement(),a.className=a.className.replace("pace-active",""),a.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},a.prototype.update=function(a){return this.progress=a,this.render()},a.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(a){i=a}return this.el=void 0},a.prototype.render=function(){var a,b,c,d,e,f,g;if(null==document.querySelector(D.target))return!1;for(a=this.getElement(),d="translate3d("+this.progress+"%, 0, 0)",g=["webkitTransform","msTransform","transform"],e=0,f=g.length;f>e;e++)b=g[e],a.children[0].style[b]=d;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(a.children[0].setAttribute("data-progress-text",""+(0|this.progress)+"%"),this.progress>=100?c="99":(c=this.progress<10?"0":"",c+=0|this.progress),a.children[0].setAttribute("data-progress",""+c)),this.lastRenderedProgress=this.progress},a.prototype.done=function(){return this.progress>=100},a}(),h=function(){function a(){this.bindings={}}return a.prototype.trigger=function(a,b){var c,d,e,f,g;if(null!=this.bindings[a]){for(f=this.bindings[a],g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.call(this,b));return g}},a.prototype.on=function(a,b){var c;return null==(c=this.bindings)[a]&&(c[a]=[]),this.bindings[a].push(b)},a}(),P=window.XMLHttpRequest,O=window.XDomainRequest,N=window.WebSocket,w=function(a,b){var c,d,e,f;f=[];for(d in b.prototype)try{e=b.prototype[d],f.push(null==a[d]&&"function"!=typeof e?a[d]=e:void 0)}catch(g){c=g}return f
vendor: 6,688 bytes, line 22304
22304},A=[],j.ignore=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],A.unshift("ignore"),c=b.apply(null,a),A.shift(),c},j.track=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],A.unshift("track"),c=b.apply(null,a),A.shift(),c},J=function(a){var b;if(null==a&&(a="GET"),"track"===A[0])return"force";if(!A.length&&D.ajax){if("socket"===a&&D.ajax.trackWebSockets)return!0;if(b=a.toUpperCase(),$.call(D.ajax.trackMethods,b)>=0)return!0}return!1},k=function(a){function b(){var a,c=this;b.__super__.constructor.apply(this,arguments),a=function(a){var b;return b=a.open,a.open=function(d,e){return J(d)&&c.trigger("request",{type:d,url:e,request:a}),b.apply(a,arguments)}},window.XMLHttpRequest=function(b){var c;return c=new P(b),a(c),c};try{w(window.XMLHttpRequest,P)}catch(d){}if(null!=O){window.XDomainRequest=function(){var b;return b=new O,a(b),b};try{w(window.XDomainRequest,O)}catch(d){}}if(null!=N&&D.ajax.trackWebSockets){window.WebSocket=function(a,b){var d;return d=null!=b?new N(a,b):new N(a),J("socket")&&c.trigger("request",{type:"socket",url:a,protocols:b,request:d}),d};try{w(window.WebSocket,N)}catch(d){}}}return Z(b,a),b}(h),R=null,y=function(){return null==R&&(R=new k),R},I=function(a){var b,c,d,e;for(e=D.ajax.ignoreURLs,c=0,d=e.length;d>c;c++)if(b=e[c],"string"==typeof b){if(-1!==a.indexOf(b))return!0}else if(b.test(a))return!0;return!1},y().on("request",function(b){var c,d,e,f,g;return f=b.type,e=b.request,g=b.url,I(g)?void 0:j.running||D.restartOnRequestAfter===!1&&"force"!==J(f)?void 0:(d=arguments,c=D.restartOnRequestAfter||0,"boolean"==typeof c&&(c=0),setTimeout(function(){var b,c,g,h,i,k;if(b="socket"===f?e.readyState<2:0<(h=e.readyState)&&4>h){for(j.restart(),i=j.sources,k=[],c=0,g=i.length;g>c;c++){if(K=i[c],K instanceof a){K.watch.apply(K,d);break}k.push(void 0)}return k}},c))}),a=function(){function a(){var a=this;this.elements=[],y().on("request",function(){return a.watch.apply(a,arguments)})}return a.prototype.watch=function(a){var b,c,d,e;return d=a.type,b=a.request,e=a.url,I(e)?void 0:(c="socket"===d?new n(b):new o(b),this.elements.push(c))},a}(),o=function(){function a(a){var b,c,d,e,f,g,h=this;if(this.progress=0,null!=window.ProgressEvent)for(c=null,a.addEventListener("progress",function(a){return h.progress=a.lengthComputable?100*a.loaded/a.total:h.progress+(100-h.progress)/2},!1),g=["load","abort","timeout","error"],d=0,e=g.length;e>d;d++)b=g[d],a.addEventListener(b,function(){return h.progress=100},!1);else f=a.onreadystatechange,a.onreadystatechange=function(){var b;return 0===(b=a.readyState)||4===b?h.progress=100:3===a.readyState&&(h.progress=50),"function"==typeof f?f.apply(null,arguments):void 0}}return a}(),n=function(){function a(a){var b,c,d,e,f=this;for(this.progress=0,e=["error","open"],c=0,d=e.length;d>c;c++)b=e[c],a.addEventListener(b,function(){return f.progress=100},!1)}return a}(),d=function(){function a(a){var b,c,d,f;for(null==a&&(a={}),this.elements=[],null==a.selectors&&(a.selectors=[]),f=a.selectors,c=0,d=f.length;d>c;c++)b=f[c],this.elements.push(new e(b))}return a}(),e=function(){function a(a){this.selector=a,this.progress=0,this.check()}return a.prototype.check=function(){var a=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return a.check()},D.elements.checkInterval)},a.prototype.done=function(){return this.progress=100},a}(),c=function(){function a(){var a,b,c=this;this.progress=null!=(b=this.states[document.readyState])?b:100,a=document.onreadystatechange,document.onreadystatechange=function(){return null!=c.states[document.readyState]&&(c.progress=c.states[document.readyState]),"function"==typeof a?a.apply(null,arguments):void 0}}return a.prototype.states={loading:0,interactive:50,complete:100},a}(),f=function(){function a(){var a,b,c,d,e,f=this;this.progress=0,a=0,e=[],d=0,c=C(),b=setInterval(function(){var g;return g=C()-c-50,c=C(),e.push(g),e.length>D.eventLag.sampleCount&&e.shift(),a=q(e),++d>=D.eventLag.minSamples&&a<D.eventLag.lagThreshold?(f.progress=100,clearInterval(b)):f.progress=100*(3/(a+3))},50)}return a}(),m=function(){function a(a){this.source=a,this.last=this.sinceLastUpdate=0,this.rate=D.initialRate,this.catchup=0,this.progress=this.lastProgress=0,null!=this.source&&(this.progress=F(this.source,"progress"))}return a.prototype.tick=function(a,b){var c;return null==b&&(b=F(this.source,"progress")),b>=100&&(this.done=!0),b===this.last?this.sinceLastUpdate+=a:(this.sinceLastUpdate&&(this.rate=(b-this.last)/this.sinceLastUpdate),this.catchup=(b-this.progress)/D.catchupTime,this.sinceLastUpdate=0,this.last=b),b>this.progress&&(this.progress+=this.catchup*a),c=1-Math.pow(this.progress/100,D.easeFactor),this.progress+=c*this.rate*a,this.progress=Math.min(this.lastProgress+D.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},a}(),L=null,H=null,r=null,M=null,p=null,s=null,j.running=!1,z=function(){return D.restartOnPushState?j.restart():void 0},null!=window.history.pushState&&(T=window.history.pushState,window.history.pushState=function(){return z(),T.apply(window.history,arguments)}),null!=window.history.replaceState&&(W=window.history.replaceState,window.history.replaceState=function(){return z(),W.apply(window.history,arguments)}),l={ajax:a,elements:d,document:c,eventLag:f},(B=function(){var a,c,d,e,f,g,h,i;for(j.sources=L=[],g=["ajax","elements","document","eventLag"],c=0,e=g.length;e>c;c++)a=g[c],D[a]!==!1&&L.push(new l[a](D[a]));for(i=null!=(h=D.extraSources)?h:[],d=0,f=i.length;f>d;d++)K=i[d],L.push(new K(D));return j.bar=r=new b,H=[],M=new m})(),j.stop=function(){return j.trigger("stop"),j.running=!1,r.destroy(),s=!0,null!=p&&("function"==typeof t&&t(p),p=null),B()},j.restart=function(){return j.trigger("restart"),j.stop(),j.start()},j.go=function(){var a;return j.running=!0,r.render(),a=C(),s=!1,p=G(function(b,c){var d,e,f,g,h,i,k,l,n,o,p,q,t,u,v,w;for(l=100-r.progress,e=p=0,f=!0,i=q=0,u=L.length;u>q;i=++q)for(K=L[i],o=null!=H[i]?H[i]:H[i]=[],h=null!=(w=K.elements)?w:[K],k=t=0,v=h.length;v>t;k=++t)g=h[k],n=null!=o[k]?o[k]:o[k]=new m(g),f&=n.done,n.done||(e++,p+=n.tick(b));return d=p/e,r.update(M.tick(b,d)),r.done()||f||s?(r.update(100),j.trigger("done"),setTimeout(function(){return r.finish(),j.running=!1,j.trigger("hide")},Math.max(D.ghostTime,Math.max(D.minTime-(C()-a),0)))):c()})},j.start=function(a){v(D,a),j.running=!0;try{r.render()}catch(b){i=b}return document.querySelector(".pace")?(j.trigger("start"),j.go()):setTimeout(j.start,50)},"function"==typeof define&&define.amd?define(
vendor: 5,018 bytes, lines 22304-22329
22304function(){return j}):"object"==typeof exports?module.exports=j:D.startOnPageLoad&&j.start()}).call(this); 22305/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) 22306 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 22307 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 22308 * 22309 * Version: 1.3.6 22310 * 22311 */ 22312(function(e){e.fn.extend({slimScroll:function(g){var a=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},g);this.each(function(){function v(d){if(r){d=d||window.event; 22313 var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);e(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&m(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function m(d,e,g){k=!1;var f=d,h=b.outerHeight()-c.outerHeight();e&&(f=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),f=Math.min(Math.max(f,0),h),f=0<d?Math.ceil(f):Math.floor(f),c.css({top:f+"px"}));l=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight()); 22314 f=l*(b[0].scrollHeight-b.outerHeight());g&&(f=d,d=f/b[0].scrollHeight*b.outerHeight(),d=Math.min(Math.max(d,0),h),c.css({top:d+"px"}));b.scrollTop(f);b.trigger("slimscrolling",~~f);w();p()}function x(){u=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),30);c.css({height:u+"px"});var a=u==b.outerHeight()?"none":"block";c.css({display:a})}function w(){x();clearTimeout(B);l==~~l?(k=a.allowPageScroll,C!=l&&b.trigger("slimscroll",0==~~l?"top":"bottom")):k=!1;C=l;u>=b.outerHeight()?k=!0:(c.stop(!0, 22315 !0).fadeIn("fast"),a.railVisible&&h.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(B=setTimeout(function(){a.disableFadeOut&&r||y||z||(c.fadeOut("slow"),h.fadeOut("slow"))},1E3))}var r,y,z,B,A,u,l,C,k=!1,b=e(this);if(b.parent().hasClass(a.wrapperClass)){var n=b.scrollTop(),c=b.closest("."+a.barClass),h=b.closest("."+a.railClass);x();if(e.isPlainObject(g)){if("height"in g&&"auto"==g.height){b.parent().css("height","auto");b.css("height","auto");var q=b.parent().parent().height();b.parent().css("height", 22316 q);b.css("height",q)}if("scrollTo"in g)n=parseInt(a.scrollTo);else if("scrollBy"in g)n+=parseInt(a.scrollBy);else if("destroy"in g){c.remove();h.remove();b.unwrap();return}m(n,!1,!0)}}else if(!(e.isPlainObject(g)&&"destroy"in g)){a.height="auto"==a.height?b.parent().height():a.height;n=e("<div></div>").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var h=e("<div></div>").addClass(a.railClass).css({width:a.size, 22317 height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=e("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),q="right"==a.position? 22318{right:a.distance}:{left:a.distance};h.css(q);c.css(q);b.wrap(n);b.parent().append(c);b.parent().append(h);a.railDraggable&&c.bind("mousedown",function(a){var b=e(document);z=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);m(0,c.position().top,!1)});b.bind("mouseup.slimscroll",function(a){z=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1}); 22319 h.hover(function(){w()},function(){p()});c.hover(function(){y=!0},function(){y=!1});b.hover(function(){r=!0;w();p()},function(){r=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(A=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&&(m((A-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),A=b.originalEvent.touches[0].pageY)});x();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}), 22320 m(0,!0)):"top"!==a.start&&(m(e(a.start).position().top,null,!0),a.alwaysVisible||c.hide());window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)}});return this}});e.fn.extend({slimscroll:e.fn.slimScroll})})(jQuery); 22321/*! 22322 * JavaScript Cookie v2.2.0 22323 * https://github.com/js-cookie/js-cookie 22324 * 22325 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 22326 * Released under the MIT license 22327 */ 22328;(function (factory) { 22329 var registeredInModuleLoader = false;
22330 if (typeof define === 'function' && define.amd) { 22331 define(factory); 22332 registeredInModuleLoader = true; 22333 } 22334 if (typeof exports === 'object') { 22335 module.exports = factory(); 22336 registeredInModuleLoader = true; 22337 } 22338 if (!registeredInModuleLoader) { 22339 var OldCookies = window.Cookies; 22340 var api = window.Cookies = factory(); 22341 api.noConflict = function () { 22342 window.Cookies = OldCookies; 22343 return api; 22344 }; 22345 } 22346}(function () { 22347 function extend () { 22348 var i = 0; 22349 var result = {}; 22350 for (; i < arguments.length; i++) { 22351 var attributes = arguments[ i ]; 22352 for (var key in attributes) { 22353 result[key] = attributes[key]; 22354 } 22355 } 22356 return result; 22357 } 22358 22359 function init (converter) { 22360 function api (key, value, attributes) { 22361 var result; 22362 if (typeof document === 'undefined') { 22363 return; 22364 } 22365 22366 // Write 22367 22368 if (arguments.length > 1) { 22369 attributes = extend({ 22370 path: '/' 22371 }, api.defaults, attributes); 22372 22373 if (typeof attributes.expires === 'number') { 22374 var expires = new Date(); 22375 expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); 22376 attributes.expires = expires; 22377 } 22378 22379 // We're using "expires" because "max-age" is not supported by IE 22380 attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; 22381 22382 try { 22383 result = JSON.stringify(value); 22384 if (/^[\{\[]/.test(result)) { 22385 value = result; 22386 } 22387 } catch (e) {} 22388 22389 if (!converter.write) { 22390 value = encodeURIComponent(String(value)) 22391 .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); 22392 } else { 22393 value = converter.write(value, key); 22394 } 22395 22396 key = encodeURIComponent(String(key)); 22397 key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); 22398 key = key.replace(/[\(\)]/g, escape); 22399 22400 var stringifiedAttributes = ''; 22401 22402 for (var attributeName in attributes) { 22403 if (!attributes[attributeName]) { 22404 continue; 22405 } 22406 stringifiedAttributes += '; ' + attributeName; 22407 if (attributes[attributeName] === true) { 22408 continue; 22409 } 22410 stringifiedAttributes += '=' + attributes[attributeName]; 22411 } 22412 return (document.cookie = key + '=' + value + stringifiedAttributes); 22413 } 22414 22415 // Read 22416 22417 if (!key) { 22418 result = {}; 22419 } 22420 22421 // To prevent the for loop in the first place assign an empty array 22422 // in case there are no cookies at all. Also prevents odd result when 22423 // calling "get()" 22424 var cookies = document.cookie ? document.cookie.split('; ') : []; 22425 var rdecode = /(%[0-9A-Z]{2})+/g; 22426 var i = 0; 22427 22428 for (; i < cookies.length; i++) { 22429 var parts = cookies[i].split('='); 22430 var cookie = parts.slice(1).join('='); 22431 22432 if (!this.json && cookie.charAt(0) === '"') { 22433 cookie = cookie.slice(1, -1); 22434 } 22435 22436 try { 22437 var name = parts[0].replace(rdecode, decodeURIComponent); 22438 cookie = converter.read ? 22439 converter.read(cookie, name) : converter(cookie, name) || 22440 cookie.replace(rdecode, decodeURIComponent); 22441 22442 if (this.json) { 22443 try { 22444 cookie = JSON.parse(cookie); 22445 } catch (e) {} 22446 } 22447 22448 if (key === name) { 22449 result = cookie; 22450 break; 22451 } 22452 22453 if (!key) { 22454 result[name] = cookie; 22455 } 22456 } catch (e) {} 22457 } 22458 22459 return result; 22460 } 22461 22462 api.set = api; 22463 api.get = function (key) { 22464 return api.call(api, key); 22465 }; 22466 api.getJSON = function () { 22467 return api.apply({ 22468 json: true 22469 }, [].slice.call(arguments)); 22470 }; 22471 api.defaults = {}; 22472 22473 api.remove = function (key, attributes) { 22474 api(key, '', extend(attributes, { 22475 expires: -1 22476 })); 22477 }; 22478 22479 api.withConverter = init; 22480 22481 return api; 22482 } 22483 22484 return init(function () {}); 22485})); 22486/*! 22487 * Jasny Bootstrap v3.1.2 (http://jasny.github.io/bootstrap) 22488 * Copyright 2012-2014 Arnold Daniels 22489 * Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE) 22490 */ 22491if("undefined"==typeof jQuery)throw new Error("Jasny Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}void 0===a.support.transition&&(a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()}))}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.state=null,this.placement=null,this.options.recalc&&(this.calcClone(),a(window).on("resize",a.proxy(this.recalc,this))),this.options.autohide&&a(document).on("click",a.proxy(this.autohide,this)),this.options.toggle&&this.toggle(),this.options.disablescrolling&&(this.options.disableScrolling=this.options.disablescrolling,delete this.options.disablescrolling)};b.DEFAULTS={toggle:!0,placement:"auto",autohide:!0,recalc:!0,disableScrolling:!0},b.prototype.offset=function(){switch(this.placement){case"left":case"right":return this.$element.outerWidth();case"top":case"bottom":return this.$element.outerHeight()}},b.prototype.calcPlacement=function(){function b(a,b){if("auto"===e.css(b))return a;
22491if("auto"===e.css(a))return b;var c=parseInt(e.css(a),10),d=parseInt(e.css(b),10);return c>d?b:a}if("auto"!==this.options.placement)return void(this.placement=this.options.placement);this.$element.hasClass("in")||this.$element.css("visiblity","hidden !important").addClass("in");var c=a(window).width()/this.$element.width(),d=a(window).height()/this.$element.height(),e=this.$element;this.placement=c>=d?b("left","right"):b("top","bottom"),"hidden !important"===this.$element.css("visibility")&&this.$element.removeClass("in").css("visiblity","")},b.prototype.opposite=function(a){switch(a){case"top":return"bottom";case"left":return"right";case"bottom":return"top";case"right":return"left"}},b.prototype.getCanvasElements=function(){var b=this.options.canvas?a(this.options.canvas):this.$element,c=b.find("*").filter(function(){return"fixed"===a(this).css("position")}).not(this.options.exclude);return b.add(c)},b.prototype.slide=function(b,c,d){if(!a.support.transition){var e={};return e[this.placement]="+="+c,b.animate(e,350,d)}var f=this.placement,g=this.opposite(f);b.each(function(){"auto"!==a(this).css(f)&&a(this).css(f,(parseInt(a(this).css(f),10)||0)+c),"auto"!==a(this).css(g)&&a(this).css(g,(parseInt(a(this).css(g),10)||0)-c)}),this.$element.one(a.support.transition.end,d).emulateTransitionEnd(350)},b.prototype.disableScrolling=function(){var b=a("body").width(),c="padding-"+this.opposite(this.placement);if(void 0===a("body").data("offcanvas-style")&&a("body").data("offcanvas-style",a("body").attr("style")),a("body").css("overflow","hidden"),a("body").width()>b){var d=parseInt(a("body").css(c),10)+a("body").width()-b;setTimeout(function(){a("body").css(c,d)},1)}},b.prototype.show=function(){if(!this.state){var b=a.Event("show.bs.offcanvas");if(this.$element.trigger(b),!b.isDefaultPrevented()){this.state="slide-in",this.calcPlacement();var c=this.getCanvasElements(),d=this.placement,e=this.opposite(d),f=this.offset();-1!==c.index(this.$element)&&(a(this.$element).data("offcanvas-style",a(this.$element).attr("style")||""),this.$element.css(d,-1*f),this.$element.css(d)),c.addClass("canvas-sliding").each(function(){void 0===a(this).data("offcanvas-style")&&a(this).data("offcanvas-style",a(this).attr("style")||""),"static"===a(this).css("position")&&a(this).css("position","relative"),"auto"!==a(this).css(d)&&"0px"!==a(this).css(d)||"auto"!==a(this).css(e)&&"0px"!==a(this).css(e)||a(this).css(d,0)}),this.options.disableScrolling&&this.disableScrolling();var g=function(){"slide-in"==this.state&&(this.state="slid",c.removeClass("canvas-sliding").addClass("canvas-slid"),this.$element.trigger("shown.bs.offcanvas"))};setTimeout(a.proxy(function(){this.$element.addClass("in"),this.slide(c,f,a.proxy(g,this))},this),1)}}},b.prototype.hide=function(){if("slid"===this.state){var b=a.Event("hide.bs.offcanvas");if(this.$element.trigger(b),!b.isDefaultPrevented()){this.state="slide-out";var c=a(".canvas-slid"),d=(this.placement,-1*this.offset()),e=function(){"slide-out"==this.state&&(this.state=null,this.placement=null,this.$element.removeClass("in"),c.removeClass("canvas-sliding"),c.add(this.$element).add("body").each(function(){a(this).attr("style",a(this).data("offcanvas-style")).removeData("offcanvas-style")}),this.$element.trigger("hidden.bs.offcanvas"))};c.removeClass("canvas-slid").addClass("canvas-sliding"),setTimeout(a.proxy(function(){this.slide(c,d,a.proxy(e,this))},this),1)}}},b.prototype.toggle=function(){"slide-in"!==this.state&&"slide-out"!==this.state&&this["slid"===this.state?"hide":"show"]()},b.prototype.calcClone=function(){this.$calcClone=this.$element.clone().html("").addClass("offcanvas-clone").removeClass("in").appendTo(a("body"))},b.prototype.recalc=function(){if("none"!==this.$calcClone.css("display")&&("slid"===this.state||"slide-in"===this.state)){this.state=null,this.placement=null;var b=this.getCanvasElements();this.$element.removeClass("in"),b.removeClass("canvas-slid"),b.add(this.$element).add("body").each(function(){a(this).attr("style",a(this).data("offcanvas-style")).removeData("offcanvas-style")})}},b.prototype.autohide=function(b){0===a(b.target).closest(this.$element).length&&this.hide()};var c=a.fn.offcanvas;a.fn.offcanvas=function(c){return this.each(function(){var d=a(this),e=d.data("bs.offcanvas"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.offcanvas",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.offcanvas.Constructor=b,a.fn.offcanvas.noConflict=function(){return a.fn.offcanvas=c,this},a(document).on("click.bs.offcanvas.data-api","[data-toggle=offcanvas]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.offcanvas"),h=g?"toggle":d.data();
22491b.stopPropagation(),g?g.toggle():f.offcanvas(h)})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.$element.on("click.bs.rowlink","td:not(.rowlink-skip)",a.proxy(this.click,this))};b.DEFAULTS={target:"a"},b.prototype.click=function(b){var c=a(b.currentTarget).closest("tr").find(this.options.target)[0];if(a(b.target)[0]!==c)if(b.preventDefault(),c.click)c.click();else if(document.createEvent){var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}};var c=a.fn.rowlink;a.fn.rowlink=function(c){return this.each(function(){var d=a(this),e=d.data("rowlink");e||d.data("rowlink",e=new b(this,c))})},a.fn.rowlink.Constructor=b,a.fn.rowlink.noConflict=function(){return a.fn.rowlink=c,this},a(document).on("click.bs.rowlink.data-api",'[data-link="row"]',function(b){if(0===a(b.target).closest(".rowlink-skip").length){var c=a(this);c.data("rowlink")||(c.rowlink(c.data()),a(b.target).trigger("click.bs.rowlink"))}})}(window.jQuery),+function(a){"use strict";var b=void 0!==window.orientation,c=navigator.userAgent.toLowerCase().indexOf("android")>-1,d="Microsoft Internet Explorer"==window.navigator.appName,e=function(b,d){c||(this.$element=a(b),this.options=a.extend({},e.DEFAULTS,d),this.mask=String(this.options.mask),this.init(),this.listen(),this.checkVal())};e.DEFAULTS={mask:"",placeholder:"_",definitions:{9:"[0-9]",a:"[A-Za-z]","?":"[A-Za-z0-9]","*":"."}},e.prototype.init=function(){var b=this.options.definitions,c=this.mask.length;this.tests=[],this.partialPosition=this.mask.length,this.firstNonMaskPos=null,a.each(this.mask.split(""),a.proxy(function(a,d){"?"==d?(c--,this.partialPosition=a):b[d]?(this.tests.push(new RegExp(b[d])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1)):this.tests.push(null)},this)),this.buffer=a.map(this.mask.split(""),a.proxy(function(a){return"?"!=a?b[a]?this.options.placeholder:a:void 0},this)),this.focusText=this.$element.val(),this.$element.data("rawMaskFn",a.proxy(function(){return a.map(this.buffer,function(a,b){return this.tests[b]&&a!=this.options.placeholder?a:null}).join("")},this))},e.prototype.listen=function(){if(!this.$element.attr("readonly")){var b=(d?"paste":"input")+".mask";this.$element.on("unmask.bs.inputmask",a.proxy(this.unmask,this)).on("focus.bs.inputmask",a.proxy(this.focusEvent,this)).on("blur.bs.inputmask",a.proxy(this.blurEvent,this)).on("keydown.bs.inputmask",a.proxy(this.keydownEvent,this)).on("keypress.bs.inputmask",a.proxy(this.keypressEvent,this)).on(b,a.proxy(this.pasteEvent,this))}},e.prototype.caret=function(a,b){if(0!==this.$element.length){if("number"==typeof a)return b="number"==typeof b?b:a,this.$element.each(function(){if(this.setSelectionRange)this.setSelectionRange(a,b);else if(this.createTextRange){var c=this.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select()}});if(this.$element[0].setSelectionRange)a=this.$element[0].selectionStart,b=this.$element[0].selectionEnd;else if(document.selection&&document.selection.createRange){var c=document.selection.createRange();a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length}return{begin:a,end:b}}},e.prototype.seekNext=function(a){for(var b=this.mask.length;++a<=b&&!this.tests[a];);return a},e.prototype.seekPrev=function(a){for(;--a>=0&&!this.tests[a];);return a},e.prototype.shiftL=function(a,b){var c=this.mask.length;if(!(0>a)){for(var d=a,e=this.seekNext(b);c>d;d++)if(this.tests[d]){if(!(c>e&&this.tests[d].test(this.buffer[e])))break;this.buffer[d]=this.buffer[e],this.buffer[e]=this.options.placeholder,e=this.seekNext(e)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,a))}},e.prototype.shiftR=function(a){for(var b=this.mask.length,c=a,d=this.options.placeholder;b>c;c++)if(this.tests[c]){var e=this.seekNext(c),f=this.buffer[c];if(this.buffer[c]=d,!(b>e&&this.tests[e].test(f)))break;d=f}},e.prototype.unmask=function(){this.$element.unbind(".mask").removeData("inputmask")},e.prototype.focusEvent=function(){this.focusText=this.$element.val();var a=this.mask.length,b=this.checkVal();this.writeBuffer();var c=this,d=function(){b==a?c.caret(0,b):c.caret(b)};d(),setTimeout(d,50)},e.prototype.blurEvent=function(){this.checkVal(),this.$element.val()!==this.focusText&&this.$element.trigger("change")},e.prototype.keydownEvent=function(a){var c=a.which;if(8==c||46==c||b&&127==c){var d=this.caret(),e=d.begin,f=d.end;return f-e===0&&(e=46!=c?this.seekPrev(e):f=this.seekNext(e-1),f=46==c?this.seekNext(f):f),this.clearBuffer(e,f),this.shiftL(e,f-1),!1}return 27==c?(this.$element.val(this.focusText),this.caret(0,this.checkVal()),!1):void 0},e.prototype.keypressEvent=function(a){var b=this.mask.length,c=a.which,d=this.caret();if(a.ctrlKey||a.altKey||a.metaKey||32>c)return!0;
22491if(c){d.end-d.begin!==0&&(this.clearBuffer(d.begin,d.end),this.shiftL(d.begin,d.end-1));var e=this.seekNext(d.begin-1);if(b>e){var f=String.fromCharCode(c);if(this.tests[e].test(f)){this.shiftR(e),this.buffer[e]=f,this.writeBuffer();var g=this.seekNext(e);this.caret(g)}}return!1}},e.prototype.pasteEvent=function(){var a=this;setTimeout(function(){a.caret(a.checkVal(!0))},0)},e.prototype.clearBuffer=function(a,b){for(var c=this.mask.length,d=a;b>d&&c>d;d++)this.tests[d]&&(this.buffer[d]=this.options.placeholder)},e.prototype.writeBuffer=function(){return this.$element.val(this.buffer.join("")).val()},e.prototype.checkVal=function(a){for(var b=this.mask.length,c=this.$element.val(),d=-1,e=0,f=0;b>e;e++)if(this.tests[e]){for(this.buffer[e]=this.options.placeholder;f++<c.length;){var g=c.charAt(f-1);if(this.tests[e].test(g)){this.buffer[e]=g,d=e;break}}if(f>c.length)break}else this.buffer[e]==c.charAt(f)&&e!=this.partialPosition&&(f++,d=e);return!a&&d+1<this.partialPosition?(this.$element.val(""),this.clearBuffer(0,b)):(a||d+1>=this.partialPosition)&&(this.writeBuffer(),a||this.$element.val(this.$element.val().substring(0,d+1))),this.partialPosition?e:this.firstNonMaskPos};var f=a.fn.inputmask;a.fn.inputmask=function(b){return this.each(function(){var c=a(this),d=c.data("inputmask");d||c.data("inputmask",d=new e(this,b))})},a.fn.inputmask.Constructor=e,a.fn.inputmask.noConflict=function(){return a.fn.inputmask=f,this},a(document).on("focus.bs.inputmask.data-api","[data-mask]",function(){var b=a(this);b.data("inputmask")||b.inputmask(b.data())})}(window.jQuery),+function(a){"use strict";var b="Microsoft Internet Explorer"==window.navigator.appName,c=function(b,c){if(this.$element=a(b),this.$input=this.$element.find(":file"),0!==this.$input.length){this.name=this.$input.attr("name")||c.name,this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]'),0===this.$hidden.length&&(this.$hidden=a('<input type="hidden">').insertBefore(this.$input)),this.$preview=this.$element.find(".fileinput-preview");var d=this.$preview.css("height");"inline"!==this.$preview.css("display")&&"0px"!==d&&"none"!==d&&this.$preview.css("line-height",d),this.original={exists:this.$element.hasClass("fileinput-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()},this.listen()}};c.prototype.listen=function(){this.$input.on("change.bs.fileinput",a.proxy(this.change,this)),a(this.$input[0].form).on("reset.bs.fileinput",a.proxy(this.reset,this)),this.$element.find('[data-trigger="fileinput"]').on("click.bs.fileinput",a.proxy(this.trigger,this)),this.$element.find('[data-dismiss="fileinput"]').on("click.bs.fileinput",a.proxy(this.clear,this))},c.prototype.change=function(b){var c=void 0===b.target.files?b.target&&b.target.value?[{name:b.target.value.replace(/^.+\\/,"")}]:[]:b.target.files;if(b.stopPropagation(),0===c.length)return void this.clear();this.$hidden.val(""),this.$hidden.attr("name",""),this.$input.attr("name",this.name);var d=c[0];if(this.$preview.length>0&&("undefined"!=typeof d.type?d.type.match(/^image\/(gif|png|jpeg)$/):d.name.match(/\.(gif|png|jpe?g)$/i))&&"undefined"!=typeof FileReader){var e=new FileReader,f=this.$preview,g=this.$element;e.onload=function(b){var e=a("<img>");e[0].src=b.target.result,c[0].result=b.target.result,g.find(".fileinput-filename").text(d.name),"none"!=f.css("max-height")&&e.css("max-height",parseInt(f.css("max-height"),10)-parseInt(f.css("padding-top"),10)-parseInt(f.css("padding-bottom"),10)-parseInt(f.css("border-top"),10)-parseInt(f.css("border-bottom"),10)),f.html(e),g.addClass("fileinput-exists").removeClass("fileinput-new"),g.trigger("change.bs.fileinput",c)},e.readAsDataURL(d)}else this.$element.find(".fileinput-filename").text(d.name),this.$preview.text(d.name),this.$element.addClass("fileinput-exists").removeClass("fileinput-new"),this.$element.trigger("change.bs.fileinput")},c.prototype.clear=function(a){if(a&&a.preventDefault(),this.$hidden.val(""),this.$hidden.attr("name",this.name),this.$input.attr("name",""),b){var c=this.$input.clone(!0);
22491this.$input.after(c),this.$input.remove(),this.$input=c}else this.$input.val("");this.$preview.html(""),this.$element.find(".fileinput-filename").text(""),this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),void 0!==a&&(this.$input.trigger("change"),this.$element.trigger("clear.bs.fileinput"))},c.prototype.reset=function(){this.clear(),this.$hidden.val(this.original.hiddenVal),this.$preview.html(this.original.preview),this.$element.find(".fileinput-filename").text(""),this.original.exists?this.$element.addClass("fileinput-exists").removeClass("fileinput-new"):this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),this.$element.trigger("reset.bs.fileinput")},c.prototype.trigger=function(a){this.$input.trigger("click"),a.preventDefault()};var d=a.fn.fileinput;a.fn.fileinput=function(b){return this.each(function(){var d=a(this),e=d.data("fileinput");e||d.data("fileinput",e=new c(this,b)),"string"==typeof b&&e[b]()})},a.fn.fileinput.Constructor=c,a.fn.fileinput.noConflict=function(){return a.fn.fileinput=d,this},a(document).on("click.fileinput.data-api",'[data-provides="fileinput"]',function(b){var c=a(this);if(!c.data("fileinput")){c.fileinput(c.data());var d=a(b.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]');d.length>0&&(b.preventDefault(),d.trigger("click.bs.fileinput"))}})}(window.jQuery); 22492/*! version : 4.17.47 22493 ========================================================= 22494 bootstrap-datetimejs 22495 https://github.com/Eonasdan/bootstrap-datetimepicker 22496 Copyright (c) 2015 Jonathan Peterson 22497 ========================================================= 22498 */ 22499/* 22500 The MIT License (MIT) 22501 22502 Copyright (c) 2015 Jonathan Peterson 22503 22504 Permission is hereby granted, free of charge, to any person obtaining a copy 22505 of this software and associated documentation files (the "Software"), to deal 22506 in the Software without restriction, including without limitation the rights 22507 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 22508 copies of the Software, and to permit persons to whom the Software is 22509 furnished to do so, subject to the following conditions: 22510 22511 The above copyright notice and this permission notice shall be included in 22512 all copies or substantial portions of the Software. 22513 22514 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22515 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22516 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22517 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22518 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22519 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22520 THE SOFTWARE. 22521 */ 22522/*global define:false */ 22523/*global exports:false */ 22524/*global require:false */ 22525/*global jQuery:false */ 22526/*global moment:false */ 22527(function (factory) { 22528 'use strict'; 22529 if (typeof define === 'function' && define.amd) { 22530 // AMD is used - Register as an anonymous module. 22531 define(['jquery', 'moment'], factory); 22532 } else if (typeof exports === 'object') { 22533 module.exports = factory(require('jquery'), require('moment')); 22534 } else { 22535 // Neither AMD nor CommonJS used. Use global variables. 22536 if (typeof jQuery === 'undefined') { 22537 throw 'bootstrap-datetimepicker requires jQuery to be loaded first'; 22538 } 22539 if (typeof moment === 'undefined') { 22540 throw 'bootstrap-datetimepicker requires Moment.js to be loaded first'; 22541 } 22542 factory(jQuery, moment); 22543 } 22544}(function ($, moment) { 22545 'use strict'; 22546 if (!moment) { 22547 throw new Error('bootstrap-datetimepicker requires Moment.js to be loaded first'); 22548 } 22549 22550 var dateTimePicker = function (element, options) { 22551 var picker = {}, 22552 date, 22553 viewDate, 22554 unset = true, 22555 input, 22556 component = false, 22557 widget = false, 22558 use24Hours, 22559 minViewModeNumber = 0, 22560 actualFormat, 22561 parseFormats, 22562 currentViewMode, 22563 datePickerModes = [ 22564 { 22565 clsName: 'days', 22566 navFnc: 'M', 22567 navStep: 1 22568 }, 22569 { 22570 clsName: 'months', 22571 navFnc: 'y', 22572 navStep: 1 22573 }, 22574 { 22575 clsName: 'years', 22576 navFnc: 'y', 22577 navStep: 10 22578 }, 22579 { 22580 clsName: 'decades', 22581 navFnc: 'y', 22582 navStep: 100 22583 } 22584 ], 22585 viewModes = ['days', 'months', 'years', 'decades'], 22586 verticalModes = ['top', 'bottom', 'auto'], 22587 horizontalModes = ['left', 'right', 'auto'], 22588 toolbarPlacements = ['default', 'top', 'bottom'], 22589 keyMap = { 22590 'up': 38, 22591 38: 'up', 22592 'down': 40, 22593 40: 'down', 22594 'left': 37, 22595 37: 'left', 22596 'right': 39, 22597 39: 'right', 22598 'tab': 9, 22599 9: 'tab', 22600 'escape': 27, 22601 27: 'escape', 22602 'enter': 13, 22603 13: 'enter', 22604 'pageUp': 33, 22605 33: 'pageUp', 22606 'pageDown': 34, 22607 34: 'pageDown', 22608 'shift': 16, 22609 16: 'shift', 22610 'control': 17, 22611 17: 'control', 22612 'space': 32, 22613 32: 'space', 22614 't': 84, 22615 84: 't', 22616 'delete': 46, 22617 46: 'delete' 22618 }, 22619 keyState = {}, 22620 22621 /******************************************************************************** 22622 * 22623 * Private functions 22624 * 22625 ********************************************************************************/ 22626 22627 hasTimeZone = function () { 22628 return moment.tz !== undefined && options.timeZone !== undefined && options.timeZone !== null && options.timeZone !== ''; 22629 }, 22630 22631 getMoment = function (d) { 22632 var returnMoment; 22633 22634 if (d === undefined || d === null) { 22635 returnMoment = moment(); //TODO should this use format? and locale? 22636 } else if (moment.isDate(d) || moment.isMoment(d)) { 22637 // If the date that is passed in is already a Date() or moment() object, 22638 // pass it directly to moment. 22639 returnMoment = moment(d); 22640 } else if (hasTimeZone()) { // There is a string to parse and a default time zone 22641 // parse with the tz function which takes a default time zone if it is not in the format str
22641ing 22642 returnMoment = moment.tz(d, parseFormats, options.useStrict, options.timeZone); 22643 } else { 22644 returnMoment = moment(d, parseFormats, options.useStrict); 22645 } 22646 22647 if (hasTimeZone()) { 22648 returnMoment.tz(options.timeZone); 22649 } 22650 22651 return returnMoment; 22652 }, 22653 22654 isEnabled = function (granularity) { 22655 if (typeof granularity !== 'string' || granularity.length > 1) { 22656 throw new TypeError('isEnabled expects a single character string parameter'); 22657 } 22658 switch (granularity) { 22659 case 'y': 22660 return actualFormat.indexOf('Y') !== -1; 22661 case 'M': 22662 return actualFormat.indexOf('M') !== -1; 22663 case 'd': 22664 return actualFormat.toLowerCase().indexOf('d') !== -1; 22665 case 'h': 22666 case 'H': 22667 return actualFormat.toLowerCase().indexOf('h') !== -1; 22668 case 'm': 22669 return actualFormat.indexOf('m') !== -1; 22670 case 's': 22671 return actualFormat.indexOf('s') !== -1; 22672 default: 22673 return false; 22674 } 22675 }, 22676 22677 hasTime = function () { 22678 return (isEnabled('h') || isEnabled('m') || isEnabled('s')); 22679 }, 22680 22681 hasDate = function () { 22682 return (isEnabled('y') || isEnabled('M') || isEnabled('d')); 22683 }, 22684 22685 getDatePickerTemplate = function () { 22686 var headTemplate = $('<thead>') 22687 .append($('<tr>') 22688 .append($('<th>').addClass('prev').attr('data-action', 'previous') 22689 .append($('<span>').addClass(options.icons.previous)) 22690 ) 22691 .append($('<th>').addClass('picker-switch').attr('data-action', 'pickerSwitch').attr('colspan', (options.calendarWeeks ? '6' : '5'))) 22692 .append($('<th>').addClass('next').attr('data-action', 'next') 22693 .append($('<span>').addClass(options.icons.next)) 22694 ) 22695 ), 22696 contTemplate = $('<tbody>') 22697 .append($('<tr>') 22698 .append($('<td>').attr('colspan', (options.calendarWeeks ? '8' : '7'))) 22699 ); 22700 22701 return [ 22702 $('<div>').addClass('datepicker-days') 22703 .append($('<table>').addClass('table-condensed') 22704 .append(headTemplate) 22705 .append($('<tbody>')) 22706 ), 22707 $('<div>').addClass('datepicker-months') 22708 .append($('<table>').addClass('table-condensed') 22709 .append(headTemplate.clone()) 22710 .append(contTemplate.clone()) 22711 ), 22712 $('<div>').addClass('datepicker-years') 22713 .append($('<table>').addClass('table-condensed') 22714 .append(headTemplate.clone()) 22715 .append(contTemplate.clone()) 22716 ), 22717 $('<div>').addClass('datepicker-decades') 22718 .append($('<table>').addClass('table-condensed') 22719 .append(headTemplate.clone()) 22720 .append(contTemplate.clone()) 22721 ) 22722 ]; 22723 }, 22724 22725 getTimePickerMainTemplate = function () { 22726 var topRow = $('<tr>'), 22727 middleRow = $('<tr>'), 22728 bottomRow = $('<tr>'); 22729 22730 if (isEnabled('h')) { 22731 topRow.append($('<td>') 22732 .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.incrementHour }).addClass('btn').attr('data-action', 'incrementHours').append($('<span>').addClass(options.icons.up)))); 22733 middleRow.append($('<td>') 22734 .append($('<span>').addClass('timepicker-hour').attr({ 'data-time-component': 'hours', 'title': options.tooltips.pickHour }).attr('data-action', 'showHours'))); 22735 bottomRow.append($('<td>') 22736 .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.decrementHour }).addClass('btn').attr('data-action', 'decrementHours').append($('<span>').addClass(options.icons.down)))); 22737 } 22738 if (isEnabled('m')) { 22739 if (isEnabled('h')) { 22740 topRow.append($('<td>').addClass('separator')); 22741 middleRow.append($('<td>').addClass('separator').html(':')); 22742 bottomRow.append($('<td>').addClass('separator')); 22743 } 22744 topRow.append($('<td>') 22745 .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.incrementMinute }).addClass('btn').attr('data-action', 'incrementMinutes') 22746 .append($('<span>').addClass(options.icons.up)))); 22747 middleRow.append($('<td>') 22748 .append($('<span>').addClass('timepicker-minute').attr({ 'data-time-component': 'minutes', 'title': options.tooltips.pickMinute }).attr('data-action', 'showMinutes'))); 22749 bottomRow.append($('<td>') 22750 .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.decrementMinute }).addClass('btn').attr('data-action', 'decrementMinutes') 22751 .append($('<span>').addClass(options.icons.down)))); 22752 } 22753 if (isEnabled('s')) { 22754 if (isEnabled('m')) { 22755 topRow.append($('<td>').addClass('separator')); 22756 middleRow.append($('<td>').addClass('separator').html(':')); 22757 bottomRow.append($('<td>').addClass('separator')); 22758 } 22759 topRow.append($('<td>') 22760 .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.incrementSecond }).addClass('btn').attr('data-action', 'incrementSeconds') 22761 .append($('<span>').addClass(options.icons.up)))); 22762 middleRow.append($('<td>') 22763 .append($('<span>').addClass('timepicker-second').attr({ 'data-time-component': '
22763seconds', 'title': options.tooltips.pickSecond }).attr('data-action', 'showSeconds'))); 22764 bottomRow.append($('<td>') 22765 .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.decrementSecond }).addClass('btn').attr('data-action', 'decrementSeconds') 22766 .append($('<span>').addClass(options.icons.down)))); 22767 } 22768 22769 if (!use24Hours) { 22770 topRow.append($('<td>').addClass('separator')); 22771 middleRow.append($('<td>') 22772 .append($('<button>').addClass('btn btn-primary').attr({ 'data-action': 'togglePeriod', tabindex: '-1', 'title': options.tooltips.togglePeriod }))); 22773 bottomRow.append($('<td>').addClass('separator')); 22774 } 22775 22776 return $('<div>').addClass('timepicker-picker') 22777 .append($('<table>').addClass('table-condensed') 22778 .append([topRow, middleRow, bottomRow])); 22779 }, 22780 22781 getTimePickerTemplate = function () { 22782 var hoursView = $('<div>').addClass('timepicker-hours') 22783 .append($('<table>').addClass('table-condensed')), 22784 minutesView = $('<div>').addClass('timepicker-minutes') 22785 .append($('<table>').addClass('table-condensed')), 22786 secondsView = $('<div>').addClass('timepicker-seconds') 22787 .append($('<table>').addClass('table-condensed')), 22788 ret = [getTimePickerMainTemplate()]; 22789 22790 if (isEnabled('h')) { 22791 ret.push(hoursView); 22792 } 22793 if (isEnabled('m')) { 22794 ret.push(minutesView); 22795 } 22796 if (isEnabled('s')) { 22797 ret.push(secondsView); 22798 } 22799 22800 return ret; 22801 }, 22802 22803 getToolbar = function () { 22804 var row = []; 22805 if (options.showTodayButton) { 22806 row.push($('<td>').append($('<a>').attr({ 'data-action': 'today', 'title': options.tooltips.today }).append($('<span>').addClass(options.icons.today)))); 22807 } 22808 if (!options.sideBySide && hasDate() && hasTime()) { 22809 row.push($('<td>').append($('<a>').attr({ 'data-action': 'togglePicker', 'title': options.tooltips.selectTime }).append($('<span>').addClass(options.icons.time)))); 22810 } 22811 if (options.showClear) { 22812 row.push($('<td>').append($('<a>').attr({ 'data-action': 'clear', 'title': options.tooltips.clear }).append($('<span>').addClass(options.icons.clear)))); 22813 } 22814 if (options.showClose) { 22815 row.push($('<td>').append($('<a>').attr({ 'data-action': 'close', 'title': options.tooltips.close }).append($('<span>').addClass(options.icons.close)))); 22816 } 22817 return $('<table>').addClass('table-condensed').append($('<tbody>').append($('<tr>').append(row))); 22818 }, 22819 22820 getTemplate = function () { 22821 var template = $('<div>').addClass('bootstrap-datetimepicker-widget dropdown-menu'), 22822 dateView = $('<div>').addClass('datepicker').append(getDatePickerTemplate()), 22823 timeView = $('<div>').addClass('timepicker').append(getTimePickerTemplate()), 22824 content = $('<ul>').addClass('list-unstyled'), 22825 toolbar = $('<li>').addClass('picker-switch' + (options.collapse ? ' accordion-toggle' : '')).append(getToolbar()); 22826 22827 if (options.inline) { 22828 template.removeClass('dropdown-menu'); 22829 } 22830 22831 if (use24Hours) { 22832 template.addClass('usetwentyfour'); 22833 } 22834 22835 if (isEnabled('s') && !use24Hours) { 22836 template.addClass('wider'); 22837 } 22838 22839 if (options.sideBySide && hasDate() && hasTime()) { 22840 template.addClass('timepicker-sbs'); 22841 if (options.toolbarPlacement === 'top') { 22842 template.append(toolbar); 22843 } 22844 template.append( 22845 $('<div>').addClass('row') 22846 .append(dateView.addClass('col-md-6')) 22847 .append(timeView.addClass('col-md-6')) 22848 ); 22849 if (options.toolbarPlacement === 'bottom') { 22850 template.append(toolbar); 22851 } 22852 return template; 22853 } 22854 22855 if (options.toolbarPlacement === 'top') { 22856 content.append(toolbar); 22857 } 22858 if (hasDate()) { 22859 content.append($('<li>').addClass((options.collapse && hasTime() ? 'collapse in' : '')).append(dateView)); 22860 } 22861 if (options.toolbarPlacement === 'default') { 22862 content.append(toolbar); 22863 } 22864 if (hasTime()) { 22865 content.append($('<li>
22865').addClass((options.collapse && hasDate() ? 'collapse' : '')).append(timeView)); 22866 } 22867 if (options.toolbarPlacement === 'bottom') { 22868 content.append(toolbar); 22869 } 22870 return template.append(content); 22871 }, 22872 22873 dataToOptions = function () { 22874 var eData, 22875 dataOptions = {}; 22876 22877 if (element.is('input') || options.inline) { 22878 eData = element.data(); 22879 } else { 22880 eData = element.find('input').data(); 22881 } 22882 22883 if (eData.dateOptions && eData.dateOptions instanceof Object) { 22884 dataOptions = $.extend(true, dataOptions, eData.dateOptions); 22885 } 22886 22887 $.each(options, function (key) { 22888 var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1); 22889 if (eData[attributeName] !== undefined) { 22890 dataOptions[key] = eData[attributeName]; 22891 } 22892 }); 22893 return dataOptions; 22894 }, 22895 22896 place = function () { 22897 var position = (component || element).position(), 22898 offset = (component || element).offset(), 22899 vertical = options.widgetPositioning.vertical, 22900 horizontal = options.widgetPositioning.horizontal, 22901 parent; 22902 22903 if (options.widgetParent) { 22904 parent = options.widgetParent.append(widget); 22905 } else if (element.is('input')) { 22906 parent = element.after(widget).parent(); 22907 } else if (options.inline) { 22908 parent = element.append(widget); 22909 return; 22910 } else { 22911 parent = element; 22912 element.children().first().after(widget); 22913 } 22914 22915 // Top and bottom logic 22916 if (vertical === 'auto') { 22917 if (offset.top + widget.height() * 1.5 >= $(window).height() + $(window).scrollTop() && 22918 widget.height() + element.outerHeight() < offset.top) { 22919 vertical = 'top'; 22920 } else { 22921 vertical = 'bottom'; 22922 } 22923 } 22924 22925 // Left and right logic 22926 if (horizontal === 'auto') { 22927 if (parent.width() < offset.left + widget.outerWidth() / 2 && 22928 offset.left + widget.outerWidth() > $(window).width()) { 22929 horizontal = 'right'; 22930 } else { 22931 horizontal = 'left'; 22932 } 22933 } 22934 22935 if (vertical === 'top') { 22936 widget.addClass('top').removeClass('bottom'); 22937 } else { 22938 widget.addClass('bottom').removeClass('top'); 22939 } 22940 22941 if (horizontal === 'right') { 22942 widget.addClass('pull-right'); 22943 } else { 22944 widget.removeClass('pull-right'); 22945 } 22946 22947 // find the first parent element that has a non-static css positioning 22948 if (parent.css('position') === 'static') { 22949 parent = parent.parents().filter(function () { 22950 return $(this).css('position') !== 'static'; 22951 }).first(); 22952 } 22953 22954 if (parent.length === 0) { 22955 throw new Error('datetimepicker component should be placed within a non-static positioned container'); 22956 } 22957 22958 widget.css({ 22959 top: vertical === 'top' ? 'auto' : position.top + element.outerHeight(), 22960 bottom: vertical === 'top' ? parent.outerHeight() - (parent === element ? 0 : position.top) : 'auto', 22961 left: horizontal === 'left' ? (parent === element ? 0 : position.left) : 'auto', 22962 right: horizontal === 'left' ? 'auto' : parent.outerWidth() - element.outerWidth() - (parent === element ? 0 : position.left) 22963 }); 22964 }, 22965 22966 notifyEvent = function (e) { 22967 if (e.type === 'dp.change' && ((e.date && e.date.isSame(e.oldDate)) || (!e.date && !e.oldDate))) { 22968 return; 22969 } 22970 element.trigger(e); 22971 }, 22972 22973 viewUpdate = function (e) { 22974 if (e === 'y') { 22975 e = 'YYYY'; 22976 } 22977 notifyEvent({ 22978 type: 'dp.update', 22979 change: e,
22980 viewDate: viewDate.clone() 22981 }); 22982 }, 22983 22984 showMode = function (dir) { 22985 if (!widget) { 22986 return; 22987 } 22988 if (dir) { 22989 currentViewMode = Math.max(minViewModeNumber, Math.min(3, currentViewMode + dir)); 22990 } 22991 widget.find('.datepicker > div').hide().filter('.datepicker-' + datePickerModes[currentViewMode].clsName).show(); 22992 }, 22993 22994 fillDow = function () { 22995 var row = $('<tr>'), 22996 currentDate = viewDate.clone().startOf('w').startOf('d'); 22997 22998 if (options.calendarWeeks === true) { 22999 row.append($('<th>').addClass('cw').text('#')); 23000 } 23001 23002 while (currentDate.isBefore(viewDate.clone().endOf('w'))) { 23003 row.append($('<th>').addClass('dow').text(currentDate.format('dd'))); 23004 currentDate.add(1, 'd'); 23005 } 23006 widget.find('.datepicker-days thead').append(row); 23007 }, 23008 23009 isInDisabledDates = function (testDate) { 23010 return options.disabledDates[testDate.format('YYYY-MM-DD')] === true; 23011 }, 23012 23013 isInEnabledDates = function (testDate) { 23014 return options.enabledDates[testDate.format('YYYY-MM-DD')] === true; 23015 }, 23016 23017 isInDisabledHours = function (testDate) { 23018 return options.disabledHours[testDate.format('H')] === true; 23019 }, 23020 23021 isInEnabledHours = function (testDate) { 23022 return options.enabledHours[testDate.format('H')] === true; 23023 }, 23024 23025 isValid = function (targetMoment, granularity) { 23026 if (!targetMoment.isValid()) { 23027 return false; 23028 } 23029 if (options.disabledDates && granularity === 'd' && isInDisabledDates(targetMoment)) { 23030 return false; 23031 } 23032 if (options.enabledDates && granularity === 'd' && !isInEnabledDates(targetMoment)) { 23033 return false; 23034 } 23035 if (options.minDate && targetMoment.isBefore(options.minDate, granularity)) { 23036 return false; 23037 } 23038 if (options.maxDate && targetMoment.isAfter(options.maxDate, granularity)) { 23039 return false; 23040 } 23041 if (options.daysOfWeekDisabled && granularity === 'd' && options.daysOfWeekDisabled.indexOf(targetMoment.day()) !== -1) { 23042 return false; 23043 } 23044 if (options.disabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && isInDisabledHours(targetMoment)) { 23045 return false; 23046 } 23047 if (options.enabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && !isInEnabledHours(targetMoment)) { 23048 return false; 23049 } 23050 if (options.disabledTimeIntervals && (granularity === 'h' || granularity === 'm' || granularity === 's')) { 23051 var found = false; 23052 $.each(options.disabledTimeIntervals, function () { 23053 if (targetMoment.isBetween(this[0], this[1])) { 23054 found = true; 23055 return false; 23056 } 23057 }); 23058 if (found) { 23059 return false; 23060 } 23061 } 23062 return true; 23063 }, 23064 23065 fillMonths = function () { 23066 var spans = [], 23067 monthsShort = viewDate.clone().startOf('y').startOf('d'); 23068 while (monthsShort.isSame(viewDate, 'y')) { 23069 spans.push($('<span>').attr('data-action', 'selectMonth').addClass('month').text(monthsShort.format('MMM'))); 23070 monthsShort.add(1, 'M'); 23071 } 23072 widget.find('.datepicker-months td').empty().append(spans); 23073 }, 23074 23075 updateMonths = function () { 23076 var monthsView = widget.find('.datepicker-months'), 23077 monthsViewHeader = monthsView.find('th'), 23078 months = monthsView.find('tbody').find('span'); 23079 23080 monthsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevYear); 23081 monthsViewHeader.eq(1).attr('title', options.tooltips.selectYear); 23082 monthsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextYear); 23083 23084 monthsView.find('.disabled').removeClass('disabled'); 23085 23086 if (!isValid(viewDate.clone().subtract(1, 'y'), 'y')) { 23087 monthsViewHeader.eq(0).addClass('disabled'); 23088 } 23089 23090 monthsViewHeader.eq(1).text(viewDate.year()); 23091 23092 if (!isValid(viewDate.clone().add(1, 'y'), 'y')) { 23093 monthsViewHeader.eq(2).addClass('disabled'); 23094 } 23095 23096 months.removeClass('active'); 23097 if (date.isSame(viewDate, 'y') && !unset) { 23098 months.eq(date.month()).addClass('active'); 23099 } 23100 23101 months.each(function (index) { 23102 if (!isValid(viewDate.clone().month(index), 'M')) { 23103 $(this).addClass('disabled'); 23104 } 23105 }); 23106 }, 23107 23108 updateYears = function () { 23109 var yearsView = widget.find('.datepicker-years'), 23110 yearsViewHeader = yearsView.find('th'),
23111 startYear = viewDate.clone().subtract(5, 'y'), 23112 endYear = viewDate.clone().add(6, 'y'), 23113 html = ''; 23114 23115 yearsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevDecade); 23116 yearsViewHeader.eq(1).attr('title', options.tooltips.selectDecade); 23117 yearsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextDecade); 23118 23119 yearsView.find('.disabled').removeClass('disabled'); 23120 23121 if (options.minDate && options.minDate.isAfter(startYear, 'y')) { 23122 yearsViewHeader.eq(0).addClass('disabled'); 23123 } 23124 23125 yearsViewHeader.eq(1).text(startYear.year() + '-' + endYear.year()); 23126 23127 if (options.maxDate && options.maxDate.isBefore(endYear, 'y')) { 23128 yearsViewHeader.eq(2).addClass('disabled'); 23129 } 23130 23131 while (!startYear.isAfter(endYear, 'y')) { 23132 html += '<span data-action="selectYear" class="year' + (startYear.isSame(date, 'y') && !unset ? ' active' : '') + (!isValid(startYear, 'y') ? ' disabled' : '') + '">' + startYear.year() + '</span>'; 23133 startYear.add(1, 'y'); 23134 } 23135 23136 yearsView.find('td').html(html); 23137 }, 23138 23139 updateDecades = function () { 23140 var decadesView = widget.find('.datepicker-decades'), 23141 decadesViewHeader = decadesView.find('th'), 23142 startDecade = moment({ y: viewDate.year() - (viewDate.year() % 100) - 1 }), 23143 endDecade = startDecade.clone().add(100, 'y'), 23144 startedAt = startDecade.clone(), 23145 minDateDecade = false, 23146 maxDateDecade = false, 23147 endDecadeYear, 23148 html = ''; 23149 23150 decadesViewHeader.eq(0).find('span').attr('title', options.tooltips.prevCentury); 23151 decadesViewHeader.eq(2).find('span').attr('title', options.tooltips.nextCentury); 23152 23153 decadesView.find('.disabled').removeClass('disabled'); 23154 23155 if (startDecade.isSame(moment({ y: 1900 })) || (options.minDate && options.minDate.isAfter(startDecade, 'y'))) { 23156 decadesViewHeader.eq(0).addClass('disabled'); 23157 } 23158 23159 decadesViewHeader.eq(1).text(startDecade.year() + '-' + endDecade.year()); 23160 23161 if (startDecade.isSame(moment({ y: 2000 })) || (options.maxDate && options.maxDate.isBefore(endDecade, 'y'))) { 23162 decadesViewHeader.eq(2).addClass('disabled'); 23163 } 23164 23165 while (!startDecade.isAfter(endDecade, 'y')) { 23166 endDecadeYear = startDecade.year() + 12; 23167 minDateDecade = options.minDate && options.minDate.isAfter(startDecade, 'y') && options.minDate.year() <= endDecadeYear; 23168 maxDateDecade = options.maxDate && options.maxDate.isAfter(startDecade, 'y') && options.maxDate.year() <= endDecadeYear; 23169 html += '<span data-action="selectDecade" class="decade' + (date.isAfter(startDecade) && date.year() <= endDecadeYear ? ' active' : '') + 23170 (!isValid(startDecade, 'y') && !minDateDecade && !maxDateDecade ? ' disabled' : '') + '" data-selection="' + (startDecade.year() + 6) + '">' + (startDecade.year() + 1) + ' - ' + (startDecade.year() + 12) + '</span>'; 23171 startDecade.add(12, 'y'); 23172 } 23173 html += '<span></span><span></span><span></span>'; //push the dangling block over, at least this way it's even 23174 23175 decadesView.find('td').html(html); 23176 decadesViewHeader.eq(1).text((startedAt.year() + 1) + '-' + (startDecade.year())); 23177 }, 23178 23179 fillDate = function () { 23180 var daysView = widget.find('.datepicker-days'), 23181 daysViewHeader = daysView.find('th'), 23182 currentDate, 23183 html = [], 23184 row, 23185 clsNames = [], 23186 i; 23187 23188 if (!hasDate()) { 23189 return; 23190 } 23191 23192 daysViewHeader.eq(0).find('span').attr('title', options.tooltips.prevMonth); 23193 daysViewHeader.eq(1).attr('title', options.tooltips.selectMonth); 23194 daysViewHeader.eq(2).find('span').attr('title', options.tooltips.nextMonth); 23195 23196 daysView.find('.disabled').removeClass('disabled'); 23197 daysViewHeader.eq(1).text(viewDate.format(options.dayViewHeaderFormat)); 23198 23199 if (!isValid(viewDate.clone().subtract(1, 'M'), 'M')) { 23200 daysViewHeader.eq(0).addClass('disabled'); 23201 } 23202 if (!isValid(viewDate.clone().add(1, 'M'), 'M')) { 23203 daysViewHeader.eq(2).addClass('disabled'); 23204 } 23205
23206 currentDate = viewDate.clone().startOf('M').startOf('w').startOf('d'); 23207 23208 for (i = 0; i < 42; i++) { //always display 42 days (should show 6 weeks) 23209 if (currentDate.weekday() === 0) { 23210 row = $('<tr>'); 23211 if (options.calendarWeeks) { 23212 row.append('<td class="cw">' + currentDate.week() + '</td>'); 23213 } 23214 html.push(row); 23215 } 23216 clsNames = ['day']; 23217 if (currentDate.isBefore(viewDate, 'M')) { 23218 clsNames.push('old'); 23219 } 23220 if (currentDate.isAfter(viewDate, 'M')) { 23221 clsNames.push('new'); 23222 } 23223 if (currentDate.isSame(date, 'd') && !unset) { 23224 clsNames.push('active'); 23225 } 23226 if (!isValid(currentDate, 'd')) { 23227 clsNames.push('disabled'); 23228 } 23229 if (currentDate.isSame(getMoment(), 'd')) { 23230 clsNames.push('today'); 23231 } 23232 if (currentDate.day() === 0 || currentDate.day() === 6) { 23233 clsNames.push('weekend'); 23234 } 23235 notifyEvent({ 23236 type: 'dp.classify', 23237 date: currentDate, 23238 classNames: clsNames 23239 }); 23240 row.append('<td data-action="selectDay" data-day="' + currentDate.format('L') + '" class="' + clsNames.join(' ') + '">' + currentDate.date() + '</td>'); 23241 currentDate.add(1, 'd'); 23242 } 23243 23244 daysView.find('tbody').empty().append(html); 23245 23246 updateMonths(); 23247 23248 updateYears(); 23249 23250 updateDecades(); 23251 }, 23252 23253 fillHours = function () { 23254 var table = widget.find('.timepicker-hours table'), 23255 currentHour = viewDate.clone().startOf('d'), 23256 html = [], 23257 row = $('<tr>'); 23258 23259 if (viewDate.hour() > 11 && !use24Hours) { 23260 currentHour.hour(12); 23261 } 23262 while (currentHour.isSame(viewDate, 'd') && (use24Hours || (viewDate.hour() < 12 && currentHour.hour() < 12) || viewDate.hour() > 11)) { 23263 if (currentHour.hour() % 4 === 0) { 23264 row = $('<tr>'); 23265 html.push(row); 23266 } 23267 row.append('<td data-action="selectHour" class="hour' + (!isValid(currentHour, 'h') ? ' disabled' : '') + '">' + currentHour.format(use24Hours ? 'HH' : 'hh') + '</td>'); 23268 currentHour.add(1, 'h'); 23269 } 23270 table.empty().append(html); 23271 }, 23272 23273 fillMinutes = function () { 23274 var table = widget.find('.timepicker-minutes table'), 23275 currentMinute = viewDate.clone().startOf('h'), 23276 html = [], 23277 row = $('<tr>'), 23278 step = options.stepping === 1 ? 5 : options.stepping; 23279 23280 while (viewDate.isSame(currentMinute, 'h')) { 23281 if (currentMinute.minute() % (step * 4) === 0) { 23282 row = $('<tr>'); 23283 html.push(row); 23284 } 23285 row.append('<td data-action="selectMinute" class="minute' + (!isValid(currentMinute, 'm') ? ' disabled' : '') + '">' + currentMinute.format('mm') + '</td>'); 23286 currentMinute.add(step, 'm'); 23287 } 23288 table.empty().append(html); 23289 }, 23290 23291 fillSeconds = function () { 23292 var table = widget.find('.timepicker-seconds table'), 23293 currentSecond = viewDate.clone().startOf('m'), 23294 html = [], 23295 row = $('<tr>'); 23296 23297 while (viewDate.isSame(currentSecond, 'm')) { 23298 if (currentSecond.second() % 20 === 0) { 23299 row = $('<tr>'); 23300 html.push(row); 23301 } 23302 row.append('<td data-action="selectSecond" class="second' + (!isValid(currentSecond, 's') ? ' disabled' : '') + '">' + currentSecond.format('ss') + '</td>'); 23303 currentSecond.add(5, 's'); 23304 } 23305 23306 table.empty().append(html); 23307 }, 23308 23309 fillTime = function () {
23310 var toggle, newDate, timeComponents = widget.find('.timepicker span[data-time-component]'); 23311 23312 if (!use24Hours) { 23313 toggle = widget.find('.timepicker [data-action=togglePeriod]'); 23314 newDate = date.clone().add((date.hours() >= 12) ? -12 : 12, 'h'); 23315 23316 toggle.text(date.format('A')); 23317 23318 if (isValid(newDate, 'h')) { 23319 toggle.removeClass('disabled'); 23320 } else { 23321 toggle.addClass('disabled'); 23322 } 23323 } 23324 timeComponents.filter('[data-time-component=hours]').text(date.format(use24Hours ? 'HH' : 'hh')); 23325 timeComponents.filter('[data-time-component=minutes]').text(date.format('mm')); 23326 timeComponents.filter('[data-time-component=seconds]').text(date.format('ss')); 23327 23328 fillHours(); 23329 fillMinutes(); 23330 fillSeconds(); 23331 }, 23332 23333 update = function () { 23334 if (!widget) { 23335 return; 23336 } 23337 fillDate(); 23338 fillTime(); 23339 }, 23340 23341 setValue = function (targetMoment) { 23342 var oldDate = unset ? null : date; 23343 23344 // case of calling setValue(null or false) 23345 if (!targetMoment) { 23346 unset = true; 23347 input.val(''); 23348 element.data('date', ''); 23349 notifyEvent({ 23350 type: 'dp.change', 23351 date: false, 23352 oldDate: oldDate 23353 }); 23354 update(); 23355 return; 23356 } 23357 23358 targetMoment = targetMoment.clone().locale(options.locale); 23359 23360 if (hasTimeZone()) { 23361 targetMoment.tz(options.timeZone); 23362 } 23363 23364 if (options.stepping !== 1) { 23365 targetMoment.minutes((Math.round(targetMoment.minutes() / options.stepping) * options.stepping)).seconds(0); 23366 23367 while (options.minDate && targetMoment.isBefore(options.minDate)) { 23368 targetMoment.add(options.stepping, 'minutes'); 23369 } 23370 } 23371 23372 if (isValid(targetMoment)) { 23373 date = targetMoment; 23374 viewDate = date.clone(); 23375 input.val(date.format(actualFormat)); 23376 element.data('date', date.format(actualFormat)); 23377 unset = false; 23378 update(); 23379 notifyEvent({ 23380 type: 'dp.change', 23381 date: date.clone(), 23382 oldDate: oldDate 23383 }); 23384 } else { 23385 if (!options.keepInvalid) { 23386 input.val(unset ? '' : date.format(actualFormat)); 23387 } else { 23388 notifyEvent({ 23389 type: 'dp.change', 23390 date: targetMoment, 23391 oldDate: oldDate 23392 }); 23393 } 23394 notifyEvent({ 23395 type: 'dp.error', 23396 date: targetMoment, 23397 oldDate: oldDate 23398 }); 23399 } 23400 }, 23401 23402 /** 23403 * Hides the widget. Possibly will emit dp.hide 23404 */ 23405 hide = function () { 23406 var transitioning = false; 23407 if (!widget) { 23408 return picker; 23409 } 23410 // Ignore event if in the middle of a picker transition 23411 widget.find('.collapse').each(function () { 23412 var collapseData = $(this).data('collapse'); 23413 if (collapseData && collapseData.transitioning) { 23414 transitioning = true; 23415 return false; 23416 } 23417 return true; 23418 }); 23419 if (transitioning) { 23420 return picker; 23421 } 23422 if (component && component.hasClass('btn')) { 23423 component.toggleClass('active'); 23424 } 23425 widget.hide(); 23426 23427 $(window).off('resize', place); 23428 widget.off('click', '[data-action]'); 23429 widget.off('mousedown', false); 23430 23431 widget.remove(); 23432 widget = false;
23433 23434 notifyEvent({ 23435 type: 'dp.hide', 23436 date: date.clone() 23437 }); 23438 23439 input.blur(); 23440 23441 viewDate = date.clone(); 23442 23443 return picker; 23444 }, 23445 23446 clear = function () { 23447 setValue(null); 23448 }, 23449 23450 parseInputDate = function (inputDate) { 23451 if (options.parseInputDate === undefined) { 23452 if (!moment.isMoment(inputDate) || inputDate instanceof Date) { 23453 inputDate = getMoment(inputDate); 23454 } 23455 } else { 23456 inputDate = options.parseInputDate(inputDate); 23457 } 23458 //inputDate.locale(options.locale); 23459 return inputDate; 23460 }, 23461 23462 /******************************************************************************** 23463 * 23464 * Widget UI interaction functions 23465 * 23466 ********************************************************************************/ 23467 actions = { 23468 next: function () { 23469 var navFnc = datePickerModes[currentViewMode].navFnc; 23470 viewDate.add(datePickerModes[currentViewMode].navStep, navFnc); 23471 fillDate(); 23472 viewUpdate(navFnc); 23473 }, 23474 23475 previous: function () { 23476 var navFnc = datePickerModes[currentViewMode].navFnc; 23477 viewDate.subtract(datePickerModes[currentViewMode].navStep, navFnc); 23478 fillDate(); 23479 viewUpdate(navFnc); 23480 }, 23481 23482 pickerSwitch: function () { 23483 showMode(1); 23484 }, 23485 23486 selectMonth: function (e) { 23487 var month = $(e.target).closest('tbody').find('span').index($(e.target)); 23488 viewDate.month(month); 23489 if (currentViewMode === minViewModeNumber) { 23490 setValue(date.clone().year(viewDate.year()).month(viewDate.month())); 23491 if (!options.inline) { 23492 hide(); 23493 } 23494 } else { 23495 showMode(-1); 23496 fillDate(); 23497 } 23498 viewUpdate('M'); 23499 }, 23500 23501 selectYear: function (e) { 23502 var year = parseInt($(e.target).text(), 10) || 0; 23503 viewDate.year(year); 23504 if (currentViewMode === minViewModeNumber) { 23505 setValue(date.clone().year(viewDate.year())); 23506 if (!options.inline) { 23507 hide(); 23508 } 23509 } else { 23510 showMode(-1); 23511 fillDate(); 23512 } 23513 viewUpdate('YYYY'); 23514 }, 23515 23516 selectDecade: function (e) { 23517 var year = parseInt($(e.target).data('selection'), 10) || 0; 23518 viewDate.year(year); 23519 if (currentViewMode === minViewModeNumber) { 23520 setValue(date.clone().year(viewDate.year())); 23521 if (!options.inline) { 23522 hide(); 23523 } 23524 } else { 23525 showMode(-1); 23526 fillDate(); 23527 } 23528 viewUpdate('YYYY'); 23529 }, 23530 23531 selectDay: function (e) { 23532 var day = viewDate.clone(); 23533 if ($(e.target).is('.old')) { 23534 day.subtract(1, 'M'); 23535 } 23536 if ($(e.target).is('.new')) { 23537 day.add(1, 'M'); 23538 } 23539 setValue(day.date(parseInt($(e.target).text(), 10))); 23540 if (!hasTime() && !options.keepOpen && !options.inline) { 23541 hide(); 23542 } 23543 }, 23544 23545 incrementHours: function () { 23546 var newDate = date.clone().add(1, 'h'); 23547 if (isValid(newDate, 'h')) { 23548 setValue(newDate); 23549 } 23550 }, 23551 23552 incrementMinutes: function () { 23553 var newDate = date.clone().add(options.stepping, 'm'); 23554 if (isValid(newDate, 'm')) { 23555 setValue(newDate); 23556 } 23557 }, 23558 23559 incrementSeconds: function () { 23560 var newDate = date.clone().add(1, 's'); 23561 if (isValid(newDate, 's')) { 23562 setValue(newDate); 23563 } 23564 }, 23565 23566 decrementHours: function () { 23567 var newDate = date.clone().subtract(1, 'h'); 23568 if (isValid(newDate, 'h')) { 23569 setValue(newDate); 23570 } 23571 }, 23572 23573 decrementMinutes: function () { 23574 var newDate = date.clone().subtract(options.stepping, 'm'); 23575 if (isValid(newDate, 'm')) { 23576 setValue(newDate); 23577 } 23578 }, 23579 23580 decrementSeconds: function () { 23581 var newDate = date.clone().subtract(1, 's'); 23582 if (isValid(newDate, 's')) { 23583 setValue(newDate); 23584 } 23585 }, 23586 23587 togglePeriod: function () { 23588 setValue(date.clone().add((date.hours() >= 12) ? -12 : 12, 'h')); 23589 }, 23590 23591 togglePicker: function (e) { 23592 var $this = $(e.target), 23593 $parent = $this.closest('ul'), 23594 expanded = $parent.find('.in'), 23595 closed = $parent.find('.collapse:not(.in)'), 23596 collapseData; 23597 23598 if (expanded && expanded.length) { 23599 collapseData = expanded.data('collapse'); 23600 if (collapseData && collapseData.transitioning) { 23601 return; 23602 } 23603 if (expanded.collapse) { // if collapse plugin is available through bootstrap.js then use it 23604 expanded.collapse('hide'); 23605 closed.collapse('show'); 23606 } else { // otherwise just toggle in class on the two views 23607 expanded.removeClass('in'); 23608 closed.addClass('in'); 23609 } 23610 if ($this.is('span')) { 23611 $this.toggleClass(options.icons.time + ' ' + options.icons.date); 23612 } else { 23613 $this.find('span').toggleClass(options.icons.time + ' ' + options.icons.date); 23614 } 23615 23616 // NOTE: uncomment if toggled state will be restored in show() 23617 //if (component) { 23618 // component.find('span').toggleClass(options.icons.time + ' ' + options.icons.date); 23619 //} 23620 } 23621 }, 23622 23623 showPicker: function () { 23624 widget.find('.timepicker > div:not(.timepicker-picker)').hide(); 23625 widget.find('.timepicker .timepicker-picker').show(); 23626 }, 23627 23628 showHours: function () { 23629 widget.find('.timepicker .timepicker-picker').hide(); 23630 widget.find('.timepicker .timepicker-hours').show(); 23631 }, 23632 23633 showMinutes: function () { 23634 widget.find('.timepicker .timepicker-picker').hide(); 23635 widget.find('.timepicker .timepicker-minutes').show(); 23636 }, 23637 23638 showSeconds: function () { 23639 widget.find('.timepicker .timepicker-picker').hide(); 23640 widget.find('.timepicker .timepicker-seconds').show(); 23641 }, 23642 23643 selectHour: function (e) { 23644 var hour = parseInt($(e.target).text(), 10); 23645 23646 if (!use24Hours) { 23647 if (date.hours() >= 12) { 23648 if (hour !== 12) { 23649 hour += 12; 23650 } 23651 } else { 23652 if (hour === 12) { 23653 hour = 0; 23654 } 23655 } 23656 } 23657 setValue(date.clone().hours(hour)); 23658 actions.showPicker.call(picker); 23659 }, 23660 23661 selectMinute: function (e) { 23662 setValue(date.clone().minutes(parseInt($(e.target).text(), 10))); 23663 actions.showPicker.call(picker); 23664 }, 23665 23666 selectSecond: function (e) { 23667 setValue(date.clone().seconds(parseInt($(e.target).text(), 10))); 23668 actions.showPicker.call(picker); 23669 }, 23670 23671 clear: clear, 23672 23673 today: function () { 23674 var todaysDate = getMoment(); 23675 if (isValid(todaysDate, 'd')) { 23676 setValue(todaysDate); 23677 } 23678 }, 23679 23680 close: hide 23681 }, 23682 23683 doAction = function (e) { 23684 if ($(e.currentTarget).is('.disabled')) { 23685 return false;
23686 } 23687 actions[$(e.currentTarget).data('action')].apply(picker, arguments); 23688 return false; 23689 }, 23690 23691 /** 23692 * Shows the widget. Possibly will emit dp.show and dp.change 23693 */ 23694 show = function () { 23695 var currentMoment, 23696 useCurrentGranularity = { 23697 'year': function (m) { 23698 return m.month(0).date(1).hours(0).seconds(0).minutes(0); 23699 }, 23700 'month': function (m) { 23701 return m.date(1).hours(0).seconds(0).minutes(0); 23702 }, 23703 'day': function (m) { 23704 return m.hours(0).seconds(0).minutes(0); 23705 }, 23706 'hour': function (m) { 23707 return m.seconds(0).minutes(0); 23708 }, 23709 'minute': function (m) { 23710 return m.seconds(0); 23711 } 23712 }; 23713 23714 if (input.prop('disabled') || (!options.ignoreReadonly && input.prop('readonly')) || widget) { 23715 return picker; 23716 } 23717 if (input.val() !== undefined && input.val().trim().length !== 0) { 23718 setValue(parseInputDate(input.val().trim())); 23719 } else if (unset && options.useCurrent && (options.inline || (input.is('input') && input.val().trim().length === 0))) { 23720 currentMoment = getMoment(); 23721 if (typeof options.useCurrent === 'string') { 23722 currentMoment = useCurrentGranularity[options.useCurrent](currentMoment); 23723 } 23724 setValue(currentMoment); 23725 } 23726 widget = getTemplate(); 23727 23728 fillDow(); 23729 fillMonths(); 23730 23731 widget.find('.timepicker-hours').hide(); 23732 widget.find('.timepicker-minutes').hide(); 23733 widget.find('.timepicker-seconds').hide(); 23734 23735 update(); 23736 showMode(); 23737 23738 $(window).on('resize', place); 23739 widget.on('click', '[data-action]', doAction); // this handles clicks on the widget 23740 widget.on('mousedown', false); 23741 23742 if (component && component.hasClass('btn')) { 23743 component.toggleClass('active'); 23744 } 23745 place(); 23746 widget.show(); 23747 if (options.focusOnShow && !input.is(':focus')) { 23748 input.focus(); 23749 } 23750 23751 notifyEvent({ 23752 type: 'dp.show' 23753 }); 23754 return picker; 23755 }, 23756 23757 /** 23758 * Shows or hides the widget 23759 */ 23760 toggle = function () { 23761 return (widget ? hide() : show()); 23762 }, 23763 23764 keydown = function (e) { 23765 var handler = null, 23766 index, 23767 index2, 23768 pressedKeys = [], 23769 pressedModifiers = {}, 23770 currentKey = e.which, 23771 keyBindKeys, 23772 allModifiersPressed, 23773 pressed = 'p'; 23774 23775 keyState[currentKey] = pressed; 23776 23777 for (index in keyState) { 23778 if (keyState.hasOwnProperty(index) && keyState[index] === pressed) { 23779 pressedKeys.push(index); 23780 if (parseInt(index, 10) !== currentKey) { 23781 pressedModifiers[index] = true; 23782 } 23783 } 23784 } 23785 23786 for (index in options.keyBinds) { 23787 if (options.keyBinds.hasOwnProperty(index) && typeof (options.keyBinds[index]) === 'function') { 23788 keyBindKeys = index.split(' '); 23789 if (keyBindKeys.length === pressedKeys.length && keyMap[currentKey] === keyBindKeys[keyBindKeys.length - 1]) { 23790 allModifiersPressed = true; 23791 for (index2 = keyBindKeys.length - 2; index2 >= 0; index2--) { 23792 if (!(keyMap[keyBindKeys[index2]] in pressedModifiers)) { 23793 allModifiersPressed = false;
23794 break; 23795 } 23796 } 23797 if (allModifiersPressed) { 23798 handler = options.keyBinds[index]; 23799 break; 23800 } 23801 } 23802 } 23803 } 23804 23805 if (handler) { 23806 handler.call(picker, widget); 23807 e.stopPropagation(); 23808 e.preventDefault(); 23809 } 23810 }, 23811 23812 keyup = function (e) { 23813 keyState[e.which] = 'r'; 23814 e.stopPropagation(); 23815 e.preventDefault(); 23816 }, 23817 23818 change = function (e) { 23819 var val = $(e.target).val().trim(), 23820 parsedDate = val ? parseInputDate(val) : null; 23821 setValue(parsedDate); 23822 e.stopImmediatePropagation(); 23823 return false; 23824 }, 23825 23826 attachDatePickerElementEvents = function () { 23827 input.on({ 23828 'change': change, 23829 'blur': options.debug ? '' : hide, 23830 'keydown': keydown, 23831 'keyup': keyup, 23832 'focus': options.allowInputToggle ? show : '' 23833 }); 23834 23835 if (element.is('input')) { 23836 input.on({ 23837 'focus': show 23838 }); 23839 } else if (component) { 23840 component.on('click', toggle); 23841 component.on('mousedown', false); 23842 } 23843 }, 23844 23845 detachDatePickerElementEvents = function () { 23846 input.off({ 23847 'change': change, 23848 'blur': blur, 23849 'keydown': keydown, 23850 'keyup': keyup, 23851 'focus': options.allowInputToggle ? hide : '' 23852 }); 23853 23854 if (element.is('input')) { 23855 input.off({ 23856 'focus': show 23857 }); 23858 } else if (component) { 23859 component.off('click', toggle); 23860 component.off('mousedown', false); 23861 } 23862 }, 23863 23864 indexGivenDates = function (givenDatesArray) { 23865 // Store given enabledDates and disabledDates as keys. 23866 // This way we can check their existence in O(1) time instead of looping through whole array. 23867 // (for example: options.enabledDates['2014-02-27'] === true) 23868 var givenDatesIndexed = {}; 23869 $.each(givenDatesArray, function () { 23870 var dDate = parseInputDate(this); 23871 if (dDate.isValid()) { 23872 givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true; 23873 } 23874 }); 23875 return (Object.keys(givenDatesIndexed).length) ? givenDatesIndexed : false; 23876 }, 23877 23878 indexGivenHours = function (givenHoursArray) { 23879 // Store given enabledHours and disabledHours as keys. 23880 // This way we can check their existence in O(1) time instead of looping through whole array. 23881 // (for example: options.enabledHours['2014-02-27'] === true) 23882 var givenHoursIndexed = {}; 23883 $.each(givenHoursArray, function () { 23884 givenHoursIndexed[this] = true; 23885 }); 23886 return (Object.keys(givenHoursIndexed).length) ? givenHoursIndexed : false; 23887 }, 23888 23889 initFormatting = function () { 23890 var format = options.format || 'L LT'; 23891 23892 actualFormat = format.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) { 23893 var newinput = date.localeData().longDateFormat(formatInput) || formatInput; 23894 return newinput.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput2) { //temp fix for #740 23895 return date.localeData().longDateFormat(formatInput2) || formatInput2; 23896 }); 23897 }); 23898 23899 23900 parseFormats = options.extraFormats ? options.extraFormats.slice() : []; 23901 if (parseFormats.indexOf(format) < 0 && parseFormats.indexOf(actualFormat) < 0) { 23902 parseFormats.push(actualFormat); 23903 } 23904 23905 use24Hours = (actualFormat.toLowerCase().indexOf('a') < 1 && actualFormat.replace(/\[.*?\]/g, '').indexOf('h') < 1); 23906 23907 if (isEnabled('y')) { 23908 minViewModeNumber = 2; 23909 } 23910 if (isEnabled('M')) { 23911 minViewModeNumber = 1; 23912 } 23913 if (isEnabled('d')) { 23914 minViewModeNumber = 0; 23915 } 23916
23917 currentViewMode = Math.max(minViewModeNumber, currentViewMode); 23918 23919 if (!unset) { 23920 setValue(date); 23921 } 23922 }; 23923 23924 /******************************************************************************** 23925 * 23926 * Public API functions 23927 * ===================== 23928 * 23929 * Important: Do not expose direct references to private objects or the options 23930 * object to the outer world. Always return a clone when returning values or make 23931 * a clone when setting a private variable. 23932 * 23933 ********************************************************************************/ 23934 picker.destroy = function () { 23935 ///<summary>Destroys the widget and removes all attached event listeners</summary> 23936 hide(); 23937 detachDatePickerElementEvents(); 23938 element.removeData('DateTimePicker'); 23939 element.removeData('date'); 23940 }; 23941 23942 picker.toggle = toggle; 23943 23944 picker.show = show; 23945 23946 picker.hide = hide; 23947 23948 picker.disable = function () { 23949 ///<summary>Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. 23950 ///If the widget was visible before that call it is hidden. Possibly emits dp.hide</summary> 23951 hide(); 23952 if (component && component.hasClass('btn')) { 23953 component.addClass('disabled'); 23954 } 23955 input.prop('disabled', true); 23956 return picker; 23957 }; 23958 23959 picker.enable = function () { 23960 ///<summary>Enables the input element, the component is attached to, by removing disabled attribute from it.</summary> 23961 if (component && component.hasClass('btn')) { 23962 component.removeClass('disabled'); 23963 } 23964 input.prop('disabled', false); 23965 return picker; 23966 }; 23967 23968 picker.ignoreReadonly = function (ignoreReadonly) { 23969 if (arguments.length === 0) { 23970 return options.ignoreReadonly; 23971 } 23972 if (typeof ignoreReadonly !== 'boolean') { 23973 throw new TypeError('ignoreReadonly () expects a boolean parameter'); 23974 } 23975 options.ignoreReadonly = ignoreReadonly; 23976 return picker; 23977 }; 23978 23979 picker.options = function (newOptions) { 23980 if (arguments.length === 0) { 23981 return $.extend(true, {}, options); 23982 } 23983 23984 if (!(newOptions instanceof Object)) { 23985 throw new TypeError('options() options parameter should be an object'); 23986 } 23987 $.extend(true, options, newOptions); 23988 $.each(options, function (key, value) { 23989 if (picker[key] !== undefined) { 23990 picker[key](value); 23991 } else { 23992 throw new TypeError('option ' + key + ' is not recognized!'); 23993 } 23994 }); 23995 return picker; 23996 }; 23997 23998 picker.date = function (newDate) { 23999 ///<signature helpKeyword="$.fn.datetimepicker.date"> 24000 ///<summary>Returns the component's model current date, a moment object or null if not set.</summary> 24001 ///<returns type="Moment">date.clone()</returns> 24002 ///</signature> 24003 ///<signature> 24004 ///<summary>Sets the components model current moment to it. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.</summary> 24005 ///<param name="newDate" locid="$.fn.datetimepicker.date_p:newDate">Takes string, Date, moment, null parameter.</param> 24006 ///</signature> 24007 if (arguments.length === 0) { 24008 if (unset) { 24009 return null; 24010 } 24011 return date.clone(); 24012 } 24013 24014 if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) { 24015 throw new TypeError('date() parameter must be one of [null, string, moment or Date]'); 24016 } 24017 24018 setValue(newDate === null ? null : parseInputDate(newDate)); 24019 return picker; 24020 }; 24021 24022 picker.format = function (newFormat) { 24023 ///<summary>test su</summary> 24024 ///<param name="newFormat">info about para</param> 24025 ///<returns type="string|boolean">returns foo</returns> 24026 if (arguments.length === 0) { 24027 return options.format; 24028 } 24029 24030 if ((typeof newFormat !== 'string') && ((typeof newFormat !== 'boolean') || (newFormat !== false))) { 24031 throw new TypeError('format() expects a string or boolean:false parameter ' + newFormat); 24032 } 24033 24034 options.format = newFormat; 24035 if (actualFormat) { 24036 initFormatting(); // reinit formatting 24037 } 24038 return picker; 24039 }; 24040 24041 picker.timeZone = function (newZone) { 24042 if (arguments.length === 0) { 24043 return options.timeZone; 24044 } 24045 24046 if (typeof newZone !== 'string') { 24047 throw new TypeError('newZone() expects a string parameter'); 24048 } 24049 24050 options.timeZone = newZone; 24051 24052 return picker; 24053 }; 24054 24055 picker.dayViewHeaderFormat = function (newFormat) { 24056 if (arguments.length === 0) { 24057 return options.dayViewHeaderFormat; 24058 } 24059 24060 if (typeof newFormat !== 'string') { 24061 throw new TypeError('dayViewHeaderFormat() expects a string parameter'); 24062 } 24063 24064 options.dayViewHeaderFormat = newFormat; 24065 return picker; 24066 }; 24067 24068 picker.extraFormats = function (formats) { 24069 if (arguments.length === 0) { 24070 return options.extraFormats; 24071 } 24072 24073 if (formats !== false && !(formats instanceof Array)) { 24074 throw new TypeError('extraFormats() expects an array or false parameter'); 24075 } 24076 24077 options.extraFormats = formats; 24078 if (parseFormats) { 24079 initFormatting(); // reinit formatting 24080 } 24081 return picker; 24082 }; 24083 24084 picker.disabledDates = function (dates) { 24085 ///<signature helpKeyword="$.fn.datetimepicker.disabledDates"> 24086 ///<summary>Returns an array with the currently set disabled dates on the component.</summary> 24087 ///<returns type="array">options.disabledDates</returns> 24088 ///</signature> 24089 ///<signature> 24090 ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of 24091 ///options.enabledDates if such exist.</summary> 24092 ///<param name="dates" locid="$.fn.datetimepicker.disabledDates_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.
24092</param> 24093 ///</signature> 24094 if (arguments.length === 0) { 24095 return (options.disabledDates ? $.extend({}, options.disabledDates) : options.disabledDates); 24096 } 24097 24098 if (!dates) { 24099 options.disabledDates = false; 24100 update(); 24101 return picker; 24102 } 24103 if (!(dates instanceof Array)) { 24104 throw new TypeError('disabledDates() expects an array parameter'); 24105 } 24106 options.disabledDates = indexGivenDates(dates); 24107 options.enabledDates = false; 24108 update(); 24109 return picker; 24110 }; 24111 24112 picker.enabledDates = function (dates) { 24113 ///<signature helpKeyword="$.fn.datetimepicker.enabledDates"> 24114 ///<summary>Returns an array with the currently set enabled dates on the component.</summary> 24115 ///<returns type="array">options.enabledDates</returns> 24116 ///</signature> 24117 ///<signature> 24118 ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledDates if such exist.</summary> 24119 ///<param name="dates" locid="$.fn.datetimepicker.enabledDates_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param> 24120 ///</signature> 24121 if (arguments.length === 0) { 24122 return (options.enabledDates ? $.extend({}, options.enabledDates) : options.enabledDates); 24123 } 24124 24125 if (!dates) { 24126 options.enabledDates = false; 24127 update(); 24128 return picker; 24129 } 24130 if (!(dates instanceof Array)) { 24131 throw new TypeError('enabledDates() expects an array parameter'); 24132 } 24133 options.enabledDates = indexGivenDates(dates); 24134 options.disabledDates = false; 24135 update(); 24136 return picker; 24137 }; 24138 24139 picker.daysOfWeekDisabled = function (daysOfWeekDisabled) { 24140 if (arguments.length === 0) { 24141 return options.daysOfWeekDisabled.splice(0); 24142 } 24143 24144 if ((typeof daysOfWeekDisabled === 'boolean') && !daysOfWeekDisabled) { 24145 options.daysOfWeekDisabled = false; 24146 update(); 24147 return picker; 24148 } 24149 24150 if (!(daysOfWeekDisabled instanceof Array)) { 24151 throw new TypeError('daysOfWeekDisabled() expects an array parameter'); 24152 } 24153 options.daysOfWeekDisabled = daysOfWeekDisabled.reduce(function (previousValue, currentValue) { 24154 currentValue = parseInt(currentValue, 10); 24155 if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) { 24156 return previousValue; 24157 } 24158 if (previousValue.indexOf(currentValue) === -1) { 24159 previousValue.push(currentValue); 24160 } 24161 return previousValue; 24162 }, []).sort(); 24163 if (options.useCurrent && !options.keepInvalid) { 24164 var tries = 0; 24165 while (!isValid(date, 'd')) { 24166 date.add(1, 'd'); 24167 if (tries === 31) { 24168 throw 'Tried 31 times to find a valid date'; 24169 } 24170 tries++; 24171 } 24172 setValue(date); 24173 } 24174 update(); 24175 return picker; 24176 }; 24177 24178 picker.maxDate = function (maxDate) { 24179 if (arguments.length === 0) { 24180 return options.maxDate ? options.maxDate.clone() : options.maxDate; 24181 } 24182 24183 if ((typeof maxDate === 'boolean') && maxDate === false) { 24184 options.maxDate = false; 24185 update(); 24186 return picker; 24187 } 24188 24189 if (typeof maxDate === 'string') { 24190 if (maxDate === 'now' || maxDate === 'moment') { 24191 maxDate = getMoment(); 24192 } 24193 } 24194 24195 var parsedDate = parseInputDate(maxDate); 24196 24197 if (!parsedDate.isValid()) { 24198 throw new TypeError('maxDate() Could not parse date parameter: ' + maxDate); 24199 } 24200 if (options.minDate && parsedDate.isBefore(options.minDate)) { 24201 throw new TypeError('maxDate() date parameter is before options.minDate: ' + parsedDate.format(actualFormat)); 24202 } 24203 options.maxDate = parsedDate; 24204 if (options.useCurrent && !options.keepInvalid && date.isAfter(maxDate)) { 24205 setValue(options.maxDate); 24206 } 24207 if (viewDate.isAfter(parsedDate)) { 24208 viewDate = parsedDate.clone().subtract(options.stepping, 'm'); 24209 } 24210 update(); 24211 return picker; 24212 }; 24213 24214 picker.minDate = function (minDate) { 24215 if (arguments.length === 0) { 24216 return options.minDate ? options.minDate.clone() : options.minDate; 24217 } 24218 24219 if ((typeof minDate === 'boolean') && minDate === false) { 24220 options.minDate = false;
24221 update(); 24222 return picker; 24223 } 24224 24225 if (typeof minDate === 'string') { 24226 if (minDate === 'now' || minDate === 'moment') { 24227 minDate = getMoment(); 24228 } 24229 } 24230 24231 var parsedDate = parseInputDate(minDate); 24232 24233 if (!parsedDate.isValid()) { 24234 throw new TypeError('minDate() Could not parse date parameter: ' + minDate); 24235 } 24236 if (options.maxDate && parsedDate.isAfter(options.maxDate)) { 24237 throw new TypeError('minDate() date parameter is after options.maxDate: ' + parsedDate.format(actualFormat)); 24238 } 24239 options.minDate = parsedDate; 24240 if (options.useCurrent && !options.keepInvalid && date.isBefore(minDate)) { 24241 setValue(options.minDate); 24242 } 24243 if (viewDate.isBefore(parsedDate)) { 24244 viewDate = parsedDate.clone().add(options.stepping, 'm'); 24245 } 24246 update(); 24247 return picker; 24248 }; 24249 24250 picker.defaultDate = function (defaultDate) { 24251 ///<signature helpKeyword="$.fn.datetimepicker.defaultDate"> 24252 ///<summary>Returns a moment with the options.defaultDate option configuration or false if not set</summary> 24253 ///<returns type="Moment">date.clone()</returns> 24254 ///</signature> 24255 ///<signature> 24256 ///<summary>Will set the picker's inital date. If a boolean:false value is passed the options.defaultDate parameter is cleared.</summary> 24257 ///<param name="defaultDate" locid="$.fn.datetimepicker.defaultDate_p:defaultDate">Takes a string, Date, moment, boolean:false</param> 24258 ///</signature> 24259 if (arguments.length === 0) { 24260 return options.defaultDate ? options.defaultDate.clone() : options.defaultDate; 24261 } 24262 if (!defaultDate) { 24263 options.defaultDate = false; 24264 return picker; 24265 } 24266 24267 if (typeof defaultDate === 'string') { 24268 if (defaultDate === 'now' || defaultDate === 'moment') { 24269 defaultDate = getMoment(); 24270 } else { 24271 defaultDate = getMoment(defaultDate); 24272 } 24273 } 24274 24275 var parsedDate = parseInputDate(defaultDate); 24276 if (!parsedDate.isValid()) { 24277 throw new TypeError('defaultDate() Could not parse date parameter: ' + defaultDate); 24278 } 24279 if (!isValid(parsedDate)) { 24280 throw new TypeError('defaultDate() date passed is invalid according to component setup validations'); 24281 } 24282 24283 options.defaultDate = parsedDate; 24284 24285 if ((options.defaultDate && options.inline) || input.val().trim() === '') { 24286 setValue(options.defaultDate); 24287 } 24288 return picker; 24289 }; 24290 24291 picker.locale = function (locale) { 24292 if (arguments.length === 0) { 24293 return options.locale; 24294 } 24295 24296 if (!moment.localeData(locale)) { 24297 throw new TypeError('locale() locale ' + locale + ' is not loaded from moment locales!'); 24298 } 24299 24300 options.locale = locale; 24301 date.locale(options.locale); 24302 viewDate.locale(options.locale); 24303 24304 if (actualFormat) { 24305 initFormatting(); // reinit formatting 24306 } 24307 if (widget) { 24308 hide(); 24309 show(); 24310 } 24311 return picker; 24312 }; 24313 24314 picker.stepping = function (stepping) { 24315 if (arguments.length === 0) { 24316 return options.stepping; 24317 } 24318 24319 stepping = parseInt(stepping, 10); 24320 if (isNaN(stepping) || stepping < 1) { 24321 stepping = 1; 24322 } 24323 options.stepping = stepping; 24324 return picker; 24325 }; 24326 24327 picker.useCurrent = function (useCurrent) { 24328 var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute']; 24329 if (arguments.length === 0) { 24330 return options.useCurrent; 24331 } 24332 24333 if ((typeof useCurrent !== 'boolean') && (typeof useCurrent !== 'string')) { 24334 throw new TypeError('useCurrent() expects a boolean or string parameter'); 24335 } 24336 if (typeof useCurrent === 'string' && useCurrentOptions.indexOf(useCurrent.toLowerCase()) === -1) { 24337 throw new TypeError('useCurrent() expects a string parameter of ' + useCurrentOptions.join(', ')); 24338 } 24339 options.useCurrent = useCurrent; 24340 return picker; 24341 }; 24342 24343 picker.collapse = function (collapse) { 24344 if (arguments.length === 0) { 24345 return options.collapse; 24346 } 24347 24348 if (typeof collapse !== 'boolean') { 24349 throw new TypeError('collapse() expects a boolean parameter'); 24350 } 24351 if (options.collapse === collapse) { 24352 return picker; 24353 } 24354 options.collapse = collapse; 24355 if (widget) { 24356 hide(); 24357 show(); 24358 } 24359 return picker; 24360 }; 24361 24362 picker.icons = function (icons) { 24363 if (arguments.length === 0) { 24364 return $.extend({}, options.icons); 24365 } 24366 24367 if (!(icons instanceof Object)) { 24368 throw new TypeError('icons() expects parameter to be an Object'); 24369 } 24370 $.extend(options.icons, icons); 24371 if (widget) { 24372 hide(); 24373 show(); 24374 } 24375 return picker; 24376 }; 24377 24378 picker.tooltips = function (tooltips) { 24379 if (arguments.length === 0) { 24380 return $.extend({}, options.tooltips); 24381 } 24382 24383 if (!(tooltips instanceof Object)) { 24384 throw new TypeError('tooltips() expects parameter to be an Object'); 24385 } 24386 $.extend(options.tooltips, tooltips); 24387 if (widget) { 24388 hide(); 24389 show(); 24390 } 24391 return picker; 24392 }; 24393 24394 picker.useStrict = function (useStrict) { 24395 if (arguments.length === 0) { 24396 return options.useStrict; 24397 } 24398 24399 if (typeof useStrict !== 'boolean') { 24400 throw new TypeError('useStrict() expects a boolean parameter'); 24401 } 24402 options.useStrict = useStrict; 24403 return picker; 24404 }; 24405 24406 picker.sideBySide = function (sideBySide) { 24407 if (arguments.length === 0) { 24408 return options.sideBySide; 24409 } 24410 24411 if (typeof sideBySide !== 'boolean') { 24412 throw new TypeError('sideBySide() expects a boolean parameter'); 24413 } 24414 options.sideBySide = sideBySide; 24415 if (widget) { 24416 hide(); 24417 show(); 24418 } 24419 return picker; 24420 }; 24421 24422 picker.viewMode = function (viewMode) { 24423 if (arguments.length === 0) { 24424 return options.viewMode; 24425 } 24426 24427 if (typeof viewMode !== 'string') { 24428 throw new TypeError('viewMode() expects a string parameter'); 24429 } 24430 24431 if (viewModes.indexOf(viewMode) === -1) { 24432 throw new TypeError('viewMode() parameter must be one of (' + viewModes.join(', ') + ') value'); 24433 } 24434
24435 options.viewMode = viewMode; 24436 currentViewMode = Math.max(viewModes.indexOf(viewMode), minViewModeNumber); 24437 24438 showMode(); 24439 return picker; 24440 }; 24441 24442 picker.toolbarPlacement = function (toolbarPlacement) { 24443 if (arguments.length === 0) { 24444 return options.toolbarPlacement; 24445 } 24446 24447 if (typeof toolbarPlacement !== 'string') { 24448 throw new TypeError('toolbarPlacement() expects a string parameter'); 24449 } 24450 if (toolbarPlacements.indexOf(toolbarPlacement) === -1) { 24451 throw new TypeError('toolbarPlacement() parameter must be one of (' + toolbarPlacements.join(', ') + ') value'); 24452 } 24453 options.toolbarPlacement = toolbarPlacement; 24454 24455 if (widget) { 24456 hide(); 24457 show(); 24458 } 24459 return picker; 24460 }; 24461 24462 picker.widgetPositioning = function (widgetPositioning) { 24463 if (arguments.length === 0) { 24464 return $.extend({}, options.widgetPositioning); 24465 } 24466 24467 if (({}).toString.call(widgetPositioning) !== '[object Object]') { 24468 throw new TypeError('widgetPositioning() expects an object variable'); 24469 } 24470 if (widgetPositioning.horizontal) { 24471 if (typeof widgetPositioning.horizontal !== 'string') { 24472 throw new TypeError('widgetPositioning() horizontal variable must be a string'); 24473 } 24474 widgetPositioning.horizontal = widgetPositioning.horizontal.toLowerCase(); 24475 if (horizontalModes.indexOf(widgetPositioning.horizontal) === -1) { 24476 throw new TypeError('widgetPositioning() expects horizontal parameter to be one of (' + horizontalModes.join(', ') + ')'); 24477 } 24478 options.widgetPositioning.horizontal = widgetPositioning.horizontal; 24479 } 24480 if (widgetPositioning.vertical) { 24481 if (typeof widgetPositioning.vertical !== 'string') { 24482 throw new TypeError('widgetPositioning() vertical variable must be a string'); 24483 } 24484 widgetPositioning.vertical = widgetPositioning.vertical.toLowerCase(); 24485 if (verticalModes.indexOf(widgetPositioning.vertical) === -1) { 24486 throw new TypeError('widgetPositioning() expects vertical parameter to be one of (' + verticalModes.join(', ') + ')'); 24487 } 24488 options.widgetPositioning.vertical = widgetPositioning.vertical; 24489 } 24490 update(); 24491 return picker; 24492 }; 24493 24494 picker.calendarWeeks = function (calendarWeeks) { 24495 if (arguments.length === 0) { 24496 return options.calendarWeeks; 24497 } 24498 24499 if (typeof calendarWeeks !== 'boolean') { 24500 throw new TypeError('calendarWeeks() expects parameter to be a boolean value'); 24501 } 24502 24503 options.calendarWeeks = calendarWeeks; 24504 update(); 24505 return picker; 24506 }; 24507 24508 picker.showTodayButton = function (showTodayButton) { 24509 if (arguments.length === 0) { 24510 return options.showTodayButton; 24511 } 24512 24513 if (typeof showTodayButton !== 'boolean') { 24514 throw new TypeError('showTodayButton() expects a boolean parameter'); 24515 } 24516 24517 options.showTodayButton = showTodayButton; 24518 if (widget) { 24519 hide(); 24520 show(); 24521 } 24522 return picker; 24523 }; 24524 24525 picker.showClear = function (showClear) { 24526 if (arguments.length === 0) { 24527 return options.showClear; 24528 } 24529 24530 if (typeof showClear !== 'boolean') { 24531 throw new TypeError('showClear() expects a boolean parameter'); 24532 } 24533 24534 options.showClear = showClear; 24535 if (widget) { 24536 hide(); 24537 show(); 24538 } 24539 return picker; 24540 }; 24541 24542 picker.widgetParent = function (widgetParent) { 24543 if (arguments.length === 0) { 24544 return options.widgetParent; 24545 } 24546 24547 if (typeof widgetParent === 'string') { 24548 widgetParent = $(widgetParent); 24549 } 24550 24551 if (widgetParent !== null && (typeof widgetParent !== 'string' && !(widgetParent instanceof $))) { 24552 throw new TypeError('widgetParent() expects a string or a jQuery object parameter'); 24553 } 24554 24555 options.widgetParent = widgetParent; 24556 if (widget) { 24557 hide(); 24558 show(); 24559 } 24560 return picker; 24561 }; 24562 24563 picker.keepOpen = function (keepOpen) { 24564 if (arguments.length === 0) { 24565 return options.keepOpen; 24566 } 24567 24568 if (typeof keepOpen !== 'boolean') { 24569 throw new TypeError('keepOpen() expects a boolean parameter'); 24570 } 24571 24572 options.keepOpen = keepOpen; 24573 return picker; 24574 }; 24575 24576 picker.focusOnShow = function (focusOnShow) { 24577 if (arguments.length === 0) { 24578 return options.focusOnShow; 24579 } 24580 24581 if (typeof focusOnShow !== 'boolean') { 24582 throw new TypeError('focusOnShow() expects a boolean parameter'); 24583 } 24584 24585 options.focusOnShow = focusOnShow; 24586 return picker; 24587 }; 24588 24589 picker.inline = function (inline) { 24590 if (arguments.length === 0) { 24591 return options.inline; 24592 } 24593 24594 if (typeof inline !== 'boolean') {
24595 throw new TypeError('inline() expects a boolean parameter'); 24596 } 24597 24598 options.inline = inline; 24599 return picker; 24600 }; 24601 24602 picker.clear = function () { 24603 clear(); 24604 return picker; 24605 }; 24606 24607 picker.keyBinds = function (keyBinds) { 24608 if (arguments.length === 0) { 24609 return options.keyBinds; 24610 } 24611 24612 options.keyBinds = keyBinds; 24613 return picker; 24614 }; 24615 24616 picker.getMoment = function (d) { 24617 return getMoment(d); 24618 }; 24619 24620 picker.debug = function (debug) { 24621 if (typeof debug !== 'boolean') { 24622 throw new TypeError('debug() expects a boolean parameter'); 24623 } 24624 24625 options.debug = debug; 24626 return picker; 24627 }; 24628 24629 picker.allowInputToggle = function (allowInputToggle) { 24630 if (arguments.length === 0) { 24631 return options.allowInputToggle; 24632 } 24633 24634 if (typeof allowInputToggle !== 'boolean') { 24635 throw new TypeError('allowInputToggle() expects a boolean parameter'); 24636 } 24637 24638 options.allowInputToggle = allowInputToggle; 24639 return picker; 24640 }; 24641 24642 picker.showClose = function (showClose) { 24643 if (arguments.length === 0) { 24644 return options.showClose; 24645 } 24646 24647 if (typeof showClose !== 'boolean') { 24648 throw new TypeError('showClose() expects a boolean parameter'); 24649 } 24650 24651 options.showClose = showClose; 24652 return picker; 24653 }; 24654 24655 picker.keepInvalid = function (keepInvalid) { 24656 if (arguments.length === 0) { 24657 return options.keepInvalid; 24658 } 24659 24660 if (typeof keepInvalid !== 'boolean') { 24661 throw new TypeError('keepInvalid() expects a boolean parameter'); 24662 } 24663 options.keepInvalid = keepInvalid; 24664 return picker; 24665 }; 24666 24667 picker.datepickerInput = function (datepickerInput) { 24668 if (arguments.length === 0) { 24669 return options.datepickerInput; 24670 } 24671 24672 if (typeof datepickerInput !== 'string') { 24673 throw new TypeError('datepickerInput() expects a string parameter'); 24674 } 24675 24676 options.datepickerInput = datepickerInput; 24677 return picker; 24678 }; 24679 24680 picker.parseInputDate = function (parseInputDate) { 24681 if (arguments.length === 0) { 24682 return options.parseInputDate; 24683 } 24684 24685 if (typeof parseInputDate !== 'function') { 24686 throw new TypeError('parseInputDate() sholud be as function'); 24687 } 24688 24689 options.parseInputDate = parseInputDate; 24690 24691 return picker; 24692 }; 24693 24694 picker.disabledTimeIntervals = function (disabledTimeIntervals) { 24695 ///<signature helpKeyword="$.fn.datetimepicker.disabledTimeIntervals"> 24696 ///<summary>Returns an array with the currently set disabled dates on the component.</summary> 24697 ///<returns type="array">options.disabledTimeIntervals</returns> 24698 ///</signature> 24699 ///<signature> 24700 ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of 24701 ///options.enabledDates if such exist.</summary> 24702 ///<param name="dates" locid="$.fn.datetimepicker.disabledTimeIntervals_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param> 24703 ///</signature> 24704 if (arguments.length === 0) { 24705 return (options.disabledTimeIntervals ? $.extend({}, options.disabledTimeIntervals) : options.disabledTimeIntervals); 24706 } 24707 24708 if (!disabledTimeIntervals) { 24709 options.disabledTimeIntervals = false; 24710 update(); 24711 return picker; 24712 } 24713 if (!(disabledTimeIntervals instanceof Array)) { 24714 throw new TypeError('disabledTimeIntervals() expects an array parameter'); 24715 } 24716 options.disabledTimeIntervals = disabledTimeIntervals; 24717 update(); 24718 return picker; 24719 }; 24720 24721 picker.disabledHours = function (hours) { 24722 ///<signature helpKeyword="$.fn.datetimepicker.disabledHours"> 24723 ///<summary>Returns an array with the currently set disabled hours on the component.</summary> 24724 ///<returns type="array">options.disabledHours</returns> 24725 ///</signature> 24726 ///<signature> 24727 ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of 24728 ///options.enabledHours if such exist.</summary> 24729 ///<param name="hours" locid="$.fn.datetimepicker.disabledHours_p:hours">Takes an [ int ] of values and disallows the user to select only from those hours.</param> 24730 ///</signature> 24731 if (arguments.length === 0) { 24732 return (options.disabledHours ? $.extend({}, options.disabledHours) : options.disabledHours); 24733 } 24734 24735 if (!hours) { 24736 options.disabledHours = false;
24737 update(); 24738 return picker; 24739 } 24740 if (!(hours instanceof Array)) { 24741 throw new TypeError('disabledHours() expects an array parameter'); 24742 } 24743 options.disabledHours = indexGivenHours(hours); 24744 options.enabledHours = false; 24745 if (options.useCurrent && !options.keepInvalid) { 24746 var tries = 0; 24747 while (!isValid(date, 'h')) { 24748 date.add(1, 'h'); 24749 if (tries === 24) { 24750 throw 'Tried 24 times to find a valid date'; 24751 } 24752 tries++; 24753 } 24754 setValue(date); 24755 } 24756 update(); 24757 return picker; 24758 }; 24759 24760 picker.enabledHours = function (hours) { 24761 ///<signature helpKeyword="$.fn.datetimepicker.enabledHours"> 24762 ///<summary>Returns an array with the currently set enabled hours on the component.</summary> 24763 ///<returns type="array">options.enabledHours</returns> 24764 ///</signature> 24765 ///<signature> 24766 ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledHours if such exist.</summary> 24767 ///<param name="hours" locid="$.fn.datetimepicker.enabledHours_p:hours">Takes an [ int ] of values and allows the user to select only from those hours.</param> 24768 ///</signature> 24769 if (arguments.length === 0) { 24770 return (options.enabledHours ? $.extend({}, options.enabledHours) : options.enabledHours); 24771 } 24772 24773 if (!hours) { 24774 options.enabledHours = false; 24775 update(); 24776 return picker; 24777 } 24778 if (!(hours instanceof Array)) { 24779 throw new TypeError('enabledHours() expects an array parameter'); 24780 } 24781 options.enabledHours = indexGivenHours(hours); 24782 options.disabledHours = false; 24783 if (options.useCurrent && !options.keepInvalid) { 24784 var tries = 0; 24785 while (!isValid(date, 'h')) { 24786 date.add(1, 'h'); 24787 if (tries === 24) { 24788 throw 'Tried 24 times to find a valid date'; 24789 } 24790 tries++; 24791 } 24792 setValue(date); 24793 } 24794 update(); 24795 return picker; 24796 }; 24797 /** 24798 * Returns the component's model current viewDate, a moment object or null if not set. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration. 24799 * @param {Takes string, viewDate, moment, null parameter.} newDate 24800 * @returns {viewDate.clone()} 24801 */ 24802 picker.viewDate = function (newDate) { 24803 if (arguments.length === 0) { 24804 return viewDate.clone(); 24805 } 24806 24807 if (!newDate) { 24808 viewDate = date.clone(); 24809 return picker; 24810 } 24811 24812 if (typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) { 24813 throw new TypeError('viewDate() parameter must be one of [string, moment or Date]'); 24814 } 24815 24816 viewDate = parseInputDate(newDate); 24817 viewUpdate(); 24818 return picker; 24819 }; 24820 24821 // initializing element and component attributes 24822 if (element.is('input')) { 24823 input = element; 24824 } else { 24825 input = element.find(options.datepickerInput); 24826 if (input.length === 0) { 24827 input = element.find('input'); 24828 } else if (!input.is('input')) { 24829 throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element'); 24830 } 24831 } 24832 24833 if (element.hasClass('input-group')) { 24834 // in case there is more then one 'input-group-addon' Issue #48 24835 if (element.find('.datepickerbutton').length === 0) { 24836 component = element.find('.input-group-addon'); 24837 } else { 24838 component = element.find('.datepickerbutton'); 24839 } 24840 } 24841 24842 if (!options.inline && !input.is('input')) { 24843 throw new Error('Could not initialize DateTimePicker without an input element'); 24844 } 24845 24846 // Set defaults for date here now instead of in var declaration 24847 date = getMoment(); 24848 viewDate = date.clone(); 24849 24850 $.extend(true, options, dataToOptions()); 24851 24852 picker.options(options); 24853 24854 initFormatting(); 24855 24856 attachDatePickerElementEvents(); 24857 24858 if (input.prop('disabled')) { 24859 picker.disable(); 24860 } 24861 if (input.is('input') && input.val().trim().length !== 0) { 24862 setValue(parseInputDate(input.val().trim())); 24863 } 24864 else if (options.defaultDate && input.attr('placeholder')
24864=== undefined) { 24865 setValue(options.defaultDate); 24866 } 24867 if (options.inline) { 24868 show(); 24869 } 24870 return picker; 24871 }; 24872 24873 /******************************************************************************** 24874 * 24875 * jQuery plugin constructor and defaults object 24876 * 24877 ********************************************************************************/ 24878 24879 /** 24880 * See (http://jquery.com/). 24881 * @name jQuery 24882 * @class 24883 * See the jQuery Library (http://jquery.com/) for full details. This just 24884 * documents the function and classes that are added to jQuery by this plug-in. 24885 */ 24886 /** 24887 * See (http://jquery.com/) 24888 * @name fn 24889 * @class 24890 * See the jQuery Library (http://jquery.com/) for full details. This just 24891 * documents the function and classes that are added to jQuery by this plug-in. 24892 * @memberOf jQuery 24893 */ 24894 /** 24895 * Show comments 24896 * @class datetimepicker 24897 * @memberOf jQuery.fn 24898 */ 24899 $.fn.datetimepicker = function (options) { 24900 options = options || {}; 24901 24902 var args = Array.prototype.slice.call(arguments, 1), 24903 isInstance = true, 24904 thisMethods = ['destroy', 'hide', 'show', 'toggle'], 24905 returnValue; 24906 24907 if (typeof options === 'object') { 24908 return this.each(function () { 24909 var $this = $(this), 24910 _options; 24911 if (!$this.data('DateTimePicker')) { 24912 // create a private copy of the defaults object 24913 _options = $.extend(true, {}, $.fn.datetimepicker.defaults, options); 24914 $this.data('DateTimePicker', dateTimePicker($this, _options)); 24915 } 24916 }); 24917 } else if (typeof options === 'string') { 24918 this.each(function () { 24919 var $this = $(this), 24920 instance = $this.data('DateTimePicker'); 24921 if (!instance) { 24922 throw new Error('bootstrap-datetimepicker("' + options + '") method was called on an element that is not using DateTimePicker'); 24923 } 24924 24925 returnValue = instance[options].apply(instance, args); 24926 isInstance = returnValue === instance; 24927 }); 24928 24929 if (isInstance || $.inArray(options, thisMethods) > -1) { 24930 return this; 24931 } 24932 24933 return returnValue; 24934 } 24935 24936 throw new TypeError('Invalid arguments for DateTimePicker: ' + options); 24937 }; 24938 24939 $.fn.datetimepicker.defaults = { 24940 timeZone: '', 24941 format: false, 24942 dayViewHeaderFormat: 'MMMM YYYY', 24943 extraFormats: false, 24944 stepping: 1, 24945 minDate: false, 24946 maxDate: false, 24947 useCurrent: true, 24948 collapse: true, 24949 locale: moment.locale(), 24950 defaultDate: false, 24951 disabledDates: false, 24952 enabledDates: false, 24953 icons: { 24954 time: 'glyphicon glyphicon-time', 24955 date: 'glyphicon glyphicon-calendar', 24956 up: 'glyphicon glyphicon-chevron-up', 24957 down: 'glyphicon glyphicon-chevron-down', 24958 previous: 'glyphicon glyphicon-chevron-left', 24959 next: 'glyphicon glyphicon-chevron-right', 24960 today: 'glyphicon glyphicon-screenshot', 24961 clear: 'glyphicon glyphicon-trash', 24962 close: 'glyphicon glyphicon-remove' 24963 }, 24964 tooltips: { 24965 today: 'Go to today', 24966 clear: 'Clear selection', 24967 close: 'Close the picker', 24968 selectMonth: 'Select Month', 24969 prevMonth: 'Previous Month', 24970 nextMonth: 'Next Month', 24971 selectYear: 'Select Year', 24972 prevYear: 'Previous Year', 24973 nextYear: 'Next Year', 24974 selectDecade: 'Select Decade', 24975 prevDecade: 'Previous Decade', 24976 nextDecade: 'Next Decade', 24977 prevCentury: 'Previous Century', 24978 nextCentury: 'Next Century', 24979 pickHour: 'Pick Hour', 24980 incrementHour: 'Increment Hour', 24981 decrementHour: 'Decrement Hour', 24982 pickMinute: 'Pick Minute', 24983 incrementMinute: 'Increment Minute', 24984 decrementMinute: 'Decrement Minute', 24985 pickSecond: 'Pick Second', 24986 incrementSecond: 'Increment Second', 24987 decrementSecond: 'Decrement Second',
24988 togglePeriod: 'Toggle Period', 24989 selectTime: 'Select Time' 24990 }, 24991 useStrict: false, 24992 sideBySide: false, 24993 daysOfWeekDisabled: false, 24994 calendarWeeks: false, 24995 viewMode: 'days', 24996 toolbarPlacement: 'default', 24997 showTodayButton: false, 24998 showClear: false, 24999 showClose: false, 25000 widgetPositioning: { 25001 horizontal: 'auto', 25002 vertical: 'auto' 25003 }, 25004 widgetParent: null, 25005 ignoreReadonly: false, 25006 keepOpen: false, 25007 focusOnShow: true, 25008 inline: false, 25009 keepInvalid: false, 25010 datepickerInput: '.datepickerinput', 25011 keyBinds: { 25012 up: function (widget) { 25013 if (!widget) { 25014 return; 25015 } 25016 var d = this.date() || this.getMoment(); 25017 if (widget.find('.datepicker').is(':visible')) { 25018 this.date(d.clone().subtract(7, 'd')); 25019 } else { 25020 this.date(d.clone().add(this.stepping(), 'm')); 25021 } 25022 }, 25023 down: function (widget) { 25024 if (!widget) { 25025 this.show(); 25026 return; 25027 } 25028 var d = this.date() || this.getMoment(); 25029 if (widget.find('.datepicker').is(':visible')) { 25030 this.date(d.clone().add(7, 'd')); 25031 } else { 25032 this.date(d.clone().subtract(this.stepping(), 'm')); 25033 } 25034 }, 25035 'control up': function (widget) { 25036 if (!widget) { 25037 return; 25038 } 25039 var d = this.date() || this.getMoment(); 25040 if (widget.find('.datepicker').is(':visible')) { 25041 this.date(d.clone().subtract(1, 'y')); 25042 } else { 25043 this.date(d.clone().add(1, 'h')); 25044 } 25045 }, 25046 'control down': function (widget) { 25047 if (!widget) { 25048 return; 25049 } 25050 var d = this.date() || this.getMoment(); 25051 if (widget.find('.datepicker').is(':visible')) { 25052 this.date(d.clone().add(1, 'y')); 25053 } else { 25054 this.date(d.clone().subtract(1, 'h')); 25055 } 25056 }, 25057 left: function (widget) { 25058 if (!widget) { 25059 return; 25060 } 25061 var d = this.date() || this.getMoment(); 25062 if (widget.find('.datepicker').is(':visible')) { 25063 this.date(d.clone().subtract(1, 'd')); 25064 } 25065 }, 25066 right: function (widget) { 25067 if (!widget) { 25068 return; 25069 } 25070 var d = this.date() || this.getMoment(); 25071 if (widget.find('.datepicker').is(':visible')) { 25072 this.date(d.clone().add(1, 'd')); 25073 } 25074 }, 25075 pageUp: function (widget) { 25076 if (!widget) { 25077 return; 25078 } 25079 var d = this.date() || this.getMoment(); 25080 if (widget.find('.datepicker').is(':visible')) { 25081 this.date(d.clone().subtract(1, 'M')); 25082 } 25083 }, 25084 pageDown: function (widget) { 25085 if (!widget) { 25086 return; 25087 } 25088 var d = this.date() || this.getMoment(); 25089 if (widget.find('.datepicker').is(':visible')) { 25090 this.date(d.clone().add(1, 'M')); 25091 } 25092 }, 25093 enter: function () { 25094 this.hide(); 25095 }, 25096 escape: function () { 25097 this.hide(); 25098 }, 25099 //tab: function (widget) { //this break the flow of the form. disabling for now 25100 // var toggle = widget.find('.picker-switch a[data-action="togglePicker"]'); 25101 // if(toggle.length > 0) toggle.click(); 25102 //}, 25103 'control space': function (widget) { 25104 if (!widget) { 25105 return; 25106 } 25107 if (widget.find('.timepicker').is(':visible')) { 25108 widget.find('.btn[data-action="togglePeriod"]').click(); 25109 } 25110 }, 25111 t: function () { 25112 this.date(this.getMoment()); 25113 }, 25114 'delete': function () { 25115 this.clear(); 25116 } 25117 }, 25118 debug: false, 25119 allowInputToggle: false, 25120 disabledTimeIntervals: false, 25121 disabledHours: false, 25122 enabledHours: false, 25123 viewDate: false 25124 }; 25125 25126 return $.fn.datetimepicker; 25127})); 25128/* 25129 * jQuery i18n plugin 25130 * @requires jQuery v1.1 or later 25131 * 25132 * Examples at: http://recurser.com/articles/2008/02/21/jquery-i18n-translation-plugin/ 25133 * Dual licensed under the MIT and GPL licenses: 25134 * http://www.opensource.org/licenses/mit-license.php 25135 * http://www.gnu.org/licenses/gpl.html 25136 *
25137 * Based on 'javascript i18n that almost doesn't suck' by markos 25138 * http://markos.gaivo.net/blog/?p=100 25139 * 25140 * Revision: $Id$ 25141 * Version: 1.0.0 Feb-10-2008 25142 */ 25143(function($) { 25144 /** 25145 * i18n provides a mechanism for translating strings using a jscript dictionary. 25146 * 25147 */ 25148 25149 25150 /* 25151 * i18n property list 25152 */ 25153 $.i18n = { 25154 25155 dict: null, 25156 25157 /** 25158 * setDictionary() 25159 * Initialise the dictionary and translate nodes 25160 * 25161 * @param property_list i18n_dict : The dictionary to use for translation 25162 */ 25163 setDictionary: function(i18n_dict) { 25164 this.dict = i18n_dict; 25165 }, 25166 25167 /** 25168 * _() 25169 * The actual translation function. Looks the given string up in the 25170 * dictionary and returns the translation if one exists. If a translation 25171 * is not found, returns the original word 25172 * 25173 * @param string str : The string to translate 25174 * @param property_list params : params for using printf() on the string 25175 * @return string : Translated word 25176 * 25177 */ 25178 _: function (str, params) { 25179 var transl = str; 25180 if (this.dict && this.dict[str]) { 25181 transl = this.dict[str]; 25182 } 25183 return this.printf(transl, params); 25184 }, 25185 25186 /** 25187 * toEntity() 25188 * Change non-ASCII characters to entity representation 25189 * 25190 * @param string str : The string to transform 25191 * @return string result : Original string with non-ASCII content converted to entities 25192 * 25193 */ 25194 toEntity: function (str) { 25195 var result = ''; 25196 for (var i=0;i<str.length; i++) { 25197 if (str.charCodeAt(i) > 128) 25198 result += "&#"+str.charCodeAt(i)+";"; 25199 else 25200 result += str.charAt(i); 25201 } 25202 return result; 25203 }, 25204 25205 /** 25206 * stripStr() 25207 * 25208 * @param string str : The string to strip 25209 * @return string result : Stripped string 25210 * 25211 */ 25212 stripStr: function(str) { 25213 return str.replace(/^\s*/, "").replace(/\s*$/, ""); 25214 }, 25215 25216 /** 25217 * stripStrML() 25218 * 25219 * @param string str : The multi-line string to strip 25220 * @return string result : Stripped string 25221 * 25222 */ 25223 stripStrML: function(str) { 25224 // Split because m flag doesn't exist before JS1.5 and we need to 25225 // strip newlines anyway 25226 var parts = str.split('\n'); 25227 for (var i=0; i<parts.length; i++) 25228 parts[i] = stripStr(parts[i]); 25229 25230 // Don't join with empty strings, because it "concats" words 25231 // And strip again 25232 return stripStr(parts.join(" ")); 25233 }, 25234 25235 /* 25236 * printf() 25237 * C-printf like function, which substitutes %s with parameters 25238 * given in list. %%s is used to escape %s. 25239 * 25240 * Doesn't work in IE5.0 (splice) 25241 * 25242 * @param string S : string to perform printf on. 25243 * @param string L : Array of arguments for printf() 25244 */ 25245 printf: function(S, L) { 25246 if (!L) return S; 25247 25248 var nS = ""; 25249 var tS = S.split("%s"); 25250 25251 for(var i=0; i<L.length; i++) { 25252 if (tS[i].lastIndexOf('%') == tS[i].length-1 && i != L.length-1) 25253 tS[i] += "s"+tS.splice(i+1,1)[0]; 25254 nS += tS[i] + L[i]; 25255 } 25256 return nS + tS[tS.length-1]; 25257 } 25258 25259 }; 25260 25261 25262})(jQuery); 25263var dictionary_cs = { 25264 "sLengthMenu": "Zobrazit _MENU_ záznamů na stránku", 25265 "sZeroRecords": "Nebyl nalezen žádný záznam", 25266 "sInfo": "Zobrazeno od _START_ do _END_ z celkového poÄtu _TOTAL_ záznamů", 25267 "sInfoEmpty": "Zobrazeno od 0 do 0 z celkového poÄtu 0 záznamů", 25268 "sInfoFiltered": "(filtrováno z _MAX_ záznamů)", 25269 "sSearch": "Hledat ve vÅ¡ech záznamech: ", 25270 "sNext": "DalÅ¡Ã", 25271 "sPrevious": "PÅedchozÃ", 25272 "today": "Dnes", 25273 "january": "Leden", 25274 "february": "Ãnor", 25275 "march": "BÅezen", 25276 "april": "Duben", 25277 "may": "KvÄten", 25278 "june": "Äerven", 25279 "july": "Äervenec", 25280 "august": "Srpen", 25281 "september": "ZáÅÃ", 25282 "october": "ÅÃjen", 25283 "november": "Listopad", 25284 "december": "Prosinec", 25285 "sun": "Ne", 25286 "mon": "Po", 25287 "tue": "Ãt", 25288 "wed": "St", 25289 "thu": "Ät", 25290 "fri": "Pá", 25291 "sat": "So", 25292 "must_select_checkbox": "Nebyl vybrán žádný záznam. MusÃte vybrat alespoÅ jeden záznam.", 25293 "payment_for": "Ãhrada faktury Ä. ", 25294 "vat": "DaÅ", 25295 "vat_claim": "DaÅ (nárok)" 25296}; 25297var dictionary_en = {
25298 "sLengthMenu": "Display _MENU_ records per page", 25299 "sZeroRecords": "Nothing found - sorry", 25300 "sInfo": "Showing _START_ to _END_ of _TOTAL_ records", 25301 "sInfoEmpty": "Showing 0 to 0 of 0 records", 25302 "sInfoFiltered": "(filtered from _MAX_ total records)", 25303 "sSearch": "Search in all items: ", 25304 "sNext": "Next", 25305 "sPrevious": "Previous", 25306 "today": "Today", 25307 "january": "January", 25308 "february": "February", 25309 "march": "March", 25310 "april": "April", 25311 "may": "May", 25312 "june": "June", 25313 "july": "July", 25314 "august": "August", 25315 "september": "September", 25316 "october": "October", 25317 "november": "November", 25318 "december": "December", 25319 "sun": "Su", 25320 "mon": "Mo", 25321 "tue": "Tu", 25322 "wed": "We", 25323 "thu": "Th", 25324 "fri": "Fr", 25325 "sat": "Sa", 25326 "must_select_checkbox": "Nebyl vybrán žádný záznam. MusÃte vybrat alespoÅ jeden záznam.", 25327 "payment_for": "Payment for invoice n. ", 25328 "vat": "DaÅ", 25329 "vat_claim": "DaÅ (nárok)" 25330}; 25331var dictionary_es = { 25332 "sLengthMenu": "Mostrar _MENU_ registro por página", 25333 "sZeroRecords": "No se ha encontrado nada - lo sentimos", 25334 "sInfo": "Mostrando desde _START_ hasta _END_ de _TOTAL_ registros", 25335 "sInfoEmpty": "Mostrado 0 de 0 de 0 rehistros", 25336 "sInfoFiltered": "(filtrado desde _MAX_ registros totales)", 25337 "sSearch": "Buscar en todos los items: ", 25338 "sNext": "Siguiente", 25339 "sPrevious": "Anterior", 25340 "today": "Hoy", 25341 "january": "Enero", 25342 "february": "Febrero", 25343 "march": "Marzo", 25344 "april": "Abril", 25345 "may": "Mayo", 25346 "june": "Junio", 25347 "july": "Julio", 25348 "august": "Agosto", 25349 "september": "Septiembre", 25350 "october": "Octubre", 25351 "november": "Noviembre", 25352 "december": "Diciembre", 25353 "sun": "Do", 25354 "mon": "Lu", 25355 "tue": "Ma", 25356 "wed": "Mi", 25357 "thu": "Ju", 25358 "fri": "Vi", 25359 "sat": "Sá", 25360 "must_select_checkbox": "Nebyl vybrán žádný záznam. MusÃte vybrat alespoÅ jeden záznam.", 25361 "payment_for": "El pago de la factura N º ", 25362 "vat": "DaÅ", 25363 "vat_claim": "DaÅ (nárok)" 25364}; 25365(function() { 25366 var attempts = 0; 25367 var maxAttempts = 100; 25368 var images_url = "/saved_images"; 25369 25370 var checkCKEditor = setInterval(function() { 25371 if (typeof CKEDITOR !== 'undefined') { 25372 clearInterval(checkCKEditor); 25373 25374 CKEDITOR.config.versionCheck = false; 25375 CKEDITOR.config.filebrowserBrowseUrl = "/ckeditor/attachment_files"; 25376 25377 // The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog. 25378 CKEDITOR.config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files"; 25379 25380 // The location of a script that handles file uploads in the Flash dialog. 25381 CKEDITOR.config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files"; 25382 25383 // The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog. 25384 CKEDITOR.config.filebrowserImageBrowseLinkUrl = images_url; 25385 25386 // The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog. 25387 CKEDITOR.config.filebrowserImageBrowseUrl = images_url; 25388 25389 // The location of a script that handles file uploads in the Image dialog. 25390 CKEDITOR.config.filebrowserImageUploadUrl = images_url; 25391 25392 CKEDITOR.config.versionCheck = false; 25393 // The location of a script that handles file uploads. 25394 CKEDITOR.config.filebrowserUploadUrl = "/ckeditor/attachment_files"; 25395 25396 CKEDITOR.config.toolbar = "Basic"; 25397 CKEDITOR.config.extraPlugins = "pastefromword"; 25398 //config.height = "300px"; 25399 CKEDITOR.config.startupFocus = false; 25400 CKEDITOR.config.disableNativeSpellChecker = false; 25401 CKEDITOR.config.toolbar_Basic = [ 25402 [ 25403 "Styles", 25404 "Format", 25405 "FontSize", 25406 "-", 25407 "Bold", 25408 "Italic", 25409 "Underline", 25410 "Strike", 25411 "-", 25412 "TextColor", 25413 "BGColor", 25414 "-", 25415 "NumberedList", 25416 "BulletedList", 25417 "-", 25418 "Link", 25419 "Unlink", 25420 "-", 25421 "PasteFromWord", 25422 "PasteText", 25423 "-", 25424 "Undo", 25425 "Redo", 25426 "Image", 25427 "-", 25428 "JustifyLeft", 25429 "JustifyCenter", 25430 "JustifyRight", 25431 "JustifyBlock", 25432 "-", 25433 "Outdent", 25434 "Indent", 25435 "-", 25436 "Table", 25437 "Maximize", 25438 ], 25439 ]; 25440 CKEDITOR.config.toolbar_Simple = [ 25441 [ 25442 "Bold", 25443 "Italic", 25444 "Underline", 25445 "-", 25446 "NumberedList", 25447 "BulletedList", 25448 "-", 25449 "Link", 25450 "Unlink", 25451 "-", 25452 "PasteFromWord", 25453 "PasteText", 25454 "-", 25455 "Undo", 25456 "Redo", 25457 "Image", 25458 "-", 25459 "JustifyLeft", 25460 "JustifyCenter", 25461 "JustifyRight", 25462 "JustifyBlock", 25463 "-", 25464 "Outdent", 25465 "Indent", 25466 "-", 25467 "Maximize", 25468 ], 25469 ]; 25470 CKEDITOR.config.toolbar_Mini = [ 25471 [ 25472 "Bold", 25473 "Italic", 25474 "Underline", 25475 "-", 25476 "NumberedList", 25477 "BulletedList", 25478 "-", 25479 "Link", 25480 "Unlink", 25481 "-", 25482 "PasteFromWord", 25483 "PasteText", 25484 "-", 25485 "Undo", 25486 "Redo", 25487 "-", 25488 "JustifyLeft", 25489 "JustifyCenter", 25490 "JustifyRight", 25491 "JustifyBlock", 25492 "-", 25493 "Outdent", 25494 "Indent", 25495 "-", 25496 "Maximize", 25497 ], 25498 ]; 25499 CKEDITOR.config.entities = false;
25500 CKEDITOR.config.htmlEncodeOutput = false; 25501 } else if (++attempts >= maxAttempts) { 25502 clearInterval(checkCKEditor); 25503 } 25504 }, 50); 25505})(); 25506(function($) { 25507 window.NestedFormEvents = function() { 25508 this.addFields = $.proxy(this.addFields, this); 25509 this.removeFields = $.proxy(this.removeFields, this); 25510 }; 25511 25512 NestedFormEvents.prototype = { 25513 addFields: function(e) { 25514 // Setup 25515 var link = e.currentTarget; 25516 var assoc = $(link).data('association'); // Name of child 25517 var blueprint = $('#' + $(link).data('blueprint-id')); 25518 var content = blueprint.data('blueprint'); // Fields template 25519 25520 // Make the context correct by replacing <parents> with the generated ID 25521 // of each of the parent objects 25522 var context = ($(link).closest('.fields').closestChild('input, textarea, select').eq(0).attr('name') || '').replace(/\[[a-z_]+\]$/, ''); 25523 25524 // If the parent has no inputs we need to strip off the last pair 25525 var current = content.match(new RegExp('\\[([a-z_]+)\\]\\[new_' + assoc + '\\]')); 25526 if (current) { 25527 context = context.replace(new RegExp('\\[' + current[1] + '\\]\\[(new_)?\\d+\\]$'), ''); 25528 } 25529 25530 // context will be something like this for a brand new form: 25531 // project[tasks_attributes][1255929127459][assignments_attributes][1255929128105] 25532 // or for an edit form: 25533 // project[tasks_attributes][0][assignments_attributes][1] 25534 if (context) { 25535 var parentNames = context.match(/[a-z_]+_attributes(?=\]\[(new_)?\d+\])/g) || []; 25536 var parentIds = context.match(/[0-9]+/g) || []; 25537 25538 for(var i = 0; i < parentNames.length; i++) { 25539 if(parentIds[i]) { 25540 content = content.replace( 25541 new RegExp('(_' + parentNames[i] + ')_.+?_', 'g'), 25542 '$1_' + parentIds[i] + '_'); 25543 25544 content = content.replace( 25545 new RegExp('(\\[' + parentNames[i] + '\\])\\[.+?\\]', 'g'), 25546 '$1[' + parentIds[i] + ']'); 25547 } 25548 } 25549 } 25550 25551 // Make a unique ID for the new child 25552 var regexp = new RegExp('new_' + assoc, 'g'); 25553 var new_id = this.newId(); 25554 content = $.trim(content.replace(regexp, new_id)); 25555 25556 var field = this.insertFields(content, assoc, link); 25557 // bubble up event upto document (through form) 25558 field 25559 .trigger({ type: 'nested:fieldAdded', field: field }) 25560 .trigger({ type: 'nested:fieldAdded:' + assoc, field: field }); 25561 return false; 25562 }, 25563 newId: function() { 25564 return new Date().getTime(); 25565 }, 25566 insertFields: function(content, assoc, link) { 25567 var target = $(link).data('target'); 25568 if (target) { 25569 return $(content).appendTo($(target)); 25570 } else { 25571 return $(content).insertBefore(link); 25572 } 25573 }, 25574 removeFields: function(e) { 25575 var $link = $(e.currentTarget), 25576 assoc = $link.data('association'); // Name of child to be removed 25577 25578 var hiddenField = $link.prev('input[type=hidden]'); 25579 hiddenField.val('1'); 25580 25581 var field = $link.closest('.fields'); 25582 field.hide(); 25583 25584 field 25585 .trigger({ type: 'nested:fieldRemoved', field: field }) 25586 .trigger({ type: 'nested:fieldRemoved:' + assoc, field: field }); 25587 return false; 25588 } 25589 }; 25590 25591 window.nestedFormEvents = new NestedFormEvents(); 25592 $(document) 25593 .delegate('form a.add_nested_fields', 'click', nestedFormEvents.addFields) 25594 .delegate('form a.remove_nested_fields', 'click', nestedFormEvents.removeFields); 25595})(jQuery); 25596 25597// http://plugins.jquery.com/project/closestChild 25598/* 25599 * Copyright 2011, Tobias Lindig 25600 * 25601 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 25602 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 25603 * 25604 */ 25605(function($) { 25606 $.fn.closestChild = function(selector) { 25607 // breadth first search for the first matched node 25608 if (selector && selector != '') { 25609 var queue = []; 25610 queue.push(this); 25611 while(queue.length > 0) { 25612 var node = queue.shift(); 25613 var children = node.children(); 25614 for(var i = 0; i < children.length; ++i) { 25615 var child = $(children[i]); 25616 if (child.is(selector)) { 25617 return child; //well, we found one 25618 } 25619 queue.push(child); 25620 } 25621 } 25622 } 25623 return $();//nothing found 25624 }; 25625})(jQuery); 25626/*! 25627 * FullCalendar v3.9.0 25628 * Docs & License: https://fullcalendar.io/ 25629 * (c) 2018 Adam Shaw 25630 */ 25631(function webpackUniversalModuleDefinition(root, factory) { 25632 if(typeof exports === 'object' && typeof module === 'object') 25633 module.exports = factory(require("moment"), require("jquery")); 25634 else if(typeof define === 'function' && define.amd) 25635 define(["moment", "jquery"], factory); 25636 else if(typeof exports === 'object') 25637 exports["FullCalendar"] = factory(require("moment"), require("jquery")); 25638 else 25639 root["FullCalendar"] = factory(root["moment"], root["jQuery"]); 25640})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_3__) { 25641return /******/ (function(modules) { // webpackBootstrap 25642/******/ // The module cache 25643/******/ var installedModules = {}; 25644/******/ 25645/******/ // The require function 25646/******/ function __webpack_require__(moduleId) { 25647/******/ 25648/******/ // Check if module is in cache 25649/******/ if(installedModules[moduleId]) { 25650/******/ return installedModules[moduleId].exports; 25651/******/ } 25652/******/ // Create a new module (and put it into the cache) 25653/******/ var module = installedModules[moduleId] = { 25654/******/ i: moduleId, 25655/******/ l: false, 25656/******/ exports: {} 25657/******/ }; 25658/******/ 25659/******/ // Execute the module function 25660/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 25661/******/ 25662/******/ // Flag the module as loaded
25663/******/ module.l = true; 25664/******/ 25665/******/ // Return the exports of the module 25666/******/ return module.exports; 25667/******/ } 25668/******/ 25669/******/ 25670/******/ // expose the modules object (__webpack_modules__) 25671/******/ __webpack_require__.m = modules; 25672/******/ 25673/******/ // expose the module cache 25674/******/ __webpack_require__.c = installedModules; 25675/******/ 25676/******/ // define getter function for harmony exports 25677/******/ __webpack_require__.d = function(exports, name, getter) { 25678/******/ if(!__webpack_require__.o(exports, name)) { 25679/******/ Object.defineProperty(exports, name, { 25680/******/ configurable: false, 25681/******/ enumerable: true, 25682/******/ get: getter 25683/******/ }); 25684/******/ } 25685/******/ }; 25686/******/ 25687/******/ // getDefaultExport function for compatibility with non-harmony modules 25688/******/ __webpack_require__.n = function(module) { 25689/******/ var getter = module && module.__esModule ? 25690/******/ function getDefault() { return module['default']; } : 25691/******/ function getModuleExports() { return module; }; 25692/******/ __webpack_require__.d(getter, 'a', getter); 25693/******/ return getter; 25694/******/ }; 25695/******/ 25696/******/ // Object.prototype.hasOwnProperty.call 25697/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 25698/******/ 25699/******/ // __webpack_public_path__ 25700/******/ __webpack_require__.p = ""; 25701/******/ 25702/******/ // Load entry module and return exports 25703/******/ return __webpack_require__(__webpack_require__.s = 236); 25704/******/ }) 25705/************************************************************************/ 25706/******/ ([ 25707/* 0 */ 25708/***/ (function(module, exports) { 25709 25710module.exports = __WEBPACK_EXTERNAL_MODULE_0__; 25711 25712/***/ }), 25713/* 1 */, 25714/* 2 */ 25715/***/ (function(module, exports) { 25716 25717/* 25718derived from: 25719https://github.com/Microsoft/tslib/blob/v1.6.0/tslib.js 25720 25721only include the helpers we need, to keep down filesize 25722*/ 25723var extendStatics = Object.setPrototypeOf || 25724 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 25725 function (d, b) { for (var p in b) 25726 if (b.hasOwnProperty(p)) 25727 d[p] = b[p]; }; 25728exports.__extends = function (d, b) { 25729 extendStatics(d, b); 25730 function __() { this.constructor = d; } 25731 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 25732}; 25733 25734 25735/***/ }), 25736/* 3 */ 25737/***/ (function(module, exports) { 25738 25739module.exports = __WEBPACK_EXTERNAL_MODULE_3__; 25740 25741/***/ }), 25742/* 4 */ 25743/***/ (function(module, exports, __webpack_require__) { 25744 25745Object.defineProperty(exports, "__esModule", { value: true }); 25746var moment = __webpack_require__(0); 25747var $ = __webpack_require__(3); 25748/* FullCalendar-specific DOM Utilities 25749----------------------------------------------------------------------------------------------------------------------*/ 25750// Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left 25751// and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that. 25752function compensateScroll(rowEls, scrollbarWidths) { 25753 if (scrollbarWidths.left) { 25754 rowEls.css({ 25755 'border-left-width': 1, 25756 'margin-left': scrollbarWidths.left - 1 25757 }); 25758 } 25759 if (scrollbarWidths.right) { 25760 rowEls.css({ 25761 'border-right-width': 1, 25762 'margin-right': scrollbarWidths.right - 1 25763 }); 25764 } 25765} 25766exports.compensateScroll = compensateScroll; 25767// Undoes compensateScroll and restores all borders/margins 25768function uncompensateScroll(rowEls) { 25769 rowEls.css({ 25770 'margin-left': '', 25771 'margin-right': '', 25772 'border-left-width': '', 25773 'border-right-width': '' 25774 }); 25775} 25776exports.uncompensateScroll = uncompensateScroll; 25777// Make the mouse cursor express that an event is not allowed in the current area 25778function disableCursor() { 25779 $('body').addClass('fc-not-allowed'); 25780} 25781exports.disableCursor = disableCursor; 25782// Returns the mouse cursor to its original look 25783function enableCursor() { 25784 $('body').removeClass('fc-not-allowed'); 25785} 25786exports.enableCursor = enableCursor; 25787// Given a total available height to fill, have `els` (essentially child rows) expand to accomodate. 25788// By default, all elements that are shorter than the recommended height are expanded uniformly, not considering 25789// any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and 25790// reduces the available height. 25791function distributeHeight(els, availableHeight, shouldRedistribute) { 25792 // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions, 25793 // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars. 25794 var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element 25795 var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE* 25796 var flexEls = []; // elements that are allowed to expand. array of DOM nodes 25797 var flexOffsets = []; // amount of vertical space it takes up 25798 var flexHeights = []; // actual css height 25799 var usedHeight = 0; 25800 undistributeHeight(els); // give all elements their natural height 25801 // find elements that are below the recommended height (expandable). 25802 // important to query for heights in a single first pass (to avoid reflow oscillation). 25803 els.each(function (i, el) { 25804 var minOffset = i === els.length - 1 ? minOffset2 : minOffset1; 25805 var naturalOffset = $(el).outerHeight(true); 25806 if (naturalOffset < minOffset) { 25807 flexEls.push(el); 25808 flexOffsets.push(naturalOffset); 25809 flexHeights.push($(el).height()); 25810 } 25811 else { 25812 // this element stretches past recommended height (non-expandable). mark the space as occupied. 25813 usedHeight += naturalOffset; 25814 } 25815 }); 25816 // readjust the recommended height to only consider the height available to non-maxed-out rows. 25817 if (shouldRedistribute) { 25818 availableHeight -= usedHeight; 25819 minOffset1 = Math.floor(availableHeight / flexEls.length); 25820 minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE* 25821 } 25822 // assign heights to all expandable elements 25823 $(flexEls).each(function (i, el) { 25824 var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1; 25825 var naturalOffset = flexOffsets[i]; 25826 var naturalHeight = flexHeights[i]; 25827 var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding 25828 if (naturalOffset < minOffset) { 25829 $(el).height(newHeight); 25830 } 25831 }); 25832} 25833exports.distributeHeight = distributeHeight; 25834// Undoes distrubuteHeight, restoring all els to their natural height 25835function undistributeHeight(els) { 25836 els.height(''); 25837} 25838exports.undistributeHeight = undistributeHeight; 25839// Given `els`, a jQuery set of <td> cells, find the cell with the largest natural width and set the widths of all the 25840// cells to be that width. 25841// PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline 25842function matchCellWidths(els) { 25843 var maxInnerWidth = 0; 25844 els.find('> *').each(function (i, innerEl) { 25845 var innerWidth = $(innerEl).outerWidth(); 25846 if (innerWidth > maxInnerWidth) { 25847 maxInnerWidth = innerWidth; 25848 } 25849 }); 25850 maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance 25851 els.width(maxInnerWidth);
25852 return maxInnerWidth; 25853} 25854exports.matchCellWidths = matchCellWidths; 25855// Given one element that resides inside another, 25856// Subtracts the height of the inner element from the outer element. 25857function subtractInnerElHeight(outerEl, innerEl) { 25858 var both = outerEl.add(innerEl); 25859 var diff; 25860 // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked 25861 both.css({ 25862 position: 'relative', 25863 left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll 25864 }); 25865 diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions 25866 both.css({ position: '', left: '' }); // undo hack 25867 return diff; 25868} 25869exports.subtractInnerElHeight = subtractInnerElHeight; 25870/* Element Geom Utilities 25871----------------------------------------------------------------------------------------------------------------------*/ 25872// borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51 25873function getScrollParent(el) { 25874 var position = el.css('position'); 25875 var scrollParent = el.parents().filter(function () { 25876 var parent = $(this); 25877 return (/(auto|scroll)/).test(parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x')); 25878 }).eq(0); 25879 return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent; 25880} 25881exports.getScrollParent = getScrollParent; 25882// Queries the outer bounding area of a jQuery element. 25883// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). 25884// Origin is optional. 25885function getOuterRect(el, origin) { 25886 var offset = el.offset(); 25887 var left = offset.left - (origin ? origin.left : 0); 25888 var top = offset.top - (origin ? origin.top : 0); 25889 return { 25890 left: left, 25891 right: left + el.outerWidth(), 25892 top: top, 25893 bottom: top + el.outerHeight() 25894 }; 25895} 25896exports.getOuterRect = getOuterRect; 25897// Queries the area within the margin/border/scrollbars of a jQuery element. Does not go within the padding. 25898// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). 25899// Origin is optional. 25900// WARNING: given element can't have borders 25901// NOTE: should use clientLeft/clientTop, but very unreliable cross-browser. 25902function getClientRect(el, origin) { 25903 var offset = el.offset(); 25904 var scrollbarWidths = getScrollbarWidths(el); 25905 var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0); 25906 var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0); 25907 return { 25908 left: left, 25909 right: left + el[0].clientWidth, 25910 top: top, 25911 bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars 25912 }; 25913} 25914exports.getClientRect = getClientRect; 25915// Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars. 25916// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). 25917// Origin is optional. 25918function getContentRect(el, origin) { 25919 var offset = el.offset(); // just outside of border, margin not included 25920 var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') - 25921 (origin ? origin.left : 0); 25922 var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') - 25923 (origin ? origin.top : 0); 25924 return { 25925 left: left, 25926 right: left + el.width(), 25927 top: top, 25928 bottom: top + el.height() 25929 }; 25930} 25931exports.getContentRect = getContentRect; 25932// Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element. 25933// WARNING: given element can't have borders (which will cause offsetWidth/offsetHeight to be larger). 25934// NOTE: should use clientLeft/clientTop, but very unreliable cross-browser. 25935function getScrollbarWidths(el) { 25936 var leftRightWidth = el[0].offsetWidth - el[0].clientWidth; 25937 var bottomWidth = el[0].offsetHeight - el[0].clientHeight; 25938 var widths; 25939 leftRightWidth = sanitizeScrollbarWidth(leftRightWidth); 25940 bottomWidth = sanitizeScrollbarWidth(bottomWidth); 25941 widths = { left: 0, right: 0, top: 0, bottom: bottomWidth }; 25942 if (getIsLeftRtlScrollbars() && el.css('direction') === 'rtl') { 25943 widths.left = leftRightWidth; 25944 } 25945 else { 25946 widths.right = leftRightWidth; 25947 } 25948 return widths; 25949}
25950exports.getScrollbarWidths = getScrollbarWidths; 25951// The scrollbar width computations in getScrollbarWidths are sometimes flawed when it comes to 25952// retina displays, rounding, and IE11. Massage them into a usable value. 25953function sanitizeScrollbarWidth(width) { 25954 width = Math.max(0, width); // no negatives 25955 width = Math.round(width); 25956 return width; 25957} 25958// Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side 25959var _isLeftRtlScrollbars = null; 25960function getIsLeftRtlScrollbars() { 25961 if (_isLeftRtlScrollbars === null) { 25962 _isLeftRtlScrollbars = computeIsLeftRtlScrollbars(); 25963 } 25964 return _isLeftRtlScrollbars; 25965} 25966function computeIsLeftRtlScrollbars() { 25967 var el = $('<div><div/></div>') 25968 .css({ 25969 position: 'absolute', 25970 top: -1000, 25971 left: 0, 25972 border: 0, 25973 padding: 0, 25974 overflow: 'scroll', 25975 direction: 'rtl' 25976 }) 25977 .appendTo('body'); 25978 var innerEl = el.children(); 25979 var res = innerEl.offset().left > el.offset().left; // is the inner div shifted to accommodate a left scrollbar? 25980 el.remove(); 25981 return res; 25982} 25983// Retrieves a jQuery element's computed CSS value as a floating-point number. 25984// If the queried value is non-numeric (ex: IE can return "medium" for border width), will just return zero. 25985function getCssFloat(el, prop) { 25986 return parseFloat(el.css(prop)) || 0; 25987} 25988/* Mouse / Touch Utilities 25989----------------------------------------------------------------------------------------------------------------------*/ 25990// Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac) 25991function isPrimaryMouseButton(ev) { 25992 return ev.which === 1 && !ev.ctrlKey; 25993} 25994exports.isPrimaryMouseButton = isPrimaryMouseButton; 25995function getEvX(ev) { 25996 var touches = ev.originalEvent.touches; 25997 // on mobile FF, pageX for touch events is present, but incorrect, 25998 // so, look at touch coordinates first. 25999 if (touches && touches.length) { 26000 return touches[0].pageX; 26001 } 26002 return ev.pageX; 26003} 26004exports.getEvX = getEvX; 26005function getEvY(ev) { 26006 var touches = ev.originalEvent.touches; 26007 // on mobile FF, pageX for touch events is present, but incorrect, 26008 // so, look at touch coordinates first. 26009 if (touches && touches.length) { 26010 return touches[0].pageY; 26011 } 26012 return ev.pageY; 26013} 26014exports.getEvY = getEvY; 26015function getEvIsTouch(ev) { 26016 return /^touch/.test(ev.type); 26017} 26018exports.getEvIsTouch = getEvIsTouch; 26019function preventSelection(el) { 26020 el.addClass('fc-unselectable') 26021 .on('selectstart', preventDefault); 26022} 26023exports.preventSelection = preventSelection; 26024function allowSelection(el) { 26025 el.removeClass('fc-unselectable') 26026 .off('selectstart', preventDefault); 26027} 26028exports.allowSelection = allowSelection; 26029// Stops a mouse/touch event from doing it's native browser action 26030function preventDefault(ev) { 26031 ev.preventDefault(); 26032} 26033exports.preventDefault = preventDefault; 26034/* General Geometry Utils 26035----------------------------------------------------------------------------------------------------------------------*/ 26036// Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false 26037function intersectRects(rect1, rect2) { 26038 var res = { 26039 left: Math.max(rect1.left, rect2.left), 26040 right: Math.min(rect1.right, rect2.right), 26041 top: Math.max(rect1.top, rect2.top), 26042 bottom: Math.min(rect1.bottom, rect2.bottom) 26043 }; 26044 if (res.left < res.right && res.top < res.bottom) { 26045 return res; 26046 } 26047 return false; 26048} 26049exports.intersectRects = intersectRects; 26050// Returns a new point that will have been moved to reside within the given rectangle 26051function constrainPoint(point, rect) { 26052 return { 26053 left: Math.min(Math.max(point.left, rect.left), rect.right), 26054 top: Math.min(Math.max(point.top, rect.top), rect.bottom) 26055 }; 26056} 26057exports.constrainPoint = constrainPoint; 26058// Returns a point that is the center of the given rectangle 26059function getRectCenter(rect) { 26060 return { 26061 left: (rect.left + rect.right) / 2, 26062 top: (rect.top + rect.bottom) / 2 26063 }; 26064} 26065exports.getRectCenter = getRectCenter; 26066// Subtracts point2's coordinates from point1's coordinates, returning a delta 26067function diffPoints(point1, point2) { 26068 return { 26069 left: point1.left - point2.left, 26070 top: point1.top - point2.top 26071 }; 26072} 26073exports.diffPoints = diffPoints; 26074/* Object Ordering by Field 26075----------------------------------------------------------------------------------------------------------------------*/ 26076function parseFieldSpecs(input) { 26077 var specs = []; 26078 var tokens = []; 26079 var i; 26080 var token; 26081 if (typeof input === 'string') { 26082 tokens = input.split(/\s*,\s*/); 26083 } 26084 else if (typeof input === 'function') { 26085 tokens = [input]; 26086 } 26087 else if ($.isArray(input)) { 26088 tokens = input; 26089 } 26090 for (i = 0; i < tokens.length; i++) { 26091 token = tokens[i]; 26092 if (typeof token === 'string') { 26093 specs.push(token.charAt(0) === '-' ? 26094 { field: token.substring(1), order: -1 } : 26095 { field: token, order: 1 }); 26096 } 26097 else if (typeof token === 'function') { 26098 specs.push({ func: token }); 26099 } 26100 } 26101 return specs; 26102} 26103exports.parseFieldSpecs = parseFieldSpecs; 26104function compareByFieldSpecs(obj1, obj2, fieldSpecs, obj1fallback, obj2fallback) { 26105 var i; 26106 var cmp; 26107 for (i = 0; i < fieldSpecs.length; i++) { 26108 cmp = compareByFieldSpec(obj1, obj2, fieldSpecs[i], obj1fallback, obj2fallback); 26109 if (cmp) { 26110 return cmp; 26111 } 26112 } 26113 return 0; 26114} 26115exports.compareByFieldSpecs = compareByFieldSpecs; 26116function compareByFieldSpec(obj1, obj2, fieldSpec, obj1fallback, obj2fallback) { 26117 if (fieldSpec.func) { 26118 return fieldSpec.func(obj1, obj2); 26119 } 26120 var val1 = obj1[fieldSpec.field]; 26121 var val2 = obj2[fieldSpec.field]; 26122 if (val1 == null && obj1fallback) { 26123 val1 = obj1fallback[fieldSpec.field]; 26124 } 26125 if (val2 == null && obj2fallback) { 26126 val2 = obj2fallback[fieldSpec.field]; 26127 } 26128 return flexibleCompare(val1, val2) * (fieldSpec.order || 1); 26129} 26130exports.compareByFieldSpec = compareByFieldSpec; 26131function flexibleCompare(a, b) { 26132 if (!a && !b) { 26133 return 0; 26134 } 26135 if (b == null) { 26136 return -1; 26137 } 26138 if (a == null) { 26139 return 1; 26140 } 26141 if ($.type(a) === 'string' || $.type(b) === 'string') { 26142 return String(a).localeCompare(String(b)); 26143 } 26144 return a - b; 26145} 26146exports.flexibleCompare = flexibleCompare; 26147/* Date Utilities 26148----------------------------------------------------------------------------------------------------------------------*/ 26149exports.dayIDs = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; 26150exports.unitsDesc = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
26150 // descending 26151// Diffs the two moments into a Duration where full-days are recorded first, then the remaining time. 26152// Moments will have their timezones normalized. 26153function diffDayTime(a, b) { 26154 return moment.duration({ 26155 days: a.clone().stripTime().diff(b.clone().stripTime(), 'days'), 26156 ms: a.time() - b.time() // time-of-day from day start. disregards timezone 26157 }); 26158} 26159exports.diffDayTime = diffDayTime; 26160// Diffs the two moments via their start-of-day (regardless of timezone). Produces whole-day durations. 26161function diffDay(a, b) { 26162 return moment.duration({ 26163 days: a.clone().stripTime().diff(b.clone().stripTime(), 'days') 26164 }); 26165} 26166exports.diffDay = diffDay; 26167// Diffs two moments, producing a duration, made of a whole-unit-increment of the given unit. Uses rounding. 26168function diffByUnit(a, b, unit) { 26169 return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true 26170 unit); 26171} 26172exports.diffByUnit = diffByUnit; 26173// Computes the unit name of the largest whole-unit period of time. 26174// For example, 48 hours will be "days" whereas 49 hours will be "hours". 26175// Accepts start/end, a range object, or an original duration object. 26176function computeGreatestUnit(start, end) { 26177 var i; 26178 var unit; 26179 var val; 26180 for (i = 0; i < exports.unitsDesc.length; i++) { 26181 unit = exports.unitsDesc[i]; 26182 val = computeRangeAs(unit, start, end); 26183 if (val >= 1 && isInt(val)) { 26184 break; 26185 } 26186 } 26187 return unit; // will be "milliseconds" if nothing else matches 26188} 26189exports.computeGreatestUnit = computeGreatestUnit; 26190// like computeGreatestUnit, but has special abilities to interpret the source input for clues 26191function computeDurationGreatestUnit(duration, durationInput) { 26192 var unit = computeGreatestUnit(duration); 26193 // prevent days:7 from being interpreted as a week 26194 if (unit === 'week' && typeof durationInput === 'object' && durationInput.days) { 26195 unit = 'day'; 26196 } 26197 return unit; 26198} 26199exports.computeDurationGreatestUnit = computeDurationGreatestUnit; 26200// Computes the number of units (like "hours") in the given range. 26201// Range can be a {start,end} object, separate start/end args, or a Duration. 26202// Results are based on Moment's .as() and .diff() methods, so results can depend on internal handling 26203// of month-diffing logic (which tends to vary from version to version). 26204function computeRangeAs(unit, start, end) { 26205 if (end != null) { 26206 return end.diff(start, unit, true); 26207 } 26208 else if (moment.isDuration(start)) { 26209 return start.as(unit); 26210 } 26211 else { 26212 return start.end.diff(start.start, unit, true); 26213 } 26214} 26215// Intelligently divides a range (specified by a start/end params) by a duration 26216function divideRangeByDuration(start, end, dur) { 26217 var months; 26218 if (durationHasTime(dur)) { 26219 return (end - start) / dur; 26220 } 26221 months = dur.asMonths(); 26222 if (Math.abs(months) >= 1 && isInt(months)) { 26223 return end.diff(start, 'months', true) / months; 26224 } 26225 return end.diff(start, 'days', true) / dur.asDays(); 26226} 26227exports.divideRangeByDuration = divideRangeByDuration; 26228// Intelligently divides one duration by another 26229function divideDurationByDuration(dur1, dur2) { 26230 var months1; 26231 var months2; 26232 if (durationHasTime(dur1) || durationHasTime(dur2)) { 26233 return dur1 / dur2; 26234 } 26235 months1 = dur1.asMonths(); 26236 months2 = dur2.asMonths(); 26237 if (Math.abs(months1) >= 1 && isInt(months1) && 26238 Math.abs(months2) >= 1 && isInt(months2)) { 26239 return months1 / months2; 26240 } 26241 return dur1.asDays() / dur2.asDays(); 26242} 26243exports.divideDurationByDuration = divideDurationByDuration; 26244// Intelligently multiplies a duration by a number 26245function multiplyDuration(dur, n) { 26246 var months; 26247 if (durationHasTime(dur)) { 26248 return moment.duration(dur * n); 26249 } 26250 months = dur.asMonths(); 26251 if (Math.abs(months) >= 1 && isInt(months)) { 26252 return moment.duration({ months: months * n }); 26253 } 26254 return moment.duration({ days: dur.asDays() * n }); 26255} 26256exports.multiplyDuration = multiplyDuration; 26257// Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms) 26258function durationHasTime(dur) { 26259 return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds()); 26260} 26261exports.durationHasTime = durationHasTime; 26262function isNativeDate(input) { 26263 return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date; 26264} 26265exports.isNativeDate = isNativeDate; 26266// Returns a boolean about whether the given input is a time string, like "06:40:00" or "06:00"
26267function isTimeString(str) { 26268 return typeof str === 'string' && 26269 /^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(str); 26270} 26271exports.isTimeString = isTimeString; 26272/* Logging and Debug 26273----------------------------------------------------------------------------------------------------------------------*/ 26274function log() { 26275 var args = []; 26276 for (var _i = 0; _i < arguments.length; _i++) { 26277 args[_i] = arguments[_i]; 26278 } 26279 var console = window.console; 26280 if (console && console.log) { 26281 return console.log.apply(console, args); 26282 } 26283} 26284exports.log = log; 26285function warn() { 26286 var args = []; 26287 for (var _i = 0; _i < arguments.length; _i++) { 26288 args[_i] = arguments[_i]; 26289 } 26290 var console = window.console; 26291 if (console && console.warn) { 26292 return console.warn.apply(console, args); 26293 } 26294 else { 26295 return log.apply(null, args); 26296 } 26297} 26298exports.warn = warn; 26299/* General Utilities 26300----------------------------------------------------------------------------------------------------------------------*/ 26301var hasOwnPropMethod = {}.hasOwnProperty; 26302// Merges an array of objects into a single object. 26303// The second argument allows for an array of property names who's object values will be merged together. 26304function mergeProps(propObjs, complexProps) { 26305 var dest = {}; 26306 var i; 26307 var name; 26308 var complexObjs; 26309 var j; 26310 var val; 26311 var props; 26312 if (complexProps) { 26313 for (i = 0; i < complexProps.length; i++) { 26314 name = complexProps[i]; 26315 complexObjs = []; 26316 // collect the trailing object values, stopping when a non-object is discovered 26317 for (j = propObjs.length - 1; j >= 0; j--) { 26318 val = propObjs[j][name]; 26319 if (typeof val === 'object') { 26320 complexObjs.unshift(val); 26321 } 26322 else if (val !== undefined) { 26323 dest[name] = val; // if there were no objects, this value will be used 26324 break; 26325 } 26326 } 26327 // if the trailing values were objects, use the merged value 26328 if (complexObjs.length) { 26329 dest[name] = mergeProps(complexObjs); 26330 } 26331 } 26332 } 26333 // copy values into the destination, going from last to first 26334 for (i = propObjs.length - 1; i >= 0; i--) { 26335 props = propObjs[i]; 26336 for (name in props) { 26337 if (!(name in dest)) { 26338 dest[name] = props[name]; 26339 } 26340 } 26341 } 26342 return dest; 26343} 26344exports.mergeProps = mergeProps; 26345function copyOwnProps(src, dest) { 26346 for (var name_1 in src) { 26347 if (hasOwnProp(src, name_1)) { 26348 dest[name_1] = src[name_1]; 26349 } 26350 } 26351} 26352exports.copyOwnProps = copyOwnProps; 26353function hasOwnProp(obj, name) { 26354 return hasOwnPropMethod.call(obj, name); 26355} 26356exports.hasOwnProp = hasOwnProp; 26357function applyAll(functions, thisObj, args) { 26358 if ($.isFunction(functions)) { 26359 functions = [functions]; 26360 } 26361 if (functions) { 26362 var i = void 0; 26363 var ret = void 0; 26364 for (i = 0; i < functions.length; i++) { 26365 ret = functions[i].apply(thisObj, args) || ret; 26366 } 26367 return ret; 26368 } 26369} 26370exports.applyAll = applyAll; 26371function removeMatching(array, testFunc) { 26372 var removeCnt = 0; 26373 var i = 0; 26374 while (i < array.length) { 26375 if (testFunc(array[i])) { 26376 array.splice(i, 1); 26377 removeCnt++; 26378 } 26379 else { 26380 i++; 26381 } 26382 } 26383 return removeCnt; 26384} 26385exports.removeMatching = removeMatching; 26386function removeExact(array, exactVal) { 26387 var removeCnt = 0; 26388 var i = 0; 26389 while (i < array.length) { 26390 if (array[i] === exactVal) { 26391 array.splice(i, 1); 26392 removeCnt++; 26393 } 26394 else { 26395 i++; 26396 } 26397 } 26398 return removeCnt; 26399} 26400exports.removeExact = removeExact; 26401function isArraysEqual(a0, a1) { 26402 var len = a0.length; 26403 var i; 26404 if (len == null || len !== a1.length) { 26405 return false; 26406 } 26407 for (i = 0; i < len; i++) { 26408 if (a0[i] !== a1[i]) { 26409 return false;
26410 } 26411 } 26412 return true; 26413} 26414exports.isArraysEqual = isArraysEqual; 26415function firstDefined() { 26416 var args = []; 26417 for (var _i = 0; _i < arguments.length; _i++) { 26418 args[_i] = arguments[_i]; 26419 } 26420 for (var i = 0; i < args.length; i++) { 26421 if (args[i] !== undefined) { 26422 return args[i]; 26423 } 26424 } 26425} 26426exports.firstDefined = firstDefined; 26427function htmlEscape(s) { 26428 return (s + '').replace(/&/g, '&') 26429 .replace(/</g, '<') 26430 .replace(/>/g, '>') 26431 .replace(/'/g, ''') 26432 .replace(/"/g, '"') 26433 .replace(/\n/g, '<br />'); 26434} 26435exports.htmlEscape = htmlEscape; 26436function stripHtmlEntities(text) { 26437 return text.replace(/&.*?;/g, ''); 26438} 26439exports.stripHtmlEntities = stripHtmlEntities; 26440// Given a hash of CSS properties, returns a string of CSS. 26441// Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values. 26442function cssToStr(cssProps) { 26443 var statements = []; 26444 $.each(cssProps, function (name, val) { 26445 if (val != null) { 26446 statements.push(name + ':' + val); 26447 } 26448 }); 26449 return statements.join(';'); 26450} 26451exports.cssToStr = cssToStr; 26452// Given an object hash of HTML attribute names to values, 26453// generates a string that can be injected between < > in HTML 26454function attrsToStr(attrs) { 26455 var parts = []; 26456 $.each(attrs, function (name, val) { 26457 if (val != null) { 26458 parts.push(name + '="' + htmlEscape(val) + '"'); 26459 } 26460 }); 26461 return parts.join(' '); 26462} 26463exports.attrsToStr = attrsToStr; 26464function capitaliseFirstLetter(str) { 26465 return str.charAt(0).toUpperCase() + str.slice(1); 26466} 26467exports.capitaliseFirstLetter = capitaliseFirstLetter; 26468function compareNumbers(a, b) { 26469 return a - b; 26470} 26471exports.compareNumbers = compareNumbers; 26472function isInt(n) { 26473 return n % 1 === 0; 26474} 26475exports.isInt = isInt; 26476// Returns a method bound to the given object context. 26477// Just like one of the jQuery.proxy signatures, but without the undesired behavior of treating the same method with 26478// different contexts as identical when binding/unbinding events. 26479function proxy(obj, methodName) { 26480 var method = obj[methodName]; 26481 return function () { 26482 return method.apply(obj, arguments); 26483 }; 26484} 26485exports.proxy = proxy; 26486// Returns a function, that, as long as it continues to be invoked, will not 26487// be triggered. The function will be called after it stops being called for 26488// N milliseconds. If `immediate` is passed, trigger the function on the 26489// leading edge, instead of the trailing. 26490// https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714 26491function debounce(func, wait, immediate) { 26492 if (immediate === void 0) { immediate = false; } 26493 var timeout; 26494 var args; 26495 var context; 26496 var timestamp; 26497 var result; 26498 var later = function () { 26499 var last = +new Date() - timestamp; 26500 if (last < wait) { 26501 timeout = setTimeout(later, wait - last); 26502 } 26503 else { 26504 timeout = null; 26505 if (!immediate) { 26506 result = func.apply(context, args); 26507 context = args = null; 26508 } 26509 } 26510 }; 26511 return function () { 26512 context = this; 26513 args = arguments; 26514 timestamp = +new Date(); 26515 var callNow = immediate && !timeout; 26516 if (!timeout) { 26517 timeout = setTimeout(later, wait); 26518 } 26519 if (callNow) { 26520 result = func.apply(context, args); 26521 context = args = null; 26522 } 26523 return result; 26524 }; 26525} 26526exports.debounce = debounce; 26527 26528 26529/***/ }), 26530/* 5 */ 26531/***/ (function(module, exports, __webpack_require__) { 26532 26533Object.defineProperty(exports, "__esModule", { value: true }); 26534var moment = __webpack_require__(0); 26535var moment_ext_1 = __webpack_require__(10); 26536var UnzonedRange = /** @class */ (function () { 26537 function UnzonedRange(startInput, endInput) { 26538 // TODO: move these into footprint. 26539 // Especially, doesn't make sense for null startMs/endMs. 26540 this.isStart = true; 26541 this.isEnd = true; 26542 if (moment.isMoment(startInput)) { 26543 startInput = startInput.clone().stripZone(); 26544 } 26545 if (moment.isMoment(endInput)) { 26546 endInput = endInput.clone().stripZone(); 26547 } 26548 if (startInput) { 26549 this.startMs = startInput.valueOf(); 26550 } 26551 if (endInput) { 26552 this.endMs = endInput.valueOf(); 26553 } 26554 } 26555 /* 26556 SIDEEFFECT: will mutate eventRanges. 26557 Will return a new array result. 26558 Only works for non-open-ended ranges. 26559 */ 26560 UnzonedRange.invertRanges = function (ranges, constraintRange) { 26561 var invertedRanges = []; 26562 var startMs = constraintRange.startMs; // the end of the previous range. the start of the new range 26563 var i; 26564 var dateRange; 26565 // ranges need to be in order. required for our date-walking algorithm 26566 ranges.sort(compareUnzonedRanges); 26567 for (i = 0; i < ranges.length; i++) { 26568 dateRange = ranges[i]; 26569 // add the span of time before the event (if there is any) 26570 if (dateRange.startMs > startMs) { 26571 invertedRanges.push(new UnzonedRange(startMs, dateRange.startMs)); 26572 } 26573 if (dateRange.endMs > startMs) { 26574 startMs = dateRange.endMs; 26575 } 26576 } 26577 // add the span of time after the last event (if there is any) 26578 if (startMs < constraintRange.endMs) { 26579 invertedRanges.push(new UnzonedRange(startMs, constraintRange.endMs)); 26580 } 26581 return invertedRanges; 26582 }; 26583 UnzonedRange.prototype.intersect = function (otherRange) { 26584 var startMs = this.startMs; 26585 var endMs = this.endMs; 26586 var newRange = null; 26587 if (otherRange.startMs != null) { 26588 if (startMs == null) { 26589 startMs = otherRange.startMs; 26590 } 26591 else { 26592 startMs = Math.max(startMs, otherRange.startMs); 26593 } 26594 } 26595 if (otherRange.endMs != null) { 26596 if (endMs == null) { 26597 endMs = otherRange.endMs; 26598 } 26599 else { 26600 endMs = Math.min(endMs, otherRange.endMs); 26601 } 26602 } 26603 if (startMs == null || endMs == null || startMs < endMs) { 26604 newRange = new UnzonedRange(startMs, endMs); 26605 newRange.isStart = this.isStart && startMs === this.startMs; 26606 newRange.isEnd = this.isEnd && endMs === this.endMs; 26607 } 26608 return newRange; 26609 }; 26610 UnzonedRange.prototype.intersectsWith = function (otherRange) { 26611 return (this.endMs == null || otherRange.startMs == null || this.endMs > otherRange.startMs) && 26612 (this.startMs == null || otherRange.endMs == null || this.startMs < otherRange.endMs); 26613 }; 26614 UnzonedRange.prototype.containsRange = function (innerRange) { 26615 return (this.startMs == null || (innerRange.startMs != null && innerRange.startMs >= this.startMs)) && 26616 (this.endMs == null || (innerRange.endMs != null && innerRange.endMs <= this.endMs)); 26617 }; 26618 // `date` can be a moment, a Date, or a millisecond time. 26619 UnzonedRange.prototype.containsDate = function (date) { 26620 var ms = date.valueOf(); 26621 return (this.startMs == null || ms >= this.startMs) && 26622 (this.endMs == null || ms < this.endMs); 26623 }; 26624 // If the given date is not within the given range, move it inside. 26625 // (If it's past the end, make it one millisecond before the end). 26626 // `date` can be a moment, a Date, or a millisecond time. 26627 // Returns a MS-time. 26628 UnzonedRange.prototype.constrainDate = function (date) { 26629 var ms = date.valueOf(); 26630 if (this.startMs != null && ms < this.startMs) { 26631 ms = this.startMs; 26632 } 26633 if (this.endMs != null && ms >= this.endMs) { 26634 ms = this.endMs - 1; 26635 } 26636 return ms; 26637 }; 26638 UnzonedRange.prototype.equals = function (otherRange) { 26639 return this.startMs === otherRange.startMs && this.endMs === otherRange.endMs; 26640 }; 26641 UnzonedRange.prototype.clone = function () { 26642 var range = new UnzonedRange(this.startMs, this.endMs); 26643 range.isStart = this.isStart; 26644 range.isEnd = this.isEnd; 26645 return range; 26646 }; 26647 // Returns an ambig-zoned moment from startMs. 26648 // BEWARE: returned moment is not localized. 26649 // Formatting and start-of-week will be default. 26650 UnzonedRange.prototype.getStart = function () { 26651 if (this.startMs != null) { 26652 return moment_ext_1.default.utc(this.startMs).stripZone(); 26653 } 26654 return null; 26655 }; 26656 // Returns an ambig-zoned moment from startMs. 26657 // BEWARE: returned moment is not localized. 26658 // Formatting and start-of-week will be default. 26659 UnzonedRange.prototype.getEnd = function () { 26660 if (this.endMs != null) { 26661 return moment_ext_1.default.utc(this.endMs).stripZone(); 26662 } 26663 return null; 26664 }; 26665 UnzonedRange.prototype.as = function (unit) { 26666 return moment.utc(this.endMs).diff(moment.utc(this.startMs), unit, true); 26667 }; 26668 return UnzonedRange; 26669}()); 26670exports.default = UnzonedRange; 26671/* 26672Only works for non-open-ended ranges. 26673*/ 26674function compareUnzonedRanges(range1, range2) { 26675 return range1.startMs - range2.startMs; // earlier ranges go first 26676} 26677 26678 26679/***/ }), 26680/* 6 */ 26681/***/ (function(module, exports, __webpack_require__) { 26682 26683Object.defineProperty(exports, "__esModule", { value: true }); 26684var tslib_1 = __webpack_require__(2); 26685var $ = __webpack_require__(3); 26686var ParsableModelMixin_1 = __webpack_require__(208); 26687var Class_1 = __webpack_require__(33); 26688var EventDefParser_1 = __webpack_require__(49); 26689var EventSource = /** @class */ (function (_super) { 26690 tslib_1.__extends(EventSource, _super); 26691 // can we do away with calendar? at least for the abstract? 26692 // useful for buildEventDef 26693 function EventSource(calendar) { 26694 var _this = _super.call(this) || this; 26695 _this.calendar = calendar; 26696 _this.className = []; 26697 _this.uid = String(EventSource.uuid++); 26698 return _this; 26699 } 26700 /* 26701 rawInput can be any data type! 26702 */ 26703 EventSource.parse = function (rawInput, calendar) { 26704 var source = new this(calendar); 26705 if (typeof rawInput === 'object') { 26706 if (source.applyProps(rawInput)) { 26707 return source; 26708 } 26709 } 26710 return false;
26711 }; 26712 EventSource.normalizeId = function (id) { 26713 if (id) { 26714 return String(id); 26715 } 26716 return null; 26717 }; 26718 EventSource.prototype.fetch = function (start, end, timezone) { 26719 // subclasses must implement. must return a promise. 26720 }; 26721 EventSource.prototype.removeEventDefsById = function (eventDefId) { 26722 // optional for subclasses to implement 26723 }; 26724 EventSource.prototype.removeAllEventDefs = function () { 26725 // optional for subclasses to implement 26726 }; 26727 /* 26728 For compairing/matching 26729 */ 26730 EventSource.prototype.getPrimitive = function (otherSource) { 26731 // subclasses must implement 26732 }; 26733 EventSource.prototype.parseEventDefs = function (rawEventDefs) { 26734 var i; 26735 var eventDef; 26736 var eventDefs = []; 26737 for (i = 0; i < rawEventDefs.length; i++) { 26738 eventDef = this.parseEventDef(rawEventDefs[i]); 26739 if (eventDef) { 26740 eventDefs.push(eventDef); 26741 } 26742 } 26743 return eventDefs; 26744 }; 26745 EventSource.prototype.parseEventDef = function (rawInput) { 26746 var calendarTransform = this.calendar.opt('eventDataTransform'); 26747 var sourceTransform = this.eventDataTransform; 26748 if (calendarTransform) { 26749 rawInput = calendarTransform(rawInput, this.calendar); 26750 } 26751 if (sourceTransform) { 26752 rawInput = sourceTransform(rawInput, this.calendar); 26753 } 26754 return EventDefParser_1.default.parse(rawInput, this); 26755 }; 26756 EventSource.prototype.applyManualStandardProps = function (rawProps) { 26757 if (rawProps.id != null) { 26758 this.id = EventSource.normalizeId(rawProps.id); 26759 } 26760 // TODO: converge with EventDef 26761 if ($.isArray(rawProps.className)) { 26762 this.className = rawProps.className; 26763 } 26764 else if (typeof rawProps.className === 'string') { 26765 this.className = rawProps.className.split(/\s+/); 26766 } 26767 return true; 26768 }; 26769 EventSource.uuid = 0; 26770 EventSource.defineStandardProps = ParsableModelMixin_1.default.defineStandardProps; 26771 EventSource.copyVerbatimStandardProps = ParsableModelMixin_1.default.copyVerbatimStandardProps; 26772 return EventSource; 26773}(Class_1.default)); 26774exports.default = EventSource; 26775ParsableModelMixin_1.default.mixInto(EventSource); 26776// Parsing 26777// --------------------------------------------------------------------------------------------------------------------- 26778EventSource.defineStandardProps({ 26779 // manually process... 26780 id: false, 26781 className: false, 26782 // automatically transfer... 26783 color: true, 26784 backgroundColor: true, 26785 borderColor: true, 26786 textColor: true, 26787 editable: true, 26788 startEditable: true, 26789 durationEditable: true, 26790 rendering: true, 26791 overlap: true, 26792 constraint: true, 26793 allDayDefault: true, 26794 eventDataTransform: true 26795}); 26796 26797 26798/***/ }), 26799/* 7 */ 26800/***/ (function(module, exports, __webpack_require__) { 26801 26802/* 26803Utility methods for easily listening to events on another object, 26804and more importantly, easily unlistening from them. 26805 26806USAGE: 26807 import { default as ListenerMixin, ListenerInterface } from './ListenerMixin' 26808in class: 26809 listenTo: ListenerInterface['listenTo'] 26810 stopListeningTo: ListenerInterface['stopListeningTo'] 26811after class: 26812 ListenerMixin.mixInto(TheClass) 26813*/ 26814Object.defineProperty(exports, "__esModule", { value: true }); 26815var tslib_1 = __webpack_require__(2); 26816var $ = __webpack_require__(3); 26817var Mixin_1 = __webpack_require__(14); 26818var guid = 0; 26819var ListenerMixin = /** @class */ (function (_super) { 26820 tslib_1.__extends(ListenerMixin, _super); 26821 function ListenerMixin() { 26822 return _super !== null && _super.apply(this, arguments) || this; 26823 } 26824 /* 26825 Given an `other` object that has on/off methods, bind the given `callback` to an event by the given name. 26826 The `callback` will be called with the `this` context of the object that .listenTo is being called on. 26827 Can be called: 26828 .listenTo(other, eventName, callback) 26829 OR 26830 .listenTo(other, { 26831 eventName1: callback1, 26832 eventName2: callback2 26833 }) 26834 */ 26835 ListenerMixin.prototype.listenTo = function (other, arg, callback) { 26836 if (typeof arg === 'object') { 26837 for (var eventName in arg) { 26838 if (arg.hasOwnProperty(eventName)) { 26839 this.listenTo(other, eventName, arg[eventName]); 26840 } 26841 } 26842 } 26843 else if (typeof arg === 'string') { 26844 other.on(arg + '.' + this.getListenerNamespace(), // use event namespacing to identify this object 26845 $.proxy(callback, this) // always use `this` context 26846 // the usually-undesired jQuery guid behavior doesn't matter, 26847 // because we always unbind via namespace 26848 ); 26849 } 26850 }; 26851 /* 26852 Causes the current object to stop listening to events on the `other` object. 26853 `eventName` is optional. If omitted, will stop listening to ALL events on `other`. 26854 */ 26855 ListenerMixin.prototype.stopListeningTo = function (other, eventName) { 26856 other.off((eventName || '') + '.' + this.getListenerNamespace()); 26857 }; 26858 /* 26859 Returns a string, unique to this object, to be used for event namespacing 26860 */ 26861 ListenerMixin.prototype.getListenerNamespace = function () { 26862 if (this.listenerId == null) { 26863 this.listenerId = guid++; 26864 } 26865 return '_listener' + this.listenerId; 26866 }; 26867 return ListenerMixin; 26868}(Mixin_1.default)); 26869exports.default = ListenerMixin; 26870 26871 26872/***/ }), 26873/* 8 */, 26874/* 9 */, 26875/* 10 */ 26876/***/ (function(module, exports, __webpack_require__) { 26877 26878Object.defineProperty(exports, "__esModule", { value: true }); 26879var moment = __webpack_require__(0); 26880var $ = __webpack_require__(3); 26881var util_1 = __webpack_require__(4); 26882var ambigDateOfMonthRegex = /^\s*\d{4}-\d\d$/; 26883var ambigTimeOrZoneRegex = /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/; 26884var newMomentProto = moment.fn; // where we will attach our new methods 26885exports.newMomentProto = newMomentProto; 26886var oldMomentProto = $.extend({}, newMomentProto); // copy of original moment methods 26887exports.oldMomentProto = oldMomentProto; 26888// tell momentjs to transfer these properties upon clone 26889var momentProperties = moment.momentProperties; 26890momentProperties.push('_fullCalendar'); 26891momentProperties.push('_ambigTime'); 26892momentProperties.push('_ambigZone'); 26893/* 26894Call this if you want Moment's original format method to be used 26895*/ 26896function oldMomentFormat(mom, formatStr) { 26897 return oldMomentProto.format.call(mom, formatStr); // oldMomentProto defined in moment-ext.js 26898} 26899exports.oldMomentFormat = oldMomentFormat; 26900// Creating 26901// ------------------------------------------------------------------------------------------------- 26902// Creates a new moment, similar to the vanilla moment(...) constructor, but with
26903// extra features (ambiguous time, enhanced formatting). When given an existing moment, 26904// it will function as a clone (and retain the zone of the moment). Anything else will 26905// result in a moment in the local zone. 26906var momentExt = function () { 26907 return makeMoment(arguments); 26908}; 26909exports.default = momentExt; 26910// Sames as momentExt, but forces the resulting moment to be in the UTC timezone. 26911momentExt.utc = function () { 26912 var mom = makeMoment(arguments, true); 26913 // Force it into UTC because makeMoment doesn't guarantee it 26914 // (if given a pre-existing moment for example) 26915 if (mom.hasTime()) { 26916 mom.utc(); 26917 } 26918 return mom; 26919}; 26920// Same as momentExt, but when given an ISO8601 string, the timezone offset is preserved. 26921// ISO8601 strings with no timezone offset will become ambiguously zoned. 26922momentExt.parseZone = function () { 26923 return makeMoment(arguments, true, true); 26924}; 26925// Builds an enhanced moment from args. When given an existing moment, it clones. When given a 26926// native Date, or called with no arguments (the current time), the resulting moment will be local. 26927// Anything else needs to be "parsed" (a string or an array), and will be affected by: 26928// parseAsUTC - if there is no zone information, should we parse the input in UTC? 26929// parseZone - if there is zone information, should we force the zone of the moment? 26930function makeMoment(args, parseAsUTC, parseZone) { 26931 if (parseAsUTC === void 0) { parseAsUTC = false; } 26932 if (parseZone === void 0) { parseZone = false; } 26933 var input = args[0]; 26934 var isSingleString = args.length === 1 && typeof input === 'string'; 26935 var isAmbigTime; 26936 var isAmbigZone; 26937 var ambigMatch; 26938 var mom; 26939 if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) { 26940 mom = moment.apply(null, args); 26941 } 26942 else { 26943 isAmbigTime = false; 26944 isAmbigZone = false; 26945 if (isSingleString) { 26946 if (ambigDateOfMonthRegex.test(input)) { 26947 // accept strings like '2014-05', but convert to the first of the month 26948 input += '-01'; 26949 args = [input]; // for when we pass it on to moment's constructor 26950 isAmbigTime = true; 26951 isAmbigZone = true; 26952 } 26953 else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) { 26954 isAmbigTime = !ambigMatch[5]; // no time part? 26955 isAmbigZone = true; 26956 } 26957 } 26958 else if ($.isArray(input)) { 26959 // arrays have no timezone information, so assume ambiguous zone 26960 isAmbigZone = true; 26961 } 26962 // otherwise, probably a string with a format 26963 if (parseAsUTC || isAmbigTime) { 26964 mom = moment.utc.apply(moment, args); 26965 } 26966 else { 26967 mom = moment.apply(null, args); 26968 } 26969 if (isAmbigTime) { 26970 mom._ambigTime = true; 26971 mom._ambigZone = true; // ambiguous time always means ambiguous zone 26972 } 26973 else if (parseZone) { 26974 if (isAmbigZone) { 26975 mom._ambigZone = true; 26976 } 26977 else if (isSingleString) { 26978 mom.utcOffset(input); // if not a valid zone, will assign UTC 26979 } 26980 } 26981 } 26982 mom._fullCalendar = true; // flag for extended functionality 26983 return mom; 26984} 26985// Week Number 26986// ------------------------------------------------------------------------------------------------- 26987// Returns the week number, considering the locale's custom week number calcuation 26988// `weeks` is an alias for `week` 26989newMomentProto.week = newMomentProto.weeks = function (input) { 26990 var weekCalc = this._locale._fullCalendar_weekCalc; 26991 if (input == null && typeof weekCalc === 'function') { 26992 return weekCalc(this); 26993 } 26994 else if (weekCalc === 'ISO') { 26995 return oldMomentProto.isoWeek.apply(this, arguments); // ISO getter/setter 26996 } 26997 return oldMomentProto.week.apply(this, arguments); // local getter/setter 26998}; 26999// Time-of-day 27000// ------------------------------------------------------------------------------------------------- 27001// GETTER 27002// Returns a Duration with the hours/minutes/seconds/ms values of the moment. 27003// If the moment has an ambiguous time, a duration of 00:00 will be returned. 27004// 27005// SETTER 27006// You can supply a Duration, a Moment, or a Duration-like argument. 27007// When setting the time, and the moment has an ambiguous time, it then becomes unambiguou
27007s. 27008newMomentProto.time = function (time) { 27009 // Fallback to the original method (if there is one) if this moment wasn't created via FullCalendar. 27010 // `time` is a generic enough method name where this precaution is necessary to avoid collisions w/ other plugins. 27011 if (!this._fullCalendar) { 27012 return oldMomentProto.time.apply(this, arguments); 27013 } 27014 if (time == null) { 27015 return moment.duration({ 27016 hours: this.hours(), 27017 minutes: this.minutes(), 27018 seconds: this.seconds(), 27019 milliseconds: this.milliseconds() 27020 }); 27021 } 27022 else { 27023 this._ambigTime = false; // mark that the moment now has a time 27024 if (!moment.isDuration(time) && !moment.isMoment(time)) { 27025 time = moment.duration(time); 27026 } 27027 // The day value should cause overflow (so 24 hours becomes 00:00:00 of next day). 27028 // Only for Duration times, not Moment times. 27029 var dayHours = 0; 27030 if (moment.isDuration(time)) { 27031 dayHours = Math.floor(time.asDays()) * 24; 27032 } 27033 // We need to set the individual fields. 27034 // Can't use startOf('day') then add duration. In case of DST at start of day. 27035 return this.hours(dayHours + time.hours()) 27036 .minutes(time.minutes()) 27037 .seconds(time.seconds()) 27038 .milliseconds(time.milliseconds()); 27039 } 27040}; 27041// Converts the moment to UTC, stripping out its time-of-day and timezone offset, 27042// but preserving its YMD. A moment with a stripped time will display no time 27043// nor timezone offset when .format() is called. 27044newMomentProto.stripTime = function () { 27045 if (!this._ambigTime) { 27046 this.utc(true); // keepLocalTime=true (for keeping *date* value) 27047 // set time to zero 27048 this.set({ 27049 hours: 0, 27050 minutes: 0, 27051 seconds: 0, 27052 ms: 0 27053 }); 27054 // Mark the time as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(), 27055 // which clears all ambig flags. 27056 this._ambigTime = true; 27057 this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset 27058 } 27059 return this; // for chaining 27060}; 27061// Returns if the moment has a non-ambiguous time (boolean) 27062newMomentProto.hasTime = function () { 27063 return !this._ambigTime; 27064}; 27065// Timezone 27066// ------------------------------------------------------------------------------------------------- 27067// Converts the moment to UTC, stripping out its timezone offset, but preserving its 27068// YMD and time-of-day. A moment with a stripped timezone offset will display no 27069// timezone offset when .format() is called. 27070newMomentProto.stripZone = function () { 27071 var wasAmbigTime; 27072 if (!this._ambigZone) { 27073 wasAmbigTime = this._ambigTime; 27074 this.utc(true); // keepLocalTime=true (for keeping date and time values) 27075 // the above call to .utc()/.utcOffset() unfortunately might clear the ambig flags, so restore 27076 this._ambigTime = wasAmbigTime || false; 27077 // Mark the zone as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(), 27078 // which clears the ambig flags. 27079 this._ambigZone = true; 27080 } 27081 return this; // for chaining 27082}; 27083// Returns of the moment has a non-ambiguous timezone offset (boolean) 27084newMomentProto.hasZone = function () { 27085 return !this._ambigZone; 27086}; 27087// implicitly marks a zone 27088newMomentProto.local = function (keepLocalTime) { 27089 // for when converting from ambiguously-zoned to local, 27090 // keep the time values when converting from UTC -> local 27091 oldMomentProto.local.call(this, this._ambigZone || keepLocalTime); 27092 // ensure non-ambiguous 27093 // this probably already happened via local() -> utcOffset(), but don't rely on Moment's internals 27094 this._ambigTime = false; 27095 this._ambigZone = false; 27096 return this; // for chaining 27097}; 27098// implicitly marks a zone 27099newMomentProto.utc = function (keepLocalTime) { 27100 oldMomentProto.utc.call(this, keepLocalTime); 27101 // ensure non-ambiguous 27102 // this probably already happened via utc() -> utcOffset(), but don't rely on Moment's internals 27103 this._ambigTime = false;
27104 this._ambigZone = false; 27105 return this; 27106}; 27107// implicitly marks a zone (will probably get called upon .utc() and .local()) 27108newMomentProto.utcOffset = function (tzo) { 27109 if (tzo != null) { 27110 // these assignments needs to happen before the original zone method is called. 27111 // I forget why, something to do with a browser crash. 27112 this._ambigTime = false; 27113 this._ambigZone = false; 27114 } 27115 return oldMomentProto.utcOffset.apply(this, arguments); 27116}; 27117 27118 27119/***/ }), 27120/* 11 */ 27121/***/ (function(module, exports, __webpack_require__) { 27122 27123/* 27124USAGE: 27125 import { default as EmitterMixin, EmitterInterface } from './EmitterMixin' 27126in class: 27127 on: EmitterInterface['on'] 27128 one: EmitterInterface['one'] 27129 off: EmitterInterface['off'] 27130 trigger: EmitterInterface['trigger'] 27131 triggerWith: EmitterInterface['triggerWith'] 27132 hasHandlers: EmitterInterface['hasHandlers'] 27133after class: 27134 EmitterMixin.mixInto(TheClass) 27135*/ 27136Object.defineProperty(exports, "__esModule", { value: true }); 27137var tslib_1 = __webpack_require__(2); 27138var $ = __webpack_require__(3); 27139var Mixin_1 = __webpack_require__(14); 27140var EmitterMixin = /** @class */ (function (_super) { 27141 tslib_1.__extends(EmitterMixin, _super); 27142 function EmitterMixin() { 27143 return _super !== null && _super.apply(this, arguments) || this; 27144 } 27145 // jQuery-ification via $(this) allows a non-DOM object to have 27146 // the same event handling capabilities (including namespaces). 27147 EmitterMixin.prototype.on = function (types, handler) { 27148 $(this).on(types, this._prepareIntercept(handler)); 27149 return this; // for chaining 27150 }; 27151 EmitterMixin.prototype.one = function (types, handler) { 27152 $(this).one(types, this._prepareIntercept(handler)); 27153 return this; // for chaining 27154 }; 27155 EmitterMixin.prototype._prepareIntercept = function (handler) { 27156 // handlers are always called with an "event" object as their first param. 27157 // sneak the `this` context and arguments into the extra parameter object 27158 // and forward them on to the original handler. 27159 var intercept = function (ev, extra) { 27160 return handler.apply(extra.context || this, extra.args || []); 27161 }; 27162 // mimick jQuery's internal "proxy" system (risky, I know) 27163 // causing all functions with the same .guid to appear to be the same. 27164 // https://github.com/jquery/jquery/blob/2.2.4/src/core.js#L448 27165 // this is needed for calling .off with the original non-intercept handler. 27166 if (!handler.guid) { 27167 handler.guid = $.guid++; 27168 } 27169 intercept.guid = handler.guid; 27170 return intercept; 27171 }; 27172 EmitterMixin.prototype.off = function (types, handler) { 27173 $(this).off(types, handler); 27174 return this; // for chaining 27175 }; 27176 EmitterMixin.prototype.trigger = function (types) { 27177 var args = []; 27178 for (var _i = 1; _i < arguments.length; _i++) { 27179 args[_i - 1] = arguments[_i]; 27180 } 27181 // pass in "extra" info to the intercept 27182 $(this).triggerHandler(types, { args: args }); 27183 return this; // for chaining 27184 }; 27185 EmitterMixin.prototype.triggerWith = function (types, context, args) { 27186 // `triggerHandler` is less reliant on the DOM compared to `trigger`. 27187 // pass in "extra" info to the intercept. 27188 $(this).triggerHandler(types, { context: context, args: args }); 27189 return this; // for chaining 27190 }; 27191 EmitterMixin.prototype.hasHandlers = function (type) { 27192 var hash = $._data(this, 'events'); // http://blog.jquery.com/2012/08/09/jquery-1-8-released/ 27193 return hash && hash[type] && hash[type].length > 0; 27194 }; 27195 return EmitterMixin; 27196}(Mixin_1.default)); 27197exports.default = EmitterMixin; 27198 27199 27200/***/ }), 27201/* 12 */ 27202/***/ (function(module, exports) { 27203 27204Object.defineProperty(exports, "__esModule", { value: true }); 27205/* 27206Meant to be immutable 27207*/ 27208var ComponentFootprint = /** @class */ (function () { 27209 function ComponentFootprint(unzonedRange, isAllDay) { 27210 this.isAllDay = false; // component can choose to ignore this 27211 this.unzonedRange = unzonedRange; 27212 this.isAllDay = isAllDay; 27213 } 27214 /* 27215 Only works for non-open-ended ranges. 27216 */ 27217 ComponentFootprint.prototype.toLegacy = function (calendar) { 27218 return { 27219 start: calendar.msToMoment(this.unzonedRange.startMs, this.isAllDay), 27220 end: calendar.msToMoment(this.unzonedRange.endMs, this.isAllDay) 27221 }; 27222 }; 27223 return ComponentFootprint; 27224}()); 27225exports.default = ComponentFootprint; 27226 27227 27228/***/ }), 27229/* 13 */ 27230/***/ (function(module, exports, __webpack_require__) { 27231 27232Object.defineProperty(exports, "__esModule", { value: true }); 27233var tslib_1 = __webpack_require__(2); 27234var EventDef_1 = __webpack_require__(34); 27235var EventInstance_1 = __webpack_require__(209); 27236var EventDateProfile_1 = __webpack_require__(17); 27237var SingleEventDef = /** @class */ (function (_super) { 27238 tslib_1.__extends(SingleEventDef, _super); 27239 function SingleEventDef() { 27240 return _super !== null && _super.apply(this, arguments) || this; 27241 } 27242 /* 27243 Will receive start/end params, but will be ignored. 27244 */ 27245 SingleEventDef.prototype.buildInstances = function () { 27246 return [this.buildInstance()]; 27247 }; 27248 SingleEventDef.prototype.buildInstance = function () { 27249 return new EventInstance_1.default(this, // definition 27250 this.dateProfile); 27251 }; 27252 SingleEventDef.prototype.isAllDay = function () { 27253 return this.dateProfile.isAllDay(); 27254 }; 27255 SingleEventDef.prototype.clone = function () { 27256 var def = _super.prototype.clone.call(this); 27257 def.dateProfile = this.dateProfile; 27258 return def; 27259 }; 27260 SingleEventDef.prototype.rezone = function () { 27261 var calendar = this.source.calendar; 27262 var dateProfile = this.dateProfile; 27263 this.dateProfile = new EventDateProfile_1.default(calendar.moment(dateProfile.start), dateProfile.end ? calendar.moment(dateProfile.end) : null, calendar); 27264 }; 27265 /* 27266 NOTE: if super-method fails, should still attempt to apply 27267 */
27268 SingleEventDef.prototype.applyManualStandardProps = function (rawProps) { 27269 var superSuccess = _super.prototype.applyManualStandardProps.call(this, rawProps); 27270 var dateProfile = EventDateProfile_1.default.parse(rawProps, this.source); // returns null on failure 27271 if (dateProfile) { 27272 this.dateProfile = dateProfile; 27273 // make sure `date` shows up in the legacy event objects as-is 27274 if (rawProps.date != null) { 27275 this.miscProps.date = rawProps.date; 27276 } 27277 return superSuccess; 27278 } 27279 else { 27280 return false; 27281 } 27282 }; 27283 return SingleEventDef; 27284}(EventDef_1.default)); 27285exports.default = SingleEventDef; 27286// Parsing 27287// --------------------------------------------------------------------------------------------------------------------- 27288SingleEventDef.defineStandardProps({ 27289 start: false, 27290 date: false, 27291 end: false, 27292 allDay: false 27293}); 27294 27295 27296/***/ }), 27297/* 14 */ 27298/***/ (function(module, exports) { 27299 27300Object.defineProperty(exports, "__esModule", { value: true }); 27301var Mixin = /** @class */ (function () { 27302 function Mixin() { 27303 } 27304 Mixin.mixInto = function (destClass) { 27305 var _this = this; 27306 Object.getOwnPropertyNames(this.prototype).forEach(function (name) { 27307 if (!destClass.prototype[name]) { 27308 destClass.prototype[name] = _this.prototype[name]; 27309 } 27310 }); 27311 }; 27312 /* 27313 will override existing methods 27314 TODO: remove! not used anymore 27315 */ 27316 Mixin.mixOver = function (destClass) { 27317 var _this = this; 27318 Object.getOwnPropertyNames(this.prototype).forEach(function (name) { 27319 destClass.prototype[name] = _this.prototype[name]; 27320 }); 27321 }; 27322 return Mixin; 27323}()); 27324exports.default = Mixin; 27325 27326 27327/***/ }), 27328/* 15 */ 27329/***/ (function(module, exports) { 27330 27331Object.defineProperty(exports, "__esModule", { value: true }); 27332var Interaction = /** @class */ (function () { 27333 function Interaction(component) { 27334 this.view = component._getView(); 27335 this.component = component; 27336 } 27337 Interaction.prototype.opt = function (name) { 27338 return this.view.opt(name); 27339 }; 27340 Interaction.prototype.end = function () { 27341 // subclasses can implement 27342 }; 27343 return Interaction; 27344}()); 27345exports.default = Interaction; 27346 27347 27348/***/ }), 27349/* 16 */ 27350/***/ (function(module, exports, __webpack_require__) { 27351 27352Object.defineProperty(exports, "__esModule", { value: true }); 27353exports.version = '3.9.0'; 27354// When introducing internal API incompatibilities (where fullcalendar plugins would break), 27355// the minor version of the calendar should be upped (ex: 2.7.2 -> 2.8.0) 27356// and the below integer should be incremented. 27357exports.internalApiVersion = 12; 27358var util_1 = __webpack_require__(4); 27359exports.applyAll = util_1.applyAll; 27360exports.debounce = util_1.debounce; 27361exports.isInt = util_1.isInt; 27362exports.htmlEscape = util_1.htmlEscape; 27363exports.cssToStr = util_1.cssToStr; 27364exports.proxy = util_1.proxy; 27365exports.capitaliseFirstLetter = util_1.capitaliseFirstLetter; 27366exports.getOuterRect = util_1.getOuterRect; 27367exports.getClientRect = util_1.getClientRect; 27368exports.getContentRect = util_1.getContentRect; 27369exports.getScrollbarWidths = util_1.getScrollbarWidths; 27370exports.preventDefault = util_1.preventDefault; 27371exports.parseFieldSpecs = util_1.parseFieldSpecs; 27372exports.compareByFieldSpecs = util_1.compareByFieldSpecs; 27373exports.compareByFieldSpec = util_1.compareByFieldSpec; 27374exports.flexibleCompare = util_1.flexibleCompare; 27375exports.computeGreatestUnit = util_1.computeGreatestUnit; 27376exports.divideRangeByDuration = util_1.divideRangeByDuration; 27377exports.divideDurationByDuration = util_1.divideDurationByDuration; 27378exports.multiplyDuration = util_1.multiplyDuration; 27379exports.durationHasTime = util_1.durationHasTime; 27380exports.log = util_1.log; 27381exports.warn = util_1.warn; 27382exports.removeExact = util_1.removeExact; 27383exports.intersectRects = util_1.intersectRects; 27384var date_formatting_1 = __webpack_require__(47); 27385exports.formatDate = date_formatting_1.formatDate; 27386exports.formatRange = date_formatting_1.formatRange;
27387exports.queryMostGranularFormatUnit = date_formatting_1.queryMostGranularFormatUnit; 27388var locale_1 = __webpack_require__(31); 27389exports.datepickerLocale = locale_1.datepickerLocale; 27390exports.locale = locale_1.locale; 27391var moment_ext_1 = __webpack_require__(10); 27392exports.moment = moment_ext_1.default; 27393var EmitterMixin_1 = __webpack_require__(11); 27394exports.EmitterMixin = EmitterMixin_1.default; 27395var ListenerMixin_1 = __webpack_require__(7); 27396exports.ListenerMixin = ListenerMixin_1.default; 27397var Model_1 = __webpack_require__(48); 27398exports.Model = Model_1.default; 27399var Constraints_1 = __webpack_require__(207); 27400exports.Constraints = Constraints_1.default; 27401var UnzonedRange_1 = __webpack_require__(5); 27402exports.UnzonedRange = UnzonedRange_1.default; 27403var ComponentFootprint_1 = __webpack_require__(12); 27404exports.ComponentFootprint = ComponentFootprint_1.default; 27405var BusinessHourGenerator_1 = __webpack_require__(212); 27406exports.BusinessHourGenerator = BusinessHourGenerator_1.default; 27407var EventDef_1 = __webpack_require__(34); 27408exports.EventDef = EventDef_1.default; 27409var EventDefMutation_1 = __webpack_require__(37); 27410exports.EventDefMutation = EventDefMutation_1.default; 27411var EventSourceParser_1 = __webpack_require__(38); 27412exports.EventSourceParser = EventSourceParser_1.default; 27413var EventSource_1 = __webpack_require__(6); 27414exports.EventSource = EventSource_1.default; 27415var ThemeRegistry_1 = __webpack_require__(51); 27416exports.defineThemeSystem = ThemeRegistry_1.defineThemeSystem; 27417var EventInstanceGroup_1 = __webpack_require__(18); 27418exports.EventInstanceGroup = EventInstanceGroup_1.default; 27419var ArrayEventSource_1 = __webpack_require__(52); 27420exports.ArrayEventSource = ArrayEventSource_1.default; 27421var FuncEventSource_1 = __webpack_require__(215); 27422exports.FuncEventSource = FuncEventSource_1.default; 27423var JsonFeedEventSource_1 = __webpack_require__(216); 27424exports.JsonFeedEventSource = JsonFeedEventSource_1.default; 27425var EventFootprint_1 = __webpack_require__(36); 27426exports.EventFootprint = EventFootprint_1.default; 27427var Class_1 = __webpack_require__(33); 27428exports.Class = Class_1.default; 27429var Mixin_1 = __webpack_require__(14); 27430exports.Mixin = Mixin_1.default; 27431var CoordCache_1 = __webpack_require__(53); 27432exports.CoordCache = CoordCache_1.default; 27433var DragListener_1 = __webpack_require__(54); 27434exports.DragListener = DragListener_1.default; 27435var Promise_1 = __webpack_require__(20); 27436exports.Promise = Promise_1.default; 27437var TaskQueue_1 = __webpack_require__(217); 27438exports.TaskQueue = TaskQueue_1.default; 27439var RenderQueue_1 = __webpack_require__(218); 27440exports.RenderQueue = RenderQueue_1.default; 27441var Scroller_1 = __webpack_require__(39); 27442exports.Scroller = Scroller_1.default; 27443var Theme_1 = __webpack_require__(19); 27444exports.Theme = Theme_1.default; 27445var DateComponent_1 = __webpack_require__(219); 27446exports.DateComponent = DateComponent_1.default; 27447var InteractiveDateComponent_1 = __webpack_require__(40); 27448exports.InteractiveDateComponent = InteractiveDateComponent_1.default; 27449var Calendar_1 = __webpack_require__(220); 27450exports.Calendar = Calendar_1.default; 27451var View_1 = __webpack_require__(41); 27452exports.View = View_1.default; 27453var ViewRegistry_1 = __webpack_require__(22); 27454exports.defineView = ViewRegistry_1.defineView; 27455exports.getViewConfig = ViewRegistry_1.getViewConfig; 27456var DayTableMixin_1 = __webpack_require__(55); 27457exports.DayTableMixin = DayTableMixin_1.default; 27458var BusinessHourRenderer_1 = __webpack_require__(56); 27459exports.BusinessHourRenderer = BusinessHourRenderer_1.default; 27460var EventRenderer_1 = __webpack_require__(42); 27461exports.EventRenderer = EventRenderer_1.default; 27462var FillRenderer_1 = __webpack_require__(57); 27463exports.FillRenderer = FillRenderer_1.default; 27464var HelperRenderer_1 = __webpack_require__(58); 27465exports.HelperRenderer = HelperRenderer_1.default;
27466var ExternalDropping_1 = __webpack_require__(222); 27467exports.ExternalDropping = ExternalDropping_1.default; 27468var EventResizing_1 = __webpack_require__(223); 27469exports.EventResizing = EventResizing_1.default; 27470var EventPointing_1 = __webpack_require__(59); 27471exports.EventPointing = EventPointing_1.default; 27472var EventDragging_1 = __webpack_require__(224); 27473exports.EventDragging = EventDragging_1.default; 27474var DateSelecting_1 = __webpack_require__(225); 27475exports.DateSelecting = DateSelecting_1.default; 27476var StandardInteractionsMixin_1 = __webpack_require__(60); 27477exports.StandardInteractionsMixin = StandardInteractionsMixin_1.default; 27478var AgendaView_1 = __webpack_require__(226); 27479exports.AgendaView = AgendaView_1.default; 27480var TimeGrid_1 = __webpack_require__(227); 27481exports.TimeGrid = TimeGrid_1.default; 27482var DayGrid_1 = __webpack_require__(61); 27483exports.DayGrid = DayGrid_1.default; 27484var BasicView_1 = __webpack_require__(62); 27485exports.BasicView = BasicView_1.default; 27486var MonthView_1 = __webpack_require__(229); 27487exports.MonthView = MonthView_1.default; 27488var ListView_1 = __webpack_require__(230); 27489exports.ListView = ListView_1.default; 27490 27491 27492/***/ }), 27493/* 17 */ 27494/***/ (function(module, exports, __webpack_require__) { 27495 27496Object.defineProperty(exports, "__esModule", { value: true }); 27497var UnzonedRange_1 = __webpack_require__(5); 27498/* 27499Meant to be immutable 27500*/ 27501var EventDateProfile = /** @class */ (function () { 27502 function EventDateProfile(start, end, calendar) { 27503 this.start = start; 27504 this.end = end || null; 27505 this.unzonedRange = this.buildUnzonedRange(calendar); 27506 } 27507 /* 27508 Needs an EventSource object 27509 */ 27510 EventDateProfile.parse = function (rawProps, source) { 27511 var startInput = rawProps.start || rawProps.date; 27512 var endInput = rawProps.end; 27513 if (!startInput) { 27514 return false; 27515 } 27516 var calendar = source.calendar; 27517 var start = calendar.moment(startInput); 27518 var end = endInput ? calendar.moment(endInput) : null; 27519 var forcedAllDay = rawProps.allDay; 27520 var forceEventDuration = calendar.opt('forceEventDuration'); 27521 if (!start.isValid()) { 27522 return false; 27523 } 27524 if (end && (!end.isValid() || !end.isAfter(start))) { 27525 end = null; 27526 } 27527 if (forcedAllDay == null) { 27528 forcedAllDay = source.allDayDefault; 27529 if (forcedAllDay == null) { 27530 forcedAllDay = calendar.opt('allDayDefault'); 27531 } 27532 } 27533 if (forcedAllDay === true) { 27534 start.stripTime(); 27535 if (end) { 27536 end.stripTime(); 27537 } 27538 } 27539 else if (forcedAllDay === false) { 27540 if (!start.hasTime()) { 27541 start.time(0); 27542 } 27543 if (end && !end.hasTime()) { 27544 end.time(0); 27545 } 27546 } 27547 if (!end && forceEventDuration) { 27548 end = calendar.getDefaultEventEnd(!start.hasTime(), start); 27549 } 27550 return new EventDateProfile(start, end, calendar); 27551 }; 27552 EventDateProfile.isStandardProp = function (propName) { 27553 return propName === 'start' || propName === 'date' || propName === 'end' || propName === 'allDay'; 27554 }; 27555 EventDateProfile.prototype.isAllDay = function () { 27556 return !(this.start.hasTime() || (this.end && this.end.hasTime())); 27557 }; 27558 /* 27559 Needs a Calendar object 27560 */ 27561 EventDateProfile.prototype.buildUnzonedRange = function (calendar) { 27562 var startMs = this.start.clone().stripZone().valueOf(); 27563 var endMs = this.getEnd(calendar).stripZone().valueOf(); 27564 return new UnzonedRange_1.default(startMs, endMs); 27565 }; 27566 /* 27567 Needs a Calendar object 27568 */ 27569 EventDateProfile.prototype.getEnd = function (calendar) { 27570 return this.end ? 27571 this.end.clone() : 27572 // derive the end from the start and allDay. compute allDay if necessary 27573 calendar.getDefaultEventEnd(this.isAllDay(), this.start); 27574 }; 27575 return EventDateProfile; 27576}()); 27577exports.default = EventDateProfile; 27578 27579 27580/***/ }), 27581/* 18 */ 27582/***/ (function(module, exports, __webpack_require__) { 27583 27584Object.defineProperty(exports, "__esModule", { value: true }); 27585var UnzonedRange_1 = __webpack_require__(5); 27586var util_1 = __webpack_require__(35); 27587var EventRange_1 = __webpack_require__(211); 27588/* 27589It's expected that there will be at least one EventInstance, 27590OR that an explicitEventDef is assigned. 27591*/ 27592var EventInstanceGroup = /** @class */ (function () { 27593 function EventInstanceGroup(eventInstances) { 27594 this.eventInstances = eventInstances || []; 27595 } 27596 EventInstanceGroup.prototype.getAllEventRanges = function (constraintRange) { 27597 if (constraintRange) { 27598 return this.sliceNormalRenderRanges(constraintRange); 27599 } 27600 else { 27601 return this.eventInstances.map(util_1.eventInstanceToEventRange); 27602 } 27603 }; 27604 EventInstanceGroup.prototype.sliceRenderRanges = function (constraintRange) { 27605 if (this.isInverse()) { 27606 return this.sliceInverseRenderRanges(constraintRange); 27607 } 27608 else { 27609 return this.sliceNormalRenderRanges(constraintRange); 27610 } 27611 }; 27612 EventInstanceGroup.prototype.sliceNormalRenderRanges = function (constraintRange) { 27613 var eventInstances = this.eventInstances; 27614 var i; 27615 var eventInstance; 27616 var slicedRange; 27617 var slicedEventRanges = []; 27618 for (i = 0; i < eventInstances.length; i++) { 27619 eventInstance = eventInstances[i]; 27620 slicedRange = eventInstance.dateProfile.unzonedRange.intersect(constraintRange); 27621 if (slicedRange) { 27622 slicedEventRanges.push(new EventRange_1.default(slicedRange, eventInstance.def, eventInstance)); 27623 } 27624 } 27625 return slicedEventRanges; 27626 }; 27627 EventInstanceGroup.prototype.sliceInverseRenderRanges = function (constraintRange) { 27628 var unzonedRanges = this.eventInstances.map(util_1.eventInstanceToUnzonedRange); 27629 var ownerDef = this.getEventDef(); 27630 unzonedRanges = UnzonedRange_1.default.invertRanges(unzonedRanges, constraintRange); 27631 return unzonedRanges.map(function (unzonedRange) { 27632 return new EventRange_1.default(unzonedRange, ownerDef); // don't give an EventInstance 27633 }); 27634 }; 27635 EventInstanceGroup.prototype.isInverse = function () { 27636 return this.getEventDef().hasInverseRendering(); 27637 }; 27638 EventInstanceGroup.prototype.getEventDef = function () { 27639 return this.explicitEventDef || this.eventInstances[0].def; 27640 }; 27641 return EventInstanceGroup; 27642}()); 27643exports.default = EventInstanceGroup; 27644 27645 27646/***/ }), 27647/* 19 */ 27648/***/ (function(module, exports, __webpack_require__) { 27649 27650Object.defineProperty(exports, "__esModule", { value: true }); 27651var $ = __webpack_require__(3); 27652var Theme = /** @class */ (function () { 27653 function Theme(optionsManager) { 27654 this.optionsManager = optionsManager; 27655 this.processIconOverride(); 27656 } 27657 Theme.prototype.processIconOverride = function () { 27658 if (this.iconOverrideOption) { 27659 this.setIconOverride(this.optionsManager.get(this.iconOverrideOption)); 27660 } 27661 }; 27662 Theme.prototype.setIconOverride = function (iconOverrideHash) { 27663 var iconClassesCopy; 27664 var buttonName; 27665 if ($.isPlainObject(iconOverrideHash)) { 27666 iconClassesCopy = $.extend({}, this.iconClasses); 27667 for (buttonName in iconOverrideHash) { 27668 iconClassesCopy[buttonName] = this.applyIconOverridePrefix(iconOverrideHash[buttonName]); 27669 } 27670 this.iconClasses = iconClassesCopy; 27671 } 27672 else if (iconOverrideHash === false) { 27673 this.iconClasses = {}; 27674 } 27675 }; 27676 Theme.prototype.applyIconOverridePrefix = function (className) { 27677 var prefix = this.iconOverridePrefix; 27678 if (prefix && className.indexOf(prefix) !== 0) { 27679 className = prefix + className; 27680 } 27681 return className; 27682 }; 27683 Theme.prototype.getClass = function (key) { 27684 return this.classes[key] || ''; 27685 }; 27686 Theme.prototype.getIconClass = function (buttonName) { 27687 var className = this.iconClasses[buttonName]; 27688 if (className) { 27689 return this.baseIconClass + ' ' + className; 27690 } 27691 return ''; 27692 }; 27693 Theme.prototype.getCustomButtonIconClass = function (customButtonProps) { 27694 var className; 27695 if (this.iconOverrideCustomButtonOption) { 27696 className = customButtonProps[this.iconOverrideCustomButtonOption]; 27697 if (className) { 27698 return this.baseIconClass + ' ' + this.applyIconOverridePrefix(className); 27699 } 27700 } 27701 return ''; 27702 }; 27703 return Theme; 27704}()); 27705exports.default = Theme; 27706Theme.prototype.classes = {}; 27707Theme.prototype.iconClasses = {}; 27708Theme.prototype.baseIconClass = ''; 27709Theme.prototype.iconOverridePrefix = ''; 27710 27711 27712/***/ }), 27713/* 20 */ 27714/***/ (function(module, exports, __webpack_require__) { 27715 27716Object.defineProperty(exports, "__esModule", { value: true }); 27717var $ = __webpack_require__(3); 27718var PromiseStub = { 27719 construct: function (executor) { 27720 var deferred = $.Deferred(); 27721 var promise = deferred.promise(); 27722 if (typeof executor === 'function') { 27723 executor(function (val) { 27724 deferred.resolve(val); 27725 attachImmediatelyResolvingThen(promise, val); 27726 }, function () { 27727 deferred.reject(); 27728 attachImmediatelyRejectingThen(promise); 27729 }); 27730 } 27731 return promise; 27732 }, 27733 resolve: function (val) { 27734 var deferred = $.Deferred().resolve(val); 27735 var promise = deferred.promise(); 27736 attachImmediatelyResolvingThen(promise, val); 27737 return promise; 27738 }, 27739 reject: function () { 27740 var deferred = $.Deferred().reject(); 27741 var promise = deferred.promise(); 27742 attachImmediatelyRejectingThen(promise); 27743 return promise; 27744 } 27745}; 27746exports.default = PromiseStub; 27747function attachImmediatelyResolvingThen(promise, val) { 27748 promise.then = function (onResolve) { 27749 if (typeof onResolve === 'function') { 27750 return PromiseStub.resolve(onResolve(val)); 27751 } 27752 return promise; 27753 }; 27754} 27755function attachImmediatelyRejectingThen(promise) { 27756 promise.then = function (onResolve, onReject) { 27757 if (typeof onReject === 'function') { 27758 onReject(); 27759 } 27760 return promise; 27761 }; 27762} 27763 27764 27765/***/ }), 27766/* 21 */ 27767/***/ (function(module, exports, __webpack_require__) { 27768 27769Object.defineProperty(exports, "__esModule", { value: true }); 27770var $ = __webpack_require__(3);
27771var exportHooks = __webpack_require__(16); 27772var EmitterMixin_1 = __webpack_require__(11); 27773var ListenerMixin_1 = __webpack_require__(7); 27774exportHooks.touchMouseIgnoreWait = 500; 27775var globalEmitter = null; 27776var neededCount = 0; 27777/* 27778Listens to document and window-level user-interaction events, like touch events and mouse events, 27779and fires these events as-is to whoever is observing a GlobalEmitter. 27780Best when used as a singleton via GlobalEmitter.get() 27781 27782Normalizes mouse/touch events. For examples: 27783- ignores the the simulated mouse events that happen after a quick tap: mousemove+mousedown+mouseup+click 27784- compensates for various buggy scenarios where a touchend does not fire 27785*/ 27786var GlobalEmitter = /** @class */ (function () { 27787 function GlobalEmitter() { 27788 this.isTouching = false; 27789 this.mouseIgnoreDepth = 0; 27790 } 27791 // gets the singleton 27792 GlobalEmitter.get = function () { 27793 if (!globalEmitter) { 27794 globalEmitter = new GlobalEmitter(); 27795 globalEmitter.bind(); 27796 } 27797 return globalEmitter; 27798 }; 27799 // called when an object knows it will need a GlobalEmitter in the near future. 27800 GlobalEmitter.needed = function () { 27801 GlobalEmitter.get(); // ensures globalEmitter 27802 neededCount++; 27803 }; 27804 // called when the object that originally called needed() doesn't need a GlobalEmitter anymore. 27805 GlobalEmitter.unneeded = function () { 27806 neededCount--; 27807 if (!neededCount) { 27808 globalEmitter.unbind(); 27809 globalEmitter = null; 27810 } 27811 }; 27812 GlobalEmitter.prototype.bind = function () { 27813 var _this = this; 27814 this.listenTo($(document), { 27815 touchstart: this.handleTouchStart, 27816 touchcancel: this.handleTouchCancel, 27817 touchend: this.handleTouchEnd, 27818 mousedown: this.handleMouseDown, 27819 mousemove: this.handleMouseMove, 27820 mouseup: this.handleMouseUp, 27821 click: this.handleClick, 27822 selectstart: this.handleSelectStart, 27823 contextmenu: this.handleContextMenu 27824 }); 27825 // because we need to call preventDefault 27826 // because https://www.chromestatus.com/features/5093566007214080 27827 // TODO: investigate performance because this is a global handler 27828 window.addEventListener('touchmove', this.handleTouchMoveProxy = function (ev) { 27829 _this.handleTouchMove($.Event(ev)); 27830 }, { passive: false } // allows preventDefault() 27831 ); 27832 // attach a handler to get called when ANY scroll action happens on the page. 27833 // this was impossible to do with normal on/off because 'scroll' doesn't bubble. 27834 // http://stackoverflow.com/a/32954565/96342 27835 window.addEventListener('scroll', this.handleScrollProxy = function (ev) { 27836 _this.handleScroll($.Event(ev)); 27837 }, true // useCapture 27838 ); 27839 }; 27840 GlobalEmitter.prototype.unbind = function () { 27841 this.stopListeningTo($(document)); 27842 window.removeEventListener('touchmove', this.handleTouchMoveProxy); 27843 window.removeEventListener('scroll', this.handleScrollProxy, true // useCapture 27844 ); 27845 }; 27846 // Touch Handlers 27847 // ----------------------------------------------------------------------------------------------------------------- 27848 GlobalEmitter.prototype.handleTouchStart = function (ev) { 27849 // if a previous touch interaction never ended with a touchend, then implicitly end it, 27850 // but since a new touch interaction is about to begin, don't start the mouse ignore period. 27851 this.stopTouch(ev, true); // skipMouseIgnore=true 27852 this.isTouching = true; 27853 this.trigger('touchstart', ev); 27854 }; 27855 GlobalEmitter.prototype.handleTouchMove = function (ev) { 27856 if (this.isTouching) { 27857 this.trigger('touchmove', ev); 27858 } 27859 }; 27860 GlobalEmitter.prototype.handleTouchCancel = function (ev) { 27861 if (this.isTouching) { 27862 this.trigger('touchcancel', ev); 27863 // Have touchcancel fire an artificial touchend. That way, handlers won't need to listen to both. 27864 // If touchend fires later, it won't have any effect b/c isTouching will be false. 27865 this.stopTouch(ev); 27866 } 27867 }; 27868 GlobalEmitter.prototype.handleTouchEnd = function (ev) { 27869 this.stopTouch(ev); 27870 }; 27871 // Mouse Handlers 27872 // ----------------------------------------------------------------------------------------------------------------- 27873 GlobalEmitter.prototype.handleMouseDown = function (ev) { 27874 if (!this.shouldIgnoreMouse()) { 27875 this.trigger('mousedown', ev); 27876 } 27877 }; 27878 GlobalEmitter.prototype.handleMouseMove = function (ev) { 27879 if (!this.shouldIgnoreMouse()) { 27880 this.trigger('mousemove', ev); 27881 } 27882 }; 27883 GlobalEmitter.prototype.handleMouseUp = function (ev) { 27884 if (!this.shouldIgnoreMouse()) { 27885 this.trigger('mouseup', ev); 27886 } 27887 }; 27888 GlobalEmitter.prototype.handleClick = function (ev) { 27889 if (!this.shouldIgnoreMouse()) { 27890 this.trigger('click', ev); 27891 } 27892 }; 27893 // Misc Handlers 27894 // ----------------------------------------------------------------------------------------------------------------- 27895 GlobalEmitter.prototype.handleSelectStart = function (ev) { 27896 this.trigger('selectstart', ev); 27897 }; 27898 GlobalEmitter.prototype.handleContextMenu = function (ev) { 27899 this.trigger('contextmenu', ev); 27900 }; 27901 GlobalEmitter.prototype.handleScroll = function (ev) { 27902 this.trigger('scroll', ev); 27903 }; 27904 // Utils 27905 // ----------------------------------------------------------------------------------------------------------------- 27906 GlobalEmitter.prototype.stopTouch = function (ev, skipMouseIgnore) { 27907 if (skipMouseIgnore === void 0) { skipMouseIgnore = false; } 27908 if (this.isTouching) { 27909 this.isTouching = false;
27910 this.trigger('touchend', ev); 27911 if (!skipMouseIgnore) { 27912 this.startTouchMouseIgnore(); 27913 } 27914 } 27915 }; 27916 GlobalEmitter.prototype.startTouchMouseIgnore = function () { 27917 var _this = this; 27918 var wait = exportHooks.touchMouseIgnoreWait; 27919 if (wait) { 27920 this.mouseIgnoreDepth++; 27921 setTimeout(function () { 27922 _this.mouseIgnoreDepth--; 27923 }, wait); 27924 } 27925 }; 27926 GlobalEmitter.prototype.shouldIgnoreMouse = function () { 27927 return this.isTouching || Boolean(this.mouseIgnoreDepth); 27928 }; 27929 return GlobalEmitter; 27930}()); 27931exports.default = GlobalEmitter; 27932ListenerMixin_1.default.mixInto(GlobalEmitter); 27933EmitterMixin_1.default.mixInto(GlobalEmitter); 27934 27935 27936/***/ }), 27937/* 22 */ 27938/***/ (function(module, exports, __webpack_require__) { 27939 27940Object.defineProperty(exports, "__esModule", { value: true }); 27941var exportHooks = __webpack_require__(16); 27942exports.viewHash = {}; 27943exportHooks.views = exports.viewHash; 27944function defineView(viewName, viewConfig) { 27945 exports.viewHash[viewName] = viewConfig; 27946} 27947exports.defineView = defineView; 27948function getViewConfig(viewName) { 27949 return exports.viewHash[viewName]; 27950} 27951exports.getViewConfig = getViewConfig; 27952 27953 27954/***/ }), 27955/* 23 */ 27956/***/ (function(module, exports, __webpack_require__) { 27957 27958Object.defineProperty(exports, "__esModule", { value: true }); 27959var tslib_1 = __webpack_require__(2); 27960var util_1 = __webpack_require__(4); 27961var DragListener_1 = __webpack_require__(54); 27962/* Tracks mouse movements over a component and raises events about which hit the mouse is over. 27963------------------------------------------------------------------------------------------------------------------------ 27964options: 27965- subjectEl 27966- subjectCenter 27967*/ 27968var HitDragListener = /** @class */ (function (_super) { 27969 tslib_1.__extends(HitDragListener, _super); 27970 function HitDragListener(component, options) { 27971 var _this = _super.call(this, options) || this; 27972 _this.component = component; 27973 return _this; 27974 } 27975 // Called when drag listening starts (but a real drag has not necessarily began). 27976 // ev might be undefined if dragging was started manually. 27977 HitDragListener.prototype.handleInteractionStart = function (ev) { 27978 var subjectEl = this.subjectEl; 27979 var subjectRect; 27980 var origPoint; 27981 var point; 27982 this.component.hitsNeeded(); 27983 this.computeScrollBounds(); // for autoscroll 27984 if (ev) { 27985 origPoint = { left: util_1.getEvX(ev), top: util_1.getEvY(ev) }; 27986 point = origPoint; 27987 // constrain the point to bounds of the element being dragged 27988 if (subjectEl) { 27989 subjectRect = util_1.getOuterRect(subjectEl); // used for centering as well 27990 point = util_1.constrainPoint(point, subjectRect); 27991 } 27992 this.origHit = this.queryHit(point.left, point.top); 27993 // treat the center of the subject as the collision point? 27994 if (subjectEl && this.options.subjectCenter) { 27995 // only consider the area the subject overlaps the hit. best for large subjects. 27996 // TODO: skip this if hit didn't supply left/right/top/bottom 27997 if (this.origHit) { 27998 subjectRect = util_1.intersectRects(this.origHit, subjectRect) || 27999 subjectRect; // in case there is no intersection 28000 } 28001 point = util_1.getRectCenter(subjectRect); 28002 } 28003 this.coordAdjust = util_1.diffPoints(point, origPoint); // point - origPoint 28004 } 28005 else { 28006 this.origHit = null; 28007 this.coordAdjust = null; 28008 } 28009 // call the super-method. do it after origHit has been computed 28010 _super.prototype.handleInteractionStart.call(this, ev); 28011 }; 28012 // Called when the actual drag has started 28013 HitDragListener.prototype.handleDragStart = function (ev) { 28014 var hit; 28015 _super.prototype.handleDragStart.call(this, ev); 28016 // might be different from this.origHit if the min-distance is large 28017 hit = this.queryHit(util_1.getEvX(ev), util_1.getEvY(ev)); 28018 // report the initial hit the mouse is over 28019 // especially important if no min-distance and drag starts immediately 28020 if (hit) { 28021 this.handleHitOver(hit); 28022 } 28023 }; 28024 // Called when the drag moves 28025 HitDragListener.prototype.handleDrag = function (dx, dy, ev) { 28026 var hit; 28027 _super.prototype.handleDrag.call(this, dx, dy, ev); 28028 hit = this.queryHit(util_1.getEvX(ev), util_1.getEvY(ev)); 28029 if (!isHitsEqual(hit, this.hit)) { 28030 if (this.hit) { 28031 this.handleHitOut(); 28032 } 28033 if (hit) { 28034 this.handleHitOver(hit); 28035 } 28036 } 28037 }; 28038 // Called when dragging has been stopped 28039 HitDragListener.prototype.handleDragEnd = function (ev) { 28040 this.handleHitDone(); 28041 _super.prototype.handleDragEnd.call(this, ev); 28042 }; 28043 // Called when a the mouse has just moved over a new hit 28044 HitDragListener.prototype.handleHitOver = function (hit) { 28045 var isOrig = isHitsEqual(hit, this.origHit); 28046 this.hit = hit; 28047 this.trigger('hitOver', this.hit, isOrig, this.origHit); 28048 }; 28049 // Called when the mouse has just moved out of a hit 28050 HitDragListener.prototype.handleHitOut = function () { 28051 if (this.hit) { 28052 this.trigger('hitOut', this.hit); 28053 this.handleHitDone(); 28054 this.hit = null; 28055 } 28056 }; 28057 // Called after a hitOut. Also called before a dragStop 28058 HitDragListener.prototype.handleHitDone = function () { 28059 if (this.hit) { 28060 this.trigger('hitDone', this.hit); 28061 } 28062 }; 28063 // Called when the interaction ends, whether there was a real drag or not 28064 HitDragListener.prototype.handleInteractionEnd = function (ev, isCancelled) { 28065 _super.prototype.handleInteractionEnd.call(this, ev, isCancelled); 28066 this.origHit = null; 28067 this.hit = null; 28068 this.component.hitsNotNeeded(); 28069 }; 28070 // Called when scrolling has stopped, whether through auto scroll, or the user scrolling 28071 HitDragListener.prototype.handleScrollEnd = function () { 28072 _super.prototype.handleScrollEnd.call(this); 28073 // hits' absolute positions will be in new places after a user's scroll. 28074 // HACK for recomputing. 28075 if (this.isDragging) { 28076 this.component.releaseHits(); 28077 this.component.prepareHits(); 28078 } 28079 }; 28080 // Gets the hit underneath the coordinates for the given mouse event 28081 HitDragListener.prototype.queryHit = function (left, top) { 28082 if (this.coordAdjust) { 28083 left += this.coordAdjust.left; 28084 top += this.coordAdjust.top; 28085 } 28086 return this.component.queryHit(left, top); 28087 }; 28088 return HitDragListener; 28089}(DragListener_1.default)); 28090exports.default = HitDragListener; 28091// Returns `true` if the hits are identically equal. `false` otherwise. Must be from the same component. 28092// Two null values will be considered equal, as two "out of the component" states are the same. 28093function isHitsEqual(hit0, hit1) { 28094 if (!hit0 && !hit1) { 28095 return true; 28096 } 28097 if (hit0 && hit1) { 28098 return hit0.component === hit1.component && 28099 isHitPropsWithin(hit0, hit1) && 28100 isHitPropsWithin(hit1, hit0); // ensures all props are identical 28101 } 28102 return false;
28103} 28104// Returns true if all of subHit's non-standard properties are within superHit 28105function isHitPropsWithin(subHit, superHit) { 28106 for (var propName in subHit) { 28107 if (!/^(component|left|right|top|bottom)$/.test(propName)) { 28108 if (subHit[propName] !== superHit[propName]) { 28109 return false; 28110 } 28111 } 28112 } 28113 return true; 28114} 28115 28116 28117/***/ }), 28118/* 24 */, 28119/* 25 */, 28120/* 26 */, 28121/* 27 */, 28122/* 28 */, 28123/* 29 */, 28124/* 30 */, 28125/* 31 */ 28126/***/ (function(module, exports, __webpack_require__) { 28127 28128Object.defineProperty(exports, "__esModule", { value: true }); 28129var $ = __webpack_require__(3); 28130var moment = __webpack_require__(0); 28131var exportHooks = __webpack_require__(16); 28132var options_1 = __webpack_require__(32); 28133var util_1 = __webpack_require__(4); 28134exports.localeOptionHash = {}; 28135exportHooks.locales = exports.localeOptionHash; 28136// NOTE: can't guarantee any of these computations will run because not every locale has datepicker 28137// configs, so make sure there are English fallbacks for these in the defaults file. 28138var dpComputableOptions = { 28139 buttonText: function (dpOptions) { 28140 return { 28141 // the translations sometimes wrongly contain HTML entities 28142 prev: util_1.stripHtmlEntities(dpOptions.prevText), 28143 next: util_1.stripHtmlEntities(dpOptions.nextText), 28144 today: util_1.stripHtmlEntities(dpOptions.currentText) 28145 }; 28146 }, 28147 // Produces format strings like "MMMM YYYY" -> "September 2014" 28148 monthYearFormat: function (dpOptions) { 28149 return dpOptions.showMonthAfterYear ? 28150 'YYYY[' + dpOptions.yearSuffix + '] MMMM' : 28151 'MMMM YYYY[' + dpOptions.yearSuffix + ']'; 28152 } 28153}; 28154var momComputableOptions = { 28155 // Produces format strings like "ddd M/D" -> "Fri 9/15" 28156 dayOfMonthFormat: function (momOptions, fcOptions) { 28157 var format = momOptions.longDateFormat('l'); // for the format like "M/D/YYYY" 28158 // strip the year off the edge, as well as other misc non-whitespace chars 28159 format = format.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g, ''); 28160 if (fcOptions.isRTL) { 28161 format += ' ddd'; // for RTL, add day-of-week to end 28162 } 28163 else { 28164 format = 'ddd ' + format; // for LTR, add day-of-week to beginning 28165 } 28166 return format; 28167 }, 28168 // Produces format strings like "h:mma" -> "6:00pm" 28169 mediumTimeFormat: function (momOptions) { 28170 return momOptions.longDateFormat('LT') 28171 .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand 28172 }, 28173 // Produces format strings like "h(:mm)a" -> "6pm" / "6:30pm" 28174 smallTimeFormat: function (momOptions) { 28175 return momOptions.longDateFormat('LT') 28176 .replace(':mm', '(:mm)') 28177 .replace(/(\Wmm)$/, '($1)') // like above, but for foreign locales 28178 .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand 28179 }, 28180 // Produces format strings like "h(:mm)t" -> "6p" / "6:30p" 28181 extraSmallTimeFormat: function (momOptions) { 28182 return momOptions.longDateFormat('LT') 28183 .replace(':mm', '(:mm)') 28184 .replace(/(\Wmm)$/, '($1)') // like above, but for foreign locales 28185 .replace(/\s*a$/i, 't'); // convert to AM/PM/am/pm to lowercase one-letter. remove any spaces beforehand 28186 }, 28187 // Produces format strings like "ha" / "H" -> "6pm" / "18" 28188 hourFormat: function (momOptions) { 28189 return momOptions.longDateFormat('LT') 28190 .replace(':mm', '') 28191 .replace(/(\Wmm)$/, '') // like above, but for foreign locales 28192 .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand 28193 }, 28194 // Produces format strings like "h:mm" -> "6:30" (with no AM/PM) 28195 noMeridiemTimeFormat: function (momOptions) { 28196 return momOptions.longDateFormat('LT') 28197 .replace(/\s*a$/i, ''); // remove trailing AM/PM 28198 } 28199}; 28200// options that should be computed off live calendar options (considers override options) 28201// TODO: best place for this? related to locale? 28202// TODO: flipping text based on isRTL is a bad idea because the CSS `direction` might want to handle it 28203var instanceComputableOptions = {
28204 // Produces format strings for results like "Mo 16" 28205 smallDayDateFormat: function (options) { 28206 return options.isRTL ? 28207 'D dd' : 28208 'dd D'; 28209 }, 28210 // Produces format strings for results like "Wk 5" 28211 weekFormat: function (options) { 28212 return options.isRTL ? 28213 'w[ ' + options.weekNumberTitle + ']' : 28214 '[' + options.weekNumberTitle + ' ]w'; 28215 }, 28216 // Produces format strings for results like "Wk5" 28217 smallWeekFormat: function (options) { 28218 return options.isRTL ? 28219 'w[' + options.weekNumberTitle + ']' : 28220 '[' + options.weekNumberTitle + ']w'; 28221 } 28222}; 28223// TODO: make these computable properties in optionsManager 28224function populateInstanceComputableOptions(options) { 28225 $.each(instanceComputableOptions, function (name, func) { 28226 if (options[name] == null) { 28227 options[name] = func(options); 28228 } 28229 }); 28230} 28231exports.populateInstanceComputableOptions = populateInstanceComputableOptions; 28232// Initialize jQuery UI datepicker translations while using some of the translations 28233// Will set this as the default locales for datepicker. 28234function datepickerLocale(localeCode, dpLocaleCode, dpOptions) { 28235 // get the FullCalendar internal option hash for this locale. create if necessary 28236 var fcOptions = exports.localeOptionHash[localeCode] || (exports.localeOptionHash[localeCode] = {}); 28237 // transfer some simple options from datepicker to fc 28238 fcOptions.isRTL = dpOptions.isRTL; 28239 fcOptions.weekNumberTitle = dpOptions.weekHeader; 28240 // compute some more complex options from datepicker 28241 $.each(dpComputableOptions, function (name, func) { 28242 fcOptions[name] = func(dpOptions); 28243 }); 28244 var jqDatePicker = $.datepicker; 28245 // is jQuery UI Datepicker is on the page? 28246 if (jqDatePicker) { 28247 // Register the locale data. 28248 // FullCalendar and MomentJS use locale codes like "pt-br" but Datepicker 28249 // does it like "pt-BR" or if it doesn't have the locale, maybe just "pt". 28250 // Make an alias so the locale can be referenced either way. 28251 jqDatePicker.regional[dpLocaleCode] = 28252 jqDatePicker.regional[localeCode] = // alias 28253 dpOptions; 28254 // Alias 'en' to the default locale data. Do this every time. 28255 jqDatePicker.regional.en = jqDatePicker.regional['']; 28256 // Set as Datepicker's global defaults. 28257 jqDatePicker.setDefaults(dpOptions); 28258 } 28259} 28260exports.datepickerLocale = datepickerLocale; 28261// Sets FullCalendar-specific translations. Will set the locales as the global default. 28262function locale(localeCode, newFcOptions) { 28263 var fcOptions; 28264 var momOptions; 28265 // get the FullCalendar internal option hash for this locale. create if necessary 28266 fcOptions = exports.localeOptionHash[localeCode] || (exports.localeOptionHash[localeCode] = {}); 28267 // provided new options for this locales? merge them in 28268 if (newFcOptions) { 28269 fcOptions = exports.localeOptionHash[localeCode] = options_1.mergeOptions([fcOptions, newFcOptions]); 28270 } 28271 // compute locale options that weren't defined. 28272 // always do this. newFcOptions can be undefined when initializing from i18n file, 28273 // so no way to tell if this is an initialization or a default-setting. 28274 momOptions = getMomentLocaleData(localeCode); // will fall back to en 28275 $.each(momComputableOptions, function (name, func) { 28276 if (fcOptions[name] == null) { 28277 fcOptions[name] = (func)(momOptions, fcOptions); 28278 } 28279 }); 28280 // set it as the default locale for FullCalendar 28281 options_1.globalDefaults.locale = localeCode; 28282} 28283exports.locale = locale; 28284// Returns moment's internal locale data. If doesn't exist, returns English. 28285function getMomentLocaleData(localeCode) { 28286 return moment.localeData(localeCode) || moment.localeData('en'); 28287} 28288exports.getMomentLocaleData = getMomentLocaleData; 28289// Initialize English by forcing computation of moment-derived options. 28290// Also, sets it as the default. 28291locale('en', options_1.englishDefaults); 28292 28293 28294/***/ }), 28295/* 32 */ 28296/***/ (function(module, exports, __webpack_require__) { 28297 28298Object.defineProperty(exports, "__esModule", { value: true }); 28299var util_1 = __webpack_require__(4); 28300exports.globalDefaults = { 28301 titleRangeSeparator: ' \u2013 ', 28302 monthYearFormat: 'MMMM YYYY', 28303 defaultTimedEventDuration: '02:00:00', 28304 defaultAllDayEventDuration: { days: 1 }, 28305 forceEventDuration: false, 28306 nextDayThreshold: '09:00:00', 28307 // display 28308 columnHeader: true, 28309 defaultView: 'month', 28310 aspectRatio: 1.35, 28311 header: { 28312 left: 'title', 28313 center: '', 28314 right: 'today prev,next' 28315 }, 28316 weekends: true, 28317 weekNumbers: false, 28318 weekNumberTitle: 'W', 28319 weekNumberCalculation: 'local', 28320 // editable: false, 28321 // nowIndicator: false, 28322 scrollTime: '06:00:00', 28323 minTime: '00:00:00', 28324 maxTime: '24:00:00', 28325 showNonCurrentDates: true, 28326 // event ajax 28327 lazyFetching: true, 28328 startParam: 'start', 28329 endParam: 'end', 28330 timezoneParam: 'timezone', 28331 timezone: false, 28332 // allDayDefault: undefined, 28333 // locale 28334 locale: null, 28335 isRTL: false, 28336 buttonText: { 28337 prev: 'prev', 28338 next: 'next', 28339 prevYear: 'prev year', 28340 nextYear: 'next year', 28341 year: 'year', 28342 today: 'today', 28343 month: 'month', 28344 week: 'week', 28345 day: 'day' 28346 }, 28347 // buttonIcons: null, 28348 allDayText: 'all-day', 28349 // allows setting a min-height to the event segment to prevent short events overlapping each other 28350 agendaEventMinHeight: 0, 28351 // jquery-ui theming 28352 theme: false, 28353 // themeButtonIcons: null, 28354 // eventResizableFromStart: false, 28355 dragOpacity: .75, 28356 dragRevertDuration: 500, 28357 dragScroll: true, 28358 // selectable: false, 28359 unselectAuto: true, 28360 // selectMinDistance: 0, 28361 dropAccept: '*', 28362 eventOrder: 'title', 28363 // eventRenderWait: null, 28364 eventLimit: false, 28365 eventLimitText: 'more', 28366 eventLimitClick: 'popover', 28367 dayPopoverFormat: 'LL', 28368 handleWindowResize: true, 28369 windowResizeDelay: 100, 28370 longPressDelay: 1000 28371}; 28372exports.englishDefaults = { 28373 dayPopoverFormat: 'dddd, MMMM D' 28374}; 28375exports.rtlDefaults = { 28376 header: { 28377 left: 'next,prev today', 28378 center: '', 28379 right: 'title' 28380 }, 28381 buttonIcons: { 28382 prev: 'right-single-arrow', 28383 next: 'left-single-arrow', 28384 prevYear: 'right-double-arrow', 28385 nextYear: 'left-double-arrow' 28386 }, 28387 themeButtonIcons: { 28388 prev: 'circle-triangle-e', 28389 next: 'circle-triangle-w', 28390 nextYear: 'seek-prev', 28391 prevYear: 'seek-next' 28392 } 28393}; 28394var complexOptions = [ 28395 'header', 28396 'footer', 28397 'buttonText', 28398 'buttonIcons', 28399 'themeButtonIcons' 28400]; 28401// Merges an array of option objects into a single object 28402function mergeOptions(optionObjs) { 28403 return util_1.mergeProps(optionObjs, complexOptions); 28404} 28405exports.mergeOptions = mergeOptions; 28406 28407 28408/***/ }), 28409/* 33 */ 28410/***/ (function(module, exports, __webpack_require__) { 28411 28412Object.defineProperty(exports, "__esModule", { value: true }); 28413var tslib_1 = __webpack_require__(2); 28414var util_1 = __webpack_require__(4); 28415// Class that all other classes will inherit from 28416var Class = /** @class */ (function () { 28417 function Class() { 28418 } 28419 // Called on a class to create a subclass. 28420 // LIMITATION: cannot provide a constructor! 28421 Class.extend = function (members) { 28422 var SubClass = /** @class */ (function (_super) { 28423 tslib_1.__extends(SubClass, _super); 28424 function SubClass() { 28425 return _super !== null && _super.apply(this, arguments) || this; 28426 } 28427 return SubClass; 28428 }(this)); 28429 util_1.copyOwnProps(members, SubClass.prototype); 28430 return SubClass; 28431 }; 28432 // Adds new member variables/methods to the class's prototype. 28433 // Can be called with another class, or a plain object hash containing new members. 28434 Class.mixin = function (members) { 28435 util_1.copyOwnProps(members, this.prototype); 28436 }; 28437 return Class; 28438}()); 28439exports.default = Class; 28440 28441
28442/***/ }), 28443/* 34 */ 28444/***/ (function(module, exports, __webpack_require__) { 28445 28446Object.defineProperty(exports, "__esModule", { value: true }); 28447var $ = __webpack_require__(3); 28448var ParsableModelMixin_1 = __webpack_require__(208); 28449var EventDef = /** @class */ (function () { 28450 function EventDef(source) { 28451 this.source = source; 28452 this.className = []; 28453 this.miscProps = {}; 28454 } 28455 EventDef.parse = function (rawInput, source) { 28456 var def = new this(source); 28457 if (def.applyProps(rawInput)) { 28458 return def; 28459 } 28460 return false; 28461 }; 28462 EventDef.normalizeId = function (id) { 28463 return String(id); 28464 }; 28465 EventDef.generateId = function () { 28466 return '_fc' + (EventDef.uuid++); 28467 }; 28468 EventDef.prototype.clone = function () { 28469 var copy = new this.constructor(this.source); 28470 copy.id = this.id; 28471 copy.rawId = this.rawId; 28472 copy.uid = this.uid; // not really unique anymore :( 28473 EventDef.copyVerbatimStandardProps(this, copy); 28474 copy.className = this.className.slice(); // copy 28475 copy.miscProps = $.extend({}, this.miscProps); 28476 return copy; 28477 }; 28478 EventDef.prototype.hasInverseRendering = function () { 28479 return this.getRendering() === 'inverse-background'; 28480 }; 28481 EventDef.prototype.hasBgRendering = function () { 28482 var rendering = this.getRendering(); 28483 return rendering === 'inverse-background' || rendering === 'background'; 28484 }; 28485 EventDef.prototype.getRendering = function () { 28486 if (this.rendering != null) { 28487 return this.rendering; 28488 } 28489 return this.source.rendering; 28490 }; 28491 EventDef.prototype.getConstraint = function () { 28492 if (this.constraint != null) { 28493 return this.constraint; 28494 } 28495 if (this.source.constraint != null) { 28496 return this.source.constraint; 28497 } 28498 return this.source.calendar.opt('eventConstraint'); // what about View option? 28499 }; 28500 EventDef.prototype.getOverlap = function () { 28501 if (this.overlap != null) { 28502 return this.overlap; 28503 } 28504 if (this.source.overlap != null) { 28505 return this.source.overlap; 28506 } 28507 return this.source.calendar.opt('eventOverlap'); // what about View option? 28508 }; 28509 EventDef.prototype.isStartExplicitlyEditable = function () { 28510 if (this.startEditable != null) { 28511 return this.startEditable; 28512 } 28513 return this.source.startEditable; 28514 }; 28515 EventDef.prototype.isDurationExplicitlyEditable = function () { 28516 if (this.durationEditable != null) { 28517 return this.durationEditable; 28518 } 28519 return this.source.durationEditable; 28520 }; 28521 EventDef.prototype.isExplicitlyEditable = function () { 28522 if (this.editable != null) { 28523 return this.editable; 28524 } 28525 return this.source.editable; 28526 }; 28527 EventDef.prototype.toLegacy = function () { 28528 var obj = $.extend({}, this.miscProps); 28529 obj._id = this.uid; 28530 obj.source = this.source; 28531 obj.className = this.className.slice(); // copy 28532 obj.allDay = this.isAllDay(); 28533 if (this.rawId != null) { 28534 obj.id = this.rawId; 28535 } 28536 EventDef.copyVerbatimStandardProps(this, obj); 28537 return obj; 28538 }; 28539 EventDef.prototype.applyManualStandardProps = function (rawProps) { 28540 if (rawProps.id != null) { 28541 this.id = EventDef.normalizeId((this.rawId = rawProps.id)); 28542 } 28543 else { 28544 this.id = EventDef.generateId(); 28545 } 28546 if (rawProps._id != null) { 28547 this.uid = String(rawProps._id); 28548 } 28549 else { 28550 this.uid = EventDef.generateId(); 28551 } 28552 // TODO: converge with EventSource 28553 if ($.isArray(rawProps.className)) { 28554 this.className = rawProps.className; 28555 } 28556 if (typeof rawProps.className === 'string') { 28557 this.className = rawProps.className.split(/\s+/); 28558 } 28559 return true; 28560 }; 28561 EventDef.prototype.applyMiscProps = function (rawProps) { 28562 $.extend(this.miscProps, rawProps); 28563 }; 28564 EventDef.uuid = 0; 28565 EventDef.defineStandardProps = ParsableModelMixin_1.default.defineStandardProps; 28566 EventDef.copyVerbatimStandardProps = ParsableModelMixin_1.default.copyVerbatimStandardProps; 28567 return EventDef; 28568}()); 28569exports.default = EventDef; 28570ParsableModelMixin_1.default.mixInto(EventDef); 28571EventDef.defineStandardProps({ 28572 // not automatically assigned (`false`) 28573 _id: false, 28574 id: false, 28575 className: false, 28576 source: false, 28577 // automatically assigned (`true`) 28578 title: true, 28579 url: true, 28580 rendering: true, 28581 constraint: true, 28582 overlap: true, 28583 editable: true, 28584 startEditable: true, 28585 durationEditable: true, 28586 color: true, 28587 backgroundColor: true, 28588 borderColor: true, 28589 textColor: true 28590}); 28591 28592 28593/***/ }), 28594/* 35 */ 28595/***/ (function(module, exports, __webpack_require__) { 28596 28597Object.defineProperty(exports, "__esModule", { value: true }); 28598var EventRange_1 = __webpack_require__(211); 28599var EventFootprint_1 = __webpack_require__(36); 28600var ComponentFootprint_1 = __webpack_require__(12); 28601function eventDefsToEventInstances(eventDefs, unzonedRange) { 28602 var eventInstances = []; 28603 var i; 28604 for (i = 0; i < eventDefs.length; i++) { 28605 eventInstances.push.apply(eventInstances, // append 28606 eventDefs[i].buildInstances(unzonedRange)); 28607 } 28608 return eventInstances; 28609} 28610exports.eventDefsToEventInstances = eventDefsToEventInstances; 28611function eventInstanceToEventRange(eventInstance) { 28612 return new EventRange_1.default(eventInstance.dateProfile.unzonedRange, eventInstance.def, eventInstance); 28613} 28614exports.eventInstanceToEventRange = eventInstanceToEventRange; 28615function eventRangeToEventFootprint(eventRange) { 28616 return new EventFootprint_1.default(new ComponentFootprint_1.default(eventRange.unzonedRange, eventRange.eventDef.isAllDay()), eventRange.eventDef, eventRange.eventInstance // might not exist 28617 ); 28618} 28619exports.eventRangeToEventFootprint = eventRangeToEventFootprint; 28620function eventInstanceToUnzonedRange(eventInstance) { 28621 return eventInstance.dateProfile.unzonedRange; 28622} 28623exports.eventInstanceToUnzonedRange = eventInstanceToUnzonedRange; 28624function eventFootprintToComponentFootprint(eventFootprint) { 28625 return eventFootprint.componentFootprint; 28626} 28627exports.eventFootprintToComponentFootprint = eventFootprintToComponentFootprint; 28628 28629 28630/***/ }), 28631/* 36 */
28632/***/ (function(module, exports) { 28633 28634Object.defineProperty(exports, "__esModule", { value: true }); 28635var EventFootprint = /** @class */ (function () { 28636 function EventFootprint(componentFootprint, eventDef, eventInstance) { 28637 this.componentFootprint = componentFootprint; 28638 this.eventDef = eventDef; 28639 if (eventInstance) { 28640 this.eventInstance = eventInstance; 28641 } 28642 } 28643 EventFootprint.prototype.getEventLegacy = function () { 28644 return (this.eventInstance || this.eventDef).toLegacy(); 28645 }; 28646 return EventFootprint; 28647}()); 28648exports.default = EventFootprint; 28649 28650 28651/***/ }), 28652/* 37 */ 28653/***/ (function(module, exports, __webpack_require__) { 28654 28655Object.defineProperty(exports, "__esModule", { value: true }); 28656var util_1 = __webpack_require__(4); 28657var EventDateProfile_1 = __webpack_require__(17); 28658var EventDef_1 = __webpack_require__(34); 28659var EventDefDateMutation_1 = __webpack_require__(50); 28660var SingleEventDef_1 = __webpack_require__(13); 28661var EventDefMutation = /** @class */ (function () { 28662 function EventDefMutation() { 28663 } 28664 EventDefMutation.createFromRawProps = function (eventInstance, rawProps, largeUnit) { 28665 var eventDef = eventInstance.def; 28666 var dateProps = {}; 28667 var standardProps = {}; 28668 var miscProps = {}; 28669 var verbatimStandardProps = {}; 28670 var eventDefId = null; 28671 var className = null; 28672 var propName; 28673 var dateProfile; 28674 var dateMutation; 28675 var defMutation; 28676 for (propName in rawProps) { 28677 if (EventDateProfile_1.default.isStandardProp(propName)) { 28678 dateProps[propName] = rawProps[propName]; 28679 } 28680 else if (eventDef.isStandardProp(propName)) { 28681 standardProps[propName] = rawProps[propName]; 28682 } 28683 else if (eventDef.miscProps[propName] !== rawProps[propName]) { 28684 miscProps[propName] = rawProps[propName]; 28685 } 28686 } 28687 dateProfile = EventDateProfile_1.default.parse(dateProps, eventDef.source); 28688 if (dateProfile) { 28689 dateMutation = EventDefDateMutation_1.default.createFromDiff(eventInstance.dateProfile, dateProfile, largeUnit); 28690 } 28691 if (standardProps.id !== eventDef.id) { 28692 eventDefId = standardProps.id; // only apply if there's a change 28693 } 28694 if (!util_1.isArraysEqual(standardProps.className, eventDef.className)) { 28695 className = standardProps.className; // only apply if there's a change 28696 } 28697 EventDef_1.default.copyVerbatimStandardProps(standardProps, // src 28698 verbatimStandardProps // dest 28699 ); 28700 defMutation = new EventDefMutation(); 28701 defMutation.eventDefId = eventDefId; 28702 defMutation.className = className; 28703 defMutation.verbatimStandardProps = verbatimStandardProps; 28704 defMutation.miscProps = miscProps; 28705 if (dateMutation) { 28706 defMutation.dateMutation = dateMutation; 28707 } 28708 return defMutation; 28709 }; 28710 /* 28711 eventDef assumed to be a SingleEventDef. 28712 returns an undo function. 28713 */ 28714 EventDefMutation.prototype.mutateSingle = function (eventDef) { 28715 var origDateProfile; 28716 if (this.dateMutation) { 28717 origDateProfile = eventDef.dateProfile; 28718 eventDef.dateProfile = this.dateMutation.buildNewDateProfile(origDateProfile, eventDef.source.calendar); 28719 } 28720 // can't undo 28721 // TODO: more DRY with EventDef::applyManualStandardProps 28722 if (this.eventDefId != null) { 28723 eventDef.id = EventDef_1.default.normalizeId((eventDef.rawId = this.eventDefId)); 28724 } 28725 // can't undo 28726 // TODO: more DRY with EventDef::applyManualStandardProps 28727 if (this.className) { 28728 eventDef.className = this.className; 28729 } 28730 // can't undo 28731 if (this.verbatimStandardProps) { 28732 SingleEventDef_1.default.copyVerbatimStandardProps(this.verbatimStandardProps, // src 28733 eventDef // dest 28734 ); 28735 } 28736 // can't undo 28737 if (this.miscProps) { 28738 eventDef.applyMiscProps(this.miscProps); 28739 } 28740 if (origDateProfile) { 28741 return function () { 28742 eventDef.dateProfile = origDateProfile; 28743 }; 28744 } 28745 else { 28746 return function () { }; 28747 } 28748 }; 28749 EventDefMutation.prototype.setDateMutation = function (dateMutation) { 28750 if (dateMutation && !dateMutation.isEmpty()) { 28751 this.dateMutation = dateMutation; 28752 } 28753 else { 28754 this.dateMutation = null; 28755 } 28756 }; 28757 EventDefMutation.prototype.isEmpty = function () { 28758 return !this.dateMutation; 28759 }; 28760 return EventDefMutation; 28761}()); 28762exports.default = EventDefMutation; 28763 28764 28765/***/ }), 28766/* 38 */
28767/***/ (function(module, exports) { 28768 28769Object.defineProperty(exports, "__esModule", { value: true }); 28770exports.default = { 28771 sourceClasses: [], 28772 registerClass: function (EventSourceClass) { 28773 this.sourceClasses.unshift(EventSourceClass); // give highest priority 28774 }, 28775 parse: function (rawInput, calendar) { 28776 var sourceClasses = this.sourceClasses; 28777 var i; 28778 var eventSource; 28779 for (i = 0; i < sourceClasses.length; i++) { 28780 eventSource = sourceClasses[i].parse(rawInput, calendar); 28781 if (eventSource) { 28782 return eventSource; 28783 } 28784 } 28785 } 28786}; 28787 28788 28789/***/ }), 28790/* 39 */ 28791/***/ (function(module, exports, __webpack_require__) { 28792 28793Object.defineProperty(exports, "__esModule", { value: true }); 28794var tslib_1 = __webpack_require__(2); 28795var $ = __webpack_require__(3); 28796var util_1 = __webpack_require__(4); 28797var Class_1 = __webpack_require__(33); 28798/* 28799Embodies a div that has potential scrollbars 28800*/ 28801var Scroller = /** @class */ (function (_super) { 28802 tslib_1.__extends(Scroller, _super); 28803 function Scroller(options) { 28804 var _this = _super.call(this) || this; 28805 options = options || {}; 28806 _this.overflowX = options.overflowX || options.overflow || 'auto'; 28807 _this.overflowY = options.overflowY || options.overflow || 'auto'; 28808 return _this; 28809 } 28810 Scroller.prototype.render = function () { 28811 this.el = this.renderEl(); 28812 this.applyOverflow(); 28813 }; 28814 Scroller.prototype.renderEl = function () { 28815 return (this.scrollEl = $('<div class="fc-scroller"></div>')); 28816 }; 28817 // sets to natural height, unlocks overflow 28818 Scroller.prototype.clear = function () { 28819 this.setHeight('auto'); 28820 this.applyOverflow(); 28821 }; 28822 Scroller.prototype.destroy = function () { 28823 this.el.remove(); 28824 }; 28825 // Overflow 28826 // ----------------------------------------------------------------------------------------------------------------- 28827 Scroller.prototype.applyOverflow = function () { 28828 this.scrollEl.css({ 28829 'overflow-x': this.overflowX, 28830 'overflow-y': this.overflowY 28831 }); 28832 }; 28833 // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'. 28834 // Useful for preserving scrollbar widths regardless of future resizes. 28835 // Can pass in scrollbarWidths for optimization. 28836 Scroller.prototype.lockOverflow = function (scrollbarWidths) { 28837 var overflowX = this.overflowX; 28838 var overflowY = this.overflowY;
28839 scrollbarWidths = scrollbarWidths || this.getScrollbarWidths(); 28840 if (overflowX === 'auto') { 28841 overflowX = (scrollbarWidths.top || scrollbarWidths.bottom || // horizontal scrollbars? 28842 // OR scrolling pane with massless scrollbars? 28843 this.scrollEl[0].scrollWidth - 1 > this.scrollEl[0].clientWidth) ? 'scroll' : 'hidden'; 28844 } 28845 if (overflowY === 'auto') { 28846 overflowY = (scrollbarWidths.left || scrollbarWidths.right || // vertical scrollbars? 28847 // OR scrolling pane with massless scrollbars? 28848 this.scrollEl[0].scrollHeight - 1 > this.scrollEl[0].clientHeight) ? 'scroll' : 'hidden'; 28849 } 28850 this.scrollEl.css({ 'overflow-x': overflowX, 'overflow-y': overflowY }); 28851 }; 28852 // Getters / Setters 28853 // ----------------------------------------------------------------------------------------------------------------- 28854 Scroller.prototype.setHeight = function (height) { 28855 this.scrollEl.height(height); 28856 }; 28857 Scroller.prototype.getScrollTop = function () { 28858 return this.scrollEl.scrollTop(); 28859 }; 28860 Scroller.prototype.setScrollTop = function (top) { 28861 this.scrollEl.scrollTop(top); 28862 }; 28863 Scroller.prototype.getClientWidth = function () { 28864 return this.scrollEl[0].clientWidth; 28865 }; 28866 Scroller.prototype.getClientHeight = function () { 28867 return this.scrollEl[0].clientHeight; 28868 }; 28869 Scroller.prototype.getScrollbarWidths = function () { 28870 return util_1.getScrollbarWidths(this.scrollEl); 28871 }; 28872 return Scroller; 28873}(Class_1.default)); 28874exports.default = Scroller; 28875 28876 28877/***/ }), 28878/* 40 */ 28879/***/ (function(module, exports, __webpack_require__) { 28880 28881Object.defineProperty(exports, "__esModule", { value: true }); 28882var tslib_1 = __webpack_require__(2); 28883var $ = __webpack_require__(3); 28884var util_1 = __webpack_require__(4); 28885var DateComponent_1 = __webpack_require__(219); 28886var GlobalEmitter_1 = __webpack_require__(21); 28887var InteractiveDateComponent = /** @class */ (function (_super) { 28888 tslib_1.__extends(InteractiveDateComponent, _super); 28889 function InteractiveDateComponent(_view, _options) { 28890 var _this = _super.call(this, _view, _options) || this; 28891 // self-config, overridable by subclasses 28892 _this.segSelector = '.fc-event-container > *'; // what constitutes an event element? 28893 if (_this.dateSelectingClass) { 28894 _this.dateClicking = new _this.dateClickingClass(_this); 28895 } 28896 if (_this.dateSelectingClass) { 28897 _this.dateSelecting = new _this.dateSelectingClass(_this); 28898 } 28899 if (_this.eventPointingClass) { 28900 _this.eventPointing = new _this.eventPointingClass(_this); 28901 } 28902 if (_this.eventDraggingClass && _this.eventPointing) { 28903 _this.eventDragging = new _this.eventDraggingClass(_this, _this.eventPointing); 28904 } 28905 if (_this.eventResizingClass && _this.eventPointing) { 28906 _this.eventResizing = new _this.eventResizingClass(_this, _this.eventPointing); 28907 } 28908 if (_this.externalDroppingClass) { 28909 _this.externalDropping = new _this.externalDroppingClass(_this); 28910 } 28911 return _this; 28912 } 28913 // Sets the container element that the view should render inside of, does global DOM-related initializations, 28914 // and renders all the non-date-related content inside. 28915 InteractiveDateComponent.prototype.setElement = function (el) { 28916 _super.prototype.setElement.call(this, el); 28917 if (this.dateClicking) { 28918 this.dateClicking.bindToEl(el); 28919 } 28920 if (this.dateSelecting) { 28921 this.dateSelecting.bindToEl(el); 28922 } 28923 this.bindAllSegHandlersToEl(el); 28924 }; 28925 InteractiveDateComponent.prototype.removeElement = function () { 28926 this.endInteractions(); 28927 _super.prototype.removeElement.call(this); 28928 }; 28929 InteractiveDateComponent.prototype.executeEventUnrender = function () { 28930 this.endInteractions(); 28931 _super.prototype.executeEventUnrender.call(this); 28932 }; 28933 InteractiveDateComponent.prototype.bindGlobalHandlers = function () { 28934 _super.prototype.bindGlobalHandlers.call(this); 28935 if (this.externalDropping) { 28936 this.externalDropping.bindToDocument(); 28937 } 28938 }; 28939 InteractiveDateComponent.prototype.unbindGlobalHandlers = function () { 28940 _super.prototype.unbindGlobalHandlers.call(this); 28941 if (this.externalDropping) { 28942 this.externalDropping.unbindFromDocument(); 28943 } 28944 }; 28945 InteractiveDateComponent.prototype.bindDateHandlerToEl = function (el, name, handler) { 28946 var _this = this; 28947 // attach a handler to the grid's root element. 28948 // jQuery will take care of unregistering them when removeElement gets called. 28949 this.el.on(name, function (ev) { 28950 if (!$(ev.target).is(_this.segSelector + ':not(.fc-helper),' + // directly on an event element 28951 _this.segSelector + ':not(.fc-helper) *,' + // within an event element 28952 '.fc-more,' + // a "more.." link 28953 'a[data-goto]' // a clickable nav link 28954 )) { 28955 return handler.call(_this, ev); 28956 } 28957 }); 28958 }; 28959 InteractiveDateComponent.prototype.bindAllSegHandlersToEl = function (el) { 28960 [ 28961 this.eventPointing, 28962 this.eventDragging, 28963 this.eventResizing 28964 ].forEach(function (eventInteraction) { 28965 if (eventInteraction) { 28966 eventInteraction.bindToEl(el); 28967 } 28968 }); 28969 }; 28970 InteractiveDateComponent.prototype.bindSegHandlerToEl = function (el, name, handler) { 28971 var _this = this; 28972 el.on(name, this.segSelector, function (ev) { 28973 var segEl = $(ev.currentTarget); 28974 if (!segEl.is('.fc-helper')) { 28975 var seg = segEl.data('fc-seg'); // grab segment data. put there by View::renderEventsPayload 28976 if (seg && !_this.shouldIgnoreEventPointing()) { 28977 return handler.call(_this, seg, ev); // context will be the Grid 28978 } 28979 } 28980 }); 28981 }; 28982 InteractiveDateComponent.prototype.shouldIgnoreMouse = function () { 28983 // HACK 28984 // This will still work even though bindDateHandlerToEl doesn't use GlobalEmitter. 28985 return GlobalEmitter_1.default.get().shouldIgnoreMouse(); 28986 }; 28987 InteractiveDateComponent.prototype.shouldIgnoreTouch = function () { 28988 var view = this._getView(); 28989 // On iOS (and Android?) when a new selection is initiated overtop another selection, 28990 // the touchend never fires because the elements gets removed mid-touch-interaction (my theory). 28991 // HACK: simply don't allow this to happen. 28992 // ALSO: prevent selection when an *event* is already raised. 28993 return view.isSelected || view.selectedEvent; 28994 }; 28995 InteractiveDateComponent.prototype.shouldIgnoreEventPointing = function () { 28996 // only call the handlers if there is not a drag/resize in progress 28997 return (this.eventDragging && this.eventDragging.isDragging) || 28998 (this.eventResizing && this.eventResizing.isResizing); 28999 }; 29000 InteractiveDateComponent.prototype.canStartSelection = function (seg, ev) { 29001 return util_1.getEvIsTouch(ev) && 29002 !this.canStartResize(seg, ev) && 29003 (this.isEventDefDraggable(seg.footprint.eventDef) || 29004 this.isEventDefResizable(seg.footprint.eventDef)); 29005 }; 29006 InteractiveDateComponent.prototype.canStartDrag = function (seg, ev) { 29007 return !this.canStartResize(seg, ev) && 29008 this.isEventDefDraggable(seg.footprint.eventDef); 29009 }; 29010 InteractiveDateComponent.prototype.canStartResize = function (seg, ev) { 29011 var view = this._getView(); 29012 var eventDef = seg.footprint.eventDef; 29013 return (!util_1.getEvIsTouch(ev) || view.isEventDefSelected(eventDef)) && 29014 this.isEventDefResizable(eventDef) && 29015 $(ev.target).is('.fc-resizer'); 29016 }; 29017 // Kills all in-progress dragging. 29018 // Useful for when public API methods that result in re-rendering are invoked during a drag. 29019 // Also useful for when touch devices misbehave and don't fire their touchend. 29020 InteractiveDateComponent.prototype.endInteractions = function () { 29021 [ 29022 this.dateClicking, 29023 this.dateSelecting, 29024 this.eventPointing, 29025 this.eventDragging, 29026 this.eventResizing 29027 ].forEach(function (interaction) { 29028 if (interaction) { 29029 interaction.end(); 29030 } 29031 }); 29032 }; 29033 // Event Drag-n-Drop 29034 // --------------------------------------------------------------------------------------------------------------- 29035 // Computes if the given event is allowed to be dragged by the user 29036 InteractiveDateComponent.prototype.isEventDefDraggable = function (eventDef) { 29037 return this.isEventDefStartEditable(eventDef); 29038 }; 29039 InteractiveDateComponent.prototype.isEventDefStartEditable = function (eventDef) { 29040 var isEditable = eventDef.isStartExplicitlyEditable(); 29041 if (isEditable == null) { 29042 isEditable = this.opt('eventStartEditable'); 29043 if (isEditable == null) { 29044 isEditable = this.isEventDefGenerallyEditable(eventDef); 29045 } 29046 } 29047 return isEditable; 29048 }; 29049 InteractiveDateComponent.prototype.isEventDefGenerallyEditable = function (eventDef) { 29050 var isEditable = eventDef.isExplicitlyEditable(); 29051 if (isEditable == null) { 29052 isEditable = this.opt('editable'); 29053 } 29054 return isEditable; 29055 }; 29056 // Event Resizing 29057 // --------------------------------------------------------------------------------------------------------------- 29058 // Computes if the given event is allowed to be resized from its starting edge 29059 InteractiveDateComponent.prototype.isEventDefResizableFromStart = function (eventDef) { 29060 return this.opt('eventResizableFromStart') && this.isEventDefResizable(eventDef); 29061 }; 29062 // Computes if the given event is allowed to be resized from its ending edge 29063 InteractiveDateComponent.prototype.isEventDefResizableFromEnd = function (eventDef) { 29064 return this.isEventDefResizable(eventDef); 29065 }; 29066 // Computes if the given event is allowed to be resized by the user at all 29067 InteractiveDateComponent.prototype.isEventDefResizable = function (eventDef) { 29068 var isResizable = eventDef.isDurationExplicitlyEditable(); 29069 if (isResizable == null) { 29070 isResizable = this.opt('eventDurationEditable'); 29071 if (isResizable == null) { 29072 isResizable = this.isEventDefGenerallyEditable(eventDef); 29073 } 29074 } 29075 return isResizable; 29076 }; 29077 // Event Mutation / Constraints 29078 // --------------------------------------------------------------------------------------------------------------- 29079 // Diffs the two dates, returning a duration, based on granularity of the grid 29080 // TODO: port isTimeScale into this system? 29081 InteractiveDateComponent.prototype.diffDates = function (a, b) { 29082 if (this.largeUnit) { 29083 return util_1.diffByUnit(a, b, this.largeUnit); 29084 } 29085 else { 29086 return util_1.diffDayTime(a, b); 29087 } 29088 }; 29089 // is it allowed, in relation to the view's validRange? 29090 // NOTE: very similar to isExternalInstanceGroupAllowed 29091 InteractiveDateComponent.prototype.isEventInstanceGroupAllowed = function (eventInstanceGroup) { 29092 var view = this._getView(); 29093 var dateProfile = this.dateProfile; 29094 var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges()); 29095 var i; 29096 for (i = 0; i < eventFootprints.length; i++) { 29097 // TODO: just use getAllEventRanges directly 29098 if (!dateProfile.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) { 29099 return false;
29100 } 29101 } 29102 return view.calendar.constraints.isEventInstanceGroupAllowed(eventInstanceGroup); 29103 }; 29104 // NOTE: very similar to isEventInstanceGroupAllowed 29105 // when it's a completely anonymous external drag, no event. 29106 InteractiveDateComponent.prototype.isExternalInstanceGroupAllowed = function (eventInstanceGroup) { 29107 var view = this._getView(); 29108 var dateProfile = this.dateProfile; 29109 var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges()); 29110 var i; 29111 for (i = 0; i < eventFootprints.length; i++) { 29112 if (!dateProfile.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) { 29113 return false; 29114 } 29115 } 29116 for (i = 0; i < eventFootprints.length; i++) { 29117 // treat it as a selection 29118 // TODO: pass in eventInstanceGroup instead 29119 // because we don't want calendar's constraint system to depend on a component's 29120 // determination of footprints. 29121 if (!view.calendar.constraints.isSelectionFootprintAllowed(eventFootprints[i].componentFootprint)) { 29122 return false; 29123 } 29124 } 29125 return true; 29126 }; 29127 return InteractiveDateComponent; 29128}(DateComponent_1.default)); 29129exports.default = InteractiveDateComponent; 29130 29131 29132/***/ }), 29133/* 41 */ 29134/***/ (function(module, exports, __webpack_require__) { 29135 29136Object.defineProperty(exports, "__esModule", { value: true }); 29137var tslib_1 = __webpack_require__(2); 29138var $ = __webpack_require__(3); 29139var moment = __webpack_require__(0); 29140var util_1 = __webpack_require__(4); 29141var RenderQueue_1 = __webpack_require__(218); 29142var DateProfileGenerator_1 = __webpack_require__(221); 29143var InteractiveDateComponent_1 = __webpack_require__(40); 29144var GlobalEmitter_1 = __webpack_require__(21); 29145var UnzonedRange_1 = __webpack_require__(5); 29146/* An abstract class from which other views inherit from 29147----------------------------------------------------------------------------------------------------------------------*/ 29148var View = /** @class */ (function (_super) { 29149 tslib_1.__extends(View, _super); 29150 function View(calendar, viewSpec) { 29151 var _this = _super.call(this, null, viewSpec.options) || this; 29152 _this.batchRenderDepth = 0; 29153 _this.isSelected = false; // boolean whether a range of time is user-selected or not 29154 _this.calendar = calendar; 29155 _this.viewSpec = viewSpec; 29156 // shortcuts 29157 _this.type = viewSpec.type; 29158 // .name is deprecated 29159 _this.name = _this.type; 29160 _this.initRenderQueue(); 29161 _this.initHiddenDays(); 29162 _this.dateProfileGenerator = new _this.dateProfileGeneratorClass(_this); 29163 _this.bindBaseRenderHandlers(); 29164 _this.eventOrderSpecs = util_1.parseFieldSpecs(_this.opt('eventOrder')); 29165 // legacy 29166 if (_this['initialize']) { 29167 _this['initialize'](); 29168 } 29169 return _this; 29170 } 29171 View.prototype._getView = function () { 29172 return this; 29173 }; 29174 // Retrieves an option with the given name 29175 View.prototype.opt = function (name) { 29176 return this.options[name]; 29177 }; 29178 /* Render Queue 29179 ------------------------------------------------------------------------------------------------------------------*/ 29180 View.prototype.initRenderQueue = function () { 29181 this.renderQueue = new RenderQueue_1.default({ 29182 event: this.opt('eventRenderWait') 29183 }); 29184 this.renderQueue.on('start', this.onRenderQueueStart.bind(this)); 29185 this.renderQueue.on('stop', this.onRenderQueueStop.bind(this)); 29186 this.on('before:change', this.startBatchRender); 29187 this.on('change', this.stopBatchRender); 29188 }; 29189 View.prototype.onRenderQueueStart = function () { 29190 this.calendar.freezeContentHeight(); 29191 this.addScroll(this.queryScroll()); 29192 }; 29193 View.prototype.onRenderQueueStop = function () { 29194 if (this.calendar.updateViewSize()) { 29195 this.popScroll(); 29196 } 29197 this.calendar.thawContentHeight(); 29198 }; 29199 View.prototype.startBatchRender = function () { 29200 if (!(this.batchRenderDepth++)) { 29201 this.renderQueue.pause(); 29202 } 29203 }; 29204 View.prototype.stopBatchRender = function () { 29205 if (!(--this.batchRenderDepth)) { 29206 this.renderQueue.resume(); 29207 } 29208 }; 29209 View.prototype.requestRender = function (func, namespace, actionType) { 29210 this.renderQueue.queue(func, namespace, actionType); 29211 }; 29212 // given func will auto-bind to `this` 29213 View.prototype.whenSizeUpdated = function (func) { 29214 if (this.renderQueue.isRunning) { 29215 this.renderQueue.one('stop', func.bind(this)); 29216 } 29217 else { 29218 func.call(this); 29219 } 29220 }; 29221 /* Title and Date Formatting 29222 ------------------------------------------------------------------------------------------------------------------*/ 29223 // Computes what the title at the top of the calendar should be for this view 29224 View.prototype.computeTitle = function (dateProfile) { 29225 var unzonedRange; 29226 // for views that span a large unit of time, show the proper interval, ignoring stray days before and after 29227 if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) { 29228 unzonedRange = dateProfile.currentUnzonedRange; 29229 } 29230 else { 29231 unzonedRange = dateProfile.activeUnzonedRange; 29232 } 29233 return this.formatRange({ 29234 start: this.calendar.msToMoment(unzonedRange.startMs, dateProfile.isRangeAllDay), 29235 end: this.calendar.msToMoment(unzonedRange.endMs, dateProfile.isRangeAllDay) 29236 }, dateProfile.isRangeAllDay, this.opt('titleFormat') || this.computeTitleFormat(dateProfile), this.opt('titleRangeSeparator')); 29237 };
29238 // Generates the format string that should be used to generate the title for the current date range. 29239 // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`. 29240 View.prototype.computeTitleFormat = function (dateProfile) { 29241 var currentRangeUnit = dateProfile.currentRangeUnit; 29242 if (currentRangeUnit === 'year') { 29243 return 'YYYY'; 29244 } 29245 else if (currentRangeUnit === 'month') { 29246 return this.opt('monthYearFormat'); // like "September 2014" 29247 } 29248 else if (dateProfile.currentUnzonedRange.as('days') > 1) { 29249 return 'll'; // multi-day range. shorter, like "Sep 9 - 10 2014" 29250 } 29251 else { 29252 return 'LL'; // one day. longer, like "September 9 2014" 29253 } 29254 }; 29255 // Date Setting/Unsetting 29256 // ----------------------------------------------------------------------------------------------------------------- 29257 View.prototype.setDate = function (date) { 29258 var currentDateProfile = this.get('dateProfile'); 29259 var newDateProfile = this.dateProfileGenerator.build(date, undefined, true); // forceToValid=true 29260 if (!currentDateProfile || 29261 !currentDateProfile.activeUnzonedRange.equals(newDateProfile.activeUnzonedRange)) { 29262 this.set('dateProfile', newDateProfile); 29263 } 29264 }; 29265 View.prototype.unsetDate = function () { 29266 this.unset('dateProfile'); 29267 }; 29268 // Event Data 29269 // ----------------------------------------------------------------------------------------------------------------- 29270 View.prototype.fetchInitialEvents = function (dateProfile) { 29271 var calendar = this.calendar; 29272 var forceAllDay = dateProfile.isRangeAllDay && !this.usesMinMaxTime; 29273 return calendar.requestEvents(calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, forceAllDay), calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, forceAllDay)); 29274 }; 29275 View.prototype.bindEventChanges = function () { 29276 this.listenTo(this.calendar, 'eventsReset', this.resetEvents); // TODO: make this a real event 29277 }; 29278 View.prototype.unbindEventChanges = function () { 29279 this.stopListeningTo(this.calendar, 'eventsReset'); 29280 }; 29281 View.prototype.setEvents = function (eventsPayload) { 29282 this.set('currentEvents', eventsPayload); 29283 this.set('hasEvents', true); 29284 }; 29285 View.prototype.unsetEvents = function () { 29286 this.unset('currentEvents'); 29287 this.unset('hasEvents'); 29288 }; 29289 View.prototype.resetEvents = function (eventsPayload) { 29290 this.startBatchRender(); 29291 this.unsetEvents(); 29292 this.setEvents(eventsPayload); 29293 this.stopBatchRender(); 29294 }; 29295 // Date High-level Rendering 29296 // ----------------------------------------------------------------------------------------------------------------- 29297 View.prototype.requestDateRender = function (dateProfile) { 29298 var _this = this; 29299 this.requestRender(function () { 29300 _this.executeDateRender(dateProfile); 29301 }, 'date', 'init'); 29302 }; 29303 View.prototype.requestDateUnrender = function () { 29304 var _this = this; 29305 this.requestRender(function () { 29306 _this.executeDateUnrender(); 29307 }, 'date', 'destroy'); 29308 }; 29309 // if dateProfile not specified, uses current 29310 View.prototype.executeDateRender = function (dateProfile) { 29311 _super.prototype.executeDateRender.call(this, dateProfile); 29312 if (this['render']) { 29313 this['render'](); // TODO: deprecate 29314 } 29315 this.trigger('datesRendered'); 29316 this.addScroll({ isDateInit: true }); 29317 this.startNowIndicator(); // shouldn't render yet because updateSize will be called soon 29318 }; 29319 View.prototype.executeDateUnrender = function () { 29320 this.unselect(); 29321 this.stopNowIndicator(); 29322 this.trigger('before:datesUnrendered'); 29323 if (this['destroy']) { 29324 this['destroy'](); // TODO: deprecate 29325 } 29326 _super.prototype.executeDateUnrender.call(this); 29327 }; 29328 // "Base" rendering 29329 // -----------------------------------------------------------------------------------------------------------------
29330 View.prototype.bindBaseRenderHandlers = function () { 29331 var _this = this; 29332 this.on('datesRendered', function () { 29333 _this.whenSizeUpdated(_this.triggerViewRender); 29334 }); 29335 this.on('before:datesUnrendered', function () { 29336 _this.triggerViewDestroy(); 29337 }); 29338 }; 29339 View.prototype.triggerViewRender = function () { 29340 this.publiclyTrigger('viewRender', { 29341 context: this, 29342 args: [this, this.el] 29343 }); 29344 }; 29345 View.prototype.triggerViewDestroy = function () { 29346 this.publiclyTrigger('viewDestroy', { 29347 context: this, 29348 args: [this, this.el] 29349 }); 29350 }; 29351 // Event High-level Rendering 29352 // ----------------------------------------------------------------------------------------------------------------- 29353 View.prototype.requestEventsRender = function (eventsPayload) { 29354 var _this = this; 29355 this.requestRender(function () { 29356 _this.executeEventRender(eventsPayload); 29357 _this.whenSizeUpdated(_this.triggerAfterEventsRendered); 29358 }, 'event', 'init'); 29359 }; 29360 View.prototype.requestEventsUnrender = function () { 29361 var _this = this; 29362 this.requestRender(function () { 29363 _this.triggerBeforeEventsDestroyed(); 29364 _this.executeEventUnrender(); 29365 }, 'event', 'destroy'); 29366 }; 29367 // Business Hour High-level Rendering 29368 // ----------------------------------------------------------------------------------------------------------------- 29369 View.prototype.requestBusinessHoursRender = function (businessHourGenerator) { 29370 var _this = this; 29371 this.requestRender(function () { 29372 _this.renderBusinessHours(businessHourGenerator); 29373 }, 'businessHours', 'init'); 29374 }; 29375 View.prototype.requestBusinessHoursUnrender = function () { 29376 var _this = this; 29377 this.requestRender(function () { 29378 _this.unrenderBusinessHours(); 29379 }, 'businessHours', 'destroy'); 29380 }; 29381 // Misc view rendering utils 29382 // ----------------------------------------------------------------------------------------------------------------- 29383 // Binds DOM handlers to elements that reside outside the view container, such as the document 29384 View.prototype.bindGlobalHandlers = function () { 29385 _super.prototype.bindGlobalHandlers.call(this); 29386 this.listenTo(GlobalEmitter_1.default.get(), { 29387 touchstart: this.processUnselect, 29388 mousedown: this.handleDocumentMousedown 29389 }); 29390 }; 29391 // Unbinds DOM handlers from elements that reside outside the view container 29392 View.prototype.unbindGlobalHandlers = function () { 29393 _super.prototype.unbindGlobalHandlers.call(this); 29394 this.stopListeningTo(GlobalEmitter_1.default.get()); 29395 }; 29396 /* Now Indicator 29397 ------------------------------------------------------------------------------------------------------------------*/ 29398 // Immediately render the current time indicator and begins re-rendering it at an interval, 29399 // which is defined by this.getNowIndicatorUnit(). 29400 // TODO: somehow do this for the current whole day's background too 29401 View.prototype.startNowIndicator = function () { 29402 var _this = this; 29403 var unit; 29404 var update; 29405 var delay; // ms wait value 29406 if (this.opt('nowIndicator')) { 29407 unit = this.getNowIndicatorUnit(); 29408 if (unit) { 29409 update = util_1.proxy(this, 'updateNowIndicator'); // bind to `this` 29410 this.initialNowDate = this.calendar.getNow(); 29411 this.initialNowQueriedMs = new Date().valueOf(); 29412 // wait until the beginning of the next interval 29413 delay = this.initialNowDate.clone().startOf(unit).add(1, unit).valueOf() - this.initialNowDate.valueOf(); 29414 this.nowIndicatorTimeoutID = setTimeout(function () { 29415 _this.nowIndicatorTimeoutID = null; 29416 update(); 29417 delay = +moment.duration(1, unit); 29418 delay = Math.max(100, delay); // prevent too frequent 29419 _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval 29420 }, delay); 29421 } 29422 // rendering will be initiated in updateSize 29423 } 29424 }; 29425 // rerenders the now indicator, computing the new current time from the amount of time that has passed 29426 // since the initial getNow call. 29427 View.prototype.updateNowIndicator = function () { 29428 if (this.isDatesRendered && 29429 this.initialNowDate // activated before? 29430 ) { 29431 this.unrenderNowIndicator(); // won't unrender if unnecessary 29432 this.renderNowIndicator(this.initialNowDate.clone().add(new Date().valueOf() - this.initialNowQueriedMs) // add ms 29433 ); 29434 this.isNowIndicatorRendered = true; 29435 } 29436 }; 29437 // Immediately unrenders the view's current time indicator and stops any re-rendering timers. 29438 // Won't cause side effects if indicator isn't rendered. 29439 View.prototype.stopNowIndicator = function () { 29440 if (this.isNowIndicatorRendered) { 29441 if (this.nowIndicatorTimeoutID) { 29442 clearTimeout(this.nowIndicatorTimeoutID); 29443 this.nowIndicatorTimeoutID = null; 29444 } 29445 if (this.nowIndicatorIntervalID) { 29446 clearInterval(this.nowIndicatorIntervalID); 29447 this.nowIndicatorIntervalID = null; 29448 } 29449 this.unrenderNowIndicator(); 29450 this.isNowIndicatorRendered = false;
29451 } 29452 }; 29453 /* Dimensions 29454 ------------------------------------------------------------------------------------------------------------------*/ 29455 View.prototype.updateSize = function (totalHeight, isAuto, isResize) { 29456 if (this['setHeight']) { 29457 this['setHeight'](totalHeight, isAuto); 29458 } 29459 else { 29460 _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize); 29461 } 29462 this.updateNowIndicator(); 29463 }; 29464 /* Scroller 29465 ------------------------------------------------------------------------------------------------------------------*/ 29466 View.prototype.addScroll = function (scroll) { 29467 var queuedScroll = this.queuedScroll || (this.queuedScroll = {}); 29468 $.extend(queuedScroll, scroll); 29469 }; 29470 View.prototype.popScroll = function () { 29471 this.applyQueuedScroll(); 29472 this.queuedScroll = null; 29473 }; 29474 View.prototype.applyQueuedScroll = function () { 29475 if (this.queuedScroll) { 29476 this.applyScroll(this.queuedScroll); 29477 } 29478 }; 29479 View.prototype.queryScroll = function () { 29480 var scroll = {}; 29481 if (this.isDatesRendered) { 29482 $.extend(scroll, this.queryDateScroll()); 29483 } 29484 return scroll; 29485 }; 29486 View.prototype.applyScroll = function (scroll) { 29487 if (scroll.isDateInit && this.isDatesRendered) { 29488 $.extend(scroll, this.computeInitialDateScroll()); 29489 } 29490 if (this.isDatesRendered) { 29491 this.applyDateScroll(scroll); 29492 } 29493 }; 29494 View.prototype.computeInitialDateScroll = function () { 29495 return {}; // subclasses must implement 29496 }; 29497 View.prototype.queryDateScroll = function () { 29498 return {}; // subclasses must implement 29499 }; 29500 View.prototype.applyDateScroll = function (scroll) { 29501 // subclasses must implement 29502 }; 29503 /* Event Drag-n-Drop 29504 ------------------------------------------------------------------------------------------------------------------*/ 29505 View.prototype.reportEventDrop = function (eventInstance, eventMutation, el, ev) { 29506 var eventManager = this.calendar.eventManager; 29507 var undoFunc = eventManager.mutateEventsWithId(eventInstance.def.id, eventMutation); 29508 var dateMutation = eventMutation.dateMutation; 29509 // update the EventInstance, for handlers 29510 if (dateMutation) { 29511 eventInstance.dateProfile = dateMutation.buildNewDateProfile(eventInstance.dateProfile, this.calendar); 29512 } 29513 this.triggerEventDrop(eventInstance, 29514 // a drop doesn't necessarily mean a date mutation (ex: resource change) 29515 (dateMutation && dateMutation.dateDelta) || moment.duration(), undoFunc, el, ev); 29516 }; 29517 // Triggers event-drop handlers that have subscribed via the API 29518 View.prototype.triggerEventDrop = function (eventInstance, dateDelta, undoFunc, el, ev) { 29519 this.publiclyTrigger('eventDrop', { 29520 context: el[0], 29521 args: [ 29522 eventInstance.toLegacy(), 29523 dateDelta, 29524 undoFunc, 29525 ev, 29526 {}, 29527 this 29528 ] 29529 }); 29530 }; 29531 /* External Element Drag-n-Drop 29532 ------------------------------------------------------------------------------------------------------------------*/ 29533 // Must be called when an external element, via jQuery UI, has been dropped onto the calendar. 29534 // `meta` is the parsed data that has been embedded into the dragging event. 29535 // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event. 29536 View.prototype.reportExternalDrop = function (singleEventDef, isEvent, isSticky, el, ev, ui) { 29537 if (isEvent) { 29538 this.calendar.eventManager.addEventDef(singleEventDef, isSticky); 29539 } 29540 this.triggerExternalDrop(singleEventDef, isEvent, el, ev, ui); 29541 }; 29542 // Triggers external-drop handlers that have subscribed via the API 29543 View.prototype.triggerExternalDrop = function (singleEventDef, isEvent, el, ev, ui) { 29544 // trigger 'drop' regardless of whether element represents an event 29545 this.publiclyTrigger('drop', { 29546 context: el[0], 29547 args: [ 29548 singleEventDef.dateProfile.start.clone(), 29549 ev, 29550 ui, 29551 this 29552 ] 29553 }); 29554 if (isEvent) { 29555 // signal an external event landed 29556 this.publiclyTrigger('eventReceive', { 29557 context: this, 29558 args: [ 29559 singleEventDef.buildInstance().toLegacy(), 29560 this 29561 ] 29562 }); 29563 } 29564 }; 29565 /* Event Resizing 29566 ------------------------------------------------------------------------------------------------------------------*/ 29567 // Must be called when an event in the view has been resized to a new length 29568 View.prototype.reportEventResize = function (eventInstance, eventMutation, el, ev) { 29569 var eventManager = this.calendar.eventManager;
29570 var undoFunc = eventManager.mutateEventsWithId(eventInstance.def.id, eventMutation); 29571 // update the EventInstance, for handlers 29572 eventInstance.dateProfile = eventMutation.dateMutation.buildNewDateProfile(eventInstance.dateProfile, this.calendar); 29573 this.triggerEventResize(eventInstance, eventMutation.dateMutation.endDelta, undoFunc, el, ev); 29574 }; 29575 // Triggers event-resize handlers that have subscribed via the API 29576 View.prototype.triggerEventResize = function (eventInstance, durationDelta, undoFunc, el, ev) { 29577 this.publiclyTrigger('eventResize', { 29578 context: el[0], 29579 args: [ 29580 eventInstance.toLegacy(), 29581 durationDelta, 29582 undoFunc, 29583 ev, 29584 {}, 29585 this 29586 ] 29587 }); 29588 }; 29589 /* Selection (time range) 29590 ------------------------------------------------------------------------------------------------------------------*/ 29591 // Selects a date span on the view. `start` and `end` are both Moments. 29592 // `ev` is the native mouse event that begin the interaction. 29593 View.prototype.select = function (footprint, ev) { 29594 this.unselect(ev); 29595 this.renderSelectionFootprint(footprint); 29596 this.reportSelection(footprint, ev); 29597 }; 29598 View.prototype.renderSelectionFootprint = function (footprint) { 29599 if (this['renderSelection']) { 29600 this['renderSelection'](footprint.toLegacy(this.calendar)); 29601 } 29602 else { 29603 _super.prototype.renderSelectionFootprint.call(this, footprint); 29604 } 29605 }; 29606 // Called when a new selection is made. Updates internal state and triggers handlers. 29607 View.prototype.reportSelection = function (footprint, ev) { 29608 this.isSelected = true; 29609 this.triggerSelect(footprint, ev); 29610 }; 29611 // Triggers handlers to 'select' 29612 View.prototype.triggerSelect = function (footprint, ev) { 29613 var dateProfile = this.calendar.footprintToDateProfile(footprint); // abuse of "Event"DateProfile? 29614 this.publiclyTrigger('select', { 29615 context: this, 29616 args: [ 29617 dateProfile.start, 29618 dateProfile.end, 29619 ev, 29620 this 29621 ] 29622 }); 29623 }; 29624 // Undoes a selection. updates in the internal state and triggers handlers. 29625 // `ev` is the native mouse event that began the interaction. 29626 View.prototype.unselect = function (ev) { 29627 if (this.isSelected) { 29628 this.isSelected = false; 29629 if (this['destroySelection']) { 29630 this['destroySelection'](); // TODO: deprecate 29631 } 29632 this.unrenderSelection(); 29633 this.publiclyTrigger('unselect', { 29634 context: this, 29635 args: [ev, this] 29636 }); 29637 } 29638 }; 29639 /* Event Selection 29640 ------------------------------------------------------------------------------------------------------------------*/ 29641 View.prototype.selectEventInstance = function (eventInstance) { 29642 if (!this.selectedEventInstance || 29643 this.selectedEventInstance !== eventInstance) { 29644 this.unselectEventInstance(); 29645 this.getEventSegs().forEach(function (seg) { 29646 if (seg.footprint.eventInstance === eventInstance && 29647 seg.el // necessary? 29648 ) { 29649 seg.el.addClass('fc-selected'); 29650 } 29651 }); 29652 this.selectedEventInstance = eventInstance; 29653 } 29654 }; 29655 View.prototype.unselectEventInstance = function () { 29656 if (this.selectedEventInstance) { 29657 this.getEventSegs().forEach(function (seg) { 29658 if (seg.el) { 29659 seg.el.removeClass('fc-selected'); 29660 } 29661 }); 29662 this.selectedEventInstance = null; 29663 } 29664 }; 29665 View.prototype.isEventDefSelected = function (eventDef) { 29666 // event references might change on refetchEvents(), while selectedEventInstance doesn't, 29667 // so compare IDs 29668 return this.selectedEventInstance && this.selectedEventInstance.def.id === eventDef.id; 29669 }; 29670 /* Mouse / Touch Unselecting (time range & event unselection) 29671 ------------------------------------------------------------------------------------------------------------------*/ 29672 // TODO: move consistently to down/start or up/end? 29673 // TODO: don't kill previous selection if touch scrolling 29674 View.prototype.handleDocumentMousedown = function (ev) { 29675 if (util_1.isPrimaryMouseButton(ev)) { 29676 this.processUnselect(ev); 29677 } 29678 }; 29679 View.prototype.processUnselect = function (ev) { 29680 this.processRangeUnselect(ev); 29681 this.processEventUnselect(ev); 29682 }; 29683 View.prototype.processRangeUnselect = function (ev) { 29684 var ignore;
29685 // is there a time-range selection? 29686 if (this.isSelected && this.opt('unselectAuto')) { 29687 // only unselect if the clicked element is not identical to or inside of an 'unselectCancel' element 29688 ignore = this.opt('unselectCancel'); 29689 if (!ignore || !$(ev.target).closest(ignore).length) { 29690 this.unselect(ev); 29691 } 29692 } 29693 }; 29694 View.prototype.processEventUnselect = function (ev) { 29695 if (this.selectedEventInstance) { 29696 if (!$(ev.target).closest('.fc-selected').length) { 29697 this.unselectEventInstance(); 29698 } 29699 } 29700 }; 29701 /* Triggers 29702 ------------------------------------------------------------------------------------------------------------------*/ 29703 View.prototype.triggerBaseRendered = function () { 29704 this.publiclyTrigger('viewRender', { 29705 context: this, 29706 args: [this, this.el] 29707 }); 29708 }; 29709 View.prototype.triggerBaseUnrendered = function () { 29710 this.publiclyTrigger('viewDestroy', { 29711 context: this, 29712 args: [this, this.el] 29713 }); 29714 }; 29715 // Triggers handlers to 'dayClick' 29716 // Span has start/end of the clicked area. Only the start is useful. 29717 View.prototype.triggerDayClick = function (footprint, dayEl, ev) { 29718 var dateProfile = this.calendar.footprintToDateProfile(footprint); // abuse of "Event"DateProfile? 29719 this.publiclyTrigger('dayClick', { 29720 context: dayEl, 29721 args: [dateProfile.start, ev, this] 29722 }); 29723 }; 29724 /* Date Utils 29725 ------------------------------------------------------------------------------------------------------------------*/ 29726 // For DateComponent::getDayClasses 29727 View.prototype.isDateInOtherMonth = function (date, dateProfile) { 29728 return false; 29729 }; 29730 // Arguments after name will be forwarded to a hypothetical function value 29731 // WARNING: passed-in arguments will be given to generator functions as-is and can cause side-effects. 29732 // Always clone your objects if you fear mutation. 29733 View.prototype.getUnzonedRangeOption = function (name) { 29734 var val = this.opt(name); 29735 if (typeof val === 'function') { 29736 val = val.apply(null, Array.prototype.slice.call(arguments, 1)); 29737 } 29738 if (val) { 29739 return this.calendar.parseUnzonedRange(val); 29740 } 29741 }; 29742 /* Hidden Days 29743 ------------------------------------------------------------------------------------------------------------------*/ 29744 // Initializes internal variables related to calculating hidden days-of-week 29745 View.prototype.initHiddenDays = function () { 29746 var hiddenDays = this.opt('hiddenDays') || []; // array of day-of-week indices that are hidden 29747 var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool) 29748 var dayCnt = 0; 29749 var i; 29750 if (this.opt('weekends') === false) { 29751 hiddenDays.push(0, 6); // 0=sunday, 6=saturday 29752 } 29753 for (i = 0; i < 7; i++) { 29754 if (!(isHiddenDayHash[i] = $.inArray(i, hiddenDays) !== -1)) { 29755 dayCnt++; 29756 } 29757 } 29758 if (!dayCnt) { 29759 throw new Error('invalid hiddenDays'); // all days were hidden? bad. 29760 } 29761 this.isHiddenDayHash = isHiddenDayHash; 29762 }; 29763 // Remove days from the beginning and end of the range that are computed as hidden. 29764 // If the whole range is trimmed off, returns null 29765 View.prototype.trimHiddenDays = function (inputUnzonedRange) { 29766 var start = inputUnzonedRange.getStart(); 29767 var end = inputUnzonedRange.getEnd(); 29768 if (start) { 29769 start = this.skipHiddenDays(start); 29770 } 29771 if (end) { 29772 end = this.skipHiddenDays(end, -1, true); 29773 } 29774 if (start === null || end === null || start < end) { 29775 return new UnzonedRange_1.default(start, end); 29776 } 29777 return null; 29778 }; 29779 // Is the current day hidden? 29780 // `day` is a day-of-week index (0-6), or a Moment
29781 View.prototype.isHiddenDay = function (day) { 29782 if (moment.isMoment(day)) { 29783 day = day.day(); 29784 } 29785 return this.isHiddenDayHash[day]; 29786 }; 29787 // Incrementing the current day until it is no longer a hidden day, returning a copy. 29788 // DOES NOT CONSIDER validUnzonedRange! 29789 // If the initial value of `date` is not a hidden day, don't do anything. 29790 // Pass `isExclusive` as `true` if you are dealing with an end date. 29791 // `inc` defaults to `1` (increment one day forward each time) 29792 View.prototype.skipHiddenDays = function (date, inc, isExclusive) { 29793 if (inc === void 0) { inc = 1; } 29794 if (isExclusive === void 0) { isExclusive = false; } 29795 var out = date.clone(); 29796 while (this.isHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7]) { 29797 out.add(inc, 'days'); 29798 } 29799 return out; 29800 }; 29801 return View; 29802}(InteractiveDateComponent_1.default)); 29803exports.default = View; 29804View.prototype.usesMinMaxTime = false; 29805View.prototype.dateProfileGeneratorClass = DateProfileGenerator_1.default; 29806View.watch('displayingDates', ['isInDom', 'dateProfile'], function (deps) { 29807 this.requestDateRender(deps.dateProfile); 29808}, function () { 29809 this.requestDateUnrender(); 29810}); 29811View.watch('displayingBusinessHours', ['displayingDates', 'businessHourGenerator'], function (deps) { 29812 this.requestBusinessHoursRender(deps.businessHourGenerator); 29813}, function () { 29814 this.requestBusinessHoursUnrender(); 29815}); 29816View.watch('initialEvents', ['dateProfile'], function (deps) { 29817 return this.fetchInitialEvents(deps.dateProfile); 29818}); 29819View.watch('bindingEvents', ['initialEvents'], function (deps) { 29820 this.setEvents(deps.initialEvents); 29821 this.bindEventChanges(); 29822}, function () { 29823 this.unbindEventChanges(); 29824 this.unsetEvents(); 29825}); 29826View.watch('displayingEvents', ['displayingDates', 'hasEvents'], function () { 29827 this.requestEventsRender(this.get('currentEvents')); 29828}, function () { 29829 this.requestEventsUnrender(); 29830}); 29831View.watch('title', ['dateProfile'], function (deps) { 29832 return (this.title = this.computeTitle(deps.dateProfile)); // assign to View for legacy reasons 29833}); 29834View.watch('legacyDateProps', ['dateProfile'], function (deps) { 29835 var calendar = this.calendar; 29836 var dateProfile = deps.dateProfile; 29837 // DEPRECATED, but we need to keep it updated... 29838 this.start = calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay); 29839 this.end = calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay); 29840 this.intervalStart = calendar.msToMoment(dateProfile.currentUnzonedRange.startMs, dateProfile.isRangeAllDay); 29841 this.intervalEnd = calendar.msToMoment(dateProfile.currentUnzonedRange.endMs, dateProfile.isRangeAllDay); 29842}); 29843 29844 29845/***/ }), 29846/* 42 */ 29847/***/ (function(module, exports, __webpack_require__) { 29848 29849Object.defineProperty(exports, "__esModule", { value: true }); 29850var $ = __webpack_require__(3); 29851var util_1 = __webpack_require__(4); 29852var EventRenderer = /** @class */ (function () { 29853 function EventRenderer(component, fillRenderer) { 29854 this.view = component._getView(); 29855 this.component = component; 29856 this.fillRenderer = fillRenderer; 29857 } 29858 EventRenderer.prototype.opt = function (name) { 29859 return this.view.opt(name); 29860 }; 29861 // Updates values that rely on options and also relate to range 29862 EventRenderer.prototype.rangeUpdated = function () { 29863 var displayEventTime; 29864 var displayEventEnd; 29865 this.eventTimeFormat = 29866 this.opt('eventTimeFormat') || 29867 this.opt('timeFormat') || // deprecated 29868 this.computeEventTimeFormat(); 29869 displayEventTime = this.opt('displayEventTime'); 29870 if (displayEventTime == null) { 29871 displayEventTime = this.computeDisplayEventTime(); // might be based off of range 29872 } 29873 displayEventEnd = this.opt('displayEventEnd'); 29874 if (displayEventEnd == null) { 29875 displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range 29876 } 29877 this.displayEventTime = displayEventTime; 29878 this.displayEventEnd = displayEventEnd; 29879 }; 29880 EventRenderer.prototype.render = function (eventsPayload) { 29881 var dateProfile = this.component._getDateProfile(); 29882 var eventDefId; 29883 var instanceGroup; 29884 var eventRanges; 29885 var bgRanges = []; 29886 var fgRanges = []; 29887 for (eventDefId in eventsPayload) { 29888 instanceGroup = eventsPayload[eventDefId]; 29889 eventRanges = instanceGroup.sliceRenderRanges(dateProfile.activeUnzonedRange); 29890 if (instanceGroup.getEventDef().hasBgRendering()) { 29891 bgRanges.push.apply(bgRanges, eventRanges); 29892 } 29893 else { 29894 fgRanges.push.apply(fgRanges, eventRanges); 29895 } 29896 } 29897 this.renderBgRanges(bgRanges); 29898 this.renderFgRanges(fgRanges); 29899 }; 29900 EventRenderer.prototype.unrender = function () { 29901 this.unrenderBgRanges(); 29902 this.unrenderFgRanges(); 29903 }; 29904 EventRenderer.prototype.renderFgRanges = function (eventRanges) { 29905 var eventFootprints = this.component.eventRangesToEventFootprints(eventRanges); 29906 var segs = this.component.eventFootprintsToSegs(eventFootprints); 29907 // render an `.el` on each seg 29908 // returns a subset of the segs. segs that were actually rendered 29909 segs = this.renderFgSegEls(segs); 29910 if (this.renderFgSegs(segs) !== false) { 29911 this.fgSegs = segs; 29912 } 29913 }; 29914 EventRenderer.prototype.unrenderFgRanges = function () { 29915 this.unrenderFgSegs(this.fgSegs || []); 29916 this.fgSegs = null; 29917 }; 29918 EventRenderer.prototype.renderBgRanges = function (eventRanges) { 29919 var eventFootprints = this.component.eventRangesToEventFootprints(eventRanges); 29920 var segs = this.component.eventFootprintsToSegs(eventFootprints); 29921 if (this.renderBgSegs(segs) !== false) { 29922 this.bgSegs = segs; 29923 } 29924 }; 29925 EventRenderer.prototype.unrenderBgRanges = function () { 29926 this.unrenderBgSegs(); 29927 this.bgSegs = null; 29928 }; 29929 EventRenderer.prototype.getSegs = function () { 29930 return (this.bgSegs || []).concat(this.fgSegs || []); 29931 }; 29932 // Renders foreground event segments onto the grid 29933 EventRenderer.prototype.renderFgSegs = function (segs) { 29934 // subclasses must implement 29935 // segs already has rendered els, and has been filtered. 29936 return false; // signal failure if not implemented 29937 }; 29938 // Unrenders all currently rendered foreground segments 29939 EventRenderer.prototype.unrenderFgSegs = function (segs) { 29940 // subclasses must implement 29941 }; 29942 EventRenderer.prototype.renderBgSegs = function (segs) { 29943 var _this = this; 29944 if (this.fillRenderer) { 29945 this.fillRenderer.renderSegs('bgEvent', segs, { 29946 getClasses: function (seg) { 29947 return _this.getBgClasses(seg.footprint.eventDef); 29948 }, 29949 getCss: function (seg) { 29950 return { 29951 'background-color': _this.getBgColor(seg.footprint.eventDef) 29952 }; 29953 }, 29954 filterEl: function (seg, el) { 29955 return _this.filterEventRenderEl(seg.footprint, el); 29956 } 29957 }); 29958 } 29959 else { 29960 return false; // signal failure if no fillRenderer 29961 } 29962 }; 29963 EventRenderer.prototype.unrenderBgSegs = function () { 29964 if (this.fillRenderer) {
29965 this.fillRenderer.unrender('bgEvent'); 29966 } 29967 }; 29968 // Renders and assigns an `el` property for each foreground event segment. 29969 // Only returns segments that successfully rendered. 29970 EventRenderer.prototype.renderFgSegEls = function (segs, disableResizing) { 29971 var _this = this; 29972 if (disableResizing === void 0) { disableResizing = false; } 29973 var hasEventRenderHandlers = this.view.hasPublicHandlers('eventRender'); 29974 var html = ''; 29975 var renderedSegs = []; 29976 var i; 29977 if (segs.length) { 29978 // build a large concatenation of event segment HTML 29979 for (i = 0; i < segs.length; i++) { 29980 this.beforeFgSegHtml(segs[i]); 29981 html += this.fgSegHtml(segs[i], disableResizing); 29982 } 29983 // Grab individual elements from the combined HTML string. Use each as the default rendering. 29984 // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false. 29985 $(html).each(function (i, node) { 29986 var seg = segs[i]; 29987 var el = $(node); 29988 if (hasEventRenderHandlers) { 29989 el = _this.filterEventRenderEl(seg.footprint, el); 29990 } 29991 if (el) { 29992 el.data('fc-seg', seg); // used by handlers 29993 seg.el = el; 29994 renderedSegs.push(seg); 29995 } 29996 }); 29997 } 29998 return renderedSegs; 29999 }; 30000 EventRenderer.prototype.beforeFgSegHtml = function (seg) { 30001 }; 30002 // Generates the HTML for the default rendering of a foreground event segment. Used by renderFgSegEls() 30003 EventRenderer.prototype.fgSegHtml = function (seg, disableResizing) { 30004 // subclasses should implement 30005 }; 30006 // Generic utility for generating the HTML classNames for an event segment's element 30007 EventRenderer.prototype.getSegClasses = function (seg, isDraggable, isResizable) { 30008 var classes = [ 30009 'fc-event', 30010 seg.isStart ? 'fc-start' : 'fc-not-start', 30011 seg.isEnd ? 'fc-end' : 'fc-not-end' 30012 ].concat(this.getClasses(seg.footprint.eventDef)); 30013 if (isDraggable) { 30014 classes.push('fc-draggable'); 30015 } 30016 if (isResizable) { 30017 classes.push('fc-resizable'); 30018 } 30019 // event is currently selected? attach a className. 30020 if (this.view.isEventDefSelected(seg.footprint.eventDef)) { 30021 classes.push('fc-selected'); 30022 } 30023 return classes; 30024 }; 30025 // Given an event and the default element used for rendering, returns the element that should actually be used. 30026 // Basically runs events and elements through the eventRender hook. 30027 EventRenderer.prototype.filterEventRenderEl = function (eventFootprint, el) { 30028 var legacy = eventFootprint.getEventLegacy(); 30029 var custom = this.view.publiclyTrigger('eventRender', { 30030 context: legacy, 30031 args: [legacy, el, this.view] 30032 }); 30033 if (custom === false) { 30034 el = null; 30035 } 30036 else if (custom && custom !== true) { 30037 el = $(custom); 30038 } 30039 return el; 30040 }; 30041 // Compute the text that should be displayed on an event's element. 30042 // `range` can be the Event object itself, or something range-like, with at least a `start`. 30043 // If event times are disabled, or the event has no time, will return a blank string. 30044 // If not specified, formatStr will default to the eventTimeFormat setting, 30045 // and displayEnd will default to the displayEventEnd setting. 30046 EventRenderer.prototype.getTimeText = function (eventFootprint, formatStr, displayEnd) { 30047 return this._getTimeText(eventFootprint.eventInstance.dateProfile.start, eventFootprint.eventInstance.dateProfile.end, eventFootprint.componentFootprint.isAllDay, formatStr, displayEnd); 30048 }; 30049 EventRenderer.prototype._getTimeText = function (start, end, isAllDay, formatStr, displayEnd) { 30050 if (formatStr == null) { 30051 formatStr = this.eventTimeFormat; 30052 } 30053 if (displayEnd == null) { 30054 displayEnd = this.displayEventEnd; 30055 } 30056 if (this.displayEventTime && !isAllDay) { 30057 if (displayEnd && end) { 30058 return this.view.formatRange({ start: start, end: end }, false, // allDay 30059 formatStr); 30060 } 30061 else { 30062 return start.format(formatStr); 30063 } 30064 } 30065 return ''; 30066 }; 30067 EventRenderer.prototype.computeEventTimeFormat = function () { 30068 return this.opt('smallTimeFormat'); 30069 }; 30070 EventRenderer.prototype.computeDisplayEventTime = function () { 30071 return true; 30072 }; 30073 EventRenderer.prototype.computeDisplayEventEnd = function () { 30074 return true; 30075 }; 30076 EventRenderer.prototype.getBgClasses = function (eventDef) { 30077 var classNames = this.getClasses(eventDef); 30078 classNames.push('fc-bgevent'); 30079 return classNames; 30080 }; 30081 EventRenderer.prototype.getClasses = function (eventDef) {
30082 var objs = this.getStylingObjs(eventDef); 30083 var i; 30084 var classNames = []; 30085 for (i = 0; i < objs.length; i++) { 30086 classNames.push.apply(// append 30087 classNames, objs[i].eventClassName || objs[i].className || []); 30088 } 30089 return classNames; 30090 }; 30091 // Utility for generating event skin-related CSS properties 30092 EventRenderer.prototype.getSkinCss = function (eventDef) { 30093 return { 30094 'background-color': this.getBgColor(eventDef), 30095 'border-color': this.getBorderColor(eventDef), 30096 color: this.getTextColor(eventDef) 30097 }; 30098 }; 30099 // Queries for caller-specified color, then falls back to default 30100 EventRenderer.prototype.getBgColor = function (eventDef) { 30101 var objs = this.getStylingObjs(eventDef); 30102 var i; 30103 var val; 30104 for (i = 0; i < objs.length && !val; i++) { 30105 val = objs[i].eventBackgroundColor || objs[i].eventColor || 30106 objs[i].backgroundColor || objs[i].color; 30107 } 30108 if (!val) { 30109 val = this.opt('eventBackgroundColor') || this.opt('eventColor'); 30110 } 30111 return val; 30112 }; 30113 // Queries for caller-specified color, then falls back to default 30114 EventRenderer.prototype.getBorderColor = function (eventDef) { 30115 var objs = this.getStylingObjs(eventDef); 30116 var i; 30117 var val; 30118 for (i = 0; i < objs.length && !val; i++) { 30119 val = objs[i].eventBorderColor || objs[i].eventColor || 30120 objs[i].borderColor || objs[i].color; 30121 } 30122 if (!val) { 30123 val = this.opt('eventBorderColor') || this.opt('eventColor'); 30124 } 30125 return val; 30126 }; 30127 // Queries for caller-specified color, then falls back to default 30128 EventRenderer.prototype.getTextColor = function (eventDef) { 30129 var objs = this.getStylingObjs(eventDef); 30130 var i; 30131 var val; 30132 for (i = 0; i < objs.length && !val; i++) { 30133 val = objs[i].eventTextColor || 30134 objs[i].textColor; 30135 } 30136 if (!val) { 30137 val = this.opt('eventTextColor'); 30138 } 30139 return val; 30140 }; 30141 EventRenderer.prototype.getStylingObjs = function (eventDef) { 30142 var objs = this.getFallbackStylingObjs(eventDef); 30143 objs.unshift(eventDef); 30144 return objs; 30145 }; 30146 EventRenderer.prototype.getFallbackStylingObjs = function (eventDef) { 30147 return [eventDef.source]; 30148 }; 30149 EventRenderer.prototype.sortEventSegs = function (segs) { 30150 segs.sort(util_1.proxy(this, 'compareEventSegs')); 30151 }; 30152 // A cmp function for determining which segments should take visual priority 30153 EventRenderer.prototype.compareEventSegs = function (seg1, seg2) { 30154 var f1 = seg1.footprint; 30155 var f2 = seg2.footprint; 30156 var cf1 = f1.componentFootprint; 30157 var cf2 = f2.componentFootprint; 30158 var r1 = cf1.unzonedRange; 30159 var r2 = cf2.unzonedRange; 30160 return r1.startMs - r2.startMs || // earlier events go first 30161 (r2.endMs - r2.startMs) - (r1.endMs - r1.startMs) || // tie? longer events go first 30162 cf2.isAllDay - cf1.isAllDay || // tie? put all-day events first (booleans cast to 0/1) 30163 util_1.compareByFieldSpecs(f1.eventDef, f2.eventDef, this.view.eventOrderSpecs, f1.eventDef.miscProps, f2.eventDef.miscProps); 30164 }; 30165 return EventRenderer; 30166}()); 30167exports.default = EventRenderer; 30168 30169 30170/***/ }), 30171/* 43 */, 30172/* 44 */, 30173/* 45 */, 30174/* 46 */, 30175/* 47 */ 30176/***/ (function(module, exports, __webpack_require__) { 30177 30178Object.defineProperty(exports, "__esModule", { value: true }); 30179var moment_ext_1 = __webpack_require__(10); 30180// Plugin 30181// ------------------------------------------------------------------------------------------------- 30182moment_ext_1.newMomentProto.format = function () { 30183 if (this._fullCalendar && arguments[0]) { 30184 return formatDate(this, arguments[0]); // our extended formatting 30185 } 30186 if (this._ambigTime) { 30187 return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD'); 30188 } 30189 if (this._ambigZone) { 30190 return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD[T]HH:mm:ss'); 30191 } 30192 if (this._fullCalendar) { 30193 // moment.format() doesn't ensure english, but we want to. 30194 return moment_ext_1.oldMomentFormat(englishMoment(this)); 30195 } 30196 return moment_ext_1.oldMomentProto.format.apply(this, arguments); 30197}; 30198moment_ext_1.newMomentProto.toISOString = function () { 30199 if (this._ambigTime) { 30200 return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD'); 30201 } 30202 if (this._ambigZone) { 30203 return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD[T]HH:mm:ss'); 30204 } 30205 if (this._fullCalendar) { 30206 // depending on browser, moment might not output english. ensure english. 30207 // https://github.com/moment/moment/blob/2.18.1/src/lib/moment/format.js#L22 30208 return moment_ext_1.oldMomentProto.toISOString.apply(englishMoment(this), arguments); 30209 } 30210 return moment_ext_1.oldMomentProto.toISOString.apply(this, arguments); 30211}; 30212function englishMoment(mom) { 30213 if (mom.locale() !== 'en') { 30214 return mom.clone().locale('en'); 30215 } 30216 return mom; 30217} 30218// Config 30219// --------------------------------------------------------------------------------------------------------------------- 30220/* 30221Inserted between chunks in the fake ("intermediate") formatting string. 30222Important that it passes as whitespace (\s) because moment often identifies non-standalone months 30223via a regexp with an \s. 30224*/ 30225var PART_SEPARATOR = '\u000b'; // vertical tab 30226/* 30227Inserted as the first character of a literal-text chunk to indicate that the literal text is not actually literal text, 30228but rather, a "special" token that has custom rendering (see specialTokens map). 30229*/ 30230var SPECIAL_TOKEN_MARKER = '\u001f'; // information separator 1 30231/* 30232Inserted at the beginning and end of a span of text that must have non-zero numeric characters. 30233Handling of these markers is done in a post-processing step at the very end of text rendering. 30234*/ 30235var MAYBE_MARKER = '\u001e'; // information separator 2 30236var MAYBE_REGEXP = new RegExp(MAYBE_MARKER + '([^' + MAYBE_MARKER + ']*)' + MAYBE_MARKER, 'g'); // must be global 30237/* 30238Addition formatting tokens we want recognized 30239*/ 30240var specialTokens = { 30241 t: function (date) { 30242 return moment_ext_1.oldMomentFormat(date, 'a').charAt(0); 30243 }, 30244 T: function (date) { 30245 return moment_ext_1.oldMomentFormat(date, 'A').charAt(0); 30246 } 30247}; 30248/* 30249The first characters of formatting tokens for units that are 1 day or larger. 30250`value` is for ranking relative size (lower means bigger).
30251`unit` is a normalized unit, used for comparing moments. 30252*/ 30253var largeTokenMap = { 30254 Y: { value: 1, unit: 'year' }, 30255 M: { value: 2, unit: 'month' }, 30256 W: { value: 3, unit: 'week' }, 30257 w: { value: 3, unit: 'week' }, 30258 D: { value: 4, unit: 'day' }, 30259 d: { value: 4, unit: 'day' } // day of week 30260}; 30261// Single Date Formatting 30262// --------------------------------------------------------------------------------------------------------------------- 30263/* 30264Formats `date` with a Moment formatting string, but allow our non-zero areas and special token 30265*/ 30266function formatDate(date, formatStr) { 30267 return renderFakeFormatString(getParsedFormatString(formatStr).fakeFormatString, date); 30268} 30269exports.formatDate = formatDate; 30270// Date Range Formatting 30271// ------------------------------------------------------------------------------------------------- 30272// TODO: make it work with timezone offset 30273/* 30274Using a formatting string meant for a single date, generate a range string, like 30275"Sep 2 - 9 2013", that intelligently inserts a separator where the dates differ. 30276If the dates are the same as far as the format string is concerned, just return a single 30277rendering of one date, without any separator. 30278*/ 30279function formatRange(date1, date2, formatStr, separator, isRTL) { 30280 var localeData; 30281 date1 = moment_ext_1.default.parseZone(date1); 30282 date2 = moment_ext_1.default.parseZone(date2); 30283 localeData = date1.localeData(); 30284 // Expand localized format strings, like "LL" -> "MMMM D YYYY". 30285 // BTW, this is not important for `formatDate` because it is impossible to put custom tokens 30286 // or non-zero areas in Moment's localized format strings. 30287 formatStr = localeData.longDateFormat(formatStr) || formatStr; 30288 return renderParsedFormat(getParsedFormatString(formatStr), date1, date2, separator || ' - ', isRTL); 30289} 30290exports.formatRange = formatRange; 30291/* 30292Renders a range with an already-parsed format string. 30293*/ 30294function renderParsedFormat(parsedFormat, date1, date2, separator, isRTL) { 30295 var sameUnits = parsedFormat.sameUnits; 30296 var unzonedDate1 = date1.clone().stripZone(); // for same-unit comparisons 30297 var unzonedDate2 = date2.clone().stripZone(); // " 30298 var renderedParts1 = renderFakeFormatStringParts(parsedFormat.fakeFormatString, date1); 30299 var renderedParts2 = renderFakeFormatStringParts(parsedFormat.fakeFormatString, date2); 30300 var leftI; 30301 var leftStr = ''; 30302 var rightI; 30303 var rightStr = ''; 30304 var middleI; 30305 var middleStr1 = ''; 30306 var middleStr2 = ''; 30307 var middleStr = ''; 30308 // Start at the leftmost side of the formatting string and continue until you hit a token 30309 // that is not the same between dates. 30310 for (leftI = 0; leftI < sameUnits.length && (!sameUnits[leftI] || unzonedDate1.isSame(unzonedDate2, sameUnits[leftI])); leftI++) { 30311 leftStr += renderedParts1[leftI]; 30312 } 30313 // Similarly, start at the rightmost side of the formatting string and move left 30314 for (rightI = sameUnits.length - 1; rightI > leftI && (!sameUnits[rightI] || unzonedDate1.isSame(unzonedDate2, sameUnits[rightI])); rightI--) { 30315 // If current chunk is on the boundary of unique date-content, and is a special-case 30316 // date-formatting postfix character, then don't consume it. Consider it unique date-content. 30317 // TODO: make configurable 30318 if (rightI - 1 === leftI && renderedParts1[rightI] === '.') { 30319 break; 30320 } 30321 rightStr = renderedParts1[rightI] + rightStr; 30322 } 30323 // The area in the middle is different for both of the dates. 30324 // Collect them distinctly so we can jam them together later. 30325 for (middleI = leftI; middleI <= rightI; middleI++) { 30326 middleStr1 += renderedParts1[middleI]; 30327 middleStr2 += renderedParts2[middleI]; 30328 } 30329 if (middleStr1 || middleStr2) { 30330 if (isRTL) { 30331 middleStr = middleStr2 + separator + middleStr1; 30332 } 30333 else { 30334 middleStr = middleStr1 + separator + middleStr2; 30335 } 30336 } 30337 return processMaybeMarkers(leftStr + middleStr + rightStr); 30338} 30339// Format String Parsing 30340// --------------------------------------------------------------------------------------------------------------------- 30341var parsedFormatStrCache = {}; 30342/*
30343Returns a parsed format string, leveraging a cache. 30344*/ 30345function getParsedFormatString(formatStr) { 30346 return parsedFormatStrCache[formatStr] || 30347 (parsedFormatStrCache[formatStr] = parseFormatString(formatStr)); 30348} 30349/* 30350Parses a format string into the following: 30351- fakeFormatString: a momentJS formatting string, littered with special control characters that get post-processed. 30352- sameUnits: for every part in fakeFormatString, if the part is a token, the value will be a unit string (like "day"), 30353 that indicates how similar a range's start & end must be in order to share the same formatted text. 30354 If not a token, then the value is null. 30355 Always a flat array (not nested liked "chunks"). 30356*/ 30357function parseFormatString(formatStr) { 30358 var chunks = chunkFormatString(formatStr); 30359 return { 30360 fakeFormatString: buildFakeFormatString(chunks), 30361 sameUnits: buildSameUnits(chunks) 30362 }; 30363} 30364/* 30365Break the formatting string into an array of chunks. 30366A 'maybe' chunk will have nested chunks. 30367*/ 30368function chunkFormatString(formatStr) { 30369 var chunks = []; 30370 var match; 30371 // TODO: more descrimination 30372 // \4 is a backreference to the first character of a multi-character set. 30373 var chunker = /\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g; 30374 while ((match = chunker.exec(formatStr))) { 30375 if (match[1]) { 30376 chunks.push.apply(chunks, // append 30377 splitStringLiteral(match[1])); 30378 } 30379 else if (match[2]) { 30380 chunks.push({ maybe: chunkFormatString(match[2]) }); 30381 } 30382 else if (match[3]) { 30383 chunks.push({ token: match[3] }); 30384 } 30385 else if (match[5]) { 30386 chunks.push.apply(chunks, // append 30387 splitStringLiteral(match[5])); 30388 } 30389 } 30390 return chunks; 30391} 30392/* 30393Potentially splits a literal-text string into multiple parts. For special cases. 30394*/ 30395function splitStringLiteral(s) { 30396 if (s === '. ') { 30397 return ['.', ' ']; // for locales with periods bound to the end of each year/month/date 30398 } 30399 else { 30400 return [s]; 30401 } 30402} 30403/* 30404Given chunks parsed from a real format string, generate a fake (aka "intermediate") format string with special control 30405characters that will eventually be given to moment for formatting, and then post-processed. 30406*/ 30407function buildFakeFormatString(chunks) { 30408 var parts = []; 30409 var i; 30410 var chunk; 30411 for (i = 0; i < chunks.length; i++) { 30412 chunk = chunks[i]; 30413 if (typeof chunk === 'string') { 30414 parts.push('[' + chunk + ']'); 30415 } 30416 else if (chunk.token) { 30417 if (chunk.token in specialTokens) { 30418 parts.push(SPECIAL_TOKEN_MARKER + // useful during post-processing 30419 '[' + chunk.token + ']' // preserve as literal text 30420 ); 30421 } 30422 else { 30423 parts.push(chunk.token); // unprotected text implies a format string 30424 } 30425 } 30426 else if (chunk.maybe) { 30427 parts.push(MAYBE_MARKER + // useful during post-processing 30428 buildFakeFormatString(chunk.maybe) + 30429 MAYBE_MARKER); 30430 } 30431 } 30432 return parts.join(PART_SEPARATOR); 30433} 30434/* 30435Given parsed chunks from a real formatting string, generates an array of unit strings (like "day") that indicate 30436in which regard two dates must be similar in order to share range formatting text. 30437The `chunks` can be nested (because of "maybe" chunks), however, the returned array will be flat. 30438*/ 30439function buildSameUnits(chunks) { 30440 var units = []; 30441 var i; 30442 var chunk; 30443 var tokenInfo; 30444 for (i = 0; i < chunks.length; i++) { 30445 chunk = chunks[i]; 30446 if (chunk.token) { 30447 tokenInfo = largeTokenMap[chunk.token.charAt(0)]; 30448 units.push(tokenInfo ? tokenInfo.unit : 'second'); // default to a very strict same-second 30449 } 30450 else if (chunk.maybe) { 30451 units.push.apply(units, // append 30452 buildSameUnits(chunk.maybe)); 30453 } 30454 else { 30455 units.push(null); 30456 } 30457 } 30458 return units; 30459} 30460// Rendering to text 30461// --------------------------------------------------------------------------------------------------------------------- 30462/*
30463Formats a date with a fake format string, post-processes the control characters, then returns. 30464*/ 30465function renderFakeFormatString(fakeFormatString, date) { 30466 return processMaybeMarkers(renderFakeFormatStringParts(fakeFormatString, date).join('')); 30467} 30468/* 30469Formats a date into parts that will have been post-processed, EXCEPT for the "maybe" markers. 30470*/ 30471function renderFakeFormatStringParts(fakeFormatString, date) { 30472 var parts = []; 30473 var fakeRender = moment_ext_1.oldMomentFormat(date, fakeFormatString); 30474 var fakeParts = fakeRender.split(PART_SEPARATOR); 30475 var i; 30476 var fakePart; 30477 for (i = 0; i < fakeParts.length; i++) { 30478 fakePart = fakeParts[i]; 30479 if (fakePart.charAt(0) === SPECIAL_TOKEN_MARKER) { 30480 parts.push( 30481 // the literal string IS the token's name. 30482 // call special token's registered function. 30483 specialTokens[fakePart.substring(1)](date)); 30484 } 30485 else { 30486 parts.push(fakePart); 30487 } 30488 } 30489 return parts; 30490} 30491/* 30492Accepts an almost-finally-formatted string and processes the "maybe" control characters, returning a new string. 30493*/ 30494function processMaybeMarkers(s) { 30495 return s.replace(MAYBE_REGEXP, function (m0, m1) { 30496 if (m1.match(/[1-9]/)) { 30497 return m1; 30498 } 30499 else { 30500 return ''; 30501 } 30502 }); 30503} 30504// Misc Utils 30505// ------------------------------------------------------------------------------------------------- 30506/* 30507Returns a unit string, either 'year', 'month', 'day', or null for the most granular formatting token in the string. 30508*/ 30509function queryMostGranularFormatUnit(formatStr) { 30510 var chunks = chunkFormatString(formatStr); 30511 var i; 30512 var chunk; 30513 var candidate; 30514 var best; 30515 for (i = 0; i < chunks.length; i++) { 30516 chunk = chunks[i]; 30517 if (chunk.token) { 30518 candidate = largeTokenMap[chunk.token.charAt(0)]; 30519 if (candidate) { 30520 if (!best || candidate.value > best.value) { 30521 best = candidate; 30522 } 30523 } 30524 } 30525 } 30526 if (best) { 30527 return best.unit; 30528 } 30529 return null; 30530} 30531exports.queryMostGranularFormatUnit = queryMostGranularFormatUnit; 30532 30533 30534/***/ }), 30535/* 48 */ 30536/***/ (function(module, exports, __webpack_require__) { 30537 30538Object.defineProperty(exports, "__esModule", { value: true }); 30539var tslib_1 = __webpack_require__(2); 30540var Class_1 = __webpack_require__(33); 30541var EmitterMixin_1 = __webpack_require__(11); 30542var ListenerMixin_1 = __webpack_require__(7); 30543var Model = /** @class */ (function (_super) { 30544 tslib_1.__extends(Model, _super); 30545 function Model() { 30546 var _this = _super.call(this) || this; 30547 _this._watchers = {}; 30548 _this._props = {}; 30549 _this.applyGlobalWatchers(); 30550 _this.constructed(); 30551 return _this; 30552 } 30553 Model.watch = function (name) { 30554 var args = []; 30555 for (var _i = 1; _i < arguments.length; _i++) { 30556 args[_i - 1] = arguments[_i]; 30557 } 30558 // subclasses should make a masked-copy of the superclass's map 30559 // TODO: write test 30560 if (!this.prototype.hasOwnProperty('_globalWatchArgs')) { 30561 this.prototype._globalWatchArgs = Object.create(this.prototype._globalWatchArgs); 30562 } 30563 this.prototype._globalWatchArgs[name] = args; 30564 }; 30565 Model.prototype.constructed = function () { 30566 // useful for monkeypatching. TODO: BaseClass? 30567 }; 30568 Model.prototype.applyGlobalWatchers = function () { 30569 var map = this._globalWatchArgs; 30570 var name; 30571 for (name in map) { 30572 this.watch.apply(this, [name].concat(map[name])); 30573 } 30574 }; 30575 Model.prototype.has = function (name) { 30576 return name in this._props; 30577 }; 30578 Model.prototype.get = function (name) { 30579 if (name === undefined) { 30580 return this._props; 30581 } 30582 return this._props[name]; 30583 }; 30584 Model.prototype.set = function (name, val) { 30585 var newProps; 30586 if (typeof name === 'string') { 30587 newProps = {}; 30588 newProps[name] = val === undefined ? null : val; 30589 } 30590 else { 30591 newProps = name; 30592 } 30593 this.setProps(newProps); 30594 }; 30595 Model.prototype.reset = function (newProps) { 30596 var oldProps = this._props; 30597 var changeset = {}; // will have undefined's to signal unsets 30598 var name; 30599 for (name in oldProps) { 30600 changeset[name] = undefined; 30601 } 30602 for (name in newProps) { 30603 changeset[name] = newProps[name]; 30604 } 30605 this.setProps(changeset); 30606 }; 30607 Model.prototype.unset = function (name) { 30608 var newProps = {}; 30609 var names; 30610 var i; 30611 if (typeof name === 'string') { 30612 names = [name]; 30613 } 30614 else { 30615 names = name; 30616 } 30617 for (i = 0; i < names.length; i++) { 30618 newProps[names[i]] = undefined; 30619 } 30620 this.setProps(newProps); 30621 }; 30622 Model.prototype.setProps = function (newProps) { 30623 var changedProps = {}; 30624 var changedCnt = 0; 30625 var name; 30626 var val; 30627 for (name in newProps) { 30628 val = newProps[name]; 30629 // a change in value? 30630 // if an object, don't check equality, because might have been mutated internally. 30631 // TODO: eventually enforce immutability. 30632 if (typeof val === 'object' || 30633 val !== this._props[name]) { 30634 changedProps[name] = val; 30635 changedCnt++; 30636 } 30637 } 30638 if (changedCnt) { 30639 this.trigger('before:batchChange', changedProps); 30640 for (name in changedProps) { 30641 val = changedProps[name]; 30642 this.trigger('before:change', name, val); 30643 this.trigger('before:change:' + name, val); 30644 } 30645 for (name in changedProps) { 30646 val = changedProps[name]; 30647 if (val === undefined) { 30648 delete this._props[name]; 30649 } 30650 else { 30651 this._props[name] = val; 30652 } 30653 this.trigger('change:' + name, val); 30654 this.trigger('change', name, val); 30655 } 30656 this.trigger('batchChange', changedProps); 30657 } 30658 }; 30659 Model.prototype.watch = function (name, depList, startFunc, stopFunc) { 30660 var _this = this; 30661 this.unwatch(name); 30662 this._watchers[name] = this._watchDeps(depList, function (deps) { 30663 var res = startFunc.call(_this, deps); 30664 if (res && res.then) { 30665 _this.unset(name); // put in an unset state while resolving 30666 res.then(function (val) { 30667 _this.set(name, val); 30668 }); 30669 } 30670 else { 30671 _this.set(name, res); 30672 } 30673 }, function (deps) { 30674 _this.unset(name); 30675 if (stopFunc) { 30676 stopFunc.call(_this, deps); 30677 } 30678 }); 30679 }; 30680 Model.prototype.unwatch = function (name) { 30681 var watcher = this._watchers[name]; 30682 if (watcher) { 30683 delete this._watchers[name]; 30684 watcher.teardown(); 30685 } 30686 }; 30687 Model.prototype._watchDeps = function (depList, startFunc, stopFunc) { 30688 var _this = this; 30689 var queuedChangeCnt = 0; 30690 var depCnt = depList.length; 30691 var satisfyCnt = 0; 30692 var values = {}; // what's passed as the `deps` arguments 30693 var bindTuples = []; // array of [ eventName, handlerFunc ] arrays 30694 var isCallingStop = false;
30695 var onBeforeDepChange = function (depName, val, isOptional) { 30696 queuedChangeCnt++; 30697 if (queuedChangeCnt === 1) { 30698 if (satisfyCnt === depCnt) { 30699 isCallingStop = true; 30700 stopFunc(values); 30701 isCallingStop = false; 30702 } 30703 } 30704 }; 30705 var onDepChange = function (depName, val, isOptional) { 30706 if (val === undefined) { 30707 // required dependency that was previously set? 30708 if (!isOptional && values[depName] !== undefined) { 30709 satisfyCnt--; 30710 } 30711 delete values[depName]; 30712 } 30713 else { 30714 // required dependency that was previously unset? 30715 if (!isOptional && values[depName] === undefined) { 30716 satisfyCnt++; 30717 } 30718 values[depName] = val; 30719 } 30720 queuedChangeCnt--; 30721 if (!queuedChangeCnt) { 30722 // now finally satisfied or satisfied all along? 30723 if (satisfyCnt === depCnt) { 30724 // if the stopFunc initiated another value change, ignore it. 30725 // it will be processed by another change event anyway. 30726 if (!isCallingStop) { 30727 startFunc(values); 30728 } 30729 } 30730 } 30731 }; 30732 // intercept for .on() that remembers handlers 30733 var bind = function (eventName, handler) { 30734 _this.on(eventName, handler); 30735 bindTuples.push([eventName, handler]); 30736 }; 30737 // listen to dependency changes 30738 depList.forEach(function (depName) { 30739 var isOptional = false;
30740 if (depName.charAt(0) === '?') { 30741 depName = depName.substring(1); 30742 isOptional = true; 30743 } 30744 bind('before:change:' + depName, function (val) { 30745 onBeforeDepChange(depName, val, isOptional); 30746 }); 30747 bind('change:' + depName, function (val) { 30748 onDepChange(depName, val, isOptional); 30749 }); 30750 }); 30751 // process current dependency values 30752 depList.forEach(function (depName) { 30753 var isOptional = false; 30754 if (depName.charAt(0) === '?') { 30755 depName = depName.substring(1); 30756 isOptional = true; 30757 } 30758 if (_this.has(depName)) { 30759 values[depName] = _this.get(depName); 30760 satisfyCnt++; 30761 } 30762 else if (isOptional) { 30763 satisfyCnt++; 30764 } 30765 }); 30766 // initially satisfied 30767 if (satisfyCnt === depCnt) { 30768 startFunc(values); 30769 } 30770 return { 30771 teardown: function () { 30772 // remove all handlers 30773 for (var i = 0; i < bindTuples.length; i++) { 30774 _this.off(bindTuples[i][0], bindTuples[i][1]); 30775 } 30776 bindTuples = null; 30777 // was satisfied, so call stopFunc 30778 if (satisfyCnt === depCnt) { 30779 stopFunc(); 30780 } 30781 }, 30782 flash: function () { 30783 if (satisfyCnt === depCnt) { 30784 stopFunc(); 30785 startFunc(values); 30786 } 30787 } 30788 }; 30789 }; 30790 Model.prototype.flash = function (name) { 30791 var watcher = this._watchers[name]; 30792 if (watcher) { 30793 watcher.flash(); 30794 } 30795 }; 30796 return Model; 30797}(Class_1.default)); 30798exports.default = Model; 30799Model.prototype._globalWatchArgs = {}; // mutation protection in Model.watch 30800EmitterMixin_1.default.mixInto(Model); 30801ListenerMixin_1.default.mixInto(Model); 30802 30803 30804/***/ }), 30805/* 49 */ 30806/***/ (function(module, exports, __webpack_require__) { 30807 30808Object.defineProperty(exports, "__esModule", { value: true }); 30809var moment = __webpack_require__(0); 30810var util_1 = __webpack_require__(4); 30811var SingleEventDef_1 = __webpack_require__(13); 30812var RecurringEventDef_1 = __webpack_require__(210); 30813exports.default = { 30814 parse: function (eventInput, source) { 30815 if (util_1.isTimeString(eventInput.start) || moment.isDuration(eventInput.start) || 30816 util_1.isTimeString(eventInput.end) || moment.isDuration(eventInput.end)) { 30817 return RecurringEventDef_1.default.parse(eventInput, source); 30818 } 30819 else { 30820 return SingleEventDef_1.default.parse(eventInput, source); 30821 } 30822 } 30823}; 30824 30825 30826/***/ }), 30827/* 50 */ 30828/***/ (function(module, exports, __webpack_require__) { 30829 30830Object.defineProperty(exports, "__esModule", { value: true }); 30831var util_1 = __webpack_require__(4); 30832var EventDateProfile_1 = __webpack_require__(17); 30833var EventDefDateMutation = /** @class */ (function () { 30834 function EventDefDateMutation() { 30835 this.clearEnd = false; 30836 this.forceTimed = false; 30837 this.forceAllDay = false; 30838 } 30839 EventDefDateMutation.createFromDiff = function (dateProfile0, dateProfile1, largeUnit) { 30840 var clearEnd = dateProfile0.end && !dateProfile1.end; 30841 var forceTimed = dateProfile0.isAllDay() && !dateProfile1.isAllDay(); 30842 var forceAllDay = !dateProfile0.isAllDay() && dateProfile1.isAllDay(); 30843 var dateDelta; 30844 var endDiff; 30845 var endDelta; 30846 var mutation; 30847 // subtracts the dates in the appropriate way, returning a duration 30848 function subtractDates(date1, date0) { 30849 if (largeUnit) { 30850 return util_1.diffByUnit(date1, date0, largeUnit); // poorly named 30851 } 30852 else if (dateProfile1.isAllDay()) { 30853 return util_1.diffDay(date1, date0); // poorly named 30854 } 30855 else { 30856 return util_1.diffDayTime(date1, date0); // poorly named 30857 } 30858 } 30859 dateDelta = subtractDates(dateProfile1.start, dateProfile0.start); 30860 if (dateProfile1.end) { 30861 // use unzonedRanges because dateProfile0.end might be null 30862 endDiff = subtractDates(dateProfile1.unzonedRange.getEnd(), dateProfile0.unzonedRange.getEnd()); 30863 endDelta = endDiff.subtract(dateDelta); 30864 } 30865 mutation = new EventDefDateMutation(); 30866 mutation.clearEnd = clearEnd; 30867 mutation.forceTimed = forceTimed; 30868 mutation.forceAllDay = forceAllDay; 30869 mutation.setDateDelta(dateDelta); 30870 mutation.setEndDelta(endDelta); 30871 return mutation; 30872 }; 30873 /* 30874 returns an undo function. 30875 */ 30876 EventDefDateMutation.prototype.buildNewDateProfile = function (eventDateProfile, calendar) { 30877 var start = eventDateProfile.start.clone(); 30878 var end = null; 30879 var shouldRezone = false;
30880 if (eventDateProfile.end && !this.clearEnd) { 30881 end = eventDateProfile.end.clone(); 30882 } 30883 else if (this.endDelta && !end) { 30884 end = calendar.getDefaultEventEnd(eventDateProfile.isAllDay(), start); 30885 } 30886 if (this.forceTimed) { 30887 shouldRezone = true; 30888 if (!start.hasTime()) { 30889 start.time(0); 30890 } 30891 if (end && !end.hasTime()) { 30892 end.time(0); 30893 } 30894 } 30895 else if (this.forceAllDay) { 30896 if (start.hasTime()) { 30897 start.stripTime(); 30898 } 30899 if (end && end.hasTime()) { 30900 end.stripTime(); 30901 } 30902 } 30903 if (this.dateDelta) { 30904 shouldRezone = true; 30905 start.add(this.dateDelta); 30906 if (end) { 30907 end.add(this.dateDelta); 30908 } 30909 } 30910 // do this before adding startDelta to start, so we can work off of start 30911 if (this.endDelta) { 30912 shouldRezone = true; 30913 end.add(this.endDelta); 30914 } 30915 if (this.startDelta) { 30916 shouldRezone = true; 30917 start.add(this.startDelta); 30918 } 30919 if (shouldRezone) { 30920 start = calendar.applyTimezone(start); 30921 if (end) { 30922 end = calendar.applyTimezone(end); 30923 } 30924 } 30925 // TODO: okay to access calendar option? 30926 if (!end && calendar.opt('forceEventDuration')) { 30927 end = calendar.getDefaultEventEnd(eventDateProfile.isAllDay(), start); 30928 } 30929 return new EventDateProfile_1.default(start, end, calendar); 30930 }; 30931 EventDefDateMutation.prototype.setDateDelta = function (dateDelta) { 30932 if (dateDelta && dateDelta.valueOf()) { 30933 this.dateDelta = dateDelta; 30934 } 30935 else { 30936 this.dateDelta = null; 30937 } 30938 }; 30939 EventDefDateMutation.prototype.setStartDelta = function (startDelta) { 30940 if (startDelta && startDelta.valueOf()) { 30941 this.startDelta = startDelta; 30942 } 30943 else { 30944 this.startDelta = null; 30945 } 30946 }; 30947 EventDefDateMutation.prototype.setEndDelta = function (endDelta) { 30948 if (endDelta && endDelta.valueOf()) { 30949 this.endDelta = endDelta; 30950 } 30951 else { 30952 this.endDelta = null; 30953 } 30954 }; 30955 EventDefDateMutation.prototype.isEmpty = function () { 30956 return !this.clearEnd && !this.forceTimed && !this.forceAllDay && 30957 !this.dateDelta && !this.startDelta && !this.endDelta; 30958 }; 30959 return EventDefDateMutation; 30960}()); 30961exports.default = EventDefDateMutation; 30962 30963 30964/***/ }), 30965/* 51 */ 30966/***/ (function(module, exports, __webpack_require__) { 30967 30968Object.defineProperty(exports, "__esModule", { value: true }); 30969var StandardTheme_1 = __webpack_require__(213); 30970var JqueryUiTheme_1 = __webpack_require__(214); 30971var themeClassHash = {}; 30972function defineThemeSystem(themeName, themeClass) { 30973 themeClassHash[themeName] = themeClass; 30974} 30975exports.defineThemeSystem = defineThemeSystem; 30976function getThemeSystemClass(themeSetting) { 30977 if (!themeSetting) { 30978 return StandardTheme_1.default; 30979 } 30980 else if (themeSetting === true) { 30981 return JqueryUiTheme_1.default; 30982 } 30983 else { 30984 return themeClassHash[themeSetting]; 30985 } 30986} 30987exports.getThemeSystemClass = getThemeSystemClass; 30988 30989 30990/***/ }), 30991/* 52 */ 30992/***/ (function(module, exports, __webpack_require__) { 30993 30994Object.defineProperty(exports, "__esModule", { value: true }); 30995var tslib_1 = __webpack_require__(2); 30996var $ = __webpack_require__(3); 30997var util_1 = __webpack_require__(4); 30998var Promise_1 = __webpack_require__(20); 30999var EventSource_1 = __webpack_require__(6); 31000var SingleEventDef_1 = __webpack_require__(13); 31001var ArrayEventSource = /** @class */ (function (_super) { 31002 tslib_1.__extends(ArrayEventSource, _super); 31003 function ArrayEventSource(calendar) { 31004 var _this = _super.call(this, calendar) || this; 31005 _this.eventDefs = []; // for if setRawEventDefs is never called 31006 return _this; 31007 } 31008 ArrayEventSource.parse = function (rawInput, calendar) { 31009 var rawProps; 31010 // normalize raw input 31011 if ($.isArray(rawInput.events)) { 31012 rawProps = rawInput; 31013 } 31014 else if ($.isArray(rawInput)) { 31015 rawProps = { events: rawInput }; 31016 } 31017 if (rawProps) { 31018 return EventSource_1.default.parse.call(this, rawProps, calendar); 31019 } 31020 return false;
31021 }; 31022 ArrayEventSource.prototype.setRawEventDefs = function (rawEventDefs) { 31023 this.rawEventDefs = rawEventDefs; 31024 this.eventDefs = this.parseEventDefs(rawEventDefs); 31025 }; 31026 ArrayEventSource.prototype.fetch = function (start, end, timezone) { 31027 var eventDefs = this.eventDefs; 31028 var i; 31029 if (this.currentTimezone != null && 31030 this.currentTimezone !== timezone) { 31031 for (i = 0; i < eventDefs.length; i++) { 31032 if (eventDefs[i] instanceof SingleEventDef_1.default) { 31033 eventDefs[i].rezone(); 31034 } 31035 } 31036 } 31037 this.currentTimezone = timezone; 31038 return Promise_1.default.resolve(eventDefs); 31039 }; 31040 ArrayEventSource.prototype.addEventDef = function (eventDef) { 31041 this.eventDefs.push(eventDef); 31042 }; 31043 /* 31044 eventDefId already normalized to a string 31045 */ 31046 ArrayEventSource.prototype.removeEventDefsById = function (eventDefId) { 31047 return util_1.removeMatching(this.eventDefs, function (eventDef) { 31048 return eventDef.id === eventDefId; 31049 }); 31050 }; 31051 ArrayEventSource.prototype.removeAllEventDefs = function () { 31052 this.eventDefs = []; 31053 }; 31054 ArrayEventSource.prototype.getPrimitive = function () { 31055 return this.rawEventDefs; 31056 }; 31057 ArrayEventSource.prototype.applyManualStandardProps = function (rawProps) { 31058 var superSuccess = _super.prototype.applyManualStandardProps.call(this, rawProps); 31059 this.setRawEventDefs(rawProps.events); 31060 return superSuccess; 31061 }; 31062 return ArrayEventSource; 31063}(EventSource_1.default)); 31064exports.default = ArrayEventSource; 31065ArrayEventSource.defineStandardProps({ 31066 events: false // don't automatically transfer 31067}); 31068 31069 31070/***/ }), 31071/* 53 */ 31072/***/ (function(module, exports, __webpack_require__) { 31073 31074Object.defineProperty(exports, "__esModule", { value: true }); 31075var $ = __webpack_require__(3); 31076var util_1 = __webpack_require__(4); 31077/* 31078A cache for the left/right/top/bottom/width/height values for one or more elements. 31079Works with both offset (from topleft document) and position (from offsetParent). 31080 31081options: 31082- els 31083- isHorizontal 31084- isVertical 31085*/ 31086var CoordCache = /** @class */ (function () { 31087 function CoordCache(options) { 31088 this.isHorizontal = false; // whether to query for left/right/width 31089 this.isVertical = false; // whether to query for top/bottom/height 31090 this.els = $(options.els); 31091 this.isHorizontal = options.isHorizontal; 31092 this.isVertical = options.isVertical; 31093 this.forcedOffsetParentEl = options.offsetParent ? $(options.offsetParent) : null; 31094 } 31095 // Queries the els for coordinates and stores them. 31096 // Call this method before using and of the get* methods below. 31097 CoordCache.prototype.build = function () { 31098 var offsetParentEl = this.forcedOffsetParentEl; 31099 if (!offsetParentEl && this.els.length > 0) { 31100 offsetParentEl = this.els.eq(0).offsetParent(); 31101 } 31102 this.origin = offsetParentEl ? 31103 offsetParentEl.offset() : 31104 null;
31105 this.boundingRect = this.queryBoundingRect(); 31106 if (this.isHorizontal) { 31107 this.buildElHorizontals(); 31108 } 31109 if (this.isVertical) { 31110 this.buildElVerticals(); 31111 } 31112 }; 31113 // Destroys all internal data about coordinates, freeing memory 31114 CoordCache.prototype.clear = function () { 31115 this.origin = null; 31116 this.boundingRect = null; 31117 this.lefts = null; 31118 this.rights = null; 31119 this.tops = null; 31120 this.bottoms = null; 31121 }; 31122 // When called, if coord caches aren't built, builds them 31123 CoordCache.prototype.ensureBuilt = function () { 31124 if (!this.origin) { 31125 this.build(); 31126 } 31127 }; 31128 // Populates the left/right internal coordinate arrays 31129 CoordCache.prototype.buildElHorizontals = function () { 31130 var lefts = []; 31131 var rights = []; 31132 this.els.each(function (i, node) { 31133 var el = $(node); 31134 var left = el.offset().left; 31135 var width = el.outerWidth(); 31136 lefts.push(left); 31137 rights.push(left + width); 31138 }); 31139 this.lefts = lefts; 31140 this.rights = rights; 31141 }; 31142 // Populates the top/bottom internal coordinate arrays 31143 CoordCache.prototype.buildElVerticals = function () { 31144 var tops = []; 31145 var bottoms = []; 31146 this.els.each(function (i, node) { 31147 var el = $(node); 31148 var top = el.offset().top; 31149 var height = el.outerHeight(); 31150 tops.push(top); 31151 bottoms.push(top + height); 31152 }); 31153 this.tops = tops; 31154 this.bottoms = bottoms; 31155 }; 31156 // Given a left offset (from document left), returns the index of the el that it horizontally intersects. 31157 // If no intersection is made, returns undefined. 31158 CoordCache.prototype.getHorizontalIndex = function (leftOffset) { 31159 this.ensureBuilt(); 31160 var lefts = this.lefts; 31161 var rights = this.rights; 31162 var len = lefts.length; 31163 var i; 31164 for (i = 0; i < len; i++) { 31165 if (leftOffset >= lefts[i] && leftOffset < rights[i]) { 31166 return i; 31167 } 31168 } 31169 }; 31170 // Given a top offset (from document top), returns the index of the el that it vertically intersects. 31171 // If no intersection is made, returns undefined. 31172 CoordCache.prototype.getVerticalIndex = function (topOffset) { 31173 this.ensureBuilt(); 31174 var tops = this.tops; 31175 var bottoms = this.bottoms; 31176 var len = tops.length; 31177 var i; 31178 for (i = 0; i < len; i++) { 31179 if (topOffset >= tops[i] && topOffset < bottoms[i]) { 31180 return i; 31181 } 31182 } 31183 }; 31184 // Gets the left offset (from document left) of the element at the given index 31185 CoordCache.prototype.getLeftOffset = function (leftIndex) { 31186 this.ensureBuilt(); 31187 return this.lefts[leftIndex]; 31188 }; 31189 // Gets the left position (from offsetParent left) of the element at the given index 31190 CoordCache.prototype.getLeftPosition = function (leftIndex) { 31191 this.ensureBuilt(); 31192 return this.lefts[leftIndex] - this.origin.left; 31193 }; 31194 // Gets the right offset (from document left) of the element at the given index. 31195 // This value is NOT relative to the document's right edge, like the CSS concept of "right" would be. 31196 CoordCache.prototype.getRightOffset = function (leftIndex) { 31197 this.ensureBuilt(); 31198 return this.rights[leftIndex]; 31199 }; 31200 // Gets the right position (from offsetParent left) of the element at the given index. 31201 // This value is NOT relative to the offsetParent's right edge, like the CSS concept of "right" would be. 31202 CoordCache.prototype.getRightPosition = function (leftIndex) { 31203 this.ensureBuilt(); 31204 return this.rights[leftIndex] - this.origin.left; 31205 }; 31206 // Gets the width of the element at the given index 31207 CoordCache.prototype.getWidth = function (leftIndex) { 31208 this.ensureBuilt(); 31209 return this.rights[leftIndex] - this.lefts[leftIndex]; 31210 }; 31211 // Gets the top offset (from document top) of the element at the given index 31212 CoordCache.prototype.getTopOffset = function (topIndex) { 31213 this.ensureBuilt(); 31214 return this.tops[topIndex]; 31215 }; 31216 // Gets the top position (from offsetParent top) of the element at the given position 31217 CoordCache.prototype.getTopPosition = function (topIndex) { 31218 this.ensureBuilt(); 31219 return this.tops[topIndex] - this.origin.top; 31220 }; 31221 // Gets the bottom offset (from the document top) of the element at the given index. 31222 // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be. 31223 CoordCache.prototype.getBottomOffset = function (topIndex) { 31224 this.ensureBuilt(); 31225 return this.bottoms[topIndex]; 31226 }; 31227 // Gets the bottom position (from the offsetParent top) of the element at the given index. 31228 // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be. 31229 CoordCache.prototype.getBottomPosition = function (topIndex) { 31230 this.ensureBuilt(); 31231 return this.bottoms[topIndex] - this.origin.top; 31232 }; 31233 // Gets the height of the element at the given index 31234 CoordCache.prototype.getHeight = function (topIndex) { 31235 this.ensureBuilt(); 31236 return this.bottoms[topIndex] - this.tops[topIndex]; 31237 }; 31238 // Bounding Rect 31239 // TODO: decouple this from CoordCache 31240 // Compute and return what the elements' bounding rectangle is, from the user's perspective. 31241 // Right now, only returns a rectangle if constrained by an overflow:scroll element. 31242 // Returns null if there are no elements 31243 CoordCache.prototype.queryBoundingRect = function () { 31244 var scrollParentEl; 31245 if (this.els.length > 0) { 31246 scrollParentEl = util_1.getScrollParent(this.els.eq(0)); 31247 if (!scrollParentEl.is(document)) { 31248 return util_1.getClientRect(scrollParentEl); 31249 } 31250 } 31251 return null; 31252 }; 31253 CoordCache.prototype.isPointInBounds = function (leftOffset, topOffset) { 31254 return this.isLeftInBounds(leftOffset) && this.isTopInBounds(topOffset); 31255 }; 31256 CoordCache.prototype.isLeftInBounds = function (leftOffset) { 31257 return !this.boundingRect || (leftOffset >= this.boundingRect.left && leftOffset < this.boundingRect.right); 31258 }; 31259 CoordCache.prototype.isTopInBounds = function (topOffset) { 31260 return !this.boundingRect || (topOffset >= this.boundingRect.top && topOffset < this.boundingRect.bottom); 31261 }; 31262 return CoordCache; 31263}()); 31264exports.default = CoordCache; 31265 31266 31267/***/ }), 31268/* 54 */ 31269/***/ (function(module, exports, __webpack_require__) { 31270 31271Object.defineProperty(exports, "__esModule", { value: true }); 31272var $ = __webpack_require__(3); 31273var util_1 = __webpack_require__(4); 31274var ListenerMixin_1 = __webpack_require__(7); 31275var GlobalEmitter_1 = __webpack_require__(21); 31276/* Tracks a drag's mouse movement, firing various handlers 31277----------------------------------------------------------------------------------------------------------------------*/ 31278// TODO: use Emitter 31279var DragListener = /** @class */ (function () { 31280 function DragListener(options) { 31281 this.isInteracting = false;
31282 this.isDistanceSurpassed = false; 31283 this.isDelayEnded = false; 31284 this.isDragging = false; 31285 this.isTouch = false; 31286 this.isGeneric = false; // initiated by 'dragstart' (jqui) 31287 this.shouldCancelTouchScroll = true; 31288 this.scrollAlwaysKills = false; 31289 this.isAutoScroll = false; 31290 // defaults 31291 this.scrollSensitivity = 30; // pixels from edge for scrolling to start 31292 this.scrollSpeed = 200; // pixels per second, at maximum speed 31293 this.scrollIntervalMs = 50; // millisecond wait between scroll increment 31294 this.options = options || {}; 31295 } 31296 // Interaction (high-level) 31297 // ----------------------------------------------------------------------------------------------------------------- 31298 DragListener.prototype.startInteraction = function (ev, extraOptions) { 31299 if (extraOptions === void 0) { extraOptions = {}; } 31300 if (ev.type === 'mousedown') { 31301 if (GlobalEmitter_1.default.get().shouldIgnoreMouse()) { 31302 return; 31303 } 31304 else if (!util_1.isPrimaryMouseButton(ev)) { 31305 return; 31306 } 31307 else { 31308 ev.preventDefault(); // prevents native selection in most browsers 31309 } 31310 } 31311 if (!this.isInteracting) { 31312 // process options 31313 this.delay = util_1.firstDefined(extraOptions.delay, this.options.delay, 0); 31314 this.minDistance = util_1.firstDefined(extraOptions.distance, this.options.distance, 0); 31315 this.subjectEl = this.options.subjectEl; 31316 util_1.preventSelection($('body')); 31317 this.isInteracting = true; 31318 this.isTouch = util_1.getEvIsTouch(ev); 31319 this.isGeneric = ev.type === 'dragstart'; 31320 this.isDelayEnded = false; 31321 this.isDistanceSurpassed = false; 31322 this.originX = util_1.getEvX(ev); 31323 this.originY = util_1.getEvY(ev); 31324 this.scrollEl = util_1.getScrollParent($(ev.target)); 31325 this.bindHandlers(); 31326 this.initAutoScroll(); 31327 this.handleInteractionStart(ev); 31328 this.startDelay(ev); 31329 if (!this.minDistance) { 31330 this.handleDistanceSurpassed(ev); 31331 } 31332 } 31333 }; 31334 DragListener.prototype.handleInteractionStart = function (ev) { 31335 this.trigger('interactionStart', ev); 31336 }; 31337 DragListener.prototype.endInteraction = function (ev, isCancelled) { 31338 if (this.isInteracting) { 31339 this.endDrag(ev); 31340 if (this.delayTimeoutId) { 31341 clearTimeout(this.delayTimeoutId); 31342 this.delayTimeoutId = null; 31343 } 31344 this.destroyAutoScroll(); 31345 this.unbindHandlers(); 31346 this.isInteracting = false; 31347 this.handleInteractionEnd(ev, isCancelled); 31348 util_1.allowSelection($('body')); 31349 } 31350 }; 31351 DragListener.prototype.handleInteractionEnd = function (ev, isCancelled) { 31352 this.trigger('interactionEnd', ev, isCancelled || false); 31353 }; 31354 // Binding To DOM 31355 // ----------------------------------------------------------------------------------------------------------------- 31356 DragListener.prototype.bindHandlers = function () { 31357 // some browsers (Safari in iOS 10) don't allow preventDefault on touch events that are bound after touchstart, 31358 // so listen to the GlobalEmitter singleton, which is always bound, instead of the document directly. 31359 var globalEmitter = GlobalEmitter_1.default.get(); 31360 if (this.isGeneric) { 31361 this.listenTo($(document), { 31362 drag: this.handleMove, 31363 dragstop: this.endInteraction 31364 }); 31365 } 31366 else if (this.isTouch) { 31367 this.listenTo(globalEmitter, { 31368 touchmove: this.handleTouchMove, 31369 touchend: this.endInteraction, 31370 scroll: this.handleTouchScroll 31371 }); 31372 } 31373 else { 31374 this.listenTo(globalEmitter, { 31375 mousemove: this.handleMouseMove, 31376 mouseup: this.endInteraction 31377 }); 31378 } 31379 this.listenTo(globalEmitter, { 31380 selectstart: util_1.preventDefault, 31381 contextmenu: util_1.preventDefault // long taps would open menu on Chrome dev tools 31382 }); 31383 }; 31384 DragListener.prototype.unbindHandlers = function () { 31385 this.stopListeningTo(GlobalEmitter_1.default.get()); 31386 this.stopListeningTo($(document)); // for isGeneric 31387 }; 31388 // Drag (high-level) 31389 // ----------------------------------------------------------------------------------------------------------------- 31390 // extraOptions ignored if drag already started 31391 DragListener.prototype.startDrag = function (ev, extraOptions) { 31392 this.startInteraction(ev, extraOptions); // ensure interaction began 31393 if (!this.isDragging) { 31394 this.isDragging = true; 31395 this.handleDragStart(ev); 31396 } 31397 }; 31398 DragListener.prototype.handleDragStart = function (ev) { 31399 this.trigger('dragStart', ev); 31400 }; 31401 DragListener.prototype.handleMove = function (ev) { 31402 var dx = util_1.getEvX(ev) - this.originX; 31403 var dy = util_1.getEvY(ev) - this.originY; 31404 var minDistance = this.minDistance; 31405 var distanceSq; // current distance from the origin, squared 31406 if (!this.isDistanceSurpassed) { 31407 distanceSq = dx * dx + dy * dy; 31408 if (distanceSq >= minDistance * minDistance) { 31409 this.handleDistanceSurpassed(ev); 31410 } 31411 } 31412 if (this.isDragging) { 31413 this.handleDrag(dx, dy, ev); 31414 } 31415 }; 31416 // Called while the mouse is being moved and when we know a legitimate drag is taking place 31417 DragListener.prototype.handleDrag = function (dx, dy, ev) { 31418 this.trigger('drag', dx, dy, ev); 31419 this.updateAutoScroll(ev); // will possibly cause scrolling 31420 }; 31421 DragListener.prototype.endDrag = function (ev) { 31422 if (this.isDragging) { 31423 this.isDragging = false;
31424 this.handleDragEnd(ev); 31425 } 31426 }; 31427 DragListener.prototype.handleDragEnd = function (ev) { 31428 this.trigger('dragEnd', ev); 31429 }; 31430 // Delay 31431 // ----------------------------------------------------------------------------------------------------------------- 31432 DragListener.prototype.startDelay = function (initialEv) { 31433 var _this = this; 31434 if (this.delay) { 31435 this.delayTimeoutId = setTimeout(function () { 31436 _this.handleDelayEnd(initialEv); 31437 }, this.delay); 31438 } 31439 else { 31440 this.handleDelayEnd(initialEv); 31441 } 31442 }; 31443 DragListener.prototype.handleDelayEnd = function (initialEv) { 31444 this.isDelayEnded = true; 31445 if (this.isDistanceSurpassed) { 31446 this.startDrag(initialEv); 31447 } 31448 }; 31449 // Distance 31450 // ----------------------------------------------------------------------------------------------------------------- 31451 DragListener.prototype.handleDistanceSurpassed = function (ev) { 31452 this.isDistanceSurpassed = true; 31453 if (this.isDelayEnded) { 31454 this.startDrag(ev); 31455 } 31456 }; 31457 // Mouse / Touch 31458 // ----------------------------------------------------------------------------------------------------------------- 31459 DragListener.prototype.handleTouchMove = function (ev) { 31460 // prevent inertia and touchmove-scrolling while dragging 31461 if (this.isDragging && this.shouldCancelTouchScroll) { 31462 ev.preventDefault(); 31463 } 31464 this.handleMove(ev); 31465 }; 31466 DragListener.prototype.handleMouseMove = function (ev) { 31467 this.handleMove(ev); 31468 }; 31469 // Scrolling (unrelated to auto-scroll) 31470 // ----------------------------------------------------------------------------------------------------------------- 31471 DragListener.prototype.handleTouchScroll = function (ev) { 31472 // if the drag is being initiated by touch, but a scroll happens before 31473 // the drag-initiating delay is over, cancel the drag 31474 if (!this.isDragging || this.scrollAlwaysKills) { 31475 this.endInteraction(ev, true); // isCancelled=true 31476 } 31477 }; 31478 // Utils 31479 // ----------------------------------------------------------------------------------------------------------------- 31480 // Triggers a callback. Calls a function in the option hash of the same name. 31481 // Arguments beyond the first `name` are forwarded on. 31482 DragListener.prototype.trigger = function (name) { 31483 var args = []; 31484 for (var _i = 1; _i < arguments.length; _i++) { 31485 args[_i - 1] = arguments[_i]; 31486 } 31487 if (this.options[name]) { 31488 this.options[name].apply(this, args); 31489 } 31490 // makes _methods callable by event name. TODO: kill this 31491 if (this['_' + name]) { 31492 this['_' + name].apply(this, args); 31493 } 31494 }; 31495 // Auto-scroll 31496 // ----------------------------------------------------------------------------------------------------------------- 31497 DragListener.prototype.initAutoScroll = function () { 31498 var scrollEl = this.scrollEl; 31499 this.isAutoScroll = 31500 this.options.scroll && 31501 scrollEl && 31502 !scrollEl.is(window) && 31503 !scrollEl.is(document); 31504 if (this.isAutoScroll) { 31505 // debounce makes sure rapid calls don't happen 31506 this.listenTo(scrollEl, 'scroll', util_1.debounce(this.handleDebouncedScroll, 100)); 31507 } 31508 }; 31509 DragListener.prototype.destroyAutoScroll = function () { 31510 this.endAutoScroll(); // kill any animation loop 31511 // remove the scroll handler if there is a scrollEl 31512 if (this.isAutoScroll) { 31513 this.stopListeningTo(this.scrollEl, 'scroll'); // will probably get removed by unbindHandlers too :( 31514 } 31515 }; 31516 // Computes and stores the bounding rectangle of scrollEl 31517 DragListener.prototype.computeScrollBounds = function () { 31518 if (this.isAutoScroll) { 31519 this.scrollBounds = util_1.getOuterRect(this.scrollEl); 31520 // TODO: use getClientRect in future. but prevents auto scrolling when on top of scrollbars 31521 } 31522 }; 31523 // Called when the dragging is in progress and scrolling should be updated 31524 DragListener.prototype.updateAutoScroll = function (ev) { 31525 var sensitivity = this.scrollSensitivity; 31526 var bounds = this.scrollBounds; 31527 var topCloseness; 31528 var bottomCloseness; 31529 var leftCloseness; 31530 var rightCloseness; 31531 var topVel = 0; 31532 var leftVel = 0; 31533 if (bounds) {
31534 // compute closeness to edges. valid range is from 0.0 - 1.0 31535 topCloseness = (sensitivity - (util_1.getEvY(ev) - bounds.top)) / sensitivity; 31536 bottomCloseness = (sensitivity - (bounds.bottom - util_1.getEvY(ev))) / sensitivity; 31537 leftCloseness = (sensitivity - (util_1.getEvX(ev) - bounds.left)) / sensitivity; 31538 rightCloseness = (sensitivity - (bounds.right - util_1.getEvX(ev))) / sensitivity; 31539 // translate vertical closeness into velocity. 31540 // mouse must be completely in bounds for velocity to happen. 31541 if (topCloseness >= 0 && topCloseness <= 1) { 31542 topVel = topCloseness * this.scrollSpeed * -1; // negative. for scrolling up 31543 } 31544 else if (bottomCloseness >= 0 && bottomCloseness <= 1) { 31545 topVel = bottomCloseness * this.scrollSpeed; 31546 } 31547 // translate horizontal closeness into velocity 31548 if (leftCloseness >= 0 && leftCloseness <= 1) { 31549 leftVel = leftCloseness * this.scrollSpeed * -1; // negative. for scrolling left 31550 } 31551 else if (rightCloseness >= 0 && rightCloseness <= 1) { 31552 leftVel = rightCloseness * this.scrollSpeed; 31553 } 31554 } 31555 this.setScrollVel(topVel, leftVel); 31556 }; 31557 // Sets the speed-of-scrolling for the scrollEl 31558 DragListener.prototype.setScrollVel = function (topVel, leftVel) { 31559 this.scrollTopVel = topVel; 31560 this.scrollLeftVel = leftVel; 31561 this.constrainScrollVel(); // massages into realistic values 31562 // if there is non-zero velocity, and an animation loop hasn't already started, then START 31563 if ((this.scrollTopVel || this.scrollLeftVel) && !this.scrollIntervalId) { 31564 this.scrollIntervalId = setInterval(util_1.proxy(this, 'scrollIntervalFunc'), // scope to `this` 31565 this.scrollIntervalMs); 31566 } 31567 }; 31568 // Forces scrollTopVel and scrollLeftVel to be zero if scrolling has already gone all the way 31569 DragListener.prototype.constrainScrollVel = function () { 31570 var el = this.scrollEl; 31571 if (this.scrollTopVel < 0) { 31572 if (el.scrollTop() <= 0) { 31573 this.scrollTopVel = 0; 31574 } 31575 } 31576 else if (this.scrollTopVel > 0) { 31577 if (el.scrollTop() + el[0].clientHeight >= el[0].scrollHeight) { 31578 this.scrollTopVel = 0; 31579 } 31580 } 31581 if (this.scrollLeftVel < 0) { 31582 if (el.scrollLeft() <= 0) { 31583 this.scrollLeftVel = 0; 31584 } 31585 } 31586 else if (this.scrollLeftVel > 0) { 31587 if (el.scrollLeft() + el[0].clientWidth >= el[0].scrollWidth) { 31588 this.scrollLeftVel = 0; 31589 } 31590 } 31591 }; 31592 // This function gets called during every iteration of the scrolling animation loop 31593 DragListener.prototype.scrollIntervalFunc = function () { 31594 var el = this.scrollEl; 31595 var frac = this.scrollIntervalMs / 1000; // considering animation frequency, what the vel should be mult'd by 31596 // change the value of scrollEl's scroll 31597 if (this.scrollTopVel) { 31598 el.scrollTop(el.scrollTop() + this.scrollTopVel * frac); 31599 } 31600 if (this.scrollLeftVel) { 31601 el.scrollLeft(el.scrollLeft() + this.scrollLeftVel * frac); 31602 } 31603 this.constrainScrollVel(); // since the scroll values changed, recompute the velocities 31604 // if scrolled all the way, which causes the vels to be zero, stop the animation loop 31605 if (!this.scrollTopVel && !this.scrollLeftVel) { 31606 this.endAutoScroll(); 31607 } 31608 }; 31609 // Kills any existing scrolling animation loop 31610 DragListener.prototype.endAutoScroll = function () { 31611 if (this.scrollIntervalId) { 31612 clearInterval(this.scrollIntervalId); 31613 this.scrollIntervalId = null; 31614 this.handleScrollEnd(); 31615 } 31616 }; 31617 // Get called when the scrollEl is scrolled (NOTE: this is delayed via debounce) 31618 DragListener.prototype.handleDebouncedScroll = function () {
31619 // recompute all coordinates, but *only* if this is *not* part of our scrolling animation 31620 if (!this.scrollIntervalId) { 31621 this.handleScrollEnd(); 31622 } 31623 }; 31624 DragListener.prototype.handleScrollEnd = function () { 31625 // Called when scrolling has stopped, whether through auto scroll, or the user scrolling 31626 }; 31627 return DragListener; 31628}()); 31629exports.default = DragListener; 31630ListenerMixin_1.default.mixInto(DragListener); 31631 31632 31633/***/ }), 31634/* 55 */ 31635/***/ (function(module, exports, __webpack_require__) { 31636 31637Object.defineProperty(exports, "__esModule", { value: true }); 31638var tslib_1 = __webpack_require__(2); 31639var util_1 = __webpack_require__(4); 31640var Mixin_1 = __webpack_require__(14); 31641/* 31642A set of rendering and date-related methods for a visual component comprised of one or more rows of day columns. 31643Prerequisite: the object being mixed into needs to be a *Grid* 31644*/ 31645var DayTableMixin = /** @class */ (function (_super) { 31646 tslib_1.__extends(DayTableMixin, _super); 31647 function DayTableMixin() { 31648 return _super !== null && _super.apply(this, arguments) || this; 31649 } 31650 // Populates internal variables used for date calculation and rendering 31651 DayTableMixin.prototype.updateDayTable = function () { 31652 var t = this; 31653 var view = t.view; 31654 var calendar = view.calendar; 31655 var date = calendar.msToUtcMoment(t.dateProfile.renderUnzonedRange.startMs, true); 31656 var end = calendar.msToUtcMoment(t.dateProfile.renderUnzonedRange.endMs, true); 31657 var dayIndex = -1; 31658 var dayIndices = []; 31659 var dayDates = []; 31660 var daysPerRow; 31661 var firstDay; 31662 var rowCnt; 31663 while (date.isBefore(end)) { 31664 if (view.isHiddenDay(date)) { 31665 dayIndices.push(dayIndex + 0.5); // mark that it's between indices 31666 } 31667 else { 31668 dayIndex++; 31669 dayIndices.push(dayIndex); 31670 dayDates.push(date.clone()); 31671 } 31672 date.add(1, 'days'); 31673 } 31674 if (this.breakOnWeeks) { 31675 // count columns until the day-of-week repeats 31676 firstDay = dayDates[0].day(); 31677 for (daysPerRow = 1; daysPerRow < dayDates.length; daysPerRow++) { 31678 if (dayDates[daysPerRow].day() === firstDay) { 31679 break; 31680 } 31681 } 31682 rowCnt = Math.ceil(dayDates.length / daysPerRow); 31683 } 31684 else { 31685 rowCnt = 1; 31686 daysPerRow = dayDates.length; 31687 } 31688 this.dayDates = dayDates; 31689 this.dayIndices = dayIndices; 31690 this.daysPerRow = daysPerRow; 31691 this.rowCnt = rowCnt; 31692 this.updateDayTableCols(); 31693 }; 31694 // Computes and assigned the colCnt property and updates any options that may be computed from it 31695 DayTableMixin.prototype.updateDayTableCols = function () { 31696 this.colCnt = this.computeColCnt(); 31697 this.colHeadFormat = 31698 this.opt('columnHeaderFormat') || 31699 this.opt('columnFormat') || // deprecated 31700 this.computeColHeadFormat(); 31701 }; 31702 // Determines how many columns there should be in the table 31703 DayTableMixin.prototype.computeColCnt = function () { 31704 return this.daysPerRow; 31705 }; 31706 // Computes the ambiguously-timed moment for the given cell 31707 DayTableMixin.prototype.getCellDate = function (row, col) { 31708 return this.dayDates[this.getCellDayIndex(row, col)].clone(); 31709 }; 31710 // Computes the ambiguously-timed date range for the given cell 31711 DayTableMixin.prototype.getCellRange = function (row, col) { 31712 var start = this.getCellDate(row, col); 31713 var end = start.clone().add(1, 'days'); 31714 return { start: start, end: end }; 31715 }; 31716 // Returns the number of day cells, chronologically, from the first of the grid (0-based) 31717 DayTableMixin.prototype.getCellDayIndex = function (row, col) { 31718 return row * this.daysPerRow + this.getColDayIndex(col); 31719 }; 31720 // Returns the numner of day cells, chronologically, from the first cell in *any given row* 31721 DayTableMixin.prototype.getColDayIndex = function (col) { 31722 if (this.isRTL) { 31723 return this.colCnt - 1 - col; 31724 } 31725 else { 31726 return col; 31727 } 31728 }; 31729 // Given a date, returns its chronolocial cell-index from the first cell of the grid. 31730 // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets. 31731 // If before the first offset, returns a negative number. 31732 // If after the last offset, returns an offset past the last cell offset. 31733 // Only works for *start* dates of cells. Will not work for exclusive end dates for cells. 31734 DayTableMixin.prototype.getDateDayIndex = function (date) { 31735 var dayIndices = this.dayIndices; 31736 var dayOffset = date.diff(this.dayDates[0], 'days'); 31737 if (dayOffset < 0) {
31738 return dayIndices[0] - 1; 31739 } 31740 else if (dayOffset >= dayIndices.length) { 31741 return dayIndices[dayIndices.length - 1] + 1; 31742 } 31743 else { 31744 return dayIndices[dayOffset]; 31745 } 31746 }; 31747 /* Options 31748 ------------------------------------------------------------------------------------------------------------------*/ 31749 // Computes a default column header formatting string if `colFormat` is not explicitly defined 31750 DayTableMixin.prototype.computeColHeadFormat = function () { 31751 // if more than one week row, or if there are a lot of columns with not much space, 31752 // put just the day numbers will be in each cell 31753 if (this.rowCnt > 1 || this.colCnt > 10) { 31754 return 'ddd'; // "Sat" 31755 } 31756 else if (this.colCnt > 1) { 31757 return this.opt('dayOfMonthFormat'); // "Sat 12/10" 31758 } 31759 else { 31760 return 'dddd'; // "Saturday" 31761 } 31762 }; 31763 /* Slicing 31764 ------------------------------------------------------------------------------------------------------------------*/ 31765 // Slices up a date range into a segment for every week-row it intersects with 31766 DayTableMixin.prototype.sliceRangeByRow = function (unzonedRange) { 31767 var daysPerRow = this.daysPerRow; 31768 var normalRange = this.view.computeDayRange(unzonedRange); // make whole-day range, considering nextDayThreshold 31769 var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index 31770 var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index 31771 var segs = []; 31772 var row; 31773 var rowFirst; 31774 var rowLast; // inclusive day-index range for current row 31775 var segFirst; 31776 var segLast; // inclusive day-index range for segment 31777 for (row = 0; row < this.rowCnt; row++) { 31778 rowFirst = row * daysPerRow; 31779 rowLast = rowFirst + daysPerRow - 1; 31780 // intersect segment's offset range with the row's 31781 segFirst = Math.max(rangeFirst, rowFirst); 31782 segLast = Math.min(rangeLast, rowLast); 31783 // deal with in-between indices 31784 segFirst = Math.ceil(segFirst); // in-between starts round to next cell 31785 segLast = Math.floor(segLast); // in-between ends round to prev cell 31786 if (segFirst <= segLast) { 31787 segs.push({ 31788 row: row, 31789 // normalize to start of row 31790 firstRowDayIndex: segFirst - rowFirst, 31791 lastRowDayIndex: segLast - rowFirst, 31792 // must be matching integers to be the segment's start/end 31793 isStart: segFirst === rangeFirst, 31794 isEnd: segLast === rangeLast 31795 }); 31796 } 31797 } 31798 return segs; 31799 }; 31800 // Slices up a date range into a segment for every day-cell it intersects with. 31801 // TODO: make more DRY with sliceRangeByRow somehow. 31802 DayTableMixin.prototype.sliceRangeByDay = function (unzonedRange) { 31803 var daysPerRow = this.daysPerRow; 31804 var normalRange = this.view.computeDayRange(unzonedRange); // make whole-day range, considering nextDayThreshold 31805 var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index 31806 var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index 31807 var segs = []; 31808 var row; 31809 var rowFirst; 31810 var rowLast; // inclusive day-index range for current row 31811 var i; 31812 var segFirst; 31813 var segLast; // inclusive day-index range for segment 31814 for (row = 0; row < this.rowCnt; row++) { 31815 rowFirst = row * daysPerRow; 31816 rowLast = rowFirst + daysPerRow - 1; 31817 for (i = rowFirst; i <= rowLast; i++) { 31818 // intersect segment's offset range with the row's 31819 segFirst = Math.max(rangeFirst, i); 31820 segLast = Math.min(rangeLast, i); 31821 // deal with in-between indices
31822 segFirst = Math.ceil(segFirst); // in-between starts round to next cell 31823 segLast = Math.floor(segLast); // in-between ends round to prev cell 31824 if (segFirst <= segLast) { 31825 segs.push({ 31826 row: row, 31827 // normalize to start of row 31828 firstRowDayIndex: segFirst - rowFirst, 31829 lastRowDayIndex: segLast - rowFirst, 31830 // must be matching integers to be the segment's start/end 31831 isStart: segFirst === rangeFirst, 31832 isEnd: segLast === rangeLast 31833 }); 31834 } 31835 } 31836 } 31837 return segs; 31838 }; 31839 /* Header Rendering 31840 ------------------------------------------------------------------------------------------------------------------*/ 31841 DayTableMixin.prototype.renderHeadHtml = function () { 31842 var theme = this.view.calendar.theme; 31843 return '' + 31844 '<div class="fc-row ' + theme.getClass('headerRow') + '">' + 31845 '<table class="' + theme.getClass('tableGrid') + '">' + 31846 '<thead>' + 31847 this.renderHeadTrHtml() + 31848 '</thead>' + 31849 '</table>' + 31850 '</div>'; 31851 }; 31852 DayTableMixin.prototype.renderHeadIntroHtml = function () { 31853 return this.renderIntroHtml(); // fall back to generic 31854 }; 31855 DayTableMixin.prototype.renderHeadTrHtml = function () { 31856 return '' + 31857 '<tr>' + 31858 (this.isRTL ? '' : this.renderHeadIntroHtml()) + 31859 this.renderHeadDateCellsHtml() + 31860 (this.isRTL ? this.renderHeadIntroHtml() : '') + 31861 '</tr>'; 31862 }; 31863 DayTableMixin.prototype.renderHeadDateCellsHtml = function () { 31864 var htmls = []; 31865 var col; 31866 var date; 31867 for (col = 0; col < this.colCnt; col++) { 31868 date = this.getCellDate(0, col); 31869 htmls.push(this.renderHeadDateCellHtml(date)); 31870 } 31871 return htmls.join(''); 31872 }; 31873 // TODO: when internalApiVersion, accept an object for HTML attributes 31874 // (colspan should be no different) 31875 DayTableMixin.prototype.renderHeadDateCellHtml = function (date, colspan, otherAttrs) { 31876 var t = this; 31877 var view = t.view; 31878 var isDateValid = t.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow. 31879 var classNames = [ 31880 'fc-day-header', 31881 view.calendar.theme.getClass('widgetHeader') 31882 ]; 31883 var innerHtml; 31884 if (typeof t.opt('columnHeaderHtml') === 'function') { 31885 innerHtml = t.opt('columnHeaderHtml')(date); 31886 } 31887 else if (typeof t.opt('columnHeaderText') === 'function') { 31888 innerHtml = util_1.htmlEscape(t.opt('columnHeaderText')(date)); 31889 } 31890 else { 31891 innerHtml = util_1.htmlEscape(date.format(t.colHeadFormat)); 31892 } 31893 // if only one row of days, the classNames on the header can represent the specific days beneath 31894 if (t.rowCnt === 1) { 31895 classNames = classNames.concat( 31896 // includes the day-of-week class 31897 // noThemeHighlight=true (don't highlight the header) 31898 t.getDayClasses(date, true)); 31899 } 31900 else { 31901 classNames.push('fc-' + util_1.dayIDs[date.day()]); // only add the day-of-week class 31902 } 31903 return '' + 31904 '<th class="' + classNames.join(' ') + '"' + 31905 ((isDateValid && t.rowCnt) === 1 ? 31906 ' data-date="' + date.format('YYYY-MM-DD') + '"' : 31907 '') + 31908 (colspan > 1 ? 31909 ' colspan="' + colspan + '"' : 31910 '') + 31911 (otherAttrs ? 31912 ' ' + otherAttrs : 31913 '') + 31914 '>' + 31915 (isDateValid ? 31916 // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff) 31917 view.buildGotoAnchorHtml({ date: date, forceOff: t.rowCnt > 1 || t.colCnt === 1 }, innerHtml) : 31918 // if not valid, display text, but no link 31919 innerHtml) + 31920 '</th>'; 31921 };
31922 /* Background Rendering 31923 ------------------------------------------------------------------------------------------------------------------*/ 31924 DayTableMixin.prototype.renderBgTrHtml = function (row) { 31925 return '' + 31926 '<tr>' + 31927 (this.isRTL ? '' : this.renderBgIntroHtml(row)) + 31928 this.renderBgCellsHtml(row) + 31929 (this.isRTL ? this.renderBgIntroHtml(row) : '') + 31930 '</tr>'; 31931 }; 31932 DayTableMixin.prototype.renderBgIntroHtml = function (row) { 31933 return this.renderIntroHtml(); // fall back to generic 31934 }; 31935 DayTableMixin.prototype.renderBgCellsHtml = function (row) { 31936 var htmls = []; 31937 var col; 31938 var date; 31939 for (col = 0; col < this.colCnt; col++) { 31940 date = this.getCellDate(row, col); 31941 htmls.push(this.renderBgCellHtml(date)); 31942 } 31943 return htmls.join(''); 31944 }; 31945 DayTableMixin.prototype.renderBgCellHtml = function (date, otherAttrs) { 31946 var t = this; 31947 var view = t.view; 31948 var isDateValid = t.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow. 31949 var classes = t.getDayClasses(date); 31950 classes.unshift('fc-day', view.calendar.theme.getClass('widgetContent')); 31951 return '<td class="' + classes.join(' ') + '"' + 31952 (isDateValid ? 31953 ' data-date="' + date.format('YYYY-MM-DD') + '"' : // if date has a time, won't format it 31954 '') + 31955 (otherAttrs ? 31956 ' ' + otherAttrs : 31957 '') + 31958 '></td>'; 31959 }; 31960 /* Generic 31961 ------------------------------------------------------------------------------------------------------------------*/ 31962 DayTableMixin.prototype.renderIntroHtml = function () { 31963 // Generates the default HTML intro for any row. User classes should override 31964 }; 31965 // TODO: a generic method for dealing with <tr>, RTL, intro 31966 // when increment internalApiVersion 31967 // wrapTr (scheduler) 31968 /* Utils 31969 ------------------------------------------------------------------------------------------------------------------*/ 31970 // Applies the generic "intro" and "outro" HTML to the given cells. 31971 // Intro means the leftmost cell when the calendar is LTR and the rightmost cell when RTL. Vice-versa for outro. 31972 DayTableMixin.prototype.bookendCells = function (trEl) { 31973 var introHtml = this.renderIntroHtml(); 31974 if (introHtml) { 31975 if (this.isRTL) { 31976 trEl.append(introHtml); 31977 } 31978 else { 31979 trEl.prepend(introHtml); 31980 } 31981 } 31982 }; 31983 return DayTableMixin; 31984}(Mixin_1.default)); 31985exports.default = DayTableMixin; 31986 31987 31988/***/ }), 31989/* 56 */ 31990/***/ (function(module, exports) { 31991 31992Object.defineProperty(exports, "__esModule", { value: true }); 31993var BusinessHourRenderer = /** @class */ (function () { 31994 /* 31995 component implements: 31996 - eventRangesToEventFootprints 31997 - eventFootprintsToSegs 31998 */ 31999 function BusinessHourRenderer(component, fillRenderer) { 32000 this.component = component; 32001 this.fillRenderer = fillRenderer; 32002 } 32003 BusinessHourRenderer.prototype.render = function (businessHourGenerator) { 32004 var component = this.component; 32005 var unzonedRange = component._getDateProfile().activeUnzonedRange; 32006 var eventInstanceGroup = businessHourGenerator.buildEventInstanceGroup(component.hasAllDayBusinessHours, unzonedRange); 32007 var eventFootprints = eventInstanceGroup ? 32008 component.eventRangesToEventFootprints(eventInstanceGroup.sliceRenderRanges(unzonedRange)) : 32009 []; 32010 this.renderEventFootprints(eventFootprints); 32011 }; 32012 BusinessHourRenderer.prototype.renderEventFootprints = function (eventFootprints) { 32013 var segs = this.component.eventFootprintsToSegs(eventFootprints); 32014 this.renderSegs(segs); 32015 this.segs = segs; 32016 }; 32017 BusinessHourRenderer.prototype.renderSegs = function (segs) { 32018 if (this.fillRenderer) { 32019 this.fillRenderer.renderSegs('businessHours', segs, { 32020 getClasses: function (seg) { 32021 return ['fc-nonbusiness', 'fc-bgevent']; 32022 } 32023 }); 32024 } 32025 }; 32026 BusinessHourRenderer.prototype.unrender = function () { 32027 if (this.fillRenderer) { 32028 this.fillRenderer.unrender('businessHours'); 32029 } 32030 this.segs = null; 32031 }; 32032 BusinessHourRenderer.prototype.getSegs = function () { 32033 return this.segs || []; 32034 }; 32035 return BusinessHourRenderer; 32036}()); 32037exports.default = BusinessHourRenderer; 32038 32039 32040/***/ }), 32041/* 57 */ 32042/***/ (function(module, exports, __webpack_require__) { 32043 32044Object.defineProperty(exports, "__esModule", { value: true }); 32045var $ = __webpack_require__(3); 32046var util_1 = __webpack_require__(4);
32047var FillRenderer = /** @class */ (function () { 32048 function FillRenderer(component) { 32049 this.fillSegTag = 'div'; 32050 this.component = component; 32051 this.elsByFill = {}; 32052 } 32053 FillRenderer.prototype.renderFootprint = function (type, componentFootprint, props) { 32054 this.renderSegs(type, this.component.componentFootprintToSegs(componentFootprint), props); 32055 }; 32056 FillRenderer.prototype.renderSegs = function (type, segs, props) { 32057 var els; 32058 segs = this.buildSegEls(type, segs, props); // assignes `.el` to each seg. returns successfully rendered segs 32059 els = this.attachSegEls(type, segs); 32060 if (els) { 32061 this.reportEls(type, els); 32062 } 32063 return segs; 32064 }; 32065 // Unrenders a specific type of fill that is currently rendered on the grid 32066 FillRenderer.prototype.unrender = function (type) { 32067 var el = this.elsByFill[type]; 32068 if (el) { 32069 el.remove(); 32070 delete this.elsByFill[type]; 32071 } 32072 }; 32073 // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types. 32074 // Only returns segments that successfully rendered. 32075 FillRenderer.prototype.buildSegEls = function (type, segs, props) { 32076 var _this = this; 32077 var html = ''; 32078 var renderedSegs = []; 32079 var i; 32080 if (segs.length) { 32081 // build a large concatenation of segment HTML 32082 for (i = 0; i < segs.length; i++) { 32083 html += this.buildSegHtml(type, segs[i], props); 32084 } 32085 // Grab individual elements from the combined HTML string. Use each as the default rendering. 32086 // Then, compute the 'el' for each segment. 32087 $(html).each(function (i, node) { 32088 var seg = segs[i]; 32089 var el = $(node); 32090 // allow custom filter methods per-type 32091 if (props.filterEl) { 32092 el = props.filterEl(seg, el); 32093 } 32094 if (el) { 32095 el = $(el); // allow custom filter to return raw DOM node 32096 // correct element type? (would be bad if a non-TD were inserted into a table for example) 32097 if (el.is(_this.fillSegTag)) { 32098 seg.el = el; 32099 renderedSegs.push(seg); 32100 } 32101 } 32102 }); 32103 } 32104 return renderedSegs; 32105 }; 32106 // Builds the HTML needed for one fill segment. Generic enough to work with different types. 32107 FillRenderer.prototype.buildSegHtml = function (type, seg, props) { 32108 // custom hooks per-type 32109 var classes = props.getClasses ? props.getClasses(seg) : []; 32110 var css = util_1.cssToStr(props.getCss ? props.getCss(seg) : {}); 32111 return '<' + this.fillSegTag + 32112 (classes.length ? ' class="' + classes.join(' ') + '"' : '') + 32113 (css ? ' style="' + css + '"' : '') + 32114 ' />'; 32115 }; 32116 // Should return wrapping DOM structure 32117 FillRenderer.prototype.attachSegEls = function (type, segs) { 32118 // subclasses must implement 32119 }; 32120 FillRenderer.prototype.reportEls = function (type, nodes) { 32121 if (this.elsByFill[type]) { 32122 this.elsByFill[type] = this.elsByFill[type].add(nodes); 32123 } 32124 else { 32125 this.elsByFill[type] = $(nodes); 32126 } 32127 }; 32128 return FillRenderer; 32129}()); 32130exports.default = FillRenderer; 32131 32132 32133/***/ }), 32134/* 58 */ 32135/***/ (function(module, exports, __webpack_require__) { 32136 32137Object.defineProperty(exports, "__esModule", { value: true }); 32138var SingleEventDef_1 = __webpack_require__(13); 32139var EventFootprint_1 = __webpack_require__(36); 32140var EventSource_1 = __webpack_require__(6); 32141var HelperRenderer = /** @class */ (function () { 32142 function HelperRenderer(component, eventRenderer) { 32143 this.view = component._getView(); 32144 this.component = component; 32145 this.eventRenderer = eventRenderer; 32146 } 32147 HelperRenderer.prototype.renderComponentFootprint = function (componentFootprint) { 32148 this.renderEventFootprints([ 32149 this.fabricateEventFootprint(componentFootprint) 32150 ]); 32151 }; 32152 HelperRenderer.prototype.renderEventDraggingFootprints = function (eventFootprints, sourceSeg, isTouch) { 32153 this.renderEventFootprints(eventFootprints, sourceSeg, 'fc-dragging', isTouch ? null : this.view.opt('dragOpacity')); 32154 }; 32155 HelperRenderer.prototype.renderEventResizingFootprints = function (eventFootprints, sourceSeg, isTouch) { 32156 this.renderEventFootprints(eventFootprints, sourceSeg, 'fc-resizing'); 32157 }; 32158 HelperRenderer.prototype.renderEventFootprints = function (eventFootprints, sourceSeg, extraClassNames, opacity) { 32159 var segs = this.component.eventFootprintsToSegs(eventFootprints); 32160 var classNames = 'fc-helper ' + (extraClassNames || ''); 32161 var i; 32162 // assigns each seg's el and returns a subset of segs that were rendered 32163 segs = this.eventRenderer.renderFgSegEls(segs); 32164 for (i = 0; i < segs.length; i++) { 32165 segs[i].el.addClass(classNames); 32166 } 32167 if (opacity != null) { 32168 for (i = 0; i < segs.length; i++) { 32169 segs[i].el.css('opacity', opacity); 32170 } 32171 } 32172 this.helperEls = this.renderSegs(segs, sourceSeg); 32173 }; 32174 /* 32175 Must return all mock event elements 32176 */ 32177 HelperRenderer.prototype.renderSegs = function (segs, sourceSeg) { 32178 // Subclasses must implement 32179 }; 32180 HelperRenderer.prototype.unrender = function () { 32181 if (this.helperEls) { 32182 this.helperEls.remove(); 32183 this.helperEls = null; 32184 } 32185 }; 32186 HelperRenderer.prototype.fabricateEventFootprint = function (componentFootprint) { 32187 var calendar = this.view.calendar; 32188 var eventDateProfile = calendar.footprintToDateProfile(componentFootprint); 32189 var dummyEvent = new SingleEventDef_1.default(new EventSource_1.default(calendar)); 32190 var dummyInstance; 32191 dummyEvent.dateProfile = eventDateProfile; 32192 dummyInstance = dummyEvent.buildInstance(); 32193 return new EventFootprint_1.default(componentFootprint, dummyEvent, dummyInstance); 32194 }; 32195 return HelperRenderer; 32196}()); 32197exports.default = HelperRenderer; 32198 32199 32200/***/ }), 32201/* 59 */ 32202/***/ (function(module, exports, __webpack_require__) { 32203 32204Object.defineProperty(exports, "__esModule", { value: true }); 32205var tslib_1 = __webpack_require__(2); 32206var GlobalEmitter_1 = __webpack_require__(21); 32207var Interaction_1 = __webpack_require__(15); 32208var EventPointing = /** @class */ (function (_super) { 32209 tslib_1.__extends(EventPointing, _super); 32210 function EventPointing() { 32211 return _super !== null && _super.apply(this, arguments) || this; 32212 } 32213 /* 32214 component must implement: 32215 - publiclyTrigger 32216 */ 32217 EventPointing.prototype.bindToEl = function (el) { 32218 var component = this.component; 32219 component.bindSegHandlerToEl(el, 'click', this.handleClick.bind(this)); 32220 component.bindSegHandlerToEl(el, 'mouseenter', this.handleMouseover.bind(this)); 32221 component.bindSegHandlerToEl(el, 'mouseleave', this.handleMouseout.bind(this)); 32222 }; 32223 EventPointing.prototype.handleClick = function (seg, ev) { 32224 var res = this.component.publiclyTrigger('eventClick', { 32225 context: seg.el[0], 32226 args: [seg.footprint.getEventLegacy(), ev, this.view] 32227 }); 32228 if (res === false) { 32229 ev.preventDefault(); 32230 } 32231 }; 32232 // Updates internal state and triggers handlers for when an event element is moused over 32233 EventPointing.prototype.handleMouseover = function (seg, ev) { 32234 if (!GlobalEmitter_1.default.get().shouldIgnoreMouse() && 32235 !this.mousedOverSeg) { 32236 this.mousedOverSeg = seg; 32237 // TODO: move to EventSelecting's responsibility 32238 if (this.view.isEventDefResizable(seg.footprint.eventDef)) { 32239 seg.el.addClass('fc-allow-mouse-resize'); 32240 } 32241 this.component.publiclyTrigger('eventMouseover', { 32242 context: seg.el[0], 32243 args: [seg.footprint.getEventLegacy(), ev, this.view] 32244 }); 32245 } 32246 }; 32247 // Updates internal state and triggers handlers for when an event element is moused out. 32248 // Can be given no arguments, in which case it will mouseout the segment that was previously moused over. 32249 EventPointing.prototype.handleMouseout = function (seg, ev) { 32250 if (this.mousedOverSeg) { 32251 this.mousedOverSeg = null; 32252 // TODO: move to EventSelecting's responsibility 32253 if (this.view.isEventDefResizable(seg.footprint.eventDef)) { 32254 seg.el.removeClass('fc-allow-mouse-resize'); 32255 } 32256 this.component.publiclyTrigger('eventMouseout', { 32257 context: seg.el[0], 32258 args: [ 32259 seg.footprint.getEventLegacy(), 32260 ev || {}, 32261 this.view 32262 ] 32263 }); 32264 } 32265 }; 32266 EventPointing.prototype.end = function () { 32267 if (this.mousedOverSeg) { 32268 this.handleMouseout(this.mousedOverSeg); 32269 } 32270 }; 32271 return EventPointing; 32272}(Interaction_1.default)); 32273exports.default = EventPointing; 32274 32275 32276/***/ }), 32277/* 60 */ 32278/***/ (function(module, exports, __webpack_require__) { 32279 32280Object.defineProperty(exports, "__esModule", { value: true }); 32281var tslib_1 = __webpack_require__(2); 32282var Mixin_1 = __webpack_require__(14); 32283var DateClicking_1 = __webpack_require__(245); 32284var DateSelecting_1 = __webpack_require__(225); 32285var EventPointing_1 = __webpack_require__(59); 32286var EventDragging_1 = __webpack_require__(224); 32287var EventResizing_1 = __webpack_require__(223);
32288var ExternalDropping_1 = __webpack_require__(222); 32289var StandardInteractionsMixin = /** @class */ (function (_super) { 32290 tslib_1.__extends(StandardInteractionsMixin, _super); 32291 function StandardInteractionsMixin() { 32292 return _super !== null && _super.apply(this, arguments) || this; 32293 } 32294 return StandardInteractionsMixin; 32295}(Mixin_1.default)); 32296exports.default = StandardInteractionsMixin; 32297StandardInteractionsMixin.prototype.dateClickingClass = DateClicking_1.default; 32298StandardInteractionsMixin.prototype.dateSelectingClass = DateSelecting_1.default; 32299StandardInteractionsMixin.prototype.eventPointingClass = EventPointing_1.default; 32300StandardInteractionsMixin.prototype.eventDraggingClass = EventDragging_1.default; 32301StandardInteractionsMixin.prototype.eventResizingClass = EventResizing_1.default; 32302StandardInteractionsMixin.prototype.externalDroppingClass = ExternalDropping_1.default; 32303 32304 32305/***/ }), 32306/* 61 */ 32307/***/ (function(module, exports, __webpack_require__) { 32308 32309Object.defineProperty(exports, "__esModule", { value: true }); 32310var tslib_1 = __webpack_require__(2); 32311var $ = __webpack_require__(3); 32312var util_1 = __webpack_require__(4); 32313var CoordCache_1 = __webpack_require__(53); 32314var Popover_1 = __webpack_require__(249); 32315var UnzonedRange_1 = __webpack_require__(5); 32316var ComponentFootprint_1 = __webpack_require__(12); 32317var EventFootprint_1 = __webpack_require__(36); 32318var BusinessHourRenderer_1 = __webpack_require__(56); 32319var StandardInteractionsMixin_1 = __webpack_require__(60); 32320var InteractiveDateComponent_1 = __webpack_require__(40); 32321var DayTableMixin_1 = __webpack_require__(55); 32322var DayGridEventRenderer_1 = __webpack_require__(250); 32323var DayGridHelperRenderer_1 = __webpack_require__(251); 32324var DayGridFillRenderer_1 = __webpack_require__(252); 32325/* A component that renders a grid of whole-days that runs horizontally. There can be multiple rows, one per week. 32326----------------------------------------------------------------------------------------------------------------------*/ 32327var DayGrid = /** @class */ (function (_super) { 32328 tslib_1.__extends(DayGrid, _super); 32329 function DayGrid(view) { 32330 var _this = _super.call(this, view) || this; 32331 _this.cellWeekNumbersVisible = false; // display week numbers in day cell? 32332 _this.bottomCoordPadding = 0; // hack for extending the hit area for the last row of the coordinate grid 32333 // isRigid determines whether the individual rows should ignore the contents and be a constant height. 32334 // Relies on the view's colCnt and rowCnt. In the future, this component should probably be self-sufficient. 32335 _this.isRigid = false; 32336 _this.hasAllDayBusinessHours = true; 32337 return _this; 32338 } 32339 // Slices up the given span (unzoned start/end with other misc data) into an array of segments 32340 DayGrid.prototype.componentFootprintToSegs = function (componentFootprint) { 32341 var segs = this.sliceRangeByRow(componentFootprint.unzonedRange); 32342 var i; 32343 var seg; 32344 for (i = 0; i < segs.length; i++) { 32345 seg = segs[i]; 32346 if (this.isRTL) { 32347 seg.leftCol = this.daysPerRow - 1 - seg.lastRowDayIndex; 32348 seg.rightCol = this.daysPerRow - 1 - seg.firstRowDayIndex; 32349 } 32350 else { 32351 seg.leftCol = seg.firstRowDayIndex; 32352 seg.rightCol = seg.lastRowDayIndex; 32353 } 32354 } 32355 return segs; 32356 }; 32357 /* Date Rendering 32358 ------------------------------------------------------------------------------------------------------------------*/ 32359 DayGrid.prototype.renderDates = function (dateProfile) { 32360 this.dateProfile = dateProfile; 32361 this.updateDayTable(); 32362 this.renderGrid(); 32363 }; 32364 DayGrid.prototype.unrenderDates = function () { 32365 this.removeSegPopover(); 32366 }; 32367 // Renders the rows and columns into the component's `this.el`, which should already be assigned. 32368 DayGrid.prototype.renderGrid = function () { 32369 var view = this.view; 32370 var rowCnt = this.rowCnt; 32371 var colCnt = this.colCnt; 32372 var html = ''; 32373 var row; 32374 var col; 32375 if (this.headContainerEl) { 32376 this.headContainerEl.html(this.renderHeadHtml()); 32377 } 32378 for (row = 0; row < rowCnt; row++) { 32379 html += this.renderDayRowHtml(row, this.isRigid); 32380 } 32381 this.el.html(html); 32382 this.rowEls = this.el.find('.fc-row'); 32383 this.cellEls = this.el.find('.fc-day, .fc-disabled-day');
32384 this.rowCoordCache = new CoordCache_1.default({ 32385 els: this.rowEls, 32386 isVertical: true 32387 }); 32388 this.colCoordCache = new CoordCache_1.default({ 32389 els: this.cellEls.slice(0, this.colCnt), 32390 isHorizontal: true 32391 }); 32392 // trigger dayRender with each cell's element 32393 for (row = 0; row < rowCnt; row++) { 32394 for (col = 0; col < colCnt; col++) { 32395 this.publiclyTrigger('dayRender', { 32396 context: view, 32397 args: [ 32398 this.getCellDate(row, col), 32399 this.getCellEl(row, col), 32400 view 32401 ] 32402 }); 32403 } 32404 } 32405 }; 32406 // Generates the HTML for a single row, which is a div that wraps a table. 32407 // `row` is the row number. 32408 DayGrid.prototype.renderDayRowHtml = function (row, isRigid) { 32409 var theme = this.view.calendar.theme; 32410 var classes = ['fc-row', 'fc-week', theme.getClass('dayRow')]; 32411 if (isRigid) { 32412 classes.push('fc-rigid'); 32413 } 32414 return '' + 32415 '<div class="' + classes.join(' ') + '">' + 32416 '<div class="fc-bg">' + 32417 '<table class="' + theme.getClass('tableGrid') + '">' + 32418 this.renderBgTrHtml(row) + 32419 '</table>' + 32420 '</div>' + 32421 '<div class="fc-content-skeleton">' + 32422 '<table>' + 32423 (this.getIsNumbersVisible() ? 32424 '<thead>' + 32425 this.renderNumberTrHtml(row) + 32426 '</thead>' : 32427 '') + 32428 '</table>' + 32429 '</div>' + 32430 '</div>'; 32431 }; 32432 DayGrid.prototype.getIsNumbersVisible = function () { 32433 return this.getIsDayNumbersVisible() || this.cellWeekNumbersVisible; 32434 }; 32435 DayGrid.prototype.getIsDayNumbersVisible = function () { 32436 return this.rowCnt > 1; 32437 }; 32438 /* Grid Number Rendering 32439 ------------------------------------------------------------------------------------------------------------------*/ 32440 DayGrid.prototype.renderNumberTrHtml = function (row) { 32441 return '' + 32442 '<tr>' + 32443 (this.isRTL ? '' : this.renderNumberIntroHtml(row)) + 32444 this.renderNumberCellsHtml(row) + 32445 (this.isRTL ? this.renderNumberIntroHtml(row) : '') + 32446 '</tr>'; 32447 }; 32448 DayGrid.prototype.renderNumberIntroHtml = function (row) { 32449 return this.renderIntroHtml(); 32450 }; 32451 DayGrid.prototype.renderNumberCellsHtml = function (row) { 32452 var htmls = []; 32453 var col; 32454 var date; 32455 for (col = 0; col < this.colCnt; col++) { 32456 date = this.getCellDate(row, col); 32457 htmls.push(this.renderNumberCellHtml(date)); 32458 } 32459 return htmls.join(''); 32460 }; 32461 // Generates the HTML for the <td>s of the "number" row in the DayGrid's content skeleton. 32462 // The number row will only exist if either day numbers or week numbers are turned on. 32463 DayGrid.prototype.renderNumberCellHtml = function (date) { 32464 var view = this.view; 32465 var html = ''; 32466 var isDateValid = this.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow. 32467 var isDayNumberVisible = this.getIsDayNumbersVisible() && isDateValid; 32468 var classes; 32469 var weekCalcFirstDoW; 32470 if (!isDayNumberVisible && !this.cellWeekNumbersVisible) { 32471 // no numbers in day cell (week number must be along the side) 32472 return '<td/>'; // will create an empty space above events :( 32473 } 32474 classes = this.getDayClasses(date); 32475 classes.unshift('fc-day-top'); 32476 if (this.cellWeekNumbersVisible) { 32477 // To determine the day of week number change under ISO, we cannot 32478 // rely on moment.js methods such as firstDayOfWeek() or weekday(), 32479 // because they rely on the locale's dow (possibly overridden by 32480 // our firstDay option), which may not be Monday. We cannot change 32481 // dow, because that would affect the calendar start day as well. 32482 if (date._locale._fullCalendar_weekCalc === 'ISO') { 32483 weekCalcFirstDoW = 1; // Monday by ISO 8601 definition 32484 } 32485 else { 32486 weekCalcFirstDoW = date._locale.firstDayOfWeek(); 32487 } 32488 } 32489 html += '<td class="' + classes.join(' ') + '"' + 32490 (isDateValid ? 32491 ' data-date="' + date.format() + '"' : 32492 '') + 32493 '>'; 32494 if (this.cellWeekNumbersVisible && (date.day() === weekCalcFirstDoW)) { 32495 html += view.buildGotoAnchorHtml({ date: date, type: 'week' }, { 'class': 'fc-week-number' }, date.format('w') // inner HTML 32496 ); 32497 } 32498 if (isDayNumberVisible) { 32499 html += view.buildGotoAnchorHtml(date, { 'class': 'fc-day-number' }, date.format('D') // inner HTML 32500 ); 32501 } 32502 html += '</td>'; 32503 return html; 32504 }; 32505 /* Hit System 32506 ------------------------------------------------------------------------------------------------------------------*/ 32507 DayGrid.prototype.prepareHits = function () { 32508 this.colCoordCache.build(); 32509 this.rowCoordCache.build(); 32510 this.rowCoordCache.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack 32511 }; 32512 DayGrid.prototype.releaseHits = function () { 32513 this.colCoordCache.clear(); 32514 this.rowCoordCache.clear(); 32515 }; 32516 DayGrid.prototype.queryHit = function (leftOffset, topOffset) { 32517 if (this.colCoordCache.isLeftInBounds(leftOffset) && this.rowCoordCache.isTopInBounds(topOffset)) { 32518 var col = this.colCoordCache.getHorizontalIndex(leftOffset); 32519 var row = this.rowCoordCache.getVerticalIndex(topOffset); 32520 if (row != null && col != null) { 32521 return this.getCellHit(row, col); 32522 } 32523 } 32524 }; 32525 DayGrid.prototype.getHitFootprint = function (hit) { 32526 var range = this.getCellRange(hit.row, hit.col); 32527 return new ComponentFootprint_1.default(new UnzonedRange_1.default(range.start, range.end), true // all-day? 32528 ); 32529 }; 32530 DayGrid.prototype.getHitEl = function (hit) { 32531 return this.getCellEl(hit.row, hit.col); 32532 }; 32533 /* Cell System 32534 ------------------------------------------------------------------------------------------------------------------*/ 32535 // FYI: the first column is the leftmost column, regardless of date 32536 DayGrid.prototype.getCellHit = function (row, col) { 32537 return { 32538 row: row, 32539 col: col, 32540 component: this, 32541 left: this.colCoordCache.getLeftOffset(col), 32542 right: this.colCoordCache.getRightOffset(col), 32543 top: this.rowCoordCache.getTopOffset(row), 32544 bottom: this.rowCoordCache.getBottomOffset(row) 32545 }; 32546 }; 32547 DayGrid.prototype.getCellEl = function (row, col) { 32548 return this.cellEls.eq(row * this.colCnt + col); 32549 }; 32550 /* Event Rendering 32551 ------------------------------------------------------------------------------------------------------------------*/ 32552 // Unrenders all events currently rendered on the grid 32553 DayGrid.prototype.executeEventUnrender = function () { 32554 this.removeSegPopover(); // removes the "more.." events popover 32555 _super.prototype.executeEventUnrender.call(this); 32556 }; 32557 // Retrieves all rendered segment objects currently rendered on the grid 32558 DayGrid.prototype.getOwnEventSegs = function () { 32559 // append the segments from the "more..." popover 32560 return _super.prototype.getOwnEventSegs.call(this).concat(this.popoverSegs || []); 32561 }; 32562 /* Event Drag Visualization 32563 ------------------------------------------------------------------------------------------------------------------*/ 32564 // Renders a visual indication of an event or external element being dragged. 32565 // `eventLocation` has zoned start and end (optional) 32566 DayGrid.prototype.renderDrag = function (eventFootprints, seg, isTouch) { 32567 var i; 32568 for (i = 0; i < eventFootprints.length; i++) { 32569 this.renderHighlight(eventFootprints[i].componentFootprint); 32570 } 32571 // render drags from OTHER components as helpers 32572 if (eventFootprints.length && seg && seg.component !== this) { 32573 this.helperRenderer.renderEventDraggingFootprints(eventFootprints, seg, isTouch); 32574 return true; // signal helpers rendered 32575 } 32576 }; 32577 // Unrenders any visual indication of a hovering event 32578 DayGrid.prototype.unrenderDrag = function () { 32579 this.unrenderHighlight(); 32580 this.helperRenderer.unrender(); 32581 }; 32582 /* Event Resize Visualization 32583 ------------------------------------------------------------------------------------------------------------------*/ 32584 // Renders a visual indication of an event being resized 32585 DayGrid.prototype.renderEventResize = function (eventFootprints, seg, isTouch) { 32586 var i; 32587 for (i = 0; i < eventFootprints.length; i++) { 32588 this.renderHighlight(eventFootprints[i].componentFootprint); 32589 } 32590 this.helperRenderer.renderEventResizingFootprints(eventFootprints, seg, isTouch); 32591 }; 32592 // Unrenders a visual indication of an event being resized 32593 DayGrid.prototype.unrenderEventResize = function () { 32594 this.unrenderHighlight(); 32595 this.helperRenderer.unrender(); 32596 }; 32597 /* More+ Link Popover 32598 ------------------------------------------------------------------------------------------------------------------*/ 32599 DayGrid.prototype.removeSegPopover = function () { 32600 if (this.segPopover) { 32601 this.segPopover.hide(); // in handler, will call segPopover's removeElement 32602 } 32603 }; 32604 // Limits the number of "levels" (vertically stacking layers of events) for each row of the grid. 32605 // `levelLimit` can be false (don't limit), a number, or true (should be computed). 32606 DayGrid.prototype.limitRows = function (levelLimit) { 32607 var rowStructs = this.eventRenderer.rowStructs || []; 32608 var row; // row # 32609 var rowLevelLimit; 32610 for (row = 0; row < rowStructs.length; row++) { 32611 this.unlimitRow(row); 32612 if (!levelLimit) { 32613 rowLevelLimit = false;
32614 } 32615 else if (typeof levelLimit === 'number') { 32616 rowLevelLimit = levelLimit; 32617 } 32618 else { 32619 rowLevelLimit = this.computeRowLevelLimit(row); 32620 } 32621 if (rowLevelLimit !== false) { 32622 this.limitRow(row, rowLevelLimit); 32623 } 32624 } 32625 }; 32626 // Computes the number of levels a row will accomodate without going outside its bounds. 32627 // Assumes the row is "rigid" (maintains a constant height regardless of what is inside). 32628 // `row` is the row number. 32629 DayGrid.prototype.computeRowLevelLimit = function (row) { 32630 var rowEl = this.rowEls.eq(row); // the containing "fake" row div 32631 var rowHeight = rowEl.height(); // TODO: cache somehow? 32632 var trEls = this.eventRenderer.rowStructs[row].tbodyEl.children(); 32633 var i; 32634 var trEl; 32635 var trHeight; 32636 function iterInnerHeights(i, childNode) { 32637 trHeight = Math.max(trHeight, $(childNode).outerHeight()); 32638 } 32639 // Reveal one level <tr> at a time and stop when we find one out of bounds 32640 for (i = 0; i < trEls.length; i++) { 32641 trEl = trEls.eq(i).removeClass('fc-limited'); // reset to original state (reveal) 32642 // with rowspans>1 and IE8, trEl.outerHeight() would return the height of the largest cell, 32643 // so instead, find the tallest inner content element. 32644 trHeight = 0; 32645 trEl.find('> td > :first-child').each(iterInnerHeights); 32646 if (trEl.position().top + trHeight > rowHeight) { 32647 return i; 32648 } 32649 } 32650 return false; // should not limit at all 32651 }; 32652 // Limits the given grid row to the maximum number of levels and injects "more" links if necessary. 32653 // `row` is the row number. 32654 // `levelLimit` is a number for the maximum (inclusive) number of levels allowed. 32655 DayGrid.prototype.limitRow = function (row, levelLimit) { 32656 var _this = this; 32657 var rowStruct = this.eventRenderer.rowStructs[row]; 32658 var moreNodes = []; // array of "more" <a> links and <td> DOM nodes 32659 var col = 0; // col #, left-to-right (not chronologically) 32660 var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right 32661 var cellMatrix; // a matrix (by level, then column) of all <td> jQuery elements in the row 32662 var limitedNodes; // array of temporarily hidden level <tr> and segment <td> DOM nodes 32663 var i; 32664 var seg; 32665 var segsBelow; // array of segment objects below `seg` in the current `col` 32666 var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies 32667 var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column) 32668 var td; 32669 var rowspan; 32670 var segMoreNodes; // array of "more" <td> cells that will stand-in for the current seg's cell 32671 var j; 32672 var moreTd; 32673 var moreWrap; 32674 var moreLink; 32675 // Iterates through empty level cells and places "more" links inside if need be 32676 var emptyCellsUntil = function (endCol) { 32677 while (col < endCol) { 32678 segsBelow = _this.getCellSegs(row, col, levelLimit); 32679 if (segsBelow.length) { 32680 td = cellMatrix[levelLimit - 1][col]; 32681 moreLink = _this.renderMoreLink(row, col, segsBelow); 32682 moreWrap = $('<div/>').append(moreLink); 32683 td.append(moreWrap); 32684 moreNodes.push(moreWrap[0]); 32685 } 32686 col++; 32687 } 32688 }; 32689 if (levelLimit && levelLimit < rowStruct.segLevels.length) { 32690 levelSegs = rowStruct.segLevels[levelLimit - 1]; 32691 cellMatrix = rowStruct.cellMatrix; 32692 limitedNodes = rowStruct.tbodyEl.children().slice(levelLimit) // get level <tr> elements past the limit 32693 .addClass('fc-limited').get(); // hide elements and get a simple DOM-nodes array 32694 // iterate though segments in the last allowable level 32695 for (i = 0; i < levelSegs.length; i++) { 32696 seg = levelSegs[i]; 32697 emptyCellsUntil(seg.leftCol); // process empty cells before the segment 32698 // determine *all* segments below `seg` that occupy the same columns 32699 colSegsBelow = []; 32700 totalSegsBelow = 0; 32701 while (col <= seg.rightCol) { 32702 segsBelow = this.getCellSegs(row, col, levelLimit); 32703 colSegsBelow.push(segsBelow); 32704 totalSegsBelow += segsBelow.length; 32705 col++; 32706 } 32707 if (totalSegsBelow) { 32708 td = cellMatrix[levelLimit - 1][seg.leftCol]; // the segment's parent cell 32709 rowspan = td.attr('rowspan') || 1; 32710 segMoreNodes = []; 32711 // make a replacement <td> for each column the segment occupies. will be one for each colspan 32712 for (j = 0; j < colSegsBelow.length; j++) { 32713 moreTd = $('<td class="fc-more-cell"/>').attr('rowspan', rowspan); 32714 segsBelow = colSegsBelow[j]; 32715 moreLink = this.renderMoreLink(row, seg.leftCol + j, [seg].concat(segsBelow) // count seg as hidden too 32716 ); 32717 moreWrap = $('<div/>').append(moreLink); 32718 moreTd.append(moreWrap); 32719 segMoreNodes.push(moreTd[0]); 32720 moreNodes.push(moreTd[0]); 32721 } 32722 td.addClass('fc-limited').after($(segMoreNodes)); // hide original <td> and inject replacements 32723 limitedNodes.push(td[0]); 32724 } 32725 } 32726 emptyCellsUntil(this.colCnt); // finish off the level 32727 rowStruct.moreEls = $(moreNodes); // for easy undoing later 32728 rowStruct.limitedEls = $(limitedNodes); // for easy undoing later 32729 } 32730 }; 32731 // Reveals all levels and removes all "more"-related elements for a grid's row. 32732 // `row` is a row number. 32733 DayGrid.prototype.unlimitRow = function (row) { 32734 var rowStruct = this.eventRenderer.rowStructs[row]; 32735 if (rowStruct.moreEls) { 32736 rowStruct.moreEls.remove(); 32737 rowStruct.moreEls = null; 32738 } 32739 if (rowStruct.limitedEls) { 32740 rowStruct.limitedEls.removeClass('fc-limited'); 32741 rowStruct.limitedEls = null; 32742 } 32743 }; 32744 // Renders an <a> element that represents hidden event element for a cell. 32745 // Responsible for attaching click handler as well. 32746 DayGrid.prototype.renderMoreLink = function (row, col, hiddenSegs) { 32747 var _this = this; 32748 var view = this.view; 32749 return $('<a class="fc-more"/>') 32750 .text(this.getMoreLinkText(hiddenSegs.length)) 32751 .on('click', function (ev) { 32752 var clickOption = _this.opt('eventLimitClick'); 32753 var date = _this.getCellDate(row, col); 32754 var moreEl = $(ev.currentTarget); 32755 var dayEl = _this.getCellEl(row, col); 32756 var allSegs = _this.getCellSegs(row, col); 32757 // rescope the segments to be within the cell's date
32758 var reslicedAllSegs = _this.resliceDaySegs(allSegs, date); 32759 var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date); 32760 if (typeof clickOption === 'function') { 32761 // the returned value can be an atomic option 32762 clickOption = _this.publiclyTrigger('eventLimitClick', { 32763 context: view, 32764 args: [ 32765 { 32766 date: date.clone(), 32767 dayEl: dayEl, 32768 moreEl: moreEl, 32769 segs: reslicedAllSegs, 32770 hiddenSegs: reslicedHiddenSegs 32771 }, 32772 ev, 32773 view 32774 ] 32775 }); 32776 } 32777 if (clickOption === 'popover') { 32778 _this.showSegPopover(row, col, moreEl, reslicedAllSegs); 32779 } 32780 else if (typeof clickOption === 'string') { 32781 view.calendar.zoomTo(date, clickOption); 32782 } 32783 }); 32784 }; 32785 // Reveals the popover that displays all events within a cell 32786 DayGrid.prototype.showSegPopover = function (row, col, moreLink, segs) { 32787 var _this = this; 32788 var view = this.view; 32789 var moreWrap = moreLink.parent(); // the <div> wrapper around the <a> 32790 var topEl; // the element we want to match the top coordinate of 32791 var options; 32792 if (this.rowCnt === 1) { 32793 topEl = view.el; // will cause the popover to cover any sort of header 32794 } 32795 else { 32796 topEl = this.rowEls.eq(row); // will align with top of row 32797 } 32798 options = { 32799 className: 'fc-more-popover ' + view.calendar.theme.getClass('popover'), 32800 content: this.renderSegPopoverContent(row, col, segs), 32801 parentEl: view.el, 32802 top: topEl.offset().top, 32803 autoHide: true, 32804 viewportConstrain: this.opt('popoverViewportConstrain'), 32805 hide: function () { 32806 // kill everything when the popover is hidden 32807 // notify events to be removed 32808 if (_this.popoverSegs) { 32809 _this.triggerBeforeEventSegsDestroyed(_this.popoverSegs); 32810 } 32811 _this.segPopover.removeElement(); 32812 _this.segPopover = null; 32813 _this.popoverSegs = null; 32814 } 32815 }; 32816 // Determine horizontal coordinate. 32817 // We use the moreWrap instead of the <td> to avoid border confusion. 32818 if (this.isRTL) { 32819 options.right = moreWrap.offset().left + moreWrap.outerWidth() + 1; // +1 to be over cell border 32820 } 32821 else { 32822 options.left = moreWrap.offset().left - 1; // -1 to be over cell border 32823 } 32824 this.segPopover = new Popover_1.default(options); 32825 this.segPopover.show(); 32826 // the popover doesn't live within the grid's container element, and thus won't get the event 32827 // delegated-handlers for free. attach event-related handlers to the popover. 32828 this.bindAllSegHandlersToEl(this.segPopover.el); 32829 this.triggerAfterEventSegsRendered(segs); 32830 }; 32831 // Builds the inner DOM contents of the segment popover 32832 DayGrid.prototype.renderSegPopoverContent = function (row, col, segs) { 32833 var view = this.view; 32834 var theme = view.calendar.theme; 32835 var title = this.getCellDate(row, col).format(this.opt('dayPopoverFormat')); 32836 var content = $('<div class="fc-header ' + theme.getClass('popoverHeader') + '">' + 32837 '<span class="fc-close ' + theme.getIconClass('close') + '"></span>' + 32838 '<span class="fc-title">' + 32839 util_1.htmlEscape(title) + 32840 '</span>' + 32841 '<div class="fc-clear"/>' + 32842 '</div>' + 32843 '<div class="fc-body ' + theme.getClass('popoverContent') + '">' + 32844 '<div class="fc-event-container"></div>' + 32845 '</div>'); 32846 var segContainer = content.find('.fc-event-container'); 32847 var i; 32848 // render each seg's `el` and only return the visible segs 32849 segs = this.eventRenderer.renderFgSegEls(segs, true); // disableResizing=true 32850 this.popoverSegs = segs; 32851 for (i = 0; i < segs.length; i++) { 32852 // because segments in the popover are not part of a grid coordinate system, provide a hint to any 32853 // grids that want to do drag-n-drop about which cell it came from 32854 this.hitsNeeded(); 32855 segs[i].hit = this.getCellHit(row, col); 32856 this.hitsNotNeeded(); 32857 segContainer.append(segs[i].el); 32858 } 32859 return content; 32860 }; 32861 // Given the events within an array of segment objects, reslice them to be in a single day
32862 DayGrid.prototype.resliceDaySegs = function (segs, dayDate) { 32863 var dayStart = dayDate.clone(); 32864 var dayEnd = dayStart.clone().add(1, 'days'); 32865 var dayRange = new UnzonedRange_1.default(dayStart, dayEnd); 32866 var newSegs = []; 32867 var i; 32868 var seg; 32869 var slicedRange; 32870 for (i = 0; i < segs.length; i++) { 32871 seg = segs[i]; 32872 slicedRange = seg.footprint.componentFootprint.unzonedRange.intersect(dayRange); 32873 if (slicedRange) { 32874 newSegs.push($.extend({}, seg, { 32875 footprint: new EventFootprint_1.default(new ComponentFootprint_1.default(slicedRange, seg.footprint.componentFootprint.isAllDay), seg.footprint.eventDef, seg.footprint.eventInstance), 32876 isStart: seg.isStart && slicedRange.isStart, 32877 isEnd: seg.isEnd && slicedRange.isEnd 32878 })); 32879 } 32880 } 32881 // force an order because eventsToSegs doesn't guarantee one 32882 // TODO: research if still needed 32883 this.eventRenderer.sortEventSegs(newSegs); 32884 return newSegs; 32885 }; 32886 // Generates the text that should be inside a "more" link, given the number of events it represents 32887 DayGrid.prototype.getMoreLinkText = function (num) { 32888 var opt = this.opt('eventLimitText'); 32889 if (typeof opt === 'function') { 32890 return opt(num); 32891 } 32892 else { 32893 return '+' + num + ' ' + opt; 32894 } 32895 }; 32896 // Returns segments within a given cell. 32897 // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs. 32898 DayGrid.prototype.getCellSegs = function (row, col, startLevel) { 32899 var segMatrix = this.eventRenderer.rowStructs[row].segMatrix; 32900 var level = startLevel || 0; 32901 var segs = []; 32902 var seg; 32903 while (level < segMatrix.length) { 32904 seg = segMatrix[level][col]; 32905 if (seg) { 32906 segs.push(seg); 32907 } 32908 level++; 32909 } 32910 return segs; 32911 }; 32912 return DayGrid; 32913}(InteractiveDateComponent_1.default)); 32914exports.default = DayGrid; 32915DayGrid.prototype.eventRendererClass = DayGridEventRenderer_1.default; 32916DayGrid.prototype.businessHourRendererClass = BusinessHourRenderer_1.default; 32917DayGrid.prototype.helperRendererClass = DayGridHelperRenderer_1.default; 32918DayGrid.prototype.fillRendererClass = DayGridFillRenderer_1.default; 32919StandardInteractionsMixin_1.default.mixInto(DayGrid); 32920DayTableMixin_1.default.mixInto(DayGrid); 32921 32922 32923/***/ }), 32924/* 62 */ 32925/***/ (function(module, exports, __webpack_require__) { 32926 32927Object.defineProperty(exports, "__esModule", { value: true }); 32928var tslib_1 = __webpack_require__(2); 32929var $ = __webpack_require__(3); 32930var util_1 = __webpack_require__(4); 32931var Scroller_1 = __webpack_require__(39); 32932var View_1 = __webpack_require__(41); 32933var BasicViewDateProfileGenerator_1 = __webpack_require__(228); 32934var DayGrid_1 = __webpack_require__(61); 32935/* An abstract class for the "basic" views, as well as month view. Renders one or more rows of day cells. 32936----------------------------------------------------------------------------------------------------------------------*/ 32937// It is a manager for a DayGrid subcomponent, which does most of the heavy lifting. 32938// It is responsible for managing width/height. 32939var BasicView = /** @class */ (function (_super) { 32940 tslib_1.__extends(BasicView, _super); 32941 function BasicView(calendar, viewSpec) { 32942 var _this = _super.call(this, calendar, viewSpec) || this; 32943 _this.dayGrid = _this.instantiateDayGrid(); 32944 _this.dayGrid.isRigid = _this.hasRigidRows(); 32945 if (_this.opt('weekNumbers')) { 32946 if (_this.opt('weekNumbersWithinDays')) { 32947 _this.dayGrid.cellWeekNumbersVisible = true; 32948 _this.dayGrid.colWeekNumbersVisible = false; 32949 } 32950 else { 32951 _this.dayGrid.cellWeekNumbersVisible = false; 32952 _this.dayGrid.colWeekNumbersVisible = true; 32953 } 32954 } 32955 _this.addChild(_this.dayGrid); 32956 _this.scroller = new Scroller_1.default({ 32957 overflowX: 'hidden', 32958 overflowY: 'auto' 32959 }); 32960 return _this; 32961 } 32962 // Generates the DayGrid object this view needs. Draws from this.dayGridClass 32963 BasicView.prototype.instantiateDayGrid = function () { 32964 // generate a subclass on the fly with BasicView-specific behavior 32965 // TODO: cache this subclass 32966 var subclass = makeDayGridSubclass(this.dayGridClass); 32967 return new subclass(this); 32968 }; 32969 BasicView.prototype.executeDateRender = function (dateProfile) { 32970 this.dayGrid.breakOnWeeks = /year|month|week/.test(dateProfile.currentRangeUnit); 32971 _super.prototype.executeDateRender.call(this, dateProfile); 32972 }; 32973 BasicView.prototype.renderSkeleton = function () { 32974 var dayGridContainerEl; 32975 var dayGridEl; 32976 this.el.addClass('fc-basic-view').html(this.renderSkeletonHtml()); 32977 this.scroller.render(); 32978 dayGridContainerEl = this.scroller.el.addClass('fc-day-grid-container');
32979 dayGridEl = $('<div class="fc-day-grid" />').appendTo(dayGridContainerEl); 32980 this.el.find('.fc-body > tr > td').append(dayGridContainerEl); 32981 this.dayGrid.headContainerEl = this.el.find('.fc-head-container'); 32982 this.dayGrid.setElement(dayGridEl); 32983 }; 32984 BasicView.prototype.unrenderSkeleton = function () { 32985 this.dayGrid.removeElement(); 32986 this.scroller.destroy(); 32987 }; 32988 // Builds the HTML skeleton for the view. 32989 // The day-grid component will render inside of a container defined by this HTML. 32990 BasicView.prototype.renderSkeletonHtml = function () { 32991 var theme = this.calendar.theme; 32992 return '' + 32993 '<table class="' + theme.getClass('tableGrid') + '">' + 32994 (this.opt('columnHeader') ? 32995 '<thead class="fc-head">' + 32996 '<tr>' + 32997 '<td class="fc-head-container ' + theme.getClass('widgetHeader') + '"> </td>' + 32998 '</tr>' + 32999 '</thead>' : 33000 '') + 33001 '<tbody class="fc-body">' + 33002 '<tr>' + 33003 '<td class="' + theme.getClass('widgetContent') + '"></td>' + 33004 '</tr>' + 33005 '</tbody>' + 33006 '</table>'; 33007 }; 33008 // Generates an HTML attribute string for setting the width of the week number column, if it is known 33009 BasicView.prototype.weekNumberStyleAttr = function () { 33010 if (this.weekNumberWidth != null) { 33011 return 'style="width:' + this.weekNumberWidth + 'px"'; 33012 } 33013 return ''; 33014 }; 33015 // Determines whether each row should have a constant height 33016 BasicView.prototype.hasRigidRows = function () { 33017 var eventLimit = this.opt('eventLimit'); 33018 return eventLimit && typeof eventLimit !== 'number'; 33019 }; 33020 /* Dimensions 33021 ------------------------------------------------------------------------------------------------------------------*/ 33022 // Refreshes the horizontal dimensions of the view 33023 BasicView.prototype.updateSize = function (totalHeight, isAuto, isResize) { 33024 var eventLimit = this.opt('eventLimit'); 33025 var headRowEl = this.dayGrid.headContainerEl.find('.fc-row'); 33026 var scrollerHeight; 33027 var scrollbarWidths; 33028 // hack to give the view some height prior to dayGrid's columns being rendered 33029 // TODO: separate setting height from scroller VS dayGrid. 33030 if (!this.dayGrid.rowEls) { 33031 if (!isAuto) { 33032 scrollerHeight = this.computeScrollerHeight(totalHeight); 33033 this.scroller.setHeight(scrollerHeight); 33034 } 33035 return; 33036 } 33037 _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize); 33038 if (this.dayGrid.colWeekNumbersVisible) { 33039 // Make sure all week number cells running down the side have the same width. 33040 // Record the width for cells created later. 33041 this.weekNumberWidth = util_1.matchCellWidths(this.el.find('.fc-week-number')); 33042 } 33043 // reset all heights to be natural 33044 this.scroller.clear(); 33045 util_1.uncompensateScroll(headRowEl); 33046 this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed 33047 // is the event limit a constant level number? 33048 if (eventLimit && typeof eventLimit === 'number') { 33049 this.dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after 33050 } 33051 // distribute the height to the rows 33052 // (totalHeight is a "recommended" value if isAuto) 33053 scrollerHeight = this.computeScrollerHeight(totalHeight); 33054 this.setGridHeight(scrollerHeight, isAuto); 33055 // is the event limit dynamically calculated? 33056 if (eventLimit && typeof eventLimit !== 'number') { 33057 this.dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set 33058 } 33059 if (!isAuto) { 33060 this.scroller.setHeight(scrollerHeight); 33061 scrollbarWidths = this.scroller.getScrollbarWidths(); 33062 if (scrollbarWidths.left || scrollbarWidths.right) { 33063 util_1.compensateScroll(headRowEl, scrollbarWidths); 33064 // doing the scrollbar compensation might have created text overflow which created more height. redo 33065 scrollerHeight = this.computeScrollerHeight(totalHeight); 33066 this.scroller.setHeight(scrollerHeight); 33067 } 33068 // guarantees the same scrollbar widths 33069 this.scroller.lockOverflow(scrollbarWidths); 33070 } 33071 }; 33072 // given a desired total height of the view, returns what the height of the scroller should be 33073 BasicView.prototype.computeScrollerHeight = function (totalHeight) { 33074 return totalHeight -
33075 util_1.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller 33076 }; 33077 // Sets the height of just the DayGrid component in this view 33078 BasicView.prototype.setGridHeight = function (height, isAuto) { 33079 if (isAuto) { 33080 util_1.undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding 33081 } 33082 else { 33083 util_1.distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows 33084 } 33085 }; 33086 /* Scroll 33087 ------------------------------------------------------------------------------------------------------------------*/ 33088 BasicView.prototype.computeInitialDateScroll = function () { 33089 return { top: 0 }; 33090 }; 33091 BasicView.prototype.queryDateScroll = function () { 33092 return { top: this.scroller.getScrollTop() }; 33093 }; 33094 BasicView.prototype.applyDateScroll = function (scroll) { 33095 if (scroll.top !== undefined) { 33096 this.scroller.setScrollTop(scroll.top); 33097 } 33098 }; 33099 return BasicView; 33100}(View_1.default)); 33101exports.default = BasicView; 33102BasicView.prototype.dateProfileGeneratorClass = BasicViewDateProfileGenerator_1.default; 33103BasicView.prototype.dayGridClass = DayGrid_1.default; 33104// customize the rendering behavior of BasicView's dayGrid 33105function makeDayGridSubclass(SuperClass) { 33106 return /** @class */ (function (_super) { 33107 tslib_1.__extends(SubClass, _super); 33108 function SubClass() { 33109 var _this = _super !== null && _super.apply(this, arguments) || this; 33110 _this.colWeekNumbersVisible = false; // display week numbers along the side? 33111 return _this; 33112 } 33113 // Generates the HTML that will go before the day-of week header cells 33114 SubClass.prototype.renderHeadIntroHtml = function () { 33115 var view = this.view; 33116 if (this.colWeekNumbersVisible) { 33117 return '' + 33118 '<th class="fc-week-number ' + view.calendar.theme.getClass('widgetHeader') + '" ' + view.weekNumberStyleAttr() + '>' + 33119 '<span>' + // needed for matchCellWidths 33120 util_1.htmlEscape(this.opt('weekNumberTitle')) + 33121 '</span>' + 33122 '</th>'; 33123 } 33124 return ''; 33125 }; 33126 // Generates the HTML that will go before content-skeleton cells that display the day/week numbers 33127 SubClass.prototype.renderNumberIntroHtml = function (row) { 33128 var view = this.view; 33129 var weekStart = this.getCellDate(row, 0); 33130 if (this.colWeekNumbersVisible) { 33131 return '' + 33132 '<td class="fc-week-number" ' + view.weekNumberStyleAttr() + '>' + 33133 view.buildGotoAnchorHtml(// aside from link, important for matchCellWidths 33134 { date: weekStart, type: 'week', forceOff: this.colCnt === 1 }, weekStart.format('w') // inner HTML 33135 ) + 33136 '</td>'; 33137 } 33138 return ''; 33139 }; 33140 // Generates the HTML that goes before the day bg cells for each day-row 33141 SubClass.prototype.renderBgIntroHtml = function () { 33142 var view = this.view; 33143 if (this.colWeekNumbersVisible) { 33144 return '<td class="fc-week-number ' + view.calendar.theme.getClass('widgetContent') + '" ' + 33145 view.weekNumberStyleAttr() + '></td>'; 33146 } 33147 return ''; 33148 }; 33149 // Generates the HTML that goes before every other type of row generated by DayGrid. 33150 // Affects helper-skeleton and highlight-skeleton rows. 33151 SubClass.prototype.renderIntroHtml = function () { 33152 var view = this.view; 33153 if (this.colWeekNumbersVisible) { 33154 return '<td class="fc-week-number" ' + view.weekNumberStyleAttr() + '></td>'; 33155 } 33156 return ''; 33157 }; 33158 SubClass.prototype.getIsNumbersVisible = function () { 33159 return DayGrid_1.default.prototype.getIsNumbersVisible.apply(this, arguments) || this.colWeekNumbersVisible; 33160 }; 33161 return SubClass; 33162 }(SuperClass)); 33163} 33164 33165 33166/***/ }), 33167/* 63 */, 33168/* 64 */, 33169/* 65 */, 33170/* 66 */, 33171/* 67 */, 33172/* 68 */, 33173/* 69 */, 33174/* 70 */, 33175/* 71 */, 33176/* 72 */, 33177/* 73 */, 33178/* 74 */, 33179/* 75 */, 33180/* 76 */, 33181/* 77 */, 33182/* 78 */, 33183/* 79 */, 33184/* 80 */, 33185/* 81 */, 33186/* 82 */, 33187/* 83 */, 33188/* 84 */, 33189/* 85 */, 33190/* 86 */, 33191/* 87 */, 33192/* 88 */, 33193/* 89 */, 33194/* 90 */, 33195/* 91 */, 33196/* 92 */, 33197/* 93 */, 33198/* 94 */, 33199/* 95 */, 33200/* 96 */, 33201/* 97 */, 33202/* 98 */, 33203/* 99 */, 33204/* 100 */, 33205/* 101 */, 33206/* 102 */, 33207/* 103 */, 33208/* 104 */, 33209/* 105 */, 33210/* 106 */, 33211/* 107 */, 33212/* 108 */, 33213/* 109 */, 33214/* 110 */, 33215/* 111 */, 33216/* 112 */, 33217/* 113 */, 33218/* 114 */, 33219/* 115 */, 33220/* 116 */, 33221/* 117 */, 33222/* 118 */, 33223/* 119 */, 33224/* 120 */, 33225/* 121 */, 33226/* 122 */, 33227/* 123 */, 33228/* 124 */, 33229/* 125 */, 33230/* 126 */, 33231/* 127 */, 33232/* 128 */, 33233/* 129 */, 33234/* 130 */, 33235/* 131 */, 33236/* 132 */, 33237/* 133 */, 33238/* 134 */, 33239/* 135 */, 33240/* 136 */, 33241/* 137 */, 33242/* 138 */, 33243/* 139 */, 33244/* 140 */, 33245/* 141 */, 33246/* 142 */, 33247/* 143 */, 33248/* 144 */, 33249/* 145 */, 33250/* 146 */, 33251/* 147 */, 33252/* 148 */, 33253/* 149 */, 33254/* 150 */, 33255/* 151 */, 33256/* 152 */, 33257/* 153 */, 33258/* 154 */, 33259/* 155 */, 33260/* 156 */, 33261/* 157 */, 33262/* 158 */, 33263/* 159 */, 33264/* 160 */, 33265/* 161 */, 33266/* 162 */, 33267/* 163 */, 33268/* 164 */, 33269/* 165 */, 33270/* 166 */, 33271/* 167 */, 33272/* 168 */, 33273/* 169 */, 33274/* 170 */, 33275/* 171 */, 33276/* 172 */, 33277/* 173 */, 33278/* 174 */, 33279/* 175 */, 33280/* 176 */, 33281/* 177 */, 33282/* 178 */, 33283/* 179 */, 33284/* 180 */, 33285/* 181 */, 33286/* 182 */, 33287/* 183 */, 33288/* 184 */, 33289/* 185 */, 33290/* 186 */, 33291/* 187 */, 33292/* 188 */, 33293/* 189 */, 33294/* 190 */, 33295/* 191 */, 33296/* 192 */, 33297/* 193 */, 33298/* 194 */, 33299/* 195 */, 33300/* 196 */, 33301/* 197 */, 33302/* 198 */, 33303/* 199 */, 33304/* 200 */, 33305/* 201 */, 33306/* 202 */, 33307/* 203 */, 33308/* 204 */, 33309/* 205 */, 33310/* 206 */, 33311/* 207 */ 33312/***/ (function(module, exports, __webpack_require__) { 33313 33314Object.defineProperty(exports, "__esModule", { value: true }); 33315var UnzonedRange_1 = __webpack_require__(5); 33316var ComponentFootprint_1 = __webpack_require__(12); 33317var EventDefParser_1 = __webpack_require__(49); 33318var EventSource_1 = __webpack_require__(6); 33319var util_1 = __webpack_require__(35); 33320var Constraints = /** @class */ (function () { 33321 function Constraints(eventManager, _calendar) { 33322 this.eventManager = eventManager; 33323 this._calendar = _calendar; 33324 } 33325 Constraints.prototype.opt = function (name) { 33326 return this._calendar.opt(name); 33327 }; 33328 /* 33329 determines if eventInstanceGroup is allowed, 33330 in relation to other EVENTS and business hours. 33331 */ 33332 Constraints.prototype.isEventInstanceGroupAllowed = function (eventInstanceGroup) { 33333 var eventDef = eventInstanceGroup.getEventDef(); 33334 var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges()); 33335 var i; 33336 var peerEventInstances = this.getPeerEventInstances(eventDef); 33337 var peerEventRanges = peerEventInstances.map(util_1.eventInstanceToEventRange); 33338 var peerEventFootprints = this.eventRangesToEventFootprints(peerEventRanges); 33339 var constraintVal = eventDef.getConstraint(); 33340 var overlapVal = eventDef.getOverlap(); 33341 var eventAllowFunc = this.opt('eventAllow'); 33342 for (i = 0; i < eventFootprints.length; i++) { 33343 if (!this.isFootprintAllowed(eventFootprints[i].componentFootprint, peerEventFootprints, constraintVal, overlapVal, eventFootprints[i].eventInstance)) { 33344 return false;
33345 } 33346 } 33347 if (eventAllowFunc) { 33348 for (i = 0; i < eventFootprints.length; i++) { 33349 if (eventAllowFunc(eventFootprints[i].componentFootprint.toLegacy(this._calendar), eventFootprints[i].getEventLegacy()) === false) { 33350 return false; 33351 } 33352 } 33353 } 33354 return true; 33355 }; 33356 Constraints.prototype.getPeerEventInstances = function (eventDef) { 33357 return this.eventManager.getEventInstancesWithoutId(eventDef.id); 33358 }; 33359 Constraints.prototype.isSelectionFootprintAllowed = function (componentFootprint) { 33360 var peerEventInstances = this.eventManager.getEventInstances(); 33361 var peerEventRanges = peerEventInstances.map(util_1.eventInstanceToEventRange); 33362 var peerEventFootprints = this.eventRangesToEventFootprints(peerEventRanges); 33363 var selectAllowFunc; 33364 if (this.isFootprintAllowed(componentFootprint, peerEventFootprints, this.opt('selectConstraint'), this.opt('selectOverlap'))) { 33365 selectAllowFunc = this.opt('selectAllow'); 33366 if (selectAllowFunc) { 33367 return selectAllowFunc(componentFootprint.toLegacy(this._calendar)) !== false; 33368 } 33369 else { 33370 return true; 33371 } 33372 } 33373 return false; 33374 }; 33375 Constraints.prototype.isFootprintAllowed = function (componentFootprint, peerEventFootprints, constraintVal, overlapVal, subjectEventInstance // optional 33376 ) { 33377 var constraintFootprints; // ComponentFootprint[] 33378 var overlapEventFootprints; // EventFootprint[] 33379 if (constraintVal != null) { 33380 constraintFootprints = this.constraintValToFootprints(constraintVal, componentFootprint.isAllDay); 33381 if (!this.isFootprintWithinConstraints(componentFootprint, constraintFootprints)) { 33382 return false; 33383 } 33384 } 33385 overlapEventFootprints = this.collectOverlapEventFootprints(peerEventFootprints, componentFootprint); 33386 if (overlapVal === false) { 33387 if (overlapEventFootprints.length) { 33388 return false; 33389 } 33390 } 33391 else if (typeof overlapVal === 'function') { 33392 if (!isOverlapsAllowedByFunc(overlapEventFootprints, overlapVal, subjectEventInstance)) { 33393 return false; 33394 } 33395 } 33396 if (subjectEventInstance) { 33397 if (!isOverlapEventInstancesAllowed(overlapEventFootprints, subjectEventInstance)) { 33398 return false; 33399 } 33400 } 33401 return true; 33402 }; 33403 // Constraint 33404 // ------------------------------------------------------------------------------------------------ 33405 Constraints.prototype.isFootprintWithinConstraints = function (componentFootprint, constraintFootprints) { 33406 var i; 33407 for (i = 0; i < constraintFootprints.length; i++) { 33408 if (this.footprintContainsFootprint(constraintFootprints[i], componentFootprint)) { 33409 return true; 33410 } 33411 } 33412 return false; 33413 }; 33414 Constraints.prototype.constraintValToFootprints = function (constraintVal, isAllDay) { 33415 var eventInstances; 33416 if (constraintVal === 'businessHours') { 33417 return this.buildCurrentBusinessFootprints(isAllDay); 33418 } 33419 else if (typeof constraintVal === 'object') { 33420 eventInstances = this.parseEventDefToInstances(constraintVal); // handles recurring events 33421 if (!eventInstances) { 33422 return this.parseFootprints(constraintVal); 33423 } 33424 else { 33425 return this.eventInstancesToFootprints(eventInstances); 33426 } 33427 } 33428 else if (constraintVal != null) { 33429 eventInstances = this.eventManager.getEventInstancesWithId(constraintVal); 33430 return this.eventInstancesToFootprints(eventInstances); 33431 } 33432 }; 33433 // returns ComponentFootprint[] 33434 // uses current view's range 33435 Constraints.prototype.buildCurrentBusinessFootprints = function (isAllDay) { 33436 var view = this._calendar.view; 33437 var businessHourGenerator = view.get('businessHourGenerator'); 33438 var unzonedRange = view.dateProfile.activeUnzonedRange; 33439 var eventInstanceGroup = businessHourGenerator.buildEventInstanceGroup(isAllDay, unzonedRange); 33440 if (eventInstanceGroup) { 33441 return this.eventInstancesToFootprints(eventInstanceGroup.eventInstances); 33442 } 33443 else { 33444 return []; 33445 } 33446 }; 33447 // conversion util 33448 Constraints.prototype.eventInstancesToFootprints = function (eventInstances) { 33449 var eventRanges = eventInstances.map(util_1.eventInstanceToEventRange); 33450 var eventFootprints = this.eventRangesToEventFootprints(eventRanges); 33451 return eventFootprints.map(util_1.eventFootprintToComponentFootprint); 33452 }; 33453 // Overlap 33454 // ------------------------------------------------------------------------------------------------ 33455 Constraints.prototype.collectOverlapEventFootprints = function (peerEventFootprints, targetFootprint) { 33456 var overlapEventFootprints = []; 33457 var i; 33458 for (i = 0; i < peerEventFootprints.length; i++) { 33459 if (this.footprintsIntersect(targetFootprint, peerEventFootprints[i].componentFootprint)) { 33460 overlapEventFootprints.push(peerEventFootprints[i]); 33461 } 33462 } 33463 return overlapEventFootprints; 33464 }; 33465 // Conversion: eventDefs -> eventInstances -> eventRanges -> eventFootprints -> componentFootprints 33466 // ------------------------------------------------------------------------------------------------ 33467 // NOTE: this might seem like repetitive code with the Grid class, however, this code is related to 33468 // constraints whereas the Grid code is related to rendering. Each approach might want to convert 33469 // eventRanges -> eventFootprints in a different way. Regardless, there are opportunities to make 33470 // this more DRY. 33471 /*
33472 Returns false on invalid input. 33473 */ 33474 Constraints.prototype.parseEventDefToInstances = function (eventInput) { 33475 var eventManager = this.eventManager; 33476 var eventDef = EventDefParser_1.default.parse(eventInput, new EventSource_1.default(this._calendar)); 33477 if (!eventDef) { 33478 return false; 33479 } 33480 return eventDef.buildInstances(eventManager.currentPeriod.unzonedRange); 33481 }; 33482 Constraints.prototype.eventRangesToEventFootprints = function (eventRanges) { 33483 var i; 33484 var eventFootprints = []; 33485 for (i = 0; i < eventRanges.length; i++) { 33486 eventFootprints.push.apply(// footprints 33487 eventFootprints, this.eventRangeToEventFootprints(eventRanges[i])); 33488 } 33489 return eventFootprints; 33490 }; 33491 Constraints.prototype.eventRangeToEventFootprints = function (eventRange) { 33492 return [util_1.eventRangeToEventFootprint(eventRange)]; 33493 }; 33494 /* 33495 Parses footprints directly. 33496 Very similar to EventDateProfile::parse :( 33497 */ 33498 Constraints.prototype.parseFootprints = function (rawInput) { 33499 var start; 33500 var end; 33501 if (rawInput.start) { 33502 start = this._calendar.moment(rawInput.start); 33503 if (!start.isValid()) { 33504 start = null; 33505 } 33506 } 33507 if (rawInput.end) { 33508 end = this._calendar.moment(rawInput.end); 33509 if (!end.isValid()) { 33510 end = null; 33511 } 33512 } 33513 return [ 33514 new ComponentFootprint_1.default(new UnzonedRange_1.default(start, end), (start && !start.hasTime()) || (end && !end.hasTime()) // isAllDay 33515 ) 33516 ]; 33517 }; 33518 // Footprint Utils 33519 // ---------------------------------------------------------------------------------------- 33520 Constraints.prototype.footprintContainsFootprint = function (outerFootprint, innerFootprint) { 33521 return outerFootprint.unzonedRange.containsRange(innerFootprint.unzonedRange); 33522 }; 33523 Constraints.prototype.footprintsIntersect = function (footprint0, footprint1) { 33524 return footprint0.unzonedRange.intersectsWith(footprint1.unzonedRange); 33525 }; 33526 return Constraints; 33527}()); 33528exports.default = Constraints; 33529// optional subjectEventInstance 33530function isOverlapsAllowedByFunc(overlapEventFootprints, overlapFunc, subjectEventInstance) { 33531 var i; 33532 for (i = 0; i < overlapEventFootprints.length; i++) { 33533 if (!overlapFunc(overlapEventFootprints[i].eventInstance.toLegacy(), subjectEventInstance ? subjectEventInstance.toLegacy() : null)) { 33534 return false; 33535 } 33536 } 33537 return true; 33538} 33539function isOverlapEventInstancesAllowed(overlapEventFootprints, subjectEventInstance) { 33540 var subjectLegacyInstance = subjectEventInstance.toLegacy(); 33541 var i; 33542 var overlapEventInstance; 33543 var overlapEventDef; 33544 var overlapVal; 33545 for (i = 0; i < overlapEventFootprints.length; i++) { 33546 overlapEventInstance = overlapEventFootprints[i].eventInstance; 33547 overlapEventDef = overlapEventInstance.def; 33548 // don't need to pass in calendar, because don't want to consider global eventOverlap property, 33549 // because we already considered that earlier in the process. 33550 overlapVal = overlapEventDef.getOverlap(); 33551 if (overlapVal === false) { 33552 return false; 33553 } 33554 else if (typeof overlapVal === 'function') { 33555 if (!overlapVal(overlapEventInstance.toLegacy(), subjectLegacyInstance)) { 33556 return false; 33557 } 33558 } 33559 } 33560 return true; 33561} 33562 33563 33564/***/ }), 33565/* 208 */ 33566/***/ (function(module, exports, __webpack_require__) { 33567 33568/* 33569USAGE: 33570 import { default as ParsableModelMixin, ParsableModelInterface } from './ParsableModelMixin' 33571in class: 33572 applyProps: ParsableModelInterface['applyProps'] 33573 applyManualStandardProps: ParsableModelInterface['applyManualStandardProps'] 33574 applyMiscProps: ParsableModelInterface['applyMiscProps'] 33575 isStandardProp: ParsableModelInterface['isStandardProp'] 33576 static defineStandardProps = ParsableModelMixin.defineStandardProps 33577 static copyVerbatimStandardProps = ParsableModelMixin.copyVerbatimStandardProps 33578after class: 33579 ParsableModelMixin.mixInto(TheClass) 33580*/ 33581Object.defineProperty(exports, "__esModule", { value: true }); 33582var tslib_1 = __webpack_require__(2); 33583var util_1 = __webpack_require__(4); 33584var Mixin_1 = __webpack_require__(14); 33585var ParsableModelMixin = /** @class */ (function (_super) { 33586 tslib_1.__extends(ParsableModelMixin, _super); 33587 function ParsableModelMixin() { 33588 return _super !== null && _super.apply(this, arguments) || this; 33589 } 33590 ParsableModelMixin.defineStandardProps = function (propDefs) { 33591 var proto = this.prototype; 33592 if (!proto.hasOwnProperty('standardPropMap')) { 33593 proto.standardPropMap = Object.create(proto.standardPropMap); 33594 } 33595 util_1.copyOwnProps(propDefs, proto.standardPropMap); 33596 }; 33597 ParsableModelMixin.copyVerbatimStandardProps = function (src, dest) { 33598 var map = this.prototype.standardPropMap; 33599 var propName; 33600 for (propName in map) { 33601 if (src[propName] != null && // in the src object? 33602 map[propName] === true // false means "copy verbatim" 33603 ) { 33604 dest[propName] = src[propName]; 33605 } 33606 } 33607 }; 33608 /* 33609 Returns true/false for success. 33610 Meant to be only called ONCE, at object creation. 33611 */ 33612 ParsableModelMixin.prototype.applyProps = function (rawProps) { 33613 var standardPropMap = this.standardPropMap; 33614 var manualProps = {}; 33615 var miscProps = {}; 33616 var propName; 33617 for (propName in rawProps) { 33618 if (standardPropMap[propName] === true) { 33619 this[propName] = rawProps[propName]; 33620 } 33621 else if (standardPropMap[propName] === false) { 33622 manualProps[propName] = rawProps[propName]; 33623 } 33624 else { 33625 miscProps[propName] = rawProps[propName]; 33626 } 33627 } 33628 this.applyMiscProps(miscProps); 33629 return this.applyManualStandardProps(manualProps); 33630 }; 33631 /* 33632 If subclasses override, they must call this supermethod and return the boolean response. 33633 Meant to be only called ONCE, at object creation. 33634 */
33635 ParsableModelMixin.prototype.applyManualStandardProps = function (rawProps) { 33636 return true; 33637 }; 33638 /* 33639 Can be called even after initial object creation. 33640 */ 33641 ParsableModelMixin.prototype.applyMiscProps = function (rawProps) { 33642 // subclasses can implement 33643 }; 33644 /* 33645 TODO: why is this a method when defineStandardProps is static 33646 */ 33647 ParsableModelMixin.prototype.isStandardProp = function (propName) { 33648 return propName in this.standardPropMap; 33649 }; 33650 return ParsableModelMixin; 33651}(Mixin_1.default)); 33652exports.default = ParsableModelMixin; 33653ParsableModelMixin.prototype.standardPropMap = {}; // will be cloned by defineStandardProps 33654 33655 33656/***/ }), 33657/* 209 */ 33658/***/ (function(module, exports) { 33659 33660Object.defineProperty(exports, "__esModule", { value: true }); 33661var EventInstance = /** @class */ (function () { 33662 function EventInstance(def, dateProfile) { 33663 this.def = def; 33664 this.dateProfile = dateProfile; 33665 } 33666 EventInstance.prototype.toLegacy = function () { 33667 var dateProfile = this.dateProfile; 33668 var obj = this.def.toLegacy(); 33669 obj.start = dateProfile.start.clone(); 33670 obj.end = dateProfile.end ? dateProfile.end.clone() : null; 33671 return obj; 33672 }; 33673 return EventInstance; 33674}()); 33675exports.default = EventInstance; 33676 33677 33678/***/ }), 33679/* 210 */ 33680/***/ (function(module, exports, __webpack_require__) { 33681 33682Object.defineProperty(exports, "__esModule", { value: true }); 33683var tslib_1 = __webpack_require__(2); 33684var $ = __webpack_require__(3); 33685var moment = __webpack_require__(0); 33686var EventDef_1 = __webpack_require__(34); 33687var EventInstance_1 = __webpack_require__(209); 33688var EventDateProfile_1 = __webpack_require__(17); 33689var RecurringEventDef = /** @class */ (function (_super) { 33690 tslib_1.__extends(RecurringEventDef, _super); 33691 function RecurringEventDef() { 33692 return _super !== null && _super.apply(this, arguments) || this; 33693 } 33694 RecurringEventDef.prototype.isAllDay = function () { 33695 return !this.startTime && !this.endTime; 33696 }; 33697 RecurringEventDef.prototype.buildInstances = function (unzonedRange) { 33698 var calendar = this.source.calendar; 33699 var unzonedDate = unzonedRange.getStart(); 33700 var unzonedEnd = unzonedRange.getEnd(); 33701 var zonedDayStart; 33702 var instanceStart; 33703 var instanceEnd; 33704 var instances = []; 33705 while (unzonedDate.isBefore(unzonedEnd)) { 33706 // if everyday, or this particular day-of-week 33707 if (!this.dowHash || this.dowHash[unzonedDate.day()]) { 33708 zonedDayStart = calendar.applyTimezone(unzonedDate); 33709 instanceStart = zonedDayStart.clone(); 33710 instanceEnd = null; 33711 if (this.startTime) { 33712 instanceStart.time(this.startTime); 33713 } 33714 else { 33715 instanceStart.stripTime(); 33716 } 33717 if (this.endTime) { 33718 instanceEnd = zonedDayStart.clone().time(this.endTime); 33719 } 33720 instances.push(new EventInstance_1.default(this, // definition 33721 new EventDateProfile_1.default(instanceStart, instanceEnd, calendar))); 33722 } 33723 unzonedDate.add(1, 'days'); 33724 } 33725 return instances; 33726 }; 33727 RecurringEventDef.prototype.setDow = function (dowNumbers) { 33728 if (!this.dowHash) { 33729 this.dowHash = {}; 33730 } 33731 for (var i = 0; i < dowNumbers.length; i++) { 33732 this.dowHash[dowNumbers[i]] = true; 33733 } 33734 }; 33735 RecurringEventDef.prototype.clone = function () { 33736 var def = _super.prototype.clone.call(this); 33737 if (def.startTime) { 33738 def.startTime = moment.duration(this.startTime); 33739 } 33740 if (def.endTime) { 33741 def.endTime = moment.duration(this.endTime); 33742 } 33743 if (this.dowHash) { 33744 def.dowHash = $.extend({}, this.dowHash); 33745 } 33746 return def; 33747 }; 33748 return RecurringEventDef; 33749}(EventDef_1.default)); 33750exports.default = RecurringEventDef; 33751/* 33752HACK to work with TypeScript mixins 33753NOTE: if super-method fails, should still attempt to apply 33754*/ 33755RecurringEventDef.prototype.applyProps = function (rawProps) { 33756 var superSuccess = EventDef_1.default.prototype.applyProps.call(this, rawProps); 33757 if (rawProps.start) { 33758 this.startTime = moment.duration(rawProps.start); 33759 } 33760 if (rawProps.end) { 33761 this.endTime = moment.duration(rawProps.end); 33762 } 33763 if (rawProps.dow) { 33764 this.setDow(rawProps.dow); 33765 } 33766 return superSuccess; 33767}; 33768// Parsing 33769// --------------------------------------------------------------------------------------------------------------------- 33770RecurringEventDef.defineStandardProps({ 33771 start: false, 33772 end: false, 33773 dow: false 33774}); 33775 33776 33777/***/ }), 33778/* 211 */
33779/***/ (function(module, exports) { 33780 33781Object.defineProperty(exports, "__esModule", { value: true }); 33782var EventRange = /** @class */ (function () { 33783 function EventRange(unzonedRange, eventDef, eventInstance) { 33784 this.unzonedRange = unzonedRange; 33785 this.eventDef = eventDef; 33786 if (eventInstance) { 33787 this.eventInstance = eventInstance; 33788 } 33789 } 33790 return EventRange; 33791}()); 33792exports.default = EventRange; 33793 33794 33795/***/ }), 33796/* 212 */ 33797/***/ (function(module, exports, __webpack_require__) { 33798 33799Object.defineProperty(exports, "__esModule", { value: true }); 33800var $ = __webpack_require__(3); 33801var util_1 = __webpack_require__(35); 33802var EventInstanceGroup_1 = __webpack_require__(18); 33803var RecurringEventDef_1 = __webpack_require__(210); 33804var EventSource_1 = __webpack_require__(6); 33805var BUSINESS_HOUR_EVENT_DEFAULTS = { 33806 start: '09:00', 33807 end: '17:00', 33808 dow: [1, 2, 3, 4, 5], 33809 rendering: 'inverse-background' 33810 // classNames are defined in businessHoursSegClasses 33811}; 33812var BusinessHourGenerator = /** @class */ (function () { 33813 function BusinessHourGenerator(rawComplexDef, calendar) { 33814 this.rawComplexDef = rawComplexDef; 33815 this.calendar = calendar; 33816 } 33817 BusinessHourGenerator.prototype.buildEventInstanceGroup = function (isAllDay, unzonedRange) { 33818 var eventDefs = this.buildEventDefs(isAllDay); 33819 var eventInstanceGroup; 33820 if (eventDefs.length) { 33821 eventInstanceGroup = new EventInstanceGroup_1.default(util_1.eventDefsToEventInstances(eventDefs, unzonedRange)); 33822 // so that inverse-background rendering can happen even when no eventRanges in view 33823 eventInstanceGroup.explicitEventDef = eventDefs[0]; 33824 return eventInstanceGroup; 33825 } 33826 }; 33827 BusinessHourGenerator.prototype.buildEventDefs = function (isAllDay) { 33828 var rawComplexDef = this.rawComplexDef; 33829 var rawDefs = []; 33830 var requireDow = false; 33831 var i; 33832 var defs = []; 33833 if (rawComplexDef === true) { 33834 rawDefs = [{}]; // will get BUSINESS_HOUR_EVENT_DEFAULTS verbatim 33835 } 33836 else if ($.isPlainObject(rawComplexDef)) { 33837 rawDefs = [rawComplexDef]; 33838 } 33839 else if ($.isArray(rawComplexDef)) { 33840 rawDefs = rawComplexDef; 33841 requireDow = true; // every sub-definition NEEDS a day-of-week 33842 } 33843 for (i = 0; i < rawDefs.length; i++) { 33844 if (!requireDow || rawDefs[i].dow) { 33845 defs.push(this.buildEventDef(isAllDay, rawDefs[i])); 33846 } 33847 } 33848 return defs; 33849 }; 33850 BusinessHourGenerator.prototype.buildEventDef = function (isAllDay, rawDef) { 33851 var fullRawDef = $.extend({}, BUSINESS_HOUR_EVENT_DEFAULTS, rawDef); 33852 if (isAllDay) { 33853 fullRawDef.start = null; 33854 fullRawDef.end = null; 33855 } 33856 return RecurringEventDef_1.default.parse(fullRawDef, new EventSource_1.default(this.calendar) // dummy source 33857 ); 33858 }; 33859 return BusinessHourGenerator; 33860}()); 33861exports.default = BusinessHourGenerator; 33862 33863 33864/***/ }), 33865/* 213 */ 33866/***/ (function(module, exports, __webpack_require__) { 33867 33868Object.defineProperty(exports, "__esModule", { value: true }); 33869var tslib_1 = __webpack_require__(2); 33870var Theme_1 = __webpack_require__(19); 33871var StandardTheme = /** @class */ (function (_super) { 33872 tslib_1.__extends(StandardTheme, _super); 33873 function StandardTheme() { 33874 return _super !== null && _super.apply(this, arguments) || this; 33875 } 33876 return StandardTheme; 33877}(Theme_1.default)); 33878exports.default = StandardTheme; 33879StandardTheme.prototype.classes = { 33880 widget: 'fc-unthemed', 33881 widgetHeader: 'fc-widget-header', 33882 widgetContent: 'fc-widget-content', 33883 buttonGroup: 'fc-button-group', 33884 button: 'fc-button', 33885 cornerLeft: 'fc-corner-left', 33886 cornerRight: 'fc-corner-right', 33887 stateDefault: 'fc-state-default', 33888 stateActive: 'fc-state-active', 33889 stateDisabled: 'fc-state-disabled', 33890 stateHover: 'fc-state-hover', 33891 stateDown: 'fc-state-down', 33892 popoverHeader: 'fc-widget-header', 33893 popoverContent: 'fc-widget-content', 33894 // day grid 33895 headerRow: 'fc-widget-header', 33896 dayRow: 'fc-widget-content', 33897 // list view 33898 listView: 'fc-widget-content' 33899}; 33900StandardTheme.prototype.baseIconClass = 'fc-icon'; 33901StandardTheme.prototype.iconClasses = { 33902 close: 'fc-icon-x', 33903 prev: 'fc-icon-left-single-arrow', 33904 next: 'fc-icon-right-single-arrow', 33905 prevYear: 'fc-icon-left-double-arrow', 33906 nextYear: 'fc-icon-right-double-arrow' 33907}; 33908StandardTheme.prototype.iconOverrideOption = 'buttonIcons'; 33909StandardTheme.prototype.iconOverrideCustomButtonOption = 'icon'; 33910StandardTheme.prototype.iconOverridePrefix = 'fc-icon-'; 33911 33912 33913/***/ }), 33914/* 214 */ 33915/***/ (function(module, exports, __webpack_require__) { 33916 33917Object.defineProperty(exports, "__esModule", { value: true }); 33918var tslib_1 = __webpack_require__(2); 33919var Theme_1 = __webpack_require__(19); 33920var JqueryUiTheme = /** @class */ (function (_super) { 33921 tslib_1.__extends(JqueryUiTheme, _super); 33922 function JqueryUiTheme() { 33923 return _super !== null && _super.apply(this, arguments) || this; 33924 } 33925 return JqueryUiTheme; 33926}(Theme_1.default)); 33927exports.default = JqueryUiTheme; 33928JqueryUiTheme.prototype.classes = { 33929 widget: 'ui-widget', 33930 widgetHeader: 'ui-widget-header', 33931 widgetContent: 'ui-widget-content', 33932 buttonGroup: 'fc-button-group', 33933 button: 'ui-button', 33934 cornerLeft: 'ui-corner-left', 33935 cornerRight: 'ui-corner-right', 33936 stateDefault: 'ui-state-default', 33937 stateActive: 'ui-state-active', 33938 stateDisabled: 'ui-state-disabled', 33939 stateHover: 'ui-state-hover', 33940 stateDown: 'ui-state-down', 33941 today: 'ui-state-highlight', 33942 popoverHeader: 'ui-widget-header', 33943 popoverContent: 'ui-widget-content', 33944 // day grid 33945 headerRow: 'ui-widget-header', 33946 dayRow: 'ui-widget-content', 33947 // list view 33948 listView: 'ui-widget-content' 33949}; 33950JqueryUiTheme.prototype.baseIconClass = 'ui-icon'; 33951JqueryUiTheme.prototype.iconClasses = { 33952 close: 'ui-icon-closethick', 33953 prev: 'ui-icon-circle-triangle-w', 33954 next: 'ui-icon-circle-triangle-e', 33955 prevYear: 'ui-icon-seek-prev', 33956 nextYear: 'ui-icon-seek-next' 33957}; 33958JqueryUiTheme.prototype.iconOverrideOption = 'themeButtonIcons'; 33959JqueryUiTheme.prototype.iconOverrideCustomButtonOption = 'themeIcon'; 33960JqueryUiTheme.prototype.iconOverridePrefix = 'ui-icon-'; 33961 33962 33963/***/ }), 33964/* 215 */ 33965/***/ (function(module, exports, __webpack_require__) { 33966 33967Object.defineProperty(exports, "__esModule", { value: true }); 33968var tslib_1 = __webpack_require__(2); 33969var $ = __webpack_require__(3); 33970var Promise_1 = __webpack_require__(20); 33971var EventSource_1 = __webpack_require__(6); 33972var FuncEventSource = /** @class */ (function (_super) { 33973 tslib_1.__extends(FuncEventSource, _super); 33974 function FuncEventSource() { 33975 return _super !== null && _super.apply(this, arguments) || this; 33976 } 33977 FuncEventSource.parse = function (rawInput, calendar) { 33978 var rawProps; 33979 // normalize raw input 33980 if ($.isFunction(rawInput.events)) { 33981 rawProps = rawInput; 33982 } 33983 else if ($.isFunction(rawInput)) { 33984 rawProps = { events: rawInput }; 33985 } 33986 if (rawProps) { 33987 return EventSource_1.default.parse.call(this, rawProps, calendar); 33988 } 33989 return false;
33990 }; 33991 FuncEventSource.prototype.fetch = function (start, end, timezone) { 33992 var _this = this; 33993 this.calendar.pushLoading(); 33994 return Promise_1.default.construct(function (onResolve) { 33995 _this.func.call(_this.calendar, start.clone(), end.clone(), timezone, function (rawEventDefs) { 33996 _this.calendar.popLoading(); 33997 onResolve(_this.parseEventDefs(rawEventDefs)); 33998 }); 33999 }); 34000 }; 34001 FuncEventSource.prototype.getPrimitive = function () { 34002 return this.func; 34003 }; 34004 FuncEventSource.prototype.applyManualStandardProps = function (rawProps) { 34005 var superSuccess = _super.prototype.applyManualStandardProps.call(this, rawProps); 34006 this.func = rawProps.events; 34007 return superSuccess; 34008 }; 34009 return FuncEventSource; 34010}(EventSource_1.default)); 34011exports.default = FuncEventSource; 34012FuncEventSource.defineStandardProps({ 34013 events: false // don't automatically transfer 34014}); 34015 34016 34017/***/ }), 34018/* 216 */ 34019/***/ (function(module, exports, __webpack_require__) { 34020 34021Object.defineProperty(exports, "__esModule", { value: true }); 34022var tslib_1 = __webpack_require__(2); 34023var $ = __webpack_require__(3); 34024var util_1 = __webpack_require__(4); 34025var Promise_1 = __webpack_require__(20); 34026var EventSource_1 = __webpack_require__(6); 34027var JsonFeedEventSource = /** @class */ (function (_super) { 34028 tslib_1.__extends(JsonFeedEventSource, _super); 34029 function JsonFeedEventSource() { 34030 return _super !== null && _super.apply(this, arguments) || this; 34031 } 34032 JsonFeedEventSource.parse = function (rawInput, calendar) { 34033 var rawProps; 34034 // normalize raw input 34035 if (typeof rawInput.url === 'string') { 34036 rawProps = rawInput; 34037 } 34038 else if (typeof rawInput === 'string') { 34039 rawProps = { url: rawInput }; 34040 } 34041 if (rawProps) { 34042 return EventSource_1.default.parse.call(this, rawProps, calendar); 34043 } 34044 return false; 34045 }; 34046 JsonFeedEventSource.prototype.fetch = function (start, end, timezone) { 34047 var _this = this; 34048 var ajaxSettings = this.ajaxSettings; 34049 var onSuccess = ajaxSettings.success; 34050 var onError = ajaxSettings.error; 34051 var requestParams = this.buildRequestParams(start, end, timezone); 34052 // todo: eventually handle the promise's then, 34053 // don't intercept success/error 34054 // tho will be a breaking API change 34055 this.calendar.pushLoading(); 34056 return Promise_1.default.construct(function (onResolve, onReject) { 34057 $.ajax($.extend({}, // destination 34058 JsonFeedEventSource.AJAX_DEFAULTS, ajaxSettings, { 34059 url: _this.url, 34060 data: requestParams, 34061 success: function (rawEventDefs, status, xhr) { 34062 var callbackRes; 34063 _this.calendar.popLoading(); 34064 if (rawEventDefs) { 34065 callbackRes = util_1.applyAll(onSuccess, _this, [rawEventDefs, status, xhr]); // redirect `this` 34066 if ($.isArray(callbackRes)) { 34067 rawEventDefs = callbackRes; 34068 } 34069 onResolve(_this.parseEventDefs(rawEventDefs)); 34070 } 34071 else { 34072 onReject(); 34073 } 34074 }, 34075 error: function (xhr, statusText, errorThrown) { 34076 _this.calendar.popLoading(); 34077 util_1.applyAll(onError, _this, [xhr, statusText, errorThrown]); // redirect `this` 34078 onReject(); 34079 } 34080 })); 34081 }); 34082 }; 34083 JsonFeedEventSource.prototype.buildRequestParams = function (start, end, timezone) { 34084 var calendar = this.calendar; 34085 var ajaxSettings = this.ajaxSettings; 34086 var startParam; 34087 var endParam; 34088 var timezoneParam;
34089 var customRequestParams; 34090 var params = {}; 34091 startParam = this.startParam; 34092 if (startParam == null) { 34093 startParam = calendar.opt('startParam'); 34094 } 34095 endParam = this.endParam; 34096 if (endParam == null) { 34097 endParam = calendar.opt('endParam'); 34098 } 34099 timezoneParam = this.timezoneParam; 34100 if (timezoneParam == null) { 34101 timezoneParam = calendar.opt('timezoneParam'); 34102 } 34103 // retrieve any outbound GET/POST $.ajax data from the options 34104 if ($.isFunction(ajaxSettings.data)) { 34105 // supplied as a function that returns a key/value object 34106 customRequestParams = ajaxSettings.data(); 34107 } 34108 else { 34109 // probably supplied as a straight key/value object 34110 customRequestParams = ajaxSettings.data || {}; 34111 } 34112 $.extend(params, customRequestParams); 34113 params[startParam] = start.format(); 34114 params[endParam] = end.format(); 34115 if (timezone && timezone !== 'local') { 34116 params[timezoneParam] = timezone; 34117 } 34118 return params; 34119 }; 34120 JsonFeedEventSource.prototype.getPrimitive = function () { 34121 return this.url; 34122 }; 34123 JsonFeedEventSource.prototype.applyMiscProps = function (rawProps) { 34124 this.ajaxSettings = rawProps; 34125 }; 34126 JsonFeedEventSource.AJAX_DEFAULTS = { 34127 dataType: 'json', 34128 cache: false 34129 }; 34130 return JsonFeedEventSource; 34131}(EventSource_1.default)); 34132exports.default = JsonFeedEventSource; 34133JsonFeedEventSource.defineStandardProps({ 34134 // automatically transfer (true)... 34135 url: true, 34136 startParam: true, 34137 endParam: true, 34138 timezoneParam: true 34139}); 34140 34141 34142/***/ }), 34143/* 217 */ 34144/***/ (function(module, exports, __webpack_require__) { 34145 34146Object.defineProperty(exports, "__esModule", { value: true }); 34147var EmitterMixin_1 = __webpack_require__(11); 34148var TaskQueue = /** @class */ (function () { 34149 function TaskQueue() { 34150 this.q = []; 34151 this.isPaused = false; 34152 this.isRunning = false; 34153 } 34154 TaskQueue.prototype.queue = function () { 34155 var args = []; 34156 for (var _i = 0; _i < arguments.length; _i++) { 34157 args[_i] = arguments[_i]; 34158 } 34159 this.q.push.apply(this.q, args); // append 34160 this.tryStart(); 34161 }; 34162 TaskQueue.prototype.pause = function () { 34163 this.isPaused = true; 34164 }; 34165 TaskQueue.prototype.resume = function () { 34166 this.isPaused = false; 34167 this.tryStart(); 34168 }; 34169 TaskQueue.prototype.getIsIdle = function () { 34170 return !this.isRunning && !this.isPaused; 34171 }; 34172 TaskQueue.prototype.tryStart = function () { 34173 if (!this.isRunning && this.canRunNext()) { 34174 this.isRunning = true; 34175 this.trigger('start'); 34176 this.runRemaining(); 34177 } 34178 }; 34179 TaskQueue.prototype.canRunNext = function () { 34180 return !this.isPaused && this.q.length; 34181 }; 34182 TaskQueue.prototype.runRemaining = function () { 34183 var _this = this; 34184 var task; 34185 var res; 34186 do { 34187 task = this.q.shift(); // always freshly reference q. might have been reassigned. 34188 res = this.runTask(task); 34189 if (res && res.then) { 34190 res.then(function () { 34191 if (_this.canRunNext()) { 34192 _this.runRemaining(); 34193 } 34194 }); 34195 return; // prevent marking as stopped 34196 } 34197 } while (this.canRunNext()); 34198 this.trigger('stop'); // not really a 'stop' ... more of a 'drained' 34199 this.isRunning = false; 34200 // if 'stop' handler added more tasks.... TODO: write test for this 34201 this.tryStart(); 34202 }; 34203 TaskQueue.prototype.runTask = function (task) { 34204 return task(); // task *is* the function, but subclasses can change the format of a task 34205 }; 34206 return TaskQueue; 34207}()); 34208exports.default = TaskQueue; 34209EmitterMixin_1.default.mixInto(TaskQueue); 34210 34211 34212/***/ }), 34213/* 218 */ 34214/***/ (function(module, exports, __webpack_require__) { 34215 34216Object.defineProperty(exports, "__esModule", { value: true }); 34217var tslib_1 = __webpack_require__(2); 34218var TaskQueue_1 = __webpack_require__(217); 34219var RenderQueue = /** @class */ (function (_super) { 34220 tslib_1.__extends(RenderQueue, _super);
34221 function RenderQueue(waitsByNamespace) { 34222 var _this = _super.call(this) || this; 34223 _this.waitsByNamespace = waitsByNamespace || {}; 34224 return _this; 34225 } 34226 RenderQueue.prototype.queue = function (taskFunc, namespace, type) { 34227 var task = { 34228 func: taskFunc, 34229 namespace: namespace, 34230 type: type 34231 }; 34232 var waitMs; 34233 if (namespace) { 34234 waitMs = this.waitsByNamespace[namespace]; 34235 } 34236 if (this.waitNamespace) { 34237 if (namespace === this.waitNamespace && waitMs != null) { 34238 this.delayWait(waitMs); 34239 } 34240 else { 34241 this.clearWait(); 34242 this.tryStart(); 34243 } 34244 } 34245 if (this.compoundTask(task)) { 34246 if (!this.waitNamespace && waitMs != null) { 34247 this.startWait(namespace, waitMs); 34248 } 34249 else { 34250 this.tryStart(); 34251 } 34252 } 34253 }; 34254 RenderQueue.prototype.startWait = function (namespace, waitMs) { 34255 this.waitNamespace = namespace; 34256 this.spawnWait(waitMs); 34257 }; 34258 RenderQueue.prototype.delayWait = function (waitMs) { 34259 clearTimeout(this.waitId); 34260 this.spawnWait(waitMs); 34261 }; 34262 RenderQueue.prototype.spawnWait = function (waitMs) { 34263 var _this = this; 34264 this.waitId = setTimeout(function () { 34265 _this.waitNamespace = null; 34266 _this.tryStart(); 34267 }, waitMs); 34268 }; 34269 RenderQueue.prototype.clearWait = function () { 34270 if (this.waitNamespace) { 34271 clearTimeout(this.waitId); 34272 this.waitId = null; 34273 this.waitNamespace = null; 34274 } 34275 }; 34276 RenderQueue.prototype.canRunNext = function () { 34277 if (!_super.prototype.canRunNext.call(this)) { 34278 return false; 34279 } 34280 // waiting for a certain namespace to stop receiving tasks? 34281 if (this.waitNamespace) { 34282 var q = this.q; 34283 // if there was a different namespace task in the meantime, 34284 // that forces all previously-waiting tasks to suddenly execute.
34285 // TODO: find a way to do this in constant time. 34286 for (var i = 0; i < q.length; i++) { 34287 if (q[i].namespace !== this.waitNamespace) { 34288 return true; // allow execution 34289 } 34290 } 34291 return false; 34292 } 34293 return true; 34294 }; 34295 RenderQueue.prototype.runTask = function (task) { 34296 task.func(); 34297 }; 34298 RenderQueue.prototype.compoundTask = function (newTask) { 34299 var q = this.q; 34300 var shouldAppend = true; 34301 var i; 34302 var task; 34303 if (newTask.namespace && newTask.type === 'destroy') { 34304 // remove all init/add/remove ops with same namespace, regardless of order 34305 for (i = q.length - 1; i >= 0; i--) { 34306 task = q[i]; 34307 switch (task.type) { 34308 case 'init': 34309 shouldAppend = false; 34310 // the latest destroy is cancelled out by not doing the init 34311 /* falls through */ 34312 case 'add': 34313 /* falls through */ 34314 case 'remove': 34315 q.splice(i, 1); // remove task 34316 } 34317 } 34318 } 34319 if (shouldAppend) { 34320 q.push(newTask); 34321 } 34322 return shouldAppend; 34323 }; 34324 return RenderQueue; 34325}(TaskQueue_1.default)); 34326exports.default = RenderQueue; 34327 34328 34329/***/ }), 34330/* 219 */ 34331/***/ (function(module, exports, __webpack_require__) { 34332 34333Object.defineProperty(exports, "__esModule", { value: true }); 34334var tslib_1 = __webpack_require__(2); 34335var $ = __webpack_require__(3); 34336var moment = __webpack_require__(0); 34337var util_1 = __webpack_require__(4); 34338var moment_ext_1 = __webpack_require__(10); 34339var date_formatting_1 = __webpack_require__(47); 34340var Component_1 = __webpack_require__(237); 34341var util_2 = __webpack_require__(35); 34342var DateComponent = /** @class */ (function (_super) { 34343 tslib_1.__extends(DateComponent, _super); 34344 function DateComponent(_view, _options) { 34345 var _this = _super.call(this) || this; 34346 _this.isRTL = false; // frequently accessed options 34347 _this.hitsNeededDepth = 0; // necessary because multiple callers might need the same hits 34348 _this.hasAllDayBusinessHours = false; // TODO: unify with largeUnit and isTimeScale? 34349 _this.isDatesRendered = false; 34350 // hack to set options prior to the this.opt calls 34351 if (_view) { 34352 _this['view'] = _view; 34353 } 34354 if (_options) { 34355 _this['options'] = _options; 34356 } 34357 _this.uid = String(DateComponent.guid++); 34358 _this.childrenByUid = {}; 34359 _this.nextDayThreshold = moment.duration(_this.opt('nextDayThreshold')); 34360 _this.isRTL = _this.opt('isRTL'); 34361 if (_this.fillRendererClass) { 34362 _this.fillRenderer = new _this.fillRendererClass(_this); 34363 } 34364 if (_this.eventRendererClass) { 34365 _this.eventRenderer = new _this.eventRendererClass(_this, _this.fillRenderer); 34366 } 34367 if (_this.helperRendererClass && _this.eventRenderer) { 34368 _this.helperRenderer = new _this.helperRendererClass(_this, _this.eventRenderer); 34369 } 34370 if (_this.businessHourRendererClass && _this.fillRenderer) { 34371 _this.businessHourRenderer = new _this.businessHourRendererClass(_this, _this.fillRenderer); 34372 } 34373 return _this; 34374 } 34375 DateComponent.prototype.addChild = function (child) { 34376 if (!this.childrenByUid[child.uid]) { 34377 this.childrenByUid[child.uid] = child; 34378 return true; 34379 } 34380 return false; 34381 }; 34382 DateComponent.prototype.removeChild = function (child) { 34383 if (this.childrenByUid[child.uid]) { 34384 delete this.childrenByUid[child.uid]; 34385 return true; 34386 } 34387 return false; 34388 }; 34389 // TODO: only do if isInDom? 34390 // TODO: make part of Component, along with children/batch-render system? 34391 DateComponent.prototype.updateSize = function (totalHeight, isAuto, isResize) { 34392 this.callChildren('updateSize', arguments); 34393 }; 34394 // Options 34395 // ----------------------------------------------------------------------------------------------------------------- 34396 DateComponent.prototype.opt = function (name) { 34397 return this._getView().opt(name); // default implementation 34398 }; 34399 DateComponent.prototype.publiclyTrigger = function () { 34400 var args = []; 34401 for (var _i = 0; _i < arguments.length; _i++) { 34402 args[_i] = arguments[_i]; 34403 }
34404 var calendar = this._getCalendar(); 34405 return calendar.publiclyTrigger.apply(calendar, args); 34406 }; 34407 DateComponent.prototype.hasPublicHandlers = function () { 34408 var args = []; 34409 for (var _i = 0; _i < arguments.length; _i++) { 34410 args[_i] = arguments[_i]; 34411 } 34412 var calendar = this._getCalendar(); 34413 return calendar.hasPublicHandlers.apply(calendar, args); 34414 }; 34415 // Date 34416 // ----------------------------------------------------------------------------------------------------------------- 34417 DateComponent.prototype.executeDateRender = function (dateProfile) { 34418 this.dateProfile = dateProfile; // for rendering 34419 this.renderDates(dateProfile); 34420 this.isDatesRendered = true; 34421 this.callChildren('executeDateRender', arguments); 34422 }; 34423 DateComponent.prototype.executeDateUnrender = function () { 34424 this.callChildren('executeDateUnrender', arguments); 34425 this.dateProfile = null; 34426 this.unrenderDates(); 34427 this.isDatesRendered = false; 34428 }; 34429 // date-cell content only 34430 DateComponent.prototype.renderDates = function (dateProfile) { 34431 // subclasses should implement 34432 }; 34433 // date-cell content only 34434 DateComponent.prototype.unrenderDates = function () { 34435 // subclasses should override 34436 }; 34437 // Now-Indicator 34438 // ----------------------------------------------------------------------------------------------------------------- 34439 // Returns a string unit, like 'second' or 'minute' that defined how often the current time indicator 34440 // should be refreshed. If something falsy is returned, no time indicator is rendered at all. 34441 DateComponent.prototype.getNowIndicatorUnit = function () { 34442 // subclasses should implement 34443 }; 34444 // Renders a current time indicator at the given datetime 34445 DateComponent.prototype.renderNowIndicator = function (date) { 34446 this.callChildren('renderNowIndicator', arguments); 34447 }; 34448 // Undoes the rendering actions from renderNowIndicator 34449 DateComponent.prototype.unrenderNowIndicator = function () { 34450 this.callChildren('unrenderNowIndicator', arguments); 34451 }; 34452 // Business Hours 34453 // --------------------------------------------------------------------------------------------------------------- 34454 DateComponent.prototype.renderBusinessHours = function (businessHourGenerator) { 34455 if (this.businessHourRenderer) { 34456 this.businessHourRenderer.render(businessHourGenerator); 34457 } 34458 this.callChildren('renderBusinessHours', arguments); 34459 }; 34460 // Unrenders previously-rendered business-hours 34461 DateComponent.prototype.unrenderBusinessHours = function () { 34462 this.callChildren('unrenderBusinessHours', arguments); 34463 if (this.businessHourRenderer) { 34464 this.businessHourRenderer.unrender(); 34465 } 34466 }; 34467 // Event Displaying 34468 // ----------------------------------------------------------------------------------------------------------------- 34469 DateComponent.prototype.executeEventRender = function (eventsPayload) { 34470 if (this.eventRenderer) { 34471 this.eventRenderer.rangeUpdated(); // poorly named now 34472 this.eventRenderer.render(eventsPayload); 34473 } 34474 else if (this['renderEvents']) { 34475 this['renderEvents'](convertEventsPayloadToLegacyArray(eventsPayload)); 34476 } 34477 this.callChildren('executeEventRender', arguments); 34478 }; 34479 DateComponent.prototype.executeEventUnrender = function () { 34480 this.callChildren('executeEventUnrender', arguments); 34481 if (this.eventRenderer) { 34482 this.eventRenderer.unrender(); 34483 } 34484 else if (this['destroyEvents']) { 34485 this['destroyEvents'](); 34486 } 34487 }; 34488 DateComponent.prototype.getBusinessHourSegs = function () { 34489 var segs = this.getOwnBusinessHourSegs(); 34490 this.iterChildren(function (child) { 34491 segs.push.apply(segs, child.getBusinessHourSegs()); 34492 }); 34493 return segs; 34494 }; 34495 DateComponent.prototype.getOwnBusinessHourSegs = function () { 34496 if (this.businessHourRenderer) { 34497 return this.businessHourRenderer.getSegs(); 34498 } 34499 return []; 34500 }; 34501 DateComponent.prototype.getEventSegs = function () { 34502 var segs = this.getOwnEventSegs(); 34503 this.iterChildren(function (child) { 34504 segs.push.apply(segs, child.getEventSegs()); 34505 }); 34506 return segs; 34507 }; 34508 DateComponent.prototype.getOwnEventSegs = function () { 34509 if (this.eventRenderer) { 34510 return this.eventRenderer.getSegs(); 34511 } 34512 return []; 34513 }; 34514 // Event Rendering Triggering 34515 // ----------------------------------------------------------------------------------------------------------------- 34516 DateComponent.prototype.triggerAfterEventsRendered = function () { 34517 this.triggerAfterEventSegsRendered(this.getEventSegs()); 34518 this.publiclyTrigger('eventAfterAllRender', { 34519 context: this, 34520 args: [this] 34521 }); 34522 }; 34523 DateComponent.prototype.triggerAfterEventSegsRendered = function (segs) { 34524 var _this = this; 34525 // an optimization, because getEventLegacy is expensive 34526 if (this.hasPublicHandlers('eventAfterRender')) {
34527 segs.forEach(function (seg) { 34528 var legacy; 34529 if (seg.el) { 34530 legacy = seg.footprint.getEventLegacy(); 34531 _this.publiclyTrigger('eventAfterRender', { 34532 context: legacy, 34533 args: [legacy, seg.el, _this] 34534 }); 34535 } 34536 }); 34537 } 34538 }; 34539 DateComponent.prototype.triggerBeforeEventsDestroyed = function () { 34540 this.triggerBeforeEventSegsDestroyed(this.getEventSegs()); 34541 }; 34542 DateComponent.prototype.triggerBeforeEventSegsDestroyed = function (segs) { 34543 var _this = this; 34544 if (this.hasPublicHandlers('eventDestroy')) { 34545 segs.forEach(function (seg) { 34546 var legacy; 34547 if (seg.el) { 34548 legacy = seg.footprint.getEventLegacy(); 34549 _this.publiclyTrigger('eventDestroy', { 34550 context: legacy, 34551 args: [legacy, seg.el, _this] 34552 }); 34553 } 34554 }); 34555 } 34556 }; 34557 // Event Rendering Utils 34558 // ----------------------------------------------------------------------------------------------------------------- 34559 // Hides all rendered event segments linked to the given event 34560 // RECURSIVE with subcomponents 34561 DateComponent.prototype.showEventsWithId = function (eventDefId) { 34562 this.getEventSegs().forEach(function (seg) { 34563 if (seg.footprint.eventDef.id === eventDefId && 34564 seg.el // necessary? 34565 ) { 34566 seg.el.css('visibility', ''); 34567 } 34568 }); 34569 this.callChildren('showEventsWithId', arguments); 34570 }; 34571 // Shows all rendered event segments linked to the given event 34572 // RECURSIVE with subcomponents 34573 DateComponent.prototype.hideEventsWithId = function (eventDefId) { 34574 this.getEventSegs().forEach(function (seg) { 34575 if (seg.footprint.eventDef.id === eventDefId && 34576 seg.el // necessary? 34577 ) { 34578 seg.el.css('visibility', 'hidden'); 34579 } 34580 }); 34581 this.callChildren('hideEventsWithId', arguments); 34582 }; 34583 // Drag-n-Drop Rendering (for both events and external elements) 34584 // --------------------------------------------------------------------------------------------------------------- 34585 // Renders a visual indication of a event or external-element drag over the given drop zone. 34586 // If an external-element, seg will be `null`. 34587 // Must return elements used for any mock events. 34588 DateComponent.prototype.renderDrag = function (eventFootprints, seg, isTouch) { 34589 var renderedHelper = false; 34590 this.iterChildren(function (child) { 34591 if (child.renderDrag(eventFootprints, seg, isTouch)) { 34592 renderedHelper = true; 34593 } 34594 }); 34595 return renderedHelper; 34596 }; 34597 // Unrenders a visual indication of an event or external-element being dragged. 34598 DateComponent.prototype.unrenderDrag = function () { 34599 this.callChildren('unrenderDrag', arguments); 34600 }; 34601 // Event Resizing 34602 // --------------------------------------------------------------------------------------------------------------- 34603 // Renders a visual indication of an event being resized. 34604 DateComponent.prototype.renderEventResize = function (eventFootprints, seg, isTouch) { 34605 this.callChildren('renderEventResize', arguments); 34606 }; 34607 // Unrenders a visual indication of an event being resized. 34608 DateComponent.prototype.unrenderEventResize = function () { 34609 this.callChildren('unrenderEventResize', arguments); 34610 }; 34611 // Selection 34612 // --------------------------------------------------------------------------------------------------------------- 34613 // Renders a visual indication of the selection 34614 // TODO: rename to `renderSelection` after legacy is gone 34615 DateComponent.prototype.renderSelectionFootprint = function (componentFootprint) { 34616 this.renderHighlight(componentFootprint); 34617 this.callChildren('renderSelectionFootprint', arguments); 34618 }; 34619 // Unrenders a visual indication of selection 34620 DateComponent.prototype.unrenderSelection = function () { 34621 this.unrenderHighlight(); 34622 this.callChildren('unrenderSelection', arguments); 34623 }; 34624 // Highlight 34625 // --------------------------------------------------------------------------------------------------------------- 34626 // Renders an emphasis on the given date range. Given a span (unzoned start/end and other misc data) 34627 DateComponent.prototype.renderHighlight = function (componentFootprint) { 34628 if (this.fillRenderer) { 34629 this.fillRenderer.renderFootprint('highlight', componentFootprint, { 34630 getClasses: function () { 34631 return ['fc-highlight']; 34632 } 34633 }); 34634 } 34635 this.callChildren('renderHighlight', arguments); 34636 }; 34637 // Unrenders the emphasis on a date range 34638 DateComponent.prototype.unrenderHighlight = function () { 34639 if (this.fillRenderer) { 34640 this.fillRenderer.unrender('highlight'); 34641 } 34642 this.callChildren('unrenderHighlight', arguments); 34643 }; 34644 // Hit Areas 34645 // --------------------------------------------------------------------------------------------------------------- 34646 // just because all DateComponents support this interface
34647 // doesn't mean they need to have their own internal coord system. they can defer to sub-components. 34648 DateComponent.prototype.hitsNeeded = function () { 34649 if (!(this.hitsNeededDepth++)) { 34650 this.prepareHits(); 34651 } 34652 this.callChildren('hitsNeeded', arguments); 34653 }; 34654 DateComponent.prototype.hitsNotNeeded = function () { 34655 if (this.hitsNeededDepth && !(--this.hitsNeededDepth)) { 34656 this.releaseHits(); 34657 } 34658 this.callChildren('hitsNotNeeded', arguments); 34659 }; 34660 DateComponent.prototype.prepareHits = function () { 34661 // subclasses can implement 34662 }; 34663 DateComponent.prototype.releaseHits = function () { 34664 // subclasses can implement 34665 }; 34666 // Given coordinates from the topleft of the document, return data about the date-related area underneath. 34667 // Can return an object with arbitrary properties (although top/right/left/bottom are encouraged). 34668 // Must have a `grid` property, a reference to this current grid. TODO: avoid this 34669 // The returned object will be processed by getHitFootprint and getHitEl. 34670 DateComponent.prototype.queryHit = function (leftOffset, topOffset) { 34671 var childrenByUid = this.childrenByUid; 34672 var uid; 34673 var hit; 34674 for (uid in childrenByUid) { 34675 hit = childrenByUid[uid].queryHit(leftOffset, topOffset); 34676 if (hit) { 34677 break; 34678 } 34679 } 34680 return hit; 34681 }; 34682 DateComponent.prototype.getSafeHitFootprint = function (hit) { 34683 var footprint = this.getHitFootprint(hit); 34684 if (!this.dateProfile.activeUnzonedRange.containsRange(footprint.unzonedRange)) { 34685 return null; 34686 } 34687 return footprint; 34688 }; 34689 DateComponent.prototype.getHitFootprint = function (hit) { 34690 // what about being abstract!? 34691 }; 34692 // Given position-level information about a date-related area within the grid, 34693 // should return a jQuery element that best represents it. passed to dayClick callback. 34694 DateComponent.prototype.getHitEl = function (hit) { 34695 // what about being abstract!? 34696 }; 34697 /* Converting eventRange -> eventFootprint 34698 ------------------------------------------------------------------------------------------------------------------*/ 34699 DateComponent.prototype.eventRangesToEventFootprints = function (eventRanges) { 34700 var eventFootprints = []; 34701 var i; 34702 for (i = 0; i < eventRanges.length; i++) { 34703 eventFootprints.push.apply(// append 34704 eventFootprints, this.eventRangeToEventFootprints(eventRanges[i])); 34705 } 34706 return eventFootprints; 34707 }; 34708 DateComponent.prototype.eventRangeToEventFootprints = function (eventRange) { 34709 return [util_2.eventRangeToEventFootprint(eventRange)]; 34710 }; 34711 /* Converting componentFootprint/eventFootprint -> segs 34712 ------------------------------------------------------------------------------------------------------------------*/ 34713 DateComponent.prototype.eventFootprintsToSegs = function (eventFootprints) { 34714 var segs = []; 34715 var i; 34716 for (i = 0; i < eventFootprints.length; i++) { 34717 segs.push.apply(segs, this.eventFootprintToSegs(eventFootprints[i])); 34718 } 34719 return segs; 34720 }; 34721 // Given an event's span (unzoned start/end and other misc data), and the event itself, 34722 // slices into segments and attaches event-derived properties to them. 34723 // eventSpan - { start, end, isStart, isEnd, otherthings... } 34724 DateComponent.prototype.eventFootprintToSegs = function (eventFootprint) { 34725 var unzonedRange = eventFootprint.componentFootprint.unzonedRange; 34726 var segs; 34727 var i; 34728 var seg; 34729 segs = this.componentFootprintToSegs(eventFootprint.componentFootprint); 34730 for (i = 0; i < segs.length; i++) { 34731 seg = segs[i]; 34732 if (!unzonedRange.isStart) { 34733 seg.isStart = false;
34734 } 34735 if (!unzonedRange.isEnd) { 34736 seg.isEnd = false; 34737 } 34738 seg.footprint = eventFootprint; 34739 // TODO: rename to seg.eventFootprint 34740 } 34741 return segs; 34742 }; 34743 DateComponent.prototype.componentFootprintToSegs = function (componentFootprint) { 34744 return []; 34745 }; 34746 // Utils 34747 // --------------------------------------------------------------------------------------------------------------- 34748 DateComponent.prototype.callChildren = function (methodName, args) { 34749 this.iterChildren(function (child) { 34750 child[methodName].apply(child, args); 34751 }); 34752 }; 34753 DateComponent.prototype.iterChildren = function (func) { 34754 var childrenByUid = this.childrenByUid; 34755 var uid; 34756 for (uid in childrenByUid) { 34757 func(childrenByUid[uid]); 34758 } 34759 }; 34760 DateComponent.prototype._getCalendar = function () { 34761 var t = this; 34762 return t.calendar || t.view.calendar; 34763 }; 34764 DateComponent.prototype._getView = function () { 34765 return this.view; 34766 }; 34767 DateComponent.prototype._getDateProfile = function () { 34768 return this._getView().get('dateProfile'); 34769 }; 34770 // Generates HTML for an anchor to another view into the calendar. 34771 // Will either generate an <a> tag or a non-clickable <span> tag, depending on enabled settings. 34772 // `gotoOptions` can either be a moment input, or an object with the form: 34773 // { date, type, forceOff } 34774 // `type` is a view-type like "day" or "week". default value is "day". 34775 // `attrs` and `innerHtml` are use to generate the rest of the HTML tag. 34776 DateComponent.prototype.buildGotoAnchorHtml = function (gotoOptions, attrs, innerHtml) { 34777 var date; 34778 var type; 34779 var forceOff; 34780 var finalOptions; 34781 if ($.isPlainObject(gotoOptions)) { 34782 date = gotoOptions.date; 34783 type = gotoOptions.type; 34784 forceOff = gotoOptions.forceOff; 34785 } 34786 else { 34787 date = gotoOptions; // a single moment input 34788 } 34789 date = moment_ext_1.default(date); // if a string, parse it 34790 finalOptions = { 34791 date: date.format('YYYY-MM-DD'), 34792 type: type || 'day' 34793 }; 34794 if (typeof attrs === 'string') { 34795 innerHtml = attrs; 34796 attrs = null; 34797 } 34798 attrs = attrs ? ' ' + util_1.attrsToStr(attrs) : ''; // will have a leading space 34799 innerHtml = innerHtml || ''; 34800 if (!forceOff && this.opt('navLinks')) { 34801 return '<a' + attrs + 34802 ' data-goto="' + util_1.htmlEscape(JSON.stringify(finalOptions)) + '">' + 34803 innerHtml + 34804 '</a>'; 34805 } 34806 else { 34807 return '<span' + attrs + '>' + 34808 innerHtml + 34809 '</span>'; 34810 } 34811 }; 34812 DateComponent.prototype.getAllDayHtml = function () { 34813 return this.opt('allDayHtml') || util_1.htmlEscape(this.opt('allDayText')); 34814 }; 34815 // Computes HTML classNames for a single-day element 34816 DateComponent.prototype.getDayClasses = function (date, noThemeHighlight) { 34817 var view = this._getView(); 34818 var classes = []; 34819 var today; 34820 if (!this.dateProfile.activeUnzonedRange.containsDate(date)) { 34821 classes.push('fc-disabled-day'); // TODO: jQuery UI theme? 34822 } 34823 else { 34824 classes.push('fc-' + util_1.dayIDs[date.day()]); 34825 if (view.isDateInOtherMonth(date, this.dateProfile)) { 34826 classes.push('fc-other-month'); 34827 } 34828 today = view.calendar.getNow(); 34829 if (date.isSame(today, 'day')) { 34830 classes.push('fc-today'); 34831 if (noThemeHighlight !== true) { 34832 classes.push(view.calendar.theme.getClass('today')); 34833 } 34834 } 34835 else if (date < today) { 34836 classes.push('fc-past'); 34837 } 34838 else { 34839 classes.push('fc-future'); 34840 } 34841 } 34842 return classes; 34843 }; 34844 // Utility for formatting a range. Accepts a range object, formatting string, and optional separator. 34845 // Displays all-day ranges naturally, with an inclusive end. Takes the current isRTL into account. 34846 // The timezones of the dates within `range` will be respected. 34847 DateComponent.prototype.formatRange = function (range, isAllDay, formatStr, separator) { 34848 var end = range.end; 34849 if (isAllDay) { 34850 end = end.clone().subtract(1); // convert to inclusive. last ms of previous day 34851 } 34852 return date_formatting_1.formatRange(range.start, end, formatStr, separator, this.isRTL); 34853 }; 34854 // Compute the number of the give units in the "current" range. 34855 // Will return a floating-point number. Won't round. 34856 DateComponent.prototype.currentRangeAs = function (unit) { 34857 return this._getDateProfile().currentUnzonedRange.as(unit); 34858 }; 34859 // Returns the date range of the full days the given range visually appears to occupy. 34860 // Returns a plain object with start/end, NOT an UnzonedRange! 34861 DateComponent.prototype.computeDayRange = function (unzonedRange) {
34862 var calendar = this._getCalendar(); 34863 var startDay = calendar.msToUtcMoment(unzonedRange.startMs, true); // the beginning of the day the range starts 34864 var end = calendar.msToUtcMoment(unzonedRange.endMs); 34865 var endTimeMS = +end.time(); // # of milliseconds into `endDay` 34866 var endDay = end.clone().stripTime(); // the beginning of the day the range exclusively ends 34867 // If the end time is actually inclusively part of the next day and is equal to or 34868 // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`. 34869 // Otherwise, leaving it as inclusive will cause it to exclude `endDay`. 34870 if (endTimeMS && endTimeMS >= this.nextDayThreshold) { 34871 endDay.add(1, 'days'); 34872 } 34873 // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day. 34874 if (endDay <= startDay) { 34875 endDay = startDay.clone().add(1, 'days'); 34876 } 34877 return { start: startDay, end: endDay }; 34878 }; 34879 // Does the given range visually appear to occupy more than one day? 34880 DateComponent.prototype.isMultiDayRange = function (unzonedRange) { 34881 var dayRange = this.computeDayRange(unzonedRange); 34882 return dayRange.end.diff(dayRange.start, 'days') > 1; 34883 }; 34884 DateComponent.guid = 0; // TODO: better system for this? 34885 return DateComponent; 34886}(Component_1.default)); 34887exports.default = DateComponent; 34888// legacy 34889function convertEventsPayloadToLegacyArray(eventsPayload) { 34890 var eventDefId; 34891 var eventInstances; 34892 var legacyEvents = []; 34893 var i; 34894 for (eventDefId in eventsPayload) { 34895 eventInstances = eventsPayload[eventDefId].eventInstances; 34896 for (i = 0; i < eventInstances.length; i++) { 34897 legacyEvents.push(eventInstances[i].toLegacy()); 34898 } 34899 } 34900 return legacyEvents; 34901} 34902 34903 34904/***/ }), 34905/* 220 */ 34906/***/ (function(module, exports, __webpack_require__) { 34907 34908Object.defineProperty(exports, "__esModule", { value: true }); 34909var $ = __webpack_require__(3); 34910var moment = __webpack_require__(0); 34911var util_1 = __webpack_require__(4); 34912var options_1 = __webpack_require__(32); 34913var Iterator_1 = __webpack_require__(238); 34914var GlobalEmitter_1 = __webpack_require__(21); 34915var EmitterMixin_1 = __webpack_require__(11); 34916var ListenerMixin_1 = __webpack_require__(7); 34917var Toolbar_1 = __webpack_require__(239); 34918var OptionsManager_1 = __webpack_require__(240); 34919var ViewSpecManager_1 = __webpack_require__(241); 34920var Constraints_1 = __webpack_require__(207); 34921var locale_1 = __webpack_require__(31); 34922var moment_ext_1 = __webpack_require__(10); 34923var UnzonedRange_1 = __webpack_require__(5); 34924var ComponentFootprint_1 = __webpack_require__(12); 34925var EventDateProfile_1 = __webpack_require__(17); 34926var EventManager_1 = __webpack_require__(242); 34927var BusinessHourGenerator_1 = __webpack_require__(212); 34928var EventSourceParser_1 = __webpack_require__(38); 34929var EventDefParser_1 = __webpack_require__(49); 34930var SingleEventDef_1 = __webpack_require__(13); 34931var EventDefMutation_1 = __webpack_require__(37); 34932var EventSource_1 = __webpack_require__(6); 34933var ThemeRegistry_1 = __webpack_require__(51); 34934var Calendar = /** @class */ (function () { 34935 function Calendar(el, overrides) { 34936 this.loadingLevel = 0; // number of simultaneous loading tasks 34937 this.ignoreUpdateViewSize = 0; 34938 this.freezeContentHeightDepth = 0; 34939 // declare the current calendar instance relies on GlobalEmitter. needed for garbage collection. 34940 // unneeded() is called in destroy. 34941 GlobalEmitter_1.default.needed(); 34942 this.el = el; 34943 this.viewsByType = {}; 34944 this.optionsManager = new OptionsManager_1.default(this, overrides); 34945 this.viewSpecManager = new ViewSpecManager_1.default(this.optionsManager, this); 34946 this.initMomentInternals(); // needs to happen after options hash initialized 34947 this.initCurrentDate(); 34948 this.initEventManager(); 34949 this.constraints = new Constraints_1.default(this.eventManager, this); 34950 this.constructed(); 34951 } 34952 Calendar.prototype.constructed = function () { 34953 // useful for monkeypatching. used? 34954 }; 34955 Calendar.prototype.getView = function () { 34956 return this.view; 34957 }; 34958 Calendar.prototype.publiclyTrigger = function (name, triggerInfo) { 34959 var optHandler = this.opt(name); 34960 var context; 34961 var args; 34962 if ($.isPlainObject(triggerInfo)) { 34963 context = triggerInfo.context; 34964 args = triggerInfo.args; 34965 } 34966 else if ($.isArray(triggerInfo)) { 34967 args = triggerInfo; 34968 } 34969 if (context == null) { 34970 context = this.el[0]; // fallback context 34971 } 34972 if (!args) { 34973 args = []; 34974 }
34975 this.triggerWith(name, context, args); // Emitter's method 34976 if (optHandler) { 34977 return optHandler.apply(context, args); 34978 } 34979 }; 34980 Calendar.prototype.hasPublicHandlers = function (name) { 34981 return this.hasHandlers(name) || 34982 this.opt(name); // handler specified in options 34983 }; 34984 // Options Public API 34985 // ----------------------------------------------------------------------------------------------------------------- 34986 // public getter/setter 34987 Calendar.prototype.option = function (name, value) { 34988 var newOptionHash; 34989 if (typeof name === 'string') { 34990 if (value === undefined) { 34991 return this.optionsManager.get(name); 34992 } 34993 else { 34994 newOptionHash = {}; 34995 newOptionHash[name] = value; 34996 this.optionsManager.add(newOptionHash); 34997 } 34998 } 34999 else if (typeof name === 'object') { 35000 this.optionsManager.add(name); 35001 } 35002 }; 35003 // private getter 35004 Calendar.prototype.opt = function (name) { 35005 return this.optionsManager.get(name); 35006 }; 35007 // View 35008 // ----------------------------------------------------------------------------------------------------------------- 35009 // Given a view name for a custom view or a standard view, creates a ready-to-go View object 35010 Calendar.prototype.instantiateView = function (viewType) { 35011 var spec = this.viewSpecManager.getViewSpec(viewType); 35012 if (!spec) { 35013 throw new Error("View type \"" + viewType + "\" is not valid"); 35014 } 35015 return new spec['class'](this, spec); 35016 }; 35017 // Returns a boolean about whether the view is okay to instantiate at some point 35018 Calendar.prototype.isValidViewType = function (viewType) { 35019 return Boolean(this.viewSpecManager.getViewSpec(viewType)); 35020 }; 35021 Calendar.prototype.changeView = function (viewName, dateOrRange) { 35022 if (dateOrRange) { 35023 if (dateOrRange.start && dateOrRange.end) { 35024 this.optionsManager.recordOverrides({ 35025 visibleRange: dateOrRange 35026 }); 35027 } 35028 else { 35029 this.currentDate = this.moment(dateOrRange).stripZone(); // just like gotoDate 35030 } 35031 } 35032 this.renderView(viewName); 35033 }; 35034 // Forces navigation to a view for the given date. 35035 // `viewType` can be a specific view name or a generic one like "week" or "day". 35036 Calendar.prototype.zoomTo = function (newDate, viewType) { 35037 var spec; 35038 viewType = viewType || 'day'; // day is default zoom 35039 spec = this.viewSpecManager.getViewSpec(viewType) || 35040 this.viewSpecManager.getUnitViewSpec(viewType); 35041 this.currentDate = newDate.clone(); 35042 this.renderView(spec ? spec.type : null); 35043 }; 35044 // Current Date 35045 // ----------------------------------------------------------------------------------------------------------------- 35046 Calendar.prototype.initCurrentDate = function () { 35047 var defaultDateInput = this.opt('defaultDate'); 35048 // compute the initial ambig-timezone date 35049 if (defaultDateInput != null) { 35050 this.currentDate = this.moment(defaultDateInput).stripZone(); 35051 } 35052 else { 35053 this.currentDate = this.getNow(); // getNow already returns unzoned 35054 } 35055 }; 35056 Calendar.prototype.prev = function () { 35057 var view = this.view; 35058 var prevInfo = view.dateProfileGenerator.buildPrev(view.get('dateProfile')); 35059 if (prevInfo.isValid) { 35060 this.currentDate = prevInfo.date; 35061 this.renderView(); 35062 } 35063 }; 35064 Calendar.prototype.next = function () { 35065 var view = this.view; 35066 var nextInfo = view.dateProfileGenerator.buildNext(view.get('dateProfile')); 35067 if (nextInfo.isValid) { 35068 this.currentDate = nextInfo.date; 35069 this.renderView(); 35070 } 35071 }; 35072 Calendar.prototype.prevYear = function () { 35073 this.currentDate.add(-1, 'years'); 35074 this.renderView(); 35075 }; 35076 Calendar.prototype.nextYear = function () { 35077 this.currentDate.add(1, 'years'); 35078 this.renderView(); 35079 }; 35080 Calendar.prototype.today = function () { 35081 this.currentDate = this.getNow(); // should deny like prev/next? 35082 this.renderView(); 35083 }; 35084 Calendar.prototype.gotoDate = function (zonedDateInput) { 35085 this.currentDate = this.moment(zonedDateInput).stripZone(); 35086 this.renderView(); 35087 }; 35088 Calendar.prototype.incrementDate = function (delta) { 35089 this.currentDate.add(moment.duration(delta)); 35090 this.renderView(); 35091 }; 35092 // for external API 35093 Calendar.prototype.getDate = function () { 35094 return this.applyTimezone(this.currentDate); // infuse the calendar's timezone 35095 }; 35096 // Loading Triggering 35097 // ----------------------------------------------------------------------------------------------------------------- 35098 // Should be called when any type of async data fetching begins 35099 Calendar.prototype.pushLoading = function () { 35100 if (!(this.loadingLevel++)) { 35101 this.publiclyTrigger('loading', [true, this.view]); 35102 } 35103 }; 35104 // Should be called when any type of async data fetching completes 35105 Calendar.prototype.popLoading = function () { 35106 if (!(--this.loadingLevel)) { 35107 this.publiclyTrigger('loading', [false, this.view]); 35108 } 35109 }; 35110 // High-level Rendering 35111 // ----------------------------------------------------------------------------------- 35112 Calendar.prototype.render = function () { 35113 if (!this.contentEl) { 35114 this.initialRender(); 35115 } 35116 else if (this.elementVisible()) { 35117 // mainly for the public API 35118 this.calcSize(); 35119 this.updateViewSize(); 35120 } 35121 }; 35122 Calendar.prototype.initialRender = function () { 35123 var _this = this; 35124 var el = this.el; 35125 el.addClass('fc'); 35126 // event delegation for nav links 35127 el.on('click.fc', 'a[data-goto]', function (ev) { 35128 var anchorEl = $(ev.currentTarget); 35129 var gotoOptions = anchorEl.data('goto'); // will automatically parse JSON 35130 var date = _this.moment(gotoOptions.date); 35131 var viewType = gotoOptions.type; 35132 // property like "navLinkDayClick". might be a string or a function 35133 var customAction = _this.view.opt('navLink' + util_1.capitaliseFirstLetter(viewType) + 'Click'); 35134 if (typeof customAction === 'function') { 35135 customAction(date, ev); 35136 } 35137 else { 35138 if (typeof customAction === 'string') { 35139 viewType = customAction; 35140 } 35141 _this.zoomTo(date, viewType); 35142 } 35143 });
35144 // called immediately, and upon option change 35145 this.optionsManager.watch('settingTheme', ['?theme', '?themeSystem'], function (opts) { 35146 var themeClass = ThemeRegistry_1.getThemeSystemClass(opts.themeSystem || opts.theme); 35147 var theme = new themeClass(_this.optionsManager); 35148 var widgetClass = theme.getClass('widget'); 35149 _this.theme = theme; 35150 if (widgetClass) { 35151 el.addClass(widgetClass); 35152 } 35153 }, function () { 35154 var widgetClass = _this.theme.getClass('widget'); 35155 _this.theme = null; 35156 if (widgetClass) { 35157 el.removeClass(widgetClass); 35158 } 35159 }); 35160 this.optionsManager.watch('settingBusinessHourGenerator', ['?businessHours'], function (deps) { 35161 _this.businessHourGenerator = new BusinessHourGenerator_1.default(deps.businessHours, _this); 35162 if (_this.view) { 35163 _this.view.set('businessHourGenerator', _this.businessHourGenerator); 35164 } 35165 }, function () { 35166 _this.businessHourGenerator = null; 35167 }); 35168 // called immediately, and upon option change. 35169 // HACK: locale often affects isRTL, so we explicitly listen to that too. 35170 this.optionsManager.watch('applyingDirClasses', ['?isRTL', '?locale'], function (opts) { 35171 el.toggleClass('fc-ltr', !opts.isRTL); 35172 el.toggleClass('fc-rtl', opts.isRTL); 35173 }); 35174 this.contentEl = $("<div class='fc-view-container'/>").prependTo(el); 35175 this.initToolbars(); 35176 this.renderHeader(); 35177 this.renderFooter(); 35178 this.renderView(this.opt('defaultView')); 35179 if (this.opt('handleWindowResize')) { 35180 $(window).resize(this.windowResizeProxy = util_1.debounce(// prevents rapid calls 35181 this.windowResize.bind(this), this.opt('windowResizeDelay'))); 35182 } 35183 }; 35184 Calendar.prototype.destroy = function () { 35185 if (this.view) { 35186 this.clearView(); 35187 } 35188 this.toolbarsManager.proxyCall('removeElement'); 35189 this.contentEl.remove(); 35190 this.el.removeClass('fc fc-ltr fc-rtl'); 35191 // removes theme-related root className 35192 this.optionsManager.unwatch('settingTheme'); 35193 this.optionsManager.unwatch('settingBusinessHourGenerator'); 35194 this.el.off('.fc'); // unbind nav link handlers 35195 if (this.windowResizeProxy) { 35196 $(window).unbind('resize', this.windowResizeProxy); 35197 this.windowResizeProxy = null; 35198 } 35199 GlobalEmitter_1.default.unneeded(); 35200 }; 35201 Calendar.prototype.elementVisible = function () { 35202 return this.el.is(':visible'); 35203 }; 35204 // Render Queue 35205 // ----------------------------------------------------------------------------------------------------------------- 35206 Calendar.prototype.bindViewHandlers = function (view) { 35207 var _this = this; 35208 view.watch('titleForCalendar', ['title'], function (deps) { 35209 if (view === _this.view) { 35210 _this.setToolbarsTitle(deps.title); 35211 } 35212 }); 35213 view.watch('dateProfileForCalendar', ['dateProfile'], function (deps) { 35214 if (view === _this.view) { 35215 _this.currentDate = deps.dateProfile.date; // might have been constrained by view dates 35216 _this.updateToolbarButtons(deps.dateProfile); 35217 } 35218 }); 35219 }; 35220 Calendar.prototype.unbindViewHandlers = function (view) { 35221 view.unwatch('titleForCalendar'); 35222 view.unwatch('dateProfileForCalendar'); 35223 }; 35224 // View Rendering 35225 // ----------------------------------------------------------------------------------- 35226 // Renders a view because of a date change, view-type change, or for the first time. 35227 // If not given a viewType, keep the current view but render different dates. 35228 // Accepts an optional scroll state to restore to. 35229 Calendar.prototype.renderView = function (viewType) { 35230 var oldView = this.view; 35231 var newView; 35232 this.freezeContentHeight(); 35233 if (oldView && viewType && oldView.type !== viewType) { 35234 this.clearView(); 35235 } 35236 // if viewType changed, or the view was never created, create a fresh view 35237 if (!this.view && viewType) { 35238 newView = this.view = 35239 this.viewsByType[viewType] || 35240 (this.viewsByType[viewType] = this.instantiateView(viewType)); 35241 this.bindViewHandlers(newView); 35242 newView.startBatchRender(); // so that setElement+setDate rendering are joined 35243 newView.setElement($("<div class='fc-view fc-" + viewType + "-view' />").appendTo(this.contentEl)); 35244 this.toolbarsManager.proxyCall('activateButton', viewType); 35245 } 35246 if (this.view) { 35247 // prevent unnecessary change firing 35248 if (this.view.get('businessHourGenerator') !== this.businessHourGenerator) { 35249 this.view.set('businessHourGenerator', this.businessHourGenerator); 35250 } 35251 this.view.setDate(this.currentDate); 35252 if (newView) { 35253 newView.stopBatchRender(); 35254 } 35255 } 35256 this.thawContentHeight(); 35257 }; 35258 // Unrenders the current view and reflects this change in the Header. 35259 // Unregsiters the `view`, but does not remove from viewByType hash. 35260 Calendar.prototype.clearView = function () { 35261 var currentView = this.view; 35262 this.toolbarsManager.proxyCall('deactivateButton', currentView.type); 35263 this.unbindViewHandlers(currentView); 35264 currentView.removeElement(); 35265 currentView.unsetDate(); // so bindViewHandlers doesn't fire with old values next time 35266 this.view = null; 35267 }; 35268 // Destroys the view, including the view object. Then, re-instantiates it and renders it. 35269 // Maintains the same scroll state. 35270 // TODO: maintain any other user-manipulated state. 35271 Calendar.prototype.reinitView = function () { 35272 var oldView = this.view; 35273 var scroll = oldView.queryScroll(); // wouldn't be so complicated if Calendar owned the scroll 35274 this.freezeContentHeight(); 35275 this.clearView(); 35276 this.calcSize(); 35277 this.renderView(oldView.type); // needs the type to freshly render 35278 this.view.applyScroll(scroll); 35279 this.thawContentHeight(); 35280 }; 35281 // Resizing 35282 // ----------------------------------------------------------------------------------- 35283 Calendar.prototype.getSuggestedViewHeight = function () { 35284 if (this.suggestedViewHeight == null) { 35285 this.calcSize(); 35286 } 35287 return this.suggestedViewHeight; 35288 }; 35289 Calendar.prototype.isHeightAuto = function () { 35290 return this.opt('contentHeight') === 'auto' || this.opt('height') === 'auto'; 35291 }; 35292 Calendar.prototype.updateViewSize = function (isResize) { 35293 if (isResize === void 0) { isResize = false; } 35294 var view = this.view; 35295 var scroll; 35296 if (!this.ignoreUpdateViewSize && view) { 35297 if (isResize) { 35298 this.calcSize(); 35299 scroll = view.queryScroll(); 35300 } 35301 this.ignoreUpdateViewSize++; 35302 view.updateSize(this.getSuggestedViewHeight(), this.isHeightAuto(), isResize); 35303 this.ignoreUpdateViewSize--; 35304 if (isResize) { 35305 view.applyScroll(scroll); 35306 } 35307 return true; // signal success 35308 } 35309 }; 35310 Calendar.prototype.calcSize = function () { 35311 if (this.elementVisible()) { 35312 this._calcSize(); 35313 } 35314 }; 35315 Calendar.prototype._calcSize = function () { 35316 var contentHeightInput = this.opt('contentHeight'); 35317 var heightInput = this.opt('height'); 35318 if (typeof contentHeightInput === 'number') { 35319 this.suggestedViewHeight = contentHeightInput; 35320 } 35321 else if (typeof contentHeightInput === 'function') { 35322 this.suggestedViewHeight = contentHeightInput(); 35323 } 35324 else if (typeof heightInput === 'number') { 35325 this.suggestedViewHeight = heightInput - this.queryToolbarsHeight(); 35326 } 35327 else if (typeof heightInput === 'function') { 35328 this.suggestedViewHeight = heightInput() - this.queryToolbarsHeight(); 35329 } 35330 else if (heightInput === 'parent') { 35331 this.suggestedViewHeight = this.el.parent().height() - this.queryToolbarsHeight(); 35332 } 35333 else { 35334 this.suggestedViewHeight = Math.round(this.contentEl.width() / 35335 Math.max(this.opt('aspectRatio'), .5)); 35336 } 35337 }; 35338 Calendar.prototype.windowResize = function (ev) { 35339 if ( 35340 // the purpose: so we don't process jqui "resize" events that have bubbled up 35341 // cast to any because .target, which is Element, can't be compared to window for some reason. 35342 ev.target === window && 35343 this.view && 35344 this.view.isDatesRendered) { 35345 if (this.updateViewSize(true)) { 35346 this.publiclyTrigger('windowResize', [this.view]); 35347 } 35348 } 35349 }; 35350 /* Height "Freezing" 35351 -----------------------------------------------------------------------------*/ 35352 Calendar.prototype.freezeContentHeight = function () { 35353 if (!(this.freezeContentHeightDepth++)) { 35354 this.forceFreezeContentHeight(); 35355 } 35356 }; 35357 Calendar.prototype.forceFreezeContentHeight = function () { 35358 this.contentEl.css({ 35359 width: '100%', 35360 height: this.contentEl.height(), 35361 overflow: 'hidden' 35362 }); 35363 }; 35364 Calendar.prototype.thawContentHeight = function () { 35365 this.freezeContentHeightDepth--; 35366 // always bring back to natural height 35367 this.contentEl.css({ 35368 width: '', 35369 height: '', 35370 overflow: '' 35371 }); 35372 // but if there are future thaws, re-freeze 35373 if (this.freezeContentHeightDepth) { 35374 this.forceFreezeContentHeight(); 35375 } 35376 }; 35377 // Toolbar 35378 // ----------------------------------------------------------------------------------------------------------------- 35379 Calendar.prototype.initToolbars = function () { 35380 this.header = new Toolbar_1.default(this, this.computeHeaderOptions()); 35381 this.footer = new Toolbar_1.default(this, this.computeFooterOptions()); 35382 this.toolbarsManager = new Iterator_1.default([this.header, this.footer]); 35383 }; 35384 Calendar.prototype.computeHeaderOptions = function () { 35385 return {
35386 extraClasses: 'fc-header-toolbar', 35387 layout: this.opt('header') 35388 }; 35389 }; 35390 Calendar.prototype.computeFooterOptions = function () { 35391 return { 35392 extraClasses: 'fc-footer-toolbar', 35393 layout: this.opt('footer') 35394 }; 35395 }; 35396 // can be called repeatedly and Header will rerender 35397 Calendar.prototype.renderHeader = function () { 35398 var header = this.header; 35399 header.setToolbarOptions(this.computeHeaderOptions()); 35400 header.render(); 35401 if (header.el) { 35402 this.el.prepend(header.el); 35403 } 35404 }; 35405 // can be called repeatedly and Footer will rerender 35406 Calendar.prototype.renderFooter = function () { 35407 var footer = this.footer; 35408 footer.setToolbarOptions(this.computeFooterOptions()); 35409 footer.render(); 35410 if (footer.el) { 35411 this.el.append(footer.el); 35412 } 35413 }; 35414 Calendar.prototype.setToolbarsTitle = function (title) { 35415 this.toolbarsManager.proxyCall('updateTitle', title); 35416 }; 35417 Calendar.prototype.updateToolbarButtons = function (dateProfile) { 35418 var now = this.getNow(); 35419 var view = this.view; 35420 var todayInfo = view.dateProfileGenerator.build(now); 35421 var prevInfo = view.dateProfileGenerator.buildPrev(view.get('dateProfile')); 35422 var nextInfo = view.dateProfileGenerator.buildNext(view.get('dateProfile')); 35423 this.toolbarsManager.proxyCall((todayInfo.isValid && !dateProfile.currentUnzonedRange.containsDate(now)) ? 35424 'enableButton' : 35425 'disableButton', 'today'); 35426 this.toolbarsManager.proxyCall(prevInfo.isValid ? 35427 'enableButton' : 35428 'disableButton', 'prev'); 35429 this.toolbarsManager.proxyCall(nextInfo.isValid ? 35430 'enableButton' : 35431 'disableButton', 'next'); 35432 }; 35433 Calendar.prototype.queryToolbarsHeight = function () { 35434 return this.toolbarsManager.items.reduce(function (accumulator, toolbar) { 35435 var toolbarHeight = toolbar.el ? toolbar.el.outerHeight(true) : 0; // includes margin 35436 return accumulator + toolbarHeight; 35437 }, 0); 35438 }; 35439 // Selection 35440 // ----------------------------------------------------------------------------------------------------------------- 35441 // this public method receives start/end dates in any format, with any timezone 35442 Calendar.prototype.select = function (zonedStartInput, zonedEndInput) { 35443 this.view.select(this.buildSelectFootprint.apply(this, arguments)); 35444 }; 35445 Calendar.prototype.unselect = function () { 35446 if (this.view) { 35447 this.view.unselect(); 35448 } 35449 }; 35450 // Given arguments to the select method in the API, returns a span (unzoned start/end and other info) 35451 Calendar.prototype.buildSelectFootprint = function (zonedStartInput, zonedEndInput) { 35452 var start = this.moment(zonedStartInput).stripZone(); 35453 var end; 35454 if (zonedEndInput) { 35455 end = this.moment(zonedEndInput).stripZone(); 35456 } 35457 else if (start.hasTime()) { 35458 end = start.clone().add(this.defaultTimedEventDuration); 35459 } 35460 else { 35461 end = start.clone().add(this.defaultAllDayEventDuration); 35462 } 35463 return new ComponentFootprint_1.default(new UnzonedRange_1.default(start, end), !start.hasTime()); 35464 }; 35465 // Date Utils 35466 // ----------------------------------------------------------------------------------------------------------------- 35467 Calendar.prototype.initMomentInternals = function () { 35468 var _this = this; 35469 this.defaultAllDayEventDuration = moment.duration(this.opt('defaultAllDayEventDuration')); 35470 this.defaultTimedEventDuration = moment.duration(this.opt('defaultTimedEventDuration')); 35471 // Called immediately, and when any of the options change. 35472 // Happens before any internal objects rebuild or rerender, because this is very core. 35473 this.optionsManager.watch('buildingMomentLocale', [ 35474 '?locale', '?monthNames', '?monthNamesShort', '?dayNames', '?dayNamesShort', 35475 '?firstDay', '?weekNumberCalculation' 35476 ], function (opts) { 35477 var weekNumberCalculation = opts.weekNumberCalculation; 35478 var firstDay = opts.firstDay; 35479 var _week; 35480 // normalize
35481 if (weekNumberCalculation === 'iso') { 35482 weekNumberCalculation = 'ISO'; // normalize 35483 } 35484 var localeData = Object.create(// make a cheap copy 35485 locale_1.getMomentLocaleData(opts.locale) // will fall back to en 35486 ); 35487 if (opts.monthNames) { 35488 localeData._months = opts.monthNames; 35489 } 35490 if (opts.monthNamesShort) { 35491 localeData._monthsShort = opts.monthNamesShort; 35492 } 35493 if (opts.dayNames) { 35494 localeData._weekdays = opts.dayNames; 35495 } 35496 if (opts.dayNamesShort) { 35497 localeData._weekdaysShort = opts.dayNamesShort; 35498 } 35499 if (firstDay == null && weekNumberCalculation === 'ISO') { 35500 firstDay = 1; 35501 } 35502 if (firstDay != null) { 35503 _week = Object.create(localeData._week); // _week: { dow: # } 35504 _week.dow = firstDay; 35505 localeData._week = _week; 35506 } 35507 if (weekNumberCalculation === 'ISO' || 35508 weekNumberCalculation === 'local' || 35509 typeof weekNumberCalculation === 'function') { 35510 localeData._fullCalendar_weekCalc = weekNumberCalculation; // moment-ext will know what to do with it 35511 } 35512 _this.localeData = localeData; 35513 // If the internal current date object already exists, move to new locale. 35514 // We do NOT need to do this technique for event dates, because this happens when converting to "segments". 35515 if (_this.currentDate) { 35516 _this.localizeMoment(_this.currentDate); // sets to localeData 35517 } 35518 }); 35519 }; 35520 // Builds a moment using the settings of the current calendar: timezone and locale. 35521 // Accepts anything the vanilla moment() constructor accepts. 35522 Calendar.prototype.moment = function () { 35523 var args = []; 35524 for (var _i = 0; _i < arguments.length; _i++) { 35525 args[_i] = arguments[_i]; 35526 } 35527 var mom; 35528 if (this.opt('timezone') === 'local') { 35529 mom = moment_ext_1.default.apply(null, args); 35530 // Force the moment to be local, because momentExt doesn't guarantee it. 35531 if (mom.hasTime()) { 35532 mom.local(); 35533 } 35534 } 35535 else if (this.opt('timezone') === 'UTC') { 35536 mom = moment_ext_1.default.utc.apply(null, args); // process as UTC 35537 } 35538 else { 35539 mom = moment_ext_1.default.parseZone.apply(null, args); // let the input decide the zone 35540 } 35541 this.localizeMoment(mom); // TODO 35542 return mom; 35543 }; 35544 Calendar.prototype.msToMoment = function (ms, forceAllDay) { 35545 var mom = moment_ext_1.default.utc(ms); // TODO: optimize by using Date.UTC 35546 if (forceAllDay) { 35547 mom.stripTime(); 35548 } 35549 else { 35550 mom = this.applyTimezone(mom); // may or may not apply locale 35551 } 35552 this.localizeMoment(mom); 35553 return mom; 35554 }; 35555 Calendar.prototype.msToUtcMoment = function (ms, forceAllDay) { 35556 var mom = moment_ext_1.default.utc(ms); // TODO: optimize by using Date.UTC 35557 if (forceAllDay) { 35558 mom.stripTime(); 35559 } 35560 this.localizeMoment(mom); 35561 return mom; 35562 }; 35563 // Updates the given moment's locale settings to the current calendar locale settings. 35564 Calendar.prototype.localizeMoment = function (mom) { 35565 mom._locale = this.localeData; 35566 }; 35567 // Returns a boolean about whether or not the calendar knows how to calculate 35568 // the timezone offset of arbitrary dates in the current timezone. 35569 Calendar.prototype.getIsAmbigTimezone = function () { 35570 return this.opt('timezone') !== 'local' && this.opt('timezone') !== 'UTC'; 35571 }; 35572 // Returns a copy of the given date in the current timezone. Has no effect on dates without times. 35573 Calendar.prototype.applyTimezone = function (date) { 35574 if (!date.hasTime()) { 35575 return date.clone(); 35576 } 35577 var zonedDate = this.moment(date.toArray()); 35578 var timeAdjust = date.time().asMilliseconds() - zonedDate.time().asMilliseconds(); 35579 var adjustedZonedDate; 35580 // Safari sometimes has problems with this coersion when near DST. Adjust if necessary. (bug #2396) 35581 if (timeAdjust) { 35582 adjustedZonedDate = zonedDate.clone().add(timeAdjust); // add milliseconds 35583 if (date.time().asMilliseconds() - adjustedZonedDate.time().asMilliseconds() === 0) { 35584 zonedDate = adjustedZonedDate; 35585 } 35586 } 35587 return zonedDate; 35588 }; 35589 /* 35590 Assumes the footprint is non-open-ended. 35591 */ 35592 Calendar.prototype.footprintToDateProfile = function (componentFootprint, ignoreEnd) { 35593 if (ignoreEnd === void 0) { ignoreEnd = false; } 35594 var start = moment_ext_1.default.utc(componentFootprint.unzonedRange.startMs); 35595 var end; 35596 if (!ignoreEnd) { 35597 end = moment_ext_1.default.utc(componentFootprint.unzonedRange.endMs); 35598 } 35599 if (componentFootprint.isAllDay) { 35600 start.stripTime(); 35601 if (end) { 35602 end.stripTime(); 35603 } 35604 } 35605 else { 35606 start = this.applyTimezone(start); 35607 if (end) { 35608 end = this.applyTimezone(end); 35609 } 35610 } 35611 return new EventDateProfile_1.default(start, end, this); 35612 }; 35613 // Returns a moment for the current date, as defined by the client's computer or from the `now` option. 35614 // Will return an moment with an ambiguous timezone. 35615 Calendar.prototype.getNow = function () { 35616 var now = this.opt('now'); 35617 if (typeof now === 'function') { 35618 now = now(); 35619 } 35620 return this.moment(now).stripZone(); 35621 }; 35622 // Produces a human-readable string for the given duration. 35623 // Side-effect: changes the locale of the given duration. 35624 Calendar.prototype.humanizeDuration = function (duration) { 35625 return duration.locale(this.opt('locale')).humanize(); 35626 }; 35627 // will return `null` if invalid range 35628 Calendar.prototype.parseUnzonedRange = function (rangeInput) { 35629 var start = null; 35630 var end = null; 35631 if (rangeInput.start) { 35632 start = this.moment(rangeInput.start).stripZone(); 35633 } 35634 if (rangeInput.end) {
35635 end = this.moment(rangeInput.end).stripZone(); 35636 } 35637 if (!start && !end) { 35638 return null; 35639 } 35640 if (start && end && end.isBefore(start)) { 35641 return null; 35642 } 35643 return new UnzonedRange_1.default(start, end); 35644 }; 35645 // Event-Date Utilities 35646 // ----------------------------------------------------------------------------------------------------------------- 35647 Calendar.prototype.initEventManager = function () { 35648 var _this = this; 35649 var eventManager = new EventManager_1.default(this); 35650 var rawSources = this.opt('eventSources') || []; 35651 var singleRawSource = this.opt('events'); 35652 this.eventManager = eventManager; 35653 if (singleRawSource) { 35654 rawSources.unshift(singleRawSource); 35655 } 35656 eventManager.on('release', function (eventsPayload) { 35657 _this.trigger('eventsReset', eventsPayload); 35658 }); 35659 eventManager.freeze(); 35660 rawSources.forEach(function (rawSource) { 35661 var source = EventSourceParser_1.default.parse(rawSource, _this); 35662 if (source) { 35663 eventManager.addSource(source); 35664 } 35665 }); 35666 eventManager.thaw(); 35667 }; 35668 Calendar.prototype.requestEvents = function (start, end) { 35669 return this.eventManager.requestEvents(start, end, this.opt('timezone'), !this.opt('lazyFetching')); 35670 }; 35671 // Get an event's normalized end date. If not present, calculate it from the defaults. 35672 Calendar.prototype.getEventEnd = function (event) { 35673 if (event.end) { 35674 return event.end.clone(); 35675 } 35676 else { 35677 return this.getDefaultEventEnd(event.allDay, event.start); 35678 } 35679 }; 35680 // Given an event's allDay status and start date, return what its fallback end date should be. 35681 // TODO: rename to computeDefaultEventEnd 35682 Calendar.prototype.getDefaultEventEnd = function (allDay, zonedStart) { 35683 var end = zonedStart.clone(); 35684 if (allDay) { 35685 end.stripTime().add(this.defaultAllDayEventDuration); 35686 } 35687 else { 35688 end.add(this.defaultTimedEventDuration); 35689 } 35690 if (this.getIsAmbigTimezone()) { 35691 end.stripZone(); // we don't know what the tzo should be 35692 } 35693 return end; 35694 }; 35695 // Public Events API 35696 // ----------------------------------------------------------------------------------------------------------------- 35697 Calendar.prototype.rerenderEvents = function () { 35698 this.view.flash('displayingEvents'); 35699 }; 35700 Calendar.prototype.refetchEvents = function () { 35701 this.eventManager.refetchAllSources(); 35702 }; 35703 Calendar.prototype.renderEvents = function (eventInputs, isSticky) { 35704 this.eventManager.freeze(); 35705 for (var i = 0; i < eventInputs.length; i++) { 35706 this.renderEvent(eventInputs[i], isSticky); 35707 } 35708 this.eventManager.thaw(); 35709 }; 35710 Calendar.prototype.renderEvent = function (eventInput, isSticky) { 35711 if (isSticky === void 0) { isSticky = false; } 35712 var eventManager = this.eventManager; 35713 var eventDef = EventDefParser_1.default.parse(eventInput, eventInput.source || eventManager.stickySource); 35714 if (eventDef) { 35715 eventManager.addEventDef(eventDef, isSticky); 35716 } 35717 }; 35718 // legacyQuery operates on legacy event instance objects 35719 Calendar.prototype.removeEvents = function (legacyQuery) { 35720 var eventManager = this.eventManager; 35721 var legacyInstances = []; 35722 var idMap = {}; 35723 var eventDef; 35724 var i; 35725 if (legacyQuery == null) { 35726 eventManager.removeAllEventDefs(); // persist=true 35727 } 35728 else { 35729 eventManager.getEventInstances().forEach(function (eventInstance) { 35730 legacyInstances.push(eventInstance.toLegacy()); 35731 }); 35732 legacyInstances = filterLegacyEventInstances(legacyInstances, legacyQuery); 35733 // compute unique IDs 35734 for (i = 0; i < legacyInstances.length; i++) { 35735 eventDef = this.eventManager.getEventDefByUid(legacyInstances[i]._id); 35736 idMap[eventDef.id] = true; 35737 } 35738 eventManager.freeze(); 35739 for (i in idMap) { 35740 eventManager.removeEventDefsById(i); // persist=true 35741 } 35742 eventManager.thaw(); 35743 } 35744 }; 35745 // legacyQuery operates on legacy event instance objects 35746 Calendar.prototype.clientEvents = function (legacyQuery) { 35747 var legacyEventInstances = [];
35748 this.eventManager.getEventInstances().forEach(function (eventInstance) { 35749 legacyEventInstances.push(eventInstance.toLegacy()); 35750 }); 35751 return filterLegacyEventInstances(legacyEventInstances, legacyQuery); 35752 }; 35753 Calendar.prototype.updateEvents = function (eventPropsArray) { 35754 this.eventManager.freeze(); 35755 for (var i = 0; i < eventPropsArray.length; i++) { 35756 this.updateEvent(eventPropsArray[i]); 35757 } 35758 this.eventManager.thaw(); 35759 }; 35760 Calendar.prototype.updateEvent = function (eventProps) { 35761 var eventDef = this.eventManager.getEventDefByUid(eventProps._id); 35762 var eventInstance; 35763 var eventDefMutation; 35764 if (eventDef instanceof SingleEventDef_1.default) { 35765 eventInstance = eventDef.buildInstance(); 35766 eventDefMutation = EventDefMutation_1.default.createFromRawProps(eventInstance, eventProps, // raw props 35767 null // largeUnit -- who uses it? 35768 ); 35769 this.eventManager.mutateEventsWithId(eventDef.id, eventDefMutation); // will release 35770 } 35771 }; 35772 // Public Event Sources API 35773 // ------------------------------------------------------------------------------------ 35774 Calendar.prototype.getEventSources = function () { 35775 return this.eventManager.otherSources.slice(); // clone 35776 }; 35777 Calendar.prototype.getEventSourceById = function (id) { 35778 return this.eventManager.getSourceById(EventSource_1.default.normalizeId(id)); 35779 }; 35780 Calendar.prototype.addEventSource = function (sourceInput) { 35781 var source = EventSourceParser_1.default.parse(sourceInput, this); 35782 if (source) { 35783 this.eventManager.addSource(source); 35784 } 35785 }; 35786 Calendar.prototype.removeEventSources = function (sourceMultiQuery) { 35787 var eventManager = this.eventManager; 35788 var sources; 35789 var i; 35790 if (sourceMultiQuery == null) { 35791 this.eventManager.removeAllSources(); 35792 } 35793 else { 35794 sources = eventManager.multiQuerySources(sourceMultiQuery); 35795 eventManager.freeze(); 35796 for (i = 0; i < sources.length; i++) { 35797 eventManager.removeSource(sources[i]); 35798 } 35799 eventManager.thaw(); 35800 } 35801 }; 35802 Calendar.prototype.removeEventSource = function (sourceQuery) { 35803 var eventManager = this.eventManager; 35804 var sources = eventManager.querySources(sourceQuery); 35805 var i; 35806 eventManager.freeze(); 35807 for (i = 0; i < sources.length; i++) { 35808 eventManager.removeSource(sources[i]); 35809 } 35810 eventManager.thaw(); 35811 }; 35812 Calendar.prototype.refetchEventSources = function (sourceMultiQuery) { 35813 var eventManager = this.eventManager; 35814 var sources = eventManager.multiQuerySources(sourceMultiQuery); 35815 var i; 35816 eventManager.freeze(); 35817 for (i = 0; i < sources.length; i++) { 35818 eventManager.refetchSource(sources[i]); 35819 } 35820 eventManager.thaw(); 35821 }; 35822 // not for internal use. use options module directly instead. 35823 Calendar.defaults = options_1.globalDefaults; 35824 Calendar.englishDefaults = options_1.englishDefaults; 35825 Calendar.rtlDefaults = options_1.rtlDefaults; 35826 return Calendar; 35827}()); 35828exports.default = Calendar; 35829EmitterMixin_1.default.mixInto(Calendar); 35830ListenerMixin_1.default.mixInto(Calendar); 35831function filterLegacyEventInstances(legacyEventInstances, legacyQuery) { 35832 if (legacyQuery == null) { 35833 return legacyEventInstances; 35834 } 35835 else if ($.isFunction(legacyQuery)) { 35836 return legacyEventInstances.filter(legacyQuery); 35837 } 35838 else { 35839 legacyQuery += ''; // normalize to string 35840 return legacyEventInstances.filter(function (legacyEventInstance) { 35841 // soft comparison because id not be normalized to string 35842 // tslint:disable-next-line 35843 return legacyEventInstance.id == legacyQuery || 35844 legacyEventInstance._id === legacyQuery; // can specify internal id, but must exactly match 35845 }); 35846 } 35847} 35848 35849 35850/***/ }), 35851/* 221 */ 35852/***/ (function(module, exports, __webpack_require__) { 35853 35854Object.defineProperty(exports, "__esModule", { value: true }); 35855var moment = __webpack_require__(0); 35856var util_1 = __webpack_require__(4); 35857var UnzonedRange_1 = __webpack_require__(5); 35858var DateProfileGenerator = /** @class */ (function () { 35859 function DateProfileGenerator(_view) { 35860 this._view = _view; 35861 } 35862 DateProfileGenerator.prototype.opt = function (name) { 35863 return this._view.opt(name); 35864 }; 35865 DateProfileGenerator.prototype.trimHiddenDays = function (unzonedRange) { 35866 return this._view.trimHiddenDays(unzonedRange); 35867 }; 35868 DateProfileGenerator.prototype.msToUtcMoment = function (ms, forceAllDay) { 35869 return this._view.calendar.msToUtcMoment(ms, forceAllDay); 35870 }; 35871 /* Date Range Computation 35872 ------------------------------------------------------------------------------------------------------------------*/ 35873 // Builds a structure with info about what the dates/ranges will be for the "prev" view. 35874 DateProfileGenerator.prototype.buildPrev = function (currentDateProfile) { 35875 var prevDate = currentDateProfile.date.clone() 35876 .startOf(currentDateProfile.currentRangeUnit) 35877 .subtract(currentDateProfile.dateIncrement); 35878 return this.build(prevDate, -1); 35879 }; 35880 // Builds a structure with info about what the dates/ranges will be for the "next" view. 35881 DateProfileGenerator.prototype.buildNext = function (currentDateProfile) { 35882 var nextDate = currentDateProfile.date.clone() 35883 .startOf(currentDateProfile.currentRangeUnit) 35884 .add(currentDateProfile.dateIncrement); 35885 return this.build(nextDate, 1); 35886 }; 35887 // Builds a structure holding dates/ranges for rendering around the given date. 35888 // Optional direction param indicates whether the date is being incremented/decremented 35889 // from its previous value. decremented = -1, incremented = 1 (default). 35890 DateProfileGenerator.prototype.build = function (date, direction, forceToValid) { 35891 if (forceToValid === void 0) { forceToValid = false; }
35892 var isDateAllDay = !date.hasTime(); 35893 var validUnzonedRange; 35894 var minTime = null; 35895 var maxTime = null; 35896 var currentInfo; 35897 var isRangeAllDay; 35898 var renderUnzonedRange; 35899 var activeUnzonedRange; 35900 var isValid; 35901 validUnzonedRange = this.buildValidRange(); 35902 validUnzonedRange = this.trimHiddenDays(validUnzonedRange); 35903 if (forceToValid) { 35904 date = this.msToUtcMoment(validUnzonedRange.constrainDate(date), // returns MS 35905 isDateAllDay); 35906 } 35907 currentInfo = this.buildCurrentRangeInfo(date, direction); 35908 isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit); 35909 renderUnzonedRange = this.buildRenderRange(this.trimHiddenDays(currentInfo.unzonedRange), currentInfo.unit, isRangeAllDay); 35910 renderUnzonedRange = this.trimHiddenDays(renderUnzonedRange); 35911 activeUnzonedRange = renderUnzonedRange.clone(); 35912 if (!this.opt('showNonCurrentDates')) { 35913 activeUnzonedRange = activeUnzonedRange.intersect(currentInfo.unzonedRange); 35914 } 35915 minTime = moment.duration(this.opt('minTime')); 35916 maxTime = moment.duration(this.opt('maxTime')); 35917 activeUnzonedRange = this.adjustActiveRange(activeUnzonedRange, minTime, maxTime); 35918 activeUnzonedRange = activeUnzonedRange.intersect(validUnzonedRange); // might return null 35919 if (activeUnzonedRange) { 35920 date = this.msToUtcMoment(activeUnzonedRange.constrainDate(date), // returns MS 35921 isDateAllDay); 35922 } 35923 // it's invalid if the originally requested date is not contained, 35924 // or if the range is completely outside of the valid range. 35925 isValid = currentInfo.unzonedRange.intersectsWith(validUnzonedRange); 35926 return { 35927 // constraint for where prev/next operations can go and where events can be dragged/resized to. 35928 // an object with optional start and end properties. 35929 validUnzonedRange: validUnzonedRange, 35930 // range the view is formally responsible for. 35931 // for example, a month view might have 1st-31st, excluding padded dates 35932 currentUnzonedRange: currentInfo.unzonedRange, 35933 // name of largest unit being displayed, like "month" or "week" 35934 currentRangeUnit: currentInfo.unit, 35935 isRangeAllDay: isRangeAllDay, 35936 // dates that display events and accept drag-n-drop 35937 // will be `null` if no dates accept events 35938 activeUnzonedRange: activeUnzonedRange, 35939 // date range with a rendered skeleton 35940 // includes not-active days that need some sort of DOM 35941 renderUnzonedRange: renderUnzonedRange, 35942 // Duration object that denotes the first visible time of any given day 35943 minTime: minTime, 35944 // Duration object that denotes the exclusive visible end time of any given day 35945 maxTime: maxTime, 35946 isValid: isValid, 35947 date: date, 35948 // how far the current date will move for a prev/next operation 35949 dateIncrement: this.buildDateIncrement(currentInfo.duration) 35950 // pass a fallback (might be null) ^ 35951 }; 35952 }; 35953 // Builds an object with optional start/end properties. 35954 // Indicates the minimum/maximum dates to display. 35955 // not responsible for trimming hidden days. 35956 DateProfileGenerator.prototype.buildValidRange = function () { 35957 return this._view.getUnzonedRangeOption('validRange', this._view.calendar.getNow()) || 35958 new UnzonedRange_1.default(); // completely open-ended 35959 }; 35960 // Builds a structure with info about the "current" range, the range that is 35961 // highlighted as being the current month for example. 35962 // See build() for a description of `direction`. 35963 // Guaranteed to have `range` and `unit` properties. `duration` is optional. 35964 // TODO: accept a MS-time instead of a moment `date`? 35965 DateProfileGenerator.prototype.buildCurrentRangeInfo = function (date, direction) { 35966 var viewSpec = this._view.viewSpec; 35967 var duration = null; 35968 var unit = null; 35969 var unzonedRange = null; 35970 var dayCount; 35971 if (viewSpec.duration) { 35972 duration = viewSpec.duration; 35973 unit = viewSpec.durationUnit; 35974 unzonedRange = this.buildRangeFromDuration(date, direction, duration, unit); 35975 } 35976 else if ((dayCount = this.opt('dayCount'))) { 35977 unit = 'day'; 35978 unzonedRange = this.buildRangeFromDayCount(date, direction, dayCount); 35979 } 35980 else if ((unzonedRange = this.buildCustomVisibleRange(date))) { 35981 unit = util_1.computeGreatestUnit(unzonedRange.getStart(), unzonedRange.getEnd()); 35982 } 35983 else { 35984 duration = this.getFallbackDuration(); 35985 unit = util_1.computeGreatestUnit(duration); 35986 unzonedRange = this.buildRangeFromDuration(date, direction, duration, unit); 35987 } 35988 return { duration: duration, unit: unit, unzonedRange: unzonedRange }; 35989 }; 35990 DateProfileGenerator.prototype.getFallbackDuration = function () { 35991 return moment.duration({ days: 1 }); 35992 }; 35993 // Returns a new activeUnzonedRange to have time values (un-ambiguate) 35994 // minTime or maxTime causes the range to expand. 35995 DateProfileGenerator.prototype.adjustActiveRange = function (unzonedRange, minTime, maxTime) { 35996 var start = unzonedRange.getStart(); 35997 var end = unzonedRange.getEnd(); 35998 if (this._view.usesMinMaxTime) { 35999 if (minTime < 0) {
36000 start.time(0).add(minTime); 36001 } 36002 if (maxTime > 24 * 60 * 60 * 1000) { 36003 end.time(maxTime - (24 * 60 * 60 * 1000)); 36004 } 36005 } 36006 return new UnzonedRange_1.default(start, end); 36007 }; 36008 // Builds the "current" range when it is specified as an explicit duration. 36009 // `unit` is the already-computed computeGreatestUnit value of duration. 36010 // TODO: accept a MS-time instead of a moment `date`? 36011 DateProfileGenerator.prototype.buildRangeFromDuration = function (date, direction, duration, unit) { 36012 var alignment = this.opt('dateAlignment'); 36013 var dateIncrementInput; 36014 var dateIncrementDuration; 36015 var start; 36016 var end; 36017 var res; 36018 // compute what the alignment should be 36019 if (!alignment) { 36020 dateIncrementInput = this.opt('dateIncrement'); 36021 if (dateIncrementInput) { 36022 dateIncrementDuration = moment.duration(dateIncrementInput); 36023 // use the smaller of the two units 36024 if (dateIncrementDuration < duration) { 36025 alignment = util_1.computeDurationGreatestUnit(dateIncrementDuration, dateIncrementInput); 36026 } 36027 else { 36028 alignment = unit; 36029 } 36030 } 36031 else { 36032 alignment = unit; 36033 } 36034 } 36035 // if the view displays a single day or smaller 36036 if (duration.as('days') <= 1) { 36037 if (this._view.isHiddenDay(start)) { 36038 start = this._view.skipHiddenDays(start, direction); 36039 start.startOf('day'); 36040 } 36041 } 36042 function computeRes() { 36043 start = date.clone().startOf(alignment); 36044 end = start.clone().add(duration); 36045 res = new UnzonedRange_1.default(start, end); 36046 } 36047 computeRes(); 36048 // if range is completely enveloped by hidden days, go past the hidden days 36049 if (!this.trimHiddenDays(res)) { 36050 date = this._view.skipHiddenDays(date, direction); 36051 computeRes(); 36052 } 36053 return res; 36054 }; 36055 // Builds the "current" range when a dayCount is specified. 36056 // TODO: accept a MS-time instead of a moment `date`? 36057 DateProfileGenerator.prototype.buildRangeFromDayCount = function (date, direction, dayCount) { 36058 var customAlignment = this.opt('dateAlignment'); 36059 var runningCount = 0; 36060 var start = date.clone(); 36061 var end; 36062 if (customAlignment) { 36063 start.startOf(customAlignment); 36064 } 36065 start.startOf('day'); 36066 start = this._view.skipHiddenDays(start, direction); 36067 end = start.clone(); 36068 do { 36069 end.add(1, 'day'); 36070 if (!this._view.isHiddenDay(end)) { 36071 runningCount++; 36072 } 36073 } while (runningCount < dayCount); 36074 return new UnzonedRange_1.default(start, end); 36075 }; 36076 // Builds a normalized range object for the "visible" range, 36077 // which is a way to define the currentUnzonedRange and activeUnzonedRange at the same time. 36078 // TODO: accept a MS-time instead of a moment `date`? 36079 DateProfileGenerator.prototype.buildCustomVisibleRange = function (date) { 36080 var visibleUnzonedRange = this._view.getUnzonedRangeOption('visibleRange', this._view.calendar.applyTimezone(date) // correct zone. also generates new obj that avoids mutations 36081 ); 36082 if (visibleUnzonedRange && (visibleUnzonedRange.startMs == null || visibleUnzonedRange.endMs == null)) { 36083 return null; 36084 } 36085 return visibleUnzonedRange; 36086 }; 36087 // Computes the range that will represent the element/cells for *rendering*, 36088 // but which may have voided days/times. 36089 // not responsible for trimming hidden days. 36090 DateProfileGenerator.prototype.buildRenderRange = function (currentUnzonedRange, currentRangeUnit, isRangeAllDay) { 36091 return currentUnzonedRange.clone(); 36092 }; 36093 // Compute the duration value that should be added/substracted to the current date 36094 // when a prev/next operation happens. 36095 DateProfileGenerator.prototype.buildDateIncrement = function (fallback) { 36096 var dateIncrementInput = this.opt('dateIncrement'); 36097 var customAlignment; 36098 if (dateIncrementInput) { 36099 return moment.duration(dateIncrementInput); 36100 } 36101 else if ((customAlignment = this.opt('dateAlignment'))) { 36102 return moment.duration(1, customAlignment); 36103 } 36104 else if (fallback) { 36105 return fallback; 36106 } 36107 else { 36108 return moment.duration({ days: 1 }); 36109 } 36110 }; 36111 return DateProfileGenerator; 36112}()); 36113exports.default = DateProfileGenerator; 36114 36115 36116/***/ }), 36117/* 222 */ 36118/***/ (function(module, exports, __webpack_require__) { 36119 36120Object.defineProperty(exports, "__esModule", { value: true }); 36121var tslib_1 = __webpack_require__(2); 36122var $ = __webpack_require__(3); 36123var moment = __webpack_require__(0);
36124var exportHooks = __webpack_require__(16); 36125var util_1 = __webpack_require__(4); 36126var moment_ext_1 = __webpack_require__(10); 36127var ListenerMixin_1 = __webpack_require__(7); 36128var HitDragListener_1 = __webpack_require__(23); 36129var SingleEventDef_1 = __webpack_require__(13); 36130var EventInstanceGroup_1 = __webpack_require__(18); 36131var EventSource_1 = __webpack_require__(6); 36132var Interaction_1 = __webpack_require__(15); 36133var ExternalDropping = /** @class */ (function (_super) { 36134 tslib_1.__extends(ExternalDropping, _super); 36135 function ExternalDropping() { 36136 var _this = _super !== null && _super.apply(this, arguments) || this; 36137 _this.isDragging = false; // jqui-dragging an external element? boolean 36138 return _this; 36139 } 36140 /* 36141 component impements: 36142 - eventRangesToEventFootprints 36143 - isEventInstanceGroupAllowed 36144 - isExternalInstanceGroupAllowed 36145 - renderDrag 36146 - unrenderDrag 36147 */ 36148 ExternalDropping.prototype.end = function () { 36149 if (this.dragListener) { 36150 this.dragListener.endInteraction(); 36151 } 36152 }; 36153 ExternalDropping.prototype.bindToDocument = function () { 36154 this.listenTo($(document), { 36155 dragstart: this.handleDragStart, 36156 sortstart: this.handleDragStart // jqui 36157 }); 36158 }; 36159 ExternalDropping.prototype.unbindFromDocument = function () { 36160 this.stopListeningTo($(document)); 36161 }; 36162 // Called when a jQuery UI drag is initiated anywhere in the DOM 36163 ExternalDropping.prototype.handleDragStart = function (ev, ui) { 36164 var el; 36165 var accept; 36166 if (this.opt('droppable')) { 36167 el = $((ui ? ui.item : null) || ev.target); 36168 // Test that the dragged element passes the dropAccept selector or filter function. 36169 // FYI, the default is "*" (matches all) 36170 accept = this.opt('dropAccept'); 36171 if ($.isFunction(accept) ? accept.call(el[0], el) : el.is(accept)) { 36172 if (!this.isDragging) { 36173 this.listenToExternalDrag(el, ev, ui); 36174 } 36175 } 36176 } 36177 }; 36178 // Called when a jQuery UI drag starts and it needs to be monitored for dropping 36179 ExternalDropping.prototype.listenToExternalDrag = function (el, ev, ui) { 36180 var _this = this; 36181 var component = this.component; 36182 var view = this.view; 36183 var meta = getDraggedElMeta(el); // extra data about event drop, including possible event to create 36184 var singleEventDef; // a null value signals an unsuccessful drag 36185 // listener that tracks mouse movement over date-associated pixel regions 36186 var dragListener = this.dragListener = new HitDragListener_1.default(component, { 36187 interactionStart: function () { 36188 _this.isDragging = true; 36189 }, 36190 hitOver: function (hit) { 36191 var isAllowed = true; 36192 var hitFootprint = hit.component.getSafeHitFootprint(hit); // hit might not belong to this grid 36193 var mutatedEventInstanceGroup; 36194 if (hitFootprint) { 36195 singleEventDef = _this.computeExternalDrop(hitFootprint, meta); 36196 if (singleEventDef) { 36197 mutatedEventInstanceGroup = new EventInstanceGroup_1.default(singleEventDef.buildInstances()); 36198 isAllowed = meta.eventProps ? // isEvent? 36199 component.isEventInstanceGroupAllowed(mutatedEventInstanceGroup) : 36200 component.isExternalInstanceGroupAllowed(mutatedEventInstanceGroup); 36201 } 36202 else { 36203 isAllowed = false; 36204 } 36205 } 36206 else { 36207 isAllowed = false; 36208 } 36209 if (!isAllowed) { 36210 singleEventDef = null; 36211 util_1.disableCursor(); 36212 } 36213 if (singleEventDef) { 36214 component.renderDrag(// called without a seg parameter 36215 component.eventRangesToEventFootprints(mutatedEventInstanceGroup.sliceRenderRanges(component.dateProfile.renderUnzonedRange, view.calendar))); 36216 } 36217 }, 36218 hitOut: function () { 36219 singleEventDef = null; // signal unsuccessful 36220 }, 36221 hitDone: function () {
36222 util_1.enableCursor(); 36223 component.unrenderDrag(); 36224 }, 36225 interactionEnd: function (ev) { 36226 if (singleEventDef) { 36227 view.reportExternalDrop(singleEventDef, Boolean(meta.eventProps), // isEvent 36228 Boolean(meta.stick), // isSticky 36229 el, ev, ui); 36230 } 36231 _this.isDragging = false; 36232 _this.dragListener = null; 36233 } 36234 }); 36235 dragListener.startDrag(ev); // start listening immediately 36236 }; 36237 // Given a hit to be dropped upon, and misc data associated with the jqui drag (guaranteed to be a plain object), 36238 // returns the zoned start/end dates for the event that would result from the hypothetical drop. end might be null. 36239 // Returning a null value signals an invalid drop hit. 36240 // DOES NOT consider overlap/constraint. 36241 // Assumes both footprints are non-open-ended. 36242 ExternalDropping.prototype.computeExternalDrop = function (componentFootprint, meta) { 36243 var calendar = this.view.calendar; 36244 var start = moment_ext_1.default.utc(componentFootprint.unzonedRange.startMs).stripZone(); 36245 var end; 36246 var eventDef; 36247 if (componentFootprint.isAllDay) { 36248 // if dropped on an all-day span, and element's metadata specified a time, set it 36249 if (meta.startTime) { 36250 start.time(meta.startTime); 36251 } 36252 else { 36253 start.stripTime(); 36254 } 36255 } 36256 if (meta.duration) { 36257 end = start.clone().add(meta.duration); 36258 } 36259 start = calendar.applyTimezone(start); 36260 if (end) { 36261 end = calendar.applyTimezone(end); 36262 } 36263 eventDef = SingleEventDef_1.default.parse($.extend({}, meta.eventProps, { 36264 start: start, 36265 end: end 36266 }), new EventSource_1.default(calendar)); 36267 return eventDef; 36268 }; 36269 return ExternalDropping; 36270}(Interaction_1.default)); 36271exports.default = ExternalDropping; 36272ListenerMixin_1.default.mixInto(ExternalDropping); 36273/* External-Dragging-Element Data 36274----------------------------------------------------------------------------------------------------------------------*/ 36275// Require all HTML5 data-* attributes used by FullCalendar to have this prefix. 36276// A value of '' will query attributes like data-event. A value of 'fc' will query attributes like data-fc-event. 36277exportHooks.dataAttrPrefix = ''; 36278// Given a jQuery element that might represent a dragged FullCalendar event, returns an intermediate data structure 36279// to be used for Event Object creation. 36280// A defined `.eventProps`, even when empty, indicates that an event should be created. 36281function getDraggedElMeta(el) { 36282 var prefix = exportHooks.dataAttrPrefix; 36283 var eventProps; // properties for creating the event, not related to date/time 36284 var startTime; // a Duration 36285 var duration; 36286 var stick; 36287 if (prefix) { 36288 prefix += '-'; 36289 } 36290 eventProps = el.data(prefix + 'event') || null; 36291 if (eventProps) { 36292 if (typeof eventProps === 'object') { 36293 eventProps = $.extend({}, eventProps); // make a copy 36294 } 36295 else { 36296 eventProps = {}; 36297 } 36298 // pluck special-cased date/time properties 36299 startTime = eventProps.start; 36300 if (startTime == null) { 36301 startTime = eventProps.time; 36302 } // accept 'time' as well 36303 duration = eventProps.duration; 36304 stick = eventProps.stick; 36305 delete eventProps.start; 36306 delete eventProps.time; 36307 delete eventProps.duration; 36308 delete eventProps.stick; 36309 } 36310 // fallback to standalone attribute values for each of the date/time properties 36311 if (startTime == null) { 36312 startTime = el.data(prefix + 'start'); 36313 } 36314 if (startTime == null) { 36315 startTime = el.data(prefix + 'time'); 36316 } // accept 'time' as well 36317 if (duration == null) { 36318 duration = el.data(prefix + 'duration'); 36319 } 36320 if (stick == null) { 36321 stick = el.data(prefix + 'stick'); 36322 } 36323 // massage into correct data types 36324 startTime = startTime != null ? moment.duration(startTime) : null; 36325 duration = duration != null ? moment.duration(duration) : null; 36326 stick = Boolean(stick); 36327 return { eventProps: eventProps, startTime: startTime, duration: duration, stick: stick }; 36328} 36329 36330 36331/***/ }), 36332/* 223 */ 36333/***/ (function(module, exports, __webpack_require__) { 36334 36335Object.defineProperty(exports, "__esModule", { value: true }); 36336var tslib_1 = __webpack_require__(2); 36337var $ = __webpack_require__(3); 36338var util_1 = __webpack_require__(4); 36339var EventDefMutation_1 = __webpack_require__(37); 36340var EventDefDateMutation_1 = __webpack_require__(50); 36341var HitDragListener_1 = __webpack_require__(23); 36342var Interaction_1 = __webpack_require__(15); 36343var EventResizing = /** @class */ (function (_super) { 36344 tslib_1.__extends(EventResizing, _super); 36345 /* 36346 component impements:
36347 - bindSegHandlerToEl 36348 - publiclyTrigger 36349 - diffDates 36350 - eventRangesToEventFootprints 36351 - isEventInstanceGroupAllowed 36352 - getSafeHitFootprint 36353 */ 36354 function EventResizing(component, eventPointing) { 36355 var _this = _super.call(this, component) || this; 36356 _this.isResizing = false; 36357 _this.eventPointing = eventPointing; 36358 return _this; 36359 } 36360 EventResizing.prototype.end = function () { 36361 if (this.dragListener) { 36362 this.dragListener.endInteraction(); 36363 } 36364 }; 36365 EventResizing.prototype.bindToEl = function (el) { 36366 var component = this.component; 36367 component.bindSegHandlerToEl(el, 'mousedown', this.handleMouseDown.bind(this)); 36368 component.bindSegHandlerToEl(el, 'touchstart', this.handleTouchStart.bind(this)); 36369 }; 36370 EventResizing.prototype.handleMouseDown = function (seg, ev) { 36371 if (this.component.canStartResize(seg, ev)) { 36372 this.buildDragListener(seg, $(ev.target).is('.fc-start-resizer')) 36373 .startInteraction(ev, { distance: 5 }); 36374 } 36375 }; 36376 EventResizing.prototype.handleTouchStart = function (seg, ev) { 36377 if (this.component.canStartResize(seg, ev)) { 36378 this.buildDragListener(seg, $(ev.target).is('.fc-start-resizer')) 36379 .startInteraction(ev); 36380 } 36381 }; 36382 // Creates a listener that tracks the user as they resize an event segment. 36383 // Generic enough to work with any type of Grid. 36384 EventResizing.prototype.buildDragListener = function (seg, isStart) { 36385 var _this = this; 36386 var component = this.component; 36387 var view = this.view; 36388 var calendar = view.calendar; 36389 var eventManager = calendar.eventManager; 36390 var el = seg.el; 36391 var eventDef = seg.footprint.eventDef; 36392 var eventInstance = seg.footprint.eventInstance; 36393 var isDragging; 36394 var resizeMutation; // zoned event date properties. falsy if invalid resize 36395 // Tracks mouse movement over the *grid's* coordinate map 36396 var dragListener = this.dragListener = new HitDragListener_1.default(component, { 36397 scroll: this.opt('dragScroll'), 36398 subjectEl: el, 36399 interactionStart: function () { 36400 isDragging = false; 36401 }, 36402 dragStart: function (ev) { 36403 isDragging = true; 36404 // ensure a mouseout on the manipulated event has been reported 36405 _this.eventPointing.handleMouseout(seg, ev); 36406 _this.segResizeStart(seg, ev); 36407 }, 36408 hitOver: function (hit, isOrig, origHit) { 36409 var isAllowed = true; 36410 var origHitFootprint = component.getSafeHitFootprint(origHit); 36411 var hitFootprint = component.getSafeHitFootprint(hit); 36412 var mutatedEventInstanceGroup; 36413 if (origHitFootprint && hitFootprint) { 36414 resizeMutation = isStart ? 36415 _this.computeEventStartResizeMutation(origHitFootprint, hitFootprint, seg.footprint) : 36416 _this.computeEventEndResizeMutation(origHitFootprint, hitFootprint, seg.footprint); 36417 if (resizeMutation) { 36418 mutatedEventInstanceGroup = eventManager.buildMutatedEventInstanceGroup(eventDef.id, resizeMutation); 36419 isAllowed = component.isEventInstanceGroupAllowed(mutatedEventInstanceGroup); 36420 } 36421 else { 36422 isAllowed = false; 36423 } 36424 } 36425 else { 36426 isAllowed = false; 36427 } 36428 if (!isAllowed) { 36429 resizeMutation = null; 36430 util_1.disableCursor(); 36431 } 36432 else if (resizeMutation.isEmpty()) { 36433 // no change. (FYI, event dates might have zones) 36434 resizeMutation = null; 36435 } 36436 if (resizeMutation) { 36437 view.hideEventsWithId(seg.footprint.eventDef.id); 36438 view.renderEventResize(component.eventRangesToEventFootprints(mutatedEventInstanceGroup.sliceRenderRanges(component.dateProfile.renderUnzonedRange, calendar)), seg); 36439 } 36440 }, 36441 hitOut: function () { 36442 resizeMutation = null; 36443 }, 36444 hitDone: function () { 36445 view.unrenderEventResize(seg); 36446 view.showEventsWithId(seg.footprint.eventDef.id);
36447 util_1.enableCursor(); 36448 }, 36449 interactionEnd: function (ev) { 36450 if (isDragging) { 36451 _this.segResizeStop(seg, ev); 36452 } 36453 if (resizeMutation) { 36454 // no need to re-show original, will rerender all anyways. esp important if eventRenderWait 36455 view.reportEventResize(eventInstance, resizeMutation, el, ev); 36456 } 36457 _this.dragListener = null; 36458 } 36459 }); 36460 return dragListener; 36461 }; 36462 // Called before event segment resizing starts 36463 EventResizing.prototype.segResizeStart = function (seg, ev) { 36464 this.isResizing = true; 36465 this.component.publiclyTrigger('eventResizeStart', { 36466 context: seg.el[0], 36467 args: [ 36468 seg.footprint.getEventLegacy(), 36469 ev, 36470 {}, 36471 this.view 36472 ] 36473 }); 36474 }; 36475 // Called after event segment resizing stops 36476 EventResizing.prototype.segResizeStop = function (seg, ev) { 36477 this.isResizing = false; 36478 this.component.publiclyTrigger('eventResizeStop', { 36479 context: seg.el[0], 36480 args: [ 36481 seg.footprint.getEventLegacy(), 36482 ev, 36483 {}, 36484 this.view 36485 ] 36486 }); 36487 }; 36488 // Returns new date-information for an event segment being resized from its start 36489 EventResizing.prototype.computeEventStartResizeMutation = function (startFootprint, endFootprint, origEventFootprint) { 36490 var origRange = origEventFootprint.componentFootprint.unzonedRange; 36491 var startDelta = this.component.diffDates(endFootprint.unzonedRange.getStart(), startFootprint.unzonedRange.getStart()); 36492 var dateMutation; 36493 var eventDefMutation; 36494 if (origRange.getStart().add(startDelta) < origRange.getEnd()) { 36495 dateMutation = new EventDefDateMutation_1.default(); 36496 dateMutation.setStartDelta(startDelta); 36497 eventDefMutation = new EventDefMutation_1.default(); 36498 eventDefMutation.setDateMutation(dateMutation); 36499 return eventDefMutation; 36500 } 36501 return false; 36502 }; 36503 // Returns new date-information for an event segment being resized from its end 36504 EventResizing.prototype.computeEventEndResizeMutation = function (startFootprint, endFootprint, origEventFootprint) { 36505 var origRange = origEventFootprint.componentFootprint.unzonedRange; 36506 var endDelta = this.component.diffDates(endFootprint.unzonedRange.getEnd(), startFootprint.unzonedRange.getEnd()); 36507 var dateMutation; 36508 var eventDefMutation; 36509 if (origRange.getEnd().add(endDelta) > origRange.getStart()) { 36510 dateMutation = new EventDefDateMutation_1.default(); 36511 dateMutation.setEndDelta(endDelta); 36512 eventDefMutation = new EventDefMutation_1.default(); 36513 eventDefMutation.setDateMutation(dateMutation); 36514 return eventDefMutation; 36515 } 36516 return false; 36517 }; 36518 return EventResizing; 36519}(Interaction_1.default)); 36520exports.default = EventResizing; 36521 36522 36523/***/ }), 36524/* 224 */ 36525/***/ (function(module, exports, __webpack_require__) { 36526 36527Object.defineProperty(exports, "__esModule", { value: true }); 36528var tslib_1 = __webpack_require__(2); 36529var util_1 = __webpack_require__(4); 36530var EventDefMutation_1 = __webpack_require__(37); 36531var EventDefDateMutation_1 = __webpack_require__(50); 36532var DragListener_1 = __webpack_require__(54); 36533var HitDragListener_1 = __webpack_require__(23); 36534var MouseFollower_1 = __webpack_require__(244); 36535var Interaction_1 = __webpack_require__(15); 36536var EventDragging = /** @class */ (function (_super) { 36537 tslib_1.__extends(EventDragging, _super); 36538 /* 36539 component implements: 36540 - bindSegHandlerToEl 36541 - publiclyTrigger 36542 - diffDates 36543 - eventRangesToEventFootprints 36544 - isEventInstanceGroupAllowed 36545 */ 36546 function EventDragging(component, eventPointing) { 36547 var _this = _super.call(this, component) || this; 36548 _this.isDragging = false;
36549 _this.eventPointing = eventPointing; 36550 return _this; 36551 } 36552 EventDragging.prototype.end = function () { 36553 if (this.dragListener) { 36554 this.dragListener.endInteraction(); 36555 } 36556 }; 36557 EventDragging.prototype.getSelectionDelay = function () { 36558 var delay = this.opt('eventLongPressDelay'); 36559 if (delay == null) { 36560 delay = this.opt('longPressDelay'); // fallback 36561 } 36562 return delay; 36563 }; 36564 EventDragging.prototype.bindToEl = function (el) { 36565 var component = this.component; 36566 component.bindSegHandlerToEl(el, 'mousedown', this.handleMousedown.bind(this)); 36567 component.bindSegHandlerToEl(el, 'touchstart', this.handleTouchStart.bind(this)); 36568 }; 36569 EventDragging.prototype.handleMousedown = function (seg, ev) { 36570 if (!this.component.shouldIgnoreMouse() && 36571 this.component.canStartDrag(seg, ev)) { 36572 this.buildDragListener(seg).startInteraction(ev, { distance: 5 }); 36573 } 36574 }; 36575 EventDragging.prototype.handleTouchStart = function (seg, ev) { 36576 var component = this.component; 36577 var settings = { 36578 delay: this.view.isEventDefSelected(seg.footprint.eventDef) ? // already selected? 36579 0 : this.getSelectionDelay() 36580 }; 36581 if (component.canStartDrag(seg, ev)) { 36582 this.buildDragListener(seg).startInteraction(ev, settings); 36583 } 36584 else if (component.canStartSelection(seg, ev)) { 36585 this.buildSelectListener(seg).startInteraction(ev, settings); 36586 } 36587 }; 36588 // seg isn't draggable, but let's use a generic DragListener 36589 // simply for the delay, so it can be selected. 36590 // Has side effect of setting/unsetting `dragListener` 36591 EventDragging.prototype.buildSelectListener = function (seg) { 36592 var _this = this; 36593 var view = this.view; 36594 var eventDef = seg.footprint.eventDef; 36595 var eventInstance = seg.footprint.eventInstance; // null for inverse-background events 36596 if (this.dragListener) { 36597 return this.dragListener; 36598 } 36599 var dragListener = this.dragListener = new DragListener_1.default({ 36600 dragStart: function (ev) { 36601 if (dragListener.isTouch && 36602 !view.isEventDefSelected(eventDef) && 36603 eventInstance) { 36604 // if not previously selected, will fire after a delay. then, select the event 36605 view.selectEventInstance(eventInstance); 36606 } 36607 }, 36608 interactionEnd: function (ev) { 36609 _this.dragListener = null; 36610 } 36611 }); 36612 return dragListener; 36613 }; 36614 // Builds a listener that will track user-dragging on an event segment. 36615 // Generic enough to work with any type of Grid. 36616 // Has side effect of setting/unsetting `dragListener` 36617 EventDragging.prototype.buildDragListener = function (seg) { 36618 var _this = this; 36619 var component = this.component; 36620 var view = this.view; 36621 var calendar = view.calendar; 36622 var eventManager = calendar.eventManager; 36623 var el = seg.el; 36624 var eventDef = seg.footprint.eventDef; 36625 var eventInstance = seg.footprint.eventInstance; // null for inverse-background events 36626 var isDragging; 36627 var mouseFollower; // A clone of the original element that will move with the mouse 36628 var eventDefMutation; 36629 if (this.dragListener) { 36630 return this.dragListener; 36631 } 36632 // Tracks mouse movement over the *view's* coordinate map. Allows dragging and dropping between subcomponents 36633 // of the view. 36634 var dragListener = this.dragListener = new HitDragListener_1.default(view, { 36635 scroll: this.opt('dragScroll'), 36636 subjectEl: el, 36637 subjectCenter: true, 36638 interactionStart: function (ev) { 36639 seg.component = component; // for renderDrag 36640 isDragging = false; 36641 mouseFollower = new MouseFollower_1.default(seg.el, { 36642 additionalClass: 'fc-dragging', 36643 parentEl: view.el, 36644 opacity: dragListener.isTouch ? null : _this.opt('dragOpacity'), 36645 revertDuration: _this.opt('dragRevertDuration'), 36646 zIndex: 2 // one above the .fc-view 36647 }); 36648 mouseFollower.hide(); // don't show until we know this is a real drag 36649 mouseFollower.start(ev); 36650 }, 36651 dragStart: function (ev) { 36652 if (dragListener.isTouch && 36653 !view.isEventDefSelected(eventDef) && 36654 eventInstance) { 36655 // if not previously selected, will fire after a delay. then, select the event 36656 view.selectEventInstance(eventInstance); 36657 } 36658 isDragging = true; 36659 // ensure a mouseout on the manipulated event has been reported 36660 _this.eventPointing.handleMouseout(seg, ev); 36661 _this.segDragStart(seg, ev); 36662 view.hideEventsWithId(seg.footprint.eventDef.id); 36663 }, 36664 hitOver: function (hit, isOrig, origHit) { 36665 var isAllowed = true; 36666 var origFootprint; 36667 var footprint; 36668 var mutatedEventInstanceGroup; 36669 // starting hit could be forced (DayGrid.limit) 36670 if (seg.hit) { 36671 origHit = seg.hit; 36672 } 36673 // hit might not belong to this grid, so query origin grid 36674 origFootprint = origHit.component.getSafeHitFootprint(
36674origHit); 36675 footprint = hit.component.getSafeHitFootprint(hit); 36676 if (origFootprint && footprint) { 36677 eventDefMutation = _this.computeEventDropMutation(origFootprint, footprint, eventDef); 36678 if (eventDefMutation) { 36679 mutatedEventInstanceGroup = eventManager.buildMutatedEventInstanceGroup(eventDef.id, eventDefMutation); 36680 isAllowed = component.isEventInstanceGroupAllowed(mutatedEventInstanceGroup); 36681 } 36682 else { 36683 isAllowed = false; 36684 } 36685 } 36686 else { 36687 isAllowed = false; 36688 } 36689 if (!isAllowed) { 36690 eventDefMutation = null; 36691 util_1.disableCursor(); 36692 } 36693 // if a valid drop location, have the subclass render a visual indication 36694 if (eventDefMutation && 36695 view.renderDrag(// truthy if rendered something 36696 component.eventRangesToEventFootprints(mutatedEventInstanceGroup.sliceRenderRanges(component.dateProfile.renderUnzonedRange, calendar)), seg, dragListener.isTouch)) { 36697 mouseFollower.hide(); // if the subclass is already using a mock event "helper", hide our own 36698 } 36699 else { 36700 mouseFollower.show(); // otherwise, have the helper follow the mouse (no snapping) 36701 } 36702 if (isOrig) { 36703 // needs to have moved hits to be a valid drop 36704 eventDefMutation = null; 36705 } 36706 }, 36707 hitOut: function () { 36708 view.unrenderDrag(seg); // unrender whatever was done in renderDrag 36709 mouseFollower.show(); // show in case we are moving out of all hits 36710 eventDefMutation = null; 36711 }, 36712 hitDone: function () { 36713 util_1.enableCursor(); 36714 }, 36715 interactionEnd: function (ev) { 36716 delete seg.component; // prevent side effects 36717 // do revert animation if hasn't changed. calls a callback when finished (whether animation or not) 36718 mouseFollower.stop(!eventDefMutation, function () { 36719 if (isDragging) { 36720 view.unrenderDrag(seg); 36721 _this.segDragStop(seg, ev); 36722 } 36723 view.showEventsWithId(seg.footprint.eventDef.id); 36724 if (eventDefMutation) { 36725 // no need to re-show original, will rerender all anyways. esp important if eventRenderWait 36726 view.reportEventDrop(eventInstance, eventDefMutation, el, ev); 36727 } 36728 }); 36729 _this.dragListener = null; 36730 } 36731 }); 36732 return dragListener; 36733 }; 36734 // Called before event segment dragging starts 36735 EventDragging.prototype.segDragStart = function (seg, ev) { 36736 this.isDragging = true; 36737 this.component.publiclyTrigger('eventDragStart', { 36738 context: seg.el[0], 36739 args: [ 36740 seg.footprint.getEventLegacy(), 36741 ev, 36742 {}, 36743 this.view 36744 ] 36745 }); 36746 }; 36747 // Called after event segment dragging stops 36748 EventDragging.prototype.segDragStop = function (seg, ev) { 36749 this.isDragging = false; 36750 this.component.publiclyTrigger('eventDragStop', { 36751 context: seg.el[0], 36752 args: [ 36753 seg.footprint.getEventLegacy(), 36754 ev, 36755 {}, 36756 this.view 36757 ] 36758 }); 36759 }; 36760 // DOES NOT consider overlap/constraint 36761 EventDragging.prototype.computeEventDropMutation = function (startFootprint, endFootprint, eventDef) { 36762 var eventDefMutation = new EventDefMutation_1.default(); 36763 eventDefMutation.setDateMutation(this.computeEventDateMutation(startFootprint, endFootprint)); 36764 return eventDefMutation; 36765 }; 36766 EventDragging.prototype.computeEventDateMutation = function (startFootprint, endFootprint) { 36767 var date0 = startFootprint.unzonedRange.getStart(); 36768 var date1 = endFootprint.unzonedRange.getStart(); 36769 var clearEnd = false;
36770 var forceTimed = false; 36771 var forceAllDay = false; 36772 var dateDelta; 36773 var dateMutation; 36774 if (startFootprint.isAllDay !== endFootprint.isAllDay) { 36775 clearEnd = true; 36776 if (endFootprint.isAllDay) { 36777 forceAllDay = true; 36778 date0.stripTime(); 36779 } 36780 else { 36781 forceTimed = true; 36782 } 36783 } 36784 dateDelta = this.component.diffDates(date1, date0); 36785 dateMutation = new EventDefDateMutation_1.default(); 36786 dateMutation.clearEnd = clearEnd; 36787 dateMutation.forceTimed = forceTimed; 36788 dateMutation.forceAllDay = forceAllDay; 36789 dateMutation.setDateDelta(dateDelta); 36790 return dateMutation; 36791 }; 36792 return EventDragging; 36793}(Interaction_1.default)); 36794exports.default = EventDragging; 36795 36796 36797/***/ }), 36798/* 225 */ 36799/***/ (function(module, exports, __webpack_require__) { 36800 36801Object.defineProperty(exports, "__esModule", { value: true }); 36802var tslib_1 = __webpack_require__(2); 36803var util_1 = __webpack_require__(4); 36804var HitDragListener_1 = __webpack_require__(23); 36805var ComponentFootprint_1 = __webpack_require__(12); 36806var UnzonedRange_1 = __webpack_require__(5); 36807var Interaction_1 = __webpack_require__(15); 36808var DateSelecting = /** @class */ (function (_super) { 36809 tslib_1.__extends(DateSelecting, _super); 36810 /* 36811 component must implement: 36812 - bindDateHandlerToEl 36813 - getSafeHitFootprint 36814 - renderHighlight 36815 - unrenderHighlight 36816 */ 36817 function DateSelecting(component) { 36818 var _this = _super.call(this, component) || this; 36819 _this.dragListener = _this.buildDragListener(); 36820 return _this; 36821 } 36822 DateSelecting.prototype.end = function () { 36823 this.dragListener.endInteraction(); 36824 }; 36825 DateSelecting.prototype.getDelay = function () { 36826 var delay = this.opt('selectLongPressDelay'); 36827 if (delay == null) { 36828 delay = this.opt('longPressDelay'); // fallback 36829 } 36830 return delay; 36831 }; 36832 DateSelecting.prototype.bindToEl = function (el) { 36833 var _this = this; 36834 var component = this.component; 36835 var dragListener = this.dragListener; 36836 component.bindDateHandlerToEl(el, 'mousedown', function (ev) { 36837 if (_this.opt('selectable') && !component.shouldIgnoreMouse()) { 36838 dragListener.startInteraction(ev, { 36839 distance: _this.opt('selectMinDistance') 36840 }); 36841 } 36842 }); 36843 component.bindDateHandlerToEl(el, 'touchstart', function (ev) { 36844 if (_this.opt('selectable') && !component.shouldIgnoreTouch()) { 36845 dragListener.startInteraction(ev, { 36846 delay: _this.getDelay() 36847 }); 36848 } 36849 }); 36850 util_1.preventSelection(el); 36851 }; 36852 // Creates a listener that tracks the user's drag across day elements, for day selecting. 36853 DateSelecting.prototype.buildDragListener = function () { 36854 var _this = this; 36855 var component = this.component; 36856 var selectionFootprint; // null if invalid selection 36857 var dragListener = new HitDragListener_1.default(component, { 36858 scroll: this.opt('dragScroll'), 36859 interactionStart: function () { 36860 selectionFootprint = null; 36861 }, 36862 dragStart: function (ev) { 36863 _this.view.unselect(ev); // since we could be rendering a new selection, we want to clear any old one 36864 }, 36865 hitOver: function (hit, isOrig, origHit) { 36866 var origHitFootprint; 36867 var hitFootprint; 36868 if (origHit) { 36869 origHitFootprint = component.getSafeHitFootprint(origHit); 36870 hitFootprint = component.getSafeHitFootprint(hit); 36871 if (origHitFootprint && hitFootprint) { 36872 selectionFootprint = _this.computeSelection(origHitFootprint, hitFootprint); 36873 } 36874 else { 36875 selectionFootprint = null; 36876 } 36877 if (selectionFootprint) {
36878 component.renderSelectionFootprint(selectionFootprint); 36879 } 36880 else if (selectionFootprint === false) { 36881 util_1.disableCursor(); 36882 } 36883 } 36884 }, 36885 hitOut: function () { 36886 selectionFootprint = null; 36887 component.unrenderSelection(); 36888 }, 36889 hitDone: function () { 36890 util_1.enableCursor(); 36891 }, 36892 interactionEnd: function (ev, isCancelled) { 36893 if (!isCancelled && selectionFootprint) { 36894 // the selection will already have been rendered. just report it 36895 _this.view.reportSelection(selectionFootprint, ev); 36896 } 36897 } 36898 }); 36899 return dragListener; 36900 }; 36901 // Given the first and last date-spans of a selection, returns another date-span object. 36902 // Subclasses can override and provide additional data in the span object. Will be passed to renderSelectionFootprint(). 36903 // Will return false if the selection is invalid and this should be indicated to the user. 36904 // Will return null/undefined if a selection invalid but no error should be reported. 36905 DateSelecting.prototype.computeSelection = function (footprint0, footprint1) { 36906 var wholeFootprint = this.computeSelectionFootprint(footprint0, footprint1); 36907 if (wholeFootprint && !this.isSelectionFootprintAllowed(wholeFootprint)) { 36908 return false; 36909 } 36910 return wholeFootprint; 36911 }; 36912 // Given two spans, must return the combination of the two. 36913 // TODO: do this separation of concerns (combining VS validation) for event dnd/resize too. 36914 // Assumes both footprints are non-open-ended. 36915 DateSelecting.prototype.computeSelectionFootprint = function (footprint0, footprint1) { 36916 var ms = [ 36917 footprint0.unzonedRange.startMs, 36918 footprint0.unzonedRange.endMs, 36919 footprint1.unzonedRange.startMs, 36920 footprint1.unzonedRange.endMs 36921 ]; 36922 ms.sort(util_1.compareNumbers); 36923 return new ComponentFootprint_1.default(new UnzonedRange_1.default(ms[0], ms[3]), footprint0.isAllDay); 36924 }; 36925 DateSelecting.prototype.isSelectionFootprintAllowed = function (componentFootprint) { 36926 return this.component.dateProfile.validUnzonedRange.containsRange(componentFootprint.unzonedRange) && 36927 this.view.calendar.constraints.isSelectionFootprintAllowed(componentFootprint); 36928 }; 36929 return DateSelecting; 36930}(Interaction_1.default)); 36931exports.default = DateSelecting; 36932 36933 36934/***/ }), 36935/* 226 */ 36936/***/ (function(module, exports, __webpack_require__) { 36937 36938Object.defineProperty(exports, "__esModule", { value: true }); 36939var tslib_1 = __webpack_require__(2); 36940var moment = __webpack_require__(0); 36941var $ = __webpack_require__(3); 36942var util_1 = __webpack_require__(4); 36943var Scroller_1 = __webpack_require__(39); 36944var View_1 = __webpack_require__(41); 36945var TimeGrid_1 = __webpack_require__(227); 36946var DayGrid_1 = __webpack_require__(61); 36947var AGENDA_ALL_DAY_EVENT_LIMIT = 5; 36948var agendaTimeGridMethods; 36949var agendaDayGridMethods; 36950/* An abstract class for all agenda-related views. Displays one more columns with time slots running vertically. 36951----------------------------------------------------------------------------------------------------------------------*/ 36952// Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on). 36953// Responsible for managing width/height. 36954var AgendaView = /** @class */ (function (_super) { 36955 tslib_1.__extends(AgendaView, _super); 36956 function AgendaView(calendar, viewSpec) { 36957 var _this = _super.call(this, calendar, viewSpec) || this; 36958 _this.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering 36959 _this.timeGrid = _this.instantiateTimeGrid(); 36960 _this.addChild(_this.timeGrid); 36961 if (_this.opt('allDaySlot')) { 36962 _this.dayGrid = _this.instantiateDayGrid(); // the all-day subcomponent of this view 36963 _this.addChild(_this.dayGrid); 36964 } 36965 _this.scroller = new Scroller_1.default({ 36966 overflowX: 'hidden', 36967 overflowY: 'auto' 36968 }); 36969 return _this; 36970 } 36971 // Instantiates the TimeGrid object this view needs. Draws from this.timeGridClass 36972 AgendaView.prototype.instantiateTimeGrid = function () { 36973 var timeGrid = new this.timeGridClass(this); 36974 util_1.copyOwnProps(agendaTimeGridMethods, timeGrid); 36975 return timeGrid; 36976 }; 36977 // Instantiates the DayGrid object this view might need. Draws from this.dayGridClass 36978 AgendaView.prototype.instantiateDayGrid = function () { 36979 var dayGrid = new this.dayGridClass(this); 36980 util_1.copyOwnProps(agendaDayGridMethods, dayGrid); 36981 return dayGrid; 36982 }; 36983 /* Rendering 36984 ------------------------------------------------------------------------------------------------------------------*/ 36985 AgendaView.prototype.renderSkeleton = function () { 36986 var timeGridWrapEl; 36987 var timeGridEl; 36988 this.el.addClass('fc-agenda-view').html(this.renderSkeletonHtml()); 36989 this.scroller.render(); 36990 timeGridWrapEl = this.scroller.el.addClass('fc-time-grid-container');
36991 timeGridEl = $('<div class="fc-time-grid" />').appendTo(timeGridWrapEl); 36992 this.el.find('.fc-body > tr > td').append(timeGridWrapEl); 36993 this.timeGrid.headContainerEl = this.el.find('.fc-head-container'); 36994 this.timeGrid.setElement(timeGridEl); 36995 if (this.dayGrid) { 36996 this.dayGrid.setElement(this.el.find('.fc-day-grid')); 36997 // have the day-grid extend it's coordinate area over the <hr> dividing the two grids 36998 this.dayGrid.bottomCoordPadding = this.dayGrid.el.next('hr').outerHeight(); 36999 } 37000 }; 37001 AgendaView.prototype.unrenderSkeleton = function () { 37002 this.timeGrid.removeElement(); 37003 if (this.dayGrid) { 37004 this.dayGrid.removeElement(); 37005 } 37006 this.scroller.destroy(); 37007 }; 37008 // Builds the HTML skeleton for the view. 37009 // The day-grid and time-grid components will render inside containers defined by this HTML. 37010 AgendaView.prototype.renderSkeletonHtml = function () { 37011 var theme = this.calendar.theme; 37012 return '' + 37013 '<table class="' + theme.getClass('tableGrid') + '">' + 37014 (this.opt('columnHeader') ? 37015 '<thead class="fc-head">' + 37016 '<tr>' + 37017 '<td class="fc-head-container ' + theme.getClass('widgetHeader') + '"> </td>' + 37018 '</tr>' + 37019 '</thead>' : 37020 '') + 37021 '<tbody class="fc-body">' + 37022 '<tr>' + 37023 '<td class="' + theme.getClass('widgetContent') + '">' + 37024 (this.dayGrid ? 37025 '<div class="fc-day-grid"/>' + 37026 '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '"/>' : 37027 '') + 37028 '</td>' + 37029 '</tr>' + 37030 '</tbody>' + 37031 '</table>'; 37032 }; 37033 // Generates an HTML attribute string for setting the width of the axis, if it is known 37034 AgendaView.prototype.axisStyleAttr = function () { 37035 if (this.axisWidth != null) { 37036 return 'style="width:' + this.axisWidth + 'px"'; 37037 } 37038 return ''; 37039 }; 37040 /* Now Indicator 37041 ------------------------------------------------------------------------------------------------------------------*/ 37042 AgendaView.prototype.getNowIndicatorUnit = function () { 37043 return this.timeGrid.getNowIndicatorUnit(); 37044 }; 37045 /* Dimensions 37046 ------------------------------------------------------------------------------------------------------------------*/ 37047 // Adjusts the vertical dimensions of the view to the specified values 37048 AgendaView.prototype.updateSize = function (totalHeight, isAuto, isResize) { 37049 var eventLimit; 37050 var scrollerHeight; 37051 var scrollbarWidths; 37052 _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize); 37053 // make all axis cells line up, and record the width so newly created axis cells will have it 37054 this.axisWidth = util_1.matchCellWidths(this.el.find('.fc-axis')); 37055 // hack to give the view some height prior to timeGrid's columns being rendered 37056 // TODO: separate setting height from scroller VS timeGrid. 37057 if (!this.timeGrid.colEls) { 37058 if (!isAuto) { 37059 scrollerHeight = this.computeScrollerHeight(totalHeight); 37060 this.scroller.setHeight(scrollerHeight); 37061 } 37062 return; 37063 } 37064 // set of fake row elements that must compensate when scroller has scrollbars 37065 var noScrollRowEls = this.el.find('.fc-row:not(.fc-scroller *)'); 37066 // reset all dimensions back to the original state 37067 this.timeGrid.bottomRuleEl.hide(); // .show() will be called later if this <hr> is necessary 37068 this.scroller.clear(); // sets height to 'auto' and clears overflow 37069 util_1.uncompensateScroll(noScrollRowEls); 37070 // limit number of events in the all-day area 37071 if (this.dayGrid) { 37072 this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed 37073 eventLimit = this.opt('eventLimit'); 37074 if (eventLimit && typeof eventLimit !== 'number') { 37075 eventLimit = AGENDA_ALL_DAY_EVENT_LIMIT; // make sure "auto" goes to a real number 37076 } 37077 if (eventLimit) { 37078 this.dayGrid.limitRows(eventLimit); 37079 } 37080 } 37081 if (!isAuto) { 37082 scrollerHeight = this.computeScrollerHeight(totalHeight); 37083 this.scroller.setHeight(scrollerHeight);
37084 scrollbarWidths = this.scroller.getScrollbarWidths(); 37085 if (scrollbarWidths.left || scrollbarWidths.right) { 37086 // make the all-day and header rows lines up 37087 util_1.compensateScroll(noScrollRowEls, scrollbarWidths); 37088 // the scrollbar compensation might have changed text flow, which might affect height, so recalculate 37089 // and reapply the desired height to the scroller. 37090 scrollerHeight = this.computeScrollerHeight(totalHeight); 37091 this.scroller.setHeight(scrollerHeight); 37092 } 37093 // guarantees the same scrollbar widths 37094 this.scroller.lockOverflow(scrollbarWidths); 37095 // if there's any space below the slats, show the horizontal rule. 37096 // this won't cause any new overflow, because lockOverflow already called. 37097 if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) { 37098 this.timeGrid.bottomRuleEl.show(); 37099 } 37100 } 37101 }; 37102 // given a desired total height of the view, returns what the height of the scroller should be 37103 AgendaView.prototype.computeScrollerHeight = function (totalHeight) { 37104 return totalHeight - 37105 util_1.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller 37106 }; 37107 /* Scroll 37108 ------------------------------------------------------------------------------------------------------------------*/ 37109 // Computes the initial pre-configured scroll state prior to allowing the user to change it 37110 AgendaView.prototype.computeInitialDateScroll = function () { 37111 var scrollTime = moment.duration(this.opt('scrollTime')); 37112 var top = this.timeGrid.computeTimeTop(scrollTime); 37113 // zoom can give weird floating-point values. rather scroll a little bit further 37114 top = Math.ceil(top); 37115 if (top) { 37116 top++; // to overcome top border that slots beyond the first have. looks better 37117 } 37118 return { top: top }; 37119 }; 37120 AgendaView.prototype.queryDateScroll = function () { 37121 return { top: this.scroller.getScrollTop() }; 37122 }; 37123 AgendaView.prototype.applyDateScroll = function (scroll) { 37124 if (scroll.top !== undefined) { 37125 this.scroller.setScrollTop(scroll.top); 37126 } 37127 }; 37128 /* Hit Areas 37129 ------------------------------------------------------------------------------------------------------------------*/ 37130 // forward all hit-related method calls to the grids (dayGrid might not be defined) 37131 AgendaView.prototype.getHitFootprint = function (hit) { 37132 // TODO: hit.component is set as a hack to identify where the hit came from 37133 return hit.component.getHitFootprint(hit); 37134 }; 37135 AgendaView.prototype.getHitEl = function (hit) { 37136 // TODO: hit.component is set as a hack to identify where the hit came from 37137 return hit.component.getHitEl(hit); 37138 }; 37139 /* Event Rendering 37140 ------------------------------------------------------------------------------------------------------------------*/ 37141 AgendaView.prototype.executeEventRender = function (eventsPayload) { 37142 var dayEventsPayload = {}; 37143 var timedEventsPayload = {}; 37144 var id; 37145 var eventInstanceGroup; 37146 // separate the events into all-day and timed 37147 for (id in eventsPayload) { 37148 eventInstanceGroup = eventsPayload[id]; 37149 if (eventInstanceGroup.getEventDef().isAllDay()) { 37150 dayEventsPayload[id] = eventInstanceGroup; 37151 } 37152 else { 37153 timedEventsPayload[id] = eventInstanceGroup; 37154 } 37155 } 37156 this.timeGrid.executeEventRender(timedEventsPayload); 37157 if (this.dayGrid) { 37158 this.dayGrid.executeEventRender(dayEventsPayload); 37159 } 37160 }; 37161 /* Dragging/Resizing Routing 37162 ------------------------------------------------------------------------------------------------------------------*/ 37163 // A returned value of `true` signals that a mock "helper" event has been rendered. 37164 AgendaView.prototype.renderDrag = function (eventFootprints, seg, isTouch) { 37165 var groups = groupEventFootprintsByAllDay(eventFootprints); 37166 var renderedHelper = false;
37167 renderedHelper = this.timeGrid.renderDrag(groups.timed, seg, isTouch); 37168 if (this.dayGrid) { 37169 renderedHelper = this.dayGrid.renderDrag(groups.allDay, seg, isTouch) || renderedHelper; 37170 } 37171 return renderedHelper; 37172 }; 37173 AgendaView.prototype.renderEventResize = function (eventFootprints, seg, isTouch) { 37174 var groups = groupEventFootprintsByAllDay(eventFootprints); 37175 this.timeGrid.renderEventResize(groups.timed, seg, isTouch); 37176 if (this.dayGrid) { 37177 this.dayGrid.renderEventResize(groups.allDay, seg, isTouch); 37178 } 37179 }; 37180 /* Selection 37181 ------------------------------------------------------------------------------------------------------------------*/ 37182 // Renders a visual indication of a selection 37183 AgendaView.prototype.renderSelectionFootprint = function (componentFootprint) { 37184 if (!componentFootprint.isAllDay) { 37185 this.timeGrid.renderSelectionFootprint(componentFootprint); 37186 } 37187 else if (this.dayGrid) { 37188 this.dayGrid.renderSelectionFootprint(componentFootprint); 37189 } 37190 }; 37191 return AgendaView; 37192}(View_1.default)); 37193exports.default = AgendaView; 37194AgendaView.prototype.timeGridClass = TimeGrid_1.default; 37195AgendaView.prototype.dayGridClass = DayGrid_1.default; 37196// Will customize the rendering behavior of the AgendaView's timeGrid 37197agendaTimeGridMethods = { 37198 // Generates the HTML that will go before the day-of week header cells 37199 renderHeadIntroHtml: function () { 37200 var view = this.view; 37201 var calendar = view.calendar; 37202 var weekStart = calendar.msToUtcMoment(this.dateProfile.renderUnzonedRange.startMs, true); 37203 var weekText; 37204 if (this.opt('weekNumbers')) { 37205 weekText = weekStart.format(this.opt('smallWeekFormat')); 37206 return '' + 37207 '<th class="fc-axis fc-week-number ' + calendar.theme.getClass('widgetHeader') + '" ' + view.axisStyleAttr() + '>' + 37208 view.buildGotoAnchorHtml(// aside from link, important for matchCellWidths 37209 { date: weekStart, type: 'week', forceOff: this.colCnt > 1 }, util_1.htmlEscape(weekText) // inner HTML 37210 ) + 37211 '</th>'; 37212 } 37213 else { 37214 return '<th class="fc-axis ' + calendar.theme.getClass('widgetHeader') + '" ' + view.axisStyleAttr() + '></th>'; 37215 } 37216 }, 37217 // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column. 37218 renderBgIntroHtml: function () { 37219 var view = this.view; 37220 return '<td class="fc-axis ' + view.calendar.theme.getClass('widgetContent') + '" ' + view.axisStyleAttr() + '></td>'; 37221 }, 37222 // Generates the HTML that goes before all other types of cells. 37223 // Affects content-skeleton, helper-skeleton, highlight-skeleton for both the time-grid and day-grid. 37224 renderIntroHtml: function () { 37225 var view = this.view; 37226 return '<td class="fc-axis" ' + view.axisStyleAttr() + '></td>'; 37227 } 37228}; 37229// Will customize the rendering behavior of the AgendaView's dayGrid 37230agendaDayGridMethods = { 37231 // Generates the HTML that goes before the all-day cells 37232 renderBgIntroHtml: function () { 37233 var view = this.view; 37234 return '' + 37235 '<td class="fc-axis ' + view.calendar.theme.getClass('widgetContent') + '" ' + view.axisStyleAttr() + '>' + 37236 '<span>' + // needed for matchCellWidths 37237 view.getAllDayHtml() + 37238 '</span>' + 37239 '</td>'; 37240 }, 37241 // Generates the HTML that goes before all other types of cells. 37242 // Affects content-skeleton, helper-skeleton, highlight-skeleton for both the time-grid and day-grid. 37243 renderIntroHtml: function () { 37244 var view = this.view; 37245 return '<td class="fc-axis" ' + view.axisStyleAttr() + '></td>'; 37246 } 37247}; 37248function groupEventFootprintsByAllDay(eventFootprints) { 37249 var allDay = []; 37250 var timed = []; 37251 var i; 37252 for (i = 0; i < eventFootprints.length; i++) { 37253 if (eventFootprints[i].componentFootprint.isAllDay) { 37254 allDay.push(eventFootprints[i]); 37255 } 37256 else { 37257 timed.push(eventFootprints[i]); 37258 } 37259 } 37260 return { allDay: allDay, timed: timed }; 37261} 37262 37263 37264/***/ }), 37265/* 227 */ 37266/***/ (function(module, exports, __webpack_require__) { 37267 37268Object.defineProperty(exports, "__esModule", { value: true }); 37269var tslib_1 = __webpack_require__(2); 37270var $ = __webpack_require__(3); 37271var moment = __webpack_require__(0); 37272var util_1 = __webpack_require__(4); 37273var InteractiveDateComponent_1 = __webpack_require__(40); 37274var BusinessHourRenderer_1 = __webpack_require__(56); 37275var StandardInteractionsMixin_1 = __webpack_require__(60); 37276var DayTableMixin_1 = __webpack_require__(55);
37277var CoordCache_1 = __webpack_require__(53); 37278var UnzonedRange_1 = __webpack_require__(5); 37279var ComponentFootprint_1 = __webpack_require__(12); 37280var TimeGridEventRenderer_1 = __webpack_require__(246); 37281var TimeGridHelperRenderer_1 = __webpack_require__(247); 37282var TimeGridFillRenderer_1 = __webpack_require__(248); 37283/* A component that renders one or more columns of vertical time slots 37284----------------------------------------------------------------------------------------------------------------------*/ 37285// We mixin DayTable, even though there is only a single row of days 37286// potential nice values for the slot-duration and interval-duration 37287// from largest to smallest 37288var AGENDA_STOCK_SUB_DURATIONS = [ 37289 { hours: 1 }, 37290 { minutes: 30 }, 37291 { minutes: 15 }, 37292 { seconds: 30 }, 37293 { seconds: 15 } 37294]; 37295var TimeGrid = /** @class */ (function (_super) { 37296 tslib_1.__extends(TimeGrid, _super); 37297 function TimeGrid(view) { 37298 var _this = _super.call(this, view) || this; 37299 _this.processOptions(); 37300 return _this; 37301 } 37302 // Slices up the given span (unzoned start/end with other misc data) into an array of segments 37303 TimeGrid.prototype.componentFootprintToSegs = function (componentFootprint) { 37304 var segs = this.sliceRangeByTimes(componentFootprint.unzonedRange); 37305 var i; 37306 for (i = 0; i < segs.length; i++) { 37307 if (this.isRTL) { 37308 segs[i].col = this.daysPerRow - 1 - segs[i].dayIndex; 37309 } 37310 else { 37311 segs[i].col = segs[i].dayIndex; 37312 } 37313 } 37314 return segs; 37315 }; 37316 /* Date Handling 37317 ------------------------------------------------------------------------------------------------------------------*/ 37318 TimeGrid.prototype.sliceRangeByTimes = function (unzonedRange) { 37319 var segs = []; 37320 var segRange; 37321 var dayIndex; 37322 for (dayIndex = 0; dayIndex < this.daysPerRow; dayIndex++) { 37323 segRange = unzonedRange.intersect(this.dayRanges[dayIndex]); 37324 if (segRange) { 37325 segs.push({ 37326 startMs: segRange.startMs, 37327 endMs: segRange.endMs, 37328 isStart: segRange.isStart, 37329 isEnd: segRange.isEnd, 37330 dayIndex: dayIndex 37331 }); 37332 } 37333 } 37334 return segs; 37335 }; 37336 /* Options 37337 ------------------------------------------------------------------------------------------------------------------*/ 37338 // Parses various options into properties of this object 37339 TimeGrid.prototype.processOptions = function () { 37340 var slotDuration = this.opt('slotDuration'); 37341 var snapDuration = this.opt('snapDuration'); 37342 var input; 37343 slotDuration = moment.duration(slotDuration); 37344 snapDuration = snapDuration ? moment.duration(snapDuration) : slotDuration; 37345 this.slotDuration = slotDuration; 37346 this.snapDuration = snapDuration; 37347 this.snapsPerSlot = slotDuration / snapDuration; // TODO: ensure an integer multiple? 37348 // might be an array value (for TimelineView). 37349 // if so, getting the most granular entry (the last one probably). 37350 input = this.opt('slotLabelFormat'); 37351 if ($.isArray(input)) { 37352 input = input[input.length - 1]; 37353 } 37354 this.labelFormat = input || 37355 this.opt('smallTimeFormat'); // the computed default 37356 input = this.opt('slotLabelInterval'); 37357 this.labelInterval = input ? 37358 moment.duration(input) : 37359 this.computeLabelInterval(slotDuration); 37360 }; 37361 // Computes an automatic value for slotLabelInterval 37362 TimeGrid.prototype.computeLabelInterval = function (slotDuration) { 37363 var i; 37364 var labelInterval; 37365 var slotsPerLabel; 37366 // find the smallest stock label interval that results in more than one slots-per-label 37367 for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) { 37368 labelInterval = moment.duration(AGENDA_STOCK_SUB_DURATIONS[i]); 37369 slotsPerLabel = util_1.divideDurationByDuration(labelInterval, slotDuration);
37370 if (util_1.isInt(slotsPerLabel) && slotsPerLabel > 1) { 37371 return labelInterval; 37372 } 37373 } 37374 return moment.duration(slotDuration); // fall back. clone 37375 }; 37376 /* Date Rendering 37377 ------------------------------------------------------------------------------------------------------------------*/ 37378 TimeGrid.prototype.renderDates = function (dateProfile) { 37379 this.dateProfile = dateProfile; 37380 this.updateDayTable(); 37381 this.renderSlats(); 37382 this.renderColumns(); 37383 }; 37384 TimeGrid.prototype.unrenderDates = function () { 37385 // this.unrenderSlats(); // don't need this because repeated .html() calls clear 37386 this.unrenderColumns(); 37387 }; 37388 TimeGrid.prototype.renderSkeleton = function () { 37389 var theme = this.view.calendar.theme; 37390 this.el.html('<div class="fc-bg"></div>' + 37391 '<div class="fc-slats"></div>' + 37392 '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" style="display:none" />'); 37393 this.bottomRuleEl = this.el.find('hr'); 37394 }; 37395 TimeGrid.prototype.renderSlats = function () { 37396 var theme = this.view.calendar.theme; 37397 this.slatContainerEl = this.el.find('> .fc-slats') 37398 .html(// avoids needing ::unrenderSlats() 37399 '<table class="' + theme.getClass('tableGrid') + '">' + 37400 this.renderSlatRowHtml() + 37401 '</table>');
37402 this.slatEls = this.slatContainerEl.find('tr'); 37403 this.slatCoordCache = new CoordCache_1.default({ 37404 els: this.slatEls, 37405 isVertical: true 37406 }); 37407 }; 37408 // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL. 37409 TimeGrid.prototype.renderSlatRowHtml = function () { 37410 var view = this.view; 37411 var calendar = view.calendar; 37412 var theme = calendar.theme; 37413 var isRTL = this.isRTL; 37414 var dateProfile = this.dateProfile; 37415 var html = ''; 37416 var slotTime = moment.duration(+dateProfile.minTime); // wish there was .clone() for durations 37417 var slotIterator = moment.duration(0); 37418 var slotDate; // will be on the view's first day, but we only care about its time 37419 var isLabeled; 37420 var axisHtml; 37421 // Calculate the time for each slot 37422 while (slotTime < dateProfile.maxTime) { 37423 slotDate = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs).time(slotTime); 37424 isLabeled = util_1.isInt(util_1.divideDurationByDuration(slotIterator, this.labelInterval)); 37425 axisHtml = 37426 '<td class="fc-axis fc-time ' + theme.getClass('widgetContent') + '" ' + view.axisStyleAttr() + '>' + 37427 (isLabeled ? 37428 '<span>' + // for matchCellWidths 37429 util_1.htmlEscape(slotDate.format(this.labelFormat)) + 37430 '</span>' : 37431 '') + 37432 '</td>'; 37433 html += 37434 '<tr data-time="' + slotDate.format('HH:mm:ss') + '"' + 37435 (isLabeled ? '' : ' class="fc-minor"') + 37436 '>' + 37437 (!isRTL ? axisHtml : '') + 37438 '<td class="' + theme.getClass('widgetContent') + '"/>' + 37439 (isRTL ? axisHtml : '') + 37440 '</tr>'; 37441 slotTime.add(this.slotDuration); 37442 slotIterator.add(this.slotDuration); 37443 } 37444 return html; 37445 }; 37446 TimeGrid.prototype.renderColumns = function () { 37447 var dateProfile = this.dateProfile; 37448 var theme = this.view.calendar.theme; 37449 this.dayRanges = this.dayDates.map(function (dayDate) { 37450 return new UnzonedRange_1.default(dayDate.clone().add(dateProfile.minTime), dayDate.clone().add(dateProfile.maxTime)); 37451 }); 37452 if (this.headContainerEl) { 37453 this.headContainerEl.html(this.renderHeadHtml()); 37454 } 37455 this.el.find('> .fc-bg').html('<table class="' + theme.getClass('tableGrid') + '">' + 37456 this.renderBgTrHtml(0) + // row=0 37457 '</table>'); 37458 this.colEls = this.el.find('.fc-day, .fc-disabled-day'); 37459 this.colCoordCache = new CoordCache_1.default({ 37460 els: this.colEls, 37461 isHorizontal: true 37462 }); 37463 this.renderContentSkeleton(); 37464 }; 37465 TimeGrid.prototype.unrenderColumns = function () { 37466 this.unrenderContentSkeleton(); 37467 }; 37468 /* Content Skeleton 37469 ------------------------------------------------------------------------------------------------------------------*/ 37470 // Renders the DOM that the view's content will live in 37471 TimeGrid.prototype.renderContentSkeleton = function () { 37472 var cellHtml = ''; 37473 var i; 37474 var skeletonEl; 37475 for (i = 0; i < this.colCnt; i++) { 37476 cellHtml += 37477 '<td>' + 37478 '<div class="fc-content-col">' + 37479 '<div class="fc-event-container fc-helper-container"></div>' + 37480 '<div class="fc-event-container"></div>' + 37481 '<div class="fc-highlight-container"></div>' + 37482 '<div class="fc-bgevent-container"></div>' + 37483 '<div class="fc-business-container"></div>' + 37484 '</div>' + 37485 '</td>'; 37486 } 37487 skeletonEl = this.contentSkeletonEl = $('<div class="fc-content-skeleton">' + 37488 '<table>' + 37489 '<tr>' + cellHtml + '</tr>' + 37490 '</table>' + 37491 '</div>'); 37492 this.colContainerEls = skeletonEl.find('.fc-content-col'); 37493 this.helperContainerEls = skeletonEl.find('.fc-helper-container'); 37494 this.fgContainerEls = skeletonEl.find('.fc-event-container:not(.fc-helper-container)'); 37495 this.bgContainerEls = skeletonEl.find('.fc-bgevent-container'); 37496 this.highlightContainerEls = skeletonEl.find('.fc-highlight-container'); 37497 this.businessContainerEls = skeletonEl.find('.fc-business-container'); 37498 this.bookendCells(skeletonEl.find('tr')); // TODO: do this on string level 37499 this.el.append(skeletonEl); 37500 }; 37501 TimeGrid.prototype.unrenderContentSkeleton = function () { 37502 if (this.contentSkeletonEl) { 37503 this.contentSkeletonEl.remove(); 37504 this.contentSkeletonEl = null; 37505 this.colContainerEls = null; 37506 this.helperContainerEls = null; 37507 this.fgContainerEls = null; 37508 this.bgContainerEls = null; 37509 this.highlightContainerEls = null; 37510 this.businessContainerEls = null; 37511 } 37512 }; 37513 // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col 37514 TimeGrid.prototype.groupSegsByCol = function (segs) { 37515 var segsByCol = []; 37516 var i; 37517 for (i = 0; i < this.colCnt; i++) { 37518 segsByCol.push([]); 37519 } 37520 for (i = 0; i < segs.length; i++) { 37521 segsByCol[segs[i].col].push(segs[i]); 37522 } 37523 return segsByCol; 37524 }; 37525 // Given segments grouped by column, insert the segments' elements into a parallel array of container 37526 // elements, each living within a column. 37527 TimeGrid.prototype.attachSegsByCol = function (segsByCol, containerEls) { 37528 var col; 37529 var segs; 37530 var i; 37531 for (col = 0; col < this.colCnt; col++) { 37532 segs = segsByCol[col]; 37533 for (i = 0; i < segs.length; i++) { 37534 containerEls.eq(col).append(segs[i].el); 37535 } 37536 } 37537 }; 37538 /* Now Indicator 37539 ------------------------------------------------------------------------------------------------------------------*/ 37540 TimeGrid.prototype.getNowIndicatorUnit = function () { 37541 return 'minute'; // will refresh on the minute 37542 }; 37543 TimeGrid.prototype.renderNowIndicator = function (date) { 37544 // HACK: if date columns not ready for some reason (scheduler) 37545 if (!this.colContainerEls) { 37546 return; 37547 } 37548 // seg system might be overkill, but it handles scenario where line needs to be rendered 37549 // more than once because of columns with the same date (resources columns for example) 37550 var segs = this.componentFootprintToSegs(new ComponentFootprint_1.default(new UnzonedRange_1.default(date, date.valueOf() + 1), // protect against null range 37551 false // all-day 37552 )); 37553 var top = this.computeDateTop(date, date); 37554 var nodes = []; 37555 var i; 37556 // render lines within the columns 37557 for (i = 0; i < segs.length; i++) { 37558 nodes.push($('<div class="fc-now-indicator fc-now-indicator-line"></div>') 37559 .css('top', top) 37560 .appendTo(this.colContainerEls.eq(segs[i].col))[0]); 37561 } 37562 // render an arrow over the axis 37563 if (segs.length > 0) { 37564 nodes.push($('<div class="fc-now-indicator fc-now-indicator-arrow"></div>') 37565 .css('top', top) 37566 .appendTo(this.el.find('.fc-content-skeleton'))[0]); 37567 } 37568 this.nowIndicatorEls = $(nodes); 37569 }; 37570 TimeGrid.prototype.unrenderNowIndicator = function () { 37571 if (this.nowIndicatorEls) { 37572 this.nowIndicatorEls.remove(); 37573 this.nowIndicatorEls = null; 37574 } 37575 }; 37576 /* Coordinates 37577 ------------------------------------------------------------------------------------------------------------------*/ 37578 TimeGrid.prototype.updateSize = function (totalHeight, isAuto, isResize) { 37579 _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize);
37580 this.slatCoordCache.build(); 37581 if (isResize) { 37582 this.updateSegVerticals([].concat(this.eventRenderer.getSegs(), this.businessSegs || [])); 37583 } 37584 }; 37585 TimeGrid.prototype.getTotalSlatHeight = function () { 37586 return this.slatContainerEl.outerHeight(); 37587 }; 37588 // Computes the top coordinate, relative to the bounds of the grid, of the given date. 37589 // `ms` can be a millisecond UTC time OR a UTC moment. 37590 // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight. 37591 TimeGrid.prototype.computeDateTop = function (ms, startOfDayDate) { 37592 return this.computeTimeTop(moment.duration(ms - startOfDayDate.clone().stripTime())); 37593 }; 37594 // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration). 37595 TimeGrid.prototype.computeTimeTop = function (time) { 37596 var len = this.slatEls.length; 37597 var dateProfile = this.dateProfile; 37598 var slatCoverage = (time - dateProfile.minTime) / this.slotDuration; // floating-point value of # of slots covered 37599 var slatIndex; 37600 var slatRemainder; 37601 // compute a floating-point number for how many slats should be progressed through. 37602 // from 0 to number of slats (inclusive) 37603 // constrained because minTime/maxTime might be customized. 37604 slatCoverage = Math.max(0, slatCoverage); 37605 slatCoverage = Math.min(len, slatCoverage); 37606 // an integer index of the furthest whole slat 37607 // from 0 to number slats (*exclusive*, so len-1) 37608 slatIndex = Math.floor(slatCoverage); 37609 slatIndex = Math.min(slatIndex, len - 1); 37610 // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition. 37611 // could be 1.0 if slatCoverage is covering *all* the slots 37612 slatRemainder = slatCoverage - slatIndex;
37613 return this.slatCoordCache.getTopPosition(slatIndex) + 37614 this.slatCoordCache.getHeight(slatIndex) * slatRemainder; 37615 }; 37616 // Refreshes the CSS top/bottom coordinates for each segment element. 37617 // Works when called after initial render, after a window resize/zoom for example. 37618 TimeGrid.prototype.updateSegVerticals = function (segs) { 37619 this.computeSegVerticals(segs); 37620 this.assignSegVerticals(segs); 37621 }; 37622 // For each segment in an array, computes and assigns its top and bottom properties 37623 TimeGrid.prototype.computeSegVerticals = function (segs) { 37624 var eventMinHeight = this.opt('agendaEventMinHeight'); 37625 var i; 37626 var seg; 37627 var dayDate; 37628 for (i = 0; i < segs.length; i++) { 37629 seg = segs[i]; 37630 dayDate = this.dayDates[seg.dayIndex]; 37631 seg.top = this.computeDateTop(seg.startMs, dayDate); 37632 seg.bottom = Math.max(seg.top + eventMinHeight, this.computeDateTop(seg.endMs, dayDate)); 37633 } 37634 }; 37635 // Given segments that already have their top/bottom properties computed, applies those values to 37636 // the segments' elements. 37637 TimeGrid.prototype.assignSegVerticals = function (segs) { 37638 var i; 37639 var seg; 37640 for (i = 0; i < segs.length; i++) { 37641 seg = segs[i]; 37642 seg.el.css(this.generateSegVerticalCss(seg)); 37643 } 37644 }; 37645 // Generates an object with CSS properties for the top/bottom coordinates of a segment element 37646 TimeGrid.prototype.generateSegVerticalCss = function (seg) { 37647 return { 37648 top: seg.top, 37649 bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container 37650 }; 37651 }; 37652 /* Hit System 37653 ------------------------------------------------------------------------------------------------------------------*/ 37654 TimeGrid.prototype.prepareHits = function () { 37655 this.colCoordCache.build(); 37656 this.slatCoordCache.build(); 37657 }; 37658 TimeGrid.prototype.releaseHits = function () { 37659 this.colCoordCache.clear(); 37660 // NOTE: don't clear slatCoordCache because we rely on it for computeTimeTop 37661 }; 37662 TimeGrid.prototype.queryHit = function (leftOffset, topOffset) { 37663 var snapsPerSlot = this.snapsPerSlot; 37664 var colCoordCache = this.colCoordCache; 37665 var slatCoordCache = this.slatCoordCache; 37666 if (colCoordCache.isLeftInBounds(leftOffset) && slatCoordCache.isTopInBounds(topOffset)) { 37667 var colIndex = colCoordCache.getHorizontalIndex(leftOffset); 37668 var slatIndex = slatCoordCache.getVerticalIndex(topOffset); 37669 if (colIndex != null && slatIndex != null) { 37670 var slatTop = slatCoordCache.getTopOffset(slatIndex); 37671 var slatHeight = slatCoordCache.getHeight(slatIndex); 37672 var partial = (topOffset - slatTop) / slatHeight; // floating point number between 0 and 1 37673 var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat 37674 var snapIndex = slatIndex * snapsPerSlot + localSnapIndex; 37675 var snapTop = slatTop + (localSnapIndex / snapsPerSlot) * slatHeight; 37676 var snapBottom = slatTop + ((localSnapIndex + 1) / snapsPerSlot) * slatHeight; 37677 return { 37678 col: colIndex, 37679 snap: snapIndex, 37680 component: this, 37681 left: colCoordCache.getLeftOffset(colIndex), 37682 right: colCoordCache.getRightOffset(colIndex), 37683 top: snapTop, 37684 bottom: snapBottom 37685 }; 37686 } 37687 } 37688 }; 37689 TimeGrid.prototype.getHitFootprint = function (hit) { 37690 var start = this.getCellDate(0, hit.col); // row=0 37691 var time = this.computeSnapTime(hit.snap); // pass in the snap-index 37692 var end; 37693 start.time(time); 37694 end = start.clone().add(this.snapDuration); 37695 return new ComponentFootprint_1.default(new UnzonedRange_1.default(start, end), false // all-day? 37696 ); 37697 }; 37698 // Given a row number of the grid, representing a "snap", returns a time (Duration) from its start-of-day 37699 TimeGrid.prototype.computeSnapTime = function (snapIndex) { 37700 return moment.duration(this.dateProfile.minTime + this.snapDuration * snapIndex); 37701 }; 37702 TimeGrid.prototype.getHitEl = function (hit) { 37703 return this.colEls.eq(hit.col); 37704 }; 37705 /* Event Drag Visualization 37706 ------------------------------------------------------------------------------------------------------------------*/ 37707 // Renders a visual indication of an event being dragged over the specified date(s). 37708 // A returned value of `true` signals that a mock "helper" event has been rendered. 37709 TimeGrid.prototype.renderDrag = function (eventFootprints, seg, isTouch) { 37710 var i; 37711 if (seg) { 37712 if (eventFootprints.length) { 37713 this.helperRenderer.renderEventDraggingFootprints(eventFootprints, seg, isTouch); 37714 // signal that a helper has been rendered 37715 return true; 37716 } 37717 } 37718 else { 37719 for (i = 0; i < eventFootprints.length; i++) { 37720 this.renderHighlight(eventFootprints[i].componentFootprint); 37721 } 37722 } 37723 }; 37724 // Unrenders any visual indication of an event being dragged 37725 TimeGrid.prototype.unrenderDrag = function () { 37726 this.unrenderHighlight(); 37727 this.helperRenderer.unrender(); 37728 }; 37729 /* Event Resize Visualization 37730 ------------------------------------------------------------------------------------------------------------------*/ 37731 // Renders a visual indication of an event being resized 37732 TimeGrid.prototype.renderEventResize = function (eventFootprints, seg, isTouch) { 37733 this.helperRenderer.renderEventResizingFootprints(eventFootprints, seg, isTouch); 37734 }; 37735 // Unrenders any visual indication of an event being resized 37736 TimeGrid.prototype.unrenderEventResize = function () { 37737 this.helperRenderer.unrender(); 37738 }; 37739 /* Selection 37740 ------------------------------------------------------------------------------------------------------------------*/ 37741 // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight. 37742 TimeGrid.prototype.renderSelectionFootprint = function (componentFootprint) { 37743 if (this.opt('selectHelper')) { 37744 this.helperRenderer.renderComponentFootprint(componentFootprint); 37745 } 37746 else { 37747 this.renderHighlight(componentFootprint); 37748 } 37749 }; 37750 // Unrenders any visual indication of a selection 37751 TimeGrid.prototype.unrenderSelection = function () { 37752 this.helperRenderer.unrender(); 37753 this.unrenderHighlight(); 37754 }; 37755 return TimeGrid; 37756}(InteractiveDateComponent_1.default)); 37757exports.default = TimeGrid; 37758TimeGrid.prototype.eventRendererClass = TimeGridEventRenderer_1.default; 37759TimeGrid.prototype.businessHourRendererClass = BusinessHourRenderer_1.default; 37760TimeGrid.prototype.helperRendererClass = TimeGridHelperRenderer_1.default; 37761TimeGrid.prototype.fillRendererClass = TimeGridFillRenderer_1.default; 37762StandardInteractionsMixin_1.default.mixInto(TimeGrid); 37763DayTableMixin_1.default.mixInto(TimeGrid); 37764 37765 37766/***/ }), 37767/* 228 */ 37768/***/ (function(module, exports, __webpack_require__) { 37769 37770Object.defineProperty(exports, "__esModule", { value: true }); 37771var tslib_1 = __webpack_require__(2); 37772var UnzonedRange_1 = __webpack_require__(5); 37773var DateProfileGenerator_1 = __webpack_require__(221); 37774var BasicViewDateProfileGenerator = /** @class */ (function (_super) { 37775 tslib_1.__extends(BasicViewDateProfileGenerator, _super); 37776 function BasicViewDateProfileGenerator() { 37777 return _super !== null && _super.apply(this, arguments) || this; 37778 } 37779 // Computes the date range that will be rendered. 37780 BasicViewDateProfileGenerator.prototype.buildRenderRange = function (currentUnzonedRange, currentRangeUnit, isRangeAllDay) { 37781 var renderUnzonedRange = _super.prototype.buildRenderRange.call(this, currentUnzonedRange, currentRangeUnit, isRangeAllDay); // an UnzonedRange 37782 var start = this.msToUtcMoment(renderUnzonedRange.startMs, isRangeAllDay); 37783 var end = this.msToUtcMoment(renderUnzonedRange.endMs, isRangeAllDay); 37784 // year and month views should be aligned with weeks. this is already done for week 37785 if (/^(year|month)$/.test(currentRangeUnit)) { 37786 start.startOf('week'); 37787 // make end-of-week if not already 37788 if (end.weekday()) { 37789 end.add(1, 'week').startOf('week'); // exclusively move backwards 37790 } 37791 } 37792 return new UnzonedRange_1.default(start, end); 37793 }; 37794 return BasicViewDateProfileGenerator; 37795}(DateProfileGenerator_1.default)); 37796exports.default = BasicViewDateProfileGenerator; 37797 37798 37799/***/ }), 37800/* 229 */ 37801/***/ (function(module, exports, __webpack_require__) { 37802 37803Object.defineProperty(exports, "__esModule", { value: true }); 37804var tslib_1 = __webpack_require__(2); 37805var moment = __webpack_require__(0); 37806var util_1 = __webpack_require__(4); 37807var BasicView_1 = __webpack_require__(62); 37808var MonthViewDateProfileGenerator_1 = __webpack_require__(253); 37809/* A month view with day cells running in rows (one-per-week) and columns 37810----------------------------------------------------------------------------------------------------------------------*/ 37811var MonthView = /** @class */ (function (_super) { 37812 tslib_1.__extends(MonthView, _super); 37813 function MonthView() { 37814 return _super !== null && _super.apply(this, arguments) || this; 37815 } 37816 // Overrides the default BasicView behavior to have special multi-week auto-height logic 37817 MonthView.prototype.setGridHeight = function (height, isAuto) { 37818 // if auto, make the height of each row the height that it would be if there were 6 weeks 37819 if (isAuto) { 37820 height *= this.dayGrid.rowCnt / 6; 37821 } 37822 util_1.distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows 37823 }; 37824 MonthView.prototype.isDateInOtherMonth = function (date, dateProfile) { 37825 return date.month() !== moment.utc(dateProfile.currentUnzonedRange.startMs).month(); // TODO: optimize 37826 }; 37827 return MonthView; 37828}(BasicView_1.default)); 37829exports.default = MonthView; 37830MonthView.prototype.dateProfileGeneratorClass = MonthViewDateProfileGenerator_1.default; 37831 37832 37833/***/ }), 37834/* 230 */ 37835/***/ (function(module, exports, __webpack_require__) { 37836 37837Object.defineProperty(exports, "__esModule", { value: true }); 37838var tslib_1 = __webpack_require__(2); 37839var $ = __webpack_require__(3); 37840var util_1 = __webpack_require__(4); 37841var UnzonedRange_1 = __webpack_require__(5); 37842var View_1 = __webpack_require__(41); 37843var Scroller_1 = __webpack_require__(39); 37844var ListEventRenderer_1 = __webpack_require__(254); 37845var ListEventPointing_1 = __webpack_require__(255); 37846/* 37847Responsible for the scroller, and forwarding event-related actions into the "grid". 37848*/ 37849var ListView = /** @class */ (function (_super) { 37850 tslib_1.__extends(ListView, _super); 37851 function ListView(calendar, viewSpec) { 37852 var _this = _super.call(this, calendar, viewSpec) || this; 37853 _this.segSelector = '.fc-list-item'; // which elements accept event actions 37854 _this.scroller = new Scroller_1.default({ 37855 overflowX: 'hidden', 37856 overflowY: 'auto' 37857 }); 37858 return _this; 37859 } 37860 ListView.prototype.renderSkeleton = function () { 37861 this.el.addClass('fc-list-view ' + 37862 this.calendar.theme.getClass('listView')); 37863 this.scroller.render(); 37864 this.scroller.el.appendTo(this.el); 37865 this.contentEl = this.scroller.scrollEl; // shortcut 37866 }; 37867 ListView.prototype.unrenderSkeleton = function () { 37868 this.scroller.destroy(); // will remove the Grid too 37869 }; 37870 ListView.prototype.updateSize = function (totalHeight, isAuto, isResize) { 37871 _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize); 37872 this.scroller.clear(); // sets height to 'auto' and clears overflow 37873 if (!isAuto) { 37874 this.scroller.setHeight(this.computeScrollerHeight(totalHeight)); 37875 } 37876 }; 37877 ListView.prototype.computeScrollerHeight = function (totalHeight) { 37878 return totalHeight -
37879 util_1.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller 37880 }; 37881 ListView.prototype.renderDates = function (dateProfile) { 37882 var calendar = this.calendar; 37883 var dayStart = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, true); 37884 var viewEnd = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.endMs, true); 37885 var dayDates = []; 37886 var dayRanges = []; 37887 while (dayStart < viewEnd) { 37888 dayDates.push(dayStart.clone()); 37889 dayRanges.push(new UnzonedRange_1.default(dayStart, dayStart.clone().add(1, 'day'))); 37890 dayStart.add(1, 'day'); 37891 } 37892 this.dayDates = dayDates; 37893 this.dayRanges = dayRanges; 37894 // all real rendering happens in EventRenderer 37895 }; 37896 // slices by day 37897 ListView.prototype.componentFootprintToSegs = function (footprint) { 37898 var dayRanges = this.dayRanges; 37899 var dayIndex; 37900 var segRange; 37901 var seg; 37902 var segs = []; 37903 for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex++) { 37904 segRange = footprint.unzonedRange.intersect(dayRanges[dayIndex]); 37905 if (segRange) { 37906 seg = { 37907 startMs: segRange.startMs, 37908 endMs: segRange.endMs, 37909 isStart: segRange.isStart, 37910 isEnd: segRange.isEnd, 37911 dayIndex: dayIndex 37912 }; 37913 segs.push(seg); 37914 // detect when footprint won't go fully into the next day, 37915 // and mutate the latest seg to the be the end. 37916 if (!seg.isEnd && !footprint.isAllDay && 37917 dayIndex + 1 < dayRanges.length && 37918 footprint.unzonedRange.endMs < dayRanges[dayIndex + 1].startMs + this.nextDayThreshold) { 37919 seg.endMs = footprint.unzonedRange.endMs; 37920 seg.isEnd = true; 37921 break; 37922 } 37923 } 37924 } 37925 return segs; 37926 }; 37927 ListView.prototype.renderEmptyMessage = function () { 37928 this.contentEl.html('<div class="fc-list-empty-wrap2">' + // TODO: try less wraps 37929 '<div class="fc-list-empty-wrap1">' + 37930 '<div class="fc-list-empty">' + 37931 util_1.htmlEscape(this.opt('noEventsMessage')) + 37932 '</div>' + 37933 '</div>' + 37934 '</div>'); 37935 }; 37936 // render the event segments in the view 37937 ListView.prototype.renderSegList = function (allSegs) { 37938 var segsByDay = this.groupSegsByDay(allSegs); // sparse array 37939 var dayIndex; 37940 var daySegs; 37941 var i; 37942 var tableEl = $('<table class="fc-list-table ' + this.calendar.theme.getClass('tableList') + '"><tbody/></table>'); 37943 var tbodyEl = tableEl.find('tbody'); 37944 for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) { 37945 daySegs = segsByDay[dayIndex]; 37946 if (daySegs) { 37947 // append a day header 37948 tbodyEl.append(this.dayHeaderHtml(this.dayDates[dayIndex])); 37949 this.eventRenderer.sortEventSegs(daySegs); 37950 for (i = 0; i < daySegs.length; i++) { 37951 tbodyEl.append(daySegs[i].el); // append event row 37952 } 37953 } 37954 } 37955 this.contentEl.empty().append(tableEl); 37956 }; 37957 // Returns a sparse array of arrays, segs grouped by their dayIndex 37958 ListView.prototype.groupSegsByDay = function (segs) { 37959 var segsByDay = []; // sparse array 37960 var i; 37961 var seg; 37962 for (i = 0; i < segs.length; i++) { 37963 seg = segs[i]; 37964 (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = [])) 37965 .push(seg); 37966 } 37967 return segsByDay; 37968 }; 37969 // generates the HTML for the day headers that live amongst the event rows 37970 ListView.prototype.dayHeaderHtml = function (dayDate) { 37971 var mainFormat = this.opt('listDayFormat'); 37972 var altFormat = this.opt('listDayAltFormat'); 37973 return '<tr class="fc-list-heading" data-date="' + dayDate.format('YYYY-MM-DD') + '">' + 37974 '<td class="' + (this.calendar.theme.getClass('tableListHeading') || 37975 this.calendar.theme.getClass('widgetHeader')) + '" colspan="3">' + 37976 (mainFormat ? 37977 this.buildGotoAnchorHtml(dayDate, { 'class': 'fc-list-heading-main' }, util_1.htmlEscape(dayDate.format(mainFormat)) // inner HTML 37978 ) : 37979 '') + 37980 (altFormat ? 37981 this.buildGotoAnchorHtml(dayDate, { 'class': 'fc-list-heading-alt' }, util_1.htmlEscape(dayDate.format(altFormat)) // inner HTML 37982 ) : 37983 '') + 37984 '</td>' + 37985 '</tr>'; 37986 }; 37987 return ListView; 37988}(View_1.default)); 37989exports.default = ListView; 37990ListView.prototype.eventRendererClass = ListEventRenderer_1.default; 37991ListView.prototype.eventPointingClass = ListEventPointing_1.default; 37992 37993 37994/***/ }), 37995/* 231 */, 37996/* 232 */, 37997/* 233 */, 37998/* 234 */, 37999/* 235 */, 38000/* 236 */ 38001/***/ (function(module, exports, __webpack_require__) { 38002 38003var $ = __webpack_require__(3);
38004var exportHooks = __webpack_require__(16); 38005var util_1 = __webpack_require__(4); 38006var Calendar_1 = __webpack_require__(220); 38007// for intentional side-effects 38008__webpack_require__(10); 38009__webpack_require__(47); 38010__webpack_require__(256); 38011__webpack_require__(257); 38012__webpack_require__(260); 38013__webpack_require__(261); 38014__webpack_require__(262); 38015__webpack_require__(263); 38016$.fullCalendar = exportHooks; 38017$.fn.fullCalendar = function (options) { 38018 var args = Array.prototype.slice.call(arguments, 1); // for a possible method call 38019 var res = this; // what this function will return (this jQuery object by default) 38020 this.each(function (i, _element) { 38021 var element = $(_element); 38022 var calendar = element.data('fullCalendar'); // get the existing calendar object (if any) 38023 var singleRes; // the returned value of this single method call 38024 // a method call 38025 if (typeof options === 'string') { 38026 if (options === 'getCalendar') { 38027 if (!i) { 38028 res = calendar; 38029 } 38030 } 38031 else if (options === 'destroy') { 38032 if (calendar) { 38033 calendar.destroy(); 38034 element.removeData('fullCalendar'); 38035 } 38036 } 38037 else if (!calendar) { 38038 util_1.warn('Attempting to call a FullCalendar method on an element with no calendar.'); 38039 } 38040 else if ($.isFunction(calendar[options])) { 38041 singleRes = calendar[options].apply(calendar, args); 38042 if (!i) { 38043 res = singleRes; // record the first method call result 38044 } 38045 if (options === 'destroy') { 38046 element.removeData('fullCalendar'); 38047 } 38048 } 38049 else { 38050 util_1.warn("'" + options + "' is an unknown FullCalendar method."); 38051 } 38052 } 38053 else if (!calendar) { 38054 calendar = new Calendar_1.default(element, options); 38055 element.data('fullCalendar', calendar); 38056 calendar.render(); 38057 } 38058 }); 38059 return res; 38060}; 38061module.exports = exportHooks; 38062 38063 38064/***/ }), 38065/* 237 */ 38066/***/ (function(module, exports, __webpack_require__) { 38067 38068Object.defineProperty(exports, "__esModule", { value: true }); 38069var tslib_1 = __webpack_require__(2); 38070var Model_1 = __webpack_require__(48); 38071var Component = /** @class */ (function (_super) { 38072 tslib_1.__extends(Component, _super); 38073 function Component() { 38074 return _super !== null && _super.apply(this, arguments) || this; 38075 } 38076 Component.prototype.setElement = function (el) { 38077 this.el = el; 38078 this.bindGlobalHandlers(); 38079 this.renderSkeleton(); 38080 this.set('isInDom', true); 38081 }; 38082 Component.prototype.removeElement = function () { 38083 this.unset('isInDom'); 38084 this.unrenderSkeleton(); 38085 this.unbindGlobalHandlers(); 38086 this.el.remove(); 38087 // NOTE: don't null-out this.el in case the View was destroyed within an API callback. 38088 // We don't null-out the View's other jQuery element references upon destroy, 38089 // so we shouldn't kill this.el either. 38090 }; 38091 Component.prototype.bindGlobalHandlers = function () { 38092 // subclasses can override 38093 }; 38094 Component.prototype.unbindGlobalHandlers = function () { 38095 // subclasses can override 38096 }; 38097 /* 38098 NOTE: Can't have a `render` method. Read the deprecation notice in View::executeDateRender 38099 */ 38100 // Renders the basic structure of the view before any content is rendered 38101 Component.prototype.renderSkeleton = function () { 38102 // subclasses should implement 38103 }; 38104 // Unrenders the basic structure of the view 38105 Component.prototype.unrenderSkeleton = function () { 38106 // subclasses should implement 38107 }; 38108 return Component; 38109}(Model_1.default)); 38110exports.default = Component; 38111 38112 38113/***/ }), 38114/* 238 */ 38115/***/ (function(module, exports) { 38116 38117Object.defineProperty(exports, "__esModule", { value: true }); 38118var Iterator = /** @class */ (function () { 38119 function Iterator(items) { 38120 this.items = items || []; 38121 } 38122 /* Calls a method on every item passing the arguments through */ 38123 Iterator.prototype.proxyCall = function (methodName) { 38124 var args = []; 38125 for (var _i = 1; _i < arguments.length; _i++) { 38126 args[_i - 1] = arguments[_i]; 38127 } 38128 var results = [];
38129 this.items.forEach(function (item) { 38130 results.push(item[methodName].apply(item, args)); 38131 }); 38132 return results; 38133 }; 38134 return Iterator; 38135}()); 38136exports.default = Iterator; 38137 38138 38139/***/ }), 38140/* 239 */ 38141/***/ (function(module, exports, __webpack_require__) { 38142 38143Object.defineProperty(exports, "__esModule", { value: true }); 38144var $ = __webpack_require__(3); 38145var util_1 = __webpack_require__(4); 38146/* Toolbar with buttons and title 38147----------------------------------------------------------------------------------------------------------------------*/ 38148var Toolbar = /** @class */ (function () { 38149 function Toolbar(calendar, toolbarOptions) { 38150 this.el = null; // mirrors local `el` 38151 this.viewsWithButtons = []; 38152 this.calendar = calendar; 38153 this.toolbarOptions = toolbarOptions; 38154 } 38155 // method to update toolbar-specific options, not calendar-wide options 38156 Toolbar.prototype.setToolbarOptions = function (newToolbarOptions) { 38157 this.toolbarOptions = newToolbarOptions; 38158 }; 38159 // can be called repeatedly and will rerender 38160 Toolbar.prototype.render = function () { 38161 var sections = this.toolbarOptions.layout; 38162 var el = this.el; 38163 if (sections) { 38164 if (!el) { 38165 el = this.el = $("<div class='fc-toolbar " + this.toolbarOptions.extraClasses + "'/>"); 38166 } 38167 else { 38168 el.empty(); 38169 } 38170 el.append(this.renderSection('left')) 38171 .append(this.renderSection('right')) 38172 .append(this.renderSection('center')) 38173 .append('<div class="fc-clear"/>'); 38174 } 38175 else { 38176 this.removeElement(); 38177 } 38178 }; 38179 Toolbar.prototype.removeElement = function () { 38180 if (this.el) { 38181 this.el.remove(); 38182 this.el = null; 38183 } 38184 }; 38185 Toolbar.prototype.renderSection = function (position) { 38186 var _this = this; 38187 var calendar = this.calendar; 38188 var theme = calendar.theme; 38189 var optionsManager = calendar.optionsManager; 38190 var viewSpecManager = calendar.viewSpecManager; 38191 var sectionEl = $('<div class="fc-' + position + '"/>'); 38192 var buttonStr = this.toolbarOptions.layout[position]; 38193 var calendarCustomButtons = optionsManager.get('customButtons') || {}; 38194 var calendarButtonTextOverrides = optionsManager.overrides.buttonText || {}; 38195 var calendarButtonText = optionsManager.get('buttonText') || {}; 38196 if (buttonStr) { 38197 $.each(buttonStr.split(' '), function (i, buttonGroupStr) { 38198 var groupChildren = $(); 38199 var isOnlyButtons = true; 38200 var groupEl; 38201 $.each(buttonGroupStr.split(','), function (j, buttonName) { 38202 var customButtonProps; 38203 var viewSpec; 38204 var buttonClick; 38205 var buttonIcon; // only one of these will be set 38206 var buttonText; // " 38207 var buttonInnerHtml; 38208 var buttonClasses; 38209 var buttonEl; 38210 var buttonAriaAttr; 38211 if (buttonName === 'title') { 38212 groupChildren = groupChildren.add($('<h2> </h2>')); // we always want it to take up height 38213 isOnlyButtons = false; 38214 } 38215 else { 38216 if ((customButtonProps = calendarCustomButtons[buttonName])) { 38217 buttonClick = function (ev) { 38218 if (customButtonProps.click) { 38219 customButtonProps.click.call(buttonEl[0], ev); 38220 } 38221 }; 38222 (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) || 38223 (buttonIcon = theme.getIconClass(buttonName)) || 38224 (buttonText = customButtonProps.text); 38225 } 38226 else if ((viewSpec = viewSpecManager.getViewSpec(buttonName))) { 38227 _this.viewsWithButtons.push(buttonName); 38228 buttonClick = function () { 38229 calendar.changeView(buttonName); 38230 }; 38231 (buttonText = viewSpec.buttonTextOverride) || 38232 (buttonIcon = theme.getIconClass(buttonName)) || 38233 (buttonText = viewSpec.buttonTextDefault); 38234 } 38235 else if (calendar[buttonName]) { 38236 buttonClick = function () { 38237 calendar[buttonName](); 38238 }; 38239 (buttonText = calendarButtonTextOverrides[buttonName]) || 38240 (buttonIcon = theme.getIconClass(buttonName)) || 38241 (buttonText = calendarButtonText[buttonName]); 38242 // ^ everything else is considered default 38243 } 38244 if (buttonClick) {
38245 buttonClasses = [ 38246 'fc-' + buttonName + '-button', 38247 theme.getClass('button'), 38248 theme.getClass('stateDefault') 38249 ]; 38250 if (buttonText) { 38251 buttonInnerHtml = util_1.htmlEscape(buttonText); 38252 buttonAriaAttr = ''; 38253 } 38254 else if (buttonIcon) { 38255 buttonInnerHtml = "<span class='" + buttonIcon + "'></span>"; 38256 buttonAriaAttr = ' aria-label="' + buttonName + '"'; 38257 } 38258 buttonEl = $(// type="button" so that it doesn't submit a form 38259 '<button type="button" class="' + buttonClasses.join(' ') + '"' + 38260 buttonAriaAttr + 38261 '>' + buttonInnerHtml + '</button>') 38262 .click(function (ev) { 38263 // don't process clicks for disabled buttons 38264 if (!buttonEl.hasClass(theme.getClass('stateDisabled'))) { 38265 buttonClick(ev); 38266 // after the click action, if the button becomes the "active" tab, or disabled, 38267 // it should never have a hover class, so remove it now. 38268 if (buttonEl.hasClass(theme.getClass('stateActive')) || 38269 buttonEl.hasClass(theme.getClass('stateDisabled'))) { 38270 buttonEl.removeClass(theme.getClass('stateHover')); 38271 } 38272 } 38273 }) 38274 .mousedown(function () { 38275 // the *down* effect (mouse pressed in). 38276 // only on buttons that are not the "active" tab, or disabled 38277 buttonEl 38278 .not('.' + theme.getClass('stateActive')) 38279 .not('.' + theme.getClass('stateDisabled')) 38280 .addClass(theme.getClass('stateDown')); 38281 }) 38282 .mouseup(function () { 38283 // undo the *down* effect 38284 buttonEl.removeClass(theme.getClass('stateDown')); 38285 }) 38286 .hover(function () { 38287 // the *hover* effect. 38288 // only on buttons that are not the "active" tab, or disabled 38289 buttonEl 38290 .not('.' + theme.getClass('stateActive')) 38291 .not('.' + theme.getClass('stateDisabled')) 38292 .addClass(theme.getClass('stateHover')); 38293 }, function () { 38294 // undo the *hover* effect 38295 buttonEl 38296 .removeClass(theme.getClass('stateHover')) 38297 .removeClass(theme.getClass('stateDown')); // if mouseleave happens before mouseup 38298 }); 38299 groupChildren = groupChildren.add(buttonEl); 38300 } 38301 } 38302 }); 38303 if (isOnlyButtons) { 38304 groupChildren 38305 .first().addClass(theme.getClass('cornerLeft')).end() 38306 .last().addClass(theme.getClass('cornerRight')).end(); 38307 } 38308 if (groupChildren.length > 1) { 38309 groupEl = $('<div/>'); 38310 if (isOnlyButtons) { 38311 groupEl.addClass(theme.getClass('buttonGroup')); 38312 } 38313 groupEl.append(groupChildren); 38314 sectionEl.append(groupEl); 38315 } 38316 else { 38317 sectionEl.append(groupChildren); // 1 or 0 children 38318 } 38319 }); 38320 } 38321 return sectionEl; 38322 }; 38323 Toolbar.prototype.updateTitle = function (text) { 38324 if (this.el) { 38325 this.el.find('h2').text(text); 38326 } 38327 }; 38328 Toolbar.prototype.activateButton = function (buttonName) { 38329 if (this.el) { 38330 this.el.find('.fc-' + buttonName + '-button') 38331 .addClass(this.calendar.theme.getClass('stateActive')); 38332 } 38333 }; 38334 Toolbar.prototype.deactivateButton = function (buttonName) { 38335 if (this.el) { 38336 this.el.find('.fc-' + buttonName + '-button') 38337 .removeClass(this.calendar.theme.getClass('stateActive')); 38338 } 38339 }; 38340 Toolbar.prototype.disableButton = function (buttonName) { 38341 if (this.el) { 38342 this.el.find('.fc-' + buttonName + '-button') 38343 .prop('disabled', true) 38344 .addClass(this.calendar.theme.getClass('stateDisabled')); 38345 } 38346 }; 38347 Toolbar.prototype.enableButton = function (buttonName) { 38348 if (this.el) { 38349 this.el.find('.fc-' + buttonName + '-button') 38350 .prop('disabled', false) 38351 .removeClass(this.calendar.theme.getClass('stateDisabled')); 38352 } 38353 }; 38354 Toolbar.prototype.getViewsWithButtons = function () { 38355 return this.viewsWithButtons; 38356 }; 38357 return Toolbar; 38358}()); 38359exports.default = Toolbar; 38360 38361 38362/***/ }), 38363/* 240 */ 38364/***/ (function(module, exports, __webpack_require__) { 38365 38366Object.defineProperty(exports, "__esModule", { value: true }); 38367var tslib_1 = __webpack_require__(2); 38368var $ = __webpack_require__(3); 38369var util_1 = __webpack_require__(4); 38370var options_1 = __webpack_require__(32); 38371var locale_1 = __webpack_require__(31); 38372var Model_1 = __webpack_require__(48); 38373var OptionsManager = /** @class */ (function (_super) { 38374 tslib_1.__extends(OptionsManager, _super); 38375 function OptionsManager(_calendar, overrides) { 38376 var _this = _super.call(this) || this; 38377 _this._calendar = _calendar; 38378 _this.overrides = $.extend({}, overrides); // make a copy 38379 _this.dynamicOverrides = {}; 38380 _this.compute(); 38381 return _this; 38382 } 38383 OptionsManager.prototype.add = function (newOptionHash) { 38384 var optionCnt = 0; 38385 var optionName; 38386 this.recordOverrides(newOptionHash); // will trigger this model's watchers 38387 for (optionName in newOptionHash) { 38388 optionCnt++; 38389 } 38390 // special-case handling of single option change. 38391 // if only one option change, `optionName` will be its name. 38392 if (optionCnt === 1) { 38393 if (optionName === 'height' || optionName === 'contentHeight' || optionName === 'aspectRatio') { 38394 this._calendar.updateViewSize(true); // isResize=true 38395 return; 38396 } 38397 else if (optionName === 'defaultDate') { 38398 return; // can't change date this way. use gotoDate instead 38399 } 38400 else if (optionName === 'businessHours') { 38401 return; // this model already reacts to this 38402 } 38403 else if (/^(event|select)(Overlap|Constraint|Allow)$/.test(optionName)) { 38404 return; // doesn't affect rendering. only interactions. 38405 } 38406 else if (optionName === 'timezone') { 38407 this._calendar.view.flash('initialEvents'); 38408 return; 38409 } 38410 } 38411 // catch-all. rerender the header and footer and rebuild/rerender the current view 38412 this._calendar.renderHeader(); 38413 this._calendar.renderFooter(); 38414 // even non-current views will be affected by this option change. do before rerender 38415 // TODO: detangle 38416 this._calendar.viewsByType = {}; 38417 this._calendar.reinitView(); 38418 }; 38419 // Computes the flattened options hash for the calendar and assigns to `this.options`. 38420 // Assumes this.overrides and this.dynamicOverrides have already been initialized. 38421 OptionsManager.prototype.compute = function () { 38422 var locale; 38423 var localeDefaults; 38424 var isRTL; 38425 var dirDefaults; 38426 var rawOptions; 38427 locale = util_1.firstDefined(// explicit locale option given? 38428 this.dynamicOverrides.locale, this.overrides.locale); 38429 localeDefaults = locale_1.localeOptionHash[locale]; 38430 if (!localeDefaults) { 38431 locale = options_1.globalDefaults.locale; 38432 localeDefaults = locale_1.localeOptionHash[locale] || {}; 38433 } 38434 isRTL = util_1.firstDefined(// based on options computed so far, is direction RTL? 38435 this.dynamicOverrides.isRTL, this.overrides.isRTL, localeDefaults.isRTL, options_1.globalDefaults.isRTL); 38436 dirDefaults = isRTL ? options_1.rtlDefaults : {}; 38437 this.dirDefaults = dirDefaults; 38438 this.localeDefaults = localeDefaults; 38439 rawOptions = options_1.mergeOptions([ 38440 options_1.globalDefaults, 38441 dirDefaults, 38442 localeDefaults, 38443 this.overrides, 38444 this.dynamicOverrides 38445 ]); 38446 locale_1.populateInstanceComputableOptions(rawOptions); // fill in gaps with computed options 38447 this.reset(rawOptions); 38448 }; 38449 // stores the new options internally, but does not rerender anything. 38450 OptionsManager.prototype.recordOverrides = function (newOptionHash) { 38451 var optionName; 38452 for (optionName in newOptionHash) { 38453 this.dynamicOverrides[optionName] = newOptionHash[optionName]; 38454 } 38455 this._calendar.viewSpecManager.clearCache(); // the dynamic override invalidates the options in this cache, so just clear it 38456 this.compute(); // this.options needs to be recomputed after the dynamic override 38457 }; 38458 return OptionsManager; 38459}(Model_1.default)); 38460exports.default = OptionsManager; 38461 38462 38463/***/ }), 38464/* 241 */ 38465/***/ (function(module, exports, __webpack_require__) { 38466 38467Object.defineProperty(exports, "__esModule", { value: true }); 38468var moment = __webpack_require__(0); 38469var $ = __webpack_require__(3); 38470var ViewRegistry_1 = __webpack_require__(22); 38471var util_1 = __webpack_require__(4); 38472var options_1 = __webpack_require__(32); 38473var locale_1 = __webpack_require__(31); 38474var ViewSpecManager = /** @class */ (function () { 38475 function ViewSpecManager(optionsManager, _calendar) { 38476 this.optionsManager = optionsManager; 38477 this._calendar = _calendar; 38478 this.clearCache(); 38479 } 38480 ViewSpecManager.prototype.clearCache = function () { 38481 this.viewSpecCache = {}; 38482 }; 38483 // Gets information about how to create a view. Will use a cache. 38484 ViewSpecManager.prototype.getViewSpec = function (viewType) { 38485 var cache = this.viewSpecCache; 38486 return cache[viewType] || (cache[viewType] = this.buildViewSpec(viewType)); 38487 }; 38488 // Given a duration singular unit, like "week" or "day", finds a matching view spec. 38489 // Preference is given to views that have corresponding buttons. 38490 ViewSpecManager.prototype.getUnitViewSpec = function (unit) { 38491 var viewTypes; 38492 var i; 38493 var spec; 38494 if ($.inArray(unit, util_1.unitsDesc) !== -1) { 38495 // put views that have buttons first. there will be duplicates, but oh well 38496 viewTypes = this._calendar.header.getViewsWithButtons(); // TODO: include footer as well? 38497 $.each(ViewRegistry_1.viewHash, function (viewType) { 38498 viewTypes.push(viewType); 38499 }); 38500 for (i = 0; i < viewTypes.length; i++) { 38501 spec = this.getViewSpec(viewTypes[i]); 38502 if (spec) { 38503 if (spec.singleUnit === unit) { 38504 return spec; 38505 } 38506 } 38507 } 38508 } 38509 }; 38510 // Builds an object with information on how to create a given view 38511 ViewSpecManager.prototype.buildViewSpec = function (requestedViewType) { 38512 var viewOverrides = this.optionsManager.overrides.views || {}; 38513 var specChain = []; // for the view. lowest to highest priority 38514 var defaultsChain = []; // for the view. lowest to highest priority 38515 var overridesChain = []; // for the view. lowest to highest priority 38516 var viewType = requestedViewType; 38517 var spec; // for the view 38518 var overrides; // for the view 38519 var durationInput; 38520 var duration; 38521 var unit; 38522 // iterate from the specific view definition to a more general one until we hit an actual View class 38523 while (viewType) {
38524 spec = ViewRegistry_1.viewHash[viewType]; 38525 overrides = viewOverrides[viewType]; 38526 viewType = null; // clear. might repopulate for another iteration 38527 if (typeof spec === 'function') { 38528 spec = { 'class': spec }; 38529 } 38530 if (spec) { 38531 specChain.unshift(spec); 38532 defaultsChain.unshift(spec.defaults || {}); 38533 durationInput = durationInput || spec.duration; 38534 viewType = viewType || spec.type; 38535 } 38536 if (overrides) { 38537 overridesChain.unshift(overrides); // view-specific option hashes have options at zero-level 38538 durationInput = durationInput || overrides.duration; 38539 viewType = viewType || overrides.type; 38540 } 38541 } 38542 spec = util_1.mergeProps(specChain); 38543 spec.type = requestedViewType; 38544 if (!spec['class']) { 38545 return false; 38546 } 38547 // fall back to top-level `duration` option 38548 durationInput = durationInput || 38549 this.optionsManager.dynamicOverrides.duration || 38550 this.optionsManager.overrides.duration; 38551 if (durationInput) { 38552 duration = moment.duration(durationInput); 38553 if (duration.valueOf()) { 38554 unit = util_1.computeDurationGreatestUnit(duration, durationInput); 38555 spec.duration = duration; 38556 spec.durationUnit = unit; 38557 // view is a single-unit duration, like "week" or "day" 38558 // incorporate options for this. lowest priority 38559 if (duration.as(unit) === 1) { 38560 spec.singleUnit = unit; 38561 overridesChain.unshift(viewOverrides[unit] || {}); 38562 } 38563 } 38564 } 38565 spec.defaults = options_1.mergeOptions(defaultsChain); 38566 spec.overrides = options_1.mergeOptions(overridesChain); 38567 this.buildViewSpecOptions(spec); 38568 this.buildViewSpecButtonText(spec, requestedViewType); 38569 return spec; 38570 }; 38571 // Builds and assigns a view spec's options object from its already-assigned defaults and overrides 38572 ViewSpecManager.prototype.buildViewSpecOptions = function (spec) { 38573 var optionsManager = this.optionsManager; 38574 spec.options = options_1.mergeOptions([ 38575 options_1.globalDefaults, 38576 spec.defaults, 38577 optionsManager.dirDefaults, 38578 optionsManager.localeDefaults, 38579 optionsManager.overrides, 38580 spec.overrides, 38581 optionsManager.dynamicOverrides // dynamically set via setter. highest precedence 38582 ]); 38583 locale_1.populateInstanceComputableOptions(spec.options); 38584 }; 38585 // Computes and assigns a view spec's buttonText-related options 38586 ViewSpecManager.prototype.buildViewSpecButtonText = function (spec, requestedViewType) { 38587 var optionsManager = this.optionsManager; 38588 // given an options object with a possible `buttonText` hash, lookup the buttonText for the 38589 // requested view, falling back to a generic unit entry like "week" or "day" 38590 function queryButtonText(options) { 38591 var buttonText = options.buttonText || {}; 38592 return buttonText[requestedViewType] || 38593 // view can decide to look up a certain key 38594 (spec.buttonTextKey ? buttonText[spec.buttonTextKey] : null) || 38595 // a key like "month" 38596 (spec.singleUnit ? buttonText[spec.singleUnit] : null); 38597 } 38598 // highest to lowest priority 38599 spec.buttonTextOverride = 38600 queryButtonText(optionsManager.dynamicOverrides) || 38601 queryButtonText(optionsManager.overrides) || // constructor-specified buttonText lookup hash takes precedence 38602 spec.overrides.buttonText; // `buttonText` for view-specific options is a string 38603 // highest to lowest priority. mirrors buildViewSpecOptions 38604 spec.buttonTextDefault = 38605 queryButtonText(optionsManager.localeDefaults) || 38606 queryButtonText(optionsManager.dirDefaults) ||
38607 spec.defaults.buttonText || // a single string. from ViewSubclass.defaults 38608 queryButtonText(options_1.globalDefaults) || 38609 (spec.duration ? this._calendar.humanizeDuration(spec.duration) : null) || // like "3 days" 38610 requestedViewType; // fall back to given view name 38611 }; 38612 return ViewSpecManager; 38613}()); 38614exports.default = ViewSpecManager; 38615 38616 38617/***/ }), 38618/* 242 */ 38619/***/ (function(module, exports, __webpack_require__) { 38620 38621Object.defineProperty(exports, "__esModule", { value: true }); 38622var $ = __webpack_require__(3); 38623var util_1 = __webpack_require__(4); 38624var EventPeriod_1 = __webpack_require__(243); 38625var ArrayEventSource_1 = __webpack_require__(52); 38626var EventSource_1 = __webpack_require__(6); 38627var EventSourceParser_1 = __webpack_require__(38); 38628var SingleEventDef_1 = __webpack_require__(13); 38629var EventInstanceGroup_1 = __webpack_require__(18); 38630var EmitterMixin_1 = __webpack_require__(11); 38631var ListenerMixin_1 = __webpack_require__(7); 38632var EventManager = /** @class */ (function () { 38633 function EventManager(calendar) { 38634 this.calendar = calendar; 38635 this.stickySource = new ArrayEventSource_1.default(calendar); 38636 this.otherSources = []; 38637 } 38638 EventManager.prototype.requestEvents = function (start, end, timezone, force) { 38639 if (force || 38640 !this.currentPeriod || 38641 !this.currentPeriod.isWithinRange(start, end) || 38642 timezone !== this.currentPeriod.timezone) { 38643 this.setPeriod(// will change this.currentPeriod 38644 new EventPeriod_1.default(start, end, timezone)); 38645 } 38646 return this.currentPeriod.whenReleased(); 38647 }; 38648 // Source Adding/Removing 38649 // ----------------------------------------------------------------------------------------------------------------- 38650 EventManager.prototype.addSource = function (eventSource) { 38651 this.otherSources.push(eventSource); 38652 if (this.currentPeriod) { 38653 this.currentPeriod.requestSource(eventSource); // might release 38654 } 38655 }; 38656 EventManager.prototype.removeSource = function (doomedSource) { 38657 util_1.removeExact(this.otherSources, doomedSource); 38658 if (this.currentPeriod) { 38659 this.currentPeriod.purgeSource(doomedSource); // might release 38660 } 38661 }; 38662 EventManager.prototype.removeAllSources = function () { 38663 this.otherSources = []; 38664 if (this.currentPeriod) { 38665 this.currentPeriod.purgeAllSources(); // might release 38666 } 38667 }; 38668 // Source Refetching 38669 // ----------------------------------------------------------------------------------------------------------------- 38670 EventManager.prototype.refetchSource = function (eventSource) { 38671 var currentPeriod = this.currentPeriod; 38672 if (currentPeriod) { 38673 currentPeriod.freeze(); 38674 currentPeriod.purgeSource(eventSource); 38675 currentPeriod.requestSource(eventSource); 38676 currentPeriod.thaw(); 38677 } 38678 }; 38679 EventManager.prototype.refetchAllSources = function () { 38680 var currentPeriod = this.currentPeriod; 38681 if (currentPeriod) { 38682 currentPeriod.freeze(); 38683 currentPeriod.purgeAllSources(); 38684 currentPeriod.requestSources(this.getSources()); 38685 currentPeriod.thaw(); 38686 } 38687 }; 38688 // Source Querying 38689 // ----------------------------------------------------------------------------------------------------------------- 38690 EventManager.prototype.getSources = function () { 38691 return [this.stickySource].concat(this.otherSources); 38692 }; 38693 // like querySources, but accepts multple match criteria (like multiple IDs) 38694 EventManager.prototype.multiQuerySources = function (matchInputs) { 38695 // coerce into an array 38696 if (!matchInputs) { 38697 matchInputs = []; 38698 } 38699 else if (!$.isArray(matchInputs)) { 38700 matchInputs = [matchInputs]; 38701 } 38702 var matchingSources = []; 38703 var i; 38704 // resolve raw inputs to real event source objects 38705 for (i = 0; i < matchInputs.length; i++) { 38706 matchingSources.push.apply(// append 38707 matchingSources, this.querySources(matchInputs[i])); 38708 } 38709 return matchingSources; 38710 }; 38711 // matchInput can either by a real event source object, an ID, or the function/URL for the source. 38712 // returns an array of matching source objects. 38713 EventManager.prototype.querySources = function (matchInput) { 38714 var sources = this.otherSources; 38715 var i; 38716 var source; 38717 // given a proper event source object 38718 for (i = 0; i < sources.length; i++) { 38719 source = sources[i]; 38720 if (source === matchInput) { 38721 return [source]; 38722 } 38723 } 38724 // an ID match
38725 source = this.getSourceById(EventSource_1.default.normalizeId(matchInput)); 38726 if (source) { 38727 return [source]; 38728 } 38729 // parse as an event source 38730 matchInput = EventSourceParser_1.default.parse(matchInput, this.calendar); 38731 if (matchInput) { 38732 return $.grep(sources, function (source) { 38733 return isSourcesEquivalent(matchInput, source); 38734 }); 38735 } 38736 }; 38737 /* 38738 ID assumed to already be normalized 38739 */ 38740 EventManager.prototype.getSourceById = function (id) { 38741 return $.grep(this.otherSources, function (source) { 38742 return source.id && source.id === id; 38743 })[0]; 38744 }; 38745 // Event-Period 38746 // ----------------------------------------------------------------------------------------------------------------- 38747 EventManager.prototype.setPeriod = function (eventPeriod) { 38748 if (this.currentPeriod) { 38749 this.unbindPeriod(this.currentPeriod); 38750 this.currentPeriod = null; 38751 } 38752 this.currentPeriod = eventPeriod; 38753 this.bindPeriod(eventPeriod); 38754 eventPeriod.requestSources(this.getSources()); 38755 }; 38756 EventManager.prototype.bindPeriod = function (eventPeriod) { 38757 this.listenTo(eventPeriod, 'release', function (eventsPayload) { 38758 this.trigger('release', eventsPayload); 38759 }); 38760 }; 38761 EventManager.prototype.unbindPeriod = function (eventPeriod) { 38762 this.stopListeningTo(eventPeriod); 38763 }; 38764 // Event Getting/Adding/Removing 38765 // ----------------------------------------------------------------------------------------------------------------- 38766 EventManager.prototype.getEventDefByUid = function (uid) { 38767 if (this.currentPeriod) { 38768 return this.currentPeriod.getEventDefByUid(uid); 38769 } 38770 }; 38771 EventManager.prototype.addEventDef = function (eventDef, isSticky) { 38772 if (isSticky) { 38773 this.stickySource.addEventDef(eventDef); 38774 } 38775 if (this.currentPeriod) { 38776 this.currentPeriod.addEventDef(eventDef); // might release 38777 } 38778 }; 38779 EventManager.prototype.removeEventDefsById = function (eventId) {
38780 this.getSources().forEach(function (eventSource) { 38781 eventSource.removeEventDefsById(eventId); 38782 }); 38783 if (this.currentPeriod) { 38784 this.currentPeriod.removeEventDefsById(eventId); // might release 38785 } 38786 }; 38787 EventManager.prototype.removeAllEventDefs = function () { 38788 this.getSources().forEach(function (eventSource) { 38789 eventSource.removeAllEventDefs(); 38790 }); 38791 if (this.currentPeriod) { 38792 this.currentPeriod.removeAllEventDefs(); 38793 } 38794 }; 38795 // Event Mutating 38796 // ----------------------------------------------------------------------------------------------------------------- 38797 /* 38798 Returns an undo function. 38799 */ 38800 EventManager.prototype.mutateEventsWithId = function (eventDefId, eventDefMutation) { 38801 var currentPeriod = this.currentPeriod; 38802 var eventDefs; 38803 var undoFuncs = []; 38804 if (currentPeriod) { 38805 currentPeriod.freeze(); 38806 eventDefs = currentPeriod.getEventDefsById(eventDefId); 38807 eventDefs.forEach(function (eventDef) { 38808 // add/remove esp because id might change 38809 currentPeriod.removeEventDef(eventDef); 38810 undoFuncs.push(eventDefMutation.mutateSingle(eventDef)); 38811 currentPeriod.addEventDef(eventDef); 38812 }); 38813 currentPeriod.thaw(); 38814 return function () { 38815 currentPeriod.freeze(); 38816 for (var i = 0; i < eventDefs.length; i++) { 38817 currentPeriod.removeEventDef(eventDefs[i]); 38818 undoFuncs[i](); 38819 currentPeriod.addEventDef(eventDefs[i]); 38820 } 38821 currentPeriod.thaw(); 38822 }; 38823 } 38824 return function () { }; 38825 }; 38826 /* 38827 copies and then mutates 38828 */ 38829 EventManager.prototype.buildMutatedEventInstanceGroup = function (eventDefId, eventDefMutation) { 38830 var eventDefs = this.getEventDefsById(eventDefId); 38831 var i; 38832 var defCopy; 38833 var allInstances = []; 38834 for (i = 0; i < eventDefs.length; i++) { 38835 defCopy = eventDefs[i].clone(); 38836 if (defCopy instanceof SingleEventDef_1.default) { 38837 eventDefMutation.mutateSingle(defCopy); 38838 allInstances.push.apply(allInstances, // append 38839 defCopy.buildInstances()); 38840 } 38841 } 38842 return new EventInstanceGroup_1.default(allInstances); 38843 }; 38844 // Freezing 38845 // ----------------------------------------------------------------------------------------------------------------- 38846 EventManager.prototype.freeze = function () { 38847 if (this.currentPeriod) { 38848 this.currentPeriod.freeze(); 38849 } 38850 }; 38851 EventManager.prototype.thaw = function () { 38852 if (this.currentPeriod) { 38853 this.currentPeriod.thaw(); 38854 } 38855 }; 38856 // methods that simply forward to EventPeriod 38857 EventManager.prototype.getEventDefsById = function (eventDefId) { 38858 return this.currentPeriod.getEventDefsById(eventDefId); 38859 }; 38860 EventManager.prototype.getEventInstances = function () { 38861 return this.currentPeriod.getEventInstances(); 38862 }; 38863 EventManager.prototype.getEventInstancesWithId = function (eventDefId) { 38864 return this.currentPeriod.getEventInstancesWithId(eventDefId); 38865 }; 38866 EventManager.prototype.getEventInstancesWithoutId = function (eventDefId) { 38867 return this.currentPeriod.getEventInstancesWithoutId(eventDefId); 38868 }; 38869 return EventManager; 38870}()); 38871exports.default = EventManager; 38872EmitterMixin_1.default.mixInto(EventManager); 38873ListenerMixin_1.default.mixInto(EventManager); 38874function isSourcesEquivalent(source0, source1) { 38875 return source0.getPrimitive() === source1.getPrimitive(); 38876} 38877 38878 38879/***/ }), 38880/* 243 */ 38881/***/ (function(module, exports, __webpack_require__) { 38882 38883Object.defineProperty(exports, "__esModule", { value: true }); 38884var $ = __webpack_require__(3); 38885var util_1 = __webpack_require__(4); 38886var Promise_1 = __webpack_require__(20); 38887var EmitterMixin_1 = __webpack_require__(11); 38888var UnzonedRange_1 = __webpack_require__(5); 38889var EventInstanceGroup_1 = __webpack_require__(18); 38890var EventPeriod = /** @class */ (function () { 38891 function EventPeriod(start, end, timezone) { 38892 this.pendingCnt = 0; 38893 this.freezeDepth = 0; 38894 this.stuntedReleaseCnt = 0; 38895 this.releaseCnt = 0; 38896 this.start = start; 38897 this.end = end; 38898 this.timezone = timezone; 38899 this.unzonedRange = new UnzonedRange_1.default(start.clone().stripZone(), end.clone().stripZone()); 38900 this.requestsByUid = {}; 38901 this.eventDefsByUid = {}; 38902 this.eventDefsById = {}; 38903 this.eventInstanceGroupsById = {}; 38904 } 38905 EventPeriod.prototype.isWithinRange = function (start, end) { 38906 // TODO: use a range util function? 38907 return !start.isBefore(this.start) && !end.isAfter(this.end); 38908 }; 38909 // Requesting and Purging 38910 // ----------------------------------------------------------------------------------------------------------------- 38911 EventPeriod.prototype.requestSources = function (sources) { 38912 this.freeze(); 38913 for (var i = 0; i < sources.length; i++) { 38914 this.requestSource(sources[i]); 38915 } 38916 this.thaw(); 38917 }; 38918 EventPeriod.prototype.requestSource = function (source) { 38919 var _this = this; 38920 var request = { source: source, status: 'pending', eventDefs: null }; 38921 this.requestsByUid[source.uid] = request; 38922 this.pendingCnt += 1; 38923 source.fetch(this.start, this.end, this.timezone).then(function (eventDefs) { 38924 if (request.status !== 'cancelled') { 38925 request.status = 'completed'; 38926 request.eventDefs = eventDefs; 38927 _this.addEventDefs(eventDefs); 38928 _this.pendingCnt--; 38929 _this.tryRelease(); 38930 } 38931 }, function () { 38932 if (request.status !== 'cancelled') { 38933 request.status = 'failed'; 38934 _this.pendingCnt--; 38935 _this.tryRelease(); 38936 } 38937 }); 38938 }; 38939 EventPeriod.prototype.purgeSource = function (source) { 38940 var request = this.requestsByUid[source.uid]; 38941 if (request) { 38942 delete this.requestsByUid[source.uid]; 38943 if (request.status === 'pending') { 38944 request.status = 'cancelled'; 38945 this.pendingCnt--; 38946 this.tryRelease(); 38947 } 38948 else if (request.status === 'completed') {
38949 request.eventDefs.forEach(this.removeEventDef.bind(this)); 38950 } 38951 } 38952 }; 38953 EventPeriod.prototype.purgeAllSources = function () { 38954 var requestsByUid = this.requestsByUid; 38955 var uid; 38956 var request; 38957 var completedCnt = 0; 38958 for (uid in requestsByUid) { 38959 request = requestsByUid[uid]; 38960 if (request.status === 'pending') { 38961 request.status = 'cancelled'; 38962 } 38963 else if (request.status === 'completed') { 38964 completedCnt++; 38965 } 38966 } 38967 this.requestsByUid = {}; 38968 this.pendingCnt = 0; 38969 if (completedCnt) { 38970 this.removeAllEventDefs(); // might release 38971 } 38972 }; 38973 // Event Definitions 38974 // ----------------------------------------------------------------------------------------------------------------- 38975 EventPeriod.prototype.getEventDefByUid = function (eventDefUid) { 38976 return this.eventDefsByUid[eventDefUid]; 38977 }; 38978 EventPeriod.prototype.getEventDefsById = function (eventDefId) { 38979 var a = this.eventDefsById[eventDefId]; 38980 if (a) { 38981 return a.slice(); // clone 38982 } 38983 return []; 38984 }; 38985 EventPeriod.prototype.addEventDefs = function (eventDefs) { 38986 for (var i = 0; i < eventDefs.length; i++) { 38987 this.addEventDef(eventDefs[i]); 38988 } 38989 }; 38990 EventPeriod.prototype.addEventDef = function (eventDef) { 38991 var eventDefsById = this.eventDefsById; 38992 var eventDefId = eventDef.id; 38993 var eventDefs = eventDefsById[eventDefId] || (eventDefsById[eventDefId] = []); 38994 var eventInstances = eventDef.buildInstances(this.unzonedRange); 38995 var i; 38996 eventDefs.push(eventDef); 38997 this.eventDefsByUid[eventDef.uid] = eventDef; 38998 for (i = 0; i < eventInstances.length; i++) { 38999 this.addEventInstance(eventInstances[i], eventDefId); 39000 } 39001 }; 39002 EventPeriod.prototype.removeEventDefsById = function (eventDefId) { 39003 var _this = this; 39004 this.getEventDefsById(eventDefId).forEach(function (eventDef) { 39005 _this.removeEventDef(eventDef); 39006 }); 39007 }; 39008 EventPeriod.prototype.removeAllEventDefs = function () { 39009 var isEmpty = $.isEmptyObject(this.eventDefsByUid); 39010 this.eventDefsByUid = {}; 39011 this.eventDefsById = {}; 39012 this.eventInstanceGroupsById = {}; 39013 if (!isEmpty) { 39014 this.tryRelease(); 39015 } 39016 }; 39017 EventPeriod.prototype.removeEventDef = function (eventDef) { 39018 var eventDefsById = this.eventDefsById; 39019 var eventDefs = eventDefsById[eventDef.id]; 39020 delete this.eventDefsByUid[eventDef.uid]; 39021 if (eventDefs) { 39022 util_1.removeExact(eventDefs, eventDef); 39023 if (!eventDefs.length) { 39024 delete eventDefsById[eventDef.id]; 39025 } 39026 this.removeEventInstancesForDef(eventDef); 39027 } 39028 }; 39029 // Event Instances 39030 // ----------------------------------------------------------------------------------------------------------------- 39031 EventPeriod.prototype.getEventInstances = function () { 39032 var eventInstanceGroupsById = this.eventInstanceGroupsById; 39033 var eventInstances = []; 39034 var id; 39035 for (id in eventInstanceGroupsById) { 39036 eventInstances.push.apply(eventInstances, // append 39037 eventInstanceGroupsById[id].eventInstances); 39038 } 39039 return eventInstances; 39040 }; 39041 EventPeriod.prototype.getEventInstancesWithId = function (eventDefId) { 39042 var eventInstanceGroup = this.eventInstanceGroupsById[eventDefId]; 39043 if (eventInstanceGroup) { 39044 return eventInstanceGroup.eventInstances.slice(); // clone 39045 } 39046 return []; 39047 }; 39048 EventPeriod.prototype.getEventInstancesWithoutId = function (eventDefId) { 39049 var eventInstanceGroupsById = this.eventInstanceGroupsById; 39050 var matchingInstances = []; 39051 var id; 39052 for (id in eventInstanceGroupsById) { 39053 if (id !== eventDefId) { 39054 matchingInstances.push.apply(matchingInstances, // append 39055 eventInstanceGroupsById[id].eventInstances); 39056 } 39057 } 39058 return matchingInstances; 39059 }; 39060 EventPeriod.prototype.addEventInstance = function (eventInstance, eventDefId) { 39061 var eventInstanceGroupsById = this.eventInstanceGroupsById; 39062 var eventInstanceGroup = eventInstanceGroupsById[eventDefId] || 39063 (eventInstanceGroupsById[eventDefId] = new EventInstanceGroup_1.default()); 39064 eventInstanceGroup.eventInstances.push(eventInstance); 39065 this.tryRelease(); 39066 }; 39067 EventPeriod.prototype.removeEventInstancesForDef = function (eventDef) { 39068 var eventInstanceGroupsById = this.eventInstanceGroupsById; 39069 var eventInstanceGroup = eventInstanceGroupsById[eventDef.id]; 39070 var removeCnt; 39071 if (eventInstanceGroup) { 39072 removeCnt = util_1.removeMatching(eventInstanceGroup.eventInstances, function (currentEventInstance) { 39073 return currentEventInstance.def === eventDef; 39074 }); 39075 if (!eventInstanceGroup.eventInstances.length) { 39076 delete eventInstanceGroupsById[eventDef.id]; 39077 } 39078 if (removeCnt) { 39079 this.tryRelease(); 39080 } 39081 } 39082 }; 39083 // Releasing and Freezing 39084 // ----------------------------------------------------------------------------------------------------------------- 39085 EventPeriod.prototype.tryRelease = function () { 39086 if (!this.pendingCnt) { 39087 if (!this.freezeDepth) { 39088 this.release(); 39089 } 39090 else { 39091 this.stuntedReleaseCnt++; 39092 } 39093 } 39094 }; 39095 EventPeriod.prototype.release = function () { 39096 this.releaseCnt++; 39097 this.trigger('release', this.eventInstanceGroupsById); 39098 }; 39099 EventPeriod.prototype.whenReleased = function () { 39100 var _this = this; 39101 if (this.releaseCnt) { 39102 return Promise_1.default.resolve(this.eventInstanceGroupsById); 39103 } 39104 else { 39105 return Promise_1.default.construct(function (onResolve) { 39106 _this.one('release', onResolve); 39107 }); 39108 } 39109 }; 39110 EventPeriod.prototype.freeze = function () { 39111 if (!(this.freezeDepth++)) { 39112 this.stuntedReleaseCnt = 0; 39113 } 39114 }; 39115 EventPeriod.prototype.thaw = function () { 39116 if (!(--this.freezeDepth) && this.stuntedReleaseCnt && !this.pendingCnt) { 39117 this.release(); 39118 } 39119 }; 39120 return EventPeriod; 39121}()); 39122exports.default = EventPeriod; 39123EmitterMixin_1.default.mixInto(EventPeriod); 39124 39125 39126/***/ }), 39127/* 244 */ 39128/***/ (function(module, exports, __webpack_require__) { 39129 39130Object.defineProperty(exports, "__esModule", { value: true }); 39131var $ = __webpack_require__(3); 39132var util_1 = __webpack_require__(4); 39133var ListenerMixin_1 = __webpack_require__(7); 39134/* Creates a clone of an element and lets it track the mouse as it moves 39135----------------------------------------------------------------------------------------------------------------------*/ 39136var MouseFollower = /** @class */ (function () { 39137 function MouseFollower(sourceEl, options) { 39138 this.isFollowing = false;
39139 this.isHidden = false; 39140 this.isAnimating = false; // doing the revert animation? 39141 this.options = options = options || {}; 39142 this.sourceEl = sourceEl; 39143 this.parentEl = options.parentEl ? $(options.parentEl) : sourceEl.parent(); // default to sourceEl's parent 39144 } 39145 // Causes the element to start following the mouse 39146 MouseFollower.prototype.start = function (ev) { 39147 if (!this.isFollowing) { 39148 this.isFollowing = true; 39149 this.y0 = util_1.getEvY(ev); 39150 this.x0 = util_1.getEvX(ev); 39151 this.topDelta = 0; 39152 this.leftDelta = 0; 39153 if (!this.isHidden) { 39154 this.updatePosition(); 39155 } 39156 if (util_1.getEvIsTouch(ev)) { 39157 this.listenTo($(document), 'touchmove', this.handleMove); 39158 } 39159 else { 39160 this.listenTo($(document), 'mousemove', this.handleMove); 39161 } 39162 } 39163 }; 39164 // Causes the element to stop following the mouse. If shouldRevert is true, will animate back to original position. 39165 // `callback` gets invoked when the animation is complete. If no animation, it is invoked immediately. 39166 MouseFollower.prototype.stop = function (shouldRevert, callback) { 39167 var _this = this; 39168 var revertDuration = this.options.revertDuration; 39169 var complete = function () { 39170 _this.isAnimating = false; 39171 _this.removeElement(); 39172 _this.top0 = _this.left0 = null; // reset state for future updatePosition calls 39173 if (callback) { 39174 callback(); 39175 } 39176 }; 39177 if (this.isFollowing && !this.isAnimating) { 39178 this.isFollowing = false; 39179 this.stopListeningTo($(document)); 39180 if (shouldRevert && revertDuration && !this.isHidden) { 39181 this.isAnimating = true; 39182 this.el.animate({ 39183 top: this.top0, 39184 left: this.left0 39185 }, { 39186 duration: revertDuration, 39187 complete: complete 39188 }); 39189 } 39190 else { 39191 complete(); 39192 } 39193 } 39194 }; 39195 // Gets the tracking element. Create it if necessary 39196 MouseFollower.prototype.getEl = function () { 39197 var el = this.el; 39198 if (!el) { 39199 el = this.el = this.sourceEl.clone() 39200 .addClass(this.options.additionalClass || '') 39201 .css({ 39202 position: 'absolute', 39203 visibility: '', 39204 display: this.isHidden ? 'none' : '', 39205 margin: 0, 39206 right: 'auto', 39207 bottom: 'auto', 39208 width: this.sourceEl.width(), 39209 height: this.sourceEl.height(), 39210 opacity: this.options.opacity || '', 39211 zIndex: this.options.zIndex 39212 }); 39213 // we don't want long taps or any mouse interaction causing selection/menus. 39214 // would use preventSelection(), but that prevents selectstart, causing problems. 39215 el.addClass('fc-unselectable'); 39216 el.appendTo(this.parentEl); 39217 } 39218 return el; 39219 }; 39220 // Removes the tracking element if it has already been created 39221 MouseFollower.prototype.removeElement = function () { 39222 if (this.el) { 39223 this.el.remove(); 39224 this.el = null; 39225 } 39226 }; 39227 // Update the CSS position of the tracking element 39228 MouseFollower.prototype.updatePosition = function () { 39229 var sourceOffset; 39230 var origin; 39231 this.getEl(); // ensure this.el 39232 // make sure origin info was computed 39233 if (this.top0 == null) { 39234 sourceOffset = this.sourceEl.offset(); 39235 origin = this.el.offsetParent().offset(); 39236 this.top0 = sourceOffset.top - origin.top; 39237 this.left0 = sourceOffset.left - origin.left; 39238 } 39239 this.el.css({ 39240 top: this.top0 + this.topDelta, 39241 left: this.left0 + this.leftDelta 39242 }); 39243 }; 39244 // Gets called when the user moves the mouse 39245 MouseFollower.prototype.handleMove = function (ev) { 39246 this.topDelta = util_1.getEvY(ev) - this.y0; 39247 this.leftDelta = util_1.getEvX(ev) - this.x0; 39248 if (!this.isHidden) { 39249 this.updatePosition(); 39250 } 39251 }; 39252 // Temporarily makes the tracking element invisible. Can be called before following starts 39253 MouseFollower.prototype.hide = function () { 39254 if (!this.isHidden) { 39255 this.isHidden = true; 39256 if (this.el) { 39257 this.el.hide(); 39258 } 39259 } 39260 }; 39261 // Show the tracking element after it has been temporarily hidden 39262 MouseFollower.prototype.show = function () { 39263 if (this.isHidden) { 39264 this.isHidden = false;
39265 this.updatePosition(); 39266 this.getEl().show(); 39267 } 39268 }; 39269 return MouseFollower; 39270}()); 39271exports.default = MouseFollower; 39272ListenerMixin_1.default.mixInto(MouseFollower); 39273 39274 39275/***/ }), 39276/* 245 */ 39277/***/ (function(module, exports, __webpack_require__) { 39278 39279Object.defineProperty(exports, "__esModule", { value: true }); 39280var tslib_1 = __webpack_require__(2); 39281var HitDragListener_1 = __webpack_require__(23); 39282var Interaction_1 = __webpack_require__(15); 39283var DateClicking = /** @class */ (function (_super) { 39284 tslib_1.__extends(DateClicking, _super); 39285 /* 39286 component must implement: 39287 - bindDateHandlerToEl 39288 - getSafeHitFootprint 39289 - getHitEl 39290 */ 39291 function DateClicking(component) { 39292 var _this = _super.call(this, component) || this; 39293 _this.dragListener = _this.buildDragListener(); 39294 return _this; 39295 } 39296 DateClicking.prototype.end = function () { 39297 this.dragListener.endInteraction(); 39298 }; 39299 DateClicking.prototype.bindToEl = function (el) { 39300 var component = this.component; 39301 var dragListener = this.dragListener; 39302 component.bindDateHandlerToEl(el, 'mousedown', function (ev) { 39303 if (!component.shouldIgnoreMouse()) { 39304 dragListener.startInteraction(ev); 39305 } 39306 }); 39307 component.bindDateHandlerToEl(el, 'touchstart', function (ev) { 39308 if (!component.shouldIgnoreTouch()) { 39309 dragListener.startInteraction(ev); 39310 } 39311 }); 39312 }; 39313 // Creates a listener that tracks the user's drag across day elements, for day clicking. 39314 DateClicking.prototype.buildDragListener = function () { 39315 var _this = this; 39316 var component = this.component; 39317 var dayClickHit; // null if invalid dayClick 39318 var dragListener = new HitDragListener_1.default(component, { 39319 scroll: this.opt('dragScroll'), 39320 interactionStart: function () { 39321 dayClickHit = dragListener.origHit; 39322 }, 39323 hitOver: function (hit, isOrig, origHit) { 39324 // if user dragged to another cell at any point, it can no longer be a dayClick 39325 if (!isOrig) { 39326 dayClickHit = null; 39327 } 39328 }, 39329 hitOut: function () { 39330 dayClickHit = null; 39331 }, 39332 interactionEnd: function (ev, isCancelled) { 39333 var componentFootprint; 39334 if (!isCancelled && dayClickHit) { 39335 componentFootprint = component.getSafeHitFootprint(dayClickHit); 39336 if (componentFootprint) { 39337 _this.view.triggerDayClick(componentFootprint, component.getHitEl(dayClickHit), ev); 39338 } 39339 } 39340 } 39341 }); 39342 // because dragListener won't be called with any time delay, "dragging" will begin immediately, 39343 // which will kill any touchmoving/scrolling. Prevent this. 39344 dragListener.shouldCancelTouchScroll = false; 39345 dragListener.scrollAlwaysKills = true; 39346 return dragListener; 39347 }; 39348 return DateClicking; 39349}(Interaction_1.default)); 39350exports.default = DateClicking; 39351 39352 39353/***/ }), 39354/* 246 */ 39355/***/ (function(module, exports, __webpack_require__) { 39356 39357Object.defineProperty(exports, "__esModule", { value: true }); 39358var tslib_1 = __webpack_require__(2); 39359var util_1 = __webpack_require__(4); 39360var EventRenderer_1 = __webpack_require__(42); 39361/* 39362Only handles foreground segs. 39363Does not own rendering. Use for low-level util methods by TimeGrid. 39364*/ 39365var TimeGridEventRenderer = /** @class */ (function (_super) { 39366 tslib_1.__extends(TimeGridEventRenderer, _super); 39367 function TimeGridEventRenderer(timeGrid, fillRenderer) { 39368 var _this = _super.call(this, timeGrid, fillRenderer) || this; 39369 _this.timeGrid = timeGrid; 39370 return _this; 39371 } 39372 TimeGridEventRenderer.prototype.renderFgSegs = function (segs) { 39373 this.renderFgSegsIntoContainers(segs, this.timeGrid.fgContainerEls); 39374 }; 39375 // Given an array of foreground segments, render a DOM element for each, computes position, 39376 // and attaches to the column inner-container elements. 39377 TimeGridEventRenderer.prototype.renderFgSegsIntoContainers = function (segs, containerEls) { 39378 var segsByCol; 39379 var col; 39380 segsByCol = this.timeGrid.groupSegsByCol(segs); 39381 for (col = 0; col < this.timeGrid.colCnt; col++) { 39382 this.updateFgSegCoords(segsByCol[col]); 39383 } 39384 this.timeGrid.attachSegsByCol(segsByCol, containerEls); 39385 }; 39386 TimeGridEventRenderer.prototype.unrenderFgSegs = function () { 39387 if (this.fgSegs) {
39388 this.fgSegs.forEach(function (seg) { 39389 seg.el.remove(); 39390 }); 39391 } 39392 }; 39393 // Computes a default event time formatting string if `timeFormat` is not explicitly defined 39394 TimeGridEventRenderer.prototype.computeEventTimeFormat = function () { 39395 return this.opt('noMeridiemTimeFormat'); // like "6:30" (no AM/PM) 39396 }; 39397 // Computes a default `displayEventEnd` value if one is not expliclty defined 39398 TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () { 39399 return true; 39400 }; 39401 // Renders the HTML for a single event segment's default rendering 39402 TimeGridEventRenderer.prototype.fgSegHtml = function (seg, disableResizing) { 39403 var view = this.view; 39404 var calendar = view.calendar; 39405 var componentFootprint = seg.footprint.componentFootprint; 39406 var isAllDay = componentFootprint.isAllDay; 39407 var eventDef = seg.footprint.eventDef; 39408 var isDraggable = view.isEventDefDraggable(eventDef); 39409 var isResizableFromStart = !disableResizing && seg.isStart && view.isEventDefResizableFromStart(eventDef); 39410 var isResizableFromEnd = !disableResizing && seg.isEnd && view.isEventDefResizableFromEnd(eventDef); 39411 var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd); 39412 var skinCss = util_1.cssToStr(this.getSkinCss(eventDef)); 39413 var timeText; 39414 var fullTimeText; // more verbose time text. for the print stylesheet 39415 var startTimeText; // just the start time text 39416 classes.unshift('fc-time-grid-event', 'fc-v-event'); 39417 // if the event appears to span more than one day... 39418 if (view.isMultiDayRange(componentFootprint.unzonedRange)) { 39419 // Don't display time text on segments that run entirely through a day. 39420 // That would appear as midnight-midnight and would look dumb. 39421 // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am) 39422 if (seg.isStart || seg.isEnd) { 39423 var zonedStart = calendar.msToMoment(seg.startMs); 39424 var zonedEnd = calendar.msToMoment(seg.endMs); 39425 timeText = this._getTimeText(zonedStart, zonedEnd, isAllDay); 39426 fullTimeText = this._getTimeText(zonedStart, zonedEnd, isAllDay, 'LT'); 39427 startTimeText = this._getTimeText(zonedStart, zonedEnd, isAllDay, null, false); // displayEnd=false 39428 } 39429 } 39430 else { 39431 // Display the normal time text for the *event's* times 39432 timeText = this.getTimeText(seg.footprint); 39433 fullTimeText = this.getTimeText(seg.footprint, 'LT'); 39434 startTimeText = this.getTimeText(seg.footprint, null, false); // displayEnd=false 39435 } 39436 return '<a class="' + classes.join(' ') + '"' + 39437 (eventDef.url ? 39438 ' href="' + util_1.htmlEscape(eventDef.url) + '"' : 39439 '') + 39440 (skinCss ? 39441 ' style="' + skinCss + '"' : 39442 '') + 39443 '>' + 39444 '<div class="fc-content">' + 39445 (timeText ? 39446 '<div class="fc-time"' + 39447 ' data-start="' + util_1.htmlEscape(startTimeText) + '"' + 39448 ' data-full="' + util_1.htmlEscape(fullTimeText) + '"' + 39449 '>' + 39450 '<span>' + util_1.htmlEscape(timeText) + '</span>' + 39451 '</div>' : 39452 '') + 39453 (eventDef.title ? 39454 '<div class="fc-title">' + 39455 util_1.htmlEscape(eventDef.title) + 39456 '</div>' : 39457 '') + 39458 '</div>' + 39459 '<div class="fc-bg"/>' + 39460 /* TODO: write CSS for this 39461 (isResizableFromStart ? 39462 '<div class="fc-resizer fc-start-resizer" />' : 39463 '' 39464 ) + 39465 */ 39466 (isResizableFromEnd ? 39467 '<div class="fc-resizer fc-end-resizer" />' : 39468 '') + 39469 '</a>'; 39470 }; 39471 // Given segments that are assumed to all live in the *same column*, 39472 // compute their verical/horizontal coordinates and assign to their elements. 39473 TimeGridEventRenderer.prototype.updateFgSegCoords = function (segs) { 39474 this.timeGrid.computeSegVerticals(segs); // horizontals relies on this 39475 this.computeFgSegHorizontals(segs); // compute horizontal coordinates, z-index's, and reorder the array 39476 this.timeGrid.assignSegVerticals(segs); 39477 this.assignFgSegHorizontals(segs); 39478 }; 39479 // Given an array of segments that are all in the same column, set
39479s the backwardCoord and forwardCoord on each. 39480 // NOTE: Also reorders the given array by date! 39481 TimeGridEventRenderer.prototype.computeFgSegHorizontals = function (segs) { 39482 var levels; 39483 var level0; 39484 var i; 39485 this.sortEventSegs(segs); // order by certain criteria 39486 levels = buildSlotSegLevels(segs); 39487 computeForwardSlotSegs(levels); 39488 if ((level0 = levels[0])) { 39489 for (i = 0; i < level0.length; i++) { 39490 computeSlotSegPressures(level0[i]); 39491 } 39492 for (i = 0; i < level0.length; i++) { 39493 this.computeFgSegForwardBack(level0[i], 0, 0); 39494 } 39495 } 39496 }; 39497 // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range 39498 // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to "left" and 39499 // seg.forwardCoord maps to "right" (via percentage). Vice-versa if the calendar is right-to-left. 39500 // 39501 // The segment might be part of a "series", which means consecutive segments with the same pressure 39502 // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of 39503 // segments behind this one in the current series, and `seriesBackwardCoord` is the starting 39504 // coordinate of the first segment in the series. 39505 TimeGridEventRenderer.prototype.computeFgSegForwardBack = function (seg, seriesBackwardPressure, seriesBackwardCoord) { 39506 var forwardSegs = seg.forwardSegs; 39507 var i; 39508 if (seg.forwardCoord === undefined) { 39509 if (!forwardSegs.length) { 39510 // if there are no forward segments, this segment should butt up against the edge 39511 seg.forwardCoord = 1; 39512 } 39513 else { 39514 // sort highest pressure first 39515 this.sortForwardSegs(forwardSegs); 39516 // this segment's forwardCoord will be calculated from the backwardCoord of the 39517 // highest-pressure forward segment. 39518 this.computeFgSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord); 39519 seg.forwardCoord = forwardSegs[0].backwardCoord; 39520 } 39521 // calculate the backwardCoord from the forwardCoord. consider the series 39522 seg.backwardCoord = seg.forwardCoord - 39523 (seg.forwardCoord - seriesBackwardCoord) / // available width for series 39524 (seriesBackwardPressure + 1); // # of segments in the series 39525 // use this segment's coordinates to computed the coordinates of the less-pressurized 39526 // forward segments 39527 for (i = 0; i < forwardSegs.length; i++) { 39528 this.computeFgSegForwardBack(forwardSegs[i], 0, seg.forwardCoord); 39529 } 39530 } 39531 }; 39532 TimeGridEventRenderer.prototype.sortForwardSegs = function (forwardSegs) { 39533 forwardSegs.sort(util_1.proxy(this, 'compareForwardSegs')); 39534 }; 39535 // A cmp function for determining which forward segment to rely on more when computing coordinates. 39536 TimeGridEventRenderer.prototype.compareForwardSegs = function (seg1, seg2) { 39537 // put higher-pressure first 39538 return seg2.forwardPressure - seg1.forwardPressure || 39539 // put segments that are closer to initial edge first (and favor ones with no coords yet) 39540 (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) || 39541 // do normal sorting... 39542 this.compareEventSegs(seg1, seg2); 39543 }; 39544 // Given foreground event segments that have already had their position coordinates computed, 39545 // assigns position-related CSS values to their elements. 39546 TimeGridEventRenderer.prototype.assignFgSegHorizontals = function (segs) { 39547 var i; 39548 var seg; 39549 for (i = 0; i < segs.length; i++) { 39550 seg = segs[i]; 39551 seg.el.css(this.generateFgSegHorizontalCss(seg)); 39552 // if the height is short, add a className for alternate styling 39553 if (seg.bottom - seg.top < 30) { 39554 seg.el.addClass('fc-short'); 39555 } 39556 } 39557 }; 39558 // Generates an object with CSS properties/values that should be applied to an event segment element. 39559 // Contains important positioning-related properties that should be applied to any event element, customized or not. 39560 TimeGridEventRenderer.prototype.generateFgSegHorizontalCss = function (seg) { 39561 var shouldOverlap = this.opt('slotEventOverlap'); 39562 var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point 39563 var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point 39564 var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first 39565 var isRTL = this.timeGrid.isRTL; 39566 var left; // amount of space from left edge, a fraction of the total width 39567 var right; // amount of space from right edge, a fraction of the total width 39568 if (shouldOverlap) { 39569 // double the width, but don't go beyond the maximum forward coordinate (1.0) 39570 forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2); 39571 } 39572 if (isRTL) { 39573 left = 1 - forwardCoord; 39574 right = backwardCoord; 39575 } 39576 else { 39577 left = backwardCoord; 39578 right = 1 - forwardCoord; 39579 } 39580 props.zIndex = seg.level + 1; // convert from 0-base to 1-based 39581 props.left = left * 100 + '%'; 39582 props.right = right * 100 + '%'; 39583 if (shouldOverlap && seg.forwardPressure) { 39584 // add padding to the edge so that forward stacked events don't cover the resizer's icon 39585 props[isRTL ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width 39586 } 39587 return props; 39588 }; 39589 return TimeGridEventRenderer; 39590}(EventRenderer_1.default)); 39591exports.default = TimeGridEventRenderer; 39592// Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is 39593// left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date. 39594function buildSlotSegLevels(segs) { 39595 var levels = []; 39596 var i; 39597 var seg; 39598 var j; 39599 for (i = 0; i < segs.length; i++) { 39600 seg = segs[i]; 39601 // go through all the levels and stop on the first level where there are no collisions 39602 for (j = 0; j < levels.length; j++) { 39603 if (!computeSlotSegCollisions(seg, levels[j]).length) { 39604 break; 39605 } 39606 } 39607 seg.level = j; 39608 (levels[j] || (levels[j] = [])).push(seg); 39609 } 39610 return levels; 39611} 39612// For every segment, figure out the other segments that are in subsequent 39613// levels that also occupy the same vertical space. Accumulate in seg.forwardSegs 39614function computeForwardSlotSegs(levels) { 39615 var i; 39616 var level; 39617 var j; 39618 var seg; 39619 var k; 39620 for (i = 0; i < levels.length; i++) { 39621 level = levels[i]; 39622 for (j = 0; j < level.length; j++) { 39623 seg = level[j]; 39624 seg.forwardSegs = []; 39625 for (k = i + 1; k < levels.length; k++) { 39626 computeSlotSegCollisions(seg, levels[k], seg.forwardSegs); 39627 } 39628 } 39629 } 39630} 39631// Figure out which path forward (via seg.forwardSegs) results in the longest path until 39632// the furthest edge is reached. The number of segments in this path will be seg.forwardPressure 39633function computeSlotSegPressures(seg) { 39634 var forwardSegs = seg.forwardSegs; 39635 var forwardPressure = 0; 39636 var i; 39637 var forwardSeg; 39638 if (seg.forwardPressure === undefined) { 39639 for (i = 0; i < forwardSegs.length; i++) { 39640 forwardSeg = forwardSegs[i]; 39641 // figure out the child's maximum forward path 39642 computeSlotSegPressures(forwardSeg); 39643 // either use the existing maximum, or use the child's forward pressure 39644 // plus one (for the forwardSeg itself) 39645 forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure); 39646 } 39647 seg.forwardPressure = forwardPressure; 39648 } 39649} 39650// Find all the segments in `otherSegs` that vertically collide with `seg`. 39651// Append into an optionally-supplied `results` array and return. 39652function computeSlotSegCollisions(seg, otherSegs, results) { 39653 if (results === void 0) { results = []; } 39654 for (var i = 0; i < otherSegs.length; i++) { 39655 if (isSlotSegCollision(seg, otherSegs[i])) { 39656 results.push(otherSegs[i]); 39657 } 39658 } 39659 return results; 39660} 39661// Do these segments occupy the same vertical space? 39662function isSlotSegCollision(seg1, seg2) { 39663 return seg1.bottom > seg2.top && seg1.top < seg2.bottom; 39664} 39665 39666 39667/***/ }), 39668/* 247 */ 39669/***/ (function(module, exports, __webpack_require__) { 39670 39671Object.defineProperty(exports, "__esModule", { value: true }); 39672var tslib_1 = __webpack_require__(2); 39673var $ = __webpack_require__(3); 39674var HelperRenderer_1 = __webpack_require__(58); 39675var TimeGridHelperRenderer = /** @class */ (function (_super) { 39676 tslib_1.__extends(TimeGridHelperRenderer, _super); 39677 function TimeGridHelperRenderer() { 39678 return _super !== null && _super.apply(this, arguments) || this; 39679 } 39680 TimeGridHelperRenderer.prototype.renderSegs = function (segs, sourceSeg) { 39681 var helperNodes = []; 39682 var i; 39683 var seg; 39684 var sourceEl; 39685 // TODO: not good to call eventRenderer this way 39686 this.eventRenderer.renderFgSegsIntoContainers(segs, this.component.helperContainerEls); 39687 // Try to make the segment that is in the same row as sourceSeg look the same 39688 for (i = 0; i < segs.length; i++) { 39689 seg = segs[i]; 39690 if (sourceSeg && sourceSeg.col === seg.col) { 39691 sourceEl = sourceSeg.el; 39692 seg.el.css({ 39693 left: sourceEl.css('left'), 39694 right: sourceEl.css('right'), 39695 'margin-left': sourceEl.css('margin-left'), 39696 'margin-right': sourceEl.css('margin-right') 39697 }); 39698 } 39699 helperNodes.push(seg.el[0]); 39700 } 39701 return $(helperNodes); // must return the elements rendered 39702 }; 39703 return TimeGridHelperRenderer; 39704}(HelperRenderer_1.default)); 39705exports.default = TimeGridHelperRenderer; 39706 39707 39708/***/ }), 39709/* 248 */ 39710/***/ (function(module, exports, __webpack_require__) { 39711 39712Object.defineProperty(exports, "__esModule", { value: true }); 39713var tslib_1 = __webpack_require__(2);
39714var FillRenderer_1 = __webpack_require__(57); 39715var TimeGridFillRenderer = /** @class */ (function (_super) { 39716 tslib_1.__extends(TimeGridFillRenderer, _super); 39717 function TimeGridFillRenderer() { 39718 return _super !== null && _super.apply(this, arguments) || this; 39719 } 39720 TimeGridFillRenderer.prototype.attachSegEls = function (type, segs) { 39721 var timeGrid = this.component; 39722 var containerEls; 39723 // TODO: more efficient lookup 39724 if (type === 'bgEvent') { 39725 containerEls = timeGrid.bgContainerEls; 39726 } 39727 else if (type === 'businessHours') { 39728 containerEls = timeGrid.businessContainerEls; 39729 } 39730 else if (type === 'highlight') { 39731 containerEls = timeGrid.highlightContainerEls; 39732 } 39733 timeGrid.updateSegVerticals(segs); 39734 timeGrid.attachSegsByCol(timeGrid.groupSegsByCol(segs), containerEls); 39735 return segs.map(function (seg) { 39736 return seg.el[0]; 39737 }); 39738 }; 39739 return TimeGridFillRenderer; 39740}(FillRenderer_1.default)); 39741exports.default = TimeGridFillRenderer; 39742 39743 39744/***/ }), 39745/* 249 */ 39746/***/ (function(module, exports, __webpack_require__) { 39747 39748/* A rectangular panel that is absolutely positioned over other content 39749------------------------------------------------------------------------------------------------------------------------ 39750Options: 39751 - className (string) 39752 - content (HTML string or jQuery element set) 39753 - parentEl 39754 - top 39755 - left 39756 - right (the x coord of where the right edge should be. not a "CSS" right) 39757 - autoHide (boolean) 39758 - show (callback) 39759 - hide (callback) 39760*/ 39761Object.defineProperty(exports, "__esModule", { value: true }); 39762var $ = __webpack_require__(3); 39763var util_1 = __webpack_require__(4); 39764var ListenerMixin_1 = __webpack_require__(7); 39765var Popover = /** @class */ (function () { 39766 function Popover(options) { 39767 this.isHidden = true; 39768 this.margin = 10; // the space required between the popover and the edges of the scroll container 39769 this.options = options || {}; 39770 } 39771 // Shows the popover on the specified position. Renders it if not already 39772 Popover.prototype.show = function () { 39773 if (this.isHidden) { 39774 if (!this.el) { 39775 this.render(); 39776 } 39777 this.el.show(); 39778 this.position(); 39779 this.isHidden = false; 39780 this.trigger('show'); 39781 } 39782 }; 39783 // Hides the popover, through CSS, but does not remove it from the DOM 39784 Popover.prototype.hide = function () { 39785 if (!this.isHidden) { 39786 this.el.hide(); 39787 this.isHidden = true; 39788 this.trigger('hide'); 39789 } 39790 }; 39791 // Creates `this.el` and renders content inside of it 39792 Popover.prototype.render = function () { 39793 var _this = this; 39794 var options = this.options; 39795 this.el = $('<div class="fc-popover"/>') 39796 .addClass(options.className || '') 39797 .css({ 39798 // position initially to the top left to avoid creating scrollbars 39799 top: 0, 39800 left: 0 39801 }) 39802 .append(options.content) 39803 .appendTo(options.parentEl); 39804 // when a click happens on anything inside with a 'fc-close' className, hide the popover 39805 this.el.on('click', '.fc-close', function () { 39806 _this.hide(); 39807 }); 39808 if (options.autoHide) { 39809 this.listenTo($(document), 'mousedown', this.documentMousedown); 39810 } 39811 }; 39812 // Triggered when the user clicks *anywhere* in the document, for the autoHide feature 39813 Popover.prototype.documentMousedown = function (ev) { 39814 // only hide the popover if the click happened outside the popover 39815 if (this.el && !$(ev.target).closest(this.el).length) { 39816 this.hide(); 39817 } 39818 }; 39819 // Hides and unregisters any handlers 39820 Popover.prototype.removeElement = function () { 39821 this.hide(); 39822 if (this.el) { 39823 this.el.remove(); 39824 this.el = null; 39825 } 39826 this.stopListeningTo($(document), 'mousedown'); 39827 }; 39828 // Positions the popover optimally, using the top/left/right options 39829 Popover.prototype.position = function () { 39830 var options = this.options; 39831 var origin = this.el.offsetParent().offset(); 39832 var width = this.el.outerWidth(); 39833 var height = this.el.outerHeight(); 39834 var windowEl = $(window); 39835 var viewportEl = util_1.getScrollParent(this.el); 39836 var viewportTop; 39837 var viewportLeft; 39838 var viewportOffset; 39839 var top; // the "position" (not "offset") values for the popover 39840 var left; // 39841 // compute top and left 39842 top = options.top || 0; 39843 if (options.left !== undefined) { 39844 left = options.left; 39845 } 39846 else if (options.right !== undefined) { 39847 left = options.right - width; // derive the left value from the right value 39848 } 39849 else { 39850 left = 0; 39851 } 39852 if (viewportEl.is(window) || viewportEl.is(document)) { 39853 viewportEl = windowEl; 39854 viewportTop = 0; // the window is always at the top left 39855 viewportLeft = 0; // (and .offset() won't work if called here) 39856 } 39857 else { 39858 viewportOffset = viewportEl.offset(); 39859 viewportTop = viewportOffset.top; 39860 viewportLeft = viewportOffset.left; 39861 } 39862 // if the window is scrolled, it causes the visible area to be further down 39863 viewportTop += windowEl.scrollTop(); 39864 viewportLeft += windowEl.scrollLeft(); 39865 // constrain to the view port. if constrained by two edges, give precedence to top/left 39866 if (options.viewportConstrain !== false) { 39867 top = Math.min(top, viewportTop + viewportEl.outerHeight() - height - this.margin); 39868 top = Math.max(top, viewportTop + this.margin); 39869 left = Math.min(left, viewportLeft + viewportEl.outerWidth() - width - this.margin); 39870 left = Math.max(left, viewportLeft + this.margin); 39871 } 39872 this.el.css({ 39873 top: top - origin.top, 39874 left: left - origin.left 39875 }); 39876 }; 39877 // Triggers a callback. Calls a function in the option hash of the same name. 39878 // Arguments beyond the first `name` are forwarded on. 39879 // TODO: better code reuse for this. Repeat code 39880 Popover.prototype.trigger = function (name) { 39881 if (this.options[name]) { 39882 this.options[name].apply(this, Array.prototype.slice.call(arguments, 1)); 39883 } 39884 }; 39885 return Popover; 39886}()); 39887exports.default = Popover; 39888ListenerMixin_1.default.mixInto(Popover); 39889 39890
39891/***/ }), 39892/* 250 */ 39893/***/ (function(module, exports, __webpack_require__) { 39894 39895Object.defineProperty(exports, "__esModule", { value: true }); 39896var tslib_1 = __webpack_require__(2); 39897var $ = __webpack_require__(3); 39898var util_1 = __webpack_require__(4); 39899var EventRenderer_1 = __webpack_require__(42); 39900/* Event-rendering methods for the DayGrid class 39901----------------------------------------------------------------------------------------------------------------------*/ 39902var DayGridEventRenderer = /** @class */ (function (_super) { 39903 tslib_1.__extends(DayGridEventRenderer, _super); 39904 function DayGridEventRenderer(dayGrid, fillRenderer) { 39905 var _this = _super.call(this, dayGrid, fillRenderer) || this; 39906 _this.dayGrid = dayGrid; 39907 return _this; 39908 } 39909 DayGridEventRenderer.prototype.renderBgRanges = function (eventRanges) { 39910 // don't render timed background events 39911 eventRanges = $.grep(eventRanges, function (eventRange) { 39912 return eventRange.eventDef.isAllDay(); 39913 }); 39914 _super.prototype.renderBgRanges.call(this, eventRanges); 39915 }; 39916 // Renders the given foreground event segments onto the grid 39917 DayGridEventRenderer.prototype.renderFgSegs = function (segs) { 39918 var rowStructs = this.rowStructs = this.renderSegRows(segs); 39919 // append to each row's content skeleton 39920 this.dayGrid.rowEls.each(function (i, rowNode) { 39921 $(rowNode).find('.fc-content-skeleton > table').append(rowStructs[i].tbodyEl); 39922 }); 39923 }; 39924 // Unrenders all currently rendered foreground event segments 39925 DayGridEventRenderer.prototype.unrenderFgSegs = function () { 39926 var rowStructs = this.rowStructs || []; 39927 var rowStruct; 39928 while ((rowStruct = rowStructs.pop())) { 39929 rowStruct.tbodyEl.remove(); 39930 } 39931 this.rowStructs = null; 39932 }; 39933 // Uses the given events array to generate <tbody> elements that should be appended to each row's content skeleton. 39934 // Returns an array of rowStruct objects (see the bottom of `renderSegRow`). 39935 // PRECONDITION: each segment shoud already have a rendered and assigned `.el` 39936 DayGridEventRenderer.prototype.renderSegRows = function (segs) { 39937 var rowStructs = []; 39938 var segRows; 39939 var row; 39940 segRows = this.groupSegRows(segs); // group into nested arrays 39941 // iterate each row of segment groupings 39942 for (row = 0; row < segRows.length; row++) { 39943 rowStructs.push(this.renderSegRow(row, segRows[row])); 39944 } 39945 return rowStructs; 39946 }; 39947 // Given a row # and an array of segments all in the same row, render a <tbody> element, a skeleton that contains 39948 // the segments. Returns object with a bunch of internal data about how the render was calculated. 39949 // NOTE: modifies rowSegs 39950 DayGridEventRenderer.prototype.renderSegRow = function (row, rowSegs) { 39951 var colCnt = this.dayGrid.colCnt; 39952 var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels 39953 var levelCnt = Math.max(1, segLevels.length); // ensure at least one level 39954 var tbody = $('<tbody/>'); 39955 var segMatrix = []; // lookup for which segments are rendered into which level+col cells 39956 var cellMatrix = []; // lookup for all <td> elements of the level+col matrix 39957 var loneCellMatrix = []; // lookup for <td> elements that only take up a single column 39958 var i; 39959 var levelSegs; 39960 var col; 39961 var tr; 39962 var j; 39963 var seg; 39964 var td; 39965 // populates empty cells from the current column (`col`) to `endCol` 39966 function emptyCellsUntil(endCol) { 39967 while (col < endCol) { 39968 // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell 39969 td = (loneCellMatrix[i - 1] || [])[col]; 39970 if (td) { 39971 td.attr('rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1); 39972 } 39973 else { 39974 td = $('<td/>'); 39975 tr.append(td); 39976 } 39977 cellMatrix[i][col] = td; 39978 loneCellMatrix[i][col] = td; 39979 col++; 39980 } 39981 } 39982 for (i = 0; i < levelCnt; i++) { 39983 levelSegs = segLevels[i]; 39984 col = 0; 39985 tr = $('<tr/>'); 39986 segMatrix.push([]); 39987 cellMatrix.push([]); 39988 loneCellMatrix.push([]); 39989 // levelCnt might be 1 even though there are no actual levels. protect against this. 39990 // this single empty row is useful for styling. 39991 if (levelSegs) { 39992 for (j = 0; j < levelSegs.length; j++) { 39993 seg = levelSegs[j]; 39994 emptyCellsUntil(seg.leftCol); 39995 // create a container that occupies or more columns. append the event element. 39996 td = $('<td class="fc-event-container"/>').append(seg.el); 39997 if (seg.leftCol !== seg.rightCol) { 39998 td.attr('colspan', seg.rightCol - seg.leftCol + 1); 39999 } 40000 else { 40001 loneCellMatrix[i][col] = td; 40002 } 40003 while (col <= seg.rightCol) { 40004 cellMatrix[i][col] = td; 40005 segMatrix[i][col] = seg; 40006 col++; 40007 } 40008 tr.append(td); 40009 } 40010 } 40011 emptyCellsUntil(colCnt); // finish off the row 40012 this.dayGrid.bookendCells(tr); 40013 tbody.append(tr); 40014 } 40015 return { 40016 row: row, 40017 tbodyEl: tbody, 40018 cellMatrix: cellMatrix, 40019 segMatrix: segMatrix, 40020 segLevels: segLevels, 40021 segs: rowSegs 40022 }; 40023 }; 40024 // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels. 40025 // NOTE: modifies segs 40026 DayGridEventRenderer.prototype.buildSegLevels = function (segs) { 40027 var levels = []; 40028 var i; 40029 var seg; 40030 var j; 40031 // Give preference to elements with certain criteria, so they have 40032 // a chance to be closer to the top. 40033 this.sortEventSegs(segs); 40034 for (i = 0; i < segs.length; i++) { 40035 seg = segs[i]; 40036 // loop through levels, starting with the topmost, until the segment doesn't collide with other segments 40037 for (j = 0; j < levels.length; j++) {
40038 if (!isDaySegCollision(seg, levels[j])) { 40039 break; 40040 } 40041 } 40042 // `j` now holds the desired subrow index 40043 seg.level = j; 40044 // create new level array if needed and append segment 40045 (levels[j] || (levels[j] = [])).push(seg); 40046 } 40047 // order segments left-to-right. very important if calendar is RTL 40048 for (j = 0; j < levels.length; j++) { 40049 levels[j].sort(compareDaySegCols); 40050 } 40051 return levels; 40052 }; 40053 // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row 40054 DayGridEventRenderer.prototype.groupSegRows = function (segs) { 40055 var segRows = []; 40056 var i; 40057 for (i = 0; i < this.dayGrid.rowCnt; i++) { 40058 segRows.push([]); 40059 } 40060 for (i = 0; i < segs.length; i++) { 40061 segRows[segs[i].row].push(segs[i]); 40062 } 40063 return segRows; 40064 }; 40065 // Computes a default event time formatting string if `timeFormat` is not explicitly defined 40066 DayGridEventRenderer.prototype.computeEventTimeFormat = function () { 40067 return this.opt('extraSmallTimeFormat'); // like "6p" or "6:30p" 40068 }; 40069 // Computes a default `displayEventEnd` value if one is not expliclty defined 40070 DayGridEventRenderer.prototype.computeDisplayEventEnd = function () { 40071 return this.dayGrid.colCnt === 1; // we'll likely have space if there's only one day 40072 }; 40073 // Builds the HTML to be used for the default element for an individual segment 40074 DayGridEventRenderer.prototype.fgSegHtml = function (seg, disableResizing) { 40075 var view = this.view; 40076 var eventDef = seg.footprint.eventDef; 40077 var isAllDay = seg.footprint.componentFootprint.isAllDay; 40078 var isDraggable = view.isEventDefDraggable(eventDef); 40079 var isResizableFromStart = !disableResizing && isAllDay && 40080 seg.isStart && view.isEventDefResizableFromStart(eventDef); 40081 var isResizableFromEnd = !disableResizing && isAllDay && 40082 seg.isEnd && view.isEventDefResizableFromEnd(eventDef); 40083 var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd); 40084 var skinCss = util_1.cssToStr(this.getSkinCss(eventDef)); 40085 var timeHtml = ''; 40086 var timeText; 40087 var titleHtml; 40088 classes.unshift('fc-day-grid-event', 'fc-h-event');
40089 // Only display a timed events time if it is the starting segment 40090 if (seg.isStart) { 40091 timeText = this.getTimeText(seg.footprint); 40092 if (timeText) { 40093 timeHtml = '<span class="fc-time">' + util_1.htmlEscape(timeText) + '</span>'; 40094 } 40095 } 40096 titleHtml = 40097 '<span class="fc-title">' + 40098 (util_1.htmlEscape(eventDef.title || '') || ' ') + // we always want one line of height 40099 '</span>'; 40100 return '<a class="' + classes.join(' ') + '"' + 40101 (eventDef.url ? 40102 ' href="' + util_1.htmlEscape(eventDef.url) + '"' : 40103 '') + 40104 (skinCss ? 40105 ' style="' + skinCss + '"' : 40106 '') + 40107 '>' + 40108 '<div class="fc-content">' + 40109 (this.dayGrid.isRTL ? 40110 titleHtml + ' ' + timeHtml : // put a natural space in between 40111 timeHtml + ' ' + titleHtml // 40112 ) + 40113 '</div>' + 40114 (isResizableFromStart ? 40115 '<div class="fc-resizer fc-start-resizer" />' : 40116 '') + 40117 (isResizableFromEnd ? 40118 '<div class="fc-resizer fc-end-resizer" />' : 40119 '') + 40120 '</a>'; 40121 }; 40122 return DayGridEventRenderer; 40123}(EventRenderer_1.default)); 40124exports.default = DayGridEventRenderer; 40125// Computes whether two segments' columns collide. They are assumed to be in the same row. 40126function isDaySegCollision(seg, otherSegs) { 40127 var i; 40128 var otherSeg; 40129 for (i = 0; i < otherSegs.length; i++) { 40130 otherSeg = otherSegs[i]; 40131 if (otherSeg.leftCol <= seg.rightCol && 40132 otherSeg.rightCol >= seg.leftCol) { 40133 return true; 40134 } 40135 } 40136 return false; 40137} 40138// A cmp function for determining the leftmost event 40139function compareDaySegCols(a, b) { 40140 return a.leftCol - b.leftCol; 40141} 40142 40143 40144/***/ }), 40145/* 251 */ 40146/***/ (function(module, exports, __webpack_require__) { 40147 40148Object.defineProperty(exports, "__esModule", { value: true }); 40149var tslib_1 = __webpack_require__(2); 40150var $ = __webpack_require__(3); 40151var HelperRenderer_1 = __webpack_require__(58); 40152var DayGridHelperRenderer = /** @class */ (function (_super) { 40153 tslib_1.__extends(DayGridHelperRenderer, _super); 40154 function DayGridHelperRenderer() { 40155 return _super !== null && _super.apply(this, arguments) || this; 40156 } 40157 // Renders a mock "helper" event. `sourceSeg` is the associated internal segment object. It can be null. 40158 DayGridHelperRenderer.prototype.renderSegs = function (segs, sourceSeg) { 40159 var helperNodes = []; 40160 var rowStructs; 40161 // TODO: not good to call eventRenderer this way 40162 rowStructs = this.eventRenderer.renderSegRows(segs); 40163 // inject each new event skeleton into each associated row 40164 this.component.rowEls.each(function (row, rowNode) { 40165 var rowEl = $(rowNode); // the .fc-row 40166 var skeletonEl = $('<div class="fc-helper-skeleton"><table/></div>'); // will be absolutely positioned 40167 var skeletonTopEl; 40168 var skeletonTop; 40169 // If there is an original segment, match the top position. Otherwise, put it at the row's top level 40170 if (sourceSeg && sourceSeg.row === row) { 40171 skeletonTop = sourceSeg.el.position().top; 40172 } 40173 else { 40174 skeletonTopEl = rowEl.find('.fc-content-skeleton tbody'); 40175 if (!skeletonTopEl.length) { 40176 skeletonTopEl = rowEl.find('.fc-content-skeleton table'); 40177 } 40178 skeletonTop = skeletonTopEl.position().top; 40179 } 40180 skeletonEl.css('top', skeletonTop) 40181 .find('table') 40182 .append(rowStructs[row].tbodyEl); 40183 rowEl.append(skeletonEl); 40184 helperNodes.push(skeletonEl[0]); 40185 }); 40186 return $(helperNodes); // must return the elements rendered 40187 }; 40188 return DayGridHelperRenderer; 40189}(HelperRenderer_1.default)); 40190exports.default = DayGridHelperRenderer; 40191 40192 40193/***/ }), 40194/* 252 */ 40195/***/ (function(module, exports, __webpack_require__) { 40196 40197Object.defineProperty(exports, "__esModule", { value: true }); 40198var tslib_1 = __webpack_require__(2); 40199var $ = __webpack_require__(3);
40200var FillRenderer_1 = __webpack_require__(57); 40201var DayGridFillRenderer = /** @class */ (function (_super) { 40202 tslib_1.__extends(DayGridFillRenderer, _super); 40203 function DayGridFillRenderer() { 40204 var _this = _super !== null && _super.apply(this, arguments) || this; 40205 _this.fillSegTag = 'td'; // override the default tag name 40206 return _this; 40207 } 40208 DayGridFillRenderer.prototype.attachSegEls = function (type, segs) { 40209 var nodes = []; 40210 var i; 40211 var seg; 40212 var skeletonEl; 40213 for (i = 0; i < segs.length; i++) { 40214 seg = segs[i]; 40215 skeletonEl = this.renderFillRow(type, seg); 40216 this.component.rowEls.eq(seg.row).append(skeletonEl); 40217 nodes.push(skeletonEl[0]); 40218 } 40219 return nodes; 40220 }; 40221 // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered. 40222 DayGridFillRenderer.prototype.renderFillRow = function (type, seg) { 40223 var colCnt = this.component.colCnt; 40224 var startCol = seg.leftCol; 40225 var endCol = seg.rightCol + 1; 40226 var className; 40227 var skeletonEl; 40228 var trEl; 40229 if (type === 'businessHours') { 40230 className = 'bgevent'; 40231 } 40232 else { 40233 className = type.toLowerCase(); 40234 } 40235 skeletonEl = $('<div class="fc-' + className + '-skeleton">' + 40236 '<table><tr/></table>' + 40237 '</div>'); 40238 trEl = skeletonEl.find('tr'); 40239 if (startCol > 0) { 40240 trEl.append('<td colspan="' + startCol + '"/>'); 40241 } 40242 trEl.append(seg.el.attr('colspan', endCol - startCol)); 40243 if (endCol < colCnt) { 40244 trEl.append('<td colspan="' + (colCnt - endCol) + '"/>'); 40245 } 40246 this.component.bookendCells(trEl); 40247 return skeletonEl; 40248 }; 40249 return DayGridFillRenderer; 40250}(FillRenderer_1.default)); 40251exports.default = DayGridFillRenderer; 40252 40253 40254/***/ }), 40255/* 253 */ 40256/***/ (function(module, exports, __webpack_require__) { 40257 40258Object.defineProperty(exports, "__esModule", { value: true }); 40259var tslib_1 = __webpack_require__(2); 40260var BasicViewDateProfileGenerator_1 = __webpack_require__(228); 40261var UnzonedRange_1 = __webpack_require__(5); 40262var MonthViewDateProfileGenerator = /** @class */ (function (_super) { 40263 tslib_1.__extends(MonthViewDateProfileGenerator, _super); 40264 function MonthViewDateProfileGenerator() { 40265 return _super !== null && _super.apply(this, arguments) || this; 40266 } 40267 // Computes the date range that will be rendered. 40268 MonthViewDateProfileGenerator.prototype.buildRenderRange = function (currentUnzonedRange, currentRangeUnit, isRangeAllDay) { 40269 var renderUnzonedRange = _super.prototype.buildRenderRange.call(this, currentUnzonedRange, currentRangeUnit, isRangeAllDay); 40270 var start = this.msToUtcMoment(renderUnzonedRange.startMs, isRangeAllDay); 40271 var end = this.msToUtcMoment(renderUnzonedRange.endMs, isRangeAllDay); 40272 var rowCnt; 40273 // ensure 6 weeks 40274 if (this.opt('fixedWeekCount')) { 40275 rowCnt = Math.ceil(// could be partial weeks due to hiddenDays 40276 end.diff(start, 'weeks', true) // dontRound=true 40277 ); 40278 end.add(6 - rowCnt, 'weeks'); 40279 } 40280 return new UnzonedRange_1.default(start, end); 40281 }; 40282 return MonthViewDateProfileGenerator; 40283}(BasicViewDateProfileGenerator_1.default)); 40284exports.default = MonthViewDateProfileGenerator; 40285 40286 40287/***/ }), 40288/* 254 */ 40289/***/ (function(module, exports, __webpack_require__) { 40290 40291Object.defineProperty(exports, "__esModule", { value: true }); 40292var tslib_1 = __webpack_require__(2); 40293var util_1 = __webpack_require__(4); 40294var EventRenderer_1 = __webpack_require__(42); 40295var ListEventRenderer = /** @class */ (function (_super) { 40296 tslib_1.__extends(ListEventRenderer, _super); 40297 function ListEventRenderer() { 40298 return _super !== null && _super.apply(this, arguments) || this; 40299 } 40300 ListEventRenderer.prototype.renderFgSegs = function (segs) { 40301 if (!segs.length) { 40302 this.component.renderEmptyMessage(); 40303 } 40304 else {
40305 this.component.renderSegList(segs); 40306 } 40307 }; 40308 // generates the HTML for a single event row 40309 ListEventRenderer.prototype.fgSegHtml = function (seg) { 40310 var view = this.view; 40311 var calendar = view.calendar; 40312 var theme = calendar.theme; 40313 var eventFootprint = seg.footprint; 40314 var eventDef = eventFootprint.eventDef; 40315 var componentFootprint = eventFootprint.componentFootprint; 40316 var url = eventDef.url; 40317 var classes = ['fc-list-item'].concat(this.getClasses(eventDef)); 40318 var bgColor = this.getBgColor(eventDef); 40319 var timeHtml; 40320 if (componentFootprint.isAllDay) { 40321 timeHtml = view.getAllDayHtml(); 40322 } 40323 else if (view.isMultiDayRange(componentFootprint.unzonedRange)) { 40324 if (seg.isStart || seg.isEnd) { 40325 timeHtml = util_1.htmlEscape(this._getTimeText(calendar.msToMoment(seg.startMs), calendar.msToMoment(seg.endMs), componentFootprint.isAllDay)); 40326 } 40327 else { 40328 timeHtml = view.getAllDayHtml(); 40329 } 40330 } 40331 else { 40332 // Display the normal time text for the *event's* times 40333 timeHtml = util_1.htmlEscape(this.getTimeText(eventFootprint)); 40334 } 40335 if (url) { 40336 classes.push('fc-has-url'); 40337 } 40338 return '<tr class="' + classes.join(' ') + '">' + 40339 (this.displayEventTime ? 40340 '<td class="fc-list-item-time ' + theme.getClass('widgetContent') + '">' + 40341 (timeHtml || '') + 40342 '</td>' : 40343 '') + 40344 '<td class="fc-list-item-marker ' + theme.getClass('widgetContent') + '">' + 40345 '<span class="fc-event-dot"' + 40346 (bgColor ? 40347 ' style="background-color:' + bgColor + '"' : 40348 '') + 40349 '></span>' + 40350 '</td>' + 40351 '<td class="fc-list-item-title ' + theme.getClass('widgetContent') + '">' + 40352 '<a' + (url ? ' href="' + util_1.htmlEscape(url) + '"' : '') + '>' + 40353 util_1.htmlEscape(eventDef.title || '') + 40354 '</a>' + 40355 '</td>' + 40356 '</tr>'; 40357 }; 40358 // like "4:00am" 40359 ListEventRenderer.prototype.computeEventTimeFormat = function () { 40360 return this.opt('mediumTimeFormat'); 40361 }; 40362 return ListEventRenderer; 40363}(EventRenderer_1.default)); 40364exports.default = ListEventRenderer; 40365 40366 40367/***/ }), 40368/* 255 */ 40369/***/ (function(module, exports, __webpack_require__) { 40370 40371Object.defineProperty(exports, "__esModule", { value: true }); 40372var tslib_1 = __webpack_require__(2); 40373var $ = __webpack_require__(3); 40374var EventPointing_1 = __webpack_require__(59); 40375var ListEventPointing = /** @class */ (function (_super) { 40376 tslib_1.__extends(ListEventPointing, _super); 40377 function ListEventPointing() { 40378 return _super !== null && _super.apply(this, arguments) || this; 40379 } 40380 // for events with a url, the whole <tr> should be clickable, 40381 // but it's impossible to wrap with an <a> tag. simulate this. 40382 ListEventPointing.prototype.handleClick = function (seg, ev) { 40383 var url; 40384 _super.prototype.handleClick.call(this, seg, ev); // might prevent the default action 40385 // not clicking on or within an <a> with an href 40386 if (!$(ev.target).closest('a[href]').length) { 40387 url = seg.footprint.eventDef.url; 40388 if (url && !ev.isDefaultPrevented()) { 40389 window.location.href = url; // simulate link click 40390 } 40391 } 40392 }; 40393 return ListEventPointing; 40394}(EventPointing_1.default)); 40395exports.default = ListEventPointing; 40396 40397 40398/***/ }), 40399/* 256 */ 40400/***/ (function(module, exports, __webpack_require__) { 40401 40402Object.defineProperty(exports, "__esModule", { value: true }); 40403var EventSourceParser_1 = __webpack_require__(38); 40404var ArrayEventSource_1 = __webpack_require__(52); 40405var FuncEventSource_1 = __webpack_require__(215); 40406var JsonFeedEventSource_1 = __webpack_require__(216); 40407EventSourceParser_1.default.registerClass(ArrayEventSource_1.default); 40408EventSourceParser_1.default.registerClass(FuncEventSource_1.default); 40409EventSourceParser_1.default.registerClass(JsonFeedEventSource_1.default); 40410 40411 40412/***/ }), 40413/* 257 */ 40414/***/ (function(module, exports, __webpack_require__) { 40415 40416Object.defineProperty(exports, "__esModule", { value: true }); 40417var ThemeRegistry_1 = __webpack_require__(51); 40418var StandardTheme_1 = __webpack_require__(213); 40419var JqueryUiTheme_1 = __webpack_require__(214); 40420var Bootstrap3Theme_1 = __webpack_require__(258); 40421var Bootstrap4Theme_1 = __webpack_require__(259); 40422ThemeRegistry_1.defineThemeSystem('standard', StandardTheme_1.default); 40423ThemeRegistry_1.defineThemeSystem('jquery-ui', JqueryUiTheme_1.default); 40424ThemeRegistry_1.defineThemeSystem('bootstrap3', Bootstrap3Theme_1.default); 40425ThemeRegistry_1.defineThemeSystem('bootstrap4', Bootstrap4Theme_1.default); 40426 40427 40428/***/ }), 40429/* 258 */ 40430/***/ (function(module, exports, __webpack_require__) { 40431 40432Object.defineProperty(exports, "__esModule", { value: true }); 40433var tslib_1 = __webpack_require__(2); 40434var Theme_1 = __webpack_require__(19); 40435var Bootstrap3Theme = /** @class */ (function (_super) { 40436 tslib_1.__extends(Bootstrap3Theme, _super); 40437 function Bootstrap3Theme() { 40438 return _super !== null && _super.apply(this, arguments) || this; 40439 } 40440 return Bootstrap3Theme; 40441}(Theme_1.default)); 40442exports.default = Bootstrap3Theme; 40443Bootstrap3Theme.prototype.classes = { 40444 widget: 'fc-bootstrap3', 40445 tableGrid: 'table-bordered', 40446 tableList: 'table', 40447 tableListHeading: 'active', 40448 buttonGroup: 'btn-group', 40449 button: 'btn btn-default', 40450 stateActive: 'active', 40451 stateDisabled: 'disabled', 40452 today: 'alert alert-info', 40453 popover: 'panel panel-default', 40454 popoverHeader: 'panel-heading', 40455 popoverContent: 'panel-body', 40456 // day grid 40457 // for left/right border color when border is inset from edges (all-day in agenda view) 40458 // avoid `panel` class b/c don't want margins/radius. only border color. 40459 headerRow: 'panel-default', 40460 dayRow: 'panel-default', 40461 // list view 40462 listView: 'panel panel-default' 40463}; 40464Bootstrap3Theme.prototype.baseIconClass = 'glyphicon'; 40465Bootstrap3Theme.prototype.iconClasses = { 40466 close: 'glyphicon-remove', 40467 prev: 'glyphicon-chevron-left', 40468 next: 'glyphicon-chevron-right', 40469 prevYear: 'glyphicon-backward', 40470 nextYear: 'glyphicon-forward' 40471}; 40472Bootstrap3Theme.prototype.iconOverrideOption = 'bootstrapGlyphicons';
40473Bootstrap3Theme.prototype.iconOverrideCustomButtonOption = 'bootstrapGlyphicon'; 40474Bootstrap3Theme.prototype.iconOverridePrefix = 'glyphicon-'; 40475 40476 40477/***/ }), 40478/* 259 */ 40479/***/ (function(module, exports, __webpack_require__) { 40480 40481Object.defineProperty(exports, "__esModule", { value: true }); 40482var tslib_1 = __webpack_require__(2); 40483var Theme_1 = __webpack_require__(19); 40484var Bootstrap4Theme = /** @class */ (function (_super) { 40485 tslib_1.__extends(Bootstrap4Theme, _super); 40486 function Bootstrap4Theme() { 40487 return _super !== null && _super.apply(this, arguments) || this; 40488 } 40489 return Bootstrap4Theme; 40490}(Theme_1.default)); 40491exports.default = Bootstrap4Theme; 40492Bootstrap4Theme.prototype.classes = { 40493 widget: 'fc-bootstrap4', 40494 tableGrid: 'table-bordered', 40495 tableList: 'table', 40496 tableListHeading: 'table-active', 40497 buttonGroup: 'btn-group', 40498 button: 'btn btn-primary', 40499 stateActive: 'active', 40500 stateDisabled: 'disabled', 40501 today: 'alert alert-info', 40502 popover: 'card card-primary', 40503 popoverHeader: 'card-header', 40504 popoverContent: 'card-body', 40505 // day grid 40506 // for left/right border color when border is inset from edges (all-day in agenda view) 40507 // avoid `table` class b/c don't want margins/padding/structure. only border color. 40508 headerRow: 'table-bordered', 40509 dayRow: 'table-bordered', 40510 // list view 40511 listView: 'card card-primary' 40512}; 40513Bootstrap4Theme.prototype.baseIconClass = 'fa'; 40514Bootstrap4Theme.prototype.iconClasses = { 40515 close: 'fa-times', 40516 prev: 'fa-chevron-left', 40517 next: 'fa-chevron-right', 40518 prevYear: 'fa-angle-double-left', 40519 nextYear: 'fa-angle-double-right' 40520}; 40521Bootstrap4Theme.prototype.iconOverrideOption = 'bootstrapFontAwesome'; 40522Bootstrap4Theme.prototype.iconOverrideCustomButtonOption = 'bootstrapFontAwesome'; 40523Bootstrap4Theme.prototype.iconOverridePrefix = 'fa-'; 40524 40525 40526/***/ }), 40527/* 260 */ 40528/***/ (function(module, exports, __webpack_require__) { 40529 40530Object.defineProperty(exports, "__esModule", { value: true }); 40531var ViewRegistry_1 = __webpack_require__(22); 40532var BasicView_1 = __webpack_require__(62); 40533var MonthView_1 = __webpack_require__(229); 40534ViewRegistry_1.defineView('basic', { 40535 'class': BasicView_1.default 40536}); 40537ViewRegistry_1.defineView('basicDay', { 40538 type: 'basic', 40539 duration: { days: 1 } 40540}); 40541ViewRegistry_1.defineView('basicWeek', { 40542 type: 'basic', 40543 duration: { weeks: 1 } 40544}); 40545ViewRegistry_1.defineView('month', { 40546 'class': MonthView_1.default, 40547 duration: { months: 1 }, 40548 defaults: { 40549 fixedWeekCount: true 40550 } 40551}); 40552 40553 40554/***/ }), 40555/* 261 */ 40556/***/ (function(module, exports, __webpack_require__) { 40557 40558Object.defineProperty(exports, "__esModule", { value: true }); 40559var ViewRegistry_1 = __webpack_require__(22); 40560var AgendaView_1 = __webpack_require__(226); 40561ViewRegistry_1.defineView('agenda', { 40562 'class': AgendaView_1.default, 40563 defaults: { 40564 allDaySlot: true, 40565 slotDuration: '00:30:00', 40566 slotEventOverlap: true // a bad name. confused with overlap/constraint system 40567 } 40568}); 40569ViewRegistry_1.defineView('agendaDay', { 40570 type: 'agenda', 40571 duration: { days: 1 } 40572}); 40573ViewRegistry_1.defineView('agendaWeek', { 40574 type: 'agenda', 40575 duration: { weeks: 1 } 40576}); 40577 40578 40579/***/ }), 40580/* 262 */ 40581/***/ (function(module, exports, __webpack_require__) { 40582 40583Object.defineProperty(exports, "__esModule", { value: true }); 40584var ViewRegistry_1 = __webpack_require__(22); 40585var ListView_1 = __webpack_require__(230); 40586ViewRegistry_1.defineView('list', { 40587 'class': ListView_1.default, 40588 buttonTextKey: 'list', 40589 defaults: { 40590 buttonText: 'list', 40591 listDayFormat: 'LL', 40592 noEventsMessage: 'No events to display' 40593 } 40594}); 40595ViewRegistry_1.defineView('listDay', { 40596 type: 'list', 40597 duration: { days: 1 }, 40598 defaults: { 40599 listDayFormat: 'dddd' // day-of-week is all we need. full date is probably in header 40600 } 40601}); 40602ViewRegistry_1.defineView('listWeek', { 40603 type: 'list', 40604 duration: { weeks: 1 }, 40605 defaults: { 40606 listDayFormat: 'dddd', 40607 listDayAltFormat: 'LL' 40608 } 40609}); 40610ViewRegistry_1.defineView('listMonth', { 40611 type: 'list', 40612 duration: { month: 1 }, 40613 defaults: { 40614 listDayAltFormat: 'dddd' // day-of-week is nice-to-have 40615 } 40616}); 40617ViewRegistry_1.defineView('listYear', { 40618 type: 'list', 40619 duration: { year: 1 }, 40620 defaults: { 40621 listDayAltFormat: 'dddd' // day-of-week is nice-to-have 40622 } 40623}); 40624 40625 40626/***/ }), 40627/* 263 */
40628/***/ (function(module, exports) { 40629 40630Object.defineProperty(exports, "__esModule", { value: true }); 40631 40632 40633/***/ }) 40634/******/ ]); 40635}); 40636(function() { 40637 var Line, 40638 bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; 40639 40640 Line = (function() { 40641 function Line(params, type, vats, parent_payment_type_id, vat_dac_mode) { 40642 var ref, ref1, ref2; 40643 if (vat_dac_mode == null) { 40644 vat_dac_mode = null; 40645 } 40646 if (params == null) { 40647 params = {}; 40648 } 40649 ref = [params.name, params.unit_name, type, params.id], this.name = ref[0], this.unit_name = ref[1], this.type = ref[2], this.id = ref[3]; 40650 this.errors = params.errors || {}; 40651 this.quantity = ko.observable(params.quantity || 1); 40652 this.unit_price = ko.observable(params.unit_price || 0); 40653 this.discount_percentage = ko.observable(params.discount_percentage || 0); 40654 ref1 = [ko.observable(params.vat_id), ko.observable(params.payment_type_id), ko.observable(false)], this.vat_id = ref1[0], this.payment_type_id = ref1[1], this.destroyed = ref1[2]; 40655 ref2 = [parent_payment_type_id, vat_dac_mode], this.parent_payment_type_id = ref2[0], this.vat_dac_mode = ref2[1]; 40656 this.vat = ko.computed((function(_this) { 40657 return function() { 40658 if (_this.vat_id()) { 40659 return _.find(vats(), function(obj) { 40660 return obj.id === _this.vat_id(); 40661 }).value; 40662 } 40663 }; 40664 })(this)); 40665 this.base_price = ko.computed((function(_this) { 40666 return function() { 40667 if (!_.isNaN(parseFloat(_this.quantity()))) { 40668 fix_input_characters(_this.quantity); 40669 } 40670 if (!_.isNaN(parseFloat(_this.unit_price()))) { 40671 fix_input_characters(_this.unit_price); 40672 } 40673 return _this.quantity() * _this.unit_price() - (_this.quantity() * _this.unit_price() * _this.discount_percentage() * 0.01); 40674 }; 40675 })(this)); 40676 this.tax = ko.computed((function(_this) { 40677 return function() { 40678 var vat_rate; 40679 vat_rate = (_this.vat_dac_mode != null) && _this.vat_dac_mode() === 2 ? 0.0 : _this.vat() / 100; 40680 return _this.base_price() * vat_rate; 40681 }; 40682 })(this)); 40683 this.total = ko.computed((function(_this) { 40684 return function() { 40685 if ((_this.vat_dac_mode != null) && _this.vat_dac_mode() === 3) { 40686 return _this.base_price(); 40687 } else { 40688 return _this.base_price() + _this.tax(); 40689 } 40690 }; 40691 })(this)); 40692 } 40693 40694 Line.prototype.changeParentPaymentType = function(obj, event) { 40695 if (!_.isUndefined(event.val)) { 40696 if (parseInt(this.payment_type_id()) !== parseInt(this.parent_payment_type_id())) { 40697 return this.parent_payment_type_id(null); 40698 } 40699 } 40700 }; 40701 40702 Line.prototype.attrName = function(index, name) { 40703 return this.type + "[lines_attributes][" + index + "][" + name + "]"; 40704 }; 40705 40706 return Line; 40707 40708 })(); 40709 40710 this.LineCalculator = (function() { 40711 function LineCalculator(params) { 40712 this.removeLine = bind(this.removeLine, this); 40713 var ref, ref1, ref2; 40714 ref = [params.is_taxable, params.is_used_in_vat_declaration, params.is_identified_person], this.is_taxable = ref[0], this.is_used_in_vat_declaration = ref[1], this.is_identified_person = ref[2]; 40715 ref1 = [params.vats, ko.observableArray(params.payment_types), ko.observable(params.show_lines), params.is_selected_in_lines], this.vats = ref1[0], this.payment_types = ref1[1], this.show_lines = ref1[2], this.is_selected_in_lines = ref1[3]; 40716 ref2 = [params.currency_iso, params.parent_payment_type_id, params.vat_regime_id, ko.observable(params.document_type), params.amounts_document_type], this.currency_iso = ref2[0], this.parent_payment_type_id = ref2[1], this.vat_regime_id = ref2[2], this.document_type = ref2[3], this.amounts_document_type = ref2[4]; 40717 this.lines = ko.observableArray(_.map(params.lines, (function(_this) { 40718 return function(l) { 40719 return new Line(l, params.type, _this.vats, _this.parent_payment_type_id, params.vat_dac_mode); 40720 }; 40721 })(this))); 40722 this.vat_dac_mode = params.vat_dac_mode; 40723 this.params = params; 40724 this.hide_vats = ko.computed((function(_this) { 40725 return function() { 40726 if (params.type === "actuarials_out") { 40727 if (_this.is_identified_person) { 40728 return _.contains([1], parseInt(_this.vat_regime_id())); 40729 } else { 40730 return !_this.is_taxable || !_.contains([1, 2], parseInt(_this.vat_regime_id())); 40731 } 40732 } else { 40733 return !_this.is_taxable; 40734 } 40735 }; 40736 })(this)); 40737 this.vat_regime = ko.computed((function(_this) { 40738 return function() { 40739 if (_this.vat_regime_id == null) { 40740 return; 40741 } 40742 if (!_.contains([1, 2], parseInt(_this.vat_regime_id())) && _this.vat_regime_id()) { 40743 return _.each(_this.lines(), function(l) { 40744 return l.vat_id(_this.params.zero_vat_id); 40745 }); 40746 } 40747 }; 40748 })(this)); 40749 this.active_lines = ko.computed((function(_this) { 40750 return function() { 40751 return _.filter(_this.lines(), function(line) { 40752 return line.destroyed() === false; 40753 }); 40754 }; 40755 })(this)); 40756 ko.computed((function(_this) { 40757 return function() { 40758 var is_payment_type_in_lines_selected; 40759 _this.is_selected_in_lines(false); 40760 if ((_this.parent_payment_type_id() != null) && !_.isEmpty(_this.parent_payment_type_id())) { 40761 return _.each(_this.lines(), function(l) { 40762 return l.payment_type_id(_this.parent_payment_type_id()); 40763 }); 40764 } else if ((_this.parent_payment_type_id() != null) && _.isEmpty(_this.parent_payment_type_id())) { 40765 is_payment_type_in_lines_selected = _.find(_this.active_lines(), function(l) { 40766 return l.payment_type_id() !== void 0 && l.payment_type_id() !== null; 40767 }); 40768 if (!_.isUndefined(is_payment_type_in_lines_selected)) { 40769 return _this.is_selected_in_lines(true); 40770 } 40771 } 40772 }; 40773 })(this)); 40774 this.totalPriceWithoutVat = ko.computed((function(_this) { 40775 return function() { 40776 return _.numberFormat(_.reduce(_this.active_lines(), (function(memo, line) { 40777 return memo + line.base_price(); 40778 }), 0), 2, ',', ' ') + (" " + (_this.currency_iso())); 40779 }; 40780 })(this)); 40781 this.totalEndPrice = ko.computed((function(_this) { 40782 return function() { 40783 return _.numberFormat(_.reduce(_this.active_lines(), (function(memo, line) { 40784 return memo + line.total(); 40785 }), 0), 2, ',', ' ') + (" " + (_this.currency_iso())); 40786 }; 40787 })(this)); 40788 this.sum_values = ko.computed((function(_this) { 40789 return function() { 40790 var base_price, lines_sum, tax, total, values, vat, vats_group; 40791 vats_group = _.groupBy(_.sortBy(_this.active_lines(), function(line) { 40792 return -line.vat(); 40793 }), function(line) { 40794 return line.vat(); 40795 }); 40796 lines_sum = (function() { 40797 var results; 40798 results = []; 40799 for (vat in vats_group) { 40800 values = vats_group[vat]; 40801 base_price = _.reduce(values, (function(memo, line) { 40802 return memo + line.base_price(); 40803 }), 0); 40804 tax = _.reduce(values, (function(memo, line) { 40805 return memo + line.tax(); 40806 }), 0); 40807 total = _.reduce(values, (function(memo, line) { 40808 return memo + line.total(); 40809 }), 0); 40810 results.push({ 40811 vat: vat + "%", 40812 base_price: (_.numberFormat(_.num.round(base_price, 2), 2, ',', ' ')) + " " + (this.currency_iso()), 40813 tax: (_.numberFormat(_.num.round(tax, 2), 2, ',', ' ')) + " " + (this.currency_iso()), 40814 total: (_.numberFormat(_.num.round(total, 2), 2, ',', ' ')) + " " + (this.currency_iso()), 40815 value_without_vat_claim: (_.numberFormat(_.num.round(base_price, 2), 2, ',', ' ')) + " " + (this.currency_iso()), 40816 value_claim: (_.numberFormat(_.num.round(tax, 2), 2, ',', ' ')) + " " + (this.currency_iso()), 40817 value_duty: (_.numberFormat(_.num.round(-tax, 2), 2, ',', ' ')) + " " + (this.currency_iso()), 40818 value_with_vat_duty: (_.numberFormat(_.num.round(base_price, 2), 2, ',', ' ')) + " " + (this.currency_iso()) 40819 }); 40820 } 40821 return results; 40822 }).call(_this); 40823 return lines_sum; 40824 }; 40825 })(this)); 40826 } 40827 40828 LineCalculator.prototype.initLineView = function(element, model) { 40829 return $(element).find("select").select2({ 40830 minimumResultsForSearch: "-1", 40831 width: "off" 40832 }); 40833 }; 40834 40835 LineCalculator.prototype.addLine = function() { 40836 return this.lines.push(new Line({}, this.params.type, this.vats, this.parent_payment_type_id, this.params.vat_dac_mode)); 40837 }; 40838 40839 LineCalculator.prototype.removeLine = function(line) { 40840 return line.destroyed(true); 40841 }; 40842 40843 LineCalculator.prototype.showLine = function() { 40844 this.show_lines(true); 40845 return this.document_type(this.params.line_document_type); 40846 }; 40847 40848 LineCalculator.prototype.showPayments = function() { 40849 return this.document_type(this.params.payments_document_type); 40850 }; 40851 40852 return LineCalculator; 40853 40854 })(); 40855 40856}).call(this); 40857(function() { 40858 this.ActuarialSettings = (function() { 40859 function ActuarialSettings(params) { 40860 var ref, ref1, ref2, ref3; 40861 this.params = params; 40862 ref = [params.is_taxable, params.is_correcting_type], this.is_taxable = ref[0], this.is_correcting_type = ref[1]; 40863 ref1 = [ko.observable(params.number), ko.observable(params.last_number), ko.observable(params.issue_date_at), ko.observable(params.uzp_date_at), ko.observable(params.currency_id), ko.observable(params.currency_iso)], this.number = ref1[0], this.last_number = ref1[1], this.issue_date_at = ref1[2], this.uzp_date_at = ref1[3], this.currency_id = ref1[4], this.currency_iso = ref1[5]; 40864 ref2 = [ko.observable(params.due_date), ko.observable(params.payment_type_id), ko.observable(params.vat_regime_id)], this.due_date = ref2[0], this.payment_type_id = ref2[1], this.vat_regime_id = ref2[2]; 40865 ref3 = [ko.observable(params.vats), ko.observable(), ko.observable(params.is_selected_in_lines), ko.observable()], this.vats = ref3[0], this.show_lines = ref3[1], this.is_selected_in_lines = ref3[2], this.vat_dac_mode = ref3[3]; 40866 this.acquisition_tax = ko.observable(); 40867 this.account_id = ko.observable(params.account_id); 40868 this.is_account_with_qr_code = ko.observable(params.is_account_with_qr_code); 40869 this.variable_symbol = ko.computed((function(_this) { 40870 return function() { 40871 return _this.number().replace(/\D/g, '').substring(0, 10); 40872 }; 40873 })(this)); 40874 this.due_date_at = ko.computed((function(_this) { 40875 return function() { 40876 if (_.contains(_this.params.due_dates, parseInt(_this.due_date()))) { 40877 return moment(_this.issue_date_at(), "DD-MM-YYYY").add(_this.due_date(), 'days').format("DD. MM. YYYY"); 40878 } else { 40879 return _this.params.due_date_at; 40880 } 40881 }; 40882 })(this)); 40883 ko.computed((function(_this) { 40884 return function() { 40885 var iso_code; 40886 iso_code = _.findWhere(_this.params.currencies, { 40887 id: parseInt(_this.currency_id()) 40888 }).iso_code; 40889 return _this.currency_iso(iso_code); 40890 }; 40891 })(this)); 40892 ko.computed((function(_this) { 40893 return function() { 40894 var vat_regime; 40895 vat_regime = _.findWhere(_this.params.vat_regimes, { 40896 id: parseInt(_this.vat_regime_id()) 40897 }); 40898 _this.acquisition_tax(vat_regime.acquisition_tax); 40899 if (_this.params.type === "actuarials_out") { 40900 return _this.vat_dac_mode(vat_regime.rate); 40901 } else { 40902 return _this.vat_dac_mode(vat_regime.acquisition_tax ? 3 : 1); 40903 } 40904 }; 40905 })(this)); 40906 ko.computed((function(_this) { 40907 return function() { 40908 if ((_this.show_lines != null) && _this.show_lines()) { 40909 return _this.showLines(); 40910 } 40911 }; 40912 })(this)); 40913 this.show_supply_code = ko.computed((function(_this) { 40914 return function() { 40915 return _.contains([2], parseInt(_this.vat_regime_id())); 40916 }; 40917 })(this)); 40918 } 40919 40920 ActuarialSettings.prototype.changeAccount = function(view, data) { 40921 return this.account_id(data.target.value); 40922 }; 40923 40924 ActuarialSettings.prototype.changeUzpDateAt = function(view, data) { 40925 this.issue_date_at($(data.target).val()); 40926 if (this.params.uzp_date_at_required || $('#actuarials_out_uzp_date_at').val().length > 0) { 40927 this.uzp_date_at(data.target.value); 40928 } 40929 return this.loadVatsAndDocumentNumber(view, data); 40930 }; 40931 40932 ActuarialSettings.prototype.loadVatsAndDocumentNumber = function(view, data) { 40933 this.getDocumentNumber(view, data); 40934 return this.loadVats(view, data); 40935 }; 40936 40937 ActuarialSettings.prototype.getDocumentNumber = function(view, data) { 40938 if (!this.params.number_disabled) { 40939 return $.getJSON("" + this.params.get_actuarial_number_path, { 40940 uzp_date_at: data.target.value, 40941 issue_date_at: this.issue_date_at(), 40942 type: this.params.type, 40943 actuarial_type_id: this.params.actuarial_type_id 40944 }).done((function(_this) { 40945 return function(numbers) { 40946 _this.number(numbers.number); 40947 return _this.last_number(numbers.last_number); 40948 }; 40949 })(this)); 40950 } 40951 }; 40952 40953 ActuarialSettings.prototype.loadVats = function(view, date) { 40954 if (this.is_taxable && !this.is_correcting_type) { 40955 return $.getJSON("" + this.params.load_vats_for_date_path, { 40956 uzp_date_at: date.target.value, 40957 issue_date_at: this.issue_date_at() 40958 }).done((function(_this) { 40959 return function(vats) { 40960 return _this.vats(vats); 40961 }; 40962 })(this)); 40963 } 40964 }; 40965 40966 return ActuarialSettings; 40967 40968 })(); 40969 40970}).call(this); 40971(function() { 40972 this.Partner = (function() { 40973 function Partner(params) { 40974 var ref, ref1; 40975 this.params = params; 40976 this.partner_inputs = ko.observable(false); 40977 ref = [ko.observable(params.partner_street), ko.observable(params.partner_city), ko.observable(params.partner_zip), ko.observable(params.partner_country_id),
40977ko.observable(params.partner_ic), ko.observable(params.partner_dic), ko.observable(params.partner_is_taxable)], this.partner_street = ref[0], this.partner_city = ref[1], this.partner_zip = ref[2], this.partner_country_id = ref[3], this.partner_ic = ref[4], this.partner_dic = ref[5], this.partner_is_taxable = ref[6]; 40978 ref1 = [ko.observable(params.partner_name), ko.observable(params.partner_id), ko.observable(params.partner_email), ko.observable(params.currency_id), ko.observable(params.partner_language), ko.observable(params.partner_reminders)], this.partner_name = ref1[0], this.partner_id = ref1[1], this.partner_email = ref1[2], this.partner_currency_id = ref1[3], this.partner_language = ref1[4], this.partner_reminders = ref1[5]; 40979 this.default_due = ko.observable(params.default_due); 40980 this.is_default_partner = ko.observable(params.is_default_partner); 40981 this.partner_country_name = ko.computed((function(_this) { 40982 return function() { 40983 if (_this.partner_country_id()) { 40984 return _.find(_this.params.countries, function(obj) { 40985 return obj.id === parseInt(_this.partner_country_id()); 40986 }).name; 40987 } 40988 }; 40989 })(this)); 40990 this.account_id = params.account_id; 40991 this.is_account_with_qr_code = ko.observable(params.is_account_with_qr_code); 40992 this.is_account_qr_default = ko.observable(params.is_account_qr_default); 40993 this.qr_codes_account_ids = params.qr_codes_account_ids; 40994 this.qr_codes_default_account_ids = params.qr_codes_default_account_ids; 40995 if (this.account_id != null) { 40996 this.is_account_with_qr_code(_.contains(this.qr_codes_account_ids, parseInt(this.account_id()))); 40997 this.is_account_qr_default(_.contains(this.qr_codes_default_account_ids, parseInt(this.account_id()))); 40998 this.account_id.subscribe((function(_this) { 40999 return function(account_id) { 41000 _this.is_account_with_qr_code(_.contains(_this.qr_codes_account_ids, parseInt(account_id))); 41001 return _this.is_account_qr_default(_.contains(_this.qr_codes_default_account_ids, parseInt(account_id))); 41002 }; 41003 })(this)); 41004 } 41005 } 41006 41007 Partner.prototype.showPartnerSetting = function() { 41008 return this.partner_inputs(!this.partner_inputs()); 41009 }; 41010 41011 Partner.prototype.loadPartner = function(view, element) { 41012 if (!_.isEmpty(this.partner_id())) { 41013 return $.getJSON("" + this.params.load_partner_data_path, { 41014 partner_id: this.partner_id() 41015 }).done((function(_this) { 41016 return function(partner) { 41017 _this.partner_name(partner.name); 41018 _this.partner_email(partner.email); 41019 _this.default_due(partner.default_due); 41020 $("#actuarials_out_due_date, #actuarials_in_due_date").trigger("change"); 41021 if (!partner.is_default_partner) { 41022 _this.partner_street(partner.address.street); 41023 _this.partner_city(partner.address.city); 41024 _this.partner_zip(partner.address.zip); 41025 _this.partner_country_id(partner.address.country_id); 41026 _this.partner_currency_id(partner.currency_id); 41027 _this.partner_language(partner.invoicing_language); 41028 _this.partner_ic(partner.ic); 41029 _this.partner_dic(partner.dic); 41030 _this.partner_is_taxable(partner.is_taxable); 41031 _this.partner_reminders(partner.reminders); 41032 _this.is_default_partner(false); 41033 return $("#cash_vouchers_in_language").trigger("change"); 41034 } else { 41035 _this.partner_street(""); 41036 _this.partner_city(""); 41037 _this.partner_zip(""); 41038 _this.partner_country_id(""); 41039 _this.partner_ic(""); 41040 _this.partner_dic(""); 41041 _this.partner_is_taxable(""); 41042 _this.partner_reminders(false); 41043 return _this.is_default_partner(true); 41044 } 41045 }; 41046 })(this)); 41047 } 41048 }; 41049 41050 return Partner; 41051 41052 })(); 41053 41054}).call(this); 41055(function() { 41056 var Amount; 41057 41058 Amount = (function() { 41059 function Amount(params, type, vat_dac_mode) { 41060 var ref, ref1; 41061 if (vat_dac_mode == null) { 41062 vat_dac_mode = null; 41063 } 41064 if (params == null) { 41065 params = {}; 41066 } 41067 ref = [ko.observable(params.base_price), ko.observable(params.tax), ko.observable(params.total_price), params.id, type, ko.observable(isNaN(params.tax) ? "" : -params.tax)], this.base_price = ref[0], this.tax = ref[1], this.total_price = ref[2], this.id = ref[3], this.type = ref[4], this.vat_duty = ref[5]; 41068 ref1 = [params.vat.value, vat_dac_mode], this.vat_value = ref1[0], this.vat_dac_mode = ref1[1]; 41069 this.vat_label = params.vat.vat_type.name + " " + params.vat.value + "%"; 41070 this.vat_rate = params.vat.value / 100; 41071 this.vat_id = params.vat_id; 41072 this.destroyed = ko.observable(false); 41073 } 41074 41075 Amount.prototype.basePriceChanged = function() { 41076 var tax, total_price;
41077 if (!_.isNaN(parseFloat(this.base_price()))) { 41078 fix_input_characters(this.base_price); 41079 } 41080 if (_.isNaN(parseFloat(this.base_price()))) { 41081 this.tax(null); 41082 return this.total_price(null); 41083 } else { 41084 tax = Math.round(parseFloat(this.base_price()) * this.vat_rate * 100) / 100; 41085 if ((this.vat_dac_mode != null) && this.vat_dac_mode() === 3) { 41086 total_price = this.base_price(); 41087 } else { 41088 total_price = Math.round((parseFloat(this.base_price()) + parseFloat(tax)) * 100) / 100; 41089 } 41090 this.tax(tax); 41091 this.total_price(total_price); 41092 return this.vat_duty(isNaN(tax) ? "" : -tax); 41093 } 41094 }; 41095 41096 Amount.prototype.taxChanged = function() { 41097 if (!_.isNaN(parseFloat(this.tax()))) { 41098 fix_input_characters(this.tax); 41099 } 41100 if (_.isNaN(parseFloat(this.base_price()))) { 41101 return; 41102 } 41103 if ((this.vat_dac_mode != null) && this.vat_dac_mode() === 3) { 41104 return this.total_price(this.base_price()); 41105 } else { 41106 return this.total_price(parseFloat(this.base_price()) + parseFloat(this.tax())); 41107 } 41108 }; 41109 41110 Amount.prototype.totalPriceChanged = function() { 41111 var targetPrice, tax; 41112 if (!_.isNaN(parseFloat(this.total_price()))) { 41113 fix_input_characters(this.total_price); 41114 } 41115 if (_.isNaN(parseFloat(this.total_price()))) { 41116 return; 41117 } 41118 tax = Math.round((this.total_price() - this.total_price() / (this.vat_rate + 1)) * 100) / 100; 41119 targetPrice = Math.round((this.total_price() - tax) * 100) / 100; 41120 this.tax(tax); 41121 this.base_price(targetPrice); 41122 return this.vat_duty(isNaN(tax) ? "" : -tax); 41123 }; 41124 41125 Amount.prototype.attrName = function(index, nested_attributes_name, name) { 41126 return this.type + "[" + nested_attributes_name + "][" + index + "][" + name + "]"; 41127 }; 41128 41129 return Amount; 41130 41131 })(); 41132 41133 this.AmountsCalculator = (function() { 41134 function AmountsCalculator(params) { 41135 var ref, ref1; 41136 ref = [params.is_used_in_vat_declaration, params.vats, params.currency_iso, ko.observable(params.show_amounts)], this.is_used_in_vat_declaration = ref[0], this.vats = ref[1], this.currency_iso = ref[2], this.show_amounts = ref[3]; 41137 ref1 = [params.document_type, params.vat_dac_mode], this.document_type = ref1[0], this.vat_dac_mode = ref1[1]; 41138 this.amounts = ko.observableArray(_.map(params.amounts, (function(_this) { 41139 return function(l) { 41140 return new Amount(l, params.type, _this.vat_dac_mode); 41141 }; 41142 })(this))); 41143 this.params = params; 41144 ko.computed((function(_this) { 41145 return function() { 41146 return _this.show_amounts(_.contains(_this.params.amounts_document_type, parseInt(_this.document_type()))); 41147 }; 41148 })(this)); 41149 this.active_amounts = ko.computed((function(_this) { 41150 return function() { 41151 return _.filter(_this.amounts(), function(amount) { 41152 return amount.destroyed() === false; 41153 }); 41154 }; 41155 })(this)); 41156 this.totalEndPrice = ko.computed((function(_this) { 41157 return function() { 41158 return _.numberFormat(_.reduce(_this.active_amounts(), (function(memo, amount) { 41159 if (_.isNaN(parseFloat(amount.total_price()))) { 41160 return memo + 0; 41161 } else { 41162 return memo + parseFloat(amount.total_price()); 41163 } 41164 }), 0), 2, ',', ' ') + (" " + (_this.currency_iso())); 41165 }; 41166 })(this)); 41167 ko.computed((function(_this) { 41168 return function() { 41169 _.each(_this.amounts(), function(amount) { 41170 if (!_.contains(_.pluck(_this.vats(), 'id'), parseInt(amount.vat_id))) { 41171 return amount.destroyed(true); 41172 } else { 41173 return amount.destroyed(false); 41174 } 41175 }); 41176 _.each(_.filter(_this.vats(), function(vat) { 41177 return !_.contains(_.pluck(_this.amounts(), 'vat_id'), vat.id); 41178 }), function(vat) { 41179 return _this.amounts.push(new Amount({ 41180 vat_id: vat.id, 41181 vat: vat 41182 }, _this.params.type, _this.vat_dac_mode)); 41183 }); 41184 return _this.amounts(_.sortBy(_this.amounts(), function(amount) { 41185 return -amount.vat_value; 41186 })); 41187 }; 41188 })(this)); 41189 } 41190 41191 return AmountsCalculator; 41192 41193 })(); 41194 41195}).call(this); 41196(function() { 41197 this.ActuarialFactory = (function() { 41198 function ActuarialFactory() {} 41199 41200 ActuarialFactory.prototype.setActuarialSettings = function(area, opts) { 41201 this.actuarial_settings = new ActuarialSettings(opts); 41202 return ko.applyBindings(this.actuarial_settings, $(area)[0]); 41203 }; 41204 41205 ActuarialFactory.prototype.setLines = function(area, opts) { 41206 this.line_calculator = new LineCalculator(opts); 41207 return ko.applyBindings(this.line_calculator, $(area)[0]); 41208 }; 41209 41210 ActuarialFactory.prototype.setAmounts = function(area, opts) { 41211 this.amounts_calculator = new AmountsCalculator(opts); 41212 return ko.applyBindings(this.amounts_calculator, $(area)[0]); 41213 }; 41214 41215 ActuarialFactory.prototype.setPartner = function(area, opts) { 41216 this.partner = new Partner(opts); 41217 ko.applyBindings(this.partner, $(area)[0]); 41218 this.partner.partner_currency_id = this.actuarial_settings.currency_id; 41219 return this.partner.default_due = this.actuarial_settings.due_date; 41220 }; 41221 41222 return ActuarialFactory; 41223 41224 })(); 41225 41226}).call(this); 41227(function() { 41228 var Line, 41229 bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; 41230 41231 Line = (function() { 41232 function Line(params, vats) { 41233 var ref, ref1; 41234 if (params == null) { 41235 params = {}; 41236 } 41237 ref = [params.name, params.unit_name, params.id], this.name = ref[0], this.unit_name = ref[1], this.id = ref[2]; 41238 this.errors = params.errors || {}; 41239 this.quantity = ko.observable(params.quantity || 1); 41240 this.unit_price = ko.observable(params.unit_price || 0); 41241 ref1 = [ko.observable(params.vat), ko.observable(false)], this.vat = ref1[0], this.destroyed = ref1[1]; 41242 ko.computed((function(_this) { 41243 return function() { 41244 if (_.isNaN(parseFloat(_this.vat()))) { 41245 return _this.vat(0); 41246 } 41247 }; 41248 })(this)); 41249 this.base_price = ko.computed((function(_this) { 41250 return function() { 41251 if (!_.isNaN(parseFloat(_this.quantity()))) { 41252 fix_input_characters(_this.quantity); 41253 }
41254 if (!_.isNaN(parseFloat(_this.unit_price()))) { 41255 fix_input_characters(_this.unit_price); 41256 } 41257 return _this.quantity() * _this.unit_price(); 41258 }; 41259 })(this)); 41260 this.tax = ko.computed((function(_this) { 41261 return function() { 41262 var vat_rate; 41263 vat_rate = (_this.vat_dac_mode != null) && _this.vat_dac_mode() === 2 ? 0.0 : _this.vat() / 100; 41264 return _this.base_price() * vat_rate; 41265 }; 41266 })(this)); 41267 this.total = ko.computed((function(_this) { 41268 return function() { 41269 return _this.base_price() + _this.tax(); 41270 }; 41271 })(this)); 41272 this.total_without_vat = ko.computed((function(_this) { 41273 return function() { 41274 return _this.total() - _this.tax(); 41275 }; 41276 })(this)); 41277 } 41278 41279 Line.prototype.attrName = function(index, name) { 41280 return "quick_actuarial[quick_actuarial_lines_attributes][" + index + "][" + name + "]"; 41281 }; 41282 41283 return Line; 41284 41285 })(); 41286 41287 this.QuickActuarial = (function() { 41288 function QuickActuarial(params) { 41289 this.removeLine = bind(this.removeLine, this); 41290 var ref; 41291 ref = [params, ko.observable(params.currency_iso), params.vats, ko.observable(params.currency_id), ko.observable(params.number)], this.params = ref[0], this.currency_iso = ref[1], this.vats = ref[2], this.currency_id = ref[3], this.number = ref[4]; 41292 this.lines = ko.observableArray(_.map(params.lines, (function(_this) { 41293 return function(l) { 41294 return new Line(l, _this.vats); 41295 }; 41296 })(this))); 41297 this.partnerEmail = ko.observable(params.partner_email); 41298 this.disableSend = ko.computed((function(_this) { 41299 return function() { 41300 var pattern; 41301 pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/; 41302 return !pattern.test(_this.partnerEmail()); 41303 }; 41304 })(this)); 41305 ko.computed((function(_this) { 41306 return function() { 41307 var iso_code; 41308 iso_code = _.findWhere(_this.params.currencies, { 41309 id: parseInt(_this.currency_id()) 41310 }).iso_code; 41311 return _this.currency_iso(iso_code); 41312 }; 41313 })(this)); 41314 this.variable_symbol = ko.computed((function(_this) { 41315 return function() { 41316 return _this.number().replace(/\D/g, '').substring(0, 10); 41317 }; 41318 })(this)); 41319 this.active_lines = ko.computed((function(_this) { 41320 return function() { 41321 return _.filter(_this.lines(), function(line) { 41322 return line.destroyed() === false; 41323 }); 41324 }; 41325 })(this)); 41326 this.totalPriceWithoutVat = ko.computed((function(_this) { 41327 return function() { 41328 return _.reduce(_this.active_lines(), (function(memo, line) { 41329 return memo + line.base_price(); 41330 }), 0) + (" " + (_this.currency_iso())); 41331 }; 41332 })(this)); 41333 this.totalEndPrice = ko.computed((function(_this) { 41334 return function() { 41335 return _.reduce(_this.active_lines(), (function(memo, line) { 41336 return memo + line.total(); 41337 }), 0) + (" " + (_this.currency_iso())); 41338 }; 41339 })(this)); 41340 this.sum_values = ko.computed((function(_this) { 41341 return function() { 41342 var base_price, lines_sum, tax, total, values, vat, vats_group; 41343 vats_group = _.groupBy(_.sortBy(_this.active_lines(), function(line) { 41344 return -line.vat(); 41345 }), function(line) { 41346 return line.vat(); 41347 }); 41348 lines_sum = (function() { 41349 var results; 41350 results = []; 41351 for (vat in vats_group) { 41352 values = vats_group[vat]; 41353 base_price = _.reduce(values, (function(memo, line) { 41354 return memo + line.base_price(); 41355 }), 0); 41356 tax = _.reduce(values, (function(memo, line) { 41357 return memo + line.tax(); 41358 }), 0); 41359 total = _.reduce(values, (function(memo, line) { 41360 return memo + line.total(); 41361 }), 0); 41362 results.push({ 41363 vat: vat + "%", 41364 base_price: (_.num.round(base_price, 2)) + " " + (this.currency_iso()), 41365 tax: (_.num.round(tax, 2)) + " " + (this.currency_iso()), 41366 total: (_.num.round(total, 2)) + " " + (this.currency_iso()), 41367 value_without_vat_claim: (_.num.round(base_price, 2)) + " " + (this.currency_iso()), 41368 value_claim: (_.num.round(tax, 2)) + " " + (this.currency_iso()), 41369 value_duty: (_.num.round(-tax, 2)) + " " + (this.currency_iso()), 41370 value_with_vat_duty: (_.num.round(base_price, 2)) + " " + (this.currency_iso()) 41371 }); 41372 } 41373 return results; 41374 }).call(_this); 41375 return lines_sum; 41376 }; 41377 })(this)); 41378 } 41379 41380 QuickActuarial.prototype.addLine = function() { 41381 return this.lines.push(new Line({}, this.vats)); 41382 }; 41383 41384 QuickActuarial.prototype.removeLine = function(line) { 41385 return line.destroyed(true); 41386 }; 41387 41388 return QuickActuarial; 41389 41390 })(); 41391 41392}).call(this); 41393(function() { 41394 this.CashVoucherSettings = (function() { 41395 function CashVoucherSettings(params) { 41396 var ref, ref1, ref2; 41397 this.params = params; 41398 ref = [params.is_taxable, ko.observable(params.number), ko.observable(params.account_id), ko.observable(params.transaction_date), ko.observable(params.vats)], this.is_taxable = ref[0], this.number = ref[1], this.account_id = ref[2], this.transaction_date = ref[3], this.vats = ref[4]; 41399 ref1 = [ko.observable(params.currency_iso), ko.observable(params.account_currency_id)], this.currency_iso = ref1[0], this.account_currency_id = ref1[1]; 41400 ref2 = [ko.observable(), ko.observable(params.description), ko.observable(params.is_selected_in_lines), ko.observable(params.payment_type_id)], this.show_uzp_date = ref2[0], this.description = ref2[1], this.is_selected_in_lines = ref2[2], this.payment_type_id = ref2[3]; 41401 this.is_new_record = params.is_new_record; 41402 ko.computed((function(_this) { 41403 return function() { 41404 _this.account_id(); 41405 _this.getDocumentNumber(); 41406 return _this.loadAccountCurrency(); 41407 }; 41408 })(this)); 41409 $('.datepicker').on('dp.change', (function(_this) { 41410 return function(e) { 41411 _this.transaction_date($(e.target).val()); 41412 return _this.getDocumentNumber(); 41413 }; 41414 })(this)); 41415 } 41416 41417 CashVoucherSettings.prototype.loadVats = function(view, date) { 41418 if (this.is_taxable) { 41419 return $.getJSON(this.params.load_vats_path + "?transaction_date=" + date.target.value).done((function(_this) { 41420 return function(vats) { 41421 return _this.vats(vats); 41422 }; 41423 })(this)); 41424 } 41425 }; 41426 41427 CashVoucherSettings.prototype.getDocumentNumber = function() { 41428 if (this.account_id() !== "" && (this.account_id() !== this.params.account_id || this.params.is_new_record)) { 41429 return $.getJSON("" + this.params.get_next_number_sequences_path, { 41430 date: this.transaction_date(), 41431 account_id: this.account_id() 41432 }).done((function(_this) { 41433 return function(sequence) { 41434 return _this.number(sequence.number); 41435 }; 41436 })(this)); 41437 } else { 41438 return this.number(this.params.number); 41439 } 41440 }; 41441 41442 CashVoucherSettings.prototype.loadAccountCurrency = function() { 41443 if (this.account_id()) { 41444 return $.getJSON("" + this.params.load_account_currency_path, { 41445 account_id: this.account_id() 41446 }).done((function(_this) { 41447 return function(account) { 41448 _this.account_currency_id(account.currency.id); 41449 return _this.currency_iso(account.currency.iso_code); 41450 }; 41451 })(this)); 41452 } 41453 }; 41454 41455 return CashVoucherSettings; 41456 41457 })(); 41458 41459}).call(this); 41460(function() { 41461 var Payment, 41462 bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; 41463 41464 Payment = (function() { 41465 function Payment(params, type, account_currency_id, convert_currency_single_company_path, transaction_date) { 41466 var ref, ref1, ref2, ref3, ref4; 41467 if (params == null) { 41468 params = {}; 41469 } 41470 ref = [params.id, type, params.actuarial_id, params.actuarial.actuarial_number, params.actuarial.type, params.actuarial.partner_name, params.actuarial.currency_id], this.id = ref[0], this.type = ref[1], this.actuarial_id = ref[2], this.actuarial_number = ref[3], this.actuarial_type = ref[4], this.partner_name = ref[5], this.actuarial_currency_id = ref[6]; 41471 this.variable_symbol = this.actuarial_type === "ActuarialsIn" ? params.actuarial.external_number : params.actuarial.variable_symbol; 41472 this.due_date_at = moment(params.actuarial.due_date_at).format("DD. MM. YYYY"); 41473 ref1 = [ko.observable(params.to_pay || 0), ko.observable(params.bank_exchange_rate), ko.observable(params.to_pay_in_account_currency || 0), ko.observable(params.transaction_exchange_rate)], this.to_pay = ref1[0], this.bank_exchange_rate = ref1[1], this.to_pay_in_account_currency = ref1[2], this.transaction_exchange_rate = ref1[3]; 41474 ref2 = [transaction_date, ko.observable(params.exchange_rate_exp || 1)], this.transaction_date = ref2[0], this.exchange_rate_exp = ref2[1]; 41475 ref3 = [params.actuarial.invoice_amount, account_currency_id, convert_currency_single_company_path], this.invoice_amount = ref3[0], this.account_currency_id = ref3[1], this.convert_currency_single_company_path = ref3[2]; 41476 ref4 = [params.actuarial.remaining_payment, params.actuarial.remaining_payment_with_currency, ko.observable(false), params.actuarial.actuarial_full_type], this.remaining_payment = ref4[0], this.remaining_payment_with_currency = ref4[1], this.destroyed = ref4[2], this.actuarial_full_type = ref4[3]; 41477 this.url = params.actuarial.url; 41478 this.errors = params.errors || {}; 41479 } 41480 41481 Payment.prototype.toPayChanged = function() { 41482 if (!_.isNaN(parseFloat(this.to_pay()))) { 41483 fix_input_characters(this.to_pay); 41484 } 41485 if (this.account_currency_id() === this.actuarial_currency_id) { 41486 this.to_pay_in_account_currency(this.to_pay()); 41487 return this.transaction_exchange_rate(_.numberFormat(parseFloat(this.to_pay() / this.to_pay_in_account_currency() * this.exchange_rate_exp()), 6)); 41488 } else { 41489 if (this.to_pay() === '') { 41490 this.bank_exchange_rate(''); 41491 this.to_pay_in_account_currency(''); 41492 return this.transaction_exchange_rate(''); 41493 } else { 41494 return $.getJSON("" + this.convert_currency_single_company_path, { 41495 from_cur: this.actuarial_currency_id, 41496 to_cur: this.account_currency_id(), 41497 value: this.to_pay(), 41498 date: this.transaction_date() 41499 }).done((function(_this) { 41500 return function(result) { 41501 _this.exchange_rate_exp(result.exchange_rate_exp); 41502 _this.to_pay_in_account_currency(parseFloat(result.converted_value).toFixed(2)); 41503 if (result.exchange_rate_type === "own") { 41504 _this.bank_exchange_rate(result.exchange_rate_own); 41505 return _this.transaction_exchange_rate(parseFloat(result.exchange_rate_own).toFixed(6)); 41506 } else { 41507 _this.bank_exchange_rate(result.exchange_rate_bank); 41508 return _this.transaction_exchange_rate(parseFloat(result.exchange_rate_bank).toFixed(6)); 41509 } 41510 }; 41511 })(this)); 41512 } 41513 } 41514 }; 41515 41516 Payment.prototype.toPayInAccountCurrencyChanged = function() { 41517 var result; 41518 if (!_.isNaN(parseFloat(this.to_pay_in_account_currency()))) { 41519 fix_input_characters(this.to_pay_in_account_currency); 41520 } 41521 if (this.to_pay_in_account_currency() === '') { 41522 return this.transaction_exchange_rate(''); 41523 } else { 41524 result = this.to_pay_in_account_currency() / this.to_pay() * this.exchange_rate_exp(); 41525 return this.transaction_exchange_rate(parseFloat(result).toFixed(6)); 41526 } 41527 }; 41528 41529 Payment.prototype.fillToPay = function() { 41530 this.to_pay(this.remaining_payment); 41531 return this.toPayChanged(); 41532 }; 41533 41534 Payment.prototype.attrName = function(index, name) { 41535 return this.type + "[cash_vouchers_payments_attributes][" + index + "][" + name + "]"; 41536 }; 41537 41538 return Payment; 41539 41540 })(); 41541 41542 this.CashVoucherPayment = (function() { 41543 function CashVoucherPayment(params) { 41544 this.groupActuarials = bind(this.groupActuarials, this); 41545 var ref, ref1; 41546 this.params = params; 41547 ref = [ko.observable(params.show_payments), params.document_type, params.currency_iso, params.account_currency_id], this.show_payments = ref[0], this.document_type = ref[1], this.currency_iso = ref[2], this.account_currency_id = ref[3]; 41548 this.description = params.description; 41549 this.payments = ko.observableArray(_.map(params.payments, (function(_this) { 41550 return function(p) { 41551 return new Payment(p, params.type, _this.account_currency_id, _this.params.convert_currency_single_company_path, _this.params.transaction_date, _this.description); 41552 }; 41553 })(this))); 41554 ref1 = [params.account_id, params.partner_id, params.want_call_for_payment, params.show_uzp_date], this.account_id = ref1[0], this.partner_id = ref1[1], this.want_call_for_payment = ref1[2], this.show_uzp_date = ref1[3]; 41555 this.partner_language = params.partner_language; 41556 this.active_payments = ko.computed((function(_this) { 41557 return function() { 41558 return _.filter(_this.payments(), function(p) { 41559 return p.destroyed() === false; 41560 }); 41561 }; 41562 })(this)); 41563 ko.computed((function(_this) { 41564 return function() { 41565 if (!_.isEmpty(_this.account_id()) && !_.isEmpty(_this.partner_id()) && _.contains(_this.params.payments_document_type, parseInt(_this.document_type()))) { 41566 return $.getJSON("" + _this.params.load_actuarials_for_payment_path, { 41567 partner_id: _this.partner_id(), 41568 cash_voucher_id: _this.params.id, 41569 type: _this.params.type, 41570 actuarial_id: _this.params.actuarial_id 41571 }).done(function(actuarials) { 41572 _.each(_this.payments(), function(payment) { 41573 if (!_.contains(_.pluck(actuarials, 'actuarial_id'), parseInt(payment.actuarial_id))) { 41574 return payment.destroyed(true); 41575 } else { 41576 return payment.destroyed(false); 41577 } 41578 }); 41579 return _.each(_.filter(actuarials, function(actuarial) { 41580 return !_.contains(_.pluck(_this.payments(), 'actuarial_id'), actuarial.actuarial_id); 41581 }), function(actuarial) { 41582 return _this.payments.push(new Payment(actuarial, _this.params.type, _this.account_currency_id, _this.params.convert_currency_single_company_path, _this.params.transaction_date, _this.description)); 41583 }); 41584 }); 41585 } 41586 }; 41587 })(this)); 41588 this.totalPrice = ko.computed((function(_this) { 41589 return function() { 41590 return _.numberFormat(_.reduce(_this.active_payments(), (function(memo, p) { 41591 if (_.isNaN(parseFloat(p.to_pay_in_account_currency()))) { 41592 return memo + 0; 41593 } else { 41594 return memo + parseFloat(p.to_pay_in_account_currency()); 41595 } 41596 }), 0), 2, ',', ' ') + (" " + (_this.currency_iso())); 41597 }; 41598 })(this)); 41599 ko.computed((function(_this) { 41600 return function() { 41601 _this.show_uzp_date(_this.document_type() === _this.params.call_for_payment_actuarial_ins); 41602 if (_.contains(_this.params.payments_document_type, parseInt(_this.document_type()))) { 41603 _this.show_payments(_.contains(_this.params.payments_document_type, parseInt(_this.document_type()))); 41604 _this.fillDescription(); 41605 if (parseFloat(_this.totalPrice()) !== 0) { 41606 return _this.groupActuarials(); 41607 } 41608 } 41609 }; 41610 })(this)); 41611 } 41612 41613 CashVoucherPayment.prototype.groupActuarials = function() { 41614 var selected_actuarial; 41615 selected_actuarial = _.find(this.active_payments(), (function
41615(_this) { 41616 return function(p) { 41617 return p.to_pay_in_account_currency() !== 0; 41618 }; 41619 })(this)); 41620 if (selected_actuarial && _.contains(["call_for_payment_actuarials_outs", "call_for_payment_actuarials_ins"], selected_actuarial.actuarial_full_type)) { 41621 if (selected_actuarial.actuarial_full_type === "call_for_payment_actuarials_ins") { 41622 if (parseInt(this.document_type()) === this.params.only_payment_document_type) { 41623 this.document_type(this.params.want_call_for_payment); 41624 } 41625 } 41626 return _.each(_.filter(this.active_payments(), (function(_this) { 41627 return function(p) { 41628 return p.actuarial_full_type !== selected_actuarial.actuarial_full_type; 41629 }; 41630 })(this)), (function(_this) { 41631 return function(payment) { 41632 return payment.destroyed(true); 41633 }; 41634 })(this)); 41635 } else { 41636 return _.each(_.filter(this.active_payments(), (function(_this) { 41637 return function(p) { 41638 return _.contains(["call_for_payment_actuarials_outs", "call_for_payment_actuarials_ins"], p.actuarial_full_type); 41639 }; 41640 })(this)), (function(_this) { 41641 return function(payment) { 41642 return payment.destroyed(true); 41643 }; 41644 })(this)); 41645 } 41646 }; 41647 41648 CashVoucherPayment.prototype.fillDescription = function() { 41649 var language, prefix; 41650 prefix = ""; 41651 language = _.isUndefined(this.partner_language()) ? "cs" : this.partner_language(); 41652 _.each(_.filter(this.active_payments(), (function(_this) { 41653 return function(p) { 41654 return parseFloat(p.to_pay_in_account_currency()) !== 0 && p.to_pay_in_account_currency() !== ""; 41655 }; 41656 })(this)), (function(_this) { 41657 return function(payment) { 41658 if (prefix === "") { 41659 prefix += window["dictionary_" + language]["payment_for"]; 41660 } 41661 if (prefix === window["dictionary_" + language]["payment_for"]) { 41662 return prefix += payment.actuarial_number; 41663 } else { 41664 return prefix += ", " + payment.actuarial_number; 41665 } 41666 }; 41667 })(this)); 41668 return this.description(prefix); 41669 }; 41670 41671 CashVoucherPayment.prototype.setCallForPaymentActurialIns = function() { 41672 this.document_type(this.params.call_for_payment_actuarial_ins); 41673 return this.show_uzp_date(true); 41674 }; 41675 41676 return CashVoucherPayment; 41677 41678 })(); 41679 41680}).call(this); 41681(function() { 41682 this.CashVoucherFactory = (function() { 41683 function CashVoucherFactory() {} 41684 41685 CashVoucherFactory.prototype.setLines = function(area, opts) { 41686 this.line_calculator = new LineCalculator(opts); 41687 return ko.applyBindings(this.line_calculator, $(area)[0]); 41688 }; 41689 41690 CashVoucherFactory.prototype.setAmounts = function(area, opts) { 41691 this.amounts_calculator = new AmountsCalculator(opts); 41692 return ko.applyBindings(this.amounts_calculator, $(area)[0]); 41693 }; 41694 41695 CashVoucherFactory.prototype.setCashVoucherSettings = function(area, opts) { 41696 this.cash_voucher_settings = new CashVoucherSettings(opts); 41697 return ko.applyBindings(this.cash_voucher_settings, $(area)[0]); 41698 }; 41699 41700 CashVoucherFactory.prototype.setPartner = function(area, opts) { 41701 this.partner = new Partner(opts); 41702 return ko.applyBindings(this.partner, $(area)[0]); 41703 }; 41704 41705 CashVoucherFactory.prototype.setCashVoucherPayment = function(area, opts) { 41706 this.cash_voucher_payment = new CashVoucherPayment(opts); 41707 return ko.applyBindings(this.cash_voucher_payment, $(area)[0]); 41708 }; 41709 41710 return CashVoucherFactory; 41711 41712 })(); 41713 41714}).call(this); 41715(function() { 41716 this.Settling = (function() { 41717 var calculate_percents, calculate_values; 41718 41719 function Settling() { 41720 this.bindSettling(); 41721 } 41722 41723 calculate_percents = function() { 41724 var i, j, len, num, ref, total; 41725 total = 0; 41726 ref = $('.percents_td input'); 41727 for (j = 0, len = ref.length; j < len; j++) { 41728 i = ref[j]; 41729 num = parseInt(i.value); 41730 if (!isNaN(num)) { 41731 total += num; 41732 } 41733 } 41734 $('.total_percents').html(total + "%"); 41735 if (total !== 100) { 41736 return $('.total_percents').addClass('red'); 41737 } else { 41738 return $('.total_percents').removeClass('red'); 41739 } 41740 }; 41741 41742 calculate_values = function() { 41743 var i, j, len, num, ref, total; 41744 total = 0.0; 41745 ref = $('.value_td input'); 41746 for (j = 0, len = ref.length; j < len; j++) { 41747 i = ref[j]; 41748 num = parseFloat(i.value); 41749 if (!isNaN(num)) { 41750 total += num; 41751 } 41752 } 41753 $('.total_value').html(total.toFixed(2)); 41754 if (total !== parseFloat($('#total_base_price input').val())) { 41755 return $('.total_value').addClass('red'); 41756 } else { 41757 return $('.total_value').removeClass('red'); 41758 } 41759 }; 41760 41761 Settling.prototype.handleSwitch = function() { 41762 var switch_value; 41763 switch_value = $('input.percents_switch:checked').val(); 41764 if (switch_value === 'amount') { 41765 $('.value_td, .total_value').show(); 41766 $('.percents_td, .total_percents').hide(); 41767 $('.percents_td input').val(''); 41768 return calculate_percents(); 41769 } else { 41770 $('.value_td, .total_value').hide(); 41771 $('.percents_td, .total_percents').show(); 41772 $('.value_td input').val(''); 41773 return calculate_values(); 41774 } 41775 }; 41776 41777 Settling.prototype.bindSettling = function() { 41778 this.handleSwitch(); 41779 $('.value_td input').change(function() { 41780 return calculate_values(); 41781 }); 41782 $('.percents_td input').change((function(_this) { 41783 return function() { 41784 _this.bindSettling(); 41785 return calculate_percents(); 41786 }; 41787 })(this)); 41788 $('.percents_switch').change((function(_this) { 41789 return function() { 41790 return _this.handleSwitch(); 41791 }; 41792 })(this)); 41793 $('.arrow_link').click(function() { 41794 var container, el, value; 41795 container = $(this).closest('tr'); 41796 value = $('[class*=base_price]', container).data('value'); 41797 if (!value) { 41798 value = $('[class*=base_price] input', container).val(); 41799 } 41800 if ($('input.percents_switch:checked').val() === 'amount') { 41801 el = container.find('td.value_td input'); 41802 } else { 41803 el = container.find('td.percents_td input'); 41804 } 41805 el.val(value); 41806 return el.trigger('change'); 41807 }); 41808 calculate_percents(); 41809 return calculate_values(); 41810 }; 41811 41812 return Settling; 41813 41814 })(); 41815 41816}).call(this); 41817(function() { 41818 this.MonthlyReport = (function() { 41819 var showHideWrappers; 41820 41821 function MonthlyReport() { 41822 this.handleReportType(); 41823 } 41824 41825 showHideWrappers = function() { 41826 var type; 41827 type = $('#export_data_report_type').val(); 41828 if (type === 'monthly') { 41829 $('.month_wrapper').show(); 41830 return $('.quartal_wrapper').hide(); 41831 } else { 41832 $('.month_wrapper').hide(); 41833 return $('.quartal_wrapper').show(); 41834 } 41835 }; 41836 41837 MonthlyReport.prototype.handleReportType = function() { 41838 showHideWrappers(); 41839 return $('#export_data_report_type').change(function() { 41840 return showHideWrappers(); 41841 }); 41842 }; 41843 41844 return MonthlyReport; 41845 41846 })(); 41847 41848}).call(this); 41849(function() { 41850 var ProperVatDeclaration, 41851 bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; 41852 41853 ProperVatDeclaration = (function() { 41854 function ProperVatDeclaration(params) { 41855 var ref, ref1, ref2; 41856 ref = [params.name, params.tax_liability, params.year, params.month, params.quarter, params.id], this.name = ref[0], this.tax_liability = ref[1], this.year = ref[2], this.month = ref[3], this.quarter = ref[4], this.id = ref[5]; 41857 ref1 = [params.period_to, params.period_to, params.last_additional, params.last_corrective], this.period_from = ref1[0], this.period_to = ref1[1], this.last_additional = ref1[2], this.last_corrective = ref1[3]; 41858 ref2 = [params.last_additional_url, params.last_corrective_url], this.last_additional_url = ref2[0], this.last_corrective_url = ref2[1]; 41859 } 41860 41861 return ProperVatDeclaration; 41862 41863 })(); 41864 41865 this.VatDeclaration = (function() { 41866 function VatDeclaration(params) { 41867 this.markParent = bind(this.markParent, this); 41868 var ref, ref1; 41869 this.params = params; 41870 ref = [ko.observable(params.declaration_type), ko.observable(params.period_type), ko.observableArray()], this.declaration_type = ref[0], this.period_type = ref[1], this.proper_vat_declaration = ref[2]; 41871 ref1 = [ko.observable(params.year), ko.observable(params.month), ko.observable(params.quarter), ko.observable(params.parent_vat_declaration_id)], this.year = ref1[0], this.month = ref1[1], this.quarter = ref1[2], this.parent_vat_declaration_id = ref1[3]; 41872 this.actuarials = ko.observableArray(); 41873 this.valid_proper = ko.computed((function(_this) { 41874 return function() { 41875 _this.year(); 41876 _this.month(); 41877 _this.quarter(); 41878 _this.declaration_type(); 41879 _this.period_type(); 41880 if ((_this.period_type() === _this.params.monthly && _.contains(_.range(1, 13), parseInt(_this.month()))) || (_this.period_type() === _this.params.quarterly && _.contains(_.range(1, 5), parseInt(_this.quarter())))) { 41881 _this.loadProperVatDeclaration(); 41882 return _this.loadNotSendActuarials(); 41883 } 41884 }; 41885 })(this)).extend({ 41886 rateLimit: 800 41887 }); 41888 } 41889 41890 VatDeclaration.prototype.loadProperVatDeclaration = function() { 41891 this.parent_vat_declaration_id(null); 41892 if (parseInt(this.params.proper_declaration_type) !== parseInt(this.declaration_type())) { 41893 return $.getJSON("" + this.params.load_valid_proper_path, { 41894 period_type: this.period_type(), 41895 year: this.year(), 41896 month: this.month(), 41897 quarter: this.quarter(), 41898 declaration_type: this.declaration_type() 41899 }).done((function(_this) { 41900 return function(vat_declarations) { 41901 return _this.proper_vat_declaration(_.map(vat_declarations, function(vat_declaration) { 41902 return new ProperVatDeclaration(vat_declaration); 41903 })); 41904 }; 41905 })(this)); 41906 } 41907 }; 41908 41909 VatDeclaration.prototype.loadNotSendActuarials = function() { 41910 if (!_.isEmpty(this.year()) && (!_.isEmpty(this.month()) || !_.isEmpty(this.quarter())) && !_.isEmpty(this.period_type())) { 41911 return $.getJSON(this.params.load_not_send_actuarials_vat_declarations_path, { 41912 year: this.year(), 41913 month: this.month(), 41914 quarter: this.quarter(), 41915 period_type: this.period_type() 41916 }).done((function(_this) { 41917 return function(actuarials) { 41918 return _this.actuarials(actuarials); 41919 }; 41920 })(this)); 41921 } 41922 }; 41923 41924 VatDeclaration.prototype.markParent = function(item) { 41925 return this.parent_vat_declaration_id(item.id); 41926 }; 41927 41928 return VatDeclaration; 41929 41930 })(); 41931 41932}).call(this); 41933(function() { 41934 this.DriveRecord = (function() { 41935 function DriveRecord(params) { 41936 var ref, ref1; 41937 this.params = params; 41938 ref = [ko.observable(params.car_id), ko.observable(params.start_tachometer), ko.observable(params.end_tachometer), ko.observable(params.start_location), ko.observable(params.is_private_car)], this.car_id = ref[0], this.start_tachometer = ref[1], this.end_tachometer = ref[2], this.start_location = ref[3], this.is_private_car = ref[4]; 41939 ref1 = [ko.observable(params.employee_id), ko.observable(params.trip_length), ko.observable(params.is_back), ko.observable(params.end_location)], this.employee_id = ref1[0], this.trip_length = ref1[1], this.is_back = ref1[2], this.end_location = ref1[3]; 41940 ko.computed((function(_this) { 41941 return function() { 41942 _this.start_location(); 41943 _this.end_location(); 41944 if (!_.isEmpty(_this.start_location()) && !_.isEmpty(_this.end_location()) && _.isEmpty(_this.trip_length())) { 41945 return $.getJSON("" + _this.params.load_trip_length_data_path, { 41946 start_location: _this.start_location(), 41947 end_location: _this.end_location() 41948 }).done(function(data) { 41949 return _this.trip_length(data.trip_length > 0 ? data.trip_length : ""); 41950 }); 41951 } 41952 }; 41953 })(this)); 41954 ko.computed((function(_this) { 41955 return function() { 41956 _this.is_back(); 41957 return _this.calculate_end_tachometer(); 41958 }; 41959 })(this)); 41960 } 41961 41962 DriveRecord.prototype.loadDriveRecordData = function() { 41963 if (!_.isEmpty(this.car_id())) { 41964 return $.getJSON("" + this.params.load_drive_record_data_path, { 41965 car_id: this.car_id() 41966 }).done((function(_this) { 41967 return function(data) { 41968 if (data.is_private) { 41969 _this.start_tachometer(""); 41970 _this.end_tachometer(""); 41971 _this.is_private_car(true); 41972 } else { 41973 _this.start_tachometer(data.end_tachometer); 41974 _this.is_private_car(false); 41975 } 41976 _this.start_location(data.start_location); 41977 if (data.primary_driver_id) { 41978 return _this.employee_id(data.primary_driver_id); 41979 } 41980 }; 41981 })(this)); 41982 } 41983 }; 41984 41985 DriveRecord.prototype.calculate_end_tachometer = function() { 41986 var end_tachometer, length, start; 41987 if (!this.is_private_car()) { 41988 length = parseInt(this.trip_length()); 41989 start = parseInt(this.start_tachometer()); 41990 if (!_.isNaN(length) && !_.isNaN(start)) { 41991 end_tachometer = start + length; 41992 if (this.is_back() === "true" || this.is_back() === true) { 41993 end_tachometer += length; 41994 } 41995 return this.end_tachometer(end_tachometer); 41996 } else { 41997 return this.end_tachometer(""); 41998 } 41999 } 42000 }; 42001 42002 return DriveRecord; 42003 42004 })(); 42005 42006}).call(this); 42007(function() { 42008 $(function() { 42009 return $("#subscription_months").change(function() { 42010 var data_price, months, price, price_with_vat, vat; 42011 months = $(this).val(); 42012 data_price = $(this).data('price'); 42013 price = parseFloat(months) * parseFloat(data_price); 42014 vat = parseFloat($(this).data('vat')); 42015 price_with_vat = price + ((price / 100) * vat); 42016 if (months === '') { 42017 $(".subscription_price").text("0.0"); 42018 } else { 42019 $(".subscription_price").text("" + (price.toFixed(2))); 42020 } 42021 if (months === '') { 42022 return $(".subscription_price_with_vat").text("0.0"); 42023 } else { 42024 return $(".subscription_price_with_vat").text("" + (price_with_vat.toFixed(2))); 42025 } 42026 }); 42027 }); 42028 42029}).call(this); 42030/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress 42031 * @license MIT */ 42032 42033;(function(root, factory) { 42034 42035 if (typeof define === 'function' && define.amd) { 42036 define(factory); 42037 } else if (typeof exports === 'object') { 42038 module.exports = factory(); 42039 } else { 42040 root.NProgress = factory(); 42041 } 42042 42043})(this, function() { 42044 var NProgress = {}; 42045 42046 NProgress.version = '0.2.0'; 42047 42048 var Settings = NProgress.settings = { 42049 minimum: 0.08, 42050 easing: 'ease', 42051 positionUsing: '', 42052 speed: 200, 42053 trickle: true, 42054 trickleRate: 0.02,
vendor: 9,420 bytes, lines 42055-42439
42055 trickleSpeed: 800, 42056 showSpinner: true, 42057 barSelector: '[role="bar"]', 42058 spinnerSelector: '[role="spinner"]', 42059 parent: 'body', 42060 template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>' 42061 }; 42062 42063 /** 42064 * Updates configuration. 42065 * 42066 * NProgress.configure({ 42067 * minimum: 0.1 42068 * }); 42069 */ 42070 NProgress.configure = function(options) { 42071 var key, value; 42072 for (key in options) { 42073 value = options[key]; 42074 if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value; 42075 } 42076 42077 return this; 42078 }; 42079 42080 /** 42081 * Last number. 42082 */ 42083 42084 NProgress.status = null; 42085 42086 /** 42087 * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. 42088 * 42089 * NProgress.set(0.4); 42090 * NProgress.set(1.0); 42091 */ 42092 42093 NProgress.set = function(n) { 42094 var started = NProgress.isStarted(); 42095 42096 n = clamp(n, Settings.minimum, 1); 42097 NProgress.status = (n === 1 ? null : n); 42098 42099 var progress = NProgress.render(!started), 42100 bar = progress.querySelector(Settings.barSelector), 42101 speed = Settings.speed, 42102 ease = Settings.easing; 42103 42104 progress.offsetWidth; /* Repaint */ 42105 42106 queue(function(next) { 42107 // Set positionUsing if it hasn't already been set 42108 if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); 42109 42110 // Add transition 42111 css(bar, barPositionCSS(n, speed, ease)); 42112 42113 if (n === 1) { 42114 // Fade out 42115 css(progress, { 42116 transition: 'none', 42117 opacity: 1 42118 }); 42119 progress.offsetWidth; /* Repaint */ 42120 42121 setTimeout(function() { 42122 css(progress, { 42123 transition: 'all ' + speed + 'ms linear', 42124 opacity: 0 42125 }); 42126 setTimeout(function() { 42127 NProgress.remove(); 42128 next(); 42129 }, speed); 42130 }, speed); 42131 } else { 42132 setTimeout(next, speed); 42133 } 42134 }); 42135 42136 return this; 42137 }; 42138 42139 NProgress.isStarted = function() { 42140 return typeof NProgress.status === 'number'; 42141 }; 42142 42143 /** 42144 * Shows the progress bar. 42145 * This is the same as setting the status to 0%, except that it doesn't go backwards. 42146 * 42147 * NProgress.start(); 42148 * 42149 */ 42150 NProgress.start = function() { 42151 if (!NProgress.status) NProgress.set(0); 42152 42153 var work = function() { 42154 setTimeout(function() { 42155 if (!NProgress.status) return; 42156 NProgress.trickle(); 42157 work(); 42158 }, Settings.trickleSpeed); 42159 }; 42160 42161 if (Settings.trickle) work(); 42162 42163 return this; 42164 }; 42165 42166 /** 42167 * Hides the progress bar. 42168 * This is the *sort of* the same as setting the status to 100%, with the 42169 * difference being `done()` makes some placebo effect of some realistic motion. 42170 * 42171 * NProgress.done(); 42172 * 42173 * If `true` is passed, it will show the progress bar even if its hidden. 42174 * 42175 * NProgress.done(true); 42176 */ 42177 42178 NProgress.done = function(force) { 42179 if (!force && !NProgress.status) return this; 42180 42181 return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); 42182 }; 42183 42184 /** 42185 * Increments by a random amount. 42186 */ 42187 42188 NProgress.inc = function(amount) { 42189 var n = NProgress.status; 42190 42191 if (!n) { 42192 return NProgress.start(); 42193 } else { 42194 if (typeof amount !== 'number') { 42195 amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); 42196 } 42197 42198 n = clamp(n + amount, 0, 0.994); 42199 return NProgress.set(n); 42200 } 42201 }; 42202 42203 NProgress.trickle = function() { 42204 return NProgress.inc(Math.random() * Settings.trickleRate); 42205 }; 42206 42207 /** 42208 * Waits for all supplied jQuery promises and 42209 * increases the progress as the promises resolve. 42210 * 42211 * @param $promise jQUery Promise 42212 */ 42213 (function() { 42214 var initial = 0, current = 0; 42215 42216 NProgress.promise = function($promise) { 42217 if (!$promise || $promise.state() === "resolved") { 42218 return this; 42219 } 42220 42221 if (current === 0) { 42222 NProgress.start(); 42223 } 42224 42225 initial++; 42226 current++; 42227 42228 $promise.always(function() { 42229 current--; 42230 if (current === 0) { 42231 initial = 0; 42232 NProgress.done(); 42233 } else { 42234 NProgress.set((initial - current) / initial); 42235 } 42236 }); 42237 42238 return this; 42239 }; 42240 42241 })(); 42242 42243 /** 42244 * (Internal) renders the progress bar markup based on the `template` 42245 * setting. 42246 */ 42247 42248 NProgress.render = function(fromStart) { 42249 if (NProgress.isRendered()) return document.getElementById('nprogress'); 42250 42251 addClass(document.documentElement, 'nprogress-busy'); 42252 42253 var progress = document.createElement('div'); 42254 progress.id = 'nprogress'; 42255 progress.innerHTML = Settings.template; 42256 42257 var bar = progress.querySelector(Settings.barSelector), 42258 perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), 42259 parent = document.querySelector(Settings.parent), 42260 spinner; 42261 42262 css(bar, { 42263 transition: 'all 0 linear', 42264 transform: 'translate3d(' + perc + '%,0,0)' 42265 }); 42266 42267 if (!Settings.showSpinner) { 42268 spinner = progress.querySelector(Settings.spinnerSelector); 42269 spinner && removeElement(spinner); 42270 } 42271 42272 if (parent != document.body) { 42273 addClass(parent, 'nprogress-custom-parent'); 42274 } 42275 42276 parent.appendChild(progress); 42277 return progress; 42278 }; 42279 42280 /** 42281 * Removes the element. Opposite of render(). 42282 */ 42283 42284 NProgress.remove = function() { 42285 removeClass(document.documentElement, 'nprogress-busy'); 42286 removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent'); 42287 var progress = document.getElementById('nprogress'); 42288 progress && removeElement(progress); 42289 }; 42290 42291 /** 42292 * Checks if the progress bar is rendered. 42293 */ 42294 42295 NProgress.isRendered = function() { 42296 return !!document.getElementById('nprogress'); 42297 }; 42298 42299 /** 42300 * Determine which positioning CSS rule to use. 42301 */ 42302 42303 NProgress.getPositioningCSS = function() { 42304 // Sniff on document.body.style 42305 var bodyStyle = document.body.style; 42306 42307 // Sniff prefixes 42308 var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : 42309 ('MozTransform' in bodyStyle) ? 'Moz' : 42310 ('msTransform' in bodyStyle) ? 'ms' : 42311 ('OTransform' in bodyStyle) ? 'O' : ''; 42312 42313 if (vendorPrefix + 'Perspective' in bodyStyle) { 42314 // Modern browsers with 3D support, e.g. Webkit, IE10 42315 return 'translate3d'; 42316 } else if (vendorPrefix + 'Transform' in bodyStyle) { 42317 // Browsers without 3D support, e.g. IE9 42318 return 'translate'; 42319 } else { 42320 // Browsers without translate() support, e.g. IE7-8 42321 return 'margin'; 42322 } 42323 }; 42324 42325 /** 42326 * Helpers 42327 */ 42328 42329 function clamp(n, min, max) { 42330 if (n < min) return min; 42331 if (n > max) return max; 42332 return n; 42333 } 42334 42335 /** 42336 * (Internal) converts a percentage (`0..1`) to a bar translateX 42337 * percentage (`-100%..0%`). 42338 */ 42339 42340 function toBarPerc(n) { 42341 return (-1 + n) * 100; 42342 } 42343 42344 42345 /** 42346 * (Internal) returns the correct CSS for changing the bar's 42347 * position given an n percentage, and speed and ease from Settings 42348 */ 42349 42350 function barPositionCSS(n, speed, ease) { 42351 var barCSS; 42352 42353 if (Settings.positionUsing === 'translate3d') { 42354 barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; 42355 } else if (Settings.positionUsing === 'translate') { 42356 barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; 42357 } else { 42358 barCSS = { 'margin-left': toBarPerc(n)+'%' }; 42359 } 42360 42361 barCSS.transition = 'all '+speed+'ms '+ease; 42362 42363 return barCSS; 42364 } 42365 42366 /** 42367 * (Internal) Queues a function to be executed. 42368 */ 42369 42370 var queue = (function() { 42371 var pending = []; 42372 42373 function next() { 42374 var fn = pending.shift(); 42375 if (fn) { 42376 fn(next); 42377 } 42378 } 42379 42380 return function(fn) { 42381 pending.push(fn); 42382 if (pending.length == 1) next(); 42383 }; 42384 })(); 42385 42386 /** 42387 * (Internal) Applies css properties to an element, similar to the jQuery 42388 * css method. 42389 * 42390 * While this helper does assist with vendor prefixed property names, it 42391 * does not perform any manipulation of values prior to setting styles. 42392 */ 42393 42394 var css = (function() { 42395 var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ], 42396 cssProps = {}; 42397 42398 function camelCase(string) { 42399 return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) { 42400 return letter.toUpperCase(); 42401 }); 42402 } 42403 42404 function getVendorProp(name) { 42405 var style = document.body.style; 42406 if (name in style) return name; 42407 42408 var i = cssPrefixes.length, 42409 capName = name.charAt(0).toUpperCase() + name.slice(1), 42410 vendorName; 42411 while (i--) { 42412 vendorName = cssPrefixes[i] + capName; 42413 if (vendorName in style) return vendorName; 42414 } 42415 42416 return name; 42417 } 42418 42419 function getStyleProp(name) { 42420 name = camelCase(name); 42421 return cssProps[name] || (cssProps[name] = getVendorProp(name)); 42422 } 42423 42424 function applyCss(element, prop, value) { 42425 prop = getStyleProp(prop); 42426 element.style[prop] = value; 42427 } 42428 42429 return function(element, properties) { 42430 var args = arguments, 42431 prop, 42432 value; 42433 42434 if (args.length == 2) { 42435 for (prop in properties) { 42436 value = properties[prop]; 42437 if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value); 42438 } 42439 } else {
42440 applyCss(element, args[1], args[2]); 42441 } 42442 } 42443 })(); 42444 42445 /** 42446 * (Internal) Determines if an element or space separated list of class names contains a class name. 42447 */ 42448 42449 function hasClass(element, name) { 42450 var list = typeof element == 'string' ? element : classList(element); 42451 return list.indexOf(' ' + name + ' ') >= 0; 42452 } 42453 42454 /** 42455 * (Internal) Adds a class to an element. 42456 */ 42457 42458 function addClass(element, name) { 42459 var oldList = classList(element), 42460 newList = oldList + name; 42461 42462 if (hasClass(oldList, name)) return; 42463 42464 // Trim the opening space. 42465 element.className = newList.substring(1); 42466 } 42467 42468 /** 42469 * (Internal) Removes a class from an element. 42470 */ 42471 42472 function removeClass(element, name) { 42473 var oldList = classList(element), 42474 newList; 42475 42476 if (!hasClass(element, name)) return; 42477 42478 // Replace the class name. 42479 newList = oldList.replace(' ' + name + ' ', ' '); 42480 42481 // Trim the opening and closing spaces. 42482 element.className = newList.substring(1, newList.length - 1); 42483 } 42484 42485 /** 42486 * (Internal) Gets a space separated list of the class names on the element. 42487 * The list is wrapped with a single space on each end to facilitate finding 42488 * matches within the list. 42489 */ 42490 42491 function classList(element) { 42492 return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' '); 42493 } 42494 42495 /** 42496 * (Internal) Removes an element from the DOM. 42497 */ 42498 42499 function removeElement(element) { 42500 element && element.parentNode && element.parentNode.removeChild(element); 42501 } 42502 42503 return NProgress; 42504}); 42505(function() { 42506 $(function() { 42507 return $(".click_photo").click(function(e) { 42508 e.preventDefault(); 42509 top.tinymce.activeEditor.windowManager.getParams().oninsert($(this).data('url')); 42510 return window.parent.tinymce.activeEditor.windowManager.close(window); 42511 }); 42512 }); 42513 42514}).call(this);
vendor: 65,423 bytes, lines 42514-42516
42514 42515/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){return n.apply(b,v.call(arguments,0).concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice;this.listeners=this.listeners||{},a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),this.$results.append(d)},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";{a(h)}this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b){var c=this,d=b.id+"-results";this.$results.attr("id",d),b.on("results:all",function(a){c.clear(),c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("results:append",function(a){c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("query",function(a){c.showLoading(a)}),b.on("select",function(){b.isOpen()&&c.setClasses()}),b.on("unselect",function(){b.isOpen()&&c.setClasses()}),b.on("open",function(){c.$results.attr("aria-expanded","true"),c.$results.attr("aria-hidden","false"),c.setClasses(),c.ensureHighlightVisible()}),b.on("close",function(){c.$results.attr("aria-expanded","false"),c.$results.attr("aria-hidden","true"),c.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=c.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=c.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?c.trigger("close"):c.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a);if(0!==d){var e=d-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top,h=f.offset().top,i=c.$results.scrollTop()+(h-g);0===e?c.$results.scrollTop(0):0>h-g&&c.$results.scrollTop(i)}}),b.on("results:next",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a),e=d+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top+c.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=c.$results.scrollTop()+h-g;0===e?c.$results.scrollTop(0):h>g&&c.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){c.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=c.$results.scrollTop(),d=c.$results.get(0).scrollHeight-c.$results.scrollTop()+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&d<=c.$results.height();e?(c.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(c.$results.scrollTop(c.$results.get(0).scrollHeight-c.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var d=a(this),e=d.data("data");return"true"===d.attr("aria-selected")?void(c.options.get("multiple")?c.trigger("unselect",{originalEvent:b,data:e}):c.trigger("close")):void c.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var b=a(this).data("data");c.getHighlightedResults().removeClass("select2-results__option--highlighted"),c.trigger("results:focus",{data:b,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a){var b=this,d=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){b.trigger("focus",a)}),this.$selection.on("blur",function(a){b.trigger("blur",a)}),this.$selection.on("keydown",function(a){b.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){b.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){b.update(a.data)}),a.on("open",function(){b.$selection.attr("aria-expanded","true"),b.$selection.attr("aria-owns",d),b._attachCloseHandler(a)}),a.on("close",function(){b.$selection.attr("aria-expanded","false"),b.$selection.removeAttr("aria-activedescendant"),b.$selection.removeAttr("aria-owns"),b.$selection.focus(),b._detachCloseHandler(a)}),a.on("enable",function(){b.$selection.attr("tabindex",b._tabindex)}),a.on("disable",function(){b.$selection.attr("tabindex","-1")})},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},d.prototype.bind=function(a){var b=this;d.__super__.bind.apply(this,arguments);var c=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",c),this.$selection.attr("aria-labelledby",c),this.$selection.on("mousedown",function(a){1===a.which&&b.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),a.on("selection:update",function(a){b.update(a.data)})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){return a("<span></span>")},d.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.display(b),d=this.$selection.find(".select2-selection__rendered");d.empty().append(c),d.prop("title",b.title||b.text)},d}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(){var b=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){b.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(c){var d=a(this),e=d.parent(),f=e.data("data");b.trigger("unselect",{originalEvent:c,data:f})})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.display(e),g=this.selectionContainer();g.append(f),g.prop("title",e.title||e.text),g.data("data",e),b.push(g)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(){function a(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},a.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},a}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle")}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus()}),b.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.focus()}),b.on("enable",function(){e.$search.prop("disabled",!1)}),b.on("disable",function(){e.$search.prop("disabled",!0)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e.trigger("blur",a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}}),this.$selection.on("input",".select2-search--inline",function(){e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input",".select2-search--inline",function(a){e.handleSearch(a)})},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.trigger("open"),this.$search.val(b.text+" ")},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"â¶":"A","A":"A","Ã":"A","Ã":"A","Ã":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä":"A","Ä":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ã":"A","Ç":"A","Ả":"A","à ":"A","Ǻ":"A","Ç":"A","È":"A","È":"A","Ạ":"A","Ậ":"A","Ặ":"A","á¸":"A","Ä":"A","Ⱥ":"A","Ɐ":"A","ê²":"AA","Ã":"AE","Ǽ":"AE","Ç¢":"AE","ê´":"AO","ê¶":"AU","ê¸":"AV","êº":"AV","ê¼":"AY","â·":"B","ï¼¢":"B","á¸":"B","á¸":"B","á¸":"B","É":"B","Æ":"B","Æ":"B","â¸":"C","ï¼£":"C","Ä":"C","Ä":"C","Ä":"C","Ä":"C","Ã":"C","á¸":"C","Æ":"C","È»":"C","ê¾":"C","â¹":"D","D":"D","á¸":"D","Ä":"D","á¸":"D","á¸":"D","á¸":"D","á¸":"D","Ä":"D","Æ":"D","Æ":"D","Æ":"D","ê¹":"D","DZ":"DZ","Ç":"DZ","Dz":"Dz","Ç ":"Dz","âº":"E","ï¼¥":"E","Ã":"E","Ã":"E","Ã":"E","á»":"E","Ế":"E","á»":"E","á»":"E","Ẽ":"E","Ä":"E","á¸":"E","á¸":"E","Ä":"E","Ä":"E","Ã":"E","Ẻ":"E","Ä":"E","È":"E","È":"E","Ẹ":"E","á»":"E","Ȩ":"E","á¸":"E","Ä":"E","á¸":"E","á¸":"E","Æ":"E","Æ":"E","â»":"F","F":"F","á¸":"F","Æ":"F","ê»":"F","â¼":"G","ï¼§":"G","Ç´":"G","Ä":"G","Ḡ":"G","Ä":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ":"G","ê ":"G","ê½":"G","ê¾":"G","â½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","È":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","ê":"H","â¾":"I","I":"I","Ã":"I","Ã":"I","Ã":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","á»":"I","Ç":"I","È":"I","È":"I","á»":"I","Ä®":"I","Ḭ":"I","Æ":"I","â¿":"J","J":"J","Ä´":"J","É":"J","â":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Æ":"K","Ⱪ":"K","ê":"K","ê":"K","ê":"K","ê¢":"K","â":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","ê":"L","ê":"L","ê":"L","Ç":"LJ","Ç":"Lj","â":"M","ï¼":"M","Ḿ":"M","á¹":"M","á¹":"M","â±®":"M","Æ":"M","â":"N","ï¼®":"N","Ǹ":"N","Å":"N","Ã":"N","á¹":"N","Å":"N","á¹":"N","Å ":"N","á¹":"N","á¹":"N","È ":"N","Æ":"N","ê":"N","ê¤":"N","Ç":"NJ","Ç":"Nj","â":"O","O":"O","Ã":"O","Ã":"O","Ã":"O","á»":"O","á»":"O","á»":"O","á»":"O","Ã":"O","á¹":"O","Ȭ":"O","á¹":"O","Å":"O","á¹":"O","á¹":"O","Å":"O","È®":"O","Ȱ":"O","Ã":"O","Ȫ":"O","á»":"O","Å":"O","Ç":"O","È":"O","È":"O","Æ ":"O","á»":"O","á»":"O","á» ":"O","á»":"O","Ợ":"O","á»":"O","á»":"O","Ǫ":"O","Ǭ":"O","Ã":"O","Ǿ":"O","Æ":"O","Æ":"O","ê":"O","ê":"O","Æ¢":"OI","ê":"OO","È¢":"OU","â ":"P","ï¼°":"P","á¹":"P","á¹":"P","Ƥ":"P","â±£":"P","ê":"P","ê":"P","ê":"P","â":"Q","ï¼±":"Q","ê":"Q","ê":"Q","É":"Q","â":"R","ï¼²":"R","Å":"R","á¹":"R","Å":"R","È":"R","È":"R","á¹":"R","á¹":"R","Å":"R","á¹":"R","É":"R","Ɽ":"R","ê":"R","ê¦":"R","ê":"R","â":"S","ï¼³":"S","áº":"S","Å":"S","Ṥ":"S","Å":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","È":"S","Å":"S","â±¾":"S","ê¨":"S","ê":"S","â":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","È":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","ê":"T","ê¨":"TZ","â":"U","ï¼µ":"U","Ã":"U","Ã":"U","Ã":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ã":"U","Ç":"U","Ç":"U","Ç":"U","Ç":"U","Ủ":"U","Å®":"U","Ű":"U","Ç":"U","È":"U","È":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É":"U","â":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"V","ê":"V","É ":"V","ê ":"VY","â":"W","ï¼·":"W","áº":"W","áº":"W","Å´":"W","áº":"W","áº":"W","áº":"W","â±²":"W","â":"X","X":"X","áº":"X","áº":"X","â":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","áº":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","É":"Y","Ỿ":"Y","â":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","áº":"Z","áº":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â":"a","ï½":"a","áº":"a","à ":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","Ä":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","Ç":"a","ả":"a","Ã¥":"a","Ç»":"a","Ç":"a","È":"a","È":"a","ạ":"a","áº":"a","ặ":"a","á¸":"a","Ä ":"a","â±¥":"a","É":"a","ê³":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","êµ":"ao","ê·":"au","ê¹":"av","ê»":"av","ê½":"ay","â":"b","ï½":"b","á¸":"b","Ḡ":"b","á¸":"b","Æ":"b","Æ":"b","É":"b","â":"c","ï½":"c","Ä":"c","Ä":"c","Ä":"c","Ä":"c","ç":"c","á¸":"c","Æ":"c","ȼ":"c","ê¿":"c","â":"c","â":"d","ï½":"d","á¸":"d","Ä":"d","á¸":"d","á¸":"d","á¸":"d","á¸":"d","Ä":"d","Æ":"d","É":"d","É":"d","êº":"d","dz":"dz","Ç":"dz","â":"e","ï½ ":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á» ":"e","á»":"e","ẽ":"e","Ä":"e","á¸":"e","á¸":"e","Ä":"e","Ä":"e","ë":"e","ẻ":"e","Ä":"e","È ":"e","È":"e","ẹ":"e","á»":"e","È©":"e","á¸":"e","Ä":"e","á¸":"e","á¸":"e","É":"e","É":"e","Ç":"e","â":"f","ï½":"f","á¸":"f","Æ":"f","ê¼":"f","â":"g","ï½":"g","ǵ":"g","Ä":"g","ḡ":"g","Ä":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","ê¡":"g","áµ¹":"g","ê¿":"g","â":"h","ï½":"h","Ä¥":"h","ḣ":"h","ḧ":"h","È":"h","ḥ":"h","ḩ":"h","ḫ":"h","áº":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ":"hv","â":"i","ï½":"i","ì":"i","Ã":"i","î":"i","Ä©":"i","Ä«":"i","Ä":"i","ï":"i","ḯ":"i","á»":"i","Ç":"i","È":"i","È":"i","á»":"i","į":"i","á¸":"i","ɨ":"i","ı":"i","â":"j","ï½":"j","ĵ":"j","ǰ":"j","É":"j","â":"k","ï½":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ":"k","ⱪ":"k","ê":"k","ê":"k","ê ":"k","ê£":"k","â":"l","ï½":"l","Å":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å":"l","Æ":"l","É«":"l","ⱡ":"l","ê":"l","ê":"l","ê":"l","Ç":"lj","â":"m","ï½":"m","ḿ":"m","á¹":"m","á¹":"m","ɱ":"m","ɯ":"m","â":"n","ï½":"n","ǹ":"n","Å":"n","ñ":"n","á¹ ":"n","Å":"n","á¹":"n","Å":"n","á¹":"n","á¹":"n","Æ":"n","ɲ":"n","Å":"n","ê":"n","ê¥":"n","Ç":"nj","â":"o","ï½":"o","ò":"o","ó":"o","ô":"o","á»":"o","á»":"o","á»":"o","á»":"o","õ":"o","á¹":"o","È":"o","á¹":"o","Å":"o","á¹":"o","á¹":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å":"o","Ç":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»":"o","ỡ":"o","á»":"o","ợ":"o","á»":"o","á»":"o","Ç«":"o","Ç":"o","ø":"o","Ç¿":"o","É":"o","ê":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","â":"p","ï½":"p","á¹":"p","á¹":"p","Æ¥":"p","áµ½":"p","ê":"p","ê":"p","ê":"p","â ":"q","ï½":"q","É":"q","ê":"q","ê":"q","â¡":"r","ï½":"r","Å":"r","á¹":"r","Å":"r","È":"r","È":"r","á¹":"r","á¹":"r","Å":"r","á¹":"r","É":"r","ɽ":"r","ê":"r","ê§":"r","ê":"r","â¢":"s","ï½":"s","Ã":"s","Å":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È":"s","Å":"s","È¿":"s","ê©":"s","ê ":"s","áº":"s","â£":"t","ï½":"t","ṫ":"t","áº":"t","Å¥":"t","á¹":"t","È":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ":"t","Ê":"t","ⱦ":"t","ê":"t","ê©":"tz","â¤":"u","ï½":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å":"u","ü":"u","Ç":"u","Ç":"u","Ç":"u","Ç":"u","á»§":"u","ů":"u","ű":"u","Ç":"u","È":"u","È":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","Ê":"u","â¥":"v","ï½":"v","á¹½":"v","ṿ":"v","Ê":"v","ê":"v","Ê":"v","ê¡":"vy","â¦":"w","ï½":"w","áº":"w","áº":"w","ŵ":"w","áº":"w","Ạ":"w","áº":"w","áº":"w","â±³":"w","â§":"x","ï½":"x","áº":"x","áº":"x","â¨":"y","ï½":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","áº":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â©":"z","ï½":"z","ź":"z","áº":"z","ż":"z","ž":"z","áº":"z","áº":"z","ƶ":"z","È¥":"z","É":"z","ⱬ":"z","ê£":"z","Î":"Î","Î":"Î","Î":"Î","Î":"Î","Ϊ":"Î","Î":"Î","Î":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","Î":"ε","ή":"η","ί":"ι","Ï":"ι","Î":"ι","Ï":"ο","Ï":"Ï ","Ï":"Ï ","ΰ":"Ï ","Ï":"Ï","Ï":"Ï"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a){var b=this;this.container=a,a.on("select",function(a){b.select(a.data)}),a.on("unselect",function(a){b.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={}; 42516if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=(c.extend(!0,{},l,j),this.option(l));k.replaceWith(m)}else{var n=this.option(j);if(j.children){var o=this.convertToOptions(j.children);b.appendMany(n,o)}h.push(n)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(b,c){this.ajaxOptions=this._applyDefaults(c.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),a.__super__.constructor.call(this,b,c)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return{q:a.term}},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url(a)),"function"==typeof f.data&&(f.data=f.data(a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g<e.length;g++){var h=e[g],i=this._normalizeItem(h),j=this.option(i);this.$element.append(j)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(){var b=(this._lastTag,this.$element.find("option[data-select2-tag]"));b.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(a,b,c){function d(a){e.select(a)}var e=this;b.term=b.term||"";var f=this.tokenizer(b,this.options,d);f.term!==b.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),b.term=f.term),a.call(this,b,c)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);e(m),g=g.substr(h+1)||"",h=0}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.position=function(){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},b.prototype.handleSearch=function(){if(!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},b.prototype.showSearch=function(){return!0},b}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="option load-more" role="treeitem"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(a,b,c){this.$dropdownParent=c.get("dropdownParent")||document.body,a.call(this,b,c)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c){var d=this,e="scroll.select2."+c.id,f="resize.select2."+c.id,g="orientationchange.select2."+c.id,h=this.$container.parents().filter(b.hasScroll);h.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),h.on(e,function(){var b=a(this).data("select2-scroll-position");a(this).scrollTop(b.y)}),a(window).on(e+" "+f+" "+g,function(){d._positionDropdown(),d._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c){var d="scroll.select2."+c.id,e="resize.select2."+c.id,f="orientationchange.select2."+c.id,g=this.$container.parents().filter(b.hasScroll);g.off(d),a(window).off(d+" "+e+" "+f)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom};c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){this.$dropdownContainer.width();var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(){d._handleSelectOnClose()})},a.prototype._handleSelectOnClose=function(){var a=this.getHighlightedResults();a.length<1||this.trigger("select",{data:a.data("data")})},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close")},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more resultsâ¦"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searchingâ¦"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend({},this.defaults,l),null==l.dataAdapter){if(l.dataAdapter=null!=l.ajax?o:null!=l.data?n:m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.selectionAdapter=l.multiple?e:d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(this.options.dir=a.prop("dir")?a.prop("dir"):a.closest("[dir]").prop("dir")?a.closest("[dir]").prop("dir"):"ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("focus",function(){a.$container.addClass("select2-container--focus")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open"),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ENTER?(a.trigger("results:select"),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle"),b.preventDefault()):c===d.UP?(a.trigger("results:previous"),b.preventDefault()):c===d.DOWN?(a.trigger("results:next"),b.preventDefault()):(c===d.ESC||c===d.TAB)&&(a.close(),b.preventDefault()):(c===d.ENTER||c===d.SPACE||(c===d.DOWN||c===d.UP)&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||(this.trigger("query",{}),this.trigger("open"))},e.prototype.close=function(){this.isOpen()&&this.trigger("close")},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f<this._currentData.length;f++){var g=this._currentData[f];e.push.apply(e,d(g,this.$element.val().split(this._valueSeparator)))}c(e)},b.prototype.select=function(b,c){if(this.options.get("multiple")){var d=this.$element.val();d+=this._valueSeparator+c.id,this.$element.val(d),this.$element.trigger("change")}else this.current(function(b){a.map(b,function(a){a.selected=!1})}),this.$element.val(c.id),this.$element.trigger("change")},b.prototype.unselect=function(a,b){var c=this;b.selected=!1,this.current(function(a){for(var d=[],e=0;e<a.length;e++){var f=a[e];
vendor: 6,528 bytes, lines 42516-42536
42516 42517b.id!=f.id&&d.push(f.id)}c.$element.val(d.join(c._valueSeparator)),c.$element.trigger("change")})},b.prototype.query=function(a,b,c){for(var d=[],e=0;e<this._currentData.length;e++){var f=this._currentData[e],g=this.matches(b,f);null!==g&&d.push(g)}c({results:d})},b.prototype.addOptions=function(b,c){var d=a.map(c,function(b){return a.data(b[0],"data")});this._currentData.push.apply(this._currentData,d)},b}),b.define("select2/compat/matcher",["jquery"],function(a){function b(b){function c(c,d){var e=a.extend(!0,{},d);if(null==c.term||""===a.trim(c.term))return e;if(d.children){for(var f=d.children.length-1;f>=0;f--){var g=d.children[f],h=b(c.term,g.text,g);h||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c;var d=this.options.get("query");d.call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){var d=c.find(".dropdown-wrapper");d.append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("jquery.select2",["jquery","require","./select2/core","./select2/defaults"],function(a,b,c,d){if(b("jquery.mousewheel"),null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){{var d=a.extend({},b,!0);new c(a(this),d)}}),this;if("string"==typeof b){var d=this.data("select2");null==d&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var f=Array.prototype.slice.call(arguments,1),g=d[b](f);return a.inArray(b,e)>-1?this:g}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery.mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}); 42518/* 42519 Define the adapter so that it's reusable 42520*/ 42521$.fn.select2.amd.define('select2/selectAllAdapter', [ 42522 'select2/utils', 42523 'select2/dropdown', 42524 'select2/dropdown/attachBody' 42525], function (Utils, Dropdown, AttachBody) { 42526 42527 function SelectAll() { } 42528 SelectAll.prototype.render = function (decorated) { 42529 var self = this, 42530 $rendered = decorated.call(this), 42531 $selectAll = $( 42532 '<button class="btn btn-xs btn-primary" type="button" style="margin-left:6px;"><i class="fa fa-check-square-o"></i> Vybrat vše</button>' 42533 ), 42534 $unselectAll = $( 42535 '<button class="btn btn-xs btn-danger" type="button" style="margin-left:6px;"><i class="fa fa-square-o"></i> Odebrat vše</button>' 42536 ),
42537 $btnContainer = $('<div style="margin:3px 0;">').append($selectAll).append($unselectAll); 42538 if (!this.$element.prop("multiple")) { 42539 // this isn't a multi-select -> don't add the buttons! 42540 return $rendered; 42541 } 42542 $rendered.find('.select2-dropdown').prepend($btnContainer); 42543 $selectAll.on('click', function (e) { 42544 var $results = $rendered.find('.select2-results__option[aria-selected=false]'); 42545 $results.each(function () { 42546 self.trigger('select', { 42547 data: $(this).data('data') 42548 }); 42549 }); 42550 self.trigger('close'); 42551 }); 42552 $unselectAll.on('click', function (e) { 42553 var $results = $rendered.find('.select2-results__option[aria-selected=true]'); 42554 $results.each(function () { 42555 self.trigger('unselect', { 42556 data: $(this).data('data') 42557 }); 42558 }); 42559 self.trigger('close'); 42560 }); 42561 return $rendered; 42562 }; 42563 42564 return Utils.Decorate( 42565 Utils.Decorate( 42566 Dropdown, 42567 AttachBody 42568 ), 42569 SelectAll 42570 ); 42571 42572}); 42573(function() { 42574 this.select2 = function() { 42575 return $('.select2').select2(); 42576 }; 42577 42578 this.datetimepicker = function() { 42579 return $('.datetimepicker').datetimepicker({ 42580 icons: { 42581 time: 'fa fa-clock-o', 42582 date: 'fa fa-calendar', 42583 up: 'fa fa-arrow-up', 42584 down: 'fa fa-arrow-down', 42585 previous: 'fa fa-arrow-left', 42586 next: 'fa fa-arrow-right', 42587 today: 'fa fa-calendar-check-o', 42588 clear: 'fa fa-trash-o', 42589 close: 'fa fa-times' 42590 }, 42591 stepping: 5, 42592 collapse: false, 42593 sideBySide: true, 42594 useCurrent: false, 42595 format: 'DD.MM.YYYY HH:mm' 42596 }); 42597 }; 42598 42599 this.datepicker = function() { 42600 return $('.datepicker').datetimepicker({ 42601 icons: { 42602 time: 'fa fa-clock-o', 42603 date: 'fa fa-calendar', 42604 up: 'fa fa-arrow-up', 42605 down: 'fa fa-arrow-down', 42606 previous: 'fa fa-arrow-left', 42607 next: 'fa fa-arrow-right', 42608 today: 'fa fa-calendar-check-o', 42609 clear: 'fa fa-trash-o', 42610 close: 'fa fa-times' 42611 }, 42612 useCurrent: false, 42613 format: 'DD.MM.YYYY' 42614 }); 42615 }; 42616 42617 this.timepicker = function() { 42618 return $('.timepicker').datetimepicker({ 42619 icons: { 42620 time: 'fa fa-clock-o', 42621 date: 'fa fa-calendar', 42622 up: 'fa fa-arrow-up', 42623 down: 'fa fa-arrow-down', 42624 previous: 'fa fa-arrow-left', 42625 next: 'fa fa-arrow-right', 42626 today: 'fa fa-calendar-check-o', 42627 clear: 'fa fa-trash-o', 42628 close: 'fa fa-times' 42629 }, 42630 useCurrent: false, 42631 format: 'HH:mm', 42632 stepping: 5 42633 }); 42634 }; 42635 42636 this.datetimepickerOnlyHours = function() { 42637 return $('.datetimepicker_only_hours').datetimepicker({ 42638 format: 'DD. MM. YYYY HH:00', 42639 showTodayButton: true, 42640 showClear: true, 42641 icons: { 42642 time: "fa fa-clock-o", 42643 date: "fa fa-calendar", 42644 up: "fa fa-arrow-up", 42645 down: "fa fa-arrow-down", 42646 previous: "fa fa-arrow-left", 42647 next: "fa fa-arrow-right" 42648 } 42649 }); 42650 }; 42651 42652}).call(this); 42653/* 42654 * 42655 * INSPINIA - Responsive Admin Theme 42656 * version 2.7.1 42657 * 42658 */ 42659 42660 42661$(document).ready(function () { 42662 42663 42664 // Add body-small class if window less than 768px 42665 if ($(this).width() < 769) { 42666 $('body').addClass('body-small') 42667 } else { 42668 $('body').removeClass('body-small') 42669 } 42670 42671 // MetsiMenu 42672 $('#side-menu').metisMenu(); 42673 42674 // Collapse ibox function 42675 $('.collapse-link').on('click', function () { 42676 var ibox = $(this).closest('div.ibox'); 42677 var button = $(this).find('i'); 42678 var content = ibox.children('.ibox-content'); 42679 content.slideToggle(200); 42680 button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down'); 42681 ibox.toggleClass('').toggleClass('border-bottom'); 42682 setTimeout(function () { 42683 ibox.resize(); 42684 ibox.find('[id^=map-]').resize(); 42685 }, 50); 42686 }); 42687 42688 // Close ibox function 42689 $('.close-link').on('click', function () { 42690 var content = $(this).closest('div.ibox'); 42691 content.remove(); 42692 }); 42693 42694 // Fullscreen ibox function 42695 $('.fullscreen-link').on('click', function () { 42696 var ibox = $(this).closest('div.ibox'); 42697 var button = $(this).find('i'); 42698 $('body').toggleClass('fullscreen-ibox-mode'); 42699 button.toggleClass('fa-expand').toggleClass('fa-compress'); 42700 ibox.toggleClass('fullscreen'); 42701 setTimeout(function () { 42702 $(window).trigger('resize'); 42703 }, 100); 42704 }); 42705 42706 // Close menu in canvas mode 42707 $('.close-canvas-menu').on('click', function () { 42708 $("body").toggleClass("mini-navbar"); 42709 SmoothlyMenu(); 42710 }); 42711 42712 // Run menu of canvas 42713 $('body.canvas-menu .sidebar-collapse').slimScroll({ 42714 height: '100%', 42715 railOpacity: 0.9 42716 }); 42717 42718 // Open close right sidebar 42719 $('.right-sidebar-toggle').on('click', function () { 42720 $('#right-sidebar').toggleClass('sidebar-open'); 42721 }); 42722 42723 // Initialize slimscroll for right sidebar 42724 $('.sidebar-container').slimScroll({ 42725 height: '100%', 42726 railOpacity: 0.4, 42727 wheelStep: 10 42728 }); 42729 42730 // Open close small chat 42731 $('.open-small-chat').on('click', function () { 42732 $(this).children().toggleClass('fa-comments').toggleClass('fa-remove'); 42733 $('.small-chat-box').toggleClass('active'); 42734 }); 42735 42736 // Initialize slimscroll for small chat 42737 $('.small-chat-box .content').slimScroll({ 42738 height: '234px', 42739 railOpacity: 0.4 42740 }); 42741 42742 // Small todo handler 42743 $('.check-link').on('click', function () { 42744 var button = $(this).find('i'); 42745 var label = $(this).next('span'); 42746 button.toggleClass('fa-check-square').toggleClass('fa-square-o'); 42747 label.toggleClass('todo-completed'); 42748 return false;
42749 }); 42750 42751 // Minimalize menu 42752 $('.navbar-minimalize').on('click', function (event) { 42753 event.preventDefault(); 42754 $("body").toggleClass("mini-navbar"); 42755 SmoothlyMenu(); 42756 42757 }); 42758 42759 // Tooltips demo 42760 $('.tooltip-demo').tooltip({ 42761 selector: "[data-toggle=tooltip]", 42762 container: "body" 42763 }); 42764 42765 42766 // Full height of sidebar 42767 function fix_height() { 42768 var heightWithoutNavbar = $("body > #wrapper").height() - 61; 42769 $(".sidebar-panel").css("min-height", heightWithoutNavbar + "px"); 42770 42771 var navbarheight = $('nav.navbar-default').height(); 42772 var wrapperHeight = $('#page-wrapper').height(); 42773 42774 if (navbarheight > wrapperHeight) { 42775 $('#page-wrapper').css("min-height", navbarheight + "px"); 42776 } 42777 42778 if (navbarheight < wrapperHeight) { 42779 $('#page-wrapper').css("min-height", $(window).height() + "px"); 42780 } 42781 42782 if ($('body').hasClass('fixed-nav')) { 42783 if (navbarheight > wrapperHeight) { 42784 $('#page-wrapper').css("min-height", navbarheight + "px"); 42785 } else { 42786 $('#page-wrapper').css("min-height", $(window).height() - 60 + "px"); 42787 } 42788 } 42789 42790 } 42791 42792 fix_height(); 42793 42794 // Fixed Sidebar 42795 $(window).bind("load", function () { 42796 if ($("body").hasClass('fixed-sidebar')) { 42797 $('.sidebar-collapse').slimScroll({ 42798 height: '100%', 42799 railOpacity: 0.9 42800 }); 42801 } 42802 }); 42803 42804 // Move right sidebar top after scroll 42805 $(window).scroll(function () { 42806 if ($(window).scrollTop() > 0 && !$('body').hasClass('fixed-nav')) { 42807 $('#right-sidebar').addClass('sidebar-top'); 42808 } else { 42809 $('#right-sidebar').removeClass('sidebar-top'); 42810 } 42811 }); 42812 42813 $(window).bind("load resize scroll", function () { 42814 if (!$("body").hasClass('body-small')) { 42815 fix_height(); 42816 } 42817 }); 42818 42819 $("[data-toggle=popover]") 42820 .popover(); 42821 42822 // Add slimscroll to element 42823 $('.full-height-scroll').slimscroll({ 42824 height: '100%' 42825 }) 42826}); 42827 42828 42829// Minimalize menu when screen is less than 768px 42830$(window).bind("resize", function () { 42831 if ($(this).width() < 769) { 42832 $('body').addClass('body-small') 42833 } else { 42834 $('body').removeClass('body-small') 42835 } 42836}); 42837 42838// Local Storage functions 42839// Set proper body class and plugins based on user configuration 42840$(document).ready(function () { 42841 if (localStorageSupport()) { 42842 42843 var collapse = localStorage.getItem("collapse_menu"); 42844 var fixedsidebar = localStorage.getItem("fixedsidebar"); 42845 var fixednavbar = localStorage.getItem("fixednavbar"); 42846 var boxedlayout = localStorage.getItem("boxedlayout"); 42847 var fixedfooter = localStorage.getItem("fixedfooter"); 42848 42849 var body = $('body'); 42850 42851 if (fixedsidebar == 'on') { 42852 body.addClass('fixed-sidebar'); 42853 $('.sidebar-collapse').slimScroll({ 42854 height: '100%', 42855 railOpacity: 0.9 42856 }); 42857 } 42858 42859 if (collapse == 'on') { 42860 if (body.hasClass('fixed-sidebar')) { 42861 if (!body.hasClass('body-small')) { 42862 body.addClass('mini-navbar'); 42863 } 42864 } else { 42865 if (!body.hasClass('body-small')) { 42866 body.addClass('mini-navbar'); 42867 } 42868 42869 } 42870 } 42871 42872 if (fixednavbar == 'on') { 42873 $(".navbar-static-top").removeClass('navbar-static-top').addClass('navbar-fixed-top'); 42874 body.addClass('fixed-nav'); 42875 } 42876 42877 if (boxedlayout == 'on') { 42878 body.addClass('boxed-layout'); 42879 } 42880 42881 if (fixedfooter == 'on') { 42882 $(".footer").addClass('fixed'); 42883 } 42884 } 42885}); 42886 42887// check if browser support HTML5 local storage 42888function localStorageSupport() { 42889 return (('localStorage' in window) && window['localStorage'] !== null) 42890} 42891 42892// For demo purpose - animation css script 42893function animationHover(element, animation) { 42894 element = $(element); 42895 element.hover( 42896 function () { 42897 element.addClass('animated ' + animation); 42898 }, 42899 function () { 42900 //wait for animation to finish before removing classes 42901 window.setTimeout(function () { 42902 element.removeClass('animated ' + animation); 42903 }, 2000); 42904 }); 42905} 42906 42907function SmoothlyMenu() { 42908 if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) { 42909 // Hide menu in order to smoothly turn on when maximize menu 42910 $('#side-menu').hide(); 42911 // For smoothly turn on menu 42912 setTimeout( 42913 function () { 42914 $('#side-menu').fadeIn(400); 42915 }, 200); 42916 } else if ($('body').hasClass('fixed-sidebar')) { 42917 $('#side-menu').hide(); 42918 setTimeout( 42919 function () { 42920 $('#side-menu').fadeIn(400); 42921 }, 100); 42922 } else { 42923 // Remove all inline style from jquery fadeIn function to reset menu state 42924 $('#side-menu').removeAttr('style'); 42925 } 42926} 42927 42928// Dragable panels 42929function WinMove() { 42930 var element = "[class*=col]"; 42931 var handle = ".ibox-title"; 42932 var connect = "[class*=col]"; 42933 $(element).sortable( 42934 { 42935 handle: handle, 42936 connectWith: connect, 42937 tolerance: 'pointer', 42938 forcePlaceholderSize: true, 42939 opacity: 0.8 42940 }) 42941 .disableSelection(); 42942}; 42943(function() { 42944 $(function() { 42945 moment.updateLocale('en', { 42946 week: { 42947 dow: 1 42948 } 42949 }); 42950 datepicker(); 42951 datetimepicker(); 42952 timepicker(); 42953 datetimepickerOnlyHours(); 42954 $.fn.select2.defaults.set('theme', 'bootstrap'); 42955 $(".select2, .select-liquid").select2(); 42956 $('.select2_with_clear, .clear-results').select2({ 42957 placeholder: '', 42958 allowClear: true 42959 }); 42960 $('.table-responsive').on('show.bs.dropdown', function() { 42961 return $('.table-responsive').css('overflow', 'inherit'); 42962 }); 42963 return $('.table-responsive').on('hide.bs.dropdown', function() { 42964 return $('.table-responsive').css('overflow', 'auto'); 42965 }); 42966 }); 42967 42968}).call(this);
vendor: 23,459 bytes, lines 42969-42975
42969/*! 42970* CookieConsent 3.1.0 42971* https://github.com/orestbida/cookieconsent 42972* Author Orest Bida 42973* Released under the MIT License 42974*/ 42975var e,t;e=this,t=function(e){'use strict';const t='opt-in',o='opt-out',n='show--consent',s='show--preferences',a='disable--interaction',c='data-category',r='div',i='button',l='aria-hidden',d='btn-group',f='click',_='data-role',u='consentModal',p='preferencesModal';class g{constructor(){this.t={mode:t,revision:0,autoShow:!0,lazyHtmlGeneration:!0,autoClearCookies:!0,manageScriptTags:!0,hideFromBots:!0,cookie:{name:'cc_cookie',expiresAfterDays:182,domain:'',path:'/',secure:!0,sameSite:'Lax'}},this.o={i:{},l:'',_:{},u:{},p:{},m:[],v:!1,h:null,C:null,S:null,M:'',T:!0,D:!1,k:!1,A:!1,N:!1,H:[],V:!1,j:!0,I:[],L:!1,F:'',P:!1,O:[],R:[],B:[],$:[],G:!1,J:!1,U:!1,q:[],K:[],W:[],X:{},Y:{},Z:{},ee:{},te:{},oe:[]},this.ne={se:{},ae:{}},this.ce={},this.re={ie:'cc:onFirstConsent',le:'cc:onConsent',de:'cc:onChange',fe:'cc:onModalShow',_e:'cc:onModalHide',ue:'cc:onModalReady'}}}const m=new g,b=(e,t)=>e.indexOf(t),v=(e,t)=>-1!==b(e,t),y=e=>Array.isArray(e),h=e=>'string'==typeof e,C=e=>!!e&&'object'==typeof e&&!y(e),w=e=>'function'==typeof e,S=e=>Object.keys(e),x=e=>Array.from(new Set(e)),M=()=>document.activeElement,T=e=>e.preventDefault(),D=(e,t)=>e.querySelectorAll(t),k=e=>e.dispatchEvent(new Event('change')),E=e=>{const t=document.createElement(e);return e===i&&(t.type=e),t},A=(e,t,o)=>e.setAttribute(t,o),N=(e,t,o)=>{e.removeAttribute(o?'data-'+t:t)},H=(e,t,o)=>e.getAttribute(o?'data-'+t:t),V=(e,t)=>e.appendChild(t),j=(e,t)=>e.classList.add(t),I=(e,t)=>j(e,'cm__'+t),L=(e,t)=>j(e,'pm__'+t),F=(e,t)=>e.classList.remove(t),P=e=>{if('object'!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());let t=Array.isArray(e)?[]:{};for(let o in e){let n=e[o];t[o]=P(n)}return t},O=()=>{const e={},{O:t,X:o,Y:n}=m.o;for(const s of t)e[s]=G(n[s],S(o[s]));return e},R=(e,t)=>dispatchEvent(new CustomEvent(e,{detail:t})),B=(e,t,o,n)=>{e.addEventListener(t,o),n&&m.o.m.push({pe:e,ge:t,me:o})},$=()=>{const e=m.t.cookie.expiresAfterDays;return w(e)?e(m.o.F):e},G=(e,t)=>{const o=e||[],n=t||[];return o.filter((e=>!v(n,e))).concat(n.filter((e=>!v(o,e))))},J=e=>{m.o.R=x(e),m.o.F=(()=>{let e='custom';const{R:t,O:o,B:n}=m.o,s=t.length;return s===o.length?e='all':s===n.length&&(e='necessary'),e})()},U=(e,t,o,n)=>{const s='accept-',{show:a,showPreferences:c,hide:r,hidePreferences:i,acceptCategory:l}=t,d=e||document,_=e=>D(d,`[data-cc="${e}"]`),u=(e,t)=>{T(e),l(t),i(),r()},p=_('show-preferencesModal'),g=_('show-consentModal'),b=_(s+'all'),v=_(s+'necessary'),y=_(s+'custom'),h=m.t.lazyHtmlGeneration;for(const e of p)A(e,'aria-haspopup','dialog'),B(e,f,(e=>{T(e),c()})),h&&(B(e,'mouseenter',(e=>{T(e),m.o.N||o(t,n)}),!0),B(e,'focus',(()=>{m.o.N||o(t,n)})));for(let e of g)A(e,'aria-haspopup','dialog'),B(e,f,(e=>{T(e),a(!0)}),!0);for(let e of b)B(e,f,(e=>{u(e,'all')}),!0);for(let e of y)B(e,f,(e=>{u(e)}),!0);for(let e of v)B(e,f,(e=>{u(e,[])}),!0)},z=(e,t)=>{e&&(t&&(e.tabIndex=-1),e.focus(),t&&e.removeAttribute('tabindex'))},q=(e,t)=>{const o=n=>{n.target.removeEventListener('transitionend',o),'opacity'===n.propertyName&&'1'===getComputedStyle(e).opacity&&z((e=>1===e?m.ne.be:m.ne.ve)(t))};B(e,'transitionend',o)};let K;const Q=e=>{clearTimeout(K),e?j(m.ne.ye,a):K=setTimeout((()=>{F(m.ne.ye,a)}),500)},W=['M 19.5 4.5 L 4.5 19.5 M 4.5 4.501 L 19.5 19.5','M 3.572 13.406 L 8.281 18.115 L 20.428 5.885','M 21.999 6.94 L 11.639 17.18 L 2.001 6.82 '],X=(e=0,t=1.5)=>`<svg viewBox="0 0 24 24" stroke-width="${t}"><path d="${W[e]}"/></svg>`,Y=e=>{const t=m.ne,o=m.o;(e=>{const n=e===t.he,s=o.i.disablePageInteraction?t.ye:n?t.Ce:t.ye;B(s,'keydown',(t=>{if('Tab'!==t.key||!(n?o.k&&!o.A:o.A))return;const s=M(),a=n?o.q:o.K;0!==a.length&&(t.shiftKey?s!==a[0]&&e.contains(s)||(T(t),z(a[1])):s!==a[1]&&e.contains(s)||(T(t),z(a[0])))}),!0)})(e)},Z=['[href]',i,'input','details','[tabindex]'].map((e=>e+':not([tabindex="-1"])')).join(','),ee=e=>{const{o:t,ne:o}=m,n=(e,t)=>{const o=D(e,Z);t[0]=o[0],t[1]=o[o.length-1]};1===e&&t.D&&n(o.he,t.q),2===e&&t.N&&n(o.we,t.K)},te=(e,t,o)=>{const{de:n,le:s,ie:a,_e:c,ue:r,fe:i}=m.ce,l=m.re;if(t){const n={modalName:t};return e===l.fe?w(i)&&i(n):e===l._e?w(c)&&c(n):(n.modal=o,w(r)&&r(n)),R(e,n)}const d={cookie:m.o.p};e===l.ie?w(a)&&a(P(d)):e===l.le?w(s)&&s(P(d)):(d.changedCategories=m.o.I,d.changedServices=m.o.ee,w(n)&&n(P(d))),R(e,P(d))},oe=(e,t)=>{try{return e()}catch(e){return!t&&console.warn('CookieConsent:',e),!1}},ne=e=>{const{Y:t,ee:o,O:n,X:s,oe:a,p:r,I:i}=m.o;for(const e of n){const n=o[e]||t[e]||[];for(const o of n){const n=s[e][o];if(!n)continue;const{onAccept:a,onReject:c}=n;!n.Se&&v(t[e],o)?(n.Se=!0,w(a)&&a()):n.Se&&!v(t[e],o)&&(n.Se=!1,w(c)&&c())}}if(!m.t.manageScriptTags)return;const l=a,d=e||r.categories||[],f=(e,n)=>{if(n>=e.length)return;const s=a[n];if(s.xe)return f(e,n+1);const r=s.Me,l=s.Te,_=s.De,u=v(d,l),p=!!_&&v(t[l],_);if(!_&&!s.ke&&u||!_&&s.ke&&!u&&v(i,l)||_&&!s.ke&&p||_&&s.ke&&!p&&v(o[l]||[],_)){s.xe=!0;const t=H(r,'type',!0);N(r,'type',!!t),N(r,c);let o=H(r,'src',!0);o&&N(r,'src',!0);const a=E('script');a.textContent=r.innerHTML;for(const{nodeName:e}of r.attributes)A(a,e,r[e]||H(r,e));t&&(a.type=t),o?a.src=o:o=r.src;const i=!!o&&(!t||['text/javascript','module'].includes(t));if(i&&(a.onload=a.onerror=()=>{f(e,++n)}),r.replaceWith(a),i)return}f(e,++n)};f(l,0)},se='bottom',ae='left',ce='center',re='right',ie='inline',le='wide',de='pm--',fe=['middle','top',se],_e=[ae,ce,re],ue={box:{Ee:[le,ie],Ae:fe,Ne:_e,He:se,Ve:re},cloud:{Ee:[ie],Ae:fe,Ne:_e,He:se,Ve:ce},bar:{Ee:[ie],Ae:fe.slice(1),Ne:[],He:se,Ve:''}},pe={box:{Ee:[],Ae:[],Ne:[],He:'',Ve:''},bar:{Ee:[le],Ae:[],Ne:[ae,re],He:'',Ve:ae}},ge=e=>{const t=m.o.i.guiOptions,o=t&&t.consentModal,n=t&&t.preferencesModal;0===e&&me(m.ne.he,ue,o,'cm--','box','cm'),1===e&&me(m.ne.we,pe,n,de,'box','pm')},me=(e,t,o,n,s,a)=>{e.className=a;const c=o&&o.layout,r=o&&o.position,i=o&&o.flipButtons,l=!o||!1!==o.equalWeightButtons,d=c&&c.split(' ')||[],f=d[0],_=d[1],u=f in t?f:s,p=t[u],g=v(p.Ee,_)&&_,b=r&&r.split(' ')||[],y=b[0],h=n===de?b[0]:b[1],C=v(p.Ae,y)?y:p.He,w=v(p.Ne,h)?h:p.Ve,S=t=>{t&&j(e,n+t)};S(u),S(g),S(C),S(w),i&&S('flip');const x=a+'__btn--secondary';if('cm'===a){const{je:e,Ie:t}=m.ne;e&&(l?F(e,x):j(e,x)),t&&(l?F(t,x):j(t,x))}else{const{Le:e}=m.ne;e&&(l?F(e,x):j(e,x))}},be=(e,t)=>{const o=m.o,n=m.ne,{hide:s,hidePreferences:a,acceptCategory:c}=e,u=e=>{c(e),a(),s()},g=o.u&&o.u.preferencesModal;if(!g)return;const b=g.title,v=g.closeIconLabel,y=g.acceptAllBtn,w=g.acceptNecessaryBtn,x=g.savePreferencesBtn,M=g.sections||[],T=y||w||x;if(n.Fe)n.Pe=E(r),L(n.Pe,'body');else{n.Fe=E(r),j(n.Fe,'pm-wrapper');const e=E('div');j(e,'pm-overlay'),V(n.Fe,e),B(e,f,a),n.we=E(r),j(n.we,'pm'),A(n.we,'role','dialog'),A(n.we,l,!0),A(n.we,'aria-modal',!0),A(n.we,'aria-labelledby','pm__title'),B(n.ye,'keydown',(e=>{27===e.keyCode&&a()}),!0),n.Oe=E(r),L(n.Oe,'header'),n.Re=E('h2'),L(n.Re,'title'),n.Re.id='pm__title',n.Be=E(i),L(n.Be,'close-btn'),A(n.Be,'aria-label',g.closeIconLabel||''),B(n.Be,f,a),n.$e=E('span'),n.$e.innerHTML=X(),V(n.Be,n.$e),n.Ge=E(r),L(n.Ge,'body'),n.Je=E(r),L(n.Je,'footer');var D=E(r);j(D,'btns');var k=E(r),N=E(r);L(k,d),L(N,d),V(n.Je,k),V(n.Je,N),V(n.Oe,n.Re),V(n.Oe,n.Be),n.ve=E(r),A(n.ve,'tabIndex',-1),V(n.we,n.ve),V(n.we,n.Oe),V(n.we,n.Ge),T&&V(n.we,n.Je),V(n.Fe,n.we)}let H;b&&(n.Re.innerHTML=b,v&&A(n.Be,'aria-label',v)),M.forEach(((e,t)=>{const s=e.title,a=e.description,c=e.linkedCategory,d=c&&o.P[c],_=e.cookieTable,u=_&&_.body,p=_&&_.caption,m=u&&u.length>0,b=!!d,v=b&&o.X[c],y=C(v)&&S(v)||[],w=b&&(!!a||!!m||S(v).length>0);var x=E(r);if(L(x,'section'),w||a){var M=E(r);L(M,'section-desc-wrapper')}let T=y.length;if(w&&T>0){const e=E(r);L(e,'section-services');for(const t of y){const o=v[t],n=o&&o.label||t,s=E(r),a=E(r),i=E(r),l=E(r);L(s,'service'),L(l,'service-title'),L(a,'service-header'),L(i,'service-icon');const f=ve(n,t,d,!0,c);l.innerHTML=n,V(a,i),V(a,l),V(s,a),V(s,f),V(e,s)}V(M,e)}if(s){var D=E(r),k=E(b?i:r);if(L(D,'section-title-wrapper'),L(k,'section-title'),k.innerHTML=s,V(D,k),b){const e=E('span');e.innerHTML=X(2,3.5),L(e,'section-arrow'),V(D,e),x.className+='--toggle';const t=ve(s,c,d);let o=g.serviceCounterLabel;if(T>0&&h(o)){let e=E('span');L(e,'badge'),L(e,'service-counter'),A(e,l,!0),A(e,'data-servicecounter',T),o&&(o=o.split('|'),o=o.length>1&&T>1?o[1]:o[0],A(e,'data-counterlabel',o)),e.innerHTML=T+(o?' '+o:''),V(k,e)}if(w){L(x,'section--expandable');var N=c+'-desc';A(k,'aria-expanded',!1),A(k,'aria-controls',N)}V(D,t)}else A(k,'role','heading'),A(k,'aria-level','3');V(x,D)}if(a){var I=E('p');L(I,'section-desc'),I.innerHTML=a,V(M,I)}if(w&&(A(M,l,'true'),M.id=N,((e,t,o)=>{B(k,f,(()=>{t.classList.contains('is-expanded')?(F(t,'is-expanded'),A(o,'aria-expanded','false'),A(e,l,'true')):(j(t,'is-expanded'),A(o,'aria-expanded','true'),A(e,l,'false'))}))})(M,x,k),m)){const e=E('table'),o=E('thead'),s=E('tbody');if(p){const t=E('caption');L(t,'table-caption'),t.innerHTML=p,e.appendChild(t)}L(e,'section-table'),L(o,'table-head'),L(s,'table-body');const a=_.headers,c=S(a),i=n.Ue.createDocumentFragment(),l=E('tr');for(const e of c){const o=a[e],n=E('th');n.id='cc__row-'+o+t,A(n,'scope','col'),L(n,'table-th'),n.innerHTML=o,V(i,n)}V(l,i),V(o,l);const d=n.Ue.createDocumentFragment();for(const e of u){const o=E('tr');L(o,'table-tr');for(const n of c){const s=a[n],c=e[n],i=E('td'),l=E(r);L(i,'table-td'),A(i,'data-column',s),A(i,'headers','cc__row-'+s+t),l.insertAdjacentHTML('beforeend',c),V(i,l),V(o,i)}V(d,o)}V(s,d),V(e,o),V(e,s),V(M,e)}(w||a)&&V(x,M);const P=n.Pe||n.Ge;b?(H||(H=E(r),L(H,'section-toggles')),H.appendChild(x)):H=null,V(P,H||x)})),y&&(n.ze||(n.ze=E(i),L(n.ze,'btn'),A(n.ze,_,'all'),V(k,n.ze),B(n.ze,f,(()=>u('all')))),n.ze.innerHTML=y),w&&(n.Le||(n.Le=E(i),L(n.Le,'btn'),A(n.Le,_,'necessary'),V(k,n.Le),B(n.Le,f,(()=>u([])))),n.Le.innerHTML=w),x&&(n.qe||(n.qe=E(i),L(n.qe,'btn'),L(n.qe,'btn--secondary'),A(n.qe,_,'save'),V(N,n.qe),B(n.qe,f,(()=>u()))),n.qe.innerHTML=x),n.Pe&&(n.we.replaceChild(n.Pe,n.Ge),n.Ge=n.Pe),ge(1),o.N||(o.N=!0,te(m.re.ue,p,n.we),t(e),V(n.Ce,n.Fe),Y(n.we),setTimeout((()=>j(n.Fe,'cc--anim')),100)),ee(2)};function ve(e,t,o,n,s){const a=m.o,r=m.ne,i=E('label'),d=E('input'),_=E('span'),u=E('span'),p=E('span'),g=E('span'),b=E('span');if(g.innerHTML=X(1,3),b.innerHTML=X(0,3),d.type='checkbox',j(i,'section__toggle-wrapper'),j(d,'section__toggle'),j(g,'toggle__icon-on'),j(b,'toggle__icon-off'),j(_,'toggle__icon'),j(u,'toggle__icon-circle'),j(p,'toggle__label'),A(_,l,'true'),n?(j(i,'toggle-service'),A(d,c,s),r.ae[s][t]=d):r.se[t]=d,n?(e=>{B(d,'change',(()=>{const t=r.ae[e],o=r.se[e];a.Z[e]=[];for(let o in t){const n=t[o];n.checked&&a.Z[e].push(n.value)}o.checked=a.Z[e].length>0}))})(s):(e=>{B(d,f,(()=>{const t=r.ae[e],o=d.checked;a.Z[e]=[];for(let n in t)t[n].checked=o,o&&a.Z[e].push(n)}))})(t),d.value=t,p.textContent=e.replace(/<.*>.*<\/.*>/gm,''),V(u,b),V(u,g),V(_,u),a.T)(o.readOnly||o.enabled)&&(d.checked=!0);else if(n){const e=a.Y[s];d.checked=o.readOnly||v(e,t)}else v(a.R,t)&&(d.checked=!0);return o.readOnly&&(d.disabled=!0),V(i,d),V(i,_),V(i,p),i}const ye=()=>{const e=E('span');return m.ne.Ke||(m.ne.Ke=e),e},he=(e,t)=>{const o=m.o,n=m.ne,{hide:s,showPreferences:a,acceptCategory:c}=e,p=o.u&&o.u.consentModal;if(!p)return;const g=p.acceptAllBtn,b=p.acceptNecessaryBtn,v=p.showPreferencesBtn,y=p.closeIconLabel,h=p.footer,C=p.label,w=p.title,S=e=>{s(),c(e)};if(!n.Qe){n.Qe=E(r),n.he=E(r),n.We=E(r),n.Xe=E(r),n.Ye=E(r),j(n.Qe,'cm-wrapper'),j(n.he,'cm'),I(n.We,'body'),I(n.Xe,'texts'),I(n.Ye,'btns'),A(n.he,'role','dialog'),A(n.he,'aria-modal','true'),A(n.he,l,'false'),A(n.he,'aria-describedby','cm__desc'),C?A(n.he,'aria-label',C):w&&A(n.he,'aria-labelledby','cm__title');const e='box',t=o.i.guiOptions,s=t&&t.consentModal,a=(s&&s.layout||e).split(' ')[0]===e;w&&y&&a&&(n.Ie||(n.Ie=E(i),n.Ie.innerHTML=X(),I(n.Ie,'btn'),I(n.Ie,'btn--close'),B(n.Ie,f,(()=>{S([])})),V(n.We,n.Ie)),A(n.Ie,'aria-label',y)),V(n.We,n.Xe),(g||b||v)&&V(n.We,n.Ye),n.be=E(r),A(n.be,'tabIndex',-1),V(n.he,n.be),V(n.he,n.We),V(n.Qe,n.he)}w&&(n.Ze||(n.Ze=E('h2'),n.Ze.className=n.Ze.id='cm__title',V(n.Xe,n.Ze)),n.Ze.innerHTML=w);let x=p.description;if(x&&(o.V&&(x=x.replace('{{revisionMessage}}',o.j?'':p.revisionMessage||'')),n.et||(n.et=E('p'),n.et.className=n.et.id='cm__desc',V(n.Xe,n.et)),n.et.innerHTML=x),g&&(n.tt||(n.tt=E(i),V(n.tt,ye()),I(n.tt,'btn'),A(n.tt,_,'all'),B(n.tt,f,(()=>{S('all')}))),n.tt.firstElementChild.innerHTML=g),b&&(n.je||(n.je=E(i),V(n.je,ye()),I(n.je,'btn'),A(n.je,_,'necessary'),B(n.je,f,(()=>{S([])}))),n.je.firstElementChild.innerHTML=b),v&&(n.ot||(n.ot=E(i),V(n.ot,ye()),I(n.ot,'btn'),I(n.ot,'btn--secondary'),A(n.ot,_,'show'),B(n.ot,'mouseenter',(()=>{o.N||be(e,t)})),B(n.ot,f,a)),n.ot.firstElementChild.innerHTML=v),n.nt||(n.nt=E(r),I(n.nt,d),g&&V(n.nt,n.tt),b&&V(n.nt,n.je),(g||b)&&V(n.We,n.nt),V(n.Ye,n.nt)),n.ot&&!n.st&&(n.st=E(r),n.je&&n.tt?(I(n.st,d),V(n.st,n.ot),V(n.Ye,n.st)):(V(n.nt,n.ot),I(n.nt,d+'--uneven'))),h){if(!n.ct){let e=E(r),t=E(r);n.ct=E(r),I(e,'footer'),I(t,'links'),I(n.ct,'link-group'),V(t,n.ct),V(e,t),V(n.he,e)}n.ct.innerHTML=h}ge(0),o.D||(o.D=!0,te(m.re.ue,u,n.he),t(e),V(n.Ce,n.Qe),Y(n.he),setTimeout((()=>j(n.Qe,'cc--anim')),100)),ee(1),U(n.We,e,be,t)},Ce=e=>{if(!h(e))return null;if(e in m.o._)return e;let t=e.slice(0,2);return t in m.o._?t:null},we=()=>m.o.l||m.o.i.language.default,Se=e=>{e&&(m.o.l=e)},xe=async e=>{const t=m.o;let o=Ce(e)?e:we(),n=t._[o];if(h(n)?n=await(async e=>{try{const t=await fetch(e);return await t.json()}catch(e){return console.error(e),!1}})(n):w(n)&&(n=await n()),!n)throw`Could not load translation for the '${o}' language`;return t.u=n,Se(o),!0},Me=()=>{let e=m.o.i.language.rtl,t=m.ne.Ce;e&&t&&(y(e)||(e=[e]),v(e,m.o.l)?j(t,'cc--rtl'):F(t,'cc--rtl'))},Te=()=>{const e=m.ne;if(e.Ce)return;e.Ce=E(r),e.Ce.id='cc-main',e.Ce.setAttribute('data-nosnippet',''),Me();let t=m.o.i.root;t&&h(t)&&(t=document.querySelector(t)),(t||e.Ue.body).appendChild(e.Ce)},De=e=>oe((()=>localStorage.removeItem(e))),ke=(e,t)=>{if(t instanceof RegExp)return e.filter((e=>t.test(e)));{const o=b(e,t);return o>-1?[e[o]]:[]}},Ee=e=>{const{hostname:t,protocol:o}=location,{name:n,path:s,domain:a,sameSite:c,useLocalStorage:r,secure:i}=m.t.cookie,l=e?(()=>{const e=m.o.S,t=e?new Date-e:0;return 864e5*$()-t})():864e5*$(),d=new Date;d.setTime(d.getTime()+l),m.o.p.expirationTime=d.getTime();const f=JSON.stringify(m.o.p);let _=n+'='+encodeURIComponent(f)+(0!==l?'; expires='+d.toUTCString():'')+'; Path='+s+'; SameSite='+c;v(t,'.')&&(_+='; Domain='+a),i&&'https:'===o&&(_+='; Secure'),r?((e,t)=>{oe((()=>localStorage.setItem(e,t)))})(n,f):document.cookie=_,m.o.p},Ae=(e,t,o)=>{if(0===e.length)return;const n=o||m.t.cookie.domain,s=t||m.t.cookie.path,a='www.'===n.slice(0,4),c=a&&n.substring(4),r=(e,t)=>{t&&'.'!==t.slice(0,1)&&(t='.'+t),document.cookie=e+'=; path='+s+(t?'; domain='+t:'')+'; expires=Thu, 01 Jan 1970 00:00:01 GMT;'};for(const t of e)r(t,o),o||r(t,n),a&&r(t,c)},Ne=e=>{const t=e||m.t.cookie.name,o=m.t.cookie.useLocalStorage;return((e,t)=>{let o;return o=oe((()=>JSON.parse(t?e:decodeURIComponent(e))),!0)||{},o})(o?(n=t,oe((()=>localStorage.getItem(n)))||''):He(t,!0),o);var n},He=(e,t)=>{const o=document.cookie.match('(^|;)\\s*'+e+'\\s*=\\s*([^;]+)');return o?t?o.pop():e:''},Ve=e=>{const t=document.cookie.split(/;\s*/),o=[];for(const n of t){let t=n.split('=')[0];e?oe((()=>{e.test(t)&&o.push(t)})):o.push(t)}return o},je=(e,n=[])=>{((e,t)=>{const{O:o,R:n,B:s,N:a,Z:c,$:r,X:i}=m.o;let l=[];if(e){y(e)?l.push(...e):h(e)&&(l='all'===e?o:[e]);for(const e of o)c[e]=v(l,e)?S(i[e]):[]}else l=[...n,...r],a&&(l=(()=>{const e=m.ne.se;if(!e)return[];let t=[];for(let o in e)e[o].checked&&t.push(o);return t})());l=l.filter((e=>!v(o,e)||!v(t,e))),l.push(...s),J(l)})(e,n),(()=>{const e=m.o,{Z:t,B:o,Y:n,X:s,O:a}=e,c=a;e.te=P(n);for(const a of c){const c=s[a],r=S(c),i=t[a]&&t[a].length>0,l=v(o,a);if(0!==r.length){if(n[a]=[],l)n[a].push(...r);else if(i){const e=t[a];n[a].push(...e)}else n[a]=e.Z[a];n[a]=x(n[a])}}})(),(()=>{const e=m.o;e.I=m.t.mode===o&&e.T?G(e.$,e.R):G(e.R,e.p.categories);let n=e.I.length>0,s=!1;for(const t of e.O)e.ee[t]=G(e.Y[t],e.te[t]),e.ee[t].length>0&&(s=!0);const a=m.ne.se;for(const t in a)a[t].checked=v(e.R,t);for(const t of e.O){const o=m.ne.ae[t],n=e.Y[t];for(const e in o)o[e].checked=v(n,e)}e.C||(e.C=new Date),e.M||(e.M=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))),e.p={categories:P(e.R),revision:m.t.revision,data:e.h,consentTimestamp:e.C.toISOString(),consentId:e.M,services:P(e.Y),languageCode:m.o.l},e.S&&(e.p.lastConsentTimestamp=e.S.toISOString());let c=!1;const r=n||s;(e.T||r)&&(e.T&&(e.T=!1,c=!0),e.S=e.S?new Date:e.C,e.p.lastConsentTimestamp=e.S.toISOString(),Ee(),m.t.autoClearCookies&&(c||r)&&(e=>{const t=m.o,o=Ve(),n=(e=>{const t=m.o;return(e?t.O:t.I).filter((e=>{const o=t.P[e];return!!o&&!o.readOnly&&!!o.autoClear}))})(e);for(const e in t.ee)for(const n of t.ee[e]){const s=t.X[e][n].cookies;if(!v(t.Y[e],n)&&s)for(const e of s){const t=ke(o,e.name);Ae(t,e.path,e.domain)}}for(const s of n){const n=t.P[s].autoClear,a=n&&n.cookies||[],c=v(t.I,s),r=!v(t.R,s),i=c&&r;if(e?r:i){n.reloadPage&&i&&(t.L=!0);for(const e of a){const t=ke(o,e.name);Ae(t,e.path,e.domain)}}}})(c),ne()),c&&(te(m.re.ie),te(m.re.le),m.t.mode===t)||(r&&te(m.re.de),e.L&&(e.L=!1,location.reload()))})()},Ie=e=>{const t=m.o.T?[]:m.o.R;return v(t,e)},Le=(e,t)=>{const o=m.o.T?[]:m.o.Y[t]||[];return v(o,e)},Fe=(e,t,o)=>{let n=[];const s=e=>{if(h(e)){let t=He(e);''!==t&&n.push(t)}else n.push(...Ve(e))};if(y(e))for(let t of e)s(t);else s(e);Ae(n,t,o)},Pe=e=>{const{ne:t,o:o}=m;if(!o.k){if(!o.D){if(!e)return;he($e,Te)}o.k=!0,o.J=M(),o.v&&Q(!0),q(t.he,1),j(t.ye,n),A(t.he,l,'false'),setTimeout((()=>{z(m.ne.be)}),100),te(m.re.fe,u)}},Oe=()=>{const{ne:e,o:t,re:o}=m;t.k&&(t.k=!1,t.v&&Q(),z(e.Ke,!0),F(e.ye,n),A(e.he,l,'true'),z(t.J),t.J=null,te(o._e,u))},Re=()=>{const e=m.o;e.A||(e.N||be($e,Te),e.A=!0,e.k?e.U=M():e.J=M(),q(m.ne.we,2),j(m.ne.ye,s),A(m.ne.we,l,'false'),setTimeout((()=>{z(m.ne.ve)}),100),te(m.re.fe,p))},Be=()=>{const e=m.o;e.A&&(e.A=!1,(()=>{const e=Je(),t=m.o.P,o=m.ne.se,n=m.ne.ae,s=e=>v(m.o.$,e);for(const a in o){const c=!!t[a].readOnly;o[a].checked=c||(e?Ie(a):s(a));for(const t in n[a])n[a][t].checked=c||(e?Le(t,a):s(a))}})(),z(m.ne.$e,!0),F(m.ne.ye,s),A(m.ne.we,l,'true'),e.k?(z(e.U),e.U=null):(z(e.J),e.J=null),te(m.re._e,p))};var $e={show:Pe,hide:Oe,showPreferences:Re,hidePreferences:Be,acceptCategory:je};const Ge=(e,t)=>{const o=Ne(t);return e?o[e]:o},Je=()=>!m.o.T;e.acceptCategory=je,e.acceptService=(e,t)=>{const{O:o,X:n}=m.o;if(!(e&&t&&h(t)&&v(o,t)&&0!==S(n[t]).length))return!1;((e,t)=>{const o=m.o,{X:n,Z:s,N:a}=o,c=m.ne.ae[t]||{},r=m.ne.se[t]||{},i=S(n[t]);if(s[t]=[],h(e)){if('all'===e){if(s[t].push(...i),a)for(let e in c)c[e].checked=!0,k(c[e])}else if(v(i,e)&&s[t].push(e),a)for(let t in c)c[t].checked=e===t,k(c[t])}else if(y(e))for(let o of i){const n=v(e,o);n&&s[t].push(o),a&&(c[o].checked=n,k(c[o]))}const l=0===s[t].length;o.R=l?o.R.filter((e=>e!==t)):x([...o.R,t]),a&&(r.checked=!l,k(r))})(e,t),je()},e.acceptedCategory=Ie,e.acceptedService=Le,e.eraseCookies=Fe,e.getConfig=e=>{const t=m.t,o=m.o.i;return e?t[e]||o[e]:{...t,...o,cookie:{...t.cookie}}},e.getCookie=Ge,e.getUserPreferences=()=>{const{F:e,Y:t}=m.o,{accepted:o,rejected:n}=(()=>{const{T:e,R:t,O:o}=m.o;return{accepted:t,rejected:e?[]:o.filter((e=>!v(t,e)))}})();return P({acceptType:e,acceptedCategories:o,rejectedCategories:n,acceptedServices:t,rejectedServices:O()})},e.hide=Oe,e.hidePreferences=Be,e.loadScript=(e,t)=>{let o=document.querySelector('script[src="'+e+'"]');return new Promise((n=>{if(o)return n(!0);if(o=E('script'),C(t))for(const e in t)A(o,e,t[e]);o.onload=()=>n(!0),o.onerror=()=>{o.remove(),n(!1)},o.src=e,V(document.head,o)}))},e.reset=e=>{const{Ce:t,ye:o}=m.ne,{name:c,path:r,domain:i,useLocalStorage:l}=m.t.cookie;e&&(l?De(c):Fe(c,r,i));for(const{pe:e,ge:t,me:o}of m.o.m)e.removeEventListener(t,o);t&&t.remove(),o&&o.classList.remove(a,s,n);const d=new g;for(const e in m)m[e]=d[e];window._ccRun=!1},e.run=async e=>{const{o:t,t:n,re:s}=m,a=window;if(!a._ccRun){if(a._ccRun=!0,(e=>{const{ne:t,t:n,o:s}=m,a=n,r=s,{cookie:i}=a,l=m.ce,d=e.cookie,f=e.categories,_=S(f)||[],u=navigator,p=document;t.Ue=p,t.ye=p.documentElement,i.domain=location.hostname,r.i=e,r.P=f,r.O=_,r._=e.language.translations,r.v=!!e.disablePageInteraction,l.ie=e.onFirstConsent,l.le=e.onConsent,l.de=e.onChange,l._e=e.onModalHide,l.fe=e.onModalShow,l.ue=e.onModalReady;const{mode:g,autoShow:b,lazyHtmlGeneration:y,autoClearCookies:h,revision:w,manageScriptTags:x,hideFromBots:M}=e;g===o&&(a.mode=g),'boolean'==typeof h&&(a.autoClearCookies=h),'boolean'==typeof x&&(a.manageScriptTags=x),'number'==typeof w&&w>=0&&(a.revision=w,r.V=!0),'boolean'==typeof b&&(a.autoShow=b),'boolean'==typeof y&&(a.lazyHtmlGeneration=y),!1===M&&(a.hideFromBots=!1),!0===a.hideFromBots&&u&&(r.G=u.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(u.userAgent)||u.webdriver),C(d)&&(a.cookie={...i,...d}),a.autoClearCookies,r.V,a.manageScriptTags,(e=>{const{P:t,X:o,Y:n,Z:s,B:a}=m.o;for(let c of e){const e=t[c],r=e.services||{},i=C(r)&&S(r)||[];o[c]={},n[c]=[],s[c]=[],e.readOnly&&(a.push(c),n[c]=i),m.ne.ae[c]={};for(let e of i){const t=r[e];t.Se=!1,o[c][e]=t}}})(_),(()=>{if(!m.t.manageScriptTags)return;const e=m.o,t=D(document,'script['+c+']');for(const o of t){let t=H(o,c),n=o.dataset.service||'',s=!1;if(t&&'!'===t.charAt(0)&&(t=t.slice(1),s=!0),'!'===n.charAt(0)&&(n=n.slice(1),s=!0),v(e.O,t)&&(e.oe.push({Me:o,xe:!1,ke:s,Te:t,De:n}),n)){const o=e.X[t];o[n]||(o[n]={Se:!1})}}})(),Se((()=>{const e=m.o.i.language.autoDetect;if(e){const t={browser:navigator.language,document:document.documentElement.lang},o=Ce(t[e]);if(o)return o}return we()})())})(e),t.G)return;(()=>{const e=m.o,t=m.t,n=Ne(),{categories:s,services:a,consentId:c,consentTimestamp:r,lastConsentTimestamp:i,data:l,revision:d}=n,f=y(s);e.p=n,e.M=c;const _=!!c&&h(c);e.C=r,e.C&&(e.C=new Date(r)),e.S=i,e.S&&(e.S=new Date(i)),e.h=void 0!==l?l:null,e.V&&_&&d!==t.revision&&(e.j=!1),e.T=!(_&&e.j&&e.C&&e.S&&f),t.cookie.useLocalStorage&&!e.T&&(e.T=(new Date).getTime()>(n.expirationTime||0),e.T&&De(t.cookie.name)),e.T,(()=>{const e=m.o;for(const t of e.O){const n=e.P[t];if(n.readOnly||n.enabled){e.$.push(t);const n=e.X[t]||{};for(let s in n)e.Z[t].push(s),e.i.mode===o&&e.Y[t].push(s)}}})(),e.T?t.mode===o&&(e.R=[...e.$]):(e.Y={...e.Y,...a},e.Z={...e.Y},J([...e.B,...s]))})();const i=Je();if(!await xe())return!1;if(U(null,r=$e,be,Te),m.o.T&&he(r,Te),m.t.lazyHtmlGeneration||be(r,Te),n.autoShow&&!i&&Pe(!0),i)return ne(),te(s.le);n.mode===o&&ne(t.$)}var r},e.setCookieData=e=>{let t,o=e.value,n=e.mode,s=!1;const a=m.o;if('update'===n){a.h=t=Ge('data');const e=typeof t==typeof o;if(e&&'object'==typeof t){!t&&(t={});for(let e in o)t[e]!==o[e]&&(t[e]=o[e],s=!0)}else!e&&t||t===o||(t=o,s=!0)}else t=o,s=!0;return s&&(a.h=t,a.p.data=t,Ee(!0)),s},e.setLanguage=async(e,t)=>{if(!Ce(e))return!1;const o=m.o;return!(e===we()&&!0!==t||!await xe(e)||(Se(e),o.D&&he($e,Te),o.N&&be($e,Te),Me(),0))},e.show=Pe,e.showPreferences=Re,e.validConsent=Je,e.validCookie=e=>''!==He(e,!0)},'object'==typeof exports&&'undefined'!=typeof module?t(exports):'function'==typeof define&&define.amd?define(['exports'],t):t((e='undefined'!=typeof globalThis?globalThis:e||self).CookieConsent={});
42976// 2026-09-30T08:54:40+02:00 42977 42978 42979window.addEventListener('load', function () { 42980 CookieConsent.run({ 42981 revision: 0, 42982 autoShow: true, 42983 disablePageInteraction: true, 42984 hideFromBots: true, 42985 42986 cookie: { 42987 name: 'cc_cookie', 42988 expiresAfterDays: 182, 42989 sameSite: 'Lax', 42990 42991 path: '/', 42992 }, 42993 42994 42995 42996 categories: {"required":{"enabled":true,"readOnly":true},"analytic":{"enabled":false,"readOnly":false}}, 42997 42998 language: { 42999 default: document.documentElement.lang || 'cs', 43000 autoDetect: 'document', 43001 translations: {"en":{"consentModal":{"title":"We use cookies!","description":"Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent.","acceptAllBtn":"Accept all","acceptNecessaryBtn":"Reject all","showPreferencesBtn":"Customize"},"preferencesModal":{"title":"Cookie preferences","acceptAllBtn":"Accept all","acceptNecessaryBtn":"Reject all","savePreferencesBtn":"Save","closeIconLabel":"Close","sections":[{"title":"","description":"Cookies are small files with a small amount of data that are stored on your terminal device (computer, tablet, mobile phone, etc.). These files allow the system to function properly or make it easier for both visitors and system administrators to work with the system. Cookies are not dangerous for the device, but in principle, their processing is subject to the protection of personal data. \u003cbr /\u003e On this page you can customize cookies according to individual categories, in accordance with your own preferences. \u003cbr /\u003e Detailed information about cookie processing You can find it in our \u003ca href=/gdpr\u003e Privacy Policy \u003c/a\u003e, the Cookies Information section."},{"title":"Technical cookies required","description":"The necessary technical cookies are required for the proper functioning of the system and all the functions we provide. Without technical cookies it is not possible to use the system and they cannot be disabled.","linkedCategory":"required","cookieTable":{"headers":{"name":"Name","expiration":"Expiration","domain":"Access","desc":"Description","security":"Security"},"body":[{"name":"cc_cookie","expiration":"365 days","domain":"Own","desc":"Save cookie preferences","security":"-"},{"name":"your_sesssion_key","expiration":"2 hours","domain":"Own","desc":"Relation identification","security":"encrypted"}]}},{"title":"Analytical cookies","description":"Analytical cookies are needed to measure system performance as well as external links. We use cookies to track where users came to the system and who linked us. We also monitor the system load in certain time periods. The direct identification of individual visitors is not used in the processing itself, the information is sufficient anonymized. Disabling these cookies will not affect the operation of the system, but will not allow you to analyze the performance and sources of visits and optimize the settings so that everything runs smoothly.","linkedCategory":"analytic","cookieTable":{"headers":{"name":"Name","expiration":"Expiration","domain":"Access","desc":"Description","security":"Security"},"body":[{"name":"affil_cookie","expiration":"30 days","domain":"Own","desc":"Affiliate system - reference mark","security":"-"}]}}]}},"cs":{"consentModal":{"title":"Tento web využÃvá cookies","description":"Na tÄchto webových stránkách se použÃvajà soubory cookies a dalšà sÃÅ¥ové identifikátory, které mohou obsahovat osobnà údaje.","acceptAllBtn":"Povolit vÅ¡e","acceptNecessaryBtn":"ZamÃtnout vÅ¡e","showPreferencesBtn":"Podrobné nastavenÃ"},"preferencesModal":{"title":"Nastavenà cookies","acceptAllBtn":"Povolit vÅ¡e","acceptNecessaryBtn":"ZamÃtnout vÅ¡e","savePreferencesBtn":"Uložit","closeIconLabel":"ZavÅÃt","sections":[{"title":"","description":"Cookies jsou malé soubory s malým množstvÃm dat, které jsou ukládány ve vaÅ¡em koncovém zaÅÃzenà (poÄÃtaÄi, tabletu, mobilnÃm telefonu apod). Tyto soubory umožÅujà správné fungovánà systému pÅÃpadnÄ usnadÅujà práci se systémem jak návÅ¡tÄvnÃkům, tak i správcům systému. Cookies nejsou nebezpeÄné pro dané zaÅÃzenÃ, ale ze svého principu je jejich zpracovánà podÅÃzeno ochranÄ osobnÃch údajů.\u003cbr /\u003e Na této stránce máte možnost pÅizpůsobit soubory cookie dle jednotlivých kategoriÃ, v souladu s vlastnÃmi preferencemi.\u003cbr /\u003e Podrobné informace o zpracovánà cookies můžete nalézt v naÅ¡ich \u003ca href=/gdpr\u003eZásadách o zpracovánà osobnÃch údajů\u003c/a\u003e, kapitola Informace o cookies."},{"title":"Nutné technické cookies","description":"Nutné technické cookies jsou vyžadovány pro správné fungovánà systému a vÅ¡ech funkcÃ, které Vám poskytujeme. Bez technických cookies nenà možné systém využÃvat a nemohou být zakázány.","linkedCategory":"required","cookieTable":{"headers":{"name":"Název","expiration":"Expirace","domain":"Kdo má pÅÃstup","desc":"Popis","security":"BezpeÄnost"},"body":[{"name":"cc_cookie","expiration":"365 dnÃ","domain":"VlastnÃ","desc":"Uloženà preferencà cookies.","security":"-"},{"name":"your_sesssion_key","expiration":"2 hodiny","domain":"VlastnÃ","desc":"JedineÄný identifikátor relace.","security":"encrypted"}]}},{"title":"Analytické cookies","description":"Analytické cookies jsou potÅebné pro mÄÅenà výkonu systému a také externÃch odkazů. Pomocà cookies sledujeme odkud uživatelé do systému pÅiÅ¡li a kdo na nás odkazoval. Sledujeme také vytÞenost systému v urÄitých Äasových úsecÃch. PÅi samotném zpracovánà se nevyužÃvá pÅÃmé identifikace jednotlivých návÅ¡tÄvnÃků, informace postaÄujà anonymizované. Vypnutà tÄchto cookies neovlivnà práci se systémem, ale neumožnà analyzovat výkon a zdroje návÅ¡tÄv a optimalizovat nastavenà tak, aby vÅ¡e bÄželo hladce.","linkedCategory":"analytic","cookieTable":{"headers":{"name":"Název","expiration":"Expirace","domain":"Kdo má pÅÃstup","desc":"Popis","security":"BezpeÄnost"},"body":[{"name":"_ga","expiration":"1 rok","domain":"VlastnÃ","desc":"OznaÄenà session Google Analytics","security":"-"}]}}]}},"es":{"consentModal":{"title":"Tento web využÃvá cookies","description":"Na tÄchto webových stránkách se použÃvajà soubory cookies a dalšà sÃÅ¥ové identifikátory, které mohou obsahovat osobnà údaje.","acceptAllBtn":"Povolit vÅ¡e","acceptNecessaryBtn":"ZamÃtnout vÅ¡e","showPreferencesBtn":"Podrobné nastavenÃ"},"preferencesModal":{"title":"Nastavenà cookies","acceptAllBtn":"Povolit vÅ¡e","acceptNecessaryBtn":"ZamÃtnout vÅ¡e","savePreferencesBtn":"Uložit","closeIconLabel":"ZavÅÃt","sections":[{"title":"","description":"Cookies jsou malé soubory s malým množstvÃm dat, které jsou ukládány ve vaÅ¡em koncovém zaÅÃzenà (poÄÃtaÄi, tabletu, mobilnÃm telefonu apod). Tyto soubory umožÅujà správné fungovánà systému pÅÃpadnÄ usnadÅujà práci se systémem jak návÅ¡tÄvnÃkům, tak i správcům systému. Cookies nejsou nebezpeÄné pro dané zaÅÃzenÃ, ale ze svého principu je jejich zpracovánà podÅÃzeno ochranÄ osobnÃch údajů.\u003cbr /\u003e Na této stránce máte možnost pÅizpůsobit soubory cookie dle jednotlivých kategoriÃ, v souladu s vlastnÃmi preferencemi.\u003cbr /\u003e Podrobné informace o zpracovánà cookies můžete nalézt v naÅ¡ich \u003ca href=/gdpr\u003eZásadách o zpracovánà osobnÃch údajů\u003c/a\u003e, kapitola Informace o cookies."},{"title":"Nutné technické cookies","description":"Nutné technické cookies jsou vyžadovány pro správné fungovánà systému a vÅ¡ech funkcÃ, které Vám poskytujeme. Bez technických cookies nenà možné systém využÃvat a nemohou být zakázány.","linkedCategory":"required","cookieTable":{"headers":{"name":"Název","expiration":"Expirace","domain":"Kdo má pÅÃstup","desc":"Popis","security":"BezpeÄnost"},"body":[{"name":"cc_cookie","expiration":"365 dnÃ","domain":"VlastnÃ","desc":"Uloženà preferencà cookies.","security":"-"},{"name":"your_sesssion_key","expiration":"2 hodiny","domain":"VlastnÃ","desc":"JedineÄný identifikátor relace.","security":"encrypted"}]}},{"title":"Analytické cookies","description":"Analytické cookies jsou potÅebné pro mÄÅenà výkonu systému a také externÃch odkazů. Pomocà cookies sledujeme odkud uživatelé do systému pÅiÅ¡li a kdo na nás odkazoval. Sledujeme také vytÞenost systému v urÄitých Äasových úsecÃch. PÅi samotném zpracovánà se nevyužÃvá pÅÃmé identifikace jednotlivých návÅ¡tÄvnÃků, informace postaÄujà anonymizované. Vypnutà tÄchto cookies neovlivnà práci se systémem, ale neumožnà analyzovat výkon a zdroje návÅ¡tÄv a optimalizovat nastavenà tak, aby vÅ¡e bÄželo hladce.","linkedCategory":"analytic","cookieTable":{"headers":{"name":"Název","expiration":"Expirace","domain":"Kdo má pÅÃstup","desc":"Popis","security":"BezpeÄnost"},"body":[{"name":"_ga","expiration":"1 rok","domain":"VlastnÃ","desc":"OznaÄenà session Google Analytics","security":"-"}]}}]}}}, 43002 }, 43003 43004 onFirstConsent: function ({ cookie }) { 43005 // fired once on the very first consent 43006 }, 43007 43008 onConsent: function ({ cookie }) { 43009 // fired on first consent and on every subsequent page load 43010 }, 43011 43012 onChange: function ({ cookie, changedCategories, changedServices }) { 43013 // fired when the user changes preferences after consent has already been given 43014 }, 43015 }); 43016}); 43017 43018 43019 43020 43021 43022 43023 43024 43025 43026 43027 43028 43029 43030 43031 43032 43033 43034 43035 43036 43037 43038 43039 43040 43041 43042 43043 43044 43045 43046 43047 43048 43049 43050 43051 43052 43053 43054 43055 43056 43057 43058 43059 43060 43061 43062 43063 43064 43065 43066 43067// for underscore and undercore.string combination 43068_.mixin(_.str.exports()); 43069 43070$(function () { 43071 //===== Multiple select =====// 43072 43073 $(".select-multiple, .select-search").select2({ 43074 width: "100%" 43075 }); 43076 43077 43078 43079 photoable_id = $("#resource").data('photoable-id'); 43080 photoable_type = $("#resource").data('photoable-type'); 43081 43082 $.i18n.setDictionary(dictionary_cs); 43083 $(document).on('ajaxStart', function () { NProgress.start(); }); 43084 $(document).on('ajaxStop', function () { NProgress.done(); }); 43085 43086 $(document).on('nested:fieldAdded', function (event) { 43087 var field = event.field; 43088 if (field && field.find('.tags').length > 0) { 43089 field.find('.tags').tagsInput({ width: '100%', defaultText: "PiÅ¡te..." }); 43090 } 43091 field.find('.tip').tooltip(); 43092 field.find('.select-liquid').select2({ 43093 minimumResultsForSearch: "-1", 43094 width: "off" 43095 }); 43096 field.find('.select-search').select2({ width: "100%" }); 43097 field.find('.datepicker').datepicker({ 43098 showOtherMonths: true, 43099 dateFormat: "dd. mm. yy" 43100 }); 43101 if (field.find(".styled, .multiselect-container input").length > 0) { 43102 field.find(".styled, .multiselect-container input").uniform({ radioClass: 'choice', selectAutoWidth: false }); 43103 } 43104 }); 43105 43106 // AJAX TABS 43107 $('a.ajaxed[data-toggle="tab"]').on('shown.bs.tab', function (e) { 43108 var target = $(e.target).attr("href"); 43109 var url = $(this).data('ajax-path'); 43110 var link = $(this); 43111 if (!$(this).hasClass('loaded')) { 43112 $.ajax({ 43113 url: url, 43114 method: 'get', 43115 dataType: 'html' 43116 }).done(function (data) { 43117 if (data) { 43118 $(link).addClass("loaded"); 43119 $(target).html(data); 43120 } 43121 }); 43122 } 43123 }); 43124 43125 $('ul>li.active>ul').css('display', 'block'); 43126}); 43127 43128function fix_input_characters(value) { 43129 var input_value = value() 43130 var input_value_comma = String(input_value).indexOf(","); 43131 var input_value_space = String(input_value).indexOf(" ");
43132 input_value = String(input_value).replace(",", "."); 43133 input_value = String(input_value).replace(" ", ""); 43134 if (input_value_comma != -1 || input_value_space != -1) { 43135 value(input_value); 43136 } 43137 return input_value; 43138};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.