cloudinary 2.4.3 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,752 +1,783 @@
1
- /*! jQuery UI - v1.12.1+CommonJS - 2018-02-10
2
- * http://jqueryui.com
3
- * Includes: widget.js
4
- * Copyright jQuery Foundation and other contributors; Licensed MIT */
5
-
6
- (function( factory ) {
7
- if ( typeof define === "function" && define.amd ) {
8
-
9
- // AMD. Register as an anonymous module.
10
- define([ "jquery" ], factory );
11
- } else if ( typeof exports === "object" ) {
12
-
13
- // Node/CommonJS
14
- factory( require( "jquery" ) );
15
- } else {
16
-
17
- // Browser globals
18
- factory( jQuery );
19
- }
20
- }(function( $ ) {
21
-
22
- $.ui = $.ui || {};
23
-
24
- var version = $.ui.version = "1.12.1";
25
-
26
-
27
- /*!
28
- * jQuery UI Widget 1.12.1
29
- * http://jqueryui.com
30
- *
31
- * Copyright jQuery Foundation and other contributors
32
- * Released under the MIT license.
33
- * http://jquery.org/license
34
- */
35
-
36
- //>>label: Widget
37
- //>>group: Core
38
- //>>description: Provides a factory for creating stateful widgets with a common API.
39
- //>>docs: http://api.jqueryui.com/jQuery.widget/
40
- //>>demos: http://jqueryui.com/widget/
41
-
42
-
43
-
44
- var widgetUuid = 0;
45
- var widgetSlice = Array.prototype.slice;
46
-
47
- $.cleanData = ( function( orig ) {
48
- return function( elems ) {
49
- var events, elem, i;
50
- for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
51
- try {
52
-
53
- // Only trigger remove when necessary to save time
54
- events = $._data( elem, "events" );
55
- if ( events && events.remove ) {
56
- $( elem ).triggerHandler( "remove" );
57
- }
58
-
59
- // Http://bugs.jquery.com/ticket/8235
60
- } catch ( e ) {}
61
- }
62
- orig( elems );
63
- };
64
- } )( $.cleanData );
65
-
66
- $.widget = function( name, base, prototype ) {
67
- var existingConstructor, constructor, basePrototype;
68
-
69
- // ProxiedPrototype allows the provided prototype to remain unmodified
70
- // so that it can be used as a mixin for multiple widgets (#8876)
71
- var proxiedPrototype = {};
72
-
73
- var namespace = name.split( "." )[ 0 ];
74
- name = name.split( "." )[ 1 ];
75
- var fullName = namespace + "-" + name;
76
-
77
- if ( !prototype ) {
78
- prototype = base;
79
- base = $.Widget;
80
- }
81
-
82
- if ( $.isArray( prototype ) ) {
83
- prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
84
- }
85
-
86
- // Create selector for plugin
87
- $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
88
- return !!$.data( elem, fullName );
89
- };
90
-
91
- $[ namespace ] = $[ namespace ] || {};
92
- existingConstructor = $[ namespace ][ name ];
93
- constructor = $[ namespace ][ name ] = function( options, element ) {
94
-
95
- // Allow instantiation without "new" keyword
96
- if ( !this._createWidget ) {
97
- return new constructor( options, element );
98
- }
99
-
100
- // Allow instantiation without initializing for simple inheritance
101
- // must use "new" keyword (the code above always passes args)
102
- if ( arguments.length ) {
103
- this._createWidget( options, element );
104
- }
105
- };
106
-
107
- // Extend with the existing constructor to carry over any static properties
108
- $.extend( constructor, existingConstructor, {
109
- version: prototype.version,
110
-
111
- // Copy the object used to create the prototype in case we need to
112
- // redefine the widget later
113
- _proto: $.extend( {}, prototype ),
114
-
115
- // Track widgets that inherit from this widget in case this widget is
116
- // redefined after a widget inherits from it
117
- _childConstructors: []
118
- } );
119
-
120
- basePrototype = new base();
121
-
122
- // We need to make the options hash a property directly on the new instance
123
- // otherwise we'll modify the options hash on the prototype that we're
124
- // inheriting from
125
- basePrototype.options = $.widget.extend( {}, basePrototype.options );
126
- $.each( prototype, function( prop, value ) {
127
- if ( !$.isFunction( value ) ) {
128
- proxiedPrototype[ prop ] = value;
129
- return;
130
- }
131
- proxiedPrototype[ prop ] = ( function() {
132
- function _super() {
133
- return base.prototype[ prop ].apply( this, arguments );
134
- }
135
-
136
- function _superApply( args ) {
137
- return base.prototype[ prop ].apply( this, args );
138
- }
139
-
140
- return function() {
141
- var __super = this._super;
142
- var __superApply = this._superApply;
143
- var returnValue;
144
-
145
- this._super = _super;
146
- this._superApply = _superApply;
147
-
148
- returnValue = value.apply( this, arguments );
149
-
150
- this._super = __super;
151
- this._superApply = __superApply;
152
-
153
- return returnValue;
154
- };
155
- } )();
156
- } );
157
- constructor.prototype = $.widget.extend( basePrototype, {
158
-
159
- // TODO: remove support for widgetEventPrefix
160
- // always use the name + a colon as the prefix, e.g., draggable:start
161
- // don't prefix for widgets that aren't DOM-based
162
- widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name
163
- }, proxiedPrototype, {
164
- constructor: constructor,
165
- namespace: namespace,
166
- widgetName: name,
167
- widgetFullName: fullName
168
- } );
169
-
170
- // If this widget is being redefined then we need to find all widgets that
171
- // are inheriting from it and redefine all of them so that they inherit from
172
- // the new version of this widget. We're essentially trying to replace one
173
- // level in the prototype chain.
174
- if ( existingConstructor ) {
175
- $.each( existingConstructor._childConstructors, function( i, child ) {
176
- var childPrototype = child.prototype;
177
-
178
- // Redefine the child widget using the same prototype that was
179
- // originally used, but inherit from the new version of the base
180
- $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
181
- child._proto );
182
- } );
183
-
184
- // Remove the list of existing child constructors from the old constructor
185
- // so the old child constructors can be garbage collected
186
- delete existingConstructor._childConstructors;
187
- } else {
188
- base._childConstructors.push( constructor );
189
- }
190
-
191
- $.widget.bridge( name, constructor );
192
-
193
- return constructor;
194
- };
195
-
196
- $.widget.extend = function( target ) {
197
- var input = widgetSlice.call( arguments, 1 );
198
- var inputIndex = 0;
199
- var inputLength = input.length;
200
- var key;
201
- var value;
202
-
203
- for ( ; inputIndex < inputLength; inputIndex++ ) {
204
- for ( key in input[ inputIndex ] ) {
205
- value = input[ inputIndex ][ key ];
206
- if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
207
-
208
- // Clone objects
209
- if ( $.isPlainObject( value ) ) {
210
- target[ key ] = $.isPlainObject( target[ key ] ) ?
211
- $.widget.extend( {}, target[ key ], value ) :
212
-
213
- // Don't extend strings, arrays, etc. with objects
214
- $.widget.extend( {}, value );
215
-
216
- // Copy everything else by reference
217
- } else {
218
- target[ key ] = value;
219
- }
220
- }
221
- }
222
- }
223
- return target;
224
- };
225
-
226
- $.widget.bridge = function( name, object ) {
227
- var fullName = object.prototype.widgetFullName || name;
228
- $.fn[ name ] = function( options ) {
229
- var isMethodCall = typeof options === "string";
230
- var args = widgetSlice.call( arguments, 1 );
231
- var returnValue = this;
232
-
233
- if ( isMethodCall ) {
234
-
235
- // If this is an empty collection, we need to have the instance method
236
- // return undefined instead of the jQuery instance
237
- if ( !this.length && options === "instance" ) {
238
- returnValue = undefined;
239
- } else {
240
- this.each( function() {
241
- var methodValue;
242
- var instance = $.data( this, fullName );
243
-
244
- if ( options === "instance" ) {
245
- returnValue = instance;
246
- return false;
247
- }
248
-
249
- if ( !instance ) {
250
- return $.error( "cannot call methods on " + name +
251
- " prior to initialization; " +
252
- "attempted to call method '" + options + "'" );
253
- }
254
-
255
- if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
256
- return $.error( "no such method '" + options + "' for " + name +
257
- " widget instance" );
258
- }
259
-
260
- methodValue = instance[ options ].apply( instance, args );
261
-
262
- if ( methodValue !== instance && methodValue !== undefined ) {
263
- returnValue = methodValue && methodValue.jquery ?
264
- returnValue.pushStack( methodValue.get() ) :
265
- methodValue;
266
- return false;
267
- }
268
- } );
269
- }
270
- } else {
271
-
272
- // Allow multiple hashes to be passed on init
273
- if ( args.length ) {
274
- options = $.widget.extend.apply( null, [ options ].concat( args ) );
275
- }
276
-
277
- this.each( function() {
278
- var instance = $.data( this, fullName );
279
- if ( instance ) {
280
- instance.option( options || {} );
281
- if ( instance._init ) {
282
- instance._init();
283
- }
284
- } else {
285
- $.data( this, fullName, new object( options, this ) );
286
- }
287
- } );
288
- }
289
-
290
- return returnValue;
291
- };
292
- };
293
-
294
- $.Widget = function( /* options, element */ ) {};
295
- $.Widget._childConstructors = [];
296
-
297
- $.Widget.prototype = {
298
- widgetName: "widget",
299
- widgetEventPrefix: "",
300
- defaultElement: "<div>",
301
-
302
- options: {
303
- classes: {},
304
- disabled: false,
305
-
306
- // Callbacks
307
- create: null
308
- },
309
-
310
- _createWidget: function( options, element ) {
311
- element = $( element || this.defaultElement || this )[ 0 ];
312
- this.element = $( element );
313
- this.uuid = widgetUuid++;
314
- this.eventNamespace = "." + this.widgetName + this.uuid;
315
-
316
- this.bindings = $();
317
- this.hoverable = $();
318
- this.focusable = $();
319
- this.classesElementLookup = {};
320
-
321
- if ( element !== this ) {
322
- $.data( element, this.widgetFullName, this );
323
- this._on( true, this.element, {
324
- remove: function( event ) {
325
- if ( event.target === element ) {
326
- this.destroy();
327
- }
328
- }
329
- } );
330
- this.document = $( element.style ?
331
-
332
- // Element within the document
333
- element.ownerDocument :
334
-
335
- // Element is window or document
336
- element.document || element );
337
- this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
338
- }
339
-
340
- this.options = $.widget.extend( {},
341
- this.options,
342
- this._getCreateOptions(),
343
- options );
344
-
345
- this._create();
346
-
347
- if ( this.options.disabled ) {
348
- this._setOptionDisabled( this.options.disabled );
349
- }
350
-
351
- this._trigger( "create", null, this._getCreateEventData() );
352
- this._init();
353
- },
354
-
355
- _getCreateOptions: function() {
356
- return {};
357
- },
358
-
359
- _getCreateEventData: $.noop,
360
-
361
- _create: $.noop,
362
-
363
- _init: $.noop,
364
-
365
- destroy: function() {
366
- var that = this;
367
-
368
- this._destroy();
369
- $.each( this.classesElementLookup, function( key, value ) {
370
- that._removeClass( value, key );
371
- } );
372
-
373
- // We can probably remove the unbind calls in 2.0
374
- // all event bindings should go through this._on()
375
- this.element
376
- .off( this.eventNamespace )
377
- .removeData( this.widgetFullName );
378
- this.widget()
379
- .off( this.eventNamespace )
380
- .removeAttr( "aria-disabled" );
381
-
382
- // Clean up events and states
383
- this.bindings.off( this.eventNamespace );
384
- },
385
-
386
- _destroy: $.noop,
387
-
388
- widget: function() {
389
- return this.element;
390
- },
391
-
392
- option: function( key, value ) {
393
- var options = key;
394
- var parts;
395
- var curOption;
396
- var i;
397
-
398
- if ( arguments.length === 0 ) {
399
-
400
- // Don't return a reference to the internal hash
401
- return $.widget.extend( {}, this.options );
402
- }
403
-
404
- if ( typeof key === "string" ) {
405
-
406
- // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
407
- options = {};
408
- parts = key.split( "." );
409
- key = parts.shift();
410
- if ( parts.length ) {
411
- curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
412
- for ( i = 0; i < parts.length - 1; i++ ) {
413
- curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
414
- curOption = curOption[ parts[ i ] ];
415
- }
416
- key = parts.pop();
417
- if ( arguments.length === 1 ) {
418
- return curOption[ key ] === undefined ? null : curOption[ key ];
419
- }
420
- curOption[ key ] = value;
421
- } else {
422
- if ( arguments.length === 1 ) {
423
- return this.options[ key ] === undefined ? null : this.options[ key ];
424
- }
425
- options[ key ] = value;
426
- }
427
- }
428
-
429
- this._setOptions( options );
430
-
431
- return this;
432
- },
433
-
434
- _setOptions: function( options ) {
435
- var key;
436
-
437
- for ( key in options ) {
438
- this._setOption( key, options[ key ] );
439
- }
440
-
441
- return this;
442
- },
443
-
444
- _setOption: function( key, value ) {
445
- if ( key === "classes" ) {
446
- this._setOptionClasses( value );
447
- }
448
-
449
- this.options[ key ] = value;
450
-
451
- if ( key === "disabled" ) {
452
- this._setOptionDisabled( value );
453
- }
454
-
455
- return this;
456
- },
457
-
458
- _setOptionClasses: function( value ) {
459
- var classKey, elements, currentElements;
460
-
461
- for ( classKey in value ) {
462
- currentElements = this.classesElementLookup[ classKey ];
463
- if ( value[ classKey ] === this.options.classes[ classKey ] ||
464
- !currentElements ||
465
- !currentElements.length ) {
466
- continue;
467
- }
468
-
469
- // We are doing this to create a new jQuery object because the _removeClass() call
470
- // on the next line is going to destroy the reference to the current elements being
471
- // tracked. We need to save a copy of this collection so that we can add the new classes
472
- // below.
473
- elements = $( currentElements.get() );
474
- this._removeClass( currentElements, classKey );
475
-
476
- // We don't use _addClass() here, because that uses this.options.classes
477
- // for generating the string of classes. We want to use the value passed in from
478
- // _setOption(), this is the new value of the classes option which was passed to
479
- // _setOption(). We pass this value directly to _classes().
480
- elements.addClass( this._classes( {
481
- element: elements,
482
- keys: classKey,
483
- classes: value,
484
- add: true
485
- } ) );
486
- }
487
- },
488
-
489
- _setOptionDisabled: function( value ) {
490
- this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
491
-
492
- // If the widget is becoming disabled, then nothing is interactive
493
- if ( value ) {
494
- this._removeClass( this.hoverable, null, "ui-state-hover" );
495
- this._removeClass( this.focusable, null, "ui-state-focus" );
496
- }
497
- },
498
-
499
- enable: function() {
500
- return this._setOptions( { disabled: false } );
501
- },
502
-
503
- disable: function() {
504
- return this._setOptions( { disabled: true } );
505
- },
506
-
507
- _classes: function( options ) {
508
- var full = [];
509
- var that = this;
510
-
511
- options = $.extend( {
512
- element: this.element,
513
- classes: this.options.classes || {}
514
- }, options );
515
-
516
- function processClassString( classes, checkOption ) {
517
- var current, i;
518
- for ( i = 0; i < classes.length; i++ ) {
519
- current = that.classesElementLookup[ classes[ i ] ] || $();
520
- if ( options.add ) {
521
- current = $( $.unique( current.get().concat( options.element.get() ) ) );
522
- } else {
523
- current = $( current.not( options.element ).get() );
524
- }
525
- that.classesElementLookup[ classes[ i ] ] = current;
526
- full.push( classes[ i ] );
527
- if ( checkOption && options.classes[ classes[ i ] ] ) {
528
- full.push( options.classes[ classes[ i ] ] );
529
- }
530
- }
531
- }
532
-
533
- this._on( options.element, {
534
- "remove": "_untrackClassesElement"
535
- } );
536
-
537
- if ( options.keys ) {
538
- processClassString( options.keys.match( /\S+/g ) || [], true );
539
- }
540
- if ( options.extra ) {
541
- processClassString( options.extra.match( /\S+/g ) || [] );
542
- }
543
-
544
- return full.join( " " );
545
- },
546
-
547
- _untrackClassesElement: function( event ) {
548
- var that = this;
549
- $.each( that.classesElementLookup, function( key, value ) {
550
- if ( $.inArray( event.target, value ) !== -1 ) {
551
- that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
552
- }
553
- } );
554
- },
555
-
556
- _removeClass: function( element, keys, extra ) {
557
- return this._toggleClass( element, keys, extra, false );
558
- },
559
-
560
- _addClass: function( element, keys, extra ) {
561
- return this._toggleClass( element, keys, extra, true );
562
- },
563
-
564
- _toggleClass: function( element, keys, extra, add ) {
565
- add = ( typeof add === "boolean" ) ? add : extra;
566
- var shift = ( typeof element === "string" || element === null ),
567
- options = {
568
- extra: shift ? keys : extra,
569
- keys: shift ? element : keys,
570
- element: shift ? this.element : element,
571
- add: add
572
- };
573
- options.element.toggleClass( this._classes( options ), add );
574
- return this;
575
- },
576
-
577
- _on: function( suppressDisabledCheck, element, handlers ) {
578
- var delegateElement;
579
- var instance = this;
580
-
581
- // No suppressDisabledCheck flag, shuffle arguments
582
- if ( typeof suppressDisabledCheck !== "boolean" ) {
583
- handlers = element;
584
- element = suppressDisabledCheck;
585
- suppressDisabledCheck = false;
586
- }
587
-
588
- // No element argument, shuffle and use this.element
589
- if ( !handlers ) {
590
- handlers = element;
591
- element = this.element;
592
- delegateElement = this.widget();
593
- } else {
594
- element = delegateElement = $( element );
595
- this.bindings = this.bindings.add( element );
596
- }
597
-
598
- $.each( handlers, function( event, handler ) {
599
- function handlerProxy() {
600
-
601
- // Allow widgets to customize the disabled handling
602
- // - disabled as an array instead of boolean
603
- // - disabled class as method for disabling individual parts
604
- if ( !suppressDisabledCheck &&
605
- ( instance.options.disabled === true ||
606
- $( this ).hasClass( "ui-state-disabled" ) ) ) {
607
- return;
608
- }
609
- return ( typeof handler === "string" ? instance[ handler ] : handler )
610
- .apply( instance, arguments );
611
- }
612
-
613
- // Copy the guid so direct unbinding works
614
- if ( typeof handler !== "string" ) {
615
- handlerProxy.guid = handler.guid =
616
- handler.guid || handlerProxy.guid || $.guid++;
617
- }
618
-
619
- var match = event.match( /^([\w:-]*)\s*(.*)$/ );
620
- var eventName = match[ 1 ] + instance.eventNamespace;
621
- var selector = match[ 2 ];
622
-
623
- if ( selector ) {
624
- delegateElement.on( eventName, selector, handlerProxy );
625
- } else {
626
- element.on( eventName, handlerProxy );
627
- }
628
- } );
629
- },
630
-
631
- _off: function( element, eventName ) {
632
- eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
633
- this.eventNamespace;
634
- element.off( eventName ).off( eventName );
635
-
636
- // Clear the stack to avoid memory leaks (#10056)
637
- this.bindings = $( this.bindings.not( element ).get() );
638
- this.focusable = $( this.focusable.not( element ).get() );
639
- this.hoverable = $( this.hoverable.not( element ).get() );
640
- },
641
-
642
- _delay: function( handler, delay ) {
643
- function handlerProxy() {
644
- return ( typeof handler === "string" ? instance[ handler ] : handler )
645
- .apply( instance, arguments );
646
- }
647
- var instance = this;
648
- return setTimeout( handlerProxy, delay || 0 );
649
- },
650
-
651
- _hoverable: function( element ) {
652
- this.hoverable = this.hoverable.add( element );
653
- this._on( element, {
654
- mouseenter: function( event ) {
655
- this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
656
- },
657
- mouseleave: function( event ) {
658
- this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
659
- }
660
- } );
661
- },
662
-
663
- _focusable: function( element ) {
664
- this.focusable = this.focusable.add( element );
665
- this._on( element, {
666
- focusin: function( event ) {
667
- this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
668
- },
669
- focusout: function( event ) {
670
- this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
671
- }
672
- } );
673
- },
674
-
675
- _trigger: function( type, event, data ) {
676
- var prop, orig;
677
- var callback = this.options[ type ];
678
-
679
- data = data || {};
680
- event = $.Event( event );
681
- event.type = ( type === this.widgetEventPrefix ?
682
- type :
683
- this.widgetEventPrefix + type ).toLowerCase();
684
-
685
- // The original event may come from any element
686
- // so we need to reset the target on the new event
687
- event.target = this.element[ 0 ];
688
-
689
- // Copy original event properties over to the new event
690
- orig = event.originalEvent;
691
- if ( orig ) {
692
- for ( prop in orig ) {
693
- if ( !( prop in event ) ) {
694
- event[ prop ] = orig[ prop ];
695
- }
696
- }
697
- }
698
-
699
- this.element.trigger( event, data );
700
- return !( $.isFunction( callback ) &&
701
- callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
702
- event.isDefaultPrevented() );
703
- }
704
- };
705
-
706
- $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
707
- $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
708
- if ( typeof options === "string" ) {
709
- options = { effect: options };
710
- }
711
-
712
- var hasOptions;
713
- var effectName = !options ?
714
- method :
715
- options === true || typeof options === "number" ?
716
- defaultEffect :
717
- options.effect || defaultEffect;
718
-
719
- options = options || {};
720
- if ( typeof options === "number" ) {
721
- options = { duration: options };
722
- }
723
-
724
- hasOptions = !$.isEmptyObject( options );
725
- options.complete = callback;
726
-
727
- if ( options.delay ) {
728
- element.delay( options.delay );
729
- }
730
-
731
- if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
732
- element[ method ]( options );
733
- } else if ( effectName !== method && element[ effectName ] ) {
734
- element[ effectName ]( options.duration, options.easing, callback );
735
- } else {
736
- element.queue( function( next ) {
737
- $( this )[ method ]();
738
- if ( callback ) {
739
- callback.call( element[ 0 ] );
740
- }
741
- next();
742
- } );
743
- }
744
- };
745
- } );
746
-
747
- var widget = $.widget;
748
-
749
-
750
-
751
-
752
- }));
1
+ /*!
2
+ * jQuery UI Widget 1.14.1
3
+ * https://jqueryui.com
4
+ *
5
+ * Copyright OpenJS Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * https://jquery.org/license
8
+ */
9
+
10
+ //>>label: Widget
11
+ //>>group: Core
12
+ //>>description: Provides a factory for creating stateful widgets with a common API.
13
+ //>>docs: https://api.jqueryui.com/jQuery.widget/
14
+ //>>demos: https://jqueryui.com/widget/
15
+
16
+ ( function( factory ) {
17
+ "use strict";
18
+
19
+ if ( typeof define === "function" && define.amd ) {
20
+
21
+ // AMD. Register as an anonymous module.
22
+ define( [ "jquery" ], factory );
23
+ } else if ( typeof exports === "object" ) {
24
+ factory( require( "jquery" ) );
25
+ } else {
26
+
27
+ // Browser globals
28
+ factory( jQuery );
29
+ }
30
+ } )( function( $ ) {
31
+ "use strict";
32
+
33
+ $.ui = $.ui || {};
34
+ var version = $.ui.version = "1.14.1";
35
+ var widgetUuid = 0;
36
+ var widgetHasOwnProperty = Array.prototype.hasOwnProperty;
37
+ var widgetSlice = Array.prototype.slice;
38
+
39
+ $.cleanData = ( function( orig ) {
40
+ return function( elems ) {
41
+ var events, elem, i;
42
+ for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
43
+
44
+ // Only trigger remove when necessary to save time
45
+ events = $._data( elem, "events" );
46
+ if ( events && events.remove ) {
47
+ $( elem ).triggerHandler( "remove" );
48
+ }
49
+ }
50
+ orig( elems );
51
+ };
52
+ } )( $.cleanData );
53
+
54
+ $.widget = function( name, base, prototype ) {
55
+ var existingConstructor, constructor, basePrototype;
56
+
57
+ // ProxiedPrototype allows the provided prototype to remain unmodified
58
+ // so that it can be used as a mixin for multiple widgets (#8876)
59
+ var proxiedPrototype = {};
60
+
61
+ var namespace = name.split( "." )[ 0 ];
62
+ name = name.split( "." )[ 1 ];
63
+ if ( name === "__proto__" || name === "constructor" ) {
64
+ return $.error( "Invalid widget name: " + name );
65
+ }
66
+ var fullName = namespace + "-" + name;
67
+
68
+ if ( !prototype ) {
69
+ prototype = base;
70
+ base = $.Widget;
71
+ }
72
+
73
+ if ( Array.isArray( prototype ) ) {
74
+ prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
75
+ }
76
+
77
+ // Create selector for plugin
78
+ $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {
79
+ return !!$.data( elem, fullName );
80
+ };
81
+
82
+ $[ namespace ] = $[ namespace ] || {};
83
+ existingConstructor = $[ namespace ][ name ];
84
+ constructor = $[ namespace ][ name ] = function( options, element ) {
85
+
86
+ // Allow instantiation without "new" keyword
87
+ if ( !this || !this._createWidget ) {
88
+ return new constructor( options, element );
89
+ }
90
+
91
+ // Allow instantiation without initializing for simple inheritance
92
+ // must use "new" keyword (the code above always passes args)
93
+ if ( arguments.length ) {
94
+ this._createWidget( options, element );
95
+ }
96
+ };
97
+
98
+ // Extend with the existing constructor to carry over any static properties
99
+ $.extend( constructor, existingConstructor, {
100
+ version: prototype.version,
101
+
102
+ // Copy the object used to create the prototype in case we need to
103
+ // redefine the widget later
104
+ _proto: $.extend( {}, prototype ),
105
+
106
+ // Track widgets that inherit from this widget in case this widget is
107
+ // redefined after a widget inherits from it
108
+ _childConstructors: []
109
+ } );
110
+
111
+ basePrototype = new base();
112
+
113
+ // We need to make the options hash a property directly on the new instance
114
+ // otherwise we'll modify the options hash on the prototype that we're
115
+ // inheriting from
116
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
117
+ $.each( prototype, function( prop, value ) {
118
+ if ( typeof value !== "function" ) {
119
+ proxiedPrototype[ prop ] = value;
120
+ return;
121
+ }
122
+ proxiedPrototype[ prop ] = ( function() {
123
+ function _super() {
124
+ return base.prototype[ prop ].apply( this, arguments );
125
+ }
126
+
127
+ function _superApply( args ) {
128
+ return base.prototype[ prop ].apply( this, args );
129
+ }
130
+
131
+ return function() {
132
+ var __super = this._super;
133
+ var __superApply = this._superApply;
134
+ var returnValue;
135
+
136
+ this._super = _super;
137
+ this._superApply = _superApply;
138
+
139
+ returnValue = value.apply( this, arguments );
140
+
141
+ this._super = __super;
142
+ this._superApply = __superApply;
143
+
144
+ return returnValue;
145
+ };
146
+ } )();
147
+ } );
148
+ constructor.prototype = $.widget.extend( basePrototype, {
149
+
150
+ // TODO: remove support for widgetEventPrefix
151
+ // always use the name + a colon as the prefix, e.g., draggable:start
152
+ // don't prefix for widgets that aren't DOM-based
153
+ widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name
154
+ }, proxiedPrototype, {
155
+ constructor: constructor,
156
+ namespace: namespace,
157
+ widgetName: name,
158
+ widgetFullName: fullName
159
+ } );
160
+
161
+ // If this widget is being redefined then we need to find all widgets that
162
+ // are inheriting from it and redefine all of them so that they inherit from
163
+ // the new version of this widget. We're essentially trying to replace one
164
+ // level in the prototype chain.
165
+ if ( existingConstructor ) {
166
+ $.each( existingConstructor._childConstructors, function( i, child ) {
167
+ var childPrototype = child.prototype;
168
+
169
+ // Redefine the child widget using the same prototype that was
170
+ // originally used, but inherit from the new version of the base
171
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
172
+ child._proto );
173
+ } );
174
+
175
+ // Remove the list of existing child constructors from the old constructor
176
+ // so the old child constructors can be garbage collected
177
+ delete existingConstructor._childConstructors;
178
+ } else if ( typeof exports === "object" ) {
179
+ factory( require( "jquery" ) );
180
+ } else {
181
+ base._childConstructors.push( constructor );
182
+ }
183
+
184
+ $.widget.bridge( name, constructor );
185
+
186
+ return constructor;
187
+ };
188
+
189
+ $.widget.extend = function( target ) {
190
+ var input = widgetSlice.call( arguments, 1 );
191
+ var inputIndex = 0;
192
+ var inputLength = input.length;
193
+ var key;
194
+ var value;
195
+
196
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
197
+ for ( key in input[ inputIndex ] ) {
198
+ value = input[ inputIndex ][ key ];
199
+ if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) {
200
+
201
+ // Clone objects
202
+ if ( $.isPlainObject( value ) ) {
203
+ target[ key ] = $.isPlainObject( target[ key ] ) ?
204
+ $.widget.extend( {}, target[ key ], value ) :
205
+
206
+ // Don't extend strings, arrays, etc. with objects
207
+ $.widget.extend( {}, value );
208
+
209
+ // Copy everything else by reference
210
+ } else if ( typeof exports === "object" ) {
211
+ factory( require( "jquery" ) );
212
+ } else {
213
+ target[ key ] = value;
214
+ }
215
+ }
216
+ }
217
+ }
218
+ return target;
219
+ };
220
+
221
+ $.widget.bridge = function( name, object ) {
222
+ var fullName = object.prototype.widgetFullName || name;
223
+ $.fn[ name ] = function( options ) {
224
+ var isMethodCall = typeof options === "string";
225
+ var args = widgetSlice.call( arguments, 1 );
226
+ var returnValue = this;
227
+
228
+ if ( isMethodCall ) {
229
+
230
+ // If this is an empty collection, we need to have the instance method
231
+ // return undefined instead of the jQuery instance
232
+ if ( !this.length && options === "instance" ) {
233
+ returnValue = undefined;
234
+ } else if ( typeof exports === "object" ) {
235
+ factory( require( "jquery" ) );
236
+ } else {
237
+ this.each( function() {
238
+ var methodValue;
239
+ var instance = $.data( this, fullName );
240
+
241
+ if ( options === "instance" ) {
242
+ returnValue = instance;
243
+ return false;
244
+ }
245
+
246
+ if ( !instance ) {
247
+ return $.error( "cannot call methods on " + name +
248
+ " prior to initialization; " +
249
+ "attempted to call method '" + options + "'" );
250
+ }
251
+
252
+ if ( typeof instance[ options ] !== "function" ||
253
+ options.charAt( 0 ) === "_" ) {
254
+ return $.error( "no such method '" + options + "' for " + name +
255
+ " widget instance" );
256
+ }
257
+
258
+ methodValue = instance[ options ].apply( instance, args );
259
+
260
+ if ( methodValue !== instance && methodValue !== undefined ) {
261
+ returnValue = methodValue && methodValue.jquery ?
262
+ returnValue.pushStack( methodValue.get() ) :
263
+ methodValue;
264
+ return false;
265
+ }
266
+ } );
267
+ }
268
+ } else if ( typeof exports === "object" ) {
269
+ factory( require( "jquery" ) );
270
+ } else {
271
+
272
+ // Allow multiple hashes to be passed on init
273
+ if ( args.length ) {
274
+ options = $.widget.extend.apply( null, [ options ].concat( args ) );
275
+ }
276
+
277
+ this.each( function() {
278
+ var instance = $.data( this, fullName );
279
+ if ( instance ) {
280
+ instance.option( options || {} );
281
+ if ( instance._init ) {
282
+ instance._init();
283
+ }
284
+ } else if ( typeof exports === "object" ) {
285
+ factory( require( "jquery" ) );
286
+ } else {
287
+ $.data( this, fullName, new object( options, this ) );
288
+ }
289
+ } );
290
+ }
291
+
292
+ return returnValue;
293
+ };
294
+ };
295
+
296
+ $.Widget = function( /* options, element */ ) {};
297
+ $.Widget._childConstructors = [];
298
+
299
+ $.Widget.prototype = {
300
+ widgetName: "widget",
301
+ widgetEventPrefix: "",
302
+ defaultElement: "<div>",
303
+
304
+ options: {
305
+ classes: {},
306
+ disabled: false,
307
+
308
+ // Callbacks
309
+ create: null
310
+ },
311
+
312
+ _createWidget: function( options, element ) {
313
+ element = $( element || this.defaultElement || this )[ 0 ];
314
+ this.element = $( element );
315
+ this.uuid = widgetUuid++;
316
+ this.eventNamespace = "." + this.widgetName + this.uuid;
317
+
318
+ this.bindings = $();
319
+ this.hoverable = $();
320
+ this.focusable = $();
321
+ this.classesElementLookup = {};
322
+
323
+ if ( element !== this ) {
324
+ $.data( element, this.widgetFullName, this );
325
+ this._on( true, this.element, {
326
+ remove: function( event ) {
327
+ if ( event.target === element ) {
328
+ this.destroy();
329
+ }
330
+ }
331
+ } );
332
+ this.document = $( element.style ?
333
+
334
+ // Element within the document
335
+ element.ownerDocument :
336
+
337
+ // Element is window or document
338
+ element.document || element );
339
+ this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
340
+ }
341
+
342
+ this.options = $.widget.extend( {},
343
+ this.options,
344
+ this._getCreateOptions(),
345
+ options );
346
+
347
+ this._create();
348
+
349
+ if ( this.options.disabled ) {
350
+ this._setOptionDisabled( this.options.disabled );
351
+ }
352
+
353
+ this._trigger( "create", null, this._getCreateEventData() );
354
+ this._init();
355
+ },
356
+
357
+ _getCreateOptions: function() {
358
+ return {};
359
+ },
360
+
361
+ _getCreateEventData: $.noop,
362
+
363
+ _create: $.noop,
364
+
365
+ _init: $.noop,
366
+
367
+ destroy: function() {
368
+ var that = this;
369
+
370
+ this._destroy();
371
+ $.each( this.classesElementLookup, function( key, value ) {
372
+ that._removeClass( value, key );
373
+ } );
374
+
375
+ // We can probably remove the unbind calls in 2.0
376
+ // all event bindings should go through this._on()
377
+ this.element
378
+ .off( this.eventNamespace )
379
+ .removeData( this.widgetFullName );
380
+ this.widget()
381
+ .off( this.eventNamespace )
382
+ .removeAttr( "aria-disabled" );
383
+
384
+ // Clean up events and states
385
+ this.bindings.off( this.eventNamespace );
386
+ },
387
+
388
+ _destroy: $.noop,
389
+
390
+ widget: function() {
391
+ return this.element;
392
+ },
393
+
394
+ option: function( key, value ) {
395
+ var options = key;
396
+ var parts;
397
+ var curOption;
398
+ var i;
399
+
400
+ if ( arguments.length === 0 ) {
401
+
402
+ // Don't return a reference to the internal hash
403
+ return $.widget.extend( {}, this.options );
404
+ }
405
+
406
+ if ( typeof key === "string" ) {
407
+
408
+ // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
409
+ options = {};
410
+ parts = key.split( "." );
411
+ key = parts.shift();
412
+ if ( parts.length ) {
413
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
414
+ for ( i = 0; i < parts.length - 1; i++ ) {
415
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
416
+ curOption = curOption[ parts[ i ] ];
417
+ }
418
+ key = parts.pop();
419
+ if ( arguments.length === 1 ) {
420
+ return curOption[ key ] === undefined ? null : curOption[ key ];
421
+ }
422
+ curOption[ key ] = value;
423
+ } else if ( typeof exports === "object" ) {
424
+ factory( require( "jquery" ) );
425
+ } else {
426
+ if ( arguments.length === 1 ) {
427
+ return this.options[ key ] === undefined ? null : this.options[ key ];
428
+ }
429
+ options[ key ] = value;
430
+ }
431
+ }
432
+
433
+ this._setOptions( options );
434
+
435
+ return this;
436
+ },
437
+
438
+ _setOptions: function( options ) {
439
+ var key;
440
+
441
+ for ( key in options ) {
442
+ this._setOption( key, options[ key ] );
443
+ }
444
+
445
+ return this;
446
+ },
447
+
448
+ _setOption: function( key, value ) {
449
+ if ( key === "classes" ) {
450
+ this._setOptionClasses( value );
451
+ }
452
+
453
+ this.options[ key ] = value;
454
+
455
+ if ( key === "disabled" ) {
456
+ this._setOptionDisabled( value );
457
+ }
458
+
459
+ return this;
460
+ },
461
+
462
+ _setOptionClasses: function( value ) {
463
+ var classKey, elements, currentElements;
464
+
465
+ for ( classKey in value ) {
466
+ currentElements = this.classesElementLookup[ classKey ];
467
+ if ( value[ classKey ] === this.options.classes[ classKey ] ||
468
+ !currentElements ||
469
+ !currentElements.length ) {
470
+ continue;
471
+ }
472
+
473
+ // We are doing this to create a new jQuery object because the _removeClass() call
474
+ // on the next line is going to destroy the reference to the current elements being
475
+ // tracked. We need to save a copy of this collection so that we can add the new classes
476
+ // below.
477
+ elements = $( currentElements.get() );
478
+ this._removeClass( currentElements, classKey );
479
+
480
+ // We don't use _addClass() here, because that uses this.options.classes
481
+ // for generating the string of classes. We want to use the value passed in from
482
+ // _setOption(), this is the new value of the classes option which was passed to
483
+ // _setOption(). We pass this value directly to _classes().
484
+ elements.addClass( this._classes( {
485
+ element: elements,
486
+ keys: classKey,
487
+ classes: value,
488
+ add: true
489
+ } ) );
490
+ }
491
+ },
492
+
493
+ _setOptionDisabled: function( value ) {
494
+ this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
495
+
496
+ // If the widget is becoming disabled, then nothing is interactive
497
+ if ( value ) {
498
+ this._removeClass( this.hoverable, null, "ui-state-hover" );
499
+ this._removeClass( this.focusable, null, "ui-state-focus" );
500
+ }
501
+ },
502
+
503
+ enable: function() {
504
+ return this._setOptions( { disabled: false } );
505
+ },
506
+
507
+ disable: function() {
508
+ return this._setOptions( { disabled: true } );
509
+ },
510
+
511
+ _classes: function( options ) {
512
+ var full = [];
513
+ var that = this;
514
+
515
+ options = $.extend( {
516
+ element: this.element,
517
+ classes: this.options.classes || {}
518
+ }, options );
519
+
520
+ function bindRemoveEvent() {
521
+ var nodesToBind = [];
522
+
523
+ options.element.each( function( _, element ) {
524
+ var isTracked = $.map( that.classesElementLookup, function( elements ) {
525
+ return elements;
526
+ } )
527
+ .some( function( elements ) {
528
+ return elements.is( element );
529
+ } );
530
+
531
+ if ( !isTracked ) {
532
+ nodesToBind.push( element );
533
+ }
534
+ } );
535
+
536
+ that._on( $( nodesToBind ), {
537
+ remove: "_untrackClassesElement"
538
+ } );
539
+ }
540
+
541
+ function processClassString( classes, checkOption ) {
542
+ var current, i;
543
+ for ( i = 0; i < classes.length; i++ ) {
544
+ current = that.classesElementLookup[ classes[ i ] ] || $();
545
+ if ( options.add ) {
546
+ bindRemoveEvent();
547
+ current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) );
548
+ } else if ( typeof exports === "object" ) {
549
+ factory( require( "jquery" ) );
550
+ } else {
551
+ current = $( current.not( options.element ).get() );
552
+ }
553
+ that.classesElementLookup[ classes[ i ] ] = current;
554
+ full.push( classes[ i ] );
555
+ if ( checkOption && options.classes[ classes[ i ] ] ) {
556
+ full.push( options.classes[ classes[ i ] ] );
557
+ }
558
+ }
559
+ }
560
+
561
+ if ( options.keys ) {
562
+ processClassString( options.keys.match( /\S+/g ) || [], true );
563
+ }
564
+ if ( options.extra ) {
565
+ processClassString( options.extra.match( /\S+/g ) || [] );
566
+ }
567
+
568
+ return full.join( " " );
569
+ },
570
+
571
+ _untrackClassesElement: function( event ) {
572
+ var that = this;
573
+ $.each( that.classesElementLookup, function( key, value ) {
574
+ if ( $.inArray( event.target, value ) !== -1 ) {
575
+ that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
576
+ }
577
+ } );
578
+
579
+ this._off( $( event.target ) );
580
+ },
581
+
582
+ _removeClass: function( element, keys, extra ) {
583
+ return this._toggleClass( element, keys, extra, false );
584
+ },
585
+
586
+ _addClass: function( element, keys, extra ) {
587
+ return this._toggleClass( element, keys, extra, true );
588
+ },
589
+
590
+ _toggleClass: function( element, keys, extra, add ) {
591
+ add = ( typeof add === "boolean" ) ? add : extra;
592
+ var shift = ( typeof element === "string" || element === null ),
593
+ options = {
594
+ extra: shift ? keys : extra,
595
+ keys: shift ? element : keys,
596
+ element: shift ? this.element : element,
597
+ add: add
598
+ };
599
+ options.element.toggleClass( this._classes( options ), add );
600
+ return this;
601
+ },
602
+
603
+ _on: function( suppressDisabledCheck, element, handlers ) {
604
+ var delegateElement;
605
+ var instance = this;
606
+
607
+ // No suppressDisabledCheck flag, shuffle arguments
608
+ if ( typeof suppressDisabledCheck !== "boolean" ) {
609
+ handlers = element;
610
+ element = suppressDisabledCheck;
611
+ suppressDisabledCheck = false;
612
+ }
613
+
614
+ // No element argument, shuffle and use this.element
615
+ if ( !handlers ) {
616
+ handlers = element;
617
+ element = this.element;
618
+ delegateElement = this.widget();
619
+ } else if ( typeof exports === "object" ) {
620
+ factory( require( "jquery" ) );
621
+ } else {
622
+ element = delegateElement = $( element );
623
+ this.bindings = this.bindings.add( element );
624
+ }
625
+
626
+ $.each( handlers, function( event, handler ) {
627
+ function handlerProxy() {
628
+
629
+ // Allow widgets to customize the disabled handling
630
+ // - disabled as an array instead of boolean
631
+ // - disabled class as method for disabling individual parts
632
+ if ( !suppressDisabledCheck &&
633
+ ( instance.options.disabled === true ||
634
+ $( this ).hasClass( "ui-state-disabled" ) ) ) {
635
+ return;
636
+ }
637
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
638
+ .apply( instance, arguments );
639
+ }
640
+
641
+ // Copy the guid so direct unbinding works
642
+ if ( typeof handler !== "string" ) {
643
+ handlerProxy.guid = handler.guid =
644
+ handler.guid || handlerProxy.guid || $.guid++;
645
+ }
646
+
647
+ var match = event.match( /^([\w:-]*)\s*(.*)$/ );
648
+ var eventName = match[ 1 ] + instance.eventNamespace;
649
+ var selector = match[ 2 ];
650
+
651
+ if ( selector ) {
652
+ delegateElement.on( eventName, selector, handlerProxy );
653
+ } else if ( typeof exports === "object" ) {
654
+ factory( require( "jquery" ) );
655
+ } else {
656
+ element.on( eventName, handlerProxy );
657
+ }
658
+ } );
659
+ },
660
+
661
+ _off: function( element, eventName ) {
662
+ eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
663
+ this.eventNamespace;
664
+ element.off( eventName );
665
+
666
+ // Clear the stack to avoid memory leaks (#10056)
667
+ this.bindings = $( this.bindings.not( element ).get() );
668
+ this.focusable = $( this.focusable.not( element ).get() );
669
+ this.hoverable = $( this.hoverable.not( element ).get() );
670
+ },
671
+
672
+ _delay: function( handler, delay ) {
673
+ function handlerProxy() {
674
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
675
+ .apply( instance, arguments );
676
+ }
677
+ var instance = this;
678
+ return setTimeout( handlerProxy, delay || 0 );
679
+ },
680
+
681
+ _hoverable: function( element ) {
682
+ this.hoverable = this.hoverable.add( element );
683
+ this._on( element, {
684
+ mouseenter: function( event ) {
685
+ this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
686
+ },
687
+ mouseleave: function( event ) {
688
+ this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
689
+ }
690
+ } );
691
+ },
692
+
693
+ _focusable: function( element ) {
694
+ this.focusable = this.focusable.add( element );
695
+ this._on( element, {
696
+ focusin: function( event ) {
697
+ this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
698
+ },
699
+ focusout: function( event ) {
700
+ this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
701
+ }
702
+ } );
703
+ },
704
+
705
+ _trigger: function( type, event, data ) {
706
+ var prop, orig;
707
+ var callback = this.options[ type ];
708
+
709
+ data = data || {};
710
+ event = $.Event( event );
711
+ event.type = ( type === this.widgetEventPrefix ?
712
+ type :
713
+ this.widgetEventPrefix + type ).toLowerCase();
714
+
715
+ // The original event may come from any element
716
+ // so we need to reset the target on the new event
717
+ event.target = this.element[ 0 ];
718
+
719
+ // Copy original event properties over to the new event
720
+ orig = event.originalEvent;
721
+ if ( orig ) {
722
+ for ( prop in orig ) {
723
+ if ( !( prop in event ) ) {
724
+ event[ prop ] = orig[ prop ];
725
+ }
726
+ }
727
+ }
728
+
729
+ this.element.trigger( event, data );
730
+ return !( typeof callback === "function" &&
731
+ callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
732
+ event.isDefaultPrevented() );
733
+ }
734
+ };
735
+
736
+ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
737
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
738
+ if ( typeof options === "string" ) {
739
+ options = { effect: options };
740
+ }
741
+
742
+ var hasOptions;
743
+ var effectName = !options ?
744
+ method :
745
+ options === true || typeof options === "number" ?
746
+ defaultEffect :
747
+ options.effect || defaultEffect;
748
+
749
+ options = options || {};
750
+ if ( typeof options === "number" ) {
751
+ options = { duration: options };
752
+ } else if ( options === true ) {
753
+ options = {};
754
+ }
755
+
756
+ hasOptions = !$.isEmptyObject( options );
757
+ options.complete = callback;
758
+
759
+ if ( options.delay ) {
760
+ element.delay( options.delay );
761
+ }
762
+
763
+ if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
764
+ element[ method ]( options );
765
+ } else if ( effectName !== method && element[ effectName ] ) {
766
+ element[ effectName ]( options.duration, options.easing, callback );
767
+ } else if ( typeof exports === "object" ) {
768
+ factory( require( "jquery" ) );
769
+ } else {
770
+ element.queue( function( next ) {
771
+ $( this )[ method ]();
772
+ if ( callback ) {
773
+ callback.call( element[ 0 ] );
774
+ }
775
+ next();
776
+ } );
777
+ }
778
+ };
779
+ } );
780
+
781
+ return $.widget;
782
+
783
+ } );