@bingads-webui-campaign/accounts-grid 0.0.1-security → 13.6.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of @bingads-webui-campaign/accounts-grid might be problematic. Click here for more details.

Files changed (126) hide show
  1. package/AUTHORS.txt +337 -0
  2. package/LICENSE.txt +20 -0
  3. package/README.md +58 -3
  4. package/bower.json +14 -0
  5. package/dist/jquery.js +10996 -0
  6. package/dist/jquery.min.js +2 -0
  7. package/dist/jquery.min.map +1 -0
  8. package/dist/jquery.slim.js +8894 -0
  9. package/dist/jquery.slim.min.js +2 -0
  10. package/dist/jquery.slim.min.map +1 -0
  11. package/external/sizzle/LICENSE.txt +36 -0
  12. package/external/sizzle/dist/sizzle.js +2542 -0
  13. package/external/sizzle/dist/sizzle.min.js +3 -0
  14. package/external/sizzle/dist/sizzle.min.map +1 -0
  15. package/package.json +139 -3
  16. package/src/ajax/jsonp.js +103 -0
  17. package/src/ajax/load.js +77 -0
  18. package/src/ajax/script.js +74 -0
  19. package/src/ajax/var/location.js +5 -0
  20. package/src/ajax/var/nonce.js +5 -0
  21. package/src/ajax/var/rquery.js +5 -0
  22. package/src/ajax/xhr.js +170 -0
  23. package/src/ajax.js +876 -0
  24. package/src/attributes/attr.js +141 -0
  25. package/src/attributes/classes.js +184 -0
  26. package/src/attributes/prop.js +142 -0
  27. package/src/attributes/support.js +33 -0
  28. package/src/attributes/val.js +191 -0
  29. package/src/attributes.js +13 -0
  30. package/src/callbacks.js +236 -0
  31. package/src/core/DOMEval.js +43 -0
  32. package/src/core/access.js +72 -0
  33. package/src/core/camelCase.js +23 -0
  34. package/src/core/init.js +129 -0
  35. package/src/core/isAttached.js +26 -0
  36. package/src/core/nodeName.js +13 -0
  37. package/src/core/parseHTML.js +65 -0
  38. package/src/core/parseXML.js +35 -0
  39. package/src/core/ready-no-deferred.js +97 -0
  40. package/src/core/ready.js +86 -0
  41. package/src/core/readyException.js +13 -0
  42. package/src/core/stripAndCollapse.js +14 -0
  43. package/src/core/support.js +20 -0
  44. package/src/core/toType.js +20 -0
  45. package/src/core/var/rsingleTag.js +7 -0
  46. package/src/core.js +400 -0
  47. package/src/css/addGetHookIf.js +26 -0
  48. package/src/css/adjustCSS.js +74 -0
  49. package/src/css/curCSS.js +100 -0
  50. package/src/css/finalPropName.js +42 -0
  51. package/src/css/hiddenVisibleSelectors.js +15 -0
  52. package/src/css/showHide.js +105 -0
  53. package/src/css/support.js +152 -0
  54. package/src/css/var/cssExpand.js +5 -0
  55. package/src/css/var/getStyles.js +17 -0
  56. package/src/css/var/isHiddenWithinTree.js +34 -0
  57. package/src/css/var/rboxStyle.js +7 -0
  58. package/src/css/var/rcustomProp.js +7 -0
  59. package/src/css/var/rnumnonpx.js +7 -0
  60. package/src/css/var/swap.js +26 -0
  61. package/src/css.js +495 -0
  62. package/src/data/Data.js +162 -0
  63. package/src/data/var/acceptData.js +19 -0
  64. package/src/data/var/dataPriv.js +7 -0
  65. package/src/data/var/dataUser.js +7 -0
  66. package/src/data.js +180 -0
  67. package/src/deferred/exceptionHook.js +21 -0
  68. package/src/deferred.js +399 -0
  69. package/src/deprecated/ajax-event-alias.js +22 -0
  70. package/src/deprecated/event.js +50 -0
  71. package/src/deprecated.js +89 -0
  72. package/src/dimensions.js +60 -0
  73. package/src/effects/Tween.js +125 -0
  74. package/src/effects/animatedSelector.js +15 -0
  75. package/src/effects.js +702 -0
  76. package/src/event/focusin.js +58 -0
  77. package/src/event/support.js +11 -0
  78. package/src/event/trigger.js +199 -0
  79. package/src/event.js +874 -0
  80. package/src/exports/amd.js +26 -0
  81. package/src/exports/global.js +34 -0
  82. package/src/jquery.js +41 -0
  83. package/src/manipulation/_evalUrl.js +32 -0
  84. package/src/manipulation/buildFragment.js +106 -0
  85. package/src/manipulation/getAll.js +32 -0
  86. package/src/manipulation/setGlobalEval.js +22 -0
  87. package/src/manipulation/support.js +41 -0
  88. package/src/manipulation/var/rscriptType.js +5 -0
  89. package/src/manipulation/var/rtagName.js +8 -0
  90. package/src/manipulation/wrapMap.js +30 -0
  91. package/src/manipulation.js +487 -0
  92. package/src/offset.js +232 -0
  93. package/src/queue/delay.js +23 -0
  94. package/src/queue.js +145 -0
  95. package/src/selector-native.js +240 -0
  96. package/src/selector-sizzle.js +19 -0
  97. package/src/selector.js +3 -0
  98. package/src/serialize.js +134 -0
  99. package/src/traversing/findFilter.js +97 -0
  100. package/src/traversing/var/dir.js +22 -0
  101. package/src/traversing/var/rneedsContext.js +8 -0
  102. package/src/traversing/var/siblings.js +17 -0
  103. package/src/traversing.js +198 -0
  104. package/src/var/ObjectFunctionString.js +7 -0
  105. package/src/var/arr.js +5 -0
  106. package/src/var/class2type.js +6 -0
  107. package/src/var/document.js +5 -0
  108. package/src/var/documentElement.js +7 -0
  109. package/src/var/flat.js +16 -0
  110. package/src/var/fnToString.js +7 -0
  111. package/src/var/getProto.js +5 -0
  112. package/src/var/hasOwn.js +7 -0
  113. package/src/var/indexOf.js +7 -0
  114. package/src/var/isFunction.js +17 -0
  115. package/src/var/isWindow.js +8 -0
  116. package/src/var/pnum.js +5 -0
  117. package/src/var/push.js +7 -0
  118. package/src/var/rcheckableType.js +5 -0
  119. package/src/var/rcssNum.js +9 -0
  120. package/src/var/rnothtmlwhite.js +8 -0
  121. package/src/var/rtrimCSS.js +12 -0
  122. package/src/var/slice.js +7 -0
  123. package/src/var/support.js +6 -0
  124. package/src/var/toString.js +7 -0
  125. package/src/var/whitespace.js +8 -0
  126. package/src/wrap.js +78 -0
@@ -0,0 +1,487 @@
1
+ define( [
2
+ "./core",
3
+ "./core/isAttached",
4
+ "./var/flat",
5
+ "./var/isFunction",
6
+ "./var/push",
7
+ "./var/rcheckableType",
8
+ "./core/access",
9
+ "./manipulation/var/rtagName",
10
+ "./manipulation/var/rscriptType",
11
+ "./manipulation/wrapMap",
12
+ "./manipulation/getAll",
13
+ "./manipulation/setGlobalEval",
14
+ "./manipulation/buildFragment",
15
+ "./manipulation/support",
16
+
17
+ "./data/var/dataPriv",
18
+ "./data/var/dataUser",
19
+ "./data/var/acceptData",
20
+ "./core/DOMEval",
21
+ "./core/nodeName",
22
+
23
+ "./core/init",
24
+ "./traversing",
25
+ "./selector",
26
+ "./event"
27
+ ], function( jQuery, isAttached, flat, isFunction, push, rcheckableType,
28
+ access, rtagName, rscriptType,
29
+ wrapMap, getAll, setGlobalEval, buildFragment, support,
30
+ dataPriv, dataUser, acceptData, DOMEval, nodeName ) {
31
+
32
+ "use strict";
33
+
34
+ var
35
+
36
+ // Support: IE <=10 - 11, Edge 12 - 13 only
37
+ // In IE/Edge using regex groups here causes severe slowdowns.
38
+ // See https://connect.microsoft.com/IE/feedback/details/1736512/
39
+ rnoInnerhtml = /<script|<style|<link/i,
40
+
41
+ // checked="checked" or checked
42
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
43
+
44
+ rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
45
+
46
+ // Prefer a tbody over its parent table for containing new rows
47
+ function manipulationTarget( elem, content ) {
48
+ if ( nodeName( elem, "table" ) &&
49
+ nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
50
+
51
+ return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
52
+ }
53
+
54
+ return elem;
55
+ }
56
+
57
+ // Replace/restore the type attribute of script elements for safe DOM manipulation
58
+ function disableScript( elem ) {
59
+ elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
60
+ return elem;
61
+ }
62
+ function restoreScript( elem ) {
63
+ if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
64
+ elem.type = elem.type.slice( 5 );
65
+ } else {
66
+ elem.removeAttribute( "type" );
67
+ }
68
+
69
+ return elem;
70
+ }
71
+
72
+ function cloneCopyEvent( src, dest ) {
73
+ var i, l, type, pdataOld, udataOld, udataCur, events;
74
+
75
+ if ( dest.nodeType !== 1 ) {
76
+ return;
77
+ }
78
+
79
+ // 1. Copy private data: events, handlers, etc.
80
+ if ( dataPriv.hasData( src ) ) {
81
+ pdataOld = dataPriv.get( src );
82
+ events = pdataOld.events;
83
+
84
+ if ( events ) {
85
+ dataPriv.remove( dest, "handle events" );
86
+
87
+ for ( type in events ) {
88
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
89
+ jQuery.event.add( dest, type, events[ type ][ i ] );
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ // 2. Copy user data
96
+ if ( dataUser.hasData( src ) ) {
97
+ udataOld = dataUser.access( src );
98
+ udataCur = jQuery.extend( {}, udataOld );
99
+
100
+ dataUser.set( dest, udataCur );
101
+ }
102
+ }
103
+
104
+ // Fix IE bugs, see support tests
105
+ function fixInput( src, dest ) {
106
+ var nodeName = dest.nodeName.toLowerCase();
107
+
108
+ // Fails to persist the checked state of a cloned checkbox or radio button.
109
+ if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
110
+ dest.checked = src.checked;
111
+
112
+ // Fails to return the selected option to the default selected state when cloning options
113
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
114
+ dest.defaultValue = src.defaultValue;
115
+ }
116
+ }
117
+
118
+ function domManip( collection, args, callback, ignored ) {
119
+
120
+ // Flatten any nested arrays
121
+ args = flat( args );
122
+
123
+ var fragment, first, scripts, hasScripts, node, doc,
124
+ i = 0,
125
+ l = collection.length,
126
+ iNoClone = l - 1,
127
+ value = args[ 0 ],
128
+ valueIsFunction = isFunction( value );
129
+
130
+ // We can't cloneNode fragments that contain checked, in WebKit
131
+ if ( valueIsFunction ||
132
+ ( l > 1 && typeof value === "string" &&
133
+ !support.checkClone && rchecked.test( value ) ) ) {
134
+ return collection.each( function( index ) {
135
+ var self = collection.eq( index );
136
+ if ( valueIsFunction ) {
137
+ args[ 0 ] = value.call( this, index, self.html() );
138
+ }
139
+ domManip( self, args, callback, ignored );
140
+ } );
141
+ }
142
+
143
+ if ( l ) {
144
+ fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
145
+ first = fragment.firstChild;
146
+
147
+ if ( fragment.childNodes.length === 1 ) {
148
+ fragment = first;
149
+ }
150
+
151
+ // Require either new content or an interest in ignored elements to invoke the callback
152
+ if ( first || ignored ) {
153
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
154
+ hasScripts = scripts.length;
155
+
156
+ // Use the original fragment for the last item
157
+ // instead of the first because it can end up
158
+ // being emptied incorrectly in certain situations (trac-8070).
159
+ for ( ; i < l; i++ ) {
160
+ node = fragment;
161
+
162
+ if ( i !== iNoClone ) {
163
+ node = jQuery.clone( node, true, true );
164
+
165
+ // Keep references to cloned scripts for later restoration
166
+ if ( hasScripts ) {
167
+
168
+ // Support: Android <=4.0 only, PhantomJS 1 only
169
+ // push.apply(_, arraylike) throws on ancient WebKit
170
+ jQuery.merge( scripts, getAll( node, "script" ) );
171
+ }
172
+ }
173
+
174
+ callback.call( collection[ i ], node, i );
175
+ }
176
+
177
+ if ( hasScripts ) {
178
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
179
+
180
+ // Reenable scripts
181
+ jQuery.map( scripts, restoreScript );
182
+
183
+ // Evaluate executable scripts on first document insertion
184
+ for ( i = 0; i < hasScripts; i++ ) {
185
+ node = scripts[ i ];
186
+ if ( rscriptType.test( node.type || "" ) &&
187
+ !dataPriv.access( node, "globalEval" ) &&
188
+ jQuery.contains( doc, node ) ) {
189
+
190
+ if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
191
+
192
+ // Optional AJAX dependency, but won't run scripts if not present
193
+ if ( jQuery._evalUrl && !node.noModule ) {
194
+ jQuery._evalUrl( node.src, {
195
+ nonce: node.nonce || node.getAttribute( "nonce" )
196
+ }, doc );
197
+ }
198
+ } else {
199
+
200
+ // Unwrap a CDATA section containing script contents. This shouldn't be
201
+ // needed as in XML documents they're already not visible when
202
+ // inspecting element contents and in HTML documents they have no
203
+ // meaning but we're preserving that logic for backwards compatibility.
204
+ // This will be removed completely in 4.0. See gh-4904.
205
+ DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }
212
+
213
+ return collection;
214
+ }
215
+
216
+ function remove( elem, selector, keepData ) {
217
+ var node,
218
+ nodes = selector ? jQuery.filter( selector, elem ) : elem,
219
+ i = 0;
220
+
221
+ for ( ; ( node = nodes[ i ] ) != null; i++ ) {
222
+ if ( !keepData && node.nodeType === 1 ) {
223
+ jQuery.cleanData( getAll( node ) );
224
+ }
225
+
226
+ if ( node.parentNode ) {
227
+ if ( keepData && isAttached( node ) ) {
228
+ setGlobalEval( getAll( node, "script" ) );
229
+ }
230
+ node.parentNode.removeChild( node );
231
+ }
232
+ }
233
+
234
+ return elem;
235
+ }
236
+
237
+ jQuery.extend( {
238
+ htmlPrefilter: function( html ) {
239
+ return html;
240
+ },
241
+
242
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
243
+ var i, l, srcElements, destElements,
244
+ clone = elem.cloneNode( true ),
245
+ inPage = isAttached( elem );
246
+
247
+ // Fix IE cloning issues
248
+ if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
249
+ !jQuery.isXMLDoc( elem ) ) {
250
+
251
+ // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
252
+ destElements = getAll( clone );
253
+ srcElements = getAll( elem );
254
+
255
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
256
+ fixInput( srcElements[ i ], destElements[ i ] );
257
+ }
258
+ }
259
+
260
+ // Copy the events from the original to the clone
261
+ if ( dataAndEvents ) {
262
+ if ( deepDataAndEvents ) {
263
+ srcElements = srcElements || getAll( elem );
264
+ destElements = destElements || getAll( clone );
265
+
266
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
267
+ cloneCopyEvent( srcElements[ i ], destElements[ i ] );
268
+ }
269
+ } else {
270
+ cloneCopyEvent( elem, clone );
271
+ }
272
+ }
273
+
274
+ // Preserve script evaluation history
275
+ destElements = getAll( clone, "script" );
276
+ if ( destElements.length > 0 ) {
277
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
278
+ }
279
+
280
+ // Return the cloned set
281
+ return clone;
282
+ },
283
+
284
+ cleanData: function( elems ) {
285
+ var data, elem, type,
286
+ special = jQuery.event.special,
287
+ i = 0;
288
+
289
+ for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
290
+ if ( acceptData( elem ) ) {
291
+ if ( ( data = elem[ dataPriv.expando ] ) ) {
292
+ if ( data.events ) {
293
+ for ( type in data.events ) {
294
+ if ( special[ type ] ) {
295
+ jQuery.event.remove( elem, type );
296
+
297
+ // This is a shortcut to avoid jQuery.event.remove's overhead
298
+ } else {
299
+ jQuery.removeEvent( elem, type, data.handle );
300
+ }
301
+ }
302
+ }
303
+
304
+ // Support: Chrome <=35 - 45+
305
+ // Assign undefined instead of using delete, see Data#remove
306
+ elem[ dataPriv.expando ] = undefined;
307
+ }
308
+ if ( elem[ dataUser.expando ] ) {
309
+
310
+ // Support: Chrome <=35 - 45+
311
+ // Assign undefined instead of using delete, see Data#remove
312
+ elem[ dataUser.expando ] = undefined;
313
+ }
314
+ }
315
+ }
316
+ }
317
+ } );
318
+
319
+ jQuery.fn.extend( {
320
+ detach: function( selector ) {
321
+ return remove( this, selector, true );
322
+ },
323
+
324
+ remove: function( selector ) {
325
+ return remove( this, selector );
326
+ },
327
+
328
+ text: function( value ) {
329
+ return access( this, function( value ) {
330
+ return value === undefined ?
331
+ jQuery.text( this ) :
332
+ this.empty().each( function() {
333
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
334
+ this.textContent = value;
335
+ }
336
+ } );
337
+ }, null, value, arguments.length );
338
+ },
339
+
340
+ append: function() {
341
+ return domManip( this, arguments, function( elem ) {
342
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
343
+ var target = manipulationTarget( this, elem );
344
+ target.appendChild( elem );
345
+ }
346
+ } );
347
+ },
348
+
349
+ prepend: function() {
350
+ return domManip( this, arguments, function( elem ) {
351
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
352
+ var target = manipulationTarget( this, elem );
353
+ target.insertBefore( elem, target.firstChild );
354
+ }
355
+ } );
356
+ },
357
+
358
+ before: function() {
359
+ return domManip( this, arguments, function( elem ) {
360
+ if ( this.parentNode ) {
361
+ this.parentNode.insertBefore( elem, this );
362
+ }
363
+ } );
364
+ },
365
+
366
+ after: function() {
367
+ return domManip( this, arguments, function( elem ) {
368
+ if ( this.parentNode ) {
369
+ this.parentNode.insertBefore( elem, this.nextSibling );
370
+ }
371
+ } );
372
+ },
373
+
374
+ empty: function() {
375
+ var elem,
376
+ i = 0;
377
+
378
+ for ( ; ( elem = this[ i ] ) != null; i++ ) {
379
+ if ( elem.nodeType === 1 ) {
380
+
381
+ // Prevent memory leaks
382
+ jQuery.cleanData( getAll( elem, false ) );
383
+
384
+ // Remove any remaining nodes
385
+ elem.textContent = "";
386
+ }
387
+ }
388
+
389
+ return this;
390
+ },
391
+
392
+ clone: function( dataAndEvents, deepDataAndEvents ) {
393
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
394
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
395
+
396
+ return this.map( function() {
397
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
398
+ } );
399
+ },
400
+
401
+ html: function( value ) {
402
+ return access( this, function( value ) {
403
+ var elem = this[ 0 ] || {},
404
+ i = 0,
405
+ l = this.length;
406
+
407
+ if ( value === undefined && elem.nodeType === 1 ) {
408
+ return elem.innerHTML;
409
+ }
410
+
411
+ // See if we can take a shortcut and just use innerHTML
412
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
413
+ !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
414
+
415
+ value = jQuery.htmlPrefilter( value );
416
+
417
+ try {
418
+ for ( ; i < l; i++ ) {
419
+ elem = this[ i ] || {};
420
+
421
+ // Remove element nodes and prevent memory leaks
422
+ if ( elem.nodeType === 1 ) {
423
+ jQuery.cleanData( getAll( elem, false ) );
424
+ elem.innerHTML = value;
425
+ }
426
+ }
427
+
428
+ elem = 0;
429
+
430
+ // If using innerHTML throws an exception, use the fallback method
431
+ } catch ( e ) {}
432
+ }
433
+
434
+ if ( elem ) {
435
+ this.empty().append( value );
436
+ }
437
+ }, null, value, arguments.length );
438
+ },
439
+
440
+ replaceWith: function() {
441
+ var ignored = [];
442
+
443
+ // Make the changes, replacing each non-ignored context element with the new content
444
+ return domManip( this, arguments, function( elem ) {
445
+ var parent = this.parentNode;
446
+
447
+ if ( jQuery.inArray( this, ignored ) < 0 ) {
448
+ jQuery.cleanData( getAll( this ) );
449
+ if ( parent ) {
450
+ parent.replaceChild( elem, this );
451
+ }
452
+ }
453
+
454
+ // Force callback invocation
455
+ }, ignored );
456
+ }
457
+ } );
458
+
459
+ jQuery.each( {
460
+ appendTo: "append",
461
+ prependTo: "prepend",
462
+ insertBefore: "before",
463
+ insertAfter: "after",
464
+ replaceAll: "replaceWith"
465
+ }, function( name, original ) {
466
+ jQuery.fn[ name ] = function( selector ) {
467
+ var elems,
468
+ ret = [],
469
+ insert = jQuery( selector ),
470
+ last = insert.length - 1,
471
+ i = 0;
472
+
473
+ for ( ; i <= last; i++ ) {
474
+ elems = i === last ? this : this.clone( true );
475
+ jQuery( insert[ i ] )[ original ]( elems );
476
+
477
+ // Support: Android <=4.0 only, PhantomJS 1 only
478
+ // .get() because push.apply(_, arraylike) throws on ancient WebKit
479
+ push.apply( ret, elems.get() );
480
+ }
481
+
482
+ return this.pushStack( ret );
483
+ };
484
+ } );
485
+
486
+ return jQuery;
487
+ } );
package/src/offset.js ADDED
@@ -0,0 +1,232 @@
1
+ define( [
2
+ "./core",
3
+ "./core/access",
4
+ "./var/documentElement",
5
+ "./var/isFunction",
6
+ "./css/var/rnumnonpx",
7
+ "./css/curCSS",
8
+ "./css/addGetHookIf",
9
+ "./css/support",
10
+ "./var/isWindow",
11
+ "./core/init",
12
+ "./css",
13
+ "./selector" // contains
14
+ ], function( jQuery, access, documentElement, isFunction, rnumnonpx,
15
+ curCSS, addGetHookIf, support, isWindow ) {
16
+
17
+ "use strict";
18
+
19
+ jQuery.offset = {
20
+ setOffset: function( elem, options, i ) {
21
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
22
+ position = jQuery.css( elem, "position" ),
23
+ curElem = jQuery( elem ),
24
+ props = {};
25
+
26
+ // Set position first, in-case top/left are set even on static elem
27
+ if ( position === "static" ) {
28
+ elem.style.position = "relative";
29
+ }
30
+
31
+ curOffset = curElem.offset();
32
+ curCSSTop = jQuery.css( elem, "top" );
33
+ curCSSLeft = jQuery.css( elem, "left" );
34
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&
35
+ ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
36
+
37
+ // Need to be able to calculate position if either
38
+ // top or left is auto and position is either absolute or fixed
39
+ if ( calculatePosition ) {
40
+ curPosition = curElem.position();
41
+ curTop = curPosition.top;
42
+ curLeft = curPosition.left;
43
+
44
+ } else {
45
+ curTop = parseFloat( curCSSTop ) || 0;
46
+ curLeft = parseFloat( curCSSLeft ) || 0;
47
+ }
48
+
49
+ if ( isFunction( options ) ) {
50
+
51
+ // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
52
+ options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
53
+ }
54
+
55
+ if ( options.top != null ) {
56
+ props.top = ( options.top - curOffset.top ) + curTop;
57
+ }
58
+ if ( options.left != null ) {
59
+ props.left = ( options.left - curOffset.left ) + curLeft;
60
+ }
61
+
62
+ if ( "using" in options ) {
63
+ options.using.call( elem, props );
64
+
65
+ } else {
66
+ curElem.css( props );
67
+ }
68
+ }
69
+ };
70
+
71
+ jQuery.fn.extend( {
72
+
73
+ // offset() relates an element's border box to the document origin
74
+ offset: function( options ) {
75
+
76
+ // Preserve chaining for setter
77
+ if ( arguments.length ) {
78
+ return options === undefined ?
79
+ this :
80
+ this.each( function( i ) {
81
+ jQuery.offset.setOffset( this, options, i );
82
+ } );
83
+ }
84
+
85
+ var rect, win,
86
+ elem = this[ 0 ];
87
+
88
+ if ( !elem ) {
89
+ return;
90
+ }
91
+
92
+ // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
93
+ // Support: IE <=11 only
94
+ // Running getBoundingClientRect on a
95
+ // disconnected node in IE throws an error
96
+ if ( !elem.getClientRects().length ) {
97
+ return { top: 0, left: 0 };
98
+ }
99
+
100
+ // Get document-relative position by adding viewport scroll to viewport-relative gBCR
101
+ rect = elem.getBoundingClientRect();
102
+ win = elem.ownerDocument.defaultView;
103
+ return {
104
+ top: rect.top + win.pageYOffset,
105
+ left: rect.left + win.pageXOffset
106
+ };
107
+ },
108
+
109
+ // position() relates an element's margin box to its offset parent's padding box
110
+ // This corresponds to the behavior of CSS absolute positioning
111
+ position: function() {
112
+ if ( !this[ 0 ] ) {
113
+ return;
114
+ }
115
+
116
+ var offsetParent, offset, doc,
117
+ elem = this[ 0 ],
118
+ parentOffset = { top: 0, left: 0 };
119
+
120
+ // position:fixed elements are offset from the viewport, which itself always has zero offset
121
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
122
+
123
+ // Assume position:fixed implies availability of getBoundingClientRect
124
+ offset = elem.getBoundingClientRect();
125
+
126
+ } else {
127
+ offset = this.offset();
128
+
129
+ // Account for the *real* offset parent, which can be the document or its root element
130
+ // when a statically positioned element is identified
131
+ doc = elem.ownerDocument;
132
+ offsetParent = elem.offsetParent || doc.documentElement;
133
+ while ( offsetParent &&
134
+ ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
135
+ jQuery.css( offsetParent, "position" ) === "static" ) {
136
+
137
+ offsetParent = offsetParent.parentNode;
138
+ }
139
+ if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
140
+
141
+ // Incorporate borders into its offset, since they are outside its content origin
142
+ parentOffset = jQuery( offsetParent ).offset();
143
+ parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
144
+ parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
145
+ }
146
+ }
147
+
148
+ // Subtract parent offsets and element margins
149
+ return {
150
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
151
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
152
+ };
153
+ },
154
+
155
+ // This method will return documentElement in the following cases:
156
+ // 1) For the element inside the iframe without offsetParent, this method will return
157
+ // documentElement of the parent window
158
+ // 2) For the hidden or detached element
159
+ // 3) For body or html element, i.e. in case of the html node - it will return itself
160
+ //
161
+ // but those exceptions were never presented as a real life use-cases
162
+ // and might be considered as more preferable results.
163
+ //
164
+ // This logic, however, is not guaranteed and can change at any point in the future
165
+ offsetParent: function() {
166
+ return this.map( function() {
167
+ var offsetParent = this.offsetParent;
168
+
169
+ while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
170
+ offsetParent = offsetParent.offsetParent;
171
+ }
172
+
173
+ return offsetParent || documentElement;
174
+ } );
175
+ }
176
+ } );
177
+
178
+ // Create scrollLeft and scrollTop methods
179
+ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
180
+ var top = "pageYOffset" === prop;
181
+
182
+ jQuery.fn[ method ] = function( val ) {
183
+ return access( this, function( elem, method, val ) {
184
+
185
+ // Coalesce documents and windows
186
+ var win;
187
+ if ( isWindow( elem ) ) {
188
+ win = elem;
189
+ } else if ( elem.nodeType === 9 ) {
190
+ win = elem.defaultView;
191
+ }
192
+
193
+ if ( val === undefined ) {
194
+ return win ? win[ prop ] : elem[ method ];
195
+ }
196
+
197
+ if ( win ) {
198
+ win.scrollTo(
199
+ !top ? val : win.pageXOffset,
200
+ top ? val : win.pageYOffset
201
+ );
202
+
203
+ } else {
204
+ elem[ method ] = val;
205
+ }
206
+ }, method, val, arguments.length );
207
+ };
208
+ } );
209
+
210
+ // Support: Safari <=7 - 9.1, Chrome <=37 - 49
211
+ // Add the top/left cssHooks using jQuery.fn.position
212
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
213
+ // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
214
+ // getComputedStyle returns percent when specified for top/left/bottom/right;
215
+ // rather than make the css module depend on the offset module, just check for it here
216
+ jQuery.each( [ "top", "left" ], function( _i, prop ) {
217
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
218
+ function( elem, computed ) {
219
+ if ( computed ) {
220
+ computed = curCSS( elem, prop );
221
+
222
+ // If curCSS returns percentage, fallback to offset
223
+ return rnumnonpx.test( computed ) ?
224
+ jQuery( elem ).position()[ prop ] + "px" :
225
+ computed;
226
+ }
227
+ }
228
+ );
229
+ } );
230
+
231
+ return jQuery;
232
+ } );